From a4e2198e4102f1dabc8f8720c2ace9c2fca8d999 Mon Sep 17 00:00:00 2001 From: sapier Date: Tue, 4 Mar 2014 19:57:39 +0100 Subject: Replace pause and message menu by formspec ones --- src/guiFormSpecMenu.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/guiFormSpecMenu.h') diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h index 1946f88eb..858894e5c 100644 --- a/src/guiFormSpecMenu.h +++ b/src/guiFormSpecMenu.h @@ -42,12 +42,22 @@ typedef enum { f_Unknown } FormspecFieldType; +typedef enum { + quit_mode_no, + quit_mode_accept, + quit_mode_cancel +} FormspecQuitMode; + struct TextDest { virtual ~TextDest() {}; // This is deprecated I guess? -celeron55 virtual void gotText(std::wstring text){} virtual void gotText(std::map fields) = 0; + virtual void setFormName(std::string formname) + { m_formname = formname;}; + + std::string m_formname; }; class IFormSource @@ -139,7 +149,8 @@ class GUIFormSpecMenu : public GUIModalMenu FieldSpec() { } - FieldSpec(const std::wstring name, const std::wstring label, const std::wstring fdeflt, int id): + FieldSpec(const std::wstring name, const std::wstring label, + const std::wstring fdeflt, int id) : fname(name), flabel(label), fdefault(fdeflt), @@ -228,7 +239,7 @@ public: void updateSelectedItem(); ItemStack verifySelectedItem(); - void acceptInput(bool quit); + void acceptInput(FormspecQuitMode quitmode); bool preprocessEvent(const SEvent& event); bool OnEvent(const SEvent& event); @@ -332,7 +343,8 @@ private: void parsePwdField(parserData* data,std::string element); void parseField(parserData* data,std::string element,std::string type); void parseSimpleField(parserData* data,std::vector &parts); - void parseTextArea(parserData* data,std::vector& parts,std::string type); + void parseTextArea(parserData* data,std::vector& parts, + std::string type); void parseLabel(parserData* data,std::string element); void parseVertLabel(parserData* data,std::string element); void parseImageButton(parserData* data,std::string element,std::string type); -- cgit v1.2.3