summaryrefslogtreecommitdiffstats
path: root/scene/gui/control.cpp
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2024-01-03 12:10:11 +0100
committerMicky <micheledevita2@gmail.com>2024-02-29 18:00:54 +0100
commitcd2032a90b7b1a499ccf08fbf62d70e0ac9bb8fa (patch)
treeb14b54af89e1c8c0a090e66a767c2f715415d819 /scene/gui/control.cpp
parentbb6b06c81343073f10cbbd2af515cf0dac1e6549 (diff)
downloadredot-engine-cd2032a90b7b1a499ccf08fbf62d70e0ac9bb8fa.tar.gz
Optimise Object's `get_argument_options`
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r--scene/gui/control.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 235895ce47..706d111fbf 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -203,13 +203,14 @@ void Control::set_root_layout_direction(int p_root_dir) {
root_layout_direction = p_root_dir;
}
+#ifdef TOOLS_ENABLED
void Control::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
ERR_READ_THREAD_GUARD;
CanvasItem::get_argument_options(p_function, p_idx, r_options);
if (p_idx == 0) {
List<StringName> sn;
- String pf = p_function;
+ const String pf = p_function;
if (pf == "add_theme_color_override" || pf == "has_theme_color" || pf == "has_theme_color_override" || pf == "get_theme_color") {
ThemeDB::get_singleton()->get_default_theme()->get_color_list(get_class(), &sn);
} else if (pf == "add_theme_style_override" || pf == "has_theme_style" || pf == "has_theme_style_override" || pf == "get_theme_style") {
@@ -228,6 +229,7 @@ void Control::get_argument_options(const StringName &p_function, int p_idx, List
}
}
}
+#endif
PackedStringArray Control::get_configuration_warnings() const {
ERR_READ_THREAD_GUARD_V(PackedStringArray());