From 9888a56639e8f033c4258043f768cbad53f82fd0 Mon Sep 17 00:00:00 2001 From: Poommetee Ketson Date: Tue, 12 Dec 2017 09:37:37 +0700 Subject: Change statable to multistate, remove extra separator --- scene/gui/popup_menu.cpp | 28 ++++++++++++++-------------- scene/gui/popup_menu.h | 12 ++++++------ 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index e37cdd5cc9..32f889e826 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -624,7 +624,7 @@ void PopupMenu::add_check_shortcut(const Ref &p_shortcut, int p_ID, bo update(); } -void PopupMenu::add_statable_item(const String &p_label, int p_max_states, int p_default_state, int p_ID, uint32_t p_accel) { +void PopupMenu::add_multistate_item(const String &p_label, int p_max_states, int p_default_state, int p_ID, uint32_t p_accel) { Item item; item.text = p_label; @@ -839,14 +839,14 @@ void PopupMenu::set_item_h_offset(int p_idx, int p_offset) { update(); } -void PopupMenu::set_item_statable(int p_idx, int p_state) { +void PopupMenu::set_item_multistate(int p_idx, int p_state) { ERR_FAIL_INDEX(p_idx, items.size()); items[p_idx].state = p_state; update(); } -void PopupMenu::toggle_item_statable(int p_idx) { +void PopupMenu::toggle_item_multistate(int p_idx) { ERR_FAIL_INDEX(p_idx, items.size()); if (0 >= items[p_idx].max_states) { @@ -940,7 +940,7 @@ void PopupMenu::activate_item(int p_item) { if (!hide_on_checkable_item_selection || !pop->is_hide_on_checkable_item_selection()) break; } else if (0 < items[p_item].max_states) { - if (!hide_on_statable_item_selection || !pop->is_hide_on_statable_item_selection()) + if (!hide_on_multistate_item_selection || !pop->is_hide_on_multistate_item_selection()) break; } else if (!hide_on_item_selection || !pop->is_hide_on_item_selection()) break; @@ -957,7 +957,7 @@ void PopupMenu::activate_item(int p_item) { if (!hide_on_checkable_item_selection) return; } else if (0 < items[p_item].max_states) { - if (!hide_on_statable_item_selection) + if (!hide_on_multistate_item_selection) return; } else if (!hide_on_item_selection) return; @@ -1093,14 +1093,14 @@ bool PopupMenu::is_hide_on_checkable_item_selection() const { return hide_on_checkable_item_selection; } -void PopupMenu::set_hide_on_statable_item_selection(bool p_enabled) { +void PopupMenu::set_hide_on_multistate_item_selection(bool p_enabled) { - hide_on_statable_item_selection = p_enabled; + hide_on_multistate_item_selection = p_enabled; } -bool PopupMenu::is_hide_on_statable_item_selection() const { +bool PopupMenu::is_hide_on_multistate_item_selection() const { - return hide_on_statable_item_selection; + return hide_on_multistate_item_selection; } String PopupMenu::get_tooltip(const Point2 &p_pos) const { @@ -1161,10 +1161,10 @@ void PopupMenu::_bind_methods() { ClassDB::bind_method(D_METHOD("set_item_as_checkable", "idx", "enable"), &PopupMenu::set_item_as_checkable); ClassDB::bind_method(D_METHOD("set_item_tooltip", "idx", "tooltip"), &PopupMenu::set_item_tooltip); ClassDB::bind_method(D_METHOD("set_item_shortcut", "idx", "shortcut", "global"), &PopupMenu::set_item_shortcut, DEFVAL(false)); - ClassDB::bind_method(D_METHOD("set_item_statable", "idx", "state"), &PopupMenu::set_item_statable); + ClassDB::bind_method(D_METHOD("set_item_multistate", "idx", "state"), &PopupMenu::set_item_multistate); ClassDB::bind_method(D_METHOD("toggle_item_checked", "idx"), &PopupMenu::toggle_item_checked); - ClassDB::bind_method(D_METHOD("toggle_item_statable", "idx"), &PopupMenu::toggle_item_statable); + ClassDB::bind_method(D_METHOD("toggle_item_multistate", "idx"), &PopupMenu::toggle_item_multistate); ClassDB::bind_method(D_METHOD("get_item_text", "idx"), &PopupMenu::get_item_text); ClassDB::bind_method(D_METHOD("get_item_icon", "idx"), &PopupMenu::get_item_icon); @@ -1196,8 +1196,8 @@ void PopupMenu::_bind_methods() { ClassDB::bind_method(D_METHOD("set_hide_on_checkable_item_selection", "enable"), &PopupMenu::set_hide_on_checkable_item_selection); ClassDB::bind_method(D_METHOD("is_hide_on_checkable_item_selection"), &PopupMenu::is_hide_on_checkable_item_selection); - ClassDB::bind_method(D_METHOD("set_hide_on_state_item_selection", "enable"), &PopupMenu::set_hide_on_statable_item_selection); - ClassDB::bind_method(D_METHOD("is_hide_on_state_item_selection"), &PopupMenu::is_hide_on_statable_item_selection); + ClassDB::bind_method(D_METHOD("set_hide_on_state_item_selection", "enable"), &PopupMenu::set_hide_on_multistate_item_selection); + ClassDB::bind_method(D_METHOD("is_hide_on_state_item_selection"), &PopupMenu::is_hide_on_multistate_item_selection); ClassDB::bind_method(D_METHOD("_submenu_timeout"), &PopupMenu::_submenu_timeout); @@ -1222,7 +1222,7 @@ PopupMenu::PopupMenu() { set_as_toplevel(true); set_hide_on_item_selection(true); set_hide_on_checkable_item_selection(true); - set_hide_on_statable_item_selection(false); + set_hide_on_multistate_item_selection(false); submenu_timer = memnew(Timer); submenu_timer->set_wait_time(0.3); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 5a10bf0765..ee514f4c4b 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -90,7 +90,7 @@ class PopupMenu : public Popup { bool invalidated_click; bool hide_on_item_selection; bool hide_on_checkable_item_selection; - bool hide_on_statable_item_selection; + bool hide_on_multistate_item_selection; Vector2 moved; Array _get_items() const; @@ -120,7 +120,7 @@ public: void add_icon_check_shortcut(const Ref &p_icon, const Ref &p_shortcut, int p_ID = -1, bool p_global = false); void add_check_shortcut(const Ref &p_shortcut, int p_ID = -1, bool p_global = false); - void add_statable_item(const String &p_label, int p_max_states, int p_default_state, int p_ID = -1, uint32_t p_accel = 0); + void add_multistate_item(const String &p_label, int p_max_states, int p_default_state, int p_ID = -1, uint32_t p_accel = 0); void set_item_text(int p_idx, const String &p_text); void set_item_icon(int p_idx, const Ref &p_icon); @@ -135,8 +135,8 @@ public: void set_item_tooltip(int p_idx, const String &p_tooltip); void set_item_shortcut(int p_idx, const Ref &p_shortcut, bool p_global = false); void set_item_h_offset(int p_idx, int p_offset); - void set_item_statable(int p_idx, int p_state); - void toggle_item_statable(int p_idx); + void set_item_multistate(int p_idx, int p_state); + void toggle_item_multistate(int p_idx); void toggle_item_checked(int p_idx); @@ -183,8 +183,8 @@ public: void set_hide_on_checkable_item_selection(bool p_enabled); bool is_hide_on_checkable_item_selection() const; - void set_hide_on_statable_item_selection(bool p_enabled); - bool is_hide_on_statable_item_selection() const; + void set_hide_on_multistate_item_selection(bool p_enabled); + bool is_hide_on_multistate_item_selection() const; PopupMenu(); ~PopupMenu(); -- cgit v1.2.3