From fab66af7e99eb71ea6a2df30bea46835f749896a Mon Sep 17 00:00:00 2001 From: Geequlim Date: Thu, 16 Nov 2017 17:18:36 +0800 Subject: Move the remote scene tree to the scene tree dock. Ignore all script constants in the global section of the breakpoint stack. Check property size before send to avoid too large of data be sent. Fix crash while clear the remote objects from the debugger. --- modules/gdscript/gdscript_editor.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'modules/gdscript/gdscript_editor.cpp') diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index de7adc7e4a..5a76acea6e 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -33,7 +33,7 @@ #include "gdscript_compiler.h" #include "global_constants.h" #include "os/file_access.h" -#include "project_settings.h" +#include "core/engine.h" #ifdef TOOLS_ENABLED #include "editor/editor_file_system.h" @@ -287,7 +287,7 @@ ScriptInstance *GDScriptLanguage::debug_get_stack_level_instance(int p_level) { ERR_FAIL_INDEX_V(p_level, _debug_call_stack_pos, NULL); int l = _debug_call_stack_pos - p_level - 1; - GDInstance *instance = _call_stack[l].instance; + ScriptInstance *instance = _call_stack[l].instance; return instance; } @@ -297,14 +297,27 @@ void GDScriptLanguage::debug_get_globals(List *p_globals, List const Map &name_idx = GDScriptLanguage::get_singleton()->get_global_map(); const Variant *globals = GDScriptLanguage::get_singleton()->get_global_array(); + List > cinfo; + get_public_constants(&cinfo); + for (const Map::Element *E = name_idx.front(); E; E = E->next()) { - if (ClassDB::class_exists(E->key()) || ProjectSettings::get_singleton()->has_singleton(E->key()) || E->key() == "PI" || E->key() == "INF" || E->key() == "NAN") + if (ClassDB::class_exists(E->key()) || Engine::get_singleton()->has_singleton(E->key())) + continue; + + bool is_script_constant = false; + for (List >::Element *CE = cinfo.front(); CE; CE = CE->next()) { + if (CE->get().first == E->key()) { + is_script_constant = true; + break; + } + } + if (is_script_constant) continue; const Variant &var = globals[E->value()]; if (Object *obj = var) { - if (Object::cast_to(obj)) + if (Object::cast_to(obj)) continue; } -- cgit v1.2.3