summaryrefslogtreecommitdiffstats
path: root/editor/plugins/item_list_editor_plugin.h
diff options
context:
space:
mode:
authorPoommetee Ketson <poommetee@protonmail.com>2017-07-04 18:38:56 +0700
committerPoommetee Ketson <poommetee@protonmail.com>2017-07-04 20:12:33 +0700
commit3aff102fc3a9db4bcebdee844c8f6c02147bf371 (patch)
tree65ace4fcea8282b30bf222c268033d13c1078c0e /editor/plugins/item_list_editor_plugin.h
parenta2586a21196aaf6327a312915b777dec4d3859cc (diff)
downloadredot-engine-3aff102fc3a9db4bcebdee844c8f6c02147bf371.tar.gz
ItemList: expose methods, in-editor items editing support
Diffstat (limited to 'editor/plugins/item_list_editor_plugin.h')
-rw-r--r--editor/plugins/item_list_editor_plugin.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/editor/plugins/item_list_editor_plugin.h b/editor/plugins/item_list_editor_plugin.h
index 042e88839f..4fed8e49f5 100644
--- a/editor/plugins/item_list_editor_plugin.h
+++ b/editor/plugins/item_list_editor_plugin.h
@@ -167,6 +167,35 @@ public:
///////////////////////////////////////////////////////////////
+class ItemListItemListPlugin : public ItemListPlugin {
+
+ GDCLASS(ItemListItemListPlugin, ItemListPlugin);
+
+ ItemList *pp;
+
+public:
+ virtual void set_object(Object *p_object);
+ virtual bool handles(Object *p_object) const;
+ virtual int get_flags() const;
+
+ virtual void set_item_text(int p_idx, const String &p_text) { pp->set_item_text(p_idx, p_text); }
+ virtual String get_item_text(int p_idx) const { return pp->get_item_text(p_idx); }
+
+ virtual void set_item_icon(int p_idx, const Ref<Texture> &p_tex) { pp->set_item_icon(p_idx, p_tex); }
+ virtual Ref<Texture> get_item_icon(int p_idx) const { return pp->get_item_icon(p_idx); }
+
+ virtual void set_item_enabled(int p_idx, int p_enabled) { pp->set_item_disabled(p_idx, !p_enabled); }
+ virtual bool is_item_enabled(int p_idx) const { return !pp->is_item_disabled(p_idx); }
+
+ virtual void add_item();
+ virtual int get_item_count() const;
+ virtual void erase(int p_idx);
+
+ ItemListItemListPlugin();
+};
+
+///////////////////////////////////////////////////////////////
+
class ItemListEditor : public HBoxContainer {
GDCLASS(ItemListEditor, HBoxContainer);