1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Replace pause and message menu by formspec ones

This commit is contained in:
sapier 2014-03-04 19:57:39 +01:00
parent 062de11b4c
commit a4e2198e41
14 changed files with 273 additions and 711 deletions

View file

@ -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);