From 637e468f1807c1bef2bf666a88520b7c5e893a43 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 29 Jul 2016 11:50:37 +0800 Subject: [PATCH 1/8] Use uniform copyright header for source --- src/config/user_config.cpp | 4 ++-- src/karts/kart.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config/user_config.cpp b/src/config/user_config.cpp index 60df0436e..95f013d91 100644 --- a/src/config/user_config.cpp +++ b/src/config/user_config.cpp @@ -1,6 +1,6 @@ // -// SuperTuxKart - A racing game -// Copyright (C) 2006-2016 SuperTuxKart Team +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2006-2016 SuperTuxKart-Team // Modeled after Supertux's configfile.cpp // // This program is free software; you can redistribute it and/or diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 602c1d284..c6cdc9feb 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -1,7 +1,7 @@ // -// SuperTuxKart - A racing game +// SuperTuxKart - a fun racing game with go-kart // Copyright (C) 2004-2016 Steve Baker -// Copyright (C) 2006-2016 SuperTuxKart Team, Joerg Henrichs, Steve Baker +// Copyright (C) 2006-2016 SuperTuxKart-Team, Joerg Henrichs, Steve Baker // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License From a318e3b2167d6280993aad4143fb1769b06d3913 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sat, 30 Jul 2016 19:43:48 -0400 Subject: [PATCH 2/8] Log out user when deactivating internet connection, fixes #2589 --- src/states_screens/options_screen_ui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/states_screens/options_screen_ui.cpp b/src/states_screens/options_screen_ui.cpp index 771c62064..b7302f412 100644 --- a/src/states_screens/options_screen_ui.cpp +++ b/src/states_screens/options_screen_ui.cpp @@ -21,6 +21,7 @@ #include "audio/sfx_manager.hpp" #include "audio/sfx_base.hpp" #include "config/hardware_stats.hpp" +#include "config/player_manager.hpp" #include "config/user_config.hpp" #include "font/bold_face.hpp" #include "font/regular_face.hpp" @@ -284,8 +285,10 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con { stats->setVisible(false); stats_label->setVisible(false); + PlayerProfile* profile = PlayerManager::getCurrentPlayer(); + if (profile != NULL && profile->isLoggedIn()) + profile->requestSignOut(); } - } else if (name=="enable-hw-report") { From 347f977ea782fafea14aa62886ed72a1dc8fafbf Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sat, 30 Jul 2016 19:44:21 -0400 Subject: [PATCH 3/8] Fix english string, as reported a while ago but couldn't fix then due to string freeze --- src/states_screens/race_setup_screen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/states_screens/race_setup_screen.cpp b/src/states_screens/race_setup_screen.cpp index 50c811446..fe51c8dbc 100644 --- a/src/states_screens/race_setup_screen.cpp +++ b/src/states_screens/race_setup_screen.cpp @@ -116,7 +116,7 @@ void RaceSetupScreen::init() irr::core::stringw name5 = irr::core::stringw( RaceManager::getNameOf(RaceManager::MINOR_MODE_SOCCER)) + L"\n"; - name5 += _("Push the ball to the opposite cage to score goals."); + name5 += _("Push the ball into the opposite cage to score goals."); w2->addItem( name5, IDENT_SOCCER, RaceManager::getIconOf(RaceManager::MINOR_MODE_SOCCER)); #define ENABLE_EASTER_EGG_MODE From b69faff13d939729f0158912e14f227ad2f10198 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sat, 30 Jul 2016 19:46:15 -0400 Subject: [PATCH 4/8] Fix indentation (tabs/spaces) --- src/states_screens/options_screen_ui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/states_screens/options_screen_ui.cpp b/src/states_screens/options_screen_ui.cpp index b7302f412..4332e896d 100644 --- a/src/states_screens/options_screen_ui.cpp +++ b/src/states_screens/options_screen_ui.cpp @@ -285,9 +285,9 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con { stats->setVisible(false); stats_label->setVisible(false); - PlayerProfile* profile = PlayerManager::getCurrentPlayer(); - if (profile != NULL && profile->isLoggedIn()) - profile->requestSignOut(); + PlayerProfile* profile = PlayerManager::getCurrentPlayer(); + if (profile != NULL && profile->isLoggedIn()) + profile->requestSignOut(); } } else if (name=="enable-hw-report") From 788f168c7f65b9ad09f5a62864f569360529ea61 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 31 Jul 2016 08:04:16 +0800 Subject: [PATCH 5/8] Fix space before colon --- src/challenges/challenge_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/challenges/challenge_data.cpp b/src/challenges/challenge_data.cpp index bc3fa8742..7cfb08eb4 100644 --- a/src/challenges/challenge_data.cpp +++ b/src/challenges/challenge_data.cpp @@ -256,7 +256,7 @@ ChallengeData::ChallengeData(const std::string& filename) if (track_node != NULL && m_minor!=RaceManager::MINOR_MODE_FOLLOW_LEADER) { //I18N: number of laps to race in a challenge - description += _("Laps : %i", m_num_laps); + description += _("Laps: %i", m_num_laps); description += core::stringw(L"\n"); } else if (track_node) From 40ab343922131d57d5fa640365e8c16dc02589fc Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sat, 30 Jul 2016 20:52:32 -0400 Subject: [PATCH 6/8] Fix string remaining in wrong language when changing language --- src/challenges/challenge_data.cpp | 37 ++++++++++++++--------- src/challenges/challenge_data.hpp | 7 +---- src/states_screens/race_gui_overworld.cpp | 9 +++++- src/states_screens/race_gui_overworld.hpp | 5 +++ 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/src/challenges/challenge_data.cpp b/src/challenges/challenge_data.cpp index bc3fa8742..f1fdc2f27 100644 --- a/src/challenges/challenge_data.cpp +++ b/src/challenges/challenge_data.cpp @@ -251,23 +251,30 @@ ChallengeData::ChallengeData(const std::string& filename) throw std::runtime_error("Unknown unlock entry"); } } - - core::stringw description; - if (track_node != NULL && m_minor!=RaceManager::MINOR_MODE_FOLLOW_LEADER) - { - //I18N: number of laps to race in a challenge - description += _("Laps : %i", m_num_laps); - description += core::stringw(L"\n"); - } - else if (track_node) - { - // Follow the leader mode: - description = _("Follow the leader"); - } - - m_challenge_description = description; } // ChallengeData +// ---------------------------------------------------------------------------- + +const irr::core::stringw ChallengeData::getChallengeDescription() const +{ + core::stringw description; + if (!m_track_id.empty()) + { + if (m_minor != RaceManager::MINOR_MODE_FOLLOW_LEADER) + { + //I18N: number of laps to race in a challenge + description += _("Laps: %i", m_num_laps); + description += core::stringw(L"\n"); + } + else + { + // Follow the leader mode: + description = _("Follow the leader"); + } + } + return description; +} // getChallengeDescription + // ---------------------------------------------------------------------------- void ChallengeData::error(const char *id) const { diff --git a/src/challenges/challenge_data.hpp b/src/challenges/challenge_data.hpp index f563695fb..0cebc4556 100644 --- a/src/challenges/challenge_data.hpp +++ b/src/challenges/challenge_data.hpp @@ -110,8 +110,6 @@ private: /** Number of trophies required to access this challenge */ int m_num_trophies; - irr::core::stringw m_challenge_description; - public: ChallengeData(const std::string& filename); @@ -195,10 +193,7 @@ public: // ------------------------------------------------------------------------ /** Returns the description of this challenge. */ - const irr::core::stringw& getChallengeDescription() const - { - return m_challenge_description; - } // getChallengeDescription + const irr::core::stringw getChallengeDescription() const; // ------------------------------------------------------------------------ /** Returns the minimum position the player must have in order to win. diff --git a/src/states_screens/race_gui_overworld.cpp b/src/states_screens/race_gui_overworld.cpp index 761836652..abc03fdb1 100644 --- a/src/states_screens/race_gui_overworld.cpp +++ b/src/states_screens/race_gui_overworld.cpp @@ -108,6 +108,7 @@ RaceGUIOverworld::RaceGUIOverworld() m_string_lap = _("Lap"); m_string_rank = _("Rank"); + m_active_challenge = NULL; // Determine maximum length of the rank/lap text, in order to // align those texts properly on the right side of the viewport. @@ -528,7 +529,13 @@ void RaceGUIOverworld::drawGlobalMiniMap() pos.UpperLeftCorner.Y += GUIEngine::getTitleFontHeight(); pos.LowerRightCorner.Y = irr_driver->getActualScreenSize().Height; - GUIEngine::getFont()->draw(challenge->getChallengeDescription().c_str(), + + if (m_active_challenge != challenge) + { + m_active_challenge = challenge; + m_challenge_description = challenge->getChallengeDescription(); + } + GUIEngine::getFont()->draw(m_challenge_description, pos, video::SColor(255,255,255,255), false, false /* vcenter */, NULL); diff --git a/src/states_screens/race_gui_overworld.hpp b/src/states_screens/race_gui_overworld.hpp index 810f2baec..56d72823b 100644 --- a/src/states_screens/race_gui_overworld.hpp +++ b/src/states_screens/race_gui_overworld.hpp @@ -101,6 +101,11 @@ private: int m_trophy_points_width; + /** The latest challenge approached by the kart */ + const ChallengeData* m_active_challenge; + + core::stringw m_challenge_description; + /** The current challenge over which the mouse is hovering. */ const OverworldChallenge *m_current_challenge; From 690440254750a9e98a3f0d56c421689c69c3d3a1 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 31 Jul 2016 09:04:10 +0800 Subject: [PATCH 7/8] Fix wrong RTL text in arena screen --- src/states_screens/arenas_screen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/states_screens/arenas_screen.cpp b/src/states_screens/arenas_screen.cpp index 999a3babc..24d90ee93 100644 --- a/src/states_screens/arenas_screen.cpp +++ b/src/states_screens/arenas_screen.cpp @@ -277,7 +277,7 @@ void ArenasScreen::buildTrackList() } else { - w->addItem( curr->getName(), curr->getIdent(), curr->getScreenshotFile(), 0, + w->addItem( translations->fribidize(curr->getName()), curr->getIdent(), curr->getScreenshotFile(), 0, IconButtonWidget::ICON_PATH_TYPE_ABSOLUTE ); } } @@ -329,7 +329,7 @@ void ArenasScreen::buildTrackList() } else { - w->addItem( curr->getName(), curr->getIdent(), curr->getScreenshotFile(), 0, + w->addItem( translations->fribidize(curr->getName()), curr->getIdent(), curr->getScreenshotFile(), 0, IconButtonWidget::ICON_PATH_TYPE_ABSOLUTE ); } } From ea939459e8769e847222de130a5d31bf1c9bf128 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sat, 30 Jul 2016 21:51:31 -0400 Subject: [PATCH 8/8] Improve string as suggested on transifex --- data/gui/options_players.stkgui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/gui/options_players.stkgui b/data/gui/options_players.stkgui index 286b0971b..5c8de774c 100644 --- a/data/gui/options_players.stkgui +++ b/data/gui/options_players.stkgui @@ -30,7 +30,7 @@