Skip to content

Commit

Permalink
fixes godotengine#10946, auto-reload with external editor
Browse files Browse the repository at this point in the history
  • Loading branch information
yjh0502 committed Aug 16, 2021
1 parent 66497e2 commit 09582bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions editor/plugins/script_text_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,10 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo
script->update_exports();
}
}

if (auto_reload_running_scripts) {
_live_auto_reload_running_scripts();
}
}

void ScriptTextEditor::_code_complete_scripts(void *p_ud, const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_force) {
Expand Down
4 changes: 2 additions & 2 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ RES ResourceFormatLoaderGDScript::load(const String &p_path, const String &p_ori

if (p_path.ends_with(".gde") || p_path.ends_with(".gdc")) {
script->set_script_path(p_original_path); // script needs this.
script->set_path(p_original_path);
script->set_path(p_original_path, true);
Error err = script->load_byte_code(p_path);
ERR_FAIL_COND_V_MSG(err != OK, RES(), "Cannot load byte code from file '" + p_path + "'.");

Expand All @@ -2177,7 +2177,7 @@ RES ResourceFormatLoaderGDScript::load(const String &p_path, const String &p_ori
ERR_FAIL_COND_V_MSG(err != OK, RES(), "Cannot load source code from file '" + p_path + "'.");

script->set_script_path(p_original_path); // script needs this.
script->set_path(p_original_path);
script->set_path(p_original_path, true);

script->reload();
}
Expand Down

0 comments on commit 09582bb

Please sign in to comment.