From 9747f59e0099e6eb57354e807b201d91520a0856 Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 5 Jan 2019 11:40:27 +0800 Subject: [PATCH] Update lobby button with pre-translated string --- .../online/networking_lobby.cpp | 34 +++++++++++++------ .../online/networking_lobby.hpp | 3 ++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/states_screens/online/networking_lobby.cpp b/src/states_screens/online/networking_lobby.cpp index d7bdb7e33..c659f789b 100644 --- a/src/states_screens/online/networking_lobby.cpp +++ b/src/states_screens/online/networking_lobby.cpp @@ -174,10 +174,22 @@ void NetworkingLobby::init() m_min_start_game_players = 0; m_timeout_message->setVisible(false); + m_start_text = _("Start race"); + //I18N: In the networking lobby, ready button is to allow player to tell + //server that he is ready for next game for owner less server + m_ready_text = _("Ready"); + //I18N: Live join is displayed in networking lobby to allow players + //to join the current started in-progress game + m_live_join_text = _("Live join"); + //I18N: In networking lobby to configuration server settings + m_configuration_text = _("Configuration"); + //I18N: Spectate is displayed in networking lobby to allow players + //to join the current started in-progress game + m_spectate_text = _("Spectate"); + //I18N: In the networking lobby m_header->setText(_("Lobby"), false); m_server_info_height = GUIEngine::getFont()->getDimension(L"X").Height; - m_start_button->setLabel(_("Start race")); m_start_button->setVisible(false); m_config_button->setVisible(false); m_state = LS_CONNECTING; @@ -255,7 +267,16 @@ void NetworkingLobby::onUpdate(float delta) if (NetworkConfig::get()->isServer() || !STKHost::existHost()) return; + if (m_has_auto_start_in_server) + { + m_start_button->setLabel(m_ready_text); + } + else + m_start_button->setLabel(m_start_text); + m_start_button->setVisible(false); + + m_config_button->setLabel(m_configuration_text); m_config_button->setVisible(false); m_config_button->setImage(m_config_texture); m_client_live_joinable = false; @@ -354,12 +375,8 @@ void NetworkingLobby::onUpdate(float delta) if (m_client_live_joinable) { m_start_button->setVisible(true); - //I18N: Live join is displayed in networking lobby to allow players - //to join the current started in-progress game - m_start_button->setLabel(_("Live join")); - //I18N: Spectate is displayed in networking lobby to allow players - //to join the current started in-progress game - m_config_button->setLabel(_("Spectate")); + m_start_button->setLabel(m_live_join_text); + m_config_button->setLabel(m_spectate_text); m_config_button->setImage(m_spectate_texture); m_config_button->setVisible(true); } @@ -714,9 +731,6 @@ void NetworkingLobby::initAutoStartTimer(bool grand_prix_started, if (min_players == 0 || start_timeout == 0.0f) return; - //I18N: In the networking lobby, ready button is to allow player to tell - //server that he is ready for next game for owner less server - m_start_button->setLabel(_("Ready")); m_has_auto_start_in_server = true; m_min_start_game_players = grand_prix_started ? 0 : min_players; m_start_timeout = start_timeout; diff --git a/src/states_screens/online/networking_lobby.hpp b/src/states_screens/online/networking_lobby.hpp index 408891ec5..e67b2ee75 100644 --- a/src/states_screens/online/networking_lobby.hpp +++ b/src/states_screens/online/networking_lobby.hpp @@ -72,6 +72,9 @@ private: std::vector m_server_info; int m_server_info_height; + core::stringw m_start_text, m_ready_text, m_live_join_text, + m_configuration_text, m_spectate_text; + float m_start_timeout; int64_t m_cur_starting_timer; unsigned m_min_start_game_players;