]> git.lizzy.rs Git - minetest.git/blobdiff - src/guiFormSpecMenu.h
fix screen flickering black when rendering to texture
[minetest.git] / src / guiFormSpecMenu.h
index 8e9557566e3b86bc9d5a2fc4c851c72fe9494934..86235900d7fc37a5297a9bb7115c7ec5e96f5d6e 100644 (file)
@@ -86,11 +86,12 @@ class GUIFormSpecMenu : public GUIModalMenu
                }
                ListDrawSpec(const InventoryLocation &a_inventoryloc,
                                const std::string &a_listname,
-                               v2s32 a_pos, v2s32 a_geom):
+                               v2s32 a_pos, v2s32 a_geom, s32 a_start_item_i):
                        inventoryloc(a_inventoryloc),
                        listname(a_listname),
                        pos(a_pos),
-                       geom(a_geom)
+                       geom(a_geom),
+                       start_item_i(a_start_item_i)
                {
                }
 
@@ -98,6 +99,7 @@ class GUIFormSpecMenu : public GUIModalMenu
                std::string listname;
                v2s32 pos;
                v2s32 geom;
+               s32 start_item_i;
        };
 
        struct ImageDrawSpec
@@ -131,6 +133,7 @@ class GUIFormSpecMenu : public GUIModalMenu
                        send = false;
                        is_button = false;
                        is_exit = false;
+                       tooltip="";
                }
                std::wstring fname;
                std::wstring flabel;
@@ -139,10 +142,12 @@ class GUIFormSpecMenu : public GUIModalMenu
                bool send;
                bool is_button;
                bool is_exit;
+               core::rect<s32> rect;
+               std::string tooltip;
        };
 
 public:
-       GUIFormSpecMenu(gui::IGUIEnvironment* env,
+       GUIFormSpecMenu(irr::IrrlichtDevice* dev,
                        gui::IGUIElement* parent, s32 id,
                        IMenuManager *menumgr,
                        InventoryManager *invmgr,
@@ -195,6 +200,7 @@ class GUIFormSpecMenu : public GUIModalMenu
        v2s32 spacing;
        v2s32 imgsize;
        
+       irr::IrrlichtDevice* m_device;
        InventoryManager *m_invmgr;
        IGameDef *m_gamedef;
 
@@ -204,12 +210,20 @@ class GUIFormSpecMenu : public GUIModalMenu
        TextDest *m_text_dst;
 
        core::array<ListDrawSpec> m_inventorylists;
+       core::array<ImageDrawSpec> m_backgrounds;       
        core::array<ImageDrawSpec> m_images;
+       core::array<ImageDrawSpec> m_itemimages;
        core::array<FieldSpec> m_fields;
 
        ItemSpec *m_selected_item;
        u32 m_selected_amount;
        bool m_selected_dragging;
+       
+       // WARNING: BLACK MAGIC
+       // Used to guess and keep up with some special things the server can do.
+       // If name is "", no guess exists.
+       ItemStack m_selected_content_guess;
+       InventoryLocation m_selected_content_guess_inventory;
 
        v2s32 m_pointer;
        gui::IGUIStaticText *m_tooltip_element;