diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 9c9c12b14..d2c27920a 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -74,6 +74,8 @@ bool MainMenuScreen::m_enable_online = false; MainMenuScreen::MainMenuScreen() : Screen("main_menu.stkgui") { + m_online_string = _("Online"); + m_login_string = _("Login"); } // MainMenuScreen // ---------------------------------------------------------------------------- @@ -167,12 +169,12 @@ void MainMenuScreen::onUpdate(float delta) { m_user_id->setText(player->getLastOnlineName() + "@stk"); m_online->setActive(true); - m_online->setLabel( _("Online")); + m_online->setLabel(m_online_string); } else if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_OUT) { m_online->setActive(true); - m_online->setLabel( _("Login" )); + m_online->setLabel(m_login_string); m_user_id->setText(player->getName()); } else @@ -182,8 +184,8 @@ void MainMenuScreen::onUpdate(float delta) m_user_id->setText(player->getName()); } - m_online->setLabel(PlayerManager::getCurrentOnlineId() ? _("Online") - : _("Login" ) ); + m_online->setLabel(PlayerManager::getCurrentOnlineId() ? m_online_string + : m_login_string); IconButtonWidget* addons_icon = getWidget("addons"); if (addons_icon != NULL) { diff --git a/src/states_screens/main_menu_screen.hpp b/src/states_screens/main_menu_screen.hpp index 0da2a18df..f4d203045 100644 --- a/src/states_screens/main_menu_screen.hpp +++ b/src/states_screens/main_menu_screen.hpp @@ -32,6 +32,10 @@ class MainMenuScreen : public GUIEngine::Screen, public GUIEngine::ScreenSinglet private: friend class GUIEngine::ScreenSingleton; + core::stringw m_online_string; + + core::stringw m_login_string; + /** Keep the widget to avoid looking it up every frame. */ GUIEngine::IconButtonWidget* m_online;