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>
This commit is contained in:
parent
964fc6e15d
commit
0e0a6bb39b
@ -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);
|
||||
|
@ -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"];
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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).
|
||||
|
@ -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>
|
||||
|
@ -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"));
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user