From 30b9a4d6b479ecfcb84d4803f5d15ee9b6c7edd6 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sun, 3 Feb 2013 16:19:09 +0400 Subject: Add Freetype support --- src/guiMainMenu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/guiMainMenu.cpp') diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 9291bb4ec..343369643 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -260,7 +260,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) //const wchar_t *text = L"H\nY\nB\nR\nI\nD"; const wchar_t *text = L"T\nA\nP\nE\n\nA\nN\nD\n\nG\nL\nU\nE"; gui::IGUIStaticText *t = - Environment->addStaticText(text, rect, false, false, this, -1); + Environment->addStaticText(text, rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER); } u32 bs = 5; @@ -359,7 +359,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) rect += m_topleft_client + v2s32(15, 0); const wchar_t *text = L"C\nL\nI\nE\nN\nT"; gui::IGUIStaticText *t = - Environment->addStaticText(text, rect, false, false, this, -1); + Environment->addStaticText(text, rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER); } // Nickname + password @@ -469,7 +469,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) rect += m_topleft_client + v2s32(15, 0); const wchar_t *text = L"C\nL\nI\nE\nN\nT"; gui::IGUIStaticText *t = - Environment->addStaticText(text, rect, false, false, this, -1); + Environment->addStaticText(text, rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER); } // Nickname + password @@ -546,7 +546,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) rect += m_topleft_server + v2s32(15, 0); const wchar_t *text = L"S\nE\nR\nV\nE\nR"; gui::IGUIStaticText *t = - Environment->addStaticText(text, rect, false, false, this, -1); + Environment->addStaticText(text, rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER); } // Server parameters @@ -598,7 +598,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) rect += m_topleft_client + v2s32(15, 0); const wchar_t *text = L"S\nE\nT\nT\nI\nN\nG\nS"; gui::IGUIStaticText *t = - Environment->addStaticText(text, rect, false, false, this, -1); + Environment->addStaticText(text, rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER); } s32 option_x = 70; @@ -701,7 +701,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) rect += m_topleft_client + v2s32(15, 0); const wchar_t *text = L"C\nR\nE\nD\nI\nT\nS"; gui::IGUIStaticText *t = - Environment->addStaticText(text, rect, false, false, this, -1); + Environment->addStaticText(text, rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER); } { -- cgit v1.2.3 From ee07c3f7cf638e854518d2cfcb9c11a64412cc72 Mon Sep 17 00:00:00 2001 From: proller Date: Fri, 22 Feb 2013 02:00:44 +0400 Subject: new auto masterserver --- src/guiMainMenu.cpp | 64 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 16 deletions(-) (limited to 'src/guiMainMenu.cpp') diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 343369643..ca334198f 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -108,6 +108,7 @@ enum GUI_ID_ENABLE_PARTICLES_CB, GUI_ID_DAMAGE_CB, GUI_ID_CREATIVE_CB, + GUI_ID_PUBLIC_CB, GUI_ID_JOIN_GAME_BUTTON, GUI_ID_CHANGE_KEYS_BUTTON, GUI_ID_DELETE_WORLD_BUTTON, @@ -562,6 +563,14 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) Environment->addCheckBox(m_data->enable_damage, rect, this, GUI_ID_DAMAGE_CB, wgettext("Enable Damage")); } + #if USE_CURL + { + core::rect rect(0, 0, 250, 30); + rect += m_topleft_server + v2s32(30+20+250+20, 60); + Environment->addCheckBox(m_data->enable_public, rect, this, GUI_ID_PUBLIC_CB, + wgettext("Public")); + } + #endif // Delete world button { core::rect rect(0, 0, 130, 30); @@ -841,6 +850,11 @@ void GUIMainMenu::readInput(MainMenuData *dst) if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) dst->enable_damage = ((gui::IGUICheckBox*)e)->isChecked(); } + { + gui::IGUIElement *e = getElementFromId(GUI_ID_PUBLIC_CB); + if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) + dst->enable_public = ((gui::IGUICheckBox*)e)->isChecked(); + } { gui::IGUIElement *e = getElementFromId(GUI_ID_FANCYTREE_CB); if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) @@ -912,8 +926,8 @@ void GUIMainMenu::readInput(MainMenuData *dst) { ServerListSpec server = getServerListSpec(wide_to_narrow(dst->address), wide_to_narrow(dst->port)); - dst->servername = server.name; - dst->serverdescription = server.description; + dst->servername = server["name"].asString(); + dst->serverdescription = server["description"].asString(); } } @@ -1174,13 +1188,31 @@ void GUIMainMenu::updateGuiServerList() i != m_data->servers.end(); i++) { std::string text; - if (i->name != "" && i->description != "") - text = i->name + " (" + i->description + ")"; - else if (i->name !="") - text = i->name; - else - text = i->address + ":" + i->port; + if ((*i)["clients"].asString().size()) + text += (*i)["clients"].asString(); + if ((*i)["clients_max"].asString().size()) + text += "/" + (*i)["clients_max"].asString(); + text += " "; + if ((*i)["version"].asString().size()) + text += (*i)["version"].asString() + " "; + if ((*i)["password"].asString().size()) + text += "*"; + if ((*i)["creative"].asString().size()) + text += "C"; + if ((*i)["damage"].asString().size()) + text += "D"; + if ((*i)["pvp"].asString().size()) + text += "P"; + text += " "; + + if ((*i)["name"] != "" && (*i)["description"] != "") + text += (*i)["name"].asString() + " (" + (*i)["description"].asString() + ")"; + else if ((*i)["name"] !="") + text += (*i)["name"].asString(); + else + text += (*i)["address"].asString() + ":" + (*i)["port"].asString(); + serverlist->addItem(narrow_to_wide(text).c_str()); } } @@ -1191,26 +1223,26 @@ void GUIMainMenu::serverListOnSelected() { gui::IGUIListBox *serverlist = (gui::IGUIListBox*)getElementFromId(GUI_ID_SERVERLIST); u16 id = serverlist->getSelected(); - if (id < 0) return; + //if (id < 0) return; // u16>0! ((gui::IGUIEditBox*)getElementFromId(GUI_ID_ADDRESS_INPUT)) - ->setText(narrow_to_wide(m_data->servers[id].address).c_str()); + ->setText(narrow_to_wide(m_data->servers[id]["address"].asString()).c_str()); ((gui::IGUIEditBox*)getElementFromId(GUI_ID_PORT_INPUT)) - ->setText(narrow_to_wide(m_data->servers[id].port).c_str()); + ->setText(narrow_to_wide(m_data->servers[id]["port"].asString()).c_str()); } } ServerListSpec GUIMainMenu::getServerListSpec(std::string address, std::string port) { ServerListSpec server; - server.address = address; - server.port = port; + server["address"] = address; + server["port"] = port; for(std::vector::iterator i = m_data->servers.begin(); i != m_data->servers.end(); i++) { - if (i->address == address && i->port == port) + if ((*i)["address"] == address && (*i)["port"] == port) { - server.description = i->description; - server.name = i->name; + server["description"] = (*i)["description"]; + server["name"] = (*i)["name"]; break; } } -- cgit v1.2.3 From 497ff1ecd64c8908f988e15ca879824f2781e3fd Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 24 Feb 2013 18:40:43 +0100 Subject: Change Minetest-c55 to Minetest --- src/guiMainMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/guiMainMenu.cpp') diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index ca334198f..eead3da92 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -1,5 +1,5 @@ /* -Minetest-c55 +Minetest Copyright (C) 2010-12 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify -- cgit v1.2.3 From 6d0ea26c2d62c3774ff384cf1bfc2a3372b49a3b Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Sun, 24 Feb 2013 19:38:45 +0100 Subject: Update Copyright Years --- src/guiMainMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/guiMainMenu.cpp') diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index eead3da92..c2e68579e 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -1,6 +1,6 @@ /* Minetest -Copyright (C) 2010-12 celeron55, Perttu Ahola +Copyright (C) 2010-2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by -- cgit v1.2.3