summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-09 16:57:31 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-09 16:57:31 +0100
commit64f2b970d8b4d2dec9a7f8047e0b5071cf41acbf (patch)
tree01c744e85a2fceeade174a61d4cfbdd7ec8a9f35 /scene
parentdfa20725bc8cd3babaffdbc0c40432457abb07d9 (diff)
parent0e0a6bb39b81eda80fbfc7195aee580d1c173d35 (diff)
Merge pull request #71114 from reduz/cleanup-property-hints
Removed unused property hints and `Object::get_translatable_strings()`
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/soft_body_3d.cpp2
-rw-r--r--scene/gui/button.cpp2
-rw-r--r--scene/gui/dialogs.cpp2
-rw-r--r--scene/gui/label.cpp2
-rw-r--r--scene/gui/menu_bar.cpp21
-rw-r--r--scene/gui/menu_bar.h1
-rw-r--r--scene/gui/option_button.cpp4
-rw-r--r--scene/gui/option_button.h2
-rw-r--r--scene/gui/popup_menu.cpp8
-rw-r--r--scene/gui/popup_menu.h2
-rw-r--r--scene/gui/tab_container.cpp16
-rw-r--r--scene/gui/tab_container.h2
12 files changed, 4 insertions, 60 deletions
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;