diff options
36 files changed, 152 insertions, 438 deletions
diff --git a/core/core_constants.cpp b/core/core_constants.cpp index 504b343736..edb72f73cb 100644 --- a/core/core_constants.cpp +++ b/core/core_constants.cpp @@ -621,14 +621,6 @@ void register_global_constants() { BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_TYPE_STRING); BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_VARIANT_TYPE); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_BASE_TYPE); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_INSTANCE); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_SCRIPT); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_BASE_TYPE); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_INSTANCE); - BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_SCRIPT); BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_OBJECT_TOO_BIG); BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_VALID_TYPES); BIND_CORE_ENUM_CONSTANT(PROPERTY_HINT_SAVE_FILE); @@ -646,10 +638,10 @@ void register_global_constants() { BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NONE); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_STORAGE); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_EDITOR); + BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_INTERNAL); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CHECKABLE); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CHECKED); - BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_INTERNATIONALIZED); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_GROUP); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CATEGORY); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_SUBGROUP); @@ -663,7 +655,7 @@ void register_global_constants() { BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_CLASS_IS_ENUM); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NIL_IS_VARIANT); - BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_INTERNAL); + BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_ARRAY); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_HIGH_END_GFX); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT); @@ -673,10 +665,8 @@ void register_global_constants() { BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_EDITOR_BASIC_SETTING); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_READ_ONLY); - BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_ARRAY); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_DEFAULT); - BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_DEFAULT_INTL); BIND_CORE_BITFIELD_FLAG(PROPERTY_USAGE_NO_EDITOR); BIND_CORE_BITFIELD_FLAG(METHOD_FLAG_NORMAL); diff --git a/core/doc_data.h b/core/doc_data.h index c547138619..1cf4e4f206 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -378,7 +378,6 @@ public: struct ClassDoc { String name; String inherits; - String category; // FIXME: Wrongly used by VisualScriptPropertySelector, should be removed. String brief_description; String description; Vector<TutorialDoc> tutorials; @@ -409,10 +408,6 @@ public: doc.inherits = p_dict["inherits"]; } - if (p_dict.has("category")) { - doc.category = p_dict["category"]; - } - if (p_dict.has("brief_description")) { doc.brief_description = p_dict["brief_description"]; } diff --git a/core/object/object.cpp b/core/object/object.cpp index 0e82440fc0..1f0a7e516d 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1594,25 +1594,6 @@ bool Object::is_blocking_signals() const { return _block_signals; } -void Object::get_translatable_strings(List<String> *p_strings) const { - List<PropertyInfo> plist; - get_property_list(&plist); - - for (const PropertyInfo &E : plist) { - if (!(E.usage & PROPERTY_USAGE_INTERNATIONALIZED)) { - continue; - } - - String text = get(E.name); - - if (text.is_empty()) { - continue; - } - - p_strings->push_back(text); - } -} - Variant::Type Object::get_static_property_type(const StringName &p_property, bool *r_valid) const { bool valid; Variant::Type t = ClassDB::get_property_type(get_class_name(), p_property, &valid); diff --git a/core/object/object.h b/core/object/object.h index 2ba86c9d31..f78c7c34fd 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -74,14 +74,6 @@ enum PropertyHint { PROPERTY_HINT_OBJECT_ID, PROPERTY_HINT_TYPE_STRING, ///< a type string, the hint is the base type to choose PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE, ///< so something else can provide this (used in scripts) - PROPERTY_HINT_METHOD_OF_VARIANT_TYPE, ///< a method of a type - PROPERTY_HINT_METHOD_OF_BASE_TYPE, ///< a method of a base type - PROPERTY_HINT_METHOD_OF_INSTANCE, ///< a method of an instance - PROPERTY_HINT_METHOD_OF_SCRIPT, ///< a method of a script & base - PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE, ///< a property of a type - PROPERTY_HINT_PROPERTY_OF_BASE_TYPE, ///< a property of a base type - PROPERTY_HINT_PROPERTY_OF_INSTANCE, ///< a property of an instance - PROPERTY_HINT_PROPERTY_OF_SCRIPT, ///< a property of a script & base PROPERTY_HINT_OBJECT_TOO_BIG, ///< object is too big to send PROPERTY_HINT_NODE_PATH_VALID_TYPES, PROPERTY_HINT_SAVE_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,". This opens a save dialog @@ -95,16 +87,15 @@ enum PropertyHint { PROPERTY_HINT_HIDE_QUATERNION_EDIT, /// Only Node3D::transform should hide the quaternion editor. PROPERTY_HINT_PASSWORD, PROPERTY_HINT_MAX, - // When updating PropertyHint, also sync the hardcoded list in VisualScriptEditorVariableEdit }; enum PropertyUsageFlags { PROPERTY_USAGE_NONE = 0, PROPERTY_USAGE_STORAGE = 1 << 1, PROPERTY_USAGE_EDITOR = 1 << 2, - PROPERTY_USAGE_CHECKABLE = 1 << 3, // Used for editing global variables. - PROPERTY_USAGE_CHECKED = 1 << 4, // Used for editing global variables. - PROPERTY_USAGE_INTERNATIONALIZED = 1 << 5, // Hint for internationalized strings. + PROPERTY_USAGE_INTERNAL = 1 << 3, + PROPERTY_USAGE_CHECKABLE = 1 << 4, // Used for editing global variables. + PROPERTY_USAGE_CHECKED = 1 << 5, // Used for editing global variables. PROPERTY_USAGE_GROUP = 1 << 6, // Used for grouping props in the editor. PROPERTY_USAGE_CATEGORY = 1 << 7, PROPERTY_USAGE_SUBGROUP = 1 << 8, @@ -117,7 +108,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE = 1 << 15, PROPERTY_USAGE_CLASS_IS_ENUM = 1 << 16, PROPERTY_USAGE_NIL_IS_VARIANT = 1 << 17, - PROPERTY_USAGE_INTERNAL = 1 << 18, + PROPERTY_USAGE_ARRAY = 1 << 18, // Used in the inspector to group properties as elements of an array. PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE = 1 << 19, // If the object is duplicated also this property will be duplicated. PROPERTY_USAGE_HIGH_END_GFX = 1 << 20, PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 1 << 21, @@ -127,10 +118,8 @@ enum PropertyUsageFlags { PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT = 1 << 25, // For Object properties, instantiate them when creating in editor. PROPERTY_USAGE_EDITOR_BASIC_SETTING = 1 << 26, //for project or editor settings, show when basic settings are selected. PROPERTY_USAGE_READ_ONLY = 1 << 27, // Mark a property as read-only in the inspector. - PROPERTY_USAGE_ARRAY = 1 << 28, // Used in the inspector to group properties as elements of an array. PROPERTY_USAGE_DEFAULT = PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_EDITOR, - PROPERTY_USAGE_DEFAULT_INTL = PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNATIONALIZED, PROPERTY_USAGE_NO_EDITOR = PROPERTY_USAGE_STORAGE, }; @@ -894,8 +883,6 @@ public: Variant::Type get_static_property_type(const StringName &p_property, bool *r_valid = nullptr) const; Variant::Type get_static_property_type_indexed(const Vector<StringName> &p_path, bool *r_valid = nullptr) const; - virtual void get_translatable_strings(List<String> *p_strings) const; - virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const; // Translate message (internationalization). diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index bf3ef7c7f9..41836650cd 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2794,51 +2794,35 @@ </constant> <constant name="PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE" value="24" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_VARIANT_TYPE" value="25" enum="PropertyHint"> + <constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="25" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_BASE_TYPE" value="26" enum="PropertyHint"> + <constant name="PROPERTY_HINT_NODE_PATH_VALID_TYPES" value="26" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_INSTANCE" value="27" enum="PropertyHint"> + <constant name="PROPERTY_HINT_SAVE_FILE" value="27" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_METHOD_OF_SCRIPT" value="28" enum="PropertyHint"> + <constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="28" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE" value="29" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="29" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_BASE_TYPE" value="30" enum="PropertyHint"> + <constant name="PROPERTY_HINT_INT_IS_POINTER" value="30" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_INSTANCE" value="31" enum="PropertyHint"> + <constant name="PROPERTY_HINT_ARRAY_TYPE" value="31" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_PROPERTY_OF_SCRIPT" value="32" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_OBJECT_TOO_BIG" value="33" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_NODE_PATH_VALID_TYPES" value="34" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_SAVE_FILE" value="35" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_GLOBAL_SAVE_FILE" value="36" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_INT_IS_OBJECTID" value="37" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_INT_IS_POINTER" value="38" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_ARRAY_TYPE" value="39" enum="PropertyHint"> - </constant> - <constant name="PROPERTY_HINT_LOCALE_ID" value="40" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LOCALE_ID" value="32" enum="PropertyHint"> Hints that a string property is a locale code. Editing it will show a locale dialog for picking language and country. </constant> - <constant name="PROPERTY_HINT_LOCALIZABLE_STRING" value="41" enum="PropertyHint"> + <constant name="PROPERTY_HINT_LOCALIZABLE_STRING" value="33" enum="PropertyHint"> Hints that a dictionary property is string translation map. Dictionary keys are locale codes and, values are translated strings. </constant> - <constant name="PROPERTY_HINT_NODE_TYPE" value="42" enum="PropertyHint"> + <constant name="PROPERTY_HINT_NODE_TYPE" value="34" enum="PropertyHint"> </constant> - <constant name="PROPERTY_HINT_HIDE_QUATERNION_EDIT" value="43" enum="PropertyHint"> + <constant name="PROPERTY_HINT_HIDE_QUATERNION_EDIT" value="35" enum="PropertyHint"> Hints that a quaternion property should disable the temporary euler editor. </constant> - <constant name="PROPERTY_HINT_PASSWORD" value="44" enum="PropertyHint"> + <constant name="PROPERTY_HINT_PASSWORD" value="36" enum="PropertyHint"> Hints that a string property is a password, and every character is replaced with the secret character. </constant> - <constant name="PROPERTY_HINT_MAX" value="45" enum="PropertyHint"> + <constant name="PROPERTY_HINT_MAX" value="37" enum="PropertyHint"> </constant> <constant name="PROPERTY_USAGE_NONE" value="0" enum="PropertyUsageFlags" is_bitfield="true"> The property is not stored, and does not display in the editor. This is the default for non-exported properties. @@ -2849,15 +2833,14 @@ <constant name="PROPERTY_USAGE_EDITOR" value="4" enum="PropertyUsageFlags" is_bitfield="true"> The property is shown in the [EditorInspector] (default). </constant> - <constant name="PROPERTY_USAGE_CHECKABLE" value="8" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_INTERNAL" value="8" enum="PropertyUsageFlags" is_bitfield="true"> + </constant> + <constant name="PROPERTY_USAGE_CHECKABLE" value="16" enum="PropertyUsageFlags" is_bitfield="true"> The property can be checked in the [EditorInspector]. </constant> - <constant name="PROPERTY_USAGE_CHECKED" value="16" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_CHECKED" value="32" enum="PropertyUsageFlags" is_bitfield="true"> The property is checked in the [EditorInspector]. </constant> - <constant name="PROPERTY_USAGE_INTERNATIONALIZED" value="32" enum="PropertyUsageFlags" is_bitfield="true"> - The property is a translatable string. - </constant> <constant name="PROPERTY_USAGE_GROUP" value="64" enum="PropertyUsageFlags" is_bitfield="true"> Used to group properties together in the editor. See [EditorInspector]. </constant> @@ -2888,7 +2871,8 @@ </constant> <constant name="PROPERTY_USAGE_NIL_IS_VARIANT" value="131072" enum="PropertyUsageFlags" is_bitfield="true"> </constant> - <constant name="PROPERTY_USAGE_INTERNAL" value="262144" enum="PropertyUsageFlags" is_bitfield="true"> + <constant name="PROPERTY_USAGE_ARRAY" value="262144" enum="PropertyUsageFlags" is_bitfield="true"> + The property is an array. </constant> <constant name="PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE" value="524288" enum="PropertyUsageFlags" is_bitfield="true"> If the property is a [Resource], a new copy of it is always created when calling [method Node.duplicate] or [method Resource.duplicate]. @@ -2911,15 +2895,9 @@ <constant name="PROPERTY_USAGE_READ_ONLY" value="134217728" enum="PropertyUsageFlags" is_bitfield="true"> The property is read-only in the [EditorInspector]. </constant> - <constant name="PROPERTY_USAGE_ARRAY" value="268435456" enum="PropertyUsageFlags" is_bitfield="true"> - The property is an array. - </constant> <constant name="PROPERTY_USAGE_DEFAULT" value="6" enum="PropertyUsageFlags" is_bitfield="true"> Default usage (storage, editor and network). </constant> - <constant name="PROPERTY_USAGE_DEFAULT_INTL" value="38" enum="PropertyUsageFlags" is_bitfield="true"> - Default usage for translatable strings (storage, editor, network and internationalized). - </constant> <constant name="PROPERTY_USAGE_NO_EDITOR" value="2" enum="PropertyUsageFlags" is_bitfield="true"> Default usage but without showing the property in the editor (storage, network). </constant> diff --git a/doc/classes/JavaScriptBridge.xml b/doc/classes/JavaScriptBridge.xml index 5e36b5cc80..340c296eef 100644 --- a/doc/classes/JavaScriptBridge.xml +++ b/doc/classes/JavaScriptBridge.xml @@ -46,6 +46,13 @@ If [param use_global_execution_context] is [code]true[/code], the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment. </description> </method> + <method name="force_fs_sync"> + <return type="void" /> + <description> + Force synchronization of the persistent file system (when enabled). + [b]Note:[/b] This is only useful for modules or extensions that can't use [FileAccess] to write files. + </description> + </method> <method name="get_interface"> <return type="JavaScriptObject" /> <param index="0" name="interface" type="String" /> diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 425ca1c516..6c833c8a26 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -36,7 +36,6 @@ #include "core/io/marshalls.h" #include "core/os/os.h" #include "core/templates/hashfuncs.h" -#include "core/version.h" #include "drivers/vulkan/vulkan_context.h" #include "thirdparty/misc/smolv.h" @@ -4574,7 +4573,7 @@ String RenderingDeviceVulkan::_shader_uniform_debug(RID p_shader, int p_set) { #define SHADER_BINARY_VERSION 3 String RenderingDeviceVulkan::shader_get_binary_cache_key() const { - return "Vulkan-SV" + itos(SHADER_BINARY_VERSION) + "-" + String(VERSION_NUMBER) + "-" + String(VERSION_HASH); + return "Vulkan-SV" + itos(SHADER_BINARY_VERSION); } struct RenderingDeviceVulkanShaderBinaryDataBinding { diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp index 0258ac532f..a5bc90159a 100644 --- a/editor/editor_asset_installer.cpp +++ b/editor/editor_asset_installer.cpp @@ -120,7 +120,6 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) { // Mark C# support as unavailable. extension_guess["cs"] = tree->get_theme_icon(SNAME("ImportFail"), SNAME("EditorIcons")); } - extension_guess["vs"] = tree->get_theme_icon(SNAME("VisualScript"), SNAME("EditorIcons")); extension_guess["res"] = tree->get_theme_icon(SNAME("Resource"), SNAME("EditorIcons")); extension_guess["tres"] = tree->get_theme_icon(SNAME("Resource"), SNAME("EditorIcons")); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 18bb3f3dbb..03ece6c29b 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2336,7 +2336,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) { if (main_plugin && !skip_main_plugin) { // Special case if use of external editor is true. Resource *current_res = Object::cast_to<Resource>(current_obj); - if (main_plugin->get_name() == "Script" && !current_obj->is_class("VisualScript") && current_res && !current_res->is_built_in() && (bool(EDITOR_GET("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { + if (main_plugin->get_name() == "Script" && current_res && !current_res->is_built_in() && (bool(EDITOR_GET("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { if (!changing_scene) { main_plugin->edit(current_obj); } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 46aa798252..7aa050227d 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -68,7 +68,7 @@ EditorPropertyNil::EditorPropertyNil() { void EditorPropertyText::_set_read_only(bool p_read_only) { text->set_editable(!p_read_only); -}; +} void EditorPropertyText::_text_submitted(const String &p_string) { if (updating) { @@ -133,7 +133,7 @@ EditorPropertyText::EditorPropertyText() { void EditorPropertyMultilineText::_set_read_only(bool p_read_only) { text->set_editable(!p_read_only); open_big_text->set_disabled(p_read_only); -}; +} void EditorPropertyMultilineText::_big_text_changed() { text->set_text(big_text->get_text()); @@ -236,7 +236,7 @@ EditorPropertyMultilineText::EditorPropertyMultilineText(bool p_expression) { void EditorPropertyTextEnum::_set_read_only(bool p_read_only) { option_button->set_disabled(p_read_only); edit_button->set_disabled(p_read_only); -}; +} void EditorPropertyTextEnum::_emit_changed_value(String p_string) { if (string_name) { @@ -450,7 +450,7 @@ EditorPropertyLocale::EditorPropertyLocale() { void EditorPropertyPath::_set_read_only(bool p_read_only) { path->set_editable(!p_read_only); path_edit->set_disabled(p_read_only); -}; +} void EditorPropertyPath::_path_selected(const String &p_path) { emit_changed(get_edited_property(), p_path); @@ -588,7 +588,7 @@ EditorPropertyPath::EditorPropertyPath() { void EditorPropertyClassName::_set_read_only(bool p_read_only) { property->set_disabled(p_read_only); -}; +} void EditorPropertyClassName::setup(const String &p_base_type, const String &p_selected_type) { base_type = p_base_type; @@ -629,112 +629,11 @@ EditorPropertyClassName::EditorPropertyClassName() { add_child(dialog); } -///////////////////// MEMBER ///////////////////////// - -void EditorPropertyMember::_set_read_only(bool p_read_only) { - property->set_disabled(p_read_only); -}; - -void EditorPropertyMember::_property_selected(const String &p_selected) { - emit_changed(get_edited_property(), p_selected); - update_property(); -} - -void EditorPropertyMember::_property_select() { - if (!selector) { - selector = memnew(PropertySelector); - selector->connect("selected", callable_mp(this, &EditorPropertyMember::_property_selected)); - add_child(selector); - } - - String current = get_edited_object()->get(get_edited_property()); - - if (hint == MEMBER_METHOD_OF_VARIANT_TYPE) { - Variant::Type type = Variant::NIL; - for (int i = 0; i < Variant::VARIANT_MAX; i++) { - if (hint_text == Variant::get_type_name(Variant::Type(i))) { - type = Variant::Type(i); - } - } - if (type != Variant::NIL) { - selector->select_method_from_basic_type(type, current); - } - - } else if (hint == MEMBER_METHOD_OF_BASE_TYPE) { - selector->select_method_from_base_type(hint_text, current); - - } else if (hint == MEMBER_METHOD_OF_INSTANCE) { - Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int())); - if (instance) { - selector->select_method_from_instance(instance, current); - } - - } else if (hint == MEMBER_METHOD_OF_SCRIPT) { - Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int())); - if (Object::cast_to<Script>(obj)) { - selector->select_method_from_script(Object::cast_to<Script>(obj), current); - } - - } else if (hint == MEMBER_PROPERTY_OF_VARIANT_TYPE) { - Variant::Type type = Variant::NIL; - String tname = hint_text; - if (tname.contains(".")) { - tname = tname.get_slice(".", 0); - } - for (int i = 0; i < Variant::VARIANT_MAX; i++) { - if (tname == Variant::get_type_name(Variant::Type(i))) { - type = Variant::Type(Variant::Type(i)); - } - } - - if (type != Variant::NIL) { - selector->select_property_from_basic_type(type, current); - } - - } else if (hint == MEMBER_PROPERTY_OF_BASE_TYPE) { - selector->select_property_from_base_type(hint_text, current); - - } else if (hint == MEMBER_PROPERTY_OF_INSTANCE) { - Object *instance = ObjectDB::get_instance(ObjectID(hint_text.to_int())); - if (instance) { - selector->select_property_from_instance(instance, current); - } - - } else if (hint == MEMBER_PROPERTY_OF_SCRIPT) { - Object *obj = ObjectDB::get_instance(ObjectID(hint_text.to_int())); - if (Object::cast_to<Script>(obj)) { - selector->select_property_from_script(Object::cast_to<Script>(obj), current); - } - } -} - -void EditorPropertyMember::setup(Type p_hint, const String &p_hint_text) { - hint = p_hint; - hint_text = p_hint_text; -} - -void EditorPropertyMember::update_property() { - String full_path = get_edited_object()->get(get_edited_property()); - property->set_text(full_path); -} - -void EditorPropertyMember::_bind_methods() { -} - -EditorPropertyMember::EditorPropertyMember() { - selector = nullptr; - property = memnew(Button); - property->set_clip_text(true); - add_child(property); - add_focusable(property); - property->connect("pressed", callable_mp(this, &EditorPropertyMember::_property_select)); -} - ///////////////////// CHECK ///////////////////////// void EditorPropertyCheck::_set_read_only(bool p_read_only) { checkbox->set_disabled(p_read_only); -}; +} void EditorPropertyCheck::_checkbox_pressed() { emit_changed(get_edited_property(), checkbox->is_pressed()); @@ -761,7 +660,7 @@ EditorPropertyCheck::EditorPropertyCheck() { void EditorPropertyEnum::_set_read_only(bool p_read_only) { options->set_disabled(p_read_only); -}; +} void EditorPropertyEnum::_option_selected(int p_which) { int64_t val = options->get_item_metadata(p_which); @@ -820,7 +719,7 @@ void EditorPropertyFlags::_set_read_only(bool p_read_only) { for (CheckBox *check : flags) { check->set_disabled(p_read_only); } -}; +} void EditorPropertyFlags::_flag_toggled(int p_index) { uint32_t value = get_edited_object()->get(get_edited_property()); @@ -1186,7 +1085,7 @@ void EditorPropertyLayers::_notification(int p_what) { void EditorPropertyLayers::_set_read_only(bool p_read_only) { button->set_disabled(p_read_only); grid->set_read_only(p_read_only); -}; +} void EditorPropertyLayers::_grid_changed(uint32_t p_grid) { emit_changed(get_edited_property(), p_grid); @@ -1359,7 +1258,7 @@ EditorPropertyLayers::EditorPropertyLayers() { void EditorPropertyInteger::_set_read_only(bool p_read_only) { spin->set_read_only(p_read_only); -}; +} void EditorPropertyInteger::_value_changed(int64_t val) { if (setting) { @@ -1406,7 +1305,7 @@ EditorPropertyInteger::EditorPropertyInteger() { void EditorPropertyObjectID::_set_read_only(bool p_read_only) { edit->set_disabled(p_read_only); -}; +} void EditorPropertyObjectID::_edit_pressed() { emit_signal(SNAME("object_id_selected"), get_edited_property(), get_edited_object()->get(get_edited_property())); @@ -1496,7 +1395,7 @@ EditorPropertyCallable::EditorPropertyCallable() { void EditorPropertyFloat::_set_read_only(bool p_read_only) { spin->set_read_only(p_read_only); -}; +} void EditorPropertyFloat::_value_changed(double val) { if (setting) { @@ -1546,7 +1445,7 @@ EditorPropertyFloat::EditorPropertyFloat() { void EditorPropertyEasing::_set_read_only(bool p_read_only) { spin->set_read_only(p_read_only); -}; +} void EditorPropertyEasing::_drag_easing(const Ref<InputEvent> &p_ev) { if (is_read_only()) { @@ -1769,7 +1668,7 @@ void EditorPropertyVector2::_set_read_only(bool p_read_only) { for (int i = 0; i < 2; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyVector2::_value_changed(double val, const String &p_name) { if (setting) { @@ -1900,7 +1799,7 @@ void EditorPropertyRect2::_set_read_only(bool p_read_only) { for (int i = 0; i < 4; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyRect2::_value_changed(double val, const String &p_name) { if (setting) { @@ -2003,7 +1902,7 @@ void EditorPropertyVector3::_set_read_only(bool p_read_only) { for (int i = 0; i < 3; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyVector3::_value_changed(double val, const String &p_name) { if (setting) { @@ -2182,7 +2081,7 @@ void EditorPropertyVector2i::_set_read_only(bool p_read_only) { for (int i = 0; i < 2; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyVector2i::_value_changed(double val, const String &p_name) { if (setting) { @@ -2312,7 +2211,7 @@ void EditorPropertyRect2i::_set_read_only(bool p_read_only) { for (int i = 0; i < 4; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyRect2i::_value_changed(double val, const String &p_name) { if (setting) { @@ -2414,7 +2313,7 @@ void EditorPropertyVector3i::_set_read_only(bool p_read_only) { for (int i = 0; i < 3; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyVector3i::_value_changed(double val, const String &p_name) { if (setting) { @@ -2564,7 +2463,7 @@ void EditorPropertyPlane::_set_read_only(bool p_read_only) { for (int i = 0; i < 4; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyPlane::_value_changed(double val, const String &p_name) { if (setting) { @@ -2660,7 +2559,7 @@ void EditorPropertyQuaternion::_set_read_only(bool p_read_only) { for (int i = 0; i < 3; i++) { euler[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyQuaternion::_edit_custom_value() { if (edit_button->is_pressed()) { @@ -2873,7 +2772,7 @@ void EditorPropertyVector4::_set_read_only(bool p_read_only) { for (int i = 0; i < 4; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyVector4::_value_changed(double val, const String &p_name) { if (setting) { @@ -2963,7 +2862,7 @@ void EditorPropertyVector4i::_set_read_only(bool p_read_only) { for (int i = 0; i < 4; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyVector4i::_value_changed(double val, const String &p_name) { if (setting) { @@ -3052,7 +2951,7 @@ void EditorPropertyAABB::_set_read_only(bool p_read_only) { for (int i = 0; i < 6; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyAABB::_value_changed(double val, const String &p_name) { if (setting) { @@ -3135,7 +3034,7 @@ void EditorPropertyTransform2D::_set_read_only(bool p_read_only) { for (int i = 0; i < 6; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyTransform2D::_value_changed(double val, const String &p_name) { if (setting) { @@ -3226,7 +3125,7 @@ void EditorPropertyBasis::_set_read_only(bool p_read_only) { for (int i = 0; i < 9; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyBasis::_value_changed(double val, const String &p_name) { if (setting) { @@ -3316,7 +3215,7 @@ void EditorPropertyTransform3D::_set_read_only(bool p_read_only) { for (int i = 0; i < 12; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyTransform3D::_value_changed(double val, const String &p_name) { if (setting) { @@ -3414,7 +3313,7 @@ void EditorPropertyProjection::_set_read_only(bool p_read_only) { for (int i = 0; i < 12; i++) { spin[i]->set_read_only(p_read_only); } -}; +} void EditorPropertyProjection::_value_changed(double val, const String &p_name) { if (setting) { @@ -3517,7 +3416,7 @@ EditorPropertyProjection::EditorPropertyProjection() { void EditorPropertyColor::_set_read_only(bool p_read_only) { picker->set_disabled(p_read_only); -}; +} void EditorPropertyColor::_color_changed(const Color &p_color) { // Cancel the color change if the current color is identical to the new one. @@ -3819,7 +3718,7 @@ EditorPropertyRID::EditorPropertyRID() { void EditorPropertyResource::_set_read_only(bool p_read_only) { resource_picker->set_editable(!p_read_only); -}; +} void EditorPropertyResource::_resource_selected(const Ref<Resource> &p_resource, bool p_inspect) { if (p_resource->is_built_in() && !p_resource->get_path().is_empty()) { @@ -3928,12 +3827,10 @@ void EditorPropertyResource::_resource_changed(const Ref<Resource> &p_resource) } } - // Make visual script the correct type. - Ref<Script> s = p_resource; - // The bool is_script applies only to an object's main script. // Changing the value of Script-type exported variables of the main script should not trigger saving/reloading properties. bool is_script = false; + Ref<Script> s = p_resource; if (get_edited_object() && s.is_valid() && get_edited_property() == CoreStringNames::get_singleton()->_script) { is_script = true; InspectorDock::get_singleton()->store_script_properties(get_edited_object()); @@ -4489,45 +4386,6 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ editor->set_save_mode(); } return editor; - } else if (p_hint == PROPERTY_HINT_METHOD_OF_VARIANT_TYPE || - p_hint == PROPERTY_HINT_METHOD_OF_BASE_TYPE || - p_hint == PROPERTY_HINT_METHOD_OF_INSTANCE || - p_hint == PROPERTY_HINT_METHOD_OF_SCRIPT || - p_hint == PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE || - p_hint == PROPERTY_HINT_PROPERTY_OF_BASE_TYPE || - p_hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE || - p_hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) { - EditorPropertyMember *editor = memnew(EditorPropertyMember); - - EditorPropertyMember::Type type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE; - switch (p_hint) { - case PROPERTY_HINT_METHOD_OF_BASE_TYPE: - type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE; - break; - case PROPERTY_HINT_METHOD_OF_INSTANCE: - type = EditorPropertyMember::MEMBER_METHOD_OF_INSTANCE; - break; - case PROPERTY_HINT_METHOD_OF_SCRIPT: - type = EditorPropertyMember::MEMBER_METHOD_OF_SCRIPT; - break; - case PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE: - type = EditorPropertyMember::MEMBER_PROPERTY_OF_VARIANT_TYPE; - break; - case PROPERTY_HINT_PROPERTY_OF_BASE_TYPE: - type = EditorPropertyMember::MEMBER_PROPERTY_OF_BASE_TYPE; - break; - case PROPERTY_HINT_PROPERTY_OF_INSTANCE: - type = EditorPropertyMember::MEMBER_PROPERTY_OF_INSTANCE; - break; - case PROPERTY_HINT_PROPERTY_OF_SCRIPT: - type = EditorPropertyMember::MEMBER_PROPERTY_OF_SCRIPT; - break; - default: { - } - } - editor->setup(type, p_hint_text); - return editor; - } else { EditorPropertyText *editor = memnew(EditorPropertyText); if (p_hint == PROPERTY_HINT_PLACEHOLDER_TEXT) { diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 03e318b706..a255af30ee 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -203,40 +203,6 @@ public: EditorPropertyClassName(); }; -class EditorPropertyMember : public EditorProperty { - GDCLASS(EditorPropertyMember, EditorProperty); - -public: - enum Type { - MEMBER_METHOD_OF_VARIANT_TYPE, ///< a method of a type - MEMBER_METHOD_OF_BASE_TYPE, ///< a method of a base type - MEMBER_METHOD_OF_INSTANCE, ///< a method of an instance - MEMBER_METHOD_OF_SCRIPT, ///< a method of a script & base - MEMBER_PROPERTY_OF_VARIANT_TYPE, ///< a property of a type - MEMBER_PROPERTY_OF_BASE_TYPE, ///< a property of a base type - MEMBER_PROPERTY_OF_INSTANCE, ///< a property of an instance - MEMBER_PROPERTY_OF_SCRIPT, ///< a property of a script & base - }; - -private: - Type hint; - PropertySelector *selector = nullptr; - Button *property = nullptr; - String hint_text; - - void _property_selected(const String &p_selected); - void _property_select(); - -protected: - virtual void _set_read_only(bool p_read_only) override; - static void _bind_methods(); - -public: - void setup(Type p_hint, const String &p_hint_text); - virtual void update_property() override; - EditorPropertyMember(); -}; - class EditorPropertyCheck : public EditorProperty { GDCLASS(EditorPropertyCheck, EditorProperty); CheckBox *checkbox = nullptr; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 96c8aa6fb5..d8252bed9c 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -133,25 +133,26 @@ void EditorColorMap::create() { add_conversion_color_pair("#0e71fc", "#0350bd"); // New Autotile add_conversion_color_pair("#c6ced4", "#828f9b"); // New Atlas - // Visual script - add_conversion_color_pair("#41ecad", "#25e3a0"); // VisualScript variant - add_conversion_color_pair("#6f91f0", "#6d8eeb"); // VisualScript bool - add_conversion_color_pair("#5abbef", "#4fb2e9"); // VisualScript int - add_conversion_color_pair("#35d4f4", "#27ccf0"); // VisualScript float - add_conversion_color_pair("#4593ec", "#4690e7"); // VisualScript String - add_conversion_color_pair("#ac73f1", "#ad76ee"); // VisualScript Vector2 - add_conversion_color_pair("#f1738f", "#ee758e"); // VisualScript Rect2 - add_conversion_color_pair("#de66f0", "#dc6aed"); // VisualScript Vector3 - add_conversion_color_pair("#b9ec41", "#96ce1a"); // VisualScript Transform2D - add_conversion_color_pair("#f74949", "#f77070"); // VisualScript Plane - add_conversion_color_pair("#ec418e", "#ec69a3"); // VisualScript Quat - add_conversion_color_pair("#ee5677", "#ee7991"); // VisualScript AABB - add_conversion_color_pair("#e1ec41", "#b2bb19"); // VisualScript Basis - add_conversion_color_pair("#f68f45", "#f49047"); // VisualScript Transform - add_conversion_color_pair("#417aec", "#6993ec"); // VisualScript NodePath - add_conversion_color_pair("#41ec80", "#2ce573"); // VisualScript RID - add_conversion_color_pair("#55f3e3", "#12d5c3"); // VisualScript Object - add_conversion_color_pair("#54ed9e", "#57e99f"); // VisualScript Dictionary + // Variant types + add_conversion_color_pair("#41ecad", "#25e3a0"); // Variant + add_conversion_color_pair("#6f91f0", "#6d8eeb"); // bool + add_conversion_color_pair("#5abbef", "#4fb2e9"); // int + add_conversion_color_pair("#35d4f4", "#27ccf0"); // float + add_conversion_color_pair("#4593ec", "#4690e7"); // String + add_conversion_color_pair("#ac73f1", "#ad76ee"); // Vector2 + add_conversion_color_pair("#f1738f", "#ee758e"); // Rect2 + add_conversion_color_pair("#de66f0", "#dc6aed"); // Vector3 + add_conversion_color_pair("#b9ec41", "#96ce1a"); // Transform2D + add_conversion_color_pair("#f74949", "#f77070"); // Plane + add_conversion_color_pair("#ec418e", "#ec69a3"); // Quaternion + add_conversion_color_pair("#ee5677", "#ee7991"); // AABB + add_conversion_color_pair("#e1ec41", "#b2bb19"); // Basis + add_conversion_color_pair("#f68f45", "#f49047"); // Transform3D + add_conversion_color_pair("#417aec", "#6993ec"); // NodePath + add_conversion_color_pair("#41ec80", "#2ce573"); // RID + add_conversion_color_pair("#55f3e3", "#12d5c3"); // Object + add_conversion_color_pair("#54ed9e", "#57e99f"); // Dictionary + // Visual shaders add_conversion_color_pair("#77ce57", "#67c046"); // Vector funcs add_conversion_color_pair("#ea686c", "#d95256"); // Vector transforms diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 628ed44aa1..a23874ea05 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -223,7 +223,6 @@ void ScriptEditorBase::_bind_methods() { ADD_SIGNAL(MethodInfo("request_open_script_at_line", PropertyInfo(Variant::OBJECT, "script"), PropertyInfo(Variant::INT, "line"))); ADD_SIGNAL(MethodInfo("request_save_history")); ADD_SIGNAL(MethodInfo("go_to_help", PropertyInfo(Variant::STRING, "what"))); - // TODO: This signal is no use for VisualScript. ADD_SIGNAL(MethodInfo("search_in_files_requested", PropertyInfo(Variant::STRING, "text"))); ADD_SIGNAL(MethodInfo("replace_in_files_requested", PropertyInfo(Variant::STRING, "text"))); ADD_SIGNAL(MethodInfo("go_to_method", PropertyInfo(Variant::OBJECT, "script"), PropertyInfo(Variant::STRING, "method"))); @@ -2205,8 +2204,7 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col, if (use_external_editor && (EditorDebuggerNode::get_singleton()->get_dump_stack_script() != p_resource || EditorDebuggerNode::get_singleton()->get_debug_with_external_editor()) && - p_resource->get_path().is_resource_file() && - !p_resource->is_class("VisualScript")) { + p_resource->get_path().is_resource_file()) { String path = EDITOR_GET("text_editor/external/exec_path"); String flags = EDITOR_GET("text_editor/external/exec_flags"); @@ -2305,21 +2303,20 @@ bool ScriptEditor::edit(const Ref<Resource> &p_resource, int p_line, int p_col, se->set_edited_resource(p_resource); - if (!p_resource->is_class("VisualScript")) { - bool highlighter_set = false; - for (int i = 0; i < syntax_highlighters.size(); i++) { - Ref<EditorSyntaxHighlighter> highlighter = syntax_highlighters[i]->_create(); - if (highlighter.is_null()) { - continue; - } - se->add_syntax_highlighter(highlighter); + // Syntax highlighting. + bool highlighter_set = false; + for (int i = 0; i < syntax_highlighters.size(); i++) { + Ref<EditorSyntaxHighlighter> highlighter = syntax_highlighters[i]->_create(); + if (highlighter.is_null()) { + continue; + } + se->add_syntax_highlighter(highlighter); - if (scr != nullptr && !highlighter_set) { - PackedStringArray languages = highlighter->_get_supported_languages(); - if (languages.has(scr->get_language()->get_name())) { - se->set_syntax_highlighter(highlighter); - highlighter_set = true; - } + if (scr != nullptr && !highlighter_set) { + PackedStringArray languages = highlighter->_get_supported_languages(); + if (languages.has(scr->get_language()->get_name())) { + se->set_syntax_highlighter(highlighter); + highlighter_set = true; } } } diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp index 22d118cd90..1d08c1fe5f 100644 --- a/editor/project_converter_3_to_4.cpp +++ b/editor/project_converter_3_to_4.cpp @@ -122,9 +122,6 @@ static const char *enum_renames[][2] = { { "JOINT_SLIDER", "JOINT_TYPE_SLIDER" }, // PhysicsServer3D { "KEY_CONTROL", "KEY_CTRL" }, // Globals { "LOOP_PING_PONG", "LOOP_PINGPONG" }, // AudioStreamWAV - { "MATH_RAND", "MATH_RANDF_RANGE" }, // VisualScriptBuiltinFunc - { "MATH_RANDOM", "MATH_RANDI_RANGE" }, // VisualScriptBuiltinFunc - { "MATH_STEPIFY", "MATH_STEP_DECIMALS" }, // VisualScriptBuiltinFunc { "MODE_KINEMATIC", "FREEZE_MODE_KINEMATIC" }, // RigidBody { "MODE_OPEN_ANY", "FILE_MODE_OPEN_ANY" }, // FileDialog { "MODE_OPEN_DIR", "FILE_MODE_OPEN_DIR" }, // FileDialog diff --git a/methods.py b/methods.py index 99a59b49e3..ee88401671 100644 --- a/methods.py +++ b/methods.py @@ -111,6 +111,10 @@ def get_version_info(module_version_string="", silent=False): head = open(os.path.join(gitfolder, "HEAD"), "r", encoding="utf8").readline().strip() if head.startswith("ref: "): ref = head[5:] + # If this directory is a Git worktree instead of a root clone. + parts = gitfolder.split("/") + if len(parts) > 2 and parts[-2] == "worktrees": + gitfolder = "/".join(parts[0:-2]) head = os.path.join(gitfolder, ref) packedrefs = os.path.join(gitfolder, "packed-refs") if os.path.isfile(head): diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotEnums.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotEnums.cs index 7f1231dbcb..5fb29b86da 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotEnums.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/GodotEnums.cs @@ -74,27 +74,19 @@ namespace Godot.SourceGenerators ObjectId = 22, TypeString = 23, NodePathToEditedNode = 24, - MethodOfVariantType = 25, - MethodOfBaseType = 26, - MethodOfInstance = 27, - MethodOfScript = 28, - PropertyOfVariantType = 29, - PropertyOfBaseType = 30, - PropertyOfInstance = 31, - PropertyOfScript = 32, - ObjectTooBig = 33, - NodePathValidTypes = 34, - SaveFile = 35, - GlobalSaveFile = 36, - IntIsObjectid = 37, - IntIsPointer = 38, - ArrayType = 39, - LocaleId = 40, - LocalizableString = 41, - NodeType = 42, - HideQuaternionEdit = 43, - Password = 44, - Max = 45 + ObjectTooBig = 25, + NodePathValidTypes = 26, + SaveFile = 27, + GlobalSaveFile = 28, + IntIsObjectid = 29, + IntIsPointer = 30, + ArrayType = 31, + LocaleId = 32, + LocalizableString = 33, + NodeType = 34, + HideQuaternionEdit = 35, + Password = 36, + Max = 37 } [Flags] @@ -103,9 +95,9 @@ namespace Godot.SourceGenerators None = 0, Storage = 2, Editor = 4, - Checkable = 8, - Checked = 16, - Internationalized = 32, + Internal = 8, + Checkable = 16, + Checked = 32, Group = 64, Category = 128, Subgroup = 256, @@ -118,7 +110,7 @@ namespace Godot.SourceGenerators ScriptDefaultValue = 32768, ClassIsEnum = 65536, NilIsVariant = 131072, - Internal = 262144, + Array = 262144, DoNotShareOnDuplicate = 524288, HighEndGfx = 1048576, NodePathFromSceneRoot = 2097152, @@ -128,9 +120,7 @@ namespace Godot.SourceGenerators EditorInstantiateObject = 33554432, EditorBasicSetting = 67108864, ReadOnly = 134217728, - Array = 268435456, Default = 6, - DefaultIntl = 38, NoEditor = 2 } diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index e40b17cecb..c0d88553ad 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -3806,7 +3806,7 @@ void BindingsGenerator::_populate_global_constants() { if (enum_name != StringName()) { EnumInterface ienum(enum_name); - // TODO: ienum.is_flags is always false for core constants since they don't seem to support bitfield enums + ienum.is_flags = CoreConstants::is_global_constant_bitfield(i); List<EnumInterface>::Element *enum_match = global_enums.find(ienum); if (enum_match) { enum_match->get().constants.push_back(iconstant); diff --git a/platform/web/api/api.cpp b/platform/web/api/api.cpp index eb3a199ae1..a630e3d866 100644 --- a/platform/web/api/api.cpp +++ b/platform/web/api/api.cpp @@ -73,6 +73,7 @@ void JavaScriptBridge::_bind_methods() { ClassDB::bind_method(D_METHOD("download_buffer", "buffer", "name", "mime"), &JavaScriptBridge::download_buffer, DEFVAL("application/octet-stream")); ClassDB::bind_method(D_METHOD("pwa_needs_update"), &JavaScriptBridge::pwa_needs_update); ClassDB::bind_method(D_METHOD("pwa_update"), &JavaScriptBridge::pwa_update); + ClassDB::bind_method(D_METHOD("force_fs_sync"), &JavaScriptBridge::force_fs_sync); ADD_SIGNAL(MethodInfo("pwa_update_available")); } @@ -111,6 +112,8 @@ bool JavaScriptBridge::pwa_needs_update() const { Error JavaScriptBridge::pwa_update() { return ERR_UNAVAILABLE; } +void JavaScriptBridge::force_fs_sync() { +} void JavaScriptBridge::download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime) { } #endif diff --git a/platform/web/api/javascript_bridge_singleton.h b/platform/web/api/javascript_bridge_singleton.h index bcf1ed653a..456fa6b313 100644 --- a/platform/web/api/javascript_bridge_singleton.h +++ b/platform/web/api/javascript_bridge_singleton.h @@ -61,6 +61,7 @@ public: void download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime = "application/octet-stream"); bool pwa_needs_update() const; Error pwa_update(); + void force_fs_sync(); static JavaScriptBridge *get_singleton(); JavaScriptBridge(); diff --git a/platform/web/javascript_bridge_singleton.cpp b/platform/web/javascript_bridge_singleton.cpp index 308ca2d5de..dba630404f 100644 --- a/platform/web/javascript_bridge_singleton.cpp +++ b/platform/web/javascript_bridge_singleton.cpp @@ -361,6 +361,11 @@ void JavaScriptBridge::download_buffer(Vector<uint8_t> p_arr, const String &p_na bool JavaScriptBridge::pwa_needs_update() const { return OS_Web::get_singleton()->pwa_needs_update(); } + Error JavaScriptBridge::pwa_update() { return OS_Web::get_singleton()->pwa_update(); } + +void JavaScriptBridge::force_fs_sync() { + OS_Web::get_singleton()->force_fs_sync(); +} diff --git a/platform/web/os_web.cpp b/platform/web/os_web.cpp index cb304ce7ac..e12f62f4ad 100644 --- a/platform/web/os_web.cpp +++ b/platform/web/os_web.cpp @@ -196,6 +196,12 @@ void OS_Web::update_pwa_state_callback() { } } +void OS_Web::force_fs_sync() { + if (is_userfs_persistent()) { + idb_needs_sync = true; + } +} + Error OS_Web::pwa_update() { return godot_js_pwa_update() ? FAILED : OK; } diff --git a/platform/web/os_web.h b/platform/web/os_web.h index c8fdea2ee0..70d8af9db9 100644 --- a/platform/web/os_web.h +++ b/platform/web/os_web.h @@ -69,6 +69,7 @@ public: bool pwa_needs_update() const { return pwa_is_waiting; } Error pwa_update(); + void force_fs_sync(); void initialize_joypads() override; diff --git a/platform/web/package-lock.json b/platform/web/package-lock.json index e1428546c6..4399e8243c 100644 --- a/platform/web/package-lock.json +++ b/platform/web/package-lock.json @@ -1529,9 +1529,9 @@ "dev": true }, "node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -3662,9 +3662,9 @@ "dev": true }, "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp index e73bd460ed..e8b51ceb92 100644 --- a/scene/3d/soft_body_3d.cpp +++ b/scene/3d/soft_body_3d.cpp @@ -368,7 +368,7 @@ void SoftBody3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_layer", "get_collision_layer"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); - ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "parent_collision_ignore", PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE, "Parent collision object"), "set_parent_collision_ignore", "get_parent_collision_ignore"); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "parent_collision_ignore", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "CollisionObject3D"), "set_parent_collision_ignore", "get_parent_collision_ignore"); ADD_PROPERTY(PropertyInfo(Variant::INT, "simulation_precision", PROPERTY_HINT_RANGE, "1,100,1"), "set_simulation_precision", "get_simulation_precision"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "total_mass", PROPERTY_HINT_RANGE, "0.01,10000,1"), "set_total_mass", "get_total_mass"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "linear_stiffness", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_linear_stiffness", "get_linear_stiffness"); diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 46764b64b2..1e07a53642 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -572,7 +572,7 @@ void Button::_bind_methods() { ClassDB::bind_method(D_METHOD("set_expand_icon", "enabled"), &Button::set_expand_icon); ClassDB::bind_method(D_METHOD("is_expand_icon"), &Button::is_expand_icon); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT_INTL), "set_text", "get_text"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_button_icon", "get_button_icon"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flat"), "set_flat", "is_flat"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_text"), "set_clip_text", "get_clip_text"); diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 1d5e6320dd..4365db2ea2 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -378,7 +378,7 @@ void AcceptDialog::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "ok_button_text"), "set_ok_button_text", "get_ok_button_text"); ADD_GROUP("Dialog", "dialog_"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "dialog_text", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT_INTL), "set_text", "get_text"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "dialog_text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dialog_hide_on_ok"), "set_hide_on_ok", "get_hide_on_ok"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dialog_close_on_escape"), "set_close_on_escape", "get_close_on_escape"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dialog_autowrap"), "set_autowrap", "has_autowrap"); diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 81e5de1886..cafea83f16 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -949,7 +949,7 @@ void Label::_bind_methods() { ClassDB::bind_method(D_METHOD("set_structured_text_bidi_override_options", "args"), &Label::set_structured_text_bidi_override_options); ClassDB::bind_method(D_METHOD("get_structured_text_bidi_override_options"), &Label::get_structured_text_bidi_override_options); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT_INTL), "set_text", "get_text"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "label_settings", PROPERTY_HINT_RESOURCE_TYPE, "LabelSettings"), "set_label_settings", "get_label_settings"); ADD_PROPERTY(PropertyInfo(Variant::INT, "horizontal_alignment", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), "set_horizontal_alignment", "get_horizontal_alignment"); ADD_PROPERTY(PropertyInfo(Variant::INT, "vertical_alignment", PROPERTY_HINT_ENUM, "Top,Center,Bottom,Fill"), "set_vertical_alignment", "get_vertical_alignment"); diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp index d262959e8a..224e405d41 100644 --- a/scene/gui/menu_bar.cpp +++ b/scene/gui/menu_bar.cpp @@ -842,27 +842,6 @@ String MenuBar::get_tooltip(const Point2 &p_pos) const { } } -void MenuBar::get_translatable_strings(List<String> *p_strings) const { - Vector<PopupMenu *> popups = _get_popups(); - for (int i = 0; i < popups.size(); i++) { - PopupMenu *pm = popups[i]; - - if (!pm->has_meta("_menu_name") && !pm->has_meta("_menu_tooltip")) { - continue; - } - - String name = pm->get_meta("_menu_name"); - if (!name.is_empty()) { - p_strings->push_back(name); - } - - String tooltip = pm->get_meta("_menu_tooltip"); - if (!tooltip.is_empty()) { - p_strings->push_back(tooltip); - } - } -} - MenuBar::MenuBar() { set_process_shortcut_input(true); } diff --git a/scene/gui/menu_bar.h b/scene/gui/menu_bar.h index 306fcc01ab..3436978a0e 100644 --- a/scene/gui/menu_bar.h +++ b/scene/gui/menu_bar.h @@ -170,7 +170,6 @@ public: PopupMenu *get_menu_popup(int p_menu) const; - virtual void get_translatable_strings(List<String> *p_strings) const override; virtual String get_tooltip(const Point2 &p_pos) const override; MenuBar(); diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index f21b5f43c6..027c97b383 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -519,10 +519,6 @@ void OptionButton::show_popup() { popup->popup(); } -void OptionButton::get_translatable_strings(List<String> *p_strings) const { - popup->get_translatable_strings(p_strings); -} - void OptionButton::_validate_property(PropertyInfo &p_property) const { if (p_property.name == "text" || p_property.name == "icon") { p_property.usage = PROPERTY_USAGE_NONE; diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index 9e409356e2..d8e2f3209d 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -125,8 +125,6 @@ public: PopupMenu *get_popup() const; void show_popup(); - virtual void get_translatable_strings(List<String> *p_strings) const override; - OptionButton(const String &p_text = String()); ~OptionButton(); }; diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 4fc0e5b05e..4e8a44dd63 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1841,14 +1841,6 @@ void PopupMenu::set_parent_rect(const Rect2 &p_rect) { parent_rect = p_rect; } -void PopupMenu::get_translatable_strings(List<String> *p_strings) const { - for (int i = 0; i < items.size(); i++) { - if (!items[i].xl_text.is_empty()) { - p_strings->push_back(items[i].xl_text); - } - } -} - void PopupMenu::add_autohide_area(const Rect2 &p_area) { autohide_areas.push_back(p_area); } diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 94bb93c867..bcc02a890f 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -284,8 +284,6 @@ public: virtual String get_tooltip(const Point2 &p_pos) const; - virtual void get_translatable_strings(List<String> *p_strings) const override; - void add_autohide_area(const Rect2 &p_area); void clear_autohide_areas(); diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 0d7b055ce8..cd1ebba5d1 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -803,22 +803,6 @@ Ref<Texture2D> TabContainer::get_tab_button_icon(int p_tab) const { return tab_bar->get_tab_button_icon(p_tab); } -void TabContainer::get_translatable_strings(List<String> *p_strings) const { - Vector<Control *> controls = _get_tab_controls(); - for (int i = 0; i < controls.size(); i++) { - Control *c = controls[i]; - - if (!c->has_meta("_tab_name")) { - continue; - } - - String name = c->get_meta("_tab_name"); - if (!name.is_empty()) { - p_strings->push_back(name); - } - } -} - Size2 TabContainer::get_minimum_size() const { Size2 ms; diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index 4a0205c2f4..3020e1fada 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -147,8 +147,6 @@ public: virtual Size2 get_minimum_size() const override; - virtual void get_translatable_strings(List<String> *p_strings) const override; - void set_popup(Node *p_popup); Popup *get_popup() const; diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp index ab64ae1055..2d5263a3e2 100644 --- a/servers/rendering/renderer_rd/shader_rd.cpp +++ b/servers/rendering/renderer_rd/shader_rd.cpp @@ -33,6 +33,7 @@ #include "core/io/compression.h" #include "core/io/dir_access.h" #include "core/io/file_access.h" +#include "core/version.h" #include "renderer_compositor_rd.h" #include "servers/rendering/rendering_device.h" #include "thirdparty/misc/smolv.h" @@ -116,6 +117,10 @@ void ShaderRD::setup(const char *p_vertex_code, const char *p_fragment_code, con } StringBuilder tohash; + tohash.append("[GodotVersionNumber]"); + tohash.append(VERSION_NUMBER); + tohash.append("[GodotVersionHash]"); + tohash.append(VERSION_HASH); tohash.append("[SpirvCacheKey]"); tohash.append(RenderingDevice::get_singleton()->shader_get_spirv_cache_key()); tohash.append("[BinaryCacheKey]"); |