diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-07-24 21:52:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 21:52:11 +0200 |
commit | b92c4323131e617077129d755f9d1032e5873bd4 (patch) | |
tree | 40b4b0a4636b96ee08a51fd0cabd9737f96912e2 /modules | |
parent | 15c6adcd5b023ad75cf119f847d28cc4d8a78ed5 (diff) | |
parent | 8ff747171f019aa1004db2a6aa37eb51ae932928 (diff) |
Merge pull request #19225 from Paulb23/open_all_files_in_script_editor
Open all files in script editor
Diffstat (limited to 'modules')
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 25 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.h | 4 |
2 files changed, 14 insertions, 15 deletions
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 873cc293c9..cad6128eca 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1962,22 +1962,16 @@ void VisualScriptEditor::_button_resource_previewed(const String &p_path, const void VisualScriptEditor::apply_code() { } -Ref<Script> VisualScriptEditor::get_edited_script() const { - +RES VisualScriptEditor::get_edited_resource() const { return script; } -Vector<String> VisualScriptEditor::get_functions() { - - return Vector<String>(); -} - -void VisualScriptEditor::set_edited_script(const Ref<Script> &p_script) { +void VisualScriptEditor::set_edited_resource(const RES &p_res) { - script = p_script; - signal_editor->script = p_script; + script = p_res; + signal_editor->script = script; signal_editor->undo_redo = undo_redo; - variable_editor->script = p_script; + variable_editor->script = script; variable_editor->undo_redo = undo_redo; script->connect("node_ports_changed", this, "_node_ports_changed"); @@ -1986,6 +1980,11 @@ void VisualScriptEditor::set_edited_script(const Ref<Script> &p_script) { _update_available_nodes(); } +Vector<String> VisualScriptEditor::get_functions() { + + return Vector<String>(); +} + void VisualScriptEditor::reload_text() { } @@ -3515,9 +3514,9 @@ VisualScriptEditor::~VisualScriptEditor() { memdelete(variable_editor); } -static ScriptEditorBase *create_editor(const Ref<Script> &p_script) { +static ScriptEditorBase *create_editor(const RES &p_resource) { - if (Object::cast_to<VisualScript>(*p_script)) { + if (Object::cast_to<VisualScript>(*p_resource)) { return memnew(VisualScriptEditor); } diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 0bd64d6a1d..843afa8f3c 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -250,9 +250,9 @@ public: virtual void set_syntax_highlighter(SyntaxHighlighter *p_highlighter); virtual void apply_code(); - virtual Ref<Script> get_edited_script() const; + virtual RES get_edited_resource() const; + virtual void set_edited_resource(const RES &p_res); virtual Vector<String> get_functions(); - virtual void set_edited_script(const Ref<Script> &p_script); virtual void reload_text(); virtual String get_name(); virtual Ref<Texture> get_icon(); |