mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
fix memory leaks introduced by invalid gettext usage
This commit is contained in:
parent
cd27c8ef5d
commit
98182f6097
@ -120,11 +120,12 @@ GUIConfigureWorld::GUIConfigureWorld(gui::IGUIEnvironment* env,
|
|||||||
}
|
}
|
||||||
if(!m_new_mod_names.empty())
|
if(!m_new_mod_names.empty())
|
||||||
{
|
{
|
||||||
|
wchar_t* text = wgettext("Warning: Some mods are not configured yet.\n"
|
||||||
|
"They will be enabled by default when you save the configuration. ");
|
||||||
GUIMessageMenu *menu =
|
GUIMessageMenu *menu =
|
||||||
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
|
new GUIMessageMenu(Environment, Parent, -1, m_menumgr, text);
|
||||||
wgettext("Warning: Some mods are not configured yet.\n"
|
|
||||||
"They will be enabled by default when you save the configuration. "));
|
|
||||||
menu->drop();
|
menu->drop();
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -139,10 +140,11 @@ GUIConfigureWorld::GUIConfigureWorld(gui::IGUIEnvironment* env,
|
|||||||
}
|
}
|
||||||
if(!missing_mods.empty())
|
if(!missing_mods.empty())
|
||||||
{
|
{
|
||||||
|
wchar_t* text = wgettext("Warning: Some configured mods are missing.\n"
|
||||||
|
"Their setting will be removed when you save the configuration. ");
|
||||||
GUIMessageMenu *menu =
|
GUIMessageMenu *menu =
|
||||||
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
|
new GUIMessageMenu(Environment, Parent, -1, m_menumgr, text);
|
||||||
wgettext("Warning: Some configured mods are missing.\n"
|
delete[] text;
|
||||||
"Their setting will be removed when you save the configuration. "));
|
|
||||||
for(std::set<std::string>::iterator it = missing_mods.begin();
|
for(std::set<std::string>::iterator it = missing_mods.begin();
|
||||||
it != missing_mods.end(); ++it)
|
it != missing_mods.end(); ++it)
|
||||||
m_settings.remove("load_mod_"+(*it));
|
m_settings.remove("load_mod_"+(*it));
|
||||||
@ -203,30 +205,36 @@ void GUIConfigureWorld::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 200, 20);
|
core::rect<s32> rect(0, 0, 200, 20);
|
||||||
rect += v2s32(0, 25) + topleft;
|
rect += v2s32(0, 25) + topleft;
|
||||||
|
wchar_t* text = wgettext("enabled");
|
||||||
m_enabled_checkbox =
|
m_enabled_checkbox =
|
||||||
Environment->addCheckBox(false, rect, this, GUI_ID_ENABLED_CHECKBOX,
|
Environment->addCheckBox(false, rect, this, GUI_ID_ENABLED_CHECKBOX,
|
||||||
wgettext("enabled"));
|
text);
|
||||||
|
delete[] text;
|
||||||
m_enabled_checkbox->setVisible(false);
|
m_enabled_checkbox->setVisible(false);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 85, 30);
|
core::rect<s32> rect(0, 0, 85, 30);
|
||||||
rect = rect + v2s32(0, 25) + topleft;
|
rect = rect + v2s32(0, 25) + topleft;
|
||||||
|
wchar_t* text = wgettext("Enable All");
|
||||||
m_enableall = Environment->addButton(rect, this, GUI_ID_ENABLEALL,
|
m_enableall = Environment->addButton(rect, this, GUI_ID_ENABLEALL,
|
||||||
wgettext("Enable All"));
|
text);
|
||||||
|
delete[] text;
|
||||||
m_enableall->setVisible(false);
|
m_enableall->setVisible(false);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 85, 30);
|
core::rect<s32> rect(0, 0, 85, 30);
|
||||||
rect = rect + v2s32(115, 25) + topleft;
|
rect = rect + v2s32(115, 25) + topleft;
|
||||||
m_disableall = Environment->addButton(rect, this, GUI_ID_DISABLEALL,
|
wchar_t* text = wgettext("Disable All");
|
||||||
wgettext("Disable All"));
|
m_disableall = Environment->addButton(rect, this, GUI_ID_DISABLEALL, text );
|
||||||
|
delete[] text;
|
||||||
m_disableall->setVisible(false);
|
m_disableall->setVisible(false);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 200, 20);
|
core::rect<s32> rect(0, 0, 200, 20);
|
||||||
rect += v2s32(0, 60) + topleft;
|
rect += v2s32(0, 60) + topleft;
|
||||||
Environment->addStaticText(wgettext("depends on:"),
|
wchar_t* text = wgettext("depends on:");
|
||||||
rect, false, false, this, -1);
|
Environment->addStaticText(text, rect, false, false, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 200, 85);
|
core::rect<s32> rect(0, 0, 200, 85);
|
||||||
@ -237,8 +245,9 @@ void GUIConfigureWorld::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 200, 20);
|
core::rect<s32> rect(0, 0, 200, 20);
|
||||||
rect += v2s32(0, 175) + topleft;
|
rect += v2s32(0, 175) + topleft;
|
||||||
Environment->addStaticText(wgettext("is required by:"),
|
wchar_t* text = wgettext("is required by:");
|
||||||
rect, false, false, this, -1);
|
Environment->addStaticText( text, rect, false, false, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 200, 85);
|
core::rect<s32> rect(0, 0, 200, 85);
|
||||||
@ -258,14 +267,16 @@ void GUIConfigureWorld::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 120, 30);
|
core::rect<s32> rect(0, 0, 120, 30);
|
||||||
rect = rect + v2s32(330, 270) - topleft;
|
rect = rect + v2s32(330, 270) - topleft;
|
||||||
Environment->addButton(rect, this, GUI_ID_CANCEL,
|
wchar_t* text = wgettext("Cancel");
|
||||||
wgettext("Cancel"));
|
Environment->addButton(rect, this, GUI_ID_CANCEL, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 120, 30);
|
core::rect<s32> rect(0, 0, 120, 30);
|
||||||
rect = rect + v2s32(460, 270) - topleft;
|
rect = rect + v2s32(460, 270) - topleft;
|
||||||
Environment->addButton(rect, this, GUI_ID_SAVE,
|
wchar_t* text = wgettext("Save");
|
||||||
wgettext("Save"));
|
Environment->addButton(rect, this, GUI_ID_SAVE, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
|
|
||||||
@ -389,17 +400,21 @@ bool GUIConfigureWorld::OnEvent(const SEvent& event)
|
|||||||
// bug in the text-size calculation. if the trailing
|
// bug in the text-size calculation. if the trailing
|
||||||
// spaces are removed from the message text, the
|
// spaces are removed from the message text, the
|
||||||
// message gets wrapped and parts of it are cut off:
|
// message gets wrapped and parts of it are cut off:
|
||||||
|
wchar_t* text = wgettext("Configuration saved. ");
|
||||||
GUIMessageMenu *menu =
|
GUIMessageMenu *menu =
|
||||||
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
|
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
|
||||||
wgettext("Configuration saved. "));
|
text );
|
||||||
|
delete[] text;
|
||||||
menu->drop();
|
menu->drop();
|
||||||
|
|
||||||
ModConfiguration modconf(m_wspec.path);
|
ModConfiguration modconf(m_wspec.path);
|
||||||
if(!modconf.isConsistent())
|
if(!modconf.isConsistent())
|
||||||
{
|
{
|
||||||
GUIMessageMenu *menu =
|
wchar_t* text = wgettext("Warning: Configuration not consistent. ");
|
||||||
|
GUIMessageMenu *menu =
|
||||||
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
|
new GUIMessageMenu(Environment, Parent, -1, m_menumgr,
|
||||||
wgettext("Warning: Configuration not consistent. "));
|
text );
|
||||||
|
delete[] text;
|
||||||
menu->drop();
|
menu->drop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,14 +116,18 @@ void GUIConfirmMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, bw, 30);
|
core::rect<s32> rect(0, 0, bw, 30);
|
||||||
rect = rect + v2s32(size.X/2-bw/2-(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
|
rect = rect + v2s32(size.X/2-bw/2-(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
|
||||||
|
wchar_t* text = wgettext("Yes");
|
||||||
Environment->addButton(rect, this, GUI_ID_YES,
|
Environment->addButton(rect, this, GUI_ID_YES,
|
||||||
wgettext("Yes"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, bw, 30);
|
core::rect<s32> rect(0, 0, bw, 30);
|
||||||
rect = rect + v2s32(size.X/2-bw/2+(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
|
rect = rect + v2s32(size.X/2-bw/2+(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
|
||||||
|
wchar_t* text = wgettext("No");
|
||||||
Environment->addButton(rect, this, GUI_ID_NO,
|
Environment->addButton(rect, this, GUI_ID_NO,
|
||||||
wgettext("No"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
|
@ -113,8 +113,9 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 100, 20);
|
core::rect<s32> rect(0, 0, 100, 20);
|
||||||
rect += v2s32(0, 5) + topleft;
|
rect += v2s32(0, 5) + topleft;
|
||||||
Environment->addStaticText(wgettext("World name"),
|
wchar_t* text = wgettext("World name");
|
||||||
rect, false, true, this, -1);
|
Environment->addStaticText(text, rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 300, 30);
|
core::rect<s32> rect(0, 0, 300, 30);
|
||||||
@ -132,8 +133,9 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 100, 20);
|
core::rect<s32> rect(0, 0, 100, 20);
|
||||||
rect += v2s32(0, 40+5) + topleft;
|
rect += v2s32(0, 40+5) + topleft;
|
||||||
Environment->addStaticText(wgettext("Game"),
|
wchar_t* text = wgettext("Game");
|
||||||
rect, false, true, this, -1);
|
Environment->addStaticText(text, rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 300, 80);
|
core::rect<s32> rect(0, 0, 300, 80);
|
||||||
@ -155,14 +157,18 @@ void GUICreateWorld::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 120, 30);
|
core::rect<s32> rect(0, 0, 120, 30);
|
||||||
rect = rect + v2s32(170, 140) + topleft;
|
rect = rect + v2s32(170, 140) + topleft;
|
||||||
|
wchar_t* text = wgettext("Create");
|
||||||
Environment->addButton(rect, this, GUI_ID_CREATE,
|
Environment->addButton(rect, this, GUI_ID_CREATE,
|
||||||
wgettext("Create"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 120, 30);
|
core::rect<s32> rect(0, 0, 120, 30);
|
||||||
rect = rect + v2s32(300, 140) + topleft;
|
rect = rect + v2s32(300, 140) + topleft;
|
||||||
|
wchar_t* text = wgettext("Cancel");
|
||||||
Environment->addButton(rect, this, GUI_ID_CANCEL,
|
Environment->addButton(rect, this, GUI_ID_CANCEL,
|
||||||
wgettext("Cancel"));
|
text);
|
||||||
|
delete [] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
|
@ -93,15 +93,19 @@ void GUIDeathScreen::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 400, 50);
|
core::rect<s32> rect(0, 0, 400, 50);
|
||||||
rect = rect + v2s32(size.X/2-400/2, size.Y/2-50/2-25);
|
rect = rect + v2s32(size.X/2-400/2, size.Y/2-50/2-25);
|
||||||
Environment->addStaticText(wgettext("You died."), rect, false,
|
wchar_t* text = wgettext("You died.");
|
||||||
|
Environment->addStaticText(text, rect, false,
|
||||||
true, this, 256);
|
true, this, 256);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, 30);
|
core::rect<s32> rect(0, 0, 140, 30);
|
||||||
rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
|
rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
|
||||||
|
wchar_t* text = wgettext("Respawn");
|
||||||
gui::IGUIElement *e =
|
gui::IGUIElement *e =
|
||||||
Environment->addButton(rect, this, 257,
|
Environment->addButton(rect, this, 257,
|
||||||
wgettext("Respawn"));
|
text);
|
||||||
|
delete[] text;
|
||||||
Environment->setFocus(e);
|
Environment->setFocus(e);
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
|
@ -581,6 +581,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
|
|||||||
size.Y-rect.getHeight()-5);
|
size.Y-rect.getHeight()-5);
|
||||||
const wchar_t *text = wgettext("Left click: Move all items, Right click: Move single item");
|
const wchar_t *text = wgettext("Left click: Move all items, Right click: Move single item");
|
||||||
Environment->addStaticText(text, rect, false, true, this, 256);
|
Environment->addStaticText(text, rect, false, true, this, 256);
|
||||||
|
delete[] text;
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
// If there's fields, add a Proceed button
|
// If there's fields, add a Proceed button
|
||||||
@ -604,7 +605,9 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
|
|||||||
|
|
||||||
v2s32 size = DesiredRect.getSize();
|
v2s32 size = DesiredRect.getSize();
|
||||||
rect = core::rect<s32>(size.X/2-70, pos.Y, (size.X/2-70)+140, pos.Y+30);
|
rect = core::rect<s32>(size.X/2-70, pos.Y, (size.X/2-70)+140, pos.Y+30);
|
||||||
Environment->addButton(rect, this, 257, wgettext("Proceed"));
|
wchar_t* text = wgettext("Proceed");
|
||||||
|
Environment->addButton(rect, this, 257, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,13 @@ GUIModalMenu(env, parent, id, menumgr)
|
|||||||
GUIKeyChangeMenu::~GUIKeyChangeMenu()
|
GUIKeyChangeMenu::~GUIKeyChangeMenu()
|
||||||
{
|
{
|
||||||
removeChildren();
|
removeChildren();
|
||||||
|
|
||||||
|
for (std::vector<key_setting*>::iterator iter = key_settings.begin();
|
||||||
|
iter != key_settings.end(); iter ++) {
|
||||||
|
delete[] (*iter)->button_name;
|
||||||
|
delete (*iter);
|
||||||
|
}
|
||||||
|
key_settings.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUIKeyChangeMenu::removeChildren()
|
void GUIKeyChangeMenu::removeChildren()
|
||||||
@ -111,8 +118,10 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||||||
core::rect < s32 > rect(0, 0, 600, 40);
|
core::rect < s32 > rect(0, 0, 600, 40);
|
||||||
rect += topleft + v2s32(25, 3);
|
rect += topleft + v2s32(25, 3);
|
||||||
//gui::IGUIStaticText *t =
|
//gui::IGUIStaticText *t =
|
||||||
Environment->addStaticText(wgettext("Keybindings. (If this menu screws up, remove stuff from minetest.conf)"),
|
wchar_t* text = wgettext("Keybindings. (If this menu screws up, remove stuff from minetest.conf)");
|
||||||
|
Environment->addStaticText(text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
//t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
|
//t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +141,9 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect < s32 > rect(0, 0, 100, 30);
|
core::rect < s32 > rect(0, 0, 100, 30);
|
||||||
rect += topleft + v2s32(offset.X + 105, offset.Y - 5);
|
rect += topleft + v2s32(offset.X + 105, offset.Y - 5);
|
||||||
k->button = Environment->addButton(rect, this, k->id, wgettext(k->key.name()));
|
wchar_t* text = wgettext(k->key.name());
|
||||||
|
k->button = Environment->addButton(rect, this, k->id, text );
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
if(i + 1 == KMaxButtonPerColumns)
|
if(i + 1 == KMaxButtonPerColumns)
|
||||||
offset = v2s32(250, 60);
|
offset = v2s32(250, 60);
|
||||||
@ -147,8 +158,10 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += topleft + v2s32(option_x, option_y);
|
rect += topleft + v2s32(option_x, option_y);
|
||||||
|
wchar_t* text = wgettext("\"Use\" = climb down");
|
||||||
Environment->addCheckBox(g_settings->getBool("aux1_descends"), rect, this,
|
Environment->addCheckBox(g_settings->getBool("aux1_descends"), rect, this,
|
||||||
GUI_ID_CB_AUX1_DESCENDS, wgettext("\"Use\" = climb down"));
|
GUI_ID_CB_AUX1_DESCENDS, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
offset += v2s32(0, 25);
|
offset += v2s32(0, 25);
|
||||||
}
|
}
|
||||||
@ -160,8 +173,10 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += topleft + v2s32(option_x, option_y);
|
rect += topleft + v2s32(option_x, option_y);
|
||||||
|
wchar_t* text = wgettext("Double tap \"jump\" to toggle fly");
|
||||||
Environment->addCheckBox(g_settings->getBool("doubletap_jump"), rect, this,
|
Environment->addCheckBox(g_settings->getBool("doubletap_jump"), rect, this,
|
||||||
GUI_ID_CB_DOUBLETAP_JUMP, wgettext("Double tap \"jump\" to toggle fly"));
|
GUI_ID_CB_DOUBLETAP_JUMP, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
offset += v2s32(0, 25);
|
offset += v2s32(0, 25);
|
||||||
}
|
}
|
||||||
@ -169,14 +184,18 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect < s32 > rect(0, 0, 100, 30);
|
core::rect < s32 > rect(0, 0, 100, 30);
|
||||||
rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40);
|
rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40);
|
||||||
|
wchar_t* text = wgettext("Save");
|
||||||
Environment->addButton(rect, this, GUI_ID_BACK_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_BACK_BUTTON,
|
||||||
wgettext("Save"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect < s32 > rect(0, 0, 100, 30);
|
core::rect < s32 > rect(0, 0, 100, 30);
|
||||||
rect += topleft + v2s32(size.X - 100 - 20 - 100 - 20, size.Y - 40);
|
rect += topleft + v2s32(size.X - 100 - 20 - 100 - 20, size.Y - 40);
|
||||||
|
wchar_t* text = wgettext("Cancel");
|
||||||
Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON,
|
||||||
wgettext("Cancel"));
|
text );
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
|
|
||||||
@ -230,7 +249,9 @@ bool GUIKeyChangeMenu::resetMenu()
|
|||||||
key_setting *k = key_settings.at(i);
|
key_setting *k = key_settings.at(i);
|
||||||
if(k->id == activeKey)
|
if(k->id == activeKey)
|
||||||
{
|
{
|
||||||
k->button->setText(wgettext(k->key.name()));
|
wchar_t* text = wgettext(k->key.name());
|
||||||
|
k->button->setText(text);
|
||||||
|
delete[] text;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,8 +287,10 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
|
|||||||
{
|
{
|
||||||
core::rect < s32 > rect(0, 0, 600, 40);
|
core::rect < s32 > rect(0, 0, 600, 40);
|
||||||
rect += v2s32(0, 0) + v2s32(25, 30);
|
rect += v2s32(0, 0) + v2s32(25, 30);
|
||||||
this->key_used_text = Environment->addStaticText(wgettext("Key already in use"),
|
wchar_t* text = wgettext("Key already in use");
|
||||||
|
this->key_used_text = Environment->addStaticText(text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
//infostream << "Key already in use" << std::endl;
|
//infostream << "Key already in use" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +307,9 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
|
|||||||
}
|
}
|
||||||
assert(k);
|
assert(k);
|
||||||
k->key = kp;
|
k->key = kp;
|
||||||
k->button->setText(wgettext(k->key.name()));
|
wchar_t* text = wgettext(k->key.name());
|
||||||
|
k->button->setText(text);
|
||||||
|
delete[] text;
|
||||||
|
|
||||||
this->key_used.push_back(kp);
|
this->key_used.push_back(kp);
|
||||||
|
|
||||||
@ -344,7 +369,9 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
|
|||||||
resetMenu();
|
resetMenu();
|
||||||
shift_down = false;
|
shift_down = false;
|
||||||
activeKey = event.GUIEvent.Caller->getID();
|
activeKey = event.GUIEvent.Caller->getID();
|
||||||
k->button->setText(wgettext("press key"));
|
wchar_t* text = wgettext("press key");
|
||||||
|
k->button->setText(text);
|
||||||
|
delete[] text;
|
||||||
this->key_used.erase(std::remove(this->key_used.begin(),
|
this->key_used.erase(std::remove(this->key_used.begin(),
|
||||||
this->key_used.end(), k->key), this->key_used.end());
|
this->key_used.end(), k->key), this->key_used.end());
|
||||||
break;
|
break;
|
||||||
@ -357,11 +384,12 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
|
|||||||
return Parent ? Parent->OnEvent(event) : false;
|
return Parent ? Parent->OnEvent(event) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUIKeyChangeMenu::add_key(int id, std::string button_name, std::string setting_name)
|
void GUIKeyChangeMenu::add_key(int id, wchar_t* button_name, std::string setting_name)
|
||||||
{
|
{
|
||||||
key_setting *k = new key_setting;
|
key_setting *k = new key_setting;
|
||||||
k->id = id;
|
k->id = id;
|
||||||
k->button_name = wgettext(button_name.c_str());
|
|
||||||
|
k->button_name = button_name;
|
||||||
k->setting_name = setting_name;
|
k->setting_name = setting_name;
|
||||||
k->key = getKeySetting(k->setting_name.c_str());
|
k->key = getKeySetting(k->setting_name.c_str());
|
||||||
key_settings.push_back(k);
|
key_settings.push_back(k);
|
||||||
@ -369,21 +397,21 @@ void GUIKeyChangeMenu::add_key(int id, std::string button_name, std::string sett
|
|||||||
|
|
||||||
void GUIKeyChangeMenu::init_keys()
|
void GUIKeyChangeMenu::init_keys()
|
||||||
{
|
{
|
||||||
this->add_key(GUI_ID_KEY_FORWARD_BUTTON, gettext("Forward"), "keymap_forward");
|
this->add_key(GUI_ID_KEY_FORWARD_BUTTON, wgettext("Forward"), "keymap_forward");
|
||||||
this->add_key(GUI_ID_KEY_BACKWARD_BUTTON, gettext("Backward"), "keymap_backward");
|
this->add_key(GUI_ID_KEY_BACKWARD_BUTTON, wgettext("Backward"), "keymap_backward");
|
||||||
this->add_key(GUI_ID_KEY_LEFT_BUTTON, gettext("Left"), "keymap_left");
|
this->add_key(GUI_ID_KEY_LEFT_BUTTON, wgettext("Left"), "keymap_left");
|
||||||
this->add_key(GUI_ID_KEY_RIGHT_BUTTON, gettext("Right"), "keymap_right");
|
this->add_key(GUI_ID_KEY_RIGHT_BUTTON, wgettext("Right"), "keymap_right");
|
||||||
this->add_key(GUI_ID_KEY_USE_BUTTON, gettext("Use"), "keymap_special1");
|
this->add_key(GUI_ID_KEY_USE_BUTTON, wgettext("Use"), "keymap_special1");
|
||||||
this->add_key(GUI_ID_KEY_JUMP_BUTTON, gettext("Jump"), "keymap_jump");
|
this->add_key(GUI_ID_KEY_JUMP_BUTTON, wgettext("Jump"), "keymap_jump");
|
||||||
this->add_key(GUI_ID_KEY_SNEAK_BUTTON, gettext("Sneak"), "keymap_sneak");
|
this->add_key(GUI_ID_KEY_SNEAK_BUTTON, wgettext("Sneak"), "keymap_sneak");
|
||||||
this->add_key(GUI_ID_KEY_DROP_BUTTON, gettext("Drop"), "keymap_drop");
|
this->add_key(GUI_ID_KEY_DROP_BUTTON, wgettext("Drop"), "keymap_drop");
|
||||||
this->add_key(GUI_ID_KEY_INVENTORY_BUTTON, gettext("Inventory"), "keymap_inventory");
|
this->add_key(GUI_ID_KEY_INVENTORY_BUTTON, wgettext("Inventory"), "keymap_inventory");
|
||||||
this->add_key(GUI_ID_KEY_CHAT_BUTTON, gettext("Chat"), "keymap_chat");
|
this->add_key(GUI_ID_KEY_CHAT_BUTTON, wgettext("Chat"), "keymap_chat");
|
||||||
this->add_key(GUI_ID_KEY_CMD_BUTTON, gettext("Command"), "keymap_cmd");
|
this->add_key(GUI_ID_KEY_CMD_BUTTON, wgettext("Command"), "keymap_cmd");
|
||||||
this->add_key(GUI_ID_KEY_CONSOLE_BUTTON, gettext("Console"), "keymap_console");
|
this->add_key(GUI_ID_KEY_CONSOLE_BUTTON, wgettext("Console"), "keymap_console");
|
||||||
this->add_key(GUI_ID_KEY_FLY_BUTTON, gettext("Toggle fly"), "keymap_freemove");
|
this->add_key(GUI_ID_KEY_FLY_BUTTON, wgettext("Toggle fly"), "keymap_freemove");
|
||||||
this->add_key(GUI_ID_KEY_FAST_BUTTON, gettext("Toggle fast"), "keymap_fastmove");
|
this->add_key(GUI_ID_KEY_FAST_BUTTON, wgettext("Toggle fast"), "keymap_fastmove");
|
||||||
this->add_key(GUI_ID_KEY_NOCLIP_BUTTON, gettext("Toggle noclip"), "keymap_noclip");
|
this->add_key(GUI_ID_KEY_NOCLIP_BUTTON, wgettext("Toggle noclip"), "keymap_noclip");
|
||||||
this->add_key(GUI_ID_KEY_RANGE_BUTTON, gettext("Range select"), "keymap_rangeselect");
|
this->add_key(GUI_ID_KEY_RANGE_BUTTON, wgettext("Range select"), "keymap_rangeselect");
|
||||||
this->add_key(GUI_ID_KEY_DUMP_BUTTON, gettext("Print stacks"), "keymap_print_debug_stacks");
|
this->add_key(GUI_ID_KEY_DUMP_BUTTON, wgettext("Print stacks"), "keymap_print_debug_stacks");
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ private:
|
|||||||
|
|
||||||
bool resetMenu();
|
bool resetMenu();
|
||||||
|
|
||||||
void add_key(int id, std::string setting_name, std::string button_name);
|
void add_key(int id, wchar_t* button_name, std::string setting_name);
|
||||||
|
|
||||||
bool shift_down;
|
bool shift_down;
|
||||||
|
|
||||||
|
@ -89,7 +89,9 @@ struct CreateWorldDestMainMenu : public CreateWorldDest
|
|||||||
std::string name_narrow = wide_to_narrow(name);
|
std::string name_narrow = wide_to_narrow(name);
|
||||||
if(!string_allowed_blacklist(name_narrow, WORLDNAME_BLACKLISTED_CHARS))
|
if(!string_allowed_blacklist(name_narrow, WORLDNAME_BLACKLISTED_CHARS))
|
||||||
{
|
{
|
||||||
m_menu->displayMessageMenu(wgettext("Cannot create world: Name contains invalid characters"));
|
wchar_t* text = wgettext("Cannot create world: Name contains invalid characters");
|
||||||
|
m_menu->displayMessageMenu(text);
|
||||||
|
delete[] text;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::vector<WorldSpec> worlds = getAvailableWorlds();
|
std::vector<WorldSpec> worlds = getAvailableWorlds();
|
||||||
@ -98,7 +100,9 @@ struct CreateWorldDestMainMenu : public CreateWorldDest
|
|||||||
{
|
{
|
||||||
if((*i).name == name_narrow)
|
if((*i).name == name_narrow)
|
||||||
{
|
{
|
||||||
m_menu->displayMessageMenu(wgettext("Cannot create world: A world by this name already exists"));
|
wchar_t* text = wgettext("Cannot create world: A world by this name already exists");
|
||||||
|
m_menu->displayMessageMenu(text);
|
||||||
|
delete[] text;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -280,12 +284,24 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
rect += m_topleft_client + v2s32(0, -30);
|
rect += m_topleft_client + v2s32(0, -30);
|
||||||
gui::IGUITabControl *e = Environment->addTabControl(
|
gui::IGUITabControl *e = Environment->addTabControl(
|
||||||
rect, this, true, true, GUI_ID_TAB_CONTROL);
|
rect, this, true, true, GUI_ID_TAB_CONTROL);
|
||||||
e->addTab(wgettext("Singleplayer"));
|
wchar_t* text = wgettext("Singleplayer");
|
||||||
e->addTab(wgettext("Multiplayer"));
|
e->addTab(text);
|
||||||
e->addTab(wgettext("Advanced"));
|
delete[] text;
|
||||||
e->addTab(wgettext("Settings"));
|
text = wgettext("Multiplayer");
|
||||||
e->addTab(wgettext("Credits"));
|
e->addTab(text);
|
||||||
|
delete[] text;
|
||||||
|
text = wgettext("Advanced");
|
||||||
|
e->addTab(text);
|
||||||
|
delete[] text;
|
||||||
|
text = wgettext("Settings");
|
||||||
|
e->addTab(text);
|
||||||
|
delete[] text;
|
||||||
|
text = wgettext("Credits");
|
||||||
|
e->addTab(text);
|
||||||
|
delete[] text;
|
||||||
|
|
||||||
e->setActiveTab(m_data->selected_tab);
|
e->setActiveTab(m_data->selected_tab);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_data->selected_tab == TAB_SINGLEPLAYER)
|
if(m_data->selected_tab == TAB_SINGLEPLAYER)
|
||||||
@ -313,9 +329,11 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, world_sel_w-4, 20);
|
core::rect<s32> rect(0, 0, world_sel_w-4, 20);
|
||||||
rect += m_topleft_client + v2s32(world_sel_x+4, world_sel_y-20);
|
rect += m_topleft_client + v2s32(world_sel_x+4, world_sel_y-20);
|
||||||
|
wchar_t* text = wgettext("Select World:");
|
||||||
/*gui::IGUIStaticText *e =*/ Environment->addStaticText(
|
/*gui::IGUIStaticText *e =*/ Environment->addStaticText(
|
||||||
wgettext("Select World:"),
|
text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
/*e->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER);*/
|
/*e->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER);*/
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@ -335,23 +353,29 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, world_button_w, 30);
|
core::rect<s32> rect(0, 0, world_button_w, 30);
|
||||||
rect += m_topleft_client + v2s32(world_sel_x, world_sel_y+world_sel_h+0);
|
rect += m_topleft_client + v2s32(world_sel_x, world_sel_y+world_sel_h+0);
|
||||||
|
wchar_t* text = wgettext("Delete");
|
||||||
Environment->addButton(rect, this, GUI_ID_DELETE_WORLD_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_DELETE_WORLD_BUTTON,
|
||||||
wgettext("Delete"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
// Create world button
|
// Create world button
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, world_button_w, 30);
|
core::rect<s32> rect(0, 0, world_button_w, 30);
|
||||||
rect += m_topleft_client + v2s32(world_sel_x+world_button_w+bs, world_sel_y+world_sel_h+0);
|
rect += m_topleft_client + v2s32(world_sel_x+world_button_w+bs, world_sel_y+world_sel_h+0);
|
||||||
|
wchar_t* text = wgettext("New");
|
||||||
Environment->addButton(rect, this, GUI_ID_CREATE_WORLD_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_CREATE_WORLD_BUTTON,
|
||||||
wgettext("New"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
// Configure world button
|
// Configure world button
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, world_button_w, 30);
|
core::rect<s32> rect(0, 0, world_button_w, 30);
|
||||||
rect += m_topleft_client + v2s32(world_sel_x+(world_button_w+bs)*2,
|
rect += m_topleft_client + v2s32(world_sel_x+(world_button_w+bs)*2,
|
||||||
world_sel_y+world_sel_h+0);
|
world_sel_y+world_sel_h+0);
|
||||||
|
wchar_t* text = wgettext("Configure");
|
||||||
Environment->addButton(rect, this, GUI_ID_CONFIGURE_WORLD_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_CONFIGURE_WORLD_BUTTON,
|
||||||
wgettext("Configure"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
// Start game button
|
// Start game button
|
||||||
{
|
{
|
||||||
@ -365,8 +389,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
core::rect<s32> rect(0, 0, bw, 30);
|
core::rect<s32> rect(0, 0, bw, 30);
|
||||||
rect += m_topleft_client + v2s32(world_sel_x+world_sel_w-bw,
|
rect += m_topleft_client + v2s32(world_sel_x+world_sel_w-bw,
|
||||||
world_sel_y+world_sel_h+30+bs);
|
world_sel_y+world_sel_h+30+bs);
|
||||||
|
wchar_t* text = wgettext("Play");
|
||||||
Environment->addButton(rect, this,
|
Environment->addButton(rect, this,
|
||||||
GUI_ID_JOIN_GAME_BUTTON, wgettext("Play"));
|
GUI_ID_JOIN_GAME_BUTTON, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
// Options
|
// Options
|
||||||
s32 option_x = 50;
|
s32 option_x = 50;
|
||||||
@ -376,14 +402,18 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x, option_y+20*0);
|
rect += m_topleft_client + v2s32(option_x, option_y+20*0);
|
||||||
|
wchar_t* text = wgettext("Creative Mode");
|
||||||
Environment->addCheckBox(m_data->creative_mode, rect, this,
|
Environment->addCheckBox(m_data->creative_mode, rect, this,
|
||||||
GUI_ID_CREATIVE_CB, wgettext("Creative Mode"));
|
GUI_ID_CREATIVE_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x, option_y+20*1);
|
rect += m_topleft_client + v2s32(option_x, option_y+20*1);
|
||||||
|
wchar_t* text = wgettext("Enable Damage");
|
||||||
Environment->addCheckBox(m_data->enable_damage, rect, this,
|
Environment->addCheckBox(m_data->enable_damage, rect, this,
|
||||||
GUI_ID_DAMAGE_CB, wgettext("Enable Damage"));
|
GUI_ID_DAMAGE_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
@ -402,9 +432,11 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
// Nickname + password
|
// Nickname + password
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 110, 20);
|
core::rect<s32> rect(0, 0, 110, 20);
|
||||||
|
wchar_t* text = wgettext("Name/Password");
|
||||||
rect += m_topleft_client + v2s32(m_size_client.X-60-100, 10+6);
|
rect += m_topleft_client + v2s32(m_size_client.X-60-100, 10+6);
|
||||||
Environment->addStaticText(wgettext("Name/Password"),
|
Environment->addStaticText(text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete [] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
{
|
{
|
||||||
@ -467,8 +499,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 110, 20);
|
core::rect<s32> rect(0, 0, 110, 20);
|
||||||
rect += m_topleft_client + v2s32(50, m_size_client.Y-50-15+6);
|
rect += m_topleft_client + v2s32(50, m_size_client.Y-50-15+6);
|
||||||
Environment->addStaticText(wgettext("Address/Port"),
|
wchar_t* text = wgettext("Address/Port");
|
||||||
|
Environment->addStaticText(text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete [] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
{
|
{
|
||||||
@ -493,13 +527,17 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
core::rect<s32> rect(0, 0, 260, 30);
|
core::rect<s32> rect(0, 0, 260, 30);
|
||||||
rect += m_topleft_client + v2s32(50,
|
rect += m_topleft_client + v2s32(50,
|
||||||
180);
|
180);
|
||||||
|
wchar_t* text = wgettext("Show Public");
|
||||||
gui::IGUIButton *e = Environment->addButton(rect, this, GUI_ID_SERVERLIST_TOGGLE,
|
gui::IGUIButton *e = Environment->addButton(rect, this, GUI_ID_SERVERLIST_TOGGLE,
|
||||||
wgettext("Show Public"));
|
text);
|
||||||
|
delete[] text;
|
||||||
e->setIsPushButton(true);
|
e->setIsPushButton(true);
|
||||||
if (m_data->selected_serverlist == SERVERLIST_PUBLIC)
|
if (m_data->selected_serverlist == SERVERLIST_PUBLIC)
|
||||||
{
|
{
|
||||||
e->setText(wgettext("Show Favorites"));
|
wchar_t* text = wgettext("Show Favorites");
|
||||||
|
e->setText(text);
|
||||||
e->setPressed();
|
e->setPressed();
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -507,18 +545,23 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 120, 30);
|
core::rect<s32> rect(0, 0, 120, 30);
|
||||||
rect += m_topleft_client + v2s32(50+260+10, 180);
|
rect += m_topleft_client + v2s32(50+260+10, 180);
|
||||||
|
wchar_t* text = wgettext("Delete");
|
||||||
gui::IGUIButton *e = Environment->addButton(rect, this, GUI_ID_SERVERLIST_DELETE,
|
gui::IGUIButton *e = Environment->addButton(rect, this, GUI_ID_SERVERLIST_DELETE,
|
||||||
wgettext("Delete"));
|
text);
|
||||||
if (m_data->selected_serverlist == SERVERLIST_PUBLIC) // Hidden when on public list
|
if (m_data->selected_serverlist == SERVERLIST_PUBLIC) // Hidden when on public list
|
||||||
e->setVisible(false);
|
e->setVisible(false);
|
||||||
|
|
||||||
|
delete [] text;
|
||||||
}
|
}
|
||||||
// Start game button
|
// Start game button
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 120, 30);
|
core::rect<s32> rect(0, 0, 120, 30);
|
||||||
rect += m_topleft_client + v2s32(m_size_client.X-130-30,
|
rect += m_topleft_client + v2s32(m_size_client.X-130-30,
|
||||||
m_size_client.Y-25-15);
|
m_size_client.Y-25-15);
|
||||||
|
wchar_t* text = wgettext("Connect");
|
||||||
Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON,
|
||||||
wgettext("Connect"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
@ -538,8 +581,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 110, 20);
|
core::rect<s32> rect(0, 0, 110, 20);
|
||||||
rect += m_topleft_client + v2s32(35+30, 35+6);
|
rect += m_topleft_client + v2s32(35+30, 35+6);
|
||||||
Environment->addStaticText(wgettext("Name/Password"),
|
wchar_t* text = wgettext("Name/Password");
|
||||||
|
Environment->addStaticText(text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete [] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
{
|
{
|
||||||
@ -565,8 +610,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 110, 20);
|
core::rect<s32> rect(0, 0, 110, 20);
|
||||||
rect += m_topleft_client + v2s32(35+30, 75+6);
|
rect += m_topleft_client + v2s32(35+30, 75+6);
|
||||||
Environment->addStaticText(wgettext("Address/Port"),
|
wchar_t* text = wgettext("Address/Port");
|
||||||
|
Environment->addStaticText(text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
{
|
{
|
||||||
@ -588,16 +635,20 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 400, 20);
|
core::rect<s32> rect(0, 0, 400, 20);
|
||||||
rect += m_topleft_client + v2s32(160+30, 75+35);
|
rect += m_topleft_client + v2s32(160+30, 75+35);
|
||||||
Environment->addStaticText(wgettext("Leave address blank to start a local server."),
|
wchar_t* text = wgettext("Leave address blank to start a local server.");
|
||||||
|
Environment->addStaticText(text,
|
||||||
rect, false, true, this, -1);
|
rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
// Start game button
|
// Start game button
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 180, 30);
|
core::rect<s32> rect(0, 0, 180, 30);
|
||||||
rect += m_topleft_client + v2s32(m_size_client.X-180-30,
|
rect += m_topleft_client + v2s32(m_size_client.X-180-30,
|
||||||
m_size_client.Y-30-20);
|
m_size_client.Y-30-20);
|
||||||
|
wchar_t* text = wgettext("Start Game / Connect");
|
||||||
Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON,
|
||||||
wgettext("Start Game / Connect"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Server section
|
Server section
|
||||||
@ -615,36 +666,46 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 250, 30);
|
core::rect<s32> rect(0, 0, 250, 30);
|
||||||
rect += m_topleft_server + v2s32(30+20+250+20, 20);
|
rect += m_topleft_server + v2s32(30+20+250+20, 20);
|
||||||
|
wchar_t* text = wgettext("Creative Mode");
|
||||||
Environment->addCheckBox(m_data->creative_mode, rect, this, GUI_ID_CREATIVE_CB,
|
Environment->addCheckBox(m_data->creative_mode, rect, this, GUI_ID_CREATIVE_CB,
|
||||||
wgettext("Creative Mode"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 250, 30);
|
core::rect<s32> rect(0, 0, 250, 30);
|
||||||
rect += m_topleft_server + v2s32(30+20+250+20, 40);
|
rect += m_topleft_server + v2s32(30+20+250+20, 40);
|
||||||
|
wchar_t* text = wgettext("Enable Damage");
|
||||||
Environment->addCheckBox(m_data->enable_damage, rect, this, GUI_ID_DAMAGE_CB,
|
Environment->addCheckBox(m_data->enable_damage, rect, this, GUI_ID_DAMAGE_CB,
|
||||||
wgettext("Enable Damage"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
#if USE_CURL
|
#if USE_CURL
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 250, 30);
|
core::rect<s32> rect(0, 0, 250, 30);
|
||||||
rect += m_topleft_server + v2s32(30+20+250+20, 60);
|
rect += m_topleft_server + v2s32(30+20+250+20, 60);
|
||||||
|
wchar_t* text = wgettext("Public");
|
||||||
Environment->addCheckBox(m_data->enable_public, rect, this, GUI_ID_PUBLIC_CB,
|
Environment->addCheckBox(m_data->enable_public, rect, this, GUI_ID_PUBLIC_CB,
|
||||||
wgettext("Public"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// Delete world button
|
// Delete world button
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 130, 30);
|
core::rect<s32> rect(0, 0, 130, 30);
|
||||||
rect += m_topleft_server + v2s32(30+20+250+20, 90);
|
rect += m_topleft_server + v2s32(30+20+250+20, 90);
|
||||||
|
wchar_t* text = wgettext("Delete world");
|
||||||
Environment->addButton(rect, this, GUI_ID_DELETE_WORLD_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_DELETE_WORLD_BUTTON,
|
||||||
wgettext("Delete world"));
|
text );
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
// Create world button
|
// Create world button
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 130, 30);
|
core::rect<s32> rect(0, 0, 130, 30);
|
||||||
rect += m_topleft_server + v2s32(30+20+250+20+140, 90);
|
rect += m_topleft_server + v2s32(30+20+250+20+140, 90);
|
||||||
|
wchar_t* text = wgettext("Create world");
|
||||||
Environment->addButton(rect, this, GUI_ID_CREATE_WORLD_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_CREATE_WORLD_BUTTON,
|
||||||
wgettext("Create world"));
|
text );
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
// World selection listbox
|
// World selection listbox
|
||||||
{
|
{
|
||||||
@ -677,26 +738,34 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x, option_y);
|
rect += m_topleft_client + v2s32(option_x, option_y);
|
||||||
|
wchar_t* text = wgettext("Fancy trees");
|
||||||
Environment->addCheckBox(m_data->fancy_trees, rect, this,
|
Environment->addCheckBox(m_data->fancy_trees, rect, this,
|
||||||
GUI_ID_FANCYTREE_CB, wgettext("Fancy trees"));
|
GUI_ID_FANCYTREE_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x, option_y+20);
|
rect += m_topleft_client + v2s32(option_x, option_y+20);
|
||||||
|
wchar_t* text = wgettext("Smooth Lighting");
|
||||||
Environment->addCheckBox(m_data->smooth_lighting, rect, this,
|
Environment->addCheckBox(m_data->smooth_lighting, rect, this,
|
||||||
GUI_ID_SMOOTH_LIGHTING_CB, wgettext("Smooth Lighting"));
|
GUI_ID_SMOOTH_LIGHTING_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x, option_y+20*2);
|
rect += m_topleft_client + v2s32(option_x, option_y+20*2);
|
||||||
|
wchar_t* text = wgettext("3D Clouds");
|
||||||
Environment->addCheckBox(m_data->clouds_3d, rect, this,
|
Environment->addCheckBox(m_data->clouds_3d, rect, this,
|
||||||
GUI_ID_3D_CLOUDS_CB, wgettext("3D Clouds"));
|
GUI_ID_3D_CLOUDS_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w, 30);
|
core::rect<s32> rect(0, 0, option_w, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x, option_y+20*3);
|
rect += m_topleft_client + v2s32(option_x, option_y+20*3);
|
||||||
|
wchar_t* text = wgettext("Opaque water");
|
||||||
Environment->addCheckBox(m_data->opaque_water, rect, this,
|
Environment->addCheckBox(m_data->opaque_water, rect, this,
|
||||||
GUI_ID_OPAQUE_WATER_CB, wgettext("Opaque water"));
|
GUI_ID_OPAQUE_WATER_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -705,58 +774,74 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175, option_y);
|
rect += m_topleft_client + v2s32(option_x+175, option_y);
|
||||||
|
wchar_t* text = wgettext("Mip-Mapping");
|
||||||
Environment->addCheckBox(m_data->mip_map, rect, this,
|
Environment->addCheckBox(m_data->mip_map, rect, this,
|
||||||
GUI_ID_MIPMAP_CB, wgettext("Mip-Mapping"));
|
GUI_ID_MIPMAP_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175, option_y+20);
|
rect += m_topleft_client + v2s32(option_x+175, option_y+20);
|
||||||
|
wchar_t* text = wgettext("Anisotropic Filtering");
|
||||||
Environment->addCheckBox(m_data->anisotropic_filter, rect, this,
|
Environment->addCheckBox(m_data->anisotropic_filter, rect, this,
|
||||||
GUI_ID_ANISOTROPIC_CB, wgettext("Anisotropic Filtering"));
|
GUI_ID_ANISOTROPIC_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175, option_y+20*2);
|
rect += m_topleft_client + v2s32(option_x+175, option_y+20*2);
|
||||||
|
wchar_t* text = wgettext("Bi-Linear Filtering");
|
||||||
Environment->addCheckBox(m_data->bilinear_filter, rect, this,
|
Environment->addCheckBox(m_data->bilinear_filter, rect, this,
|
||||||
GUI_ID_BILINEAR_CB, wgettext("Bi-Linear Filtering"));
|
GUI_ID_BILINEAR_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175, option_y+20*3);
|
rect += m_topleft_client + v2s32(option_x+175, option_y+20*3);
|
||||||
|
wchar_t* text = wgettext("Tri-Linear Filtering");
|
||||||
Environment->addCheckBox(m_data->trilinear_filter, rect, this,
|
Environment->addCheckBox(m_data->trilinear_filter, rect, this,
|
||||||
GUI_ID_TRILINEAR_CB, wgettext("Tri-Linear Filtering"));
|
GUI_ID_TRILINEAR_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
// shader/on demand image loading/particles settings
|
// shader/on demand image loading/particles settings
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175*2, option_y);
|
rect += m_topleft_client + v2s32(option_x+175*2, option_y);
|
||||||
|
wchar_t* text = wgettext("Shaders");
|
||||||
Environment->addCheckBox(m_data->enable_shaders, rect, this,
|
Environment->addCheckBox(m_data->enable_shaders, rect, this,
|
||||||
GUI_ID_SHADERS_CB, wgettext("Shaders"));
|
GUI_ID_SHADERS_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175*2, option_y+20);
|
rect += m_topleft_client + v2s32(option_x+175*2, option_y+20);
|
||||||
|
wchar_t* text = wgettext("Preload item visuals");
|
||||||
Environment->addCheckBox(m_data->preload_item_visuals, rect, this,
|
Environment->addCheckBox(m_data->preload_item_visuals, rect, this,
|
||||||
GUI_ID_PRELOAD_ITEM_VISUALS_CB, wgettext("Preload item visuals"));
|
GUI_ID_PRELOAD_ITEM_VISUALS_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175*2, option_y+20*2);
|
rect += m_topleft_client + v2s32(option_x+175*2, option_y+20*2);
|
||||||
|
wchar_t* text = wgettext("Enable Particles");
|
||||||
Environment->addCheckBox(m_data->enable_particles, rect, this,
|
Environment->addCheckBox(m_data->enable_particles, rect, this,
|
||||||
GUI_ID_ENABLE_PARTICLES_CB, wgettext("Enable Particles"));
|
GUI_ID_ENABLE_PARTICLES_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, option_w+20+20, 30);
|
core::rect<s32> rect(0, 0, option_w+20+20, 30);
|
||||||
rect += m_topleft_client + v2s32(option_x+175*2, option_y+20*3);
|
rect += m_topleft_client + v2s32(option_x+175*2, option_y+20*3);
|
||||||
|
wchar_t* text = wgettext("Finite liquid");
|
||||||
Environment->addCheckBox(m_data->liquid_finite, rect, this,
|
Environment->addCheckBox(m_data->liquid_finite, rect, this,
|
||||||
GUI_ID_LIQUID_FINITE_CB, wgettext("Finite liquid"));
|
GUI_ID_LIQUID_FINITE_CB, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Key change button
|
// Key change button
|
||||||
@ -765,8 +850,10 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
|
|||||||
/*rect += m_topleft_client + v2s32(m_size_client.X-120-30,
|
/*rect += m_topleft_client + v2s32(m_size_client.X-120-30,
|
||||||
m_size_client.Y-30-20);*/
|
m_size_client.Y-30-20);*/
|
||||||
rect += m_topleft_client + v2s32(option_x, option_y+120);
|
rect += m_topleft_client + v2s32(option_x, option_y+120);
|
||||||
|
wchar_t* text = wgettext("Change keys");
|
||||||
Environment->addButton(rect, this,
|
Environment->addButton(rect, this,
|
||||||
GUI_ID_CHANGE_KEYS_BUTTON, wgettext("Change keys"));
|
GUI_ID_CHANGE_KEYS_BUTTON, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
@ -1080,9 +1167,11 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
|
|||||||
readInput(&cur);
|
readInput(&cur);
|
||||||
if (getTab() == TAB_MULTIPLAYER && cur.address == L"")
|
if (getTab() == TAB_MULTIPLAYER && cur.address == L"")
|
||||||
{
|
{
|
||||||
|
wchar_t* text = wgettext("Address required.");
|
||||||
(new GUIMessageMenu(env, parent, -1, menumgr,
|
(new GUIMessageMenu(env, parent, -1, menumgr,
|
||||||
wgettext("Address required."))
|
text)
|
||||||
)->drop();
|
)->drop();
|
||||||
|
delete[] text;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
acceptInput();
|
acceptInput();
|
||||||
@ -1098,9 +1187,11 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
|
|||||||
MainMenuData cur;
|
MainMenuData cur;
|
||||||
readInput(&cur);
|
readInput(&cur);
|
||||||
if(cur.selected_world == -1){
|
if(cur.selected_world == -1){
|
||||||
|
wchar_t* text = wgettext("Cannot delete world: Nothing selected");
|
||||||
(new GUIMessageMenu(env, parent, -1, menumgr,
|
(new GUIMessageMenu(env, parent, -1, menumgr,
|
||||||
wgettext("Cannot delete world: Nothing selected"))
|
text)
|
||||||
)->drop();
|
)->drop();
|
||||||
|
delete[] text;
|
||||||
} else {
|
} else {
|
||||||
WorldSpec spec = m_data->worlds[cur.selected_world];
|
WorldSpec spec = m_data->worlds[cur.selected_world];
|
||||||
// Get files and directories involved
|
// Get files and directories involved
|
||||||
@ -1110,12 +1201,16 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
|
|||||||
// Launch confirmation dialog
|
// Launch confirmation dialog
|
||||||
ConfirmDestDeleteWorld *dest = new
|
ConfirmDestDeleteWorld *dest = new
|
||||||
ConfirmDestDeleteWorld(spec, this, paths);
|
ConfirmDestDeleteWorld(spec, this, paths);
|
||||||
std::wstring text = wgettext("Delete world");
|
wchar_t* text1 = wgettext("Delete world");
|
||||||
|
wchar_t* text2 = wgettext("Files to be deleted");
|
||||||
|
std::wstring text = text1;
|
||||||
text += L" \"";
|
text += L" \"";
|
||||||
text += narrow_to_wide(spec.name);
|
text += narrow_to_wide(spec.name);
|
||||||
text += L"\"?\n\n";
|
text += L"\"?\n\n";
|
||||||
text += wgettext("Files to be deleted");
|
text += text2;
|
||||||
text += L":\n";
|
text += L":\n";
|
||||||
|
delete[] text1;
|
||||||
|
delete[] text2;
|
||||||
for(u32 i=0; i<paths.size(); i++){
|
for(u32 i=0; i<paths.size(); i++){
|
||||||
if(i == 3){ text += L"..."; break; }
|
if(i == 3){ text += L"..."; break; }
|
||||||
text += narrow_to_wide(paths[i]) + L"\n";
|
text += narrow_to_wide(paths[i]) + L"\n";
|
||||||
@ -1128,10 +1223,12 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
|
|||||||
case GUI_ID_CREATE_WORLD_BUTTON: {
|
case GUI_ID_CREATE_WORLD_BUTTON: {
|
||||||
std::vector<SubgameSpec> games = getAvailableGames();
|
std::vector<SubgameSpec> games = getAvailableGames();
|
||||||
if(games.size() == 0){
|
if(games.size() == 0){
|
||||||
|
wchar_t* text = wgettext("Cannot create world: No games found");
|
||||||
GUIMessageMenu *menu = new GUIMessageMenu(env, parent,
|
GUIMessageMenu *menu = new GUIMessageMenu(env, parent,
|
||||||
-1, menumgr,
|
-1, menumgr,
|
||||||
wgettext("Cannot create world: No games found"));
|
text);
|
||||||
menu->drop();
|
menu->drop();
|
||||||
|
delete[] text;
|
||||||
} else {
|
} else {
|
||||||
CreateWorldDest *dest = new CreateWorldDestMainMenu(this);
|
CreateWorldDest *dest = new CreateWorldDestMainMenu(this);
|
||||||
GUICreateWorld *menu = new GUICreateWorld(env, parent, -1,
|
GUICreateWorld *menu = new GUICreateWorld(env, parent, -1,
|
||||||
@ -1145,9 +1242,11 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
|
|||||||
readInput(&cur);
|
readInput(&cur);
|
||||||
if(cur.selected_world == -1)
|
if(cur.selected_world == -1)
|
||||||
{
|
{
|
||||||
|
wchar_t* text = wgettext("Cannot configure world: Nothing selected");
|
||||||
(new GUIMessageMenu(env, parent, -1, menumgr,
|
(new GUIMessageMenu(env, parent, -1, menumgr,
|
||||||
wgettext("Cannot configure world: Nothing selected"))
|
text)
|
||||||
)->drop();
|
)->drop();
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1180,8 +1279,12 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
|
|||||||
if (m_data->selected_serverlist == SERVERLIST_PUBLIC) // switch to favorite list
|
if (m_data->selected_serverlist == SERVERLIST_PUBLIC) // switch to favorite list
|
||||||
{
|
{
|
||||||
m_data->servers = ServerList::getLocal();
|
m_data->servers = ServerList::getLocal();
|
||||||
togglebutton->setText(wgettext("Show Public"));
|
wchar_t* text1 = wgettext("Show Public");
|
||||||
title->setText(wgettext("Favorites:"));
|
wchar_t* text2 = wgettext("Favorites:");
|
||||||
|
togglebutton->setText(text1);
|
||||||
|
title->setText(text2);
|
||||||
|
delete[] text1;
|
||||||
|
delete[] text2;
|
||||||
deletebutton->setVisible(true);
|
deletebutton->setVisible(true);
|
||||||
updateGuiServerList();
|
updateGuiServerList();
|
||||||
serverlist->setSelected(0);
|
serverlist->setSelected(0);
|
||||||
@ -1190,8 +1293,12 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
|
|||||||
else // switch to online list
|
else // switch to online list
|
||||||
{
|
{
|
||||||
m_data->servers = ServerList::getOnline();
|
m_data->servers = ServerList::getOnline();
|
||||||
togglebutton->setText(wgettext("Show Favorites"));
|
wchar_t* text1 = wgettext("Show Favorites");
|
||||||
title->setText(wgettext("Public Server List:"));
|
wchar_t* text2 = wgettext("Public Server List:");
|
||||||
|
togglebutton->setText(text1);
|
||||||
|
title->setText(text2);
|
||||||
|
delete[] text1;
|
||||||
|
delete[] text2;
|
||||||
deletebutton->setVisible(false);
|
deletebutton->setVisible(false);
|
||||||
updateGuiServerList();
|
updateGuiServerList();
|
||||||
serverlist->setSelected(0);
|
serverlist->setSelected(0);
|
||||||
@ -1261,8 +1368,10 @@ void GUIMainMenu::deleteWorld(const std::vector<std::string> &paths)
|
|||||||
// Delete files
|
// Delete files
|
||||||
bool did = fs::DeletePaths(paths);
|
bool did = fs::DeletePaths(paths);
|
||||||
if(!did){
|
if(!did){
|
||||||
|
wchar_t* text = wgettext("Failed to delete all world files");
|
||||||
GUIMessageMenu *menu = new GUIMessageMenu(env, parent,
|
GUIMessageMenu *menu = new GUIMessageMenu(env, parent,
|
||||||
-1, menumgr, wgettext("Failed to delete all world files"));
|
-1, menumgr, text);
|
||||||
|
delete[] text;
|
||||||
menu->drop();
|
menu->drop();
|
||||||
}
|
}
|
||||||
// Quit menu to refresh it
|
// Quit menu to refresh it
|
||||||
|
@ -104,10 +104,12 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, bw, 30);
|
core::rect<s32> rect(0, 0, bw, 30);
|
||||||
rect = rect + v2s32(size.X/2-bw/2, size.Y/2-30/2+5 + msg_h/2);
|
rect = rect + v2s32(size.X/2-bw/2, size.Y/2-30/2+5 + msg_h/2);
|
||||||
|
wchar_t* text = wgettext("Proceed");
|
||||||
gui::IGUIElement *e =
|
gui::IGUIElement *e =
|
||||||
Environment->addButton(rect, this, 257,
|
Environment->addButton(rect, this, 257,
|
||||||
wgettext("Proceed"));
|
text);
|
||||||
Environment->setFocus(e);
|
Environment->setFocus(e);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 110, 20);
|
core::rect<s32> rect(0, 0, 110, 20);
|
||||||
rect += topleft_client + v2s32(35, ypos+6);
|
rect += topleft_client + v2s32(35, ypos+6);
|
||||||
Environment->addStaticText(wgettext("Old Password"),
|
wchar_t* text = wgettext("Old Password");
|
||||||
rect, false, true, this, -1);
|
Environment->addStaticText(text, rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
{
|
{
|
||||||
@ -122,8 +123,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 110, 20);
|
core::rect<s32> rect(0, 0, 110, 20);
|
||||||
rect += topleft_client + v2s32(35, ypos+6);
|
rect += topleft_client + v2s32(35, ypos+6);
|
||||||
Environment->addStaticText(wgettext("New Password"),
|
wchar_t* text = wgettext("New Password");
|
||||||
rect, false, true, this, -1);
|
Environment->addStaticText(text, rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
{
|
{
|
||||||
@ -138,8 +140,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 110, 20);
|
core::rect<s32> rect(0, 0, 110, 20);
|
||||||
rect += topleft_client + v2s32(35, ypos+6);
|
rect += topleft_client + v2s32(35, ypos+6);
|
||||||
Environment->addStaticText(wgettext("Confirm Password"),
|
wchar_t* text = wgettext("Confirm Password");
|
||||||
rect, false, true, this, -1);
|
Environment->addStaticText(text, rect, false, true, this, -1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
{
|
{
|
||||||
@ -155,18 +158,22 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, 30);
|
core::rect<s32> rect(0, 0, 140, 30);
|
||||||
rect = rect + v2s32(size.X/2-140/2, ypos);
|
rect = rect + v2s32(size.X/2-140/2, ypos);
|
||||||
Environment->addButton(rect, this, ID_change, wgettext("Change"));
|
wchar_t* text = wgettext("Change");
|
||||||
|
Environment->addButton(rect, this, ID_change, text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
ypos += 50;
|
ypos += 50;
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 300, 20);
|
core::rect<s32> rect(0, 0, 300, 20);
|
||||||
rect += topleft_client + v2s32(35, ypos);
|
rect += topleft_client + v2s32(35, ypos);
|
||||||
|
wchar_t* text = wgettext("Passwords do not match!");
|
||||||
IGUIElement *e =
|
IGUIElement *e =
|
||||||
Environment->addStaticText(
|
Environment->addStaticText(
|
||||||
wgettext("Passwords do not match!"),
|
text,
|
||||||
rect, false, true, this, ID_message);
|
rect, false, true, this, ID_message);
|
||||||
e->setVisible(false);
|
e->setVisible(false);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
|
|
||||||
|
@ -119,8 +119,10 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||||
|
wchar_t* text = wgettext("Continue");
|
||||||
Environment->addButton(rect, this, 256,
|
Environment->addButton(rect, this, 256,
|
||||||
wgettext("Continue"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
btn_y += btn_height + btn_gap;
|
btn_y += btn_height + btn_gap;
|
||||||
if(!m_simple_singleplayer_mode)
|
if(!m_simple_singleplayer_mode)
|
||||||
@ -128,48 +130,58 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||||
|
wchar_t* text = wgettext("Change Password");
|
||||||
Environment->addButton(rect, this, 261,
|
Environment->addButton(rect, this, 261,
|
||||||
wgettext("Change Password"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
btn_y += btn_height + btn_gap;
|
btn_y += btn_height + btn_gap;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||||
|
wchar_t* text = wgettext("Sound Volume");
|
||||||
Environment->addButton(rect, this, 262,
|
Environment->addButton(rect, this, 262,
|
||||||
wgettext("Sound Volume"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
btn_y += btn_height + btn_gap;
|
btn_y += btn_height + btn_gap;
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||||
|
wchar_t* text = wgettext("Exit to Menu");
|
||||||
Environment->addButton(rect, this, 260,
|
Environment->addButton(rect, this, 260,
|
||||||
wgettext("Exit to Menu"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
btn_y += btn_height + btn_gap;
|
btn_y += btn_height + btn_gap;
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||||
|
wchar_t* text = wgettext("Exit to OS");
|
||||||
Environment->addButton(rect, this, 257,
|
Environment->addButton(rect, this, 257,
|
||||||
wgettext("Exit to OS"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 180, 240);
|
core::rect<s32> rect(0, 0, 180, 240);
|
||||||
rect = rect + v2s32(size.X/2 + 90, size.Y/2-rect.getHeight()/2);
|
rect = rect + v2s32(size.X/2 + 90, size.Y/2-rect.getHeight()/2);
|
||||||
Environment->addStaticText(chartowchar_t(gettext(
|
wchar_t* text = wgettext("Default Controls:\n"
|
||||||
"Default Controls:\n"
|
"- WASD: Walk\n"
|
||||||
"- WASD: Walk\n"
|
"- Mouse left: dig/hit\n"
|
||||||
"- Mouse left: dig/hit\n"
|
"- Mouse right: place/use\n"
|
||||||
"- Mouse right: place/use\n"
|
"- Mouse wheel: select item\n"
|
||||||
"- Mouse wheel: select item\n"
|
"- 0...9: select item\n"
|
||||||
"- 0...9: select item\n"
|
"- Shift: sneak\n"
|
||||||
"- Shift: sneak\n"
|
"- R: Toggle viewing all loaded chunks\n"
|
||||||
"- R: Toggle viewing all loaded chunks\n"
|
"- I: Inventory menu\n"
|
||||||
"- I: Inventory menu\n"
|
"- ESC: This menu\n"
|
||||||
"- ESC: This menu\n"
|
"- T: Chat\n"
|
||||||
"- T: Chat\n"
|
);
|
||||||
)), rect, false, true, this, 258);
|
Environment->addStaticText(text, rect, false, true, this, 258);
|
||||||
|
delete[] text;
|
||||||
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 180, 220);
|
core::rect<s32> rect(0, 0, 180, 220);
|
||||||
|
@ -127,8 +127,10 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 140, 30);
|
core::rect<s32> rect(0, 0, 140, 30);
|
||||||
rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
|
rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25);
|
||||||
|
wchar_t* text = wgettext("Proceed");
|
||||||
Environment->addButton(rect, this, 257,
|
Environment->addButton(rect, this, 257,
|
||||||
wgettext("Proceed"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
changeCtype("C");
|
changeCtype("C");
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,10 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 120, 20);
|
core::rect<s32> rect(0, 0, 120, 20);
|
||||||
rect = rect + v2s32(size.X/2-60, size.Y/2-35);
|
rect = rect + v2s32(size.X/2-60, size.Y/2-35);
|
||||||
Environment->addStaticText(wgettext("Sound Volume: "), rect, false,
|
wchar_t* text = wgettext("Sound Volume: ");
|
||||||
|
Environment->addStaticText(text, rect, false,
|
||||||
true, this, ID_soundText1);
|
true, this, ID_soundText1);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 30, 20);
|
core::rect<s32> rect(0, 0, 30, 20);
|
||||||
@ -117,8 +119,10 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
|
|||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 80, 30);
|
core::rect<s32> rect(0, 0, 80, 30);
|
||||||
rect = rect + v2s32(size.X/2-80/2, size.Y/2+55);
|
rect = rect + v2s32(size.X/2-80/2, size.Y/2+55);
|
||||||
|
wchar_t* text = wgettext("Exit");
|
||||||
Environment->addButton(rect, this, ID_soundExitButton,
|
Environment->addButton(rect, this, ID_soundExitButton,
|
||||||
wgettext("Exit"));
|
text);
|
||||||
|
delete[] text;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 300, 20);
|
core::rect<s32> rect(0, 0, 300, 20);
|
||||||
|
@ -1501,7 +1501,9 @@ int main(int argc, char *argv[])
|
|||||||
while(device->run() && kill == false)
|
while(device->run() && kill == false)
|
||||||
{
|
{
|
||||||
// Set the window caption
|
// Set the window caption
|
||||||
device->setWindowCaption((std::wstring(L"Minetest [")+wgettext("Main Menu")+L"]").c_str());
|
wchar_t* text = wgettext("Main Menu");
|
||||||
|
device->setWindowCaption((std::wstring(L"Minetest [")+text+L"]").c_str());
|
||||||
|
delete[] text;
|
||||||
|
|
||||||
// This is used for catching disconnects
|
// This is used for catching disconnects
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user