diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/bullet/rigid_body_bullet.cpp | 2 | ||||
| -rw-r--r-- | modules/csg/icons/CSGBox.svg (renamed from modules/csg/icons/icon_c_s_g_box.svg) | 0 | ||||
| -rw-r--r-- | modules/csg/icons/CSGCapsule.svg (renamed from modules/csg/icons/icon_c_s_g_capsule.svg) | 0 | ||||
| -rw-r--r-- | modules/csg/icons/CSGCombiner.svg (renamed from modules/csg/icons/icon_c_s_g_combiner.svg) | 0 | ||||
| -rw-r--r-- | modules/csg/icons/CSGCylinder.svg (renamed from modules/csg/icons/icon_c_s_g_cylinder.svg) | 0 | ||||
| -rw-r--r-- | modules/csg/icons/CSGMesh.svg (renamed from modules/csg/icons/icon_c_s_g_mesh.svg) | 0 | ||||
| -rw-r--r-- | modules/csg/icons/CSGPolygon.svg (renamed from modules/csg/icons/icon_c_s_g_polygon.svg) | 0 | ||||
| -rw-r--r-- | modules/csg/icons/CSGSphere.svg (renamed from modules/csg/icons/icon_c_s_g_sphere.svg) | 0 | ||||
| -rw-r--r-- | modules/csg/icons/CSGTorus.svg (renamed from modules/csg/icons/icon_c_s_g_torus.svg) | 0 | ||||
| -rw-r--r-- | modules/gdnative/icons/GDNativeLibrary.svg (renamed from modules/gdnative/icons/icon_g_d_native_library.svg) | 0 | ||||
| -rw-r--r-- | modules/gdnative/icons/NativeScript.svg (renamed from modules/gdnative/icons/icon_native_script.svg) | 0 | ||||
| -rw-r--r-- | modules/gdnative/pluginscript/pluginscript_script.cpp | 2 | ||||
| -rw-r--r-- | modules/gdnavigation/navigation_mesh_editor_plugin.cpp | 6 | ||||
| -rw-r--r-- | modules/gdnavigation/navigation_mesh_editor_plugin.h | 2 | ||||
| -rw-r--r-- | modules/gdscript/gdscript.cpp | 12 | ||||
| -rw-r--r-- | modules/gdscript/gdscript.h | 14 | ||||
| -rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 4 | ||||
| -rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 8 | ||||
| -rw-r--r-- | modules/gdscript/gdscript_function.cpp | 22 | ||||
| -rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 16 | ||||
| -rw-r--r-- | modules/gdscript/icons/GDScript.svg (renamed from modules/gdscript/icons/icon_g_d_script.svg) | 0 | ||||
| -rw-r--r-- | modules/gdscript/language_server/gdscript_workspace.cpp | 26 | ||||
| -rw-r--r-- | modules/gdscript/language_server/gdscript_workspace.h | 2 | ||||
| -rw-r--r-- | modules/gridmap/icons/GridMap.svg (renamed from modules/gridmap/icons/icon_grid_map.svg) | 0 | ||||
| -rw-r--r-- | modules/mono/csharp_script.cpp | 12 | ||||
| -rw-r--r-- | modules/mono/icons/CSharpScript.svg (renamed from modules/mono/icons/icon_c_sharp_script.svg) | 0 | ||||
| -rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 5 | ||||
| -rw-r--r-- | modules/mono/mono_gd/gd_mono_internals.cpp | 7 | ||||
| -rw-r--r-- | modules/mono/mono_gd/gd_mono_utils.cpp | 8 | ||||
| -rw-r--r-- | modules/opensimplex/icons/NoiseTexture.svg (renamed from modules/opensimplex/icons/icon_noise_texture.svg) | 0 | ||||
| -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 |
33 files changed, 109 insertions, 83 deletions
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index d33c3a748c..80f42c8441 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -240,7 +240,7 @@ void RigidBodyBullet::KinematicUtilities::copyAllOwnerShapes() { shapes.write[i].shape = static_cast<btConvexShape *>(shape_wrapper->shape->create_bt_shape(owner_scale * shape_wrapper->scale, safe_margin)); } break; default: - WARN_PRINT("This shape is not supported to be kinematic!"); + WARN_PRINT("This shape is not supported for kinematic collision."); shapes.write[i].shape = NULL; } } diff --git a/modules/csg/icons/icon_c_s_g_box.svg b/modules/csg/icons/CSGBox.svg index 67e34df444..67e34df444 100644 --- a/modules/csg/icons/icon_c_s_g_box.svg +++ b/modules/csg/icons/CSGBox.svg diff --git a/modules/csg/icons/icon_c_s_g_capsule.svg b/modules/csg/icons/CSGCapsule.svg index 92a7b5a870..92a7b5a870 100644 --- a/modules/csg/icons/icon_c_s_g_capsule.svg +++ b/modules/csg/icons/CSGCapsule.svg diff --git a/modules/csg/icons/icon_c_s_g_combiner.svg b/modules/csg/icons/CSGCombiner.svg index cce2902e24..cce2902e24 100644 --- a/modules/csg/icons/icon_c_s_g_combiner.svg +++ b/modules/csg/icons/CSGCombiner.svg diff --git a/modules/csg/icons/icon_c_s_g_cylinder.svg b/modules/csg/icons/CSGCylinder.svg index 645a74c79b..645a74c79b 100644 --- a/modules/csg/icons/icon_c_s_g_cylinder.svg +++ b/modules/csg/icons/CSGCylinder.svg diff --git a/modules/csg/icons/icon_c_s_g_mesh.svg b/modules/csg/icons/CSGMesh.svg index 6e940a4aa5..6e940a4aa5 100644 --- a/modules/csg/icons/icon_c_s_g_mesh.svg +++ b/modules/csg/icons/CSGMesh.svg diff --git a/modules/csg/icons/icon_c_s_g_polygon.svg b/modules/csg/icons/CSGPolygon.svg index 71b03cb8e6..71b03cb8e6 100644 --- a/modules/csg/icons/icon_c_s_g_polygon.svg +++ b/modules/csg/icons/CSGPolygon.svg diff --git a/modules/csg/icons/icon_c_s_g_sphere.svg b/modules/csg/icons/CSGSphere.svg index f81b566993..f81b566993 100644 --- a/modules/csg/icons/icon_c_s_g_sphere.svg +++ b/modules/csg/icons/CSGSphere.svg diff --git a/modules/csg/icons/icon_c_s_g_torus.svg b/modules/csg/icons/CSGTorus.svg index 3d30aa47b2..3d30aa47b2 100644 --- a/modules/csg/icons/icon_c_s_g_torus.svg +++ b/modules/csg/icons/CSGTorus.svg diff --git a/modules/gdnative/icons/icon_g_d_native_library.svg b/modules/gdnative/icons/GDNativeLibrary.svg index b494c7af6e..b494c7af6e 100644 --- a/modules/gdnative/icons/icon_g_d_native_library.svg +++ b/modules/gdnative/icons/GDNativeLibrary.svg diff --git a/modules/gdnative/icons/icon_native_script.svg b/modules/gdnative/icons/NativeScript.svg index fb9e135627..fb9e135627 100644 --- a/modules/gdnative/icons/icon_native_script.svg +++ b/modules/gdnative/icons/NativeScript.svg diff --git a/modules/gdnative/pluginscript/pluginscript_script.cpp b/modules/gdnative/pluginscript/pluginscript_script.cpp index fe1f63f6da..b7cbedc51a 100644 --- a/modules/gdnative/pluginscript/pluginscript_script.cpp +++ b/modules/gdnative/pluginscript/pluginscript_script.cpp @@ -194,7 +194,7 @@ ScriptInstance *PluginScript::instance_create(Object *p_this) { if (!ClassDB::is_parent_class(p_this->get_class_name(), base_type)) { String msg = "Script inherits from native type '" + String(base_type) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"; // TODO: implement PluginscriptLanguage::debug_break_parse - // if (ScriptDebugger::get_singleton()) { + // if (EngineDebugger::is_active()) { // _language->debug_break_parse(get_path(), 0, msg); // } ERR_FAIL_V_MSG(NULL, msg); diff --git a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp index 5c298ae9e4..e6ff7a7afa 100644 --- a/modules/gdnavigation/navigation_mesh_editor_plugin.cpp +++ b/modules/gdnavigation/navigation_mesh_editor_plugin.cpp @@ -84,13 +84,13 @@ void NavigationMeshEditor::_clear_pressed() { } } -void NavigationMeshEditor::edit(NavigationRegion *p_nav_mesh_instance) { +void NavigationMeshEditor::edit(NavigationRegion *p_nav_region) { - if (p_nav_mesh_instance == NULL || node == p_nav_mesh_instance) { + if (p_nav_region == NULL || node == p_nav_region) { return; } - node = p_nav_mesh_instance; + node = p_nav_region; } void NavigationMeshEditor::_bind_methods() { diff --git a/modules/gdnavigation/navigation_mesh_editor_plugin.h b/modules/gdnavigation/navigation_mesh_editor_plugin.h index 7c3faebf57..847ad4f63d 100644 --- a/modules/gdnavigation/navigation_mesh_editor_plugin.h +++ b/modules/gdnavigation/navigation_mesh_editor_plugin.h @@ -61,7 +61,7 @@ protected: void _notification(int p_option); public: - void edit(NavigationRegion *p_nav_mesh_instance); + void edit(NavigationRegion *p_nav_region); NavigationMeshEditor(); ~NavigationMeshEditor(); }; diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index c641ce37c5..d31823d632 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -315,7 +315,7 @@ ScriptInstance *GDScript::instance_create(Object *p_this) { if (top->native.is_valid()) { if (!ClassDB::is_parent_class(p_this->get_class_name(), top->native->get_name())) { - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), 1, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); } ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + String(top->native->get_name()) + "', so it can't be instanced in object of type '" + p_this->get_class() + "'" + "."); @@ -556,7 +556,7 @@ Error GDScript::reload(bool p_keep_state) { GDScriptParser parser; Error err = parser.parse(source, basedir, false, path); if (err) { - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), parser.get_error_line(), "Parser Error: " + parser.get_error()); } _err_print_error("GDScript::reload", path.empty() ? "built-in" : (const char *)path.utf8().get_data(), parser.get_error_line(), ("Parse Error: " + parser.get_error()).utf8().get_data(), ERR_HANDLER_SCRIPT); @@ -571,7 +571,7 @@ Error GDScript::reload(bool p_keep_state) { if (err) { if (can_run) { - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { GDScriptLanguage::get_singleton()->debug_break_parse(get_path(), compiler.get_error_line(), "Parser Error: " + compiler.get_error()); } _err_print_error("GDScript::reload", path.empty() ? "built-in" : (const char *)path.utf8().get_data(), compiler.get_error_line(), ("Compile Error: " + compiler.get_error()).utf8().get_data(), ERR_HANDLER_SCRIPT); @@ -583,9 +583,9 @@ Error GDScript::reload(bool p_keep_state) { #ifdef DEBUG_ENABLED for (const List<GDScriptWarning>::Element *E = parser.get_warnings().front(); E; E = E->next()) { const GDScriptWarning &warning = E->get(); - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { Vector<ScriptLanguage::StackInfo> si; - ScriptDebugger::get_singleton()->send_error("", get_path(), warning.line, warning.get_name(), warning.get_message(), ERR_HANDLER_WARNING, si); + EngineDebugger::get_script_debugger()->send_error("", get_path(), warning.line, warning.get_name(), warning.get_message(), ERR_HANDLER_WARNING, si); } } #endif @@ -2201,7 +2201,7 @@ GDScriptLanguage::GDScriptLanguage() { int dmcs = GLOBAL_DEF("debug/settings/gdscript/max_call_stack", 1024); ProjectSettings::get_singleton()->set_custom_property_info("debug/settings/gdscript/max_call_stack", PropertyInfo(Variant::INT, "debug/settings/gdscript/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; diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 3a90f0fc20..456cd88fe6 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -31,6 +31,8 @@ #ifndef GDSCRIPT_H #define GDSCRIPT_H +#include "core/debugger/engine_debugger.h" +#include "core/debugger/script_debugger.h" #include "core/io/resource_loader.h" #include "core/io/resource_saver.h" #include "core/script_language.h" @@ -393,13 +395,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; } @@ -416,13 +418,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/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 4bd425f999..42efdeffbb 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -1579,7 +1579,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser codegen.stack_max = 0; codegen.current_line = 0; codegen.call_max = 0; - codegen.debug_stack = ScriptDebugger::get_singleton() != NULL; + codegen.debug_stack = EngineDebugger::is_active(); Vector<StringName> argnames; int stack_level = 0; @@ -1765,7 +1765,7 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser gdfunc->_call_size = codegen.call_max; gdfunc->name = func_name; #ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { String signature; //path if (p_script->get_path() != String()) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 1bc1aae0d2..966a3db840 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -221,12 +221,12 @@ Script *GDScriptLanguage::create_script() const { bool GDScriptLanguage::debug_break_parse(const String &p_file, int p_line, 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_line = p_line; _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; @@ -235,13 +235,13 @@ bool GDScriptLanguage::debug_break_parse(const String &p_file, int p_line, const bool GDScriptLanguage::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_line = -1; _debug_parse_err_file = ""; _debug_error = p_error; bool is_error_breakpoint = p_error != "Breakpoint"; - ScriptDebugger::get_singleton()->debug(this, p_allow_continue, is_error_breakpoint); + EngineDebugger::get_script_debugger()->debug(this, p_allow_continue, is_error_breakpoint); return true; } else { return false; diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 79c550c81c..3f73654a1e 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -391,7 +391,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) + if (EngineDebugger::is_active()) GDScriptLanguage::get_singleton()->enter_function(p_instance, this, stack, &ip, &line); #define GD_ERR_BREAK(m_cond) \ @@ -1522,7 +1522,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a OPCODE(OPCODE_BREAKPOINT) { #ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { GDScriptLanguage::get_singleton()->debug_break("Breakpoint Statement", true); } #endif @@ -1536,26 +1536,26 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a line = _code_ptr[ip + 1]; ip += 2; - 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(line, source)) + if (EngineDebugger::get_script_debugger()->is_breakpoint(line, source)) do_break = true; if (do_break) { GDScriptLanguage::get_singleton()->debug_break("Breakpoint", true); } - ScriptDebugger::get_singleton()->line_poll(); + EngineDebugger::get_singleton()->line_poll(); } } DISPATCH_OPCODE; @@ -1622,7 +1622,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a // When it's the last resume it will postpone the exit from stack, // so the debugger knows which function triggered the resume of the next function (if any) if (!p_state || yielded) { - if (ScriptDebugger::get_singleton()) + if (EngineDebugger::is_active()) GDScriptLanguage::get_singleton()->exit_function(); #endif @@ -1884,7 +1884,7 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) { } #ifdef DEBUG_ENABLED - if (ScriptDebugger::get_singleton()) + if (EngineDebugger::is_active()) GDScriptLanguage::get_singleton()->exit_function(); if (state.stack_size) { //free stack diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 0382944efd..353c79d6bb 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3102,18 +3102,18 @@ void GDScriptParser::_parse_block(BlockNode *p_block, bool p_static) { Vector<Node *> args; Vector<double> constants; - bool constant = false; + bool constant = true; for (int i = 1; i < op->arguments.size(); i++) { args.push_back(op->arguments[i]); - if (constant && op->arguments[i]->type == Node::TYPE_CONSTANT) { + if (op->arguments[i]->type == Node::TYPE_CONSTANT) { ConstantNode *c = static_cast<ConstantNode *>(op->arguments[i]); if (c->value.get_type() == Variant::FLOAT || c->value.get_type() == Variant::INT) { constants.push_back(c->value); - constant = true; } } else { constant = false; + break; } } @@ -3809,6 +3809,12 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { } StringName argname = tokenizer->get_token_identifier(); + for (int i = 0; i < arguments.size(); i++) { + if (arguments[i] == argname) { + _set_error("The argument name \"" + String(argname) + "\" is defined multiple times."); + return; + } + } arguments.push_back(argname); #ifdef DEBUG_ENABLED arguments_usage.push_back(0); @@ -5227,6 +5233,10 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { } } break; + case GDScriptTokenizer::TK_CF_PASS: { + tokenizer->advance(); + } break; + default: { _set_error(String() + "Unexpected token: " + tokenizer->get_token_name(tokenizer->get_token()) + ":" + tokenizer->get_token_identifier()); diff --git a/modules/gdscript/icons/icon_g_d_script.svg b/modules/gdscript/icons/GDScript.svg index 953bb9ae9e..953bb9ae9e 100644 --- a/modules/gdscript/icons/icon_g_d_script.svg +++ b/modules/gdscript/icons/GDScript.svg diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index 886d65d28c..205257b8f2 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -401,19 +401,23 @@ void GDScriptWorkspace::_get_owners(EditorFileSystemDirectory *efsd, String p_pa } } -Node *GDScriptWorkspace::_get_owner_node(String p_path) { - Node *owner_node = NULL; +Node *GDScriptWorkspace::_get_owner_scene_node(String p_path) { + Node *owner_scene_node = NULL; List<String> owners; _get_owners(EditorFileSystem::get_singleton()->get_filesystem(), p_path, owners); - if (owners.size() > 0) { - NodePath owner_path = owners[0]; - Ref<PackedScene> owner_res = ResourceLoader::load(owner_path); - owner_node = owner_res->instance(PackedScene::GEN_EDIT_STATE_DISABLED); + for (int i = 0; i < owners.size(); i++) { + NodePath owner_path = owners[i]; + RES owner_res = ResourceLoader::load(owner_path); + if (Object::cast_to<PackedScene>(owner_res.ptr())) { + Ref<PackedScene> owner_packed_scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*owner_res)); + owner_scene_node = owner_packed_scene->instance(); + break; + } } - return owner_node; + return owner_scene_node; } void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<ScriptCodeCompletionOption> *r_options) { @@ -423,11 +427,11 @@ void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List<S bool forced = false; if (const ExtendGDScriptParser *parser = get_parse_result(path)) { - Node *owner_node = _get_owner_node(path); + Node *owner_scene_node = _get_owner_scene_node(path); String code = parser->get_text_for_completion(p_params.position); - GDScriptLanguage::get_singleton()->complete_code(code, path, owner_node, r_options, forced, call_hint); - if (owner_node) { - memdelete(owner_node); + GDScriptLanguage::get_singleton()->complete_code(code, path, owner_scene_node, r_options, forced, call_hint); + if (owner_scene_node) { + memdelete(owner_scene_node); } } } diff --git a/modules/gdscript/language_server/gdscript_workspace.h b/modules/gdscript/language_server/gdscript_workspace.h index 8b46d345d9..e45b06747d 100644 --- a/modules/gdscript/language_server/gdscript_workspace.h +++ b/modules/gdscript/language_server/gdscript_workspace.h @@ -42,7 +42,7 @@ class GDScriptWorkspace : public Reference { private: void _get_owners(EditorFileSystemDirectory *efsd, String p_path, List<String> &owners); - Node *_get_owner_node(String p_path); + Node *_get_owner_scene_node(String p_path); protected: static void _bind_methods(); diff --git a/modules/gridmap/icons/icon_grid_map.svg b/modules/gridmap/icons/GridMap.svg index eafe1211f2..eafe1211f2 100644 --- a/modules/gridmap/icons/icon_grid_map.svg +++ b/modules/gridmap/icons/GridMap.svg diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 6809cbdff9..02ff6bcf13 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -33,6 +33,8 @@ #include <mono/metadata/threads.h> #include <stdint.h> +#include "core/debugger/engine_debugger.h" +#include "core/debugger/script_debugger.h" #include "core/io/json.h" #include "core/os/file_access.h" #include "core/os/mutex.h" @@ -1134,11 +1136,11 @@ void CSharpLanguage::thread_exit() { bool CSharpLanguage::debug_break_parse(const String &p_file, int p_line, const String &p_error) { // Not a parser error in our case, but it's still used for other type of errors - 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_line = p_line; _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; @@ -1147,11 +1149,11 @@ bool CSharpLanguage::debug_break_parse(const String &p_file, int p_line, const S bool CSharpLanguage::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_line = -1; _debug_parse_err_file = ""; _debug_error = p_error; - ScriptDebugger::get_singleton()->debug(this, p_allow_continue); + EngineDebugger::get_script_debugger()->debug(this, p_allow_continue); return true; } else { return false; @@ -2998,7 +3000,7 @@ ScriptInstance *CSharpScript::instance_create(Object *p_this) { if (native) { String native_name = NATIVE_GDMONOCLASS_NAME(native); if (!ClassDB::is_parent_class(p_this->get_class_name(), native_name)) { - if (ScriptDebugger::get_singleton()) { + if (EngineDebugger::is_active()) { CSharpLanguage::get_singleton()->debug_break_parse(get_path(), 0, "Script inherits from native type '" + native_name + "', so it can't be instanced in object of type: '" + p_this->get_class() + "'"); } ERR_FAIL_V_MSG(NULL, "Script inherits from native type '" + native_name + diff --git a/modules/mono/icons/icon_c_sharp_script.svg b/modules/mono/icons/CSharpScript.svg index 69664ca553..69664ca553 100644 --- a/modules/mono/icons/icon_c_sharp_script.svg +++ b/modules/mono/icons/CSharpScript.svg diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 895393537f..eb4c263745 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -37,6 +37,7 @@ #include <mono/metadata/mono-gc.h> #include <mono/metadata/profiler.h> +#include "core/debugger/engine_debugger.h" #include "core/os/dir_access.h" #include "core/os/file_access.h" #include "core/os/os.h" @@ -1183,8 +1184,8 @@ void GDMono::unhandled_exception_hook(MonoObject *p_exc, void *) { #ifdef DEBUG_ENABLED GDMonoUtils::debug_send_unhandled_exception_error((MonoException *)p_exc); - if (ScriptDebugger::get_singleton()) - ScriptDebugger::get_singleton()->idle_poll(); + if (EngineDebugger::is_active()) + EngineDebugger::get_singleton()->poll_events(false); #endif exit(mono_environment_exitcode_get()); diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp index 74ffa90cb3..b179b484f3 100644 --- a/modules/mono/mono_gd/gd_mono_internals.cpp +++ b/modules/mono/mono_gd/gd_mono_internals.cpp @@ -38,6 +38,9 @@ #include "gd_mono_marshal.h" #include "gd_mono_utils.h" +#include "core/debugger/engine_debugger.h" +#include "core/debugger/script_debugger.h" + #include <mono/metadata/exception.h> namespace GDMonoInternals { @@ -120,8 +123,8 @@ void unhandled_exception(MonoException *p_exc) { } else { #ifdef DEBUG_ENABLED GDMonoUtils::debug_send_unhandled_exception_error((MonoException *)p_exc); - if (ScriptDebugger::get_singleton()) - ScriptDebugger::get_singleton()->idle_poll(); + if (EngineDebugger::is_active()) + EngineDebugger::get_singleton()->poll_events(false); #endif } } diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp index 41f49d8ac9..bc290f3a7f 100644 --- a/modules/mono/mono_gd/gd_mono_utils.cpp +++ b/modules/mono/mono_gd/gd_mono_utils.cpp @@ -32,6 +32,8 @@ #include <mono/metadata/exception.h> +#include "core/debugger/engine_debugger.h" +#include "core/debugger/script_debugger.h" #include "core/os/dir_access.h" #include "core/os/mutex.h" #include "core/os/os.h" @@ -39,7 +41,7 @@ #include "core/reference.h" #ifdef TOOLS_ENABLED -#include "editor/debugger/script_editor_debugger.h" +#include "editor/debugger/editor_debugger_node.h" #endif #include "../csharp_script.h" @@ -351,7 +353,7 @@ void debug_print_unhandled_exception(MonoException *p_exc) { void debug_send_unhandled_exception_error(MonoException *p_exc) { #ifdef DEBUG_ENABLED - if (!ScriptDebugger::get_singleton()) { + if (!EngineDebugger::is_active()) { #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint()) { ERR_PRINT(GDMonoUtils::get_exception_name_and_message(p_exc)); @@ -410,7 +412,7 @@ void debug_send_unhandled_exception_error(MonoException *p_exc) { int line = si.size() ? si[0].line : __LINE__; String error_msg = "Unhandled exception"; - ScriptDebugger::get_singleton()->send_error(func, file, line, error_msg, exc_msg, ERR_HANDLER_ERROR, si); + EngineDebugger::get_script_debugger()->send_error(func, file, line, error_msg, exc_msg, ERR_HANDLER_ERROR, si); #endif } diff --git a/modules/opensimplex/icons/icon_noise_texture.svg b/modules/opensimplex/icons/NoiseTexture.svg index 5908c2b2d4..5908c2b2d4 100644 --- a/modules/opensimplex/icons/icon_noise_texture.svg +++ b/modules/opensimplex/icons/NoiseTexture.svg 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; } |