diff options
Diffstat (limited to 'modules/visual_script')
-rw-r--r-- | modules/visual_script/icons/VisualScript.svg (renamed from modules/visual_script/icons/icon_visual_script.svg) | 0 | ||||
-rw-r--r-- | modules/visual_script/visual_script.cpp | 30 | ||||
-rw-r--r-- | modules/visual_script/visual_script.h | 14 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_property_selector.cpp | 2 |
5 files changed, 25 insertions, 23 deletions
diff --git a/modules/visual_script/icons/icon_visual_script.svg b/modules/visual_script/icons/VisualScript.svg index f6475d590e..f6475d590e 100644 --- a/modules/visual_script/icons/icon_visual_script.svg +++ b/modules/visual_script/icons/VisualScript.svg diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 471f43cadd..050fdbcb07 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1629,7 +1629,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p int flow_stack_pos = p_flow_stack_pos; #ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { VisualScriptLanguage::singleton->enter_function(this, &p_method, variant_stack, &working_mem, ¤t_node_id); } #endif @@ -1766,7 +1766,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p #ifdef DEBUG_ENABLED //will re-enter later, so exiting - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { VisualScriptLanguage::singleton->exit_function(); } #endif @@ -1776,26 +1776,26 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p } #ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { // line bool do_break = false; - if (ScriptDebugger::get_singleton()->get_lines_left() > 0) { + if (EngineDebugger::get_script_debugger()->get_lines_left() > 0) { - if (ScriptDebugger::get_singleton()->get_depth() <= 0) - ScriptDebugger::get_singleton()->set_lines_left(ScriptDebugger::get_singleton()->get_lines_left() - 1); - if (ScriptDebugger::get_singleton()->get_lines_left() <= 0) + if (EngineDebugger::get_script_debugger()->get_depth() <= 0) + EngineDebugger::get_script_debugger()->set_lines_left(EngineDebugger::get_script_debugger()->get_lines_left() - 1); + if (EngineDebugger::get_script_debugger()->get_lines_left() <= 0) do_break = true; } - if (ScriptDebugger::get_singleton()->is_breakpoint(current_node_id, source)) + if (EngineDebugger::get_script_debugger()->is_breakpoint(current_node_id, source)) do_break = true; if (do_break) { VisualScriptLanguage::singleton->debug_break("Breakpoint", true); } - ScriptDebugger::get_singleton()->line_poll(); + EngineDebugger::get_singleton()->line_poll(); } #endif int output = ret & VisualScriptNodeInstance::STEP_MASK; @@ -1983,7 +1983,7 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p } #ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { VisualScriptLanguage::singleton->exit_function(); } #endif @@ -2593,12 +2593,12 @@ void VisualScriptLanguage::add_global_constant(const StringName &p_variable, con bool VisualScriptLanguage::debug_break_parse(const String &p_file, int p_node, const String &p_error) { //break because of parse error - if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) { + if (EngineDebugger::is_active() && Thread::get_caller_id() == Thread::get_main_id()) { _debug_parse_err_node = p_node; _debug_parse_err_file = p_file; _debug_error = p_error; - ScriptDebugger::get_singleton()->debug(this, false, true); + EngineDebugger::get_script_debugger()->debug(this, false, true); return true; } else { return false; @@ -2607,12 +2607,12 @@ bool VisualScriptLanguage::debug_break_parse(const String &p_file, int p_node, c bool VisualScriptLanguage::debug_break(const String &p_error, bool p_allow_continue) { - if (ScriptDebugger::get_singleton() && Thread::get_caller_id() == Thread::get_main_id()) { + if (EngineDebugger::is_active() && Thread::get_caller_id() == Thread::get_main_id()) { _debug_parse_err_node = -1; _debug_parse_err_file = ""; _debug_error = p_error; - ScriptDebugger::get_singleton()->debug(this, p_allow_continue, true); + EngineDebugger::get_script_debugger()->debug(this, p_allow_continue, true); return true; } else { return false; @@ -2837,7 +2837,7 @@ VisualScriptLanguage::VisualScriptLanguage() { int dmcs = GLOBAL_DEF("debug/settings/visual_script/max_call_stack", 1024); ProjectSettings::get_singleton()->set_custom_property_info("debug/settings/visual_script/max_call_stack", PropertyInfo(Variant::INT, "debug/settings/visual_script/max_call_stack", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater")); //minimum is 1024 - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { //debugging enabled! _debug_max_call_stack = dmcs; _call_stack = memnew_arr(CallLevel, _debug_max_call_stack + 1); diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 0a6daba64f..d1005c025c 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -31,6 +31,8 @@ #ifndef VISUAL_SCRIPT_H #define VISUAL_SCRIPT_H +#include "core/debugger/engine_debugger.h" +#include "core/debugger/script_debugger.h" #include "core/os/thread.h" #include "core/script_language.h" @@ -540,13 +542,13 @@ public: if (Thread::get_main_id() != Thread::get_caller_id()) return; //no support for other threads than main for now - if (ScriptDebugger::get_singleton()->get_lines_left() > 0 && ScriptDebugger::get_singleton()->get_depth() >= 0) - ScriptDebugger::get_singleton()->set_depth(ScriptDebugger::get_singleton()->get_depth() + 1); + if (EngineDebugger::get_script_debugger()->get_lines_left() > 0 && EngineDebugger::get_script_debugger()->get_depth() >= 0) + EngineDebugger::get_script_debugger()->set_depth(EngineDebugger::get_script_debugger()->get_depth() + 1); if (_debug_call_stack_pos >= _debug_max_call_stack) { //stack overflow _debug_error = "Stack Overflow (Stack Size: " + itos(_debug_max_call_stack) + ")"; - ScriptDebugger::get_singleton()->debug(this); + EngineDebugger::get_script_debugger()->debug(this); return; } @@ -563,13 +565,13 @@ public: if (Thread::get_main_id() != Thread::get_caller_id()) return; //no support for other threads than main for now - if (ScriptDebugger::get_singleton()->get_lines_left() > 0 && ScriptDebugger::get_singleton()->get_depth() >= 0) - ScriptDebugger::get_singleton()->set_depth(ScriptDebugger::get_singleton()->get_depth() - 1); + if (EngineDebugger::get_script_debugger()->get_lines_left() > 0 && EngineDebugger::get_script_debugger()->get_depth() >= 0) + EngineDebugger::get_script_debugger()->set_depth(EngineDebugger::get_script_debugger()->get_depth() - 1); if (_debug_call_stack_pos == 0) { _debug_error = "Stack Underflow (Engine Bug)"; - ScriptDebugger::get_singleton()->debug(this); + EngineDebugger::get_script_debugger()->debug(this); return; } diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 8259e5eb9a..8840b9f7cf 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -1832,7 +1832,7 @@ void VisualScriptEditor::_fn_name_box_input(const Ref<InputEvent> &p_event) { return; Ref<InputEventKey> key = p_event; - if (key.is_valid() && key->is_pressed() && key->get_scancode() == KEY_ENTER) { + if (key.is_valid() && key->is_pressed() && key->get_keycode() == KEY_ENTER) { function_name_edit->hide(); _rename_function(selected, function_name_box->get_text()); function_name_box->clear(); diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp index a2baacb619..d799f19143 100644 --- a/modules/visual_script/visual_script_property_selector.cpp +++ b/modules/visual_script/visual_script_property_selector.cpp @@ -51,7 +51,7 @@ void VisualScriptPropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) { if (k.is_valid()) { - switch (k->get_scancode()) { + switch (k->get_keycode()) { case KEY_UP: case KEY_DOWN: case KEY_PAGEUP: |