You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add PropertyListHelper in all simple cases
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/popup_menu.h"
|
||||
#include "scene/property_list_helper.h"
|
||||
|
||||
class MenuButton : public Button {
|
||||
GDCLASS(MenuButton, Button);
|
||||
@@ -42,13 +43,18 @@ class MenuButton : public Button {
|
||||
bool disable_shortcuts = false;
|
||||
PopupMenu *popup = nullptr;
|
||||
|
||||
static inline PropertyListHelper base_property_helper;
|
||||
PropertyListHelper property_helper;
|
||||
|
||||
void _popup_visibility_changed(bool p_visible);
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
void _get_property_list(List<PropertyInfo> *p_list) const { property_helper.get_property_list(p_list, popup->get_item_count()); }
|
||||
bool _property_can_revert(const StringName &p_name) const { return property_helper.property_can_revert(p_name); }
|
||||
bool _property_get_revert(const StringName &p_name, Variant &r_property) const { return property_helper.property_get_revert(p_name, r_property); }
|
||||
static void _bind_methods();
|
||||
virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user