summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2023-01-09 15:31:44 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-09 16:56:01 +0100
commit0e0a6bb39b81eda80fbfc7195aee580d1c173d35 (patch)
tree1007aa12eb23aea5412c2d8a9c7f540a47940305 /core/object
parent964fc6e15d8631a06c2f442299759041328a8473 (diff)
Removed unused property hints and `Object::get_translatable_strings()`
* Remove unused `EditorPropertyMember` and related hints, previouly used by VisualScript. Such logic should be implemented in the VS module itself. * As the above broke compatibility with the VS module, clean up the other hacks that were still in core in support of VisualScript. * `PROPERTY_USAGE_INTERNATIONALIZED` was only used in Object's `get_translatable_strings()`, which is a legacy function not used anywhere. So both are removed. * Reordered some usage flags after the above removal to minimize the diff. * General clean up. Fixes #30203. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Diffstat (limited to 'core/object')
-rw-r--r--core/object/object.cpp19
-rw-r--r--core/object/object.h21
2 files changed, 4 insertions, 36 deletions
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).