diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-20 12:55:46 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-20 12:55:46 -0300 |
commit | 541fdffc0ab2115238fe9cedbf1c088b15f11fdf (patch) | |
tree | 187c5d0278e5075907fef8a86b4d00d6a0b7161a /modules | |
parent | 831e21e89ba0275b43b6a351e538256b8ce715a3 (diff) | |
parent | 90b8a5b71ef79e0339826507c4b290f0c51b7cd2 (diff) |
Merge pull request #10319 from neikeq/pr-engine-editor-hint
Adds Engine::is_editor_hint() method
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdnative/gdnative.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gd_editor.cpp | 3 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_func_nodes.cpp | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index 440cc45479..fc4fc5c10d 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -229,7 +229,7 @@ bool GDNative::initialize() { godot_gdnative_init_options options; - options.in_editor = SceneTree::get_singleton()->is_editor_hint(); + options.in_editor = Engine::get_singleton()->is_editor_hint(); options.core_api_hash = ClassDB::get_api_hash(ClassDB::API_CORE); options.editor_api_hash = ClassDB::get_api_hash(ClassDB::API_EDITOR); options.no_api_hash = ClassDB::get_api_hash(ClassDB::API_NONE); @@ -265,7 +265,7 @@ bool GDNative::terminate() { // TODO(karroffel): remove this? Should be part of NativeScript, not // GDNative IMO godot_gdnative_terminate_options options; - options.in_editor = SceneTree::get_singleton()->is_editor_hint(); + options.in_editor = Engine::get_singleton()->is_editor_hint(); library_terminate_pointer(&options); diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index f8b45af85a..3fa0a38024 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -35,6 +35,7 @@ #ifdef TOOLS_ENABLED #include "editor/editor_file_system.h" #include "editor/editor_settings.h" +#include "engine.h" #endif void GDScriptLanguage::get_comment_delimiters(List<String> *p_delimiters) const { @@ -2371,7 +2372,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base String GDScriptLanguage::_get_indentation() const { #ifdef TOOLS_ENABLED - if (SceneTree::get_singleton()->is_editor_hint()) { + if (Engine::get_singleton()->is_editor_hint()) { bool use_space_indentation = EDITOR_DEF("text_editor/indent/type", 0); if (use_space_indentation) { diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 8cbfb8f3fd..b4bdbe16b4 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -273,7 +273,7 @@ void VisualScript::_node_ports_changed(int p_id) { Function &func = functions[function]; Ref<VisualScriptNode> vsn = func.nodes[p_id].node; - if (OS::get_singleton()->get_main_loop() && OS::get_singleton()->get_main_loop()->cast_to<SceneTree>() && OS::get_singleton()->get_main_loop()->cast_to<SceneTree>()->is_editor_hint()) { + if (OS::get_singleton()->get_main_loop() && OS::get_singleton()->get_main_loop()->cast_to<SceneTree>() && Engine::get_singleton()->is_editor_hint()) { vsn->validate_input_default_values(); //force validate default values when editing on editor } diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index afdf50027e..e94bb8fba5 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -1164,7 +1164,7 @@ void VisualScriptPropertySet::_update_cache() { if (!OS::get_singleton()->get_main_loop()->cast_to<SceneTree>()) return; - if (!OS::get_singleton()->get_main_loop()->cast_to<SceneTree>()->is_editor_hint()) //only update cache if editor exists, it's pointless otherwise + if (!Engine::get_singleton()->is_editor_hint()) //only update cache if editor exists, it's pointless otherwise return; if (call_mode == CALL_MODE_BASIC_TYPE) { |