aboutsummaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.h
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-03-04 19:57:39 +0100
committersapier <Sapier at GMX dot net>2014-03-05 18:44:14 +0100
commita4e2198e4102f1dabc8f8720c2ace9c2fca8d999 (patch)
treeb0287c27c99763e6cbda7f1990a5ce93397d7182 /src/guiFormSpecMenu.h
parent062de11b4cff30861dd4e9eb56f131d821f34b51 (diff)
downloadminetest-a4e2198e4102f1dabc8f8720c2ace9c2fca8d999.tar.gz
minetest-a4e2198e4102f1dabc8f8720c2ace9c2fca8d999.tar.bz2
minetest-a4e2198e4102f1dabc8f8720c2ace9c2fca8d999.zip
Replace pause and message menu by formspec ones
Diffstat (limited to 'src/guiFormSpecMenu.h')
-rw-r--r--src/guiFormSpecMenu.h18
1 files changed, 15 insertions, 3 deletions
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<std::string, std::string> 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<std::string> &parts);
- void parseTextArea(parserData* data,std::vector<std::string>& parts,std::string type);
+ void parseTextArea(parserData* data,std::vector<std::string>& 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);