From de9a1f51a755fa5d93bb0445c7c6003a9b4bd28b Mon Sep 17 00:00:00 2001 From: hiker Date: Thu, 2 Oct 2014 07:59:24 +1000 Subject: [PATCH] Removed empty 'online overview' page, show the achievements page instead. --- data/gui/online/profile_achievements.stkgui | 3 +- data/gui/online/profile_friends.stkgui | 3 +- data/gui/online/profile_settings.stkgui | 3 +- sources.cmake | 2 +- .../dialogs/user_info_dialog.cpp | 4 +- src/states_screens/main_menu_screen.cpp | 8 +-- src/states_screens/online_profile_base.cpp | 9 +-- src/states_screens/online_profile_base.hpp | 3 +- .../online_profile_overview.cpp | 67 ------------------- .../online_profile_overview.hpp | 55 --------------- src/states_screens/online_screen.cpp | 4 +- 11 files changed, 14 insertions(+), 147 deletions(-) delete mode 100644 src/states_screens/online_profile_overview.cpp delete mode 100644 src/states_screens/online_profile_overview.hpp diff --git a/data/gui/online/profile_achievements.stkgui b/data/gui/online/profile_achievements.stkgui index b8d13653d..0d52222be 100644 --- a/data/gui/online/profile_achievements.stkgui +++ b/data/gui/online/profile_achievements.stkgui @@ -9,9 +9,8 @@ - - + diff --git a/data/gui/online/profile_friends.stkgui b/data/gui/online/profile_friends.stkgui index c2498bfd9..47f2ed31c 100644 --- a/data/gui/online/profile_friends.stkgui +++ b/data/gui/online/profile_friends.stkgui @@ -9,9 +9,8 @@ - - + diff --git a/data/gui/online/profile_settings.stkgui b/data/gui/online/profile_settings.stkgui index 78599ff0b..7b15fc064 100644 --- a/data/gui/online/profile_settings.stkgui +++ b/data/gui/online/profile_settings.stkgui @@ -9,9 +9,8 @@ - - + diff --git a/sources.cmake b/sources.cmake index ddc029d4f..f484b15d5 100644 --- a/sources.cmake +++ b/sources.cmake @@ -1,5 +1,5 @@ # Modify this file to change the last-modified date when you add/remove a file. -# This will then trigger a new cmake run automatically. +# This will then trigger a new cmake run automatically. file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp") file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp") file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*") diff --git a/src/states_screens/dialogs/user_info_dialog.cpp b/src/states_screens/dialogs/user_info_dialog.cpp index 546d7d091..8c457f518 100644 --- a/src/states_screens/dialogs/user_info_dialog.cpp +++ b/src/states_screens/dialogs/user_info_dialog.cpp @@ -21,8 +21,8 @@ #include "guiengine/dialog_queue.hpp" #include "guiengine/engine.hpp" #include "online/online_profile.hpp" +#include "states_screens/online_profile_achievements.hpp" #include "states_screens/online_profile_friends.hpp" -#include "states_screens/online_profile_overview.hpp" #include "states_screens/state_manager.hpp" #include "utils/translation.hpp" @@ -481,7 +481,7 @@ void UserInfoDialog::onUpdate(float dt) { ModalDialog::dismiss(); if (m_enter_profile) - StateManager::get()->replaceTopMostScreen(OnlineProfileOverview::getInstance()); + StateManager::get()->replaceTopMostScreen(OnlineProfileAchievements::getInstance()); return; } } // onUpdate diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 755cb1393..68db41b68 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -42,7 +42,7 @@ #include "states_screens/grand_prix_editor_screen.hpp" #include "states_screens/help_screen_1.hpp" #include "states_screens/offline_kart_selection.hpp" -#include "states_screens/online_profile_overview.hpp" +#include "states_screens/online_profile_achievements.hpp" #include "states_screens/online_screen.hpp" #include "states_screens/options_screen_video.hpp" #include "states_screens/state_manager.hpp" @@ -442,10 +442,10 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, } if (PlayerManager::getCurrentOnlineId()) { - // For 0.8.2 disable the server menu, instead go to online profile + // For 0.8.2 disable the server menu, instead go to online profile //OnlineScreen::getInstance()->push(); - ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId()); - OnlineProfileOverview::getInstance()->push(); + ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId()); + OnlineProfileAchievements::getInstance()->push(); } else diff --git a/src/states_screens/online_profile_base.cpp b/src/states_screens/online_profile_base.cpp index c9f6abde7..c7b938a5c 100644 --- a/src/states_screens/online_profile_base.cpp +++ b/src/states_screens/online_profile_base.cpp @@ -24,7 +24,6 @@ #include "online/online_profile.hpp" #include "states_screens/state_manager.hpp" #include "utils/translation.hpp" -#include "states_screens/online_profile_overview.hpp" #include "states_screens/online_profile_friends.hpp" #include "states_screens/online_profile_achievements.hpp" #include "states_screens/online_profile_settings.hpp" @@ -52,9 +51,6 @@ void OnlineProfileBase::loadedFromFile() m_header = getWidget("title"); assert(m_header != NULL); - m_overview_tab = - (IconButtonWidget *)m_profile_tabs->findWidgetNamed("tab_overview"); - assert(m_overview_tab != NULL); m_friends_tab = (IconButtonWidget *) m_profile_tabs->findWidgetNamed("tab_friends"); assert(m_friends_tab != NULL); @@ -91,7 +87,6 @@ void OnlineProfileBase::init() { Screen::init(); - m_overview_tab->setTooltip( _("Overview") ); m_friends_tab->setTooltip( _("Friends") ); m_achievements_tab->setTooltip( _("Achievements") ); m_settings_tab->setTooltip( _("Account Settings") ); @@ -119,9 +114,7 @@ void OnlineProfileBase::eventCallback(Widget* widget, const std::string& name, std::string selection = ((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER); StateManager *sm = StateManager::get(); - if (selection == m_overview_tab->m_properties[PROP_ID]) - sm->replaceTopMostScreen(OnlineProfileOverview::getInstance()); - else if (selection == m_friends_tab->m_properties[PROP_ID]) + if (selection == m_friends_tab->m_properties[PROP_ID]) sm->replaceTopMostScreen(OnlineProfileFriends::getInstance()); else if (selection == m_achievements_tab->m_properties[PROP_ID]) sm->replaceTopMostScreen(OnlineProfileAchievements::getInstance()); diff --git a/src/states_screens/online_profile_base.hpp b/src/states_screens/online_profile_base.hpp index 94bcac23a..956b43d9b 100644 --- a/src/states_screens/online_profile_base.hpp +++ b/src/states_screens/online_profile_base.hpp @@ -30,7 +30,7 @@ namespace GUIEngine { class Widget; } /** Online profile base screen. Used for displaying friends, achievements, - * overview, and settings. It handles the tabs which are common to each + * and settings. It handles the tabs which are common to each * of those screens, and keeps track of the profile to display. * \ingroup states_screens */ @@ -42,7 +42,6 @@ protected: /** Pointer to the various widgets on the screen. */ GUIEngine::LabelWidget * m_header; GUIEngine::RibbonWidget* m_profile_tabs; - GUIEngine::IconButtonWidget * m_overview_tab; GUIEngine::IconButtonWidget * m_friends_tab; GUIEngine::IconButtonWidget * m_achievements_tab; GUIEngine::IconButtonWidget * m_settings_tab; diff --git a/src/states_screens/online_profile_overview.cpp b/src/states_screens/online_profile_overview.cpp deleted file mode 100644 index 128437f47..000000000 --- a/src/states_screens/online_profile_overview.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SuperTuxKart - a fun racing game with go-kart -// Copyright (C) 2010 Glenn De Jonghe -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 3 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#include "states_screens/online_profile_overview.hpp" - -#include "guiengine/engine.hpp" -#include "guiengine/scalable_font.hpp" -#include "guiengine/screen.hpp" -#include "guiengine/widget.hpp" -#include "states_screens/state_manager.hpp" -#include "utils/translation.hpp" - -#include - -#include -#include - -using namespace GUIEngine; -using namespace irr::core; -using namespace irr::gui; -using namespace Online; - -DEFINE_SCREEN_SINGLETON( OnlineProfileOverview ); - -// ----------------------------------------------------------------------------- - -OnlineProfileOverview::OnlineProfileOverview() : OnlineProfileBase("online/profile_overview.stkgui") -{ -} // OnlineProfileOverview - -// ----------------------------------------------------------------------------- - -void OnlineProfileOverview::loadedFromFile() -{ - OnlineProfileBase::loadedFromFile(); - -} // loadedFromFile - -// ----------------------------------------------------------------------------- - -void OnlineProfileOverview::init() -{ - OnlineProfileBase::init(); - m_profile_tabs->select( m_overview_tab->m_properties[PROP_ID], PLAYER_ID_GAME_MASTER ); -} // init - -// ----------------------------------------------------------------------------- - -void OnlineProfileOverview::eventCallback(Widget* widget, const std::string& name, const int playerID) -{ - OnlineProfileBase::eventCallback( widget, name, playerID); -} // eventCallback - diff --git a/src/states_screens/online_profile_overview.hpp b/src/states_screens/online_profile_overview.hpp deleted file mode 100644 index 6ad7619e1..000000000 --- a/src/states_screens/online_profile_overview.hpp +++ /dev/null @@ -1,55 +0,0 @@ -// SuperTuxKart - a fun racing game with go-kart -// Copyright (C) 2013 Glenn De Jonghe -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 3 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -#ifndef __HEADER_ONLINE_PROFILE_OVERVIEW_HPP__ -#define __HEADER_ONLINE_PROFILE_OVERVIEW_HPP__ - -#include -#include - -#include "guiengine/screen.hpp" -#include "guiengine/widgets.hpp" -#include "states_screens/online_profile_base.hpp" - -namespace GUIEngine { class Widget; } - - -/** - * \brief Online profiel overview screen - * \ingroup states_screens - */ -class OnlineProfileOverview : public OnlineProfileBase, public GUIEngine::ScreenSingleton -{ -protected: - OnlineProfileOverview(); - -public: - friend class GUIEngine::ScreenSingleton; - - /** \brief implement callback from parent class GUIEngine::Screen */ - virtual void loadedFromFile() OVERRIDE; - - /** \brief implement callback from parent class GUIEngine::Screen */ - virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name, - const int playerID) OVERRIDE; - - /** \brief implement callback from parent class GUIEngine::Screen */ - virtual void init() OVERRIDE; -}; - -#endif diff --git a/src/states_screens/online_screen.cpp b/src/states_screens/online_screen.cpp index fdfd54363..c7bf9275f 100644 --- a/src/states_screens/online_screen.cpp +++ b/src/states_screens/online_screen.cpp @@ -40,7 +40,7 @@ #include "states_screens/networking_lobby.hpp" #include "states_screens/server_selection.hpp" #include "states_screens/create_server_screen.hpp" -#include "states_screens/online_profile_overview.hpp" +#include "states_screens/online_profile_achievements.hpp" #include #include @@ -233,7 +233,7 @@ void OnlineScreen::eventCallback(Widget* widget, const std::string& name, else if (selection == m_profile_widget->m_properties[PROP_ID]) { ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId()); - OnlineProfileOverview::getInstance()->push(); + OnlineProfileAchievements::getInstance()->push(); } else if (selection == m_find_server_widget->m_properties[PROP_ID]) {