mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-03 09:29:38 +01:00
Backported: - Add item tooltip access to OptionButton - timothyqiu - d537a88299
This commit is contained in:
parent
40b60f3c86
commit
d7f455f36f
@ -80,6 +80,13 @@
|
|||||||
Returns the text of the item at index [code]idx[/code].
|
Returns the text of the item at index [code]idx[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="get_item_tooltip" qualifiers="const">
|
||||||
|
<return type="String" />
|
||||||
|
<argument index="0" name="idx" type="int" />
|
||||||
|
<description>
|
||||||
|
Returns the tooltip of the item at index [code]idx[/code].
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="get_popup" qualifiers="const">
|
<method name="get_popup" qualifiers="const">
|
||||||
<return type="PopupMenu" />
|
<return type="PopupMenu" />
|
||||||
<description>
|
<description>
|
||||||
@ -161,6 +168,14 @@
|
|||||||
Sets the text of the item at index [code]idx[/code].
|
Sets the text of the item at index [code]idx[/code].
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="set_item_tooltip">
|
||||||
|
<return type="void" />
|
||||||
|
<argument index="0" name="idx" type="int" />
|
||||||
|
<argument index="1" name="tooltip" type="String" />
|
||||||
|
<description>
|
||||||
|
Sets the tooltip of the item at index [code]idx[/code].
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
</methods>
|
</methods>
|
||||||
<members>
|
<members>
|
||||||
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" />
|
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" />
|
||||||
|
@ -162,6 +162,10 @@ void OptionButton::set_item_disabled(int p_idx, bool p_disabled) {
|
|||||||
popup->set_item_disabled(p_idx, p_disabled);
|
popup->set_item_disabled(p_idx, p_disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OptionButton::set_item_tooltip(int p_idx, const String &p_tooltip) {
|
||||||
|
popup->set_item_tooltip(p_idx, p_tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
String OptionButton::get_item_text(int p_idx) const {
|
String OptionButton::get_item_text(int p_idx) const {
|
||||||
return popup->get_item_text(p_idx);
|
return popup->get_item_text(p_idx);
|
||||||
}
|
}
|
||||||
@ -186,6 +190,10 @@ bool OptionButton::is_item_disabled(int p_idx) const {
|
|||||||
return popup->is_item_disabled(p_idx);
|
return popup->is_item_disabled(p_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String OptionButton::get_item_tooltip(int p_idx) const {
|
||||||
|
return popup->get_item_tooltip(p_idx);
|
||||||
|
}
|
||||||
|
|
||||||
int OptionButton::get_item_count() const {
|
int OptionButton::get_item_count() const {
|
||||||
return popup->get_item_count();
|
return popup->get_item_count();
|
||||||
}
|
}
|
||||||
@ -305,6 +313,8 @@ void OptionButton::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("set_item_text", "idx", "text"), &OptionButton::set_item_text);
|
ClassDB::bind_method(D_METHOD("set_item_text", "idx", "text"), &OptionButton::set_item_text);
|
||||||
ClassDB::bind_method(D_METHOD("set_item_icon", "idx", "texture"), &OptionButton::set_item_icon);
|
ClassDB::bind_method(D_METHOD("set_item_icon", "idx", "texture"), &OptionButton::set_item_icon);
|
||||||
ClassDB::bind_method(D_METHOD("set_item_disabled", "idx", "disabled"), &OptionButton::set_item_disabled);
|
ClassDB::bind_method(D_METHOD("set_item_disabled", "idx", "disabled"), &OptionButton::set_item_disabled);
|
||||||
|
ClassDB::bind_method(D_METHOD("get_item_tooltip", "idx"), &OptionButton::get_item_tooltip);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_item_tooltip", "idx", "tooltip"), &OptionButton::set_item_tooltip);
|
||||||
ClassDB::bind_method(D_METHOD("set_item_id", "idx", "id"), &OptionButton::set_item_id);
|
ClassDB::bind_method(D_METHOD("set_item_id", "idx", "id"), &OptionButton::set_item_id);
|
||||||
ClassDB::bind_method(D_METHOD("set_item_metadata", "idx", "metadata"), &OptionButton::set_item_metadata);
|
ClassDB::bind_method(D_METHOD("set_item_metadata", "idx", "metadata"), &OptionButton::set_item_metadata);
|
||||||
ClassDB::bind_method(D_METHOD("get_item_text", "idx"), &OptionButton::get_item_text);
|
ClassDB::bind_method(D_METHOD("get_item_text", "idx"), &OptionButton::get_item_text);
|
||||||
|
@ -64,6 +64,7 @@ public:
|
|||||||
void set_item_id(int p_idx, int p_id);
|
void set_item_id(int p_idx, int p_id);
|
||||||
void set_item_metadata(int p_idx, const Variant &p_metadata);
|
void set_item_metadata(int p_idx, const Variant &p_metadata);
|
||||||
void set_item_disabled(int p_idx, bool p_disabled);
|
void set_item_disabled(int p_idx, bool p_disabled);
|
||||||
|
void set_item_tooltip(int p_idx, const String &p_tooltip);
|
||||||
|
|
||||||
String get_item_text(int p_idx) const;
|
String get_item_text(int p_idx) const;
|
||||||
Ref<Texture> get_item_icon(int p_idx) const;
|
Ref<Texture> get_item_icon(int p_idx) const;
|
||||||
@ -71,6 +72,7 @@ public:
|
|||||||
int get_item_index(int p_id) const;
|
int get_item_index(int p_id) const;
|
||||||
Variant get_item_metadata(int p_idx) const;
|
Variant get_item_metadata(int p_idx) const;
|
||||||
bool is_item_disabled(int p_idx) const;
|
bool is_item_disabled(int p_idx) const;
|
||||||
|
String get_item_tooltip(int p_idx) const;
|
||||||
|
|
||||||
int get_item_count() const;
|
int get_item_count() const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user