summaryrefslogtreecommitdiff
path: root/src/guiInventoryMenu.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-06-03 18:30:34 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-06-03 22:31:02 +0300
commita09d86dd3cc3fd31404e6403cfc5d9c7020f944f (patch)
treeda48d36fbfc83eaba81fb8cf2ec4a74a56d33c51 /src/guiInventoryMenu.h
parent3ccb0f691b1ec45a2fb5b7f4a5fc0ae2db776d36 (diff)
downloadminetest-a09d86dd3cc3fd31404e6403cfc5d9c7020f944f.tar.gz
minetest-a09d86dd3cc3fd31404e6403cfc5d9c7020f944f.tar.bz2
minetest-a09d86dd3cc3fd31404e6403cfc5d9c7020f944f.zip
Update inventory menu from formspec on-the-fly
Diffstat (limited to 'src/guiInventoryMenu.h')
-rw-r--r--src/guiInventoryMenu.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/guiInventoryMenu.h b/src/guiInventoryMenu.h
index beb6ef2e8..3f03064df 100644
--- a/src/guiInventoryMenu.h
+++ b/src/guiInventoryMenu.h
@@ -30,6 +30,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
class IGameDef;
class InventoryManager;
+class IFormSource
+{
+public:
+ virtual ~IFormSource(){}
+ virtual std::string getForm() = 0;
+};
+
void drawItemStack(video::IVideoDriver *driver,
gui::IGUIFont *font,
const ItemStack &item,
@@ -117,6 +124,12 @@ public:
m_current_inventory_location = current_inventory_location;
regenerateGui(m_screensize_old);
}
+
+ // form_src is deleted by this GUIInventoryMenu
+ void setFormSource(IFormSource *form_src)
+ {
+ m_form_src = form_src;
+ }
void removeChildren();
/*
@@ -147,6 +160,7 @@ protected:
std::string m_formspec_string;
InventoryLocation m_current_inventory_location;
+ IFormSource *m_form_src;
core::array<ListDrawSpec> m_inventorylists;
core::array<ImageDrawSpec> m_images;