summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-10-20 15:43:17 +0200
committerkobewi <kobewi4e@gmail.com>2022-11-08 01:29:39 +0100
commitd9f066d5fadfce5fc19310f8ba5ce51d3552bf9e (patch)
treead7a7fa1d33b3e46c7f79c9b4016f51d53c67a76 /scene
parentb61fda9d2a6166e41538405ad8ae24f1aed40570 (diff)
Remove duplicate project settings definitions
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/item_list.cpp5
-rw-r--r--scene/gui/popup_menu.cpp2
-rw-r--r--scene/gui/tree.cpp2
-rw-r--r--scene/resources/shape_2d.cpp2
4 files changed, 4 insertions, 7 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index d6b5557a3f..82f089735d 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -896,7 +896,7 @@ void ItemList::gui_input(const Ref<InputEvent> &p_event) {
if (k.is_valid() && k->get_unicode()) {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- uint64_t max_interval = uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000));
+ uint64_t max_interval = uint64_t(GLOBAL_GET("gui/timers/incremental_search_max_interval_msec"));
search_time_msec = now;
if (diff > max_interval) {
@@ -1831,9 +1831,6 @@ void ItemList::_bind_methods() {
ADD_SIGNAL(MethodInfo("item_clicked", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::VECTOR2, "at_position"), PropertyInfo(Variant::INT, "mouse_button_index")));
ADD_SIGNAL(MethodInfo("multi_selected", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "selected")));
ADD_SIGNAL(MethodInfo("item_activated", PropertyInfo(Variant::INT, "index")));
-
- GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000);
- ProjectSettings::get_singleton()->set_custom_property_info("gui/timers/incremental_search_max_interval_msec", PropertyInfo(Variant::INT, "gui/timers/incremental_search_max_interval_msec", PROPERTY_HINT_RANGE, "0,10000,1,or_greater")); // No negative numbers
}
ItemList::ItemList() {
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 9a411ef7ed..82f56a56c9 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -472,7 +472,7 @@ void PopupMenu::gui_input(const Ref<InputEvent> &p_event) {
if (allow_search && k.is_valid() && k->get_unicode() && k->is_pressed()) {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- uint64_t max_interval = uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000));
+ uint64_t max_interval = uint64_t(GLOBAL_GET("gui/timers/incremental_search_max_interval_msec"));
search_time_msec = now;
if (diff > max_interval) {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 6f9a9a5141..1c96858da7 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -4818,7 +4818,7 @@ TreeItem *Tree::get_item_with_text(const String &p_find) const {
void Tree::_do_incr_search(const String &p_add) {
uint64_t time = OS::get_singleton()->get_ticks_usec() / 1000; // convert to msec
uint64_t diff = time - last_keypress;
- if (diff > uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec", 2000))) {
+ if (diff > uint64_t(GLOBAL_GET("gui/timers/incremental_search_max_interval_msec"))) {
incr_search = p_add;
} else if (incr_search != p_add) {
incr_search += p_add;
diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp
index 61daf801e8..af84144591 100644
--- a/scene/resources/shape_2d.cpp
+++ b/scene/resources/shape_2d.cpp
@@ -116,7 +116,7 @@ bool Shape2D::is_collision_outline_enabled() {
return true;
}
#endif
- return GLOBAL_DEF("debug/shapes/collision/draw_2d_outlines", true);
+ return GLOBAL_GET("debug/shapes/collision/draw_2d_outlines");
}
Shape2D::Shape2D(const RID &p_rid) {