diff --git a/data/gui/online/lan.stkgui b/data/gui/online/lan.stkgui new file mode 100644 index 000000000..c94e6082a --- /dev/null +++ b/data/gui/online/lan.stkgui @@ -0,0 +1,29 @@ + + + + +
+
+ + +
+
diff --git a/data/gui/online/online.stkgui b/data/gui/online/online.stkgui new file mode 100644 index 000000000..3572916bc --- /dev/null +++ b/data/gui/online/online.stkgui @@ -0,0 +1,29 @@ + + +
+
+ +
+ + +
diff --git a/data/gui/online/profile_achievements_tab.stkgui b/data/gui/online/profile_achievements_tab.stkgui index dbf3256b5..7d519d661 100644 --- a/data/gui/online/profile_achievements_tab.stkgui +++ b/data/gui/online/profile_achievements_tab.stkgui @@ -9,7 +9,6 @@ - diff --git a/data/gui/online/profile_friends.stkgui b/data/gui/online/profile_friends.stkgui index 0e1213c61..e0e49473b 100644 --- a/data/gui/online/profile_friends.stkgui +++ b/data/gui/online/profile_friends.stkgui @@ -9,7 +9,6 @@ - diff --git a/data/gui/online/profile_servers.stkgui b/data/gui/online/profile_servers.stkgui index 25ca99ffa..88de78d8c 100644 --- a/data/gui/online/profile_servers.stkgui +++ b/data/gui/online/profile_servers.stkgui @@ -3,59 +3,25 @@
-
+
- + +
diff --git a/data/gui/online/profile_settings.stkgui b/data/gui/online/profile_settings.stkgui index 126519d9f..d89d52c23 100644 --- a/data/gui/online/profile_settings.stkgui +++ b/data/gui/online/profile_settings.stkgui @@ -8,7 +8,6 @@ - setBadge(LOADING_BADGE); } - m_online = getWidget("online"); + IconButtonWidget* online = getWidget("online"); - if(!m_enable_online) - m_online->setActive(false); + if (!m_enable_online) + online->setActive(false); LabelWidget* w = getWidget("info_addons"); const core::stringw &news_text = NewsManager::get()->getNextNewsMessage(); @@ -179,32 +177,25 @@ void MainMenuScreen::init() } // init // ---------------------------------------------------------------------------- -void MainMenuScreen::onUpdate(float delta) +void MainMenuScreen::onUpdate(float delta) { PlayerProfile *player = PlayerManager::getCurrentPlayer(); if(PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_GUEST || PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_IN) { m_user_id->setText(player->getLastOnlineName() + "@stk"); - m_online->setActive(true); - m_online->setLabel(m_online_string); } else if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_OUT) { - m_online->setActive(true); - m_online->setLabel(m_login_string); m_user_id->setText(player->getName()); } else { // now must be either logging in or logging out - m_online->setActive(false); m_user_id->setText(player->getName()); } - m_online->setLabel(PlayerManager::getCurrentOnlineId() ? m_online_string - : m_login_string); IconButtonWidget* addons_icon = getWidget("addons"); if (addons_icon != NULL) { @@ -472,6 +463,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, } else if (selection == "story") { + NetworkConfig::get()->unsetNetworking(); PlayerProfile *player = PlayerManager::getCurrentPlayer(); if (player->isFirstTime()) { @@ -505,24 +497,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, } else if (selection == "online") { - if(UserConfigParams::m_internet_status!=RequestManager::IPERM_ALLOWED) - { - new MessageDialog(_("You can not play online without internet access. " - "If you want to play online, go to options, select " - " tab 'User Interface', and edit " - "\"Connect to the Internet\".")); - return; - } - - if (PlayerManager::getCurrentOnlineId()) - { - ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId()); - OnlineProfileServers::getInstance()->push(); - } - else - { - UserScreen::getInstance()->push(); - } + OnlineScreen::getInstance()->push(); } else if (selection == "addons") { diff --git a/src/states_screens/main_menu_screen.hpp b/src/states_screens/main_menu_screen.hpp index 4e79c4532..8da6c94ab 100644 --- a/src/states_screens/main_menu_screen.hpp +++ b/src/states_screens/main_menu_screen.hpp @@ -32,13 +32,6 @@ 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; - /** Keep the widget to to the user name. */ GUIEngine::ButtonWidget *m_user_id; diff --git a/src/states_screens/online_lan.cpp b/src/states_screens/online_lan.cpp new file mode 100644 index 000000000..9e22fa104 --- /dev/null +++ b/src/states_screens/online_lan.cpp @@ -0,0 +1,112 @@ +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2010-2015 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_servers.hpp" + +#include "audio/sfx_manager.hpp" +#include "config/player_manager.hpp" +#include "guiengine/engine.hpp" +#include "guiengine/scalable_font.hpp" +#include "guiengine/screen.hpp" +#include "guiengine/widget.hpp" +#include "network/network_config.hpp" +#include "network/protocol_manager.hpp" +#include "network/protocols/connect_to_server.hpp" +#include "network/protocols/request_connection.hpp" +#include "network/servers_manager.hpp" +#include "states_screens/state_manager.hpp" +#include "states_screens/create_server_screen.hpp" +#include "states_screens/networking_lobby.hpp" +#include "states_screens/online_lan.hpp" +#include "states_screens/server_selection.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( OnlineLanScreen ); + +// ----------------------------------------------------------------------------- + +OnlineLanScreen::OnlineLanScreen() : GUIEngine::Screen("online/lan.stkgui") +{ +} // OnlineLanScreen + +// ----------------------------------------------------------------------------- + +void OnlineLanScreen::loadedFromFile() +{ +} // loadedFromFile + +// ----------------------------------------------------------------------------- + +void OnlineLanScreen::init() +{ + RibbonWidget* ribbon = getWidget("lan"); + assert(ribbon != NULL); + ribbon->select("find_lan_server", PLAYER_ID_GAME_MASTER); + ribbon->setFocusForPlayer(PLAYER_ID_GAME_MASTER); +} // init + +// ----------------------------------------------------------------------------- + +void OnlineLanScreen::eventCallback(Widget* widget, const std::string& name, const int playerID) +{ + if (name == "back") + { + StateManager::get()->popMenu(); + return; + } + if (name == "lan") + { + RibbonWidget* ribbon = dynamic_cast(widget); + std::string selection = ribbon->getSelectionIDString(PLAYER_ID_GAME_MASTER); + if (selection == "create_lan_server") + { + NetworkConfig::get()->setIsLAN(); + NetworkConfig::get()->setIsServer(true); + CreateServerScreen::getInstance()->push(); + // TODO: create lan server + } + else if (selection == "find_lan_server") + { + NetworkConfig::get()->setIsLAN(); + NetworkConfig::get()->setIsServer(false); + ServerSelection::getInstance()->push(); + } + } + +} // eventCallback + +// ---------------------------------------------------------------------------- +/** Also called when pressing the back button. It resets the flags to indicate + * a networked game. + */ +bool OnlineLanScreen::onEscapePressed() +{ + NetworkConfig::get()->unsetNetworking(); + //StateManager::get()->popMenu(); + return true; +} // onEscapePressed + diff --git a/src/states_screens/online_lan.hpp b/src/states_screens/online_lan.hpp new file mode 100644 index 000000000..615cb9e37 --- /dev/null +++ b/src/states_screens/online_lan.hpp @@ -0,0 +1,57 @@ +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2013-2015 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_OLAN_HPP__ +#define __HEADER_OLAN_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 OnlineLanScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton +{ +protected: + OnlineLanScreen(); + +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; + virtual bool onEscapePressed() OVERRIDE; + +}; // class OnlineProfileServers + +#endif diff --git a/src/states_screens/online_profile_base.cpp b/src/states_screens/online_profile_base.cpp index 208123750..0088cdaf3 100644 --- a/src/states_screens/online_profile_base.cpp +++ b/src/states_screens/online_profile_base.cpp @@ -42,7 +42,6 @@ using namespace Online; OnlineProfileBase::OnlineProfileBase(const std::string &filename) : Screen(filename.c_str()) { - m_servers_tab = NULL; m_friends_tab = NULL; m_achievements_tab = NULL; m_settings_tab = NULL; @@ -63,9 +62,6 @@ void OnlineProfileBase::loadedFromFile() m_friends_tab = (IconButtonWidget *)m_profile_tabs->findWidgetNamed("tab_friends"); assert(m_friends_tab != NULL); - m_servers_tab = (IconButtonWidget *)m_profile_tabs->findWidgetNamed("tab_servers"); - assert(m_servers_tab != NULL); - m_achievements_tab = (IconButtonWidget*)m_profile_tabs->findWidgetNamed("tab_achievements"); assert(m_profile_tabs == NULL || m_achievements_tab != NULL); @@ -107,7 +103,6 @@ void OnlineProfileBase::init() if (m_profile_tabs) { - m_servers_tab->setTooltip(_("Servers")); m_friends_tab->setTooltip(_("Friends")); m_achievements_tab->setTooltip(_("Achievements")); m_settings_tab->setTooltip(_("Account Settings")); @@ -159,8 +154,6 @@ void OnlineProfileBase::eventCallback(Widget* widget, const std::string& name, sm->replaceTopMostScreen(TabOnlineProfileAchievements::getInstance()); else if (selection == m_settings_tab->m_properties[PROP_ID]) sm->replaceTopMostScreen(OnlineProfileSettings::getInstance()); - else if (selection == m_servers_tab->m_properties[PROP_ID]) - sm->replaceTopMostScreen(OnlineProfileServers::getInstance()); } else if (name == "back") { diff --git a/src/states_screens/online_profile_base.hpp b/src/states_screens/online_profile_base.hpp index 95a6906fa..0285edb4b 100644 --- a/src/states_screens/online_profile_base.hpp +++ b/src/states_screens/online_profile_base.hpp @@ -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_servers_tab; GUIEngine::IconButtonWidget * m_friends_tab; GUIEngine::IconButtonWidget * m_achievements_tab; GUIEngine::IconButtonWidget * m_settings_tab; diff --git a/src/states_screens/online_profile_servers.cpp b/src/states_screens/online_profile_servers.cpp index 7d3400b0f..0787d2fef 100644 --- a/src/states_screens/online_profile_servers.cpp +++ b/src/states_screens/online_profile_servers.cpp @@ -48,7 +48,7 @@ DEFINE_SCREEN_SINGLETON( OnlineProfileServers ); // ----------------------------------------------------------------------------- -OnlineProfileServers::OnlineProfileServers() : OnlineProfileBase("online/profile_servers.stkgui") +OnlineProfileServers::OnlineProfileServers() : GUIEngine::Screen("online/profile_servers.stkgui") { } // OnlineProfileServers @@ -56,44 +56,28 @@ OnlineProfileServers::OnlineProfileServers() : OnlineProfileBase("online/profile void OnlineProfileServers::loadedFromFile() { - OnlineProfileBase::loadedFromFile(); } // loadedFromFile // ----------------------------------------------------------------------------- void OnlineProfileServers::init() { - OnlineProfileBase::init(); - m_profile_tabs->select( m_servers_tab->m_properties[PROP_ID], PLAYER_ID_GAME_MASTER ); - m_servers_tab->setFocusForPlayer(PLAYER_ID_GAME_MASTER); - // OnlineScreen::getInstance()->push(); + RibbonWidget* ribbon = getWidget("wan"); + assert(ribbon != NULL); + ribbon->select("find_wan_server", PLAYER_ID_GAME_MASTER); + ribbon->setFocusForPlayer(PLAYER_ID_GAME_MASTER); } // init // ----------------------------------------------------------------------------- void OnlineProfileServers::eventCallback(Widget* widget, const std::string& name, const int playerID) { - OnlineProfileBase::eventCallback( widget, name, playerID); - - if (name == "lan") + if (name == "back") { - RibbonWidget* ribbon = dynamic_cast(widget); - std::string selection = ribbon->getSelectionIDString(PLAYER_ID_GAME_MASTER); - if (selection == "create_lan_server") - { - NetworkConfig::get()->setIsLAN(); - NetworkConfig::get()->setIsServer(true); - CreateServerScreen::getInstance()->push(); - // TODO: create lan server - } - else if (selection == "find_lan_server") - { - NetworkConfig::get()->setIsLAN(); - NetworkConfig::get()->setIsServer(false); - ServerSelection::getInstance()->push(); - } + StateManager::get()->popMenu(); + return; } - else if (name == "wan") + if (name == "wan") { RibbonWidget* ribbon = dynamic_cast(widget); std::string selection = ribbon->getSelectionIDString(PLAYER_ID_GAME_MASTER); @@ -176,6 +160,6 @@ void OnlineProfileServers::doQuickPlay() bool OnlineProfileServers::onEscapePressed() { NetworkConfig::get()->unsetNetworking(); - return OnlineProfileBase::onEscapePressed(); + return true; } // onEscapePressed diff --git a/src/states_screens/online_profile_servers.hpp b/src/states_screens/online_profile_servers.hpp index b840f103e..0d30b6fe6 100644 --- a/src/states_screens/online_profile_servers.hpp +++ b/src/states_screens/online_profile_servers.hpp @@ -33,7 +33,7 @@ namespace GUIEngine { class Widget; } * \brief Online profiel overview screen * \ingroup states_screens */ -class OnlineProfileServers : public OnlineProfileBase, public GUIEngine::ScreenSingleton +class OnlineProfileServers : public GUIEngine::Screen, public GUIEngine::ScreenSingleton { protected: OnlineProfileServers(); diff --git a/src/states_screens/online_screen.cpp b/src/states_screens/online_screen.cpp new file mode 100644 index 000000000..e7a9d3572 --- /dev/null +++ b/src/states_screens/online_screen.cpp @@ -0,0 +1,200 @@ +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2009-2015 Marianne Gagnon +// +// 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/main_menu_screen.hpp" + +#include "config/player_manager.hpp" +#include "config/user_config.hpp" +#include "graphics/irr_driver.hpp" +#include "guiengine/scalable_font.hpp" +#include "guiengine/widgets/label_widget.hpp" +#include "guiengine/widgets/list_widget.hpp" +#include "guiengine/widgets/ribbon_widget.hpp" +#include "input/device_manager.hpp" +#include "input/input_manager.hpp" +#include "input/keyboard_device.hpp" +#include "io/file_manager.hpp" +#include "main_loop.hpp" +#include "network/network_config.hpp" +#include "online/request_manager.hpp" +#include "states_screens/online_lan.hpp" +#include "states_screens/online_profile_achievements.hpp" +#include "states_screens/online_profile_servers.hpp" +#include "states_screens/online_screen.hpp" +#include "states_screens/state_manager.hpp" +#include "states_screens/user_screen.hpp" +#include "states_screens/dialogs/message_dialog.hpp" +#include "tracks/track_manager.hpp" +#include "utils/string_utils.hpp" + + +#include + + +using namespace GUIEngine; +using namespace Online; + +DEFINE_SCREEN_SINGLETON( OnlineScreen ); + +bool OnlineScreen::m_enable_online = true; + +// ---------------------------------------------------------------------------- + +OnlineScreen::OnlineScreen() : Screen("online/online.stkgui") +{ + m_online_string = _("Your profile"); + //I18N: Used as a verb, appears on the main networking menu (login button) + m_login_string = _("Login"); +} // OnlineScreen + +// ---------------------------------------------------------------------------- + +void OnlineScreen::loadedFromFile() +{ +} // loadedFromFile + +// ---------------------------------------------------------------------------- + +void OnlineScreen::beforeAddingWidget() +{ + bool is_logged_in = false; + PlayerProfile *player = PlayerManager::getCurrentPlayer(); + if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_GUEST || + PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_IN) + { + is_logged_in = true; + } + + IconButtonWidget* wan = getWidget("wan"); + wan->setActive(is_logged_in); + wan->setVisible(is_logged_in); +} // beforeAddingWidget + +// ---------------------------------------------------------------------------- +// +void OnlineScreen::init() +{ + Screen::init(); + + m_online = getWidget("online"); + + if (!m_enable_online) + m_online->setActive(false); + + m_user_id = getWidget("user-id"); + assert(m_user_id); + + RibbonWidget* r = getWidget("menu_toprow"); + r->setFocusForPlayer(PLAYER_ID_GAME_MASTER); + +} // init + +// ---------------------------------------------------------------------------- + +void OnlineScreen::onUpdate(float delta) +{ + PlayerProfile *player = PlayerManager::getCurrentPlayer(); + if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_GUEST || + PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_IN) + { + m_online->setActive(true); + m_online->setLabel(m_online_string); + m_user_id->setText(player->getLastOnlineName() + "@stk"); + } + else if (PlayerManager::getCurrentOnlineState() == PlayerProfile::OS_SIGNED_OUT) + { + m_online->setActive(true); + m_online->setLabel(m_login_string); + m_user_id->setText(player->getName()); + } + else + { + // now must be either logging in or logging out + m_online->setActive(false); + m_user_id->setText(player->getName()); + } + + m_online->setLabel(PlayerManager::getCurrentOnlineId() ? m_online_string + : m_login_string); +} // onUpdate + +// ---------------------------------------------------------------------------- + +void OnlineScreen::eventCallback(Widget* widget, const std::string& name, + const int playerID) +{ + if (name == "user-id") + { + UserScreen::getInstance()->push(); + return; + } + else if (name == "back") + { + StateManager::get()->popMenu(); + return; + } + + RibbonWidget* ribbon = dynamic_cast(widget); + if (ribbon == NULL) return; // what's that event?? + + // ---- A ribbon icon was clicked + std::string selection = + ribbon->getSelectionIDString(PLAYER_ID_GAME_MASTER); + + if (selection == "lan") + { + OnlineLanScreen::getInstance()->push(); + } + else if (selection == "wan") + { + OnlineProfileServers::getInstance()->push(); + } + else if (selection == "online") + { + if (UserConfigParams::m_internet_status != RequestManager::IPERM_ALLOWED) + { + new MessageDialog(_("You can not play online without internet access. " + "If you want to play online, go to options, select " + " tab 'User Interface', and edit " + "\"Connect to the Internet\".")); + return; + } + + if (PlayerManager::getCurrentOnlineId()) + { + ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId()); + TabOnlineProfileAchievements::getInstance()->push(); + } + else + { + UserScreen::getInstance()->push(); + } + } +} // eventCallback + +// ---------------------------------------------------------------------------- + +void OnlineScreen::tearDown() +{ +} // tearDown + +// ---------------------------------------------------------------------------- + +void OnlineScreen::onDisabledItemClicked(const std::string& item) +{ +} // onDisabledItemClicked diff --git a/src/states_screens/online_screen.hpp b/src/states_screens/online_screen.hpp new file mode 100644 index 000000000..d02f83a3d --- /dev/null +++ b/src/states_screens/online_screen.hpp @@ -0,0 +1,73 @@ +// SuperTuxKart - a fun racing game with go-kart +// Copyright (C) 2009-2015 Marianne Gagnon +// +// 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_SCREEN_HPP +#define HEADER_ONLINE_SCREEN_HPP + +#include "guiengine/screen.hpp" + +namespace GUIEngine { class Widget; class ListWidget; + class ButtonWidget; class IconButtonWidget; } + +/** + * \brief Handles the networking main menu + * \ingroup states_screens + */ +class OnlineScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton +{ +private: + friend class GUIEngine::ScreenSingleton; + + core::stringw m_online_string; + + core::stringw m_login_string; + + /** Keep the widget to to the user name. */ + GUIEngine::ButtonWidget *m_user_id; + + /** Keep the widget to avoid looking it up every frame. */ + GUIEngine::IconButtonWidget* m_online; + + OnlineScreen(); + +public: + /** Temporary disable the online menu while it is being worked at. */ + static bool m_enable_online; + + virtual void onUpdate(float delta) OVERRIDE; + + /** \brief implement callback from parent class GUIEngine::Screen */ + virtual void loadedFromFile() OVERRIDE; + + /** \brief implement callback from parent class GUIEngine::Screen */ + virtual void beforeAddingWidget() 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; + + /** \brief implement callback from parent class GUIEngine::Screen */ + virtual void tearDown() OVERRIDE; + + /** \brief implement callback from parent class GUIEngine::Screen */ + virtual void onDisabledItemClicked(const std::string& item) OVERRIDE; +}; + +#endif diff --git a/src/states_screens/user_screen.cpp b/src/states_screens/user_screen.cpp index 91071c597..e73feb207 100644 --- a/src/states_screens/user_screen.cpp +++ b/src/states_screens/user_screen.cpp @@ -400,6 +400,7 @@ void BaseUserScreen::eventCallback(Widget* widget, */ void BaseUserScreen::closeScreen() { + // TODO: return user to where they come from StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance()); } // closeScreen