Update inventory texture too
[oweals/minetest.git] / src / guiInventoryMenu.h
index 10fb7a4250dd11ff0403cd0b0eaff27547a882df..55d18a851055f2f7cdf8b963bd4475ba6a93d850 100644 (file)
@@ -26,10 +26,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "utility.h"
 #include "modalMenu.h"
 
+class ITextureSource;
+
 void drawInventoryItem(video::IVideoDriver *driver,
                gui::IGUIFont *font,
                InventoryItem *item, core::rect<s32> rect,
-               const core::rect<s32> *clip);
+               const core::rect<s32> *clip,
+               ITextureSource *tsrc);
 
 class GUIInventoryMenu : public GUIModalMenu
 {
@@ -102,13 +105,20 @@ public:
                v2s32 pos;
                v2s32 geom;
        };
+       
+       // See .cpp for format
+       static v2s16 makeDrawSpecArrayFromString(
+                       core::array<GUIInventoryMenu::DrawSpec> &draw_spec,
+                       const std::string &data,
+                       const std::string &current_name);
 
        GUIInventoryMenu(gui::IGUIEnvironment* env,
                        gui::IGUIElement* parent, s32 id,
                        IMenuManager *menumgr,
                        v2s16 menu_size,
                        InventoryContext *c,
-                       InventoryManager *invmgr
+                       InventoryManager *invmgr,
+                       ITextureSource *tsrc
                        );
        ~GUIInventoryMenu();
 
@@ -124,7 +134,7 @@ public:
        void regenerateGui(v2u32 screensize);
        
        ItemSpec getItemAtPos(v2s32 p) const;
-       void drawList(const ListDrawSpec &s);
+       void drawList(const ListDrawSpec &s, ITextureSource *tsrc);
        void drawMenu();
 
        bool OnEvent(const SEvent& event);
@@ -143,6 +153,7 @@ protected:
        
        InventoryContext *m_c;
        InventoryManager *m_invmgr;
+       ITextureSource *m_tsrc;
 
        core::array<DrawSpec> m_init_draw_spec;
        core::array<ListDrawSpec> m_draw_spec;