Formspecs: Use mouse wheel to pick up and deposit single items
[oweals/minetest.git] / src / gui / guiFormSpecMenu.h
index 9cd98f8068c97f495f96cc6dea5c66008624d228..7a096a1ea14ff185fd057fcce1bc2aaf58f269bc 100644 (file)
@@ -287,12 +287,14 @@ public:
                        ISimpleTextureSource *tsrc,
                        IFormSource* fs_src,
                        TextDest* txt_dst,
+                       std::string formspecPrepend,
                        bool remap_dbl_click = true);
 
        ~GUIFormSpecMenu();
 
-       static void create(GUIFormSpecMenu **cur_formspec, Client *client,
-               JoystickController *joystick, IFormSource *fs_src, TextDest *txt_dest);
+       static void create(GUIFormSpecMenu *&cur_formspec, Client *client,
+               JoystickController *joystick, IFormSource *fs_src, TextDest *txt_dest,
+               const std::string &formspecPrepend);
 
        void setFormSpec(const std::string &formspec_string,
                        const InventoryLocation &current_inventory_location)
@@ -302,6 +304,11 @@ public:
                regenerateGui(m_screensize_old);
        }
 
+       void setFormspecPrepend(const std::string &formspecPrepend)
+       {
+               m_formspec_prepend = formspecPrepend;
+       }
+
        // form_src is deleted by this GUIFormSpecMenu
        void setFormSource(IFormSource *form_src)
        {
@@ -378,6 +385,7 @@ protected:
        Client *m_client;
 
        std::string m_formspec_string;
+       std::string m_formspec_prepend;
        InventoryLocation m_current_inventory_location;
 
        std::vector<ListDrawSpec> m_inventorylists;
@@ -484,6 +492,8 @@ private:
        void parseFieldCloseOnEnter(parserData *data, const std::string &element);
        void parsePwdField(parserData* data, const std::string &element);
        void parseField(parserData* data, const std::string &element, const std::string &type);
+       void createTextField(parserData *data, FieldSpec &spec,
+               core::rect<s32> &rect, bool is_multiline);
        void parseSimpleField(parserData* data,std::vector<std::string> &parts);
        void parseTextArea(parserData* data,std::vector<std::string>& parts,
                        const std::string &type);