From a09d86dd3cc3fd31404e6403cfc5d9c7020f944f Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 3 Jun 2012 18:30:34 +0300 Subject: Update inventory menu from formspec on-the-fly --- src/guiInventoryMenu.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/guiInventoryMenu.h') 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 m_inventorylists; core::array m_images; -- cgit v1.2.3