diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 8 | ||||
-rw-r--r-- | modules/mono/class_db_api_json.cpp | 7 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 2 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs | 6 | ||||
-rw-r--r-- | modules/mono/editor/editor_internal_calls.cpp | 9 | ||||
-rw-r--r-- | modules/mono/editor/script_class_parser.cpp | 6 | ||||
-rw-r--r-- | modules/recast/register_types.cpp | 10 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.cpp | 16 | ||||
-rw-r--r-- | modules/visual_script/visual_script_nodes.h | 3 |
9 files changed, 46 insertions, 21 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 5c2e7137bf..aec7110ee5 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -5404,12 +5404,12 @@ void GDScriptParser::_determine_inheritance(ClassNode *p_class, bool p_recursive ident += ("." + subclass); - if (base_script->get_subclasses().has(subclass)) { + if (find_subclass->get_subclasses().has(subclass)) { - find_subclass = base_script->get_subclasses()[subclass]; - } else if (base_script->get_constants().has(subclass)) { + find_subclass = find_subclass->get_subclasses()[subclass]; + } else if (find_subclass->get_constants().has(subclass)) { - Ref<GDScript> new_base_class = base_script->get_constants()[subclass]; + Ref<GDScript> new_base_class = find_subclass->get_constants()[subclass]; if (new_base_class.is_null()) { _set_error("Constant isn't a class: " + ident, p_class->line); return; diff --git a/modules/mono/class_db_api_json.cpp b/modules/mono/class_db_api_json.cpp index c1d6f4dccf..b04e53bd81 100644 --- a/modules/mono/class_db_api_json.cpp +++ b/modules/mono/class_db_api_json.cpp @@ -71,6 +71,13 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) { while ((k = t->method_map.next(k))) { + String name = k->operator String(); + + ERR_CONTINUE(name.empty()); + + if (name[0] == '_') + continue; // Ignore non-virtual methods that start with an underscore + snames.push_back(*k); } diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 0f6b8357b8..210267e681 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -106,7 +106,7 @@ Error CSharpLanguage::execute_file(const String &p_path) { void CSharpLanguage::init() { #ifdef DEBUG_METHODS_ENABLED - if (OS::get_singleton()->get_cmdline_args().find("--class_db_to_json")) { + if (OS::get_singleton()->get_cmdline_args().find("--class-db-json")) { class_db_api_to_json("user://class_db_api.json", ClassDB::API_CORE); #ifdef TOOLS_ENABLED class_db_api_to_json("user://class_db_api_editor.json", ClassDB::API_EDITOR); diff --git a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs index 80e45b3a3c..11afa8773e 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Internals/ScriptClassParser.cs @@ -25,14 +25,14 @@ namespace GodotTools.Internals } [MethodImpl(MethodImplOptions.InternalCall)] - private static extern Error internal_ParseFile(string filePath, Array<Dictionary> classes); + private static extern Error internal_ParseFile(string filePath, Array<Dictionary> classes, out string errorStr); public static void ParseFileOrThrow(string filePath, out IEnumerable<ClassDecl> classes) { var classesArray = new Array<Dictionary>(); - var error = internal_ParseFile(filePath, classesArray); + var error = internal_ParseFile(filePath, classesArray, out string errorStr); if (error != Error.Ok) - throw new Exception($"Failed to determine namespace and class for script: {filePath}. Parse error: {error}"); + throw new Exception($"Failed to determine namespace and class for script: {filePath}. Parse error: {errorStr ?? error.ToString()}"); var classesList = new List<ClassDecl>(); diff --git a/modules/mono/editor/editor_internal_calls.cpp b/modules/mono/editor/editor_internal_calls.cpp index cfc869cd39..c8d20e80be 100644 --- a/modules/mono/editor/editor_internal_calls.cpp +++ b/modules/mono/editor/editor_internal_calls.cpp @@ -201,7 +201,9 @@ uint32_t godot_icall_BindingsGenerator_CsGlueVersion() { return CS_GLUE_VERSION; } -int32_t godot_icall_ScriptClassParser_ParseFile(MonoString *p_filepath, MonoObject *p_classes) { +int32_t godot_icall_ScriptClassParser_ParseFile(MonoString *p_filepath, MonoObject *p_classes, MonoString **r_error_str) { + *r_error_str = NULL; + String filepath = GDMonoMarshal::mono_string_to_godot(p_filepath); ScriptClassParser scp; @@ -220,6 +222,11 @@ int32_t godot_icall_ScriptClassParser_ParseFile(MonoString *p_filepath, MonoObje classDeclDict["base_count"] = classDecl.base.size(); classes.push_back(classDeclDict); } + } else { + String error_str = scp.get_error(); + if (!error_str.empty()) { + *r_error_str = GDMonoMarshal::mono_string_from_godot(error_str); + } } return err; } diff --git a/modules/mono/editor/script_class_parser.cpp b/modules/mono/editor/script_class_parser.cpp index c400479b89..84163dd952 100644 --- a/modules/mono/editor/script_class_parser.cpp +++ b/modules/mono/editor/script_class_parser.cpp @@ -302,8 +302,10 @@ Error ScriptClassParser::_skip_generic_type_params() { Error err = _skip_generic_type_params(); if (err) return err; - continue; - } else if (tk == TK_OP_GREATER) { + tk = get_token(); + } + + if (tk == TK_OP_GREATER) { return OK; } else if (tk != TK_COMMA) { error_str = "Unexpected token: " + get_token_name(tk); diff --git a/modules/recast/register_types.cpp b/modules/recast/register_types.cpp index a1286c58c8..ea0ab00771 100644 --- a/modules/recast/register_types.cpp +++ b/modules/recast/register_types.cpp @@ -38,17 +38,17 @@ EditorNavigationMeshGenerator *_nav_mesh_generator = NULL; void register_recast_types() { #ifdef TOOLS_ENABLED - EditorPlugins::add_by_type<NavigationMeshEditorPlugin>(); - _nav_mesh_generator = memnew(EditorNavigationMeshGenerator); - ClassDB::APIType prev_api = ClassDB::get_current_api(); ClassDB::set_current_api(ClassDB::API_EDITOR); - ClassDB::register_class<EditorNavigationMeshGenerator>(); + EditorPlugins::add_by_type<NavigationMeshEditorPlugin>(); + _nav_mesh_generator = memnew(EditorNavigationMeshGenerator); - ClassDB::set_current_api(prev_api); + ClassDB::register_class<EditorNavigationMeshGenerator>(); Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationMeshGenerator", EditorNavigationMeshGenerator::get_singleton())); + + ClassDB::set_current_api(prev_api); #endif } diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 0a9f228b0a..86c1080182 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -2377,10 +2377,7 @@ VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output return tg; } -void VisualScriptEngineSingleton::_bind_methods() { - - ClassDB::bind_method(D_METHOD("set_singleton", "name"), &VisualScriptEngineSingleton::set_singleton); - ClassDB::bind_method(D_METHOD("get_singleton"), &VisualScriptEngineSingleton::get_singleton); +void VisualScriptEngineSingleton::_validate_property(PropertyInfo &property) const { String cc; @@ -2397,7 +2394,16 @@ void VisualScriptEngineSingleton::_bind_methods() { cc += E->get().name; } - ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant", PROPERTY_HINT_ENUM, cc), "set_singleton", "get_singleton"); + property.hint = PROPERTY_HINT_ENUM; + property.hint_string = cc; +} + +void VisualScriptEngineSingleton::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_singleton", "name"), &VisualScriptEngineSingleton::set_singleton); + ClassDB::bind_method(D_METHOD("get_singleton"), &VisualScriptEngineSingleton::get_singleton); + + ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant"), "set_singleton", "get_singleton"); } VisualScriptEngineSingleton::VisualScriptEngineSingleton() { diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index fe44af277f..0df5071491 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -614,6 +614,9 @@ class VisualScriptEngineSingleton : public VisualScriptNode { String singleton; +protected: + void _validate_property(PropertyInfo &property) const; + static void _bind_methods(); public: |