You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Expose the EditorScriptHighlighter::_create() method to GDExtension
This commit is contained in:
@@ -10,6 +10,12 @@
|
|||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
<methods>
|
<methods>
|
||||||
|
<method name="_create" qualifiers="virtual const">
|
||||||
|
<return type="EditorSyntaxHighlighter" />
|
||||||
|
<description>
|
||||||
|
Virtual method which creates a new instance of the syntax highlighter.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="_get_name" qualifiers="virtual const">
|
<method name="_get_name" qualifiers="virtual const">
|
||||||
<return type="String" />
|
<return type="String" />
|
||||||
<description>
|
<description>
|
||||||
|
|||||||
@@ -86,10 +86,14 @@ PackedStringArray EditorSyntaxHighlighter::_get_supported_languages() const {
|
|||||||
|
|
||||||
Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const {
|
Ref<EditorSyntaxHighlighter> EditorSyntaxHighlighter::_create() const {
|
||||||
Ref<EditorSyntaxHighlighter> syntax_highlighter;
|
Ref<EditorSyntaxHighlighter> syntax_highlighter;
|
||||||
|
if (GDVIRTUAL_IS_OVERRIDDEN(_create)) {
|
||||||
|
GDVIRTUAL_CALL(_create, syntax_highlighter);
|
||||||
|
} else {
|
||||||
syntax_highlighter.instantiate();
|
syntax_highlighter.instantiate();
|
||||||
if (get_script_instance()) {
|
if (get_script_instance()) {
|
||||||
syntax_highlighter->set_script(get_script_instance()->get_script());
|
syntax_highlighter->set_script(get_script_instance()->get_script());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return syntax_highlighter;
|
return syntax_highlighter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +102,7 @@ void EditorSyntaxHighlighter::_bind_methods() {
|
|||||||
|
|
||||||
GDVIRTUAL_BIND(_get_name)
|
GDVIRTUAL_BIND(_get_name)
|
||||||
GDVIRTUAL_BIND(_get_supported_languages)
|
GDVIRTUAL_BIND(_get_supported_languages)
|
||||||
|
GDVIRTUAL_BIND(_create)
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ protected:
|
|||||||
|
|
||||||
GDVIRTUAL0RC(String, _get_name)
|
GDVIRTUAL0RC(String, _get_name)
|
||||||
GDVIRTUAL0RC(PackedStringArray, _get_supported_languages)
|
GDVIRTUAL0RC(PackedStringArray, _get_supported_languages)
|
||||||
|
GDVIRTUAL0RC(Ref<EditorSyntaxHighlighter>, _create)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual String _get_name() const;
|
virtual String _get_name() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user