aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-05-02 19:57:03 +0200
committerPilzAdam <pilzadam@minetest.net>2013-05-02 20:05:07 +0200
commitb75505e6b2b82d48980ff71649dd4944b04b6f78 (patch)
tree7b55eba3e76e6938bc49715b0277f9601e5d8b67
parentee8067f7cfa5b25e12a166bd5d306a905630ee92 (diff)
downloadminetest-b75505e6b2b82d48980ff71649dd4944b04b6f78.tar.gz
minetest-b75505e6b2b82d48980ff71649dd4944b04b6f78.tar.bz2
minetest-b75505e6b2b82d48980ff71649dd4944b04b6f78.zip
Show game name instead of game ID of selected game
-rw-r--r--src/guiMainMenu.cpp6
-rw-r--r--src/guiMainMenu.h2
-rw-r--r--src/main.cpp4
3 files changed, 9 insertions, 3 deletions
diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp
index c6142d4ce..5d5ae1e90 100644
--- a/src/guiMainMenu.cpp
+++ b/src/guiMainMenu.cpp
@@ -258,9 +258,9 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
core::rect<s32> rect(0, 0, size.X, 40);
rect += v2s32(4, 0);
std::string t = "Minetest " VERSION_STRING;
- if(m_data->selected_game != ""){
+ if(m_data->selected_game_name != ""){
t += "/";
- t += m_data->selected_game;
+ t += m_data->selected_game_name;
}
Environment->addStaticText(narrow_to_wide(t).c_str(),
rect, false, true, this, -1);
@@ -1356,6 +1356,8 @@ bool GUIMainMenu::OnEvent(const SEvent& event)
eid <= GUI_ID_GAME_BUTTON_MAX){
m_data->selected_game =
m_data->games[eid - GUI_ID_GAME_BUTTON_FIRST].id;
+ m_data->selected_game_name =
+ m_data->games[eid - GUI_ID_GAME_BUTTON_FIRST].name;
regenerateGui(m_screensize_old);
}
}
diff --git a/src/guiMainMenu.h b/src/guiMainMenu.h
index 1c5ca4d37..1d09c8baa 100644
--- a/src/guiMainMenu.h
+++ b/src/guiMainMenu.h
@@ -40,6 +40,7 @@ struct MainMenuData
// Generic
int selected_tab;
std::string selected_game;
+ std::string selected_game_name;
// Client options
std::string servername;
std::string serverdescription;
@@ -80,6 +81,7 @@ struct MainMenuData
// Generic
selected_tab(0),
selected_game("minetest"),
+ selected_game_name("Minetest"),
// Client opts
fancy_trees(false),
smooth_lighting(false),
diff --git a/src/main.cpp b/src/main.cpp
index 9a646413d..501e4cdf4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1501,8 +1501,10 @@ int main(int argc, char *argv[])
menudata.selected_tab = g_settings->getS32("selected_mainmenu_tab");
if(g_settings->exists("selected_serverlist"))
menudata.selected_serverlist = g_settings->getS32("selected_serverlist");
- if(g_settings->exists("selected_mainmenu_game"))
+ if(g_settings->exists("selected_mainmenu_game")){
menudata.selected_game = g_settings->get("selected_mainmenu_game");
+ menudata.selected_game_name = findSubgame(menudata.selected_game).name;
+ }
menudata.address = narrow_to_wide(address);
menudata.name = narrow_to_wide(playername);
menudata.port = narrow_to_wide(itos(port));