start of profiles
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13416 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
757d9e3683
commit
856a21a47e
@ -33,11 +33,13 @@
|
||||
|
||||
<buttonbar id="menu_bottomrow" x="0" y="0" width="12%" height="100%" align="center">
|
||||
<icon-button id="sign_in" width="64" height="64" icon="gui/main_about.png" extend_label="50"
|
||||
I18N="Main menu button" text="Sign In" label_location="hover"/>
|
||||
I18N="Online menu button" text="Sign In" label_location="hover"/>
|
||||
<icon-button id="register" width="64" height="64" icon="gui/tutorial.png" extend_label="75"
|
||||
I18N="Main menu button" text="Register" label_location="hover"/>
|
||||
I18N="Online menu button" text="Register" label_location="hover"/>
|
||||
<icon-button id="profile" width="64" height="64" icon="gui/green_check.png" extend_label="50"
|
||||
I18N="Online menu button" text="Profile" label_location="hover"/>
|
||||
<icon-button id="sign_out" width="64" height="64" icon="gui/main_quit.png" extend_label="70"
|
||||
I18N="Main menu button" text="Sign Out" label_location="hover"/>
|
||||
I18N="Online menu button" text="Sign Out" label_location="hover"/>
|
||||
</buttonbar>
|
||||
|
||||
</bottombar>
|
||||
|
22
data/gui/online/profile_overview.stkgui
Normal file
22
data/gui/online/profile_overview.stkgui
Normal file
@ -0,0 +1,22 @@
|
||||
<stkgui>
|
||||
|
||||
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
|
||||
|
||||
<header id="title" text_align="center" width="80%" align="center" text="..."/>
|
||||
|
||||
<spacer height="25" width="10"/>
|
||||
|
||||
<tabs id="profile_tabs" height="10%" max_height="110" x="2%" width="98%" align="center">
|
||||
<icon-button id="tab_overview" width="128" height="128" icon="gui/options_video.png" I18N="Section in the profile menu" text="Overview"/>
|
||||
</tabs>
|
||||
|
||||
<box proportion="1" width="100%" layout="vertical-row">
|
||||
<div x="1%" y="2%" width="98%" height="96%" layout="vertical-row" >
|
||||
|
||||
</div>
|
||||
</box>
|
||||
</div>
|
||||
|
||||
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
|
||||
|
||||
</stkgui>
|
@ -7,8 +7,9 @@
|
||||
|
||||
<spacer height="20" width="50">
|
||||
|
||||
<label id="terms" proportion="5" width="90%" align="center" text_align="center" word_wrap="true"
|
||||
I18N="In the registration dialog' dialog" text="The terms will come here. In a fancy scroll box."/>
|
||||
<box proportion="5" width="90%" align="center" layout="vertical-row" padding="8">
|
||||
<list id="terms" x="0" y="0" width="100%" height="100%"/>
|
||||
</box>
|
||||
|
||||
<div align="center" width="fit" height="fit" layout="horizontal-row" >
|
||||
<label text_align="center" align="center" I18N="In the registration dialog" word_wrap="true"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Generated by ./update_file_list.sh. Do not edit this file manually.
|
||||
# Generated by /home/gl3nn/repos/gsoc-stk-branch/update_file_list.sh. Do not edit this file manually.
|
||||
set(STK_SOURCES
|
||||
src/addons/addon.cpp
|
||||
src/addons/addons_manager.cpp
|
||||
@ -173,6 +173,7 @@ src/network/types.cpp
|
||||
src/online/current_user.cpp
|
||||
src/online/http_manager.cpp
|
||||
src/online/messages.cpp
|
||||
src/online/profile_manager.cpp
|
||||
src/online/request.cpp
|
||||
src/online/server.cpp
|
||||
src/online/servers_manager.cpp
|
||||
@ -226,9 +227,9 @@ src/states_screens/help_screen_4.cpp
|
||||
src/states_screens/kart_selection.cpp
|
||||
src/states_screens/main_menu_screen.cpp
|
||||
src/states_screens/networking_lobby.cpp
|
||||
src/states_screens/networking_lobby_settings.cpp
|
||||
src/states_screens/network_kart_selection.cpp
|
||||
src/states_screens/offline_kart_selection.cpp
|
||||
src/states_screens/online_profile_overview.cpp
|
||||
src/states_screens/online_screen.cpp
|
||||
src/states_screens/options_screen_audio.cpp
|
||||
src/states_screens/options_screen_input2.cpp
|
||||
@ -466,6 +467,7 @@ src/network/types.hpp
|
||||
src/online/current_user.hpp
|
||||
src/online/http_manager.hpp
|
||||
src/online/messages.hpp
|
||||
src/online/profile_manager.hpp
|
||||
src/online/request.hpp
|
||||
src/online/server.hpp
|
||||
src/online/servers_manager.hpp
|
||||
@ -522,9 +524,9 @@ src/states_screens/help_screen_4.hpp
|
||||
src/states_screens/kart_selection.hpp
|
||||
src/states_screens/main_menu_screen.hpp
|
||||
src/states_screens/networking_lobby.hpp
|
||||
src/states_screens/networking_lobby_settings.hpp
|
||||
src/states_screens/network_kart_selection.hpp
|
||||
src/states_screens/offline_kart_selection.hpp
|
||||
src/states_screens/online_profile_overview.hpp
|
||||
src/states_screens/online_screen.hpp
|
||||
src/states_screens/options_screen_audio.hpp
|
||||
src/states_screens/options_screen_input2.hpp
|
||||
|
@ -115,7 +115,7 @@ private:
|
||||
/** Compressed size of the addon package. */
|
||||
int m_size;
|
||||
/** Rating for thsi addon package. */
|
||||
float m_rating;
|
||||
mutable float m_rating;
|
||||
/** Minimum version addon is included with. */
|
||||
std::string m_min_include_ver;
|
||||
/** Maximum version addon is included with. */
|
||||
@ -152,7 +152,7 @@ public:
|
||||
const float getRating() const {return m_rating; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Sets the rating of an addon. */
|
||||
void setRating(const float rating) {m_rating = rating; }
|
||||
void setRating(const float rating) const {m_rating = rating; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns the type of the addon. */
|
||||
const std::string& getType() const { return m_type; }
|
||||
|
@ -345,7 +345,7 @@ void AddonsManager::loadInstalledAddons()
|
||||
* found!
|
||||
* \param id The id to search for.
|
||||
*/
|
||||
Addon* AddonsManager::getAddon(const std::string &id)
|
||||
const Addon* AddonsManager::getAddon(const std::string &id) const
|
||||
{
|
||||
int i = getAddonIndex(id);
|
||||
return (i<0) ? NULL : &(m_addons_list.getData()[i]);
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
~AddonsManager();
|
||||
void initOnline(const XMLNode *xml);
|
||||
void checkInstalledAddons();
|
||||
Addon* getAddon(const std::string &id);
|
||||
const Addon* getAddon(const std::string &id) const;
|
||||
int getAddonIndex(const std::string &id) const;
|
||||
bool install(const Addon &addon);
|
||||
bool uninstall(const Addon &addon);
|
||||
|
70
src/online/profile_manager.cpp
Normal file
70
src/online/profile_manager.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
//
|
||||
// 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.
|
||||
|
||||
|
||||
#include "online/profile_manager.hpp"
|
||||
|
||||
#include "online/current_user.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Online;
|
||||
|
||||
namespace Online{
|
||||
static ProfileManager* current_user_singleton(NULL);
|
||||
|
||||
ProfileManager* ProfileManager::get()
|
||||
{
|
||||
if (current_user_singleton == NULL)
|
||||
current_user_singleton = new ProfileManager();
|
||||
return current_user_singleton;
|
||||
}
|
||||
|
||||
void ProfileManager::deallocate()
|
||||
{
|
||||
delete current_user_singleton;
|
||||
current_user_singleton = NULL;
|
||||
} // deallocate
|
||||
|
||||
// ============================================================================
|
||||
ProfileManager::ProfileManager()
|
||||
{
|
||||
setState (S_READY);
|
||||
m_is_current_user = false;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
void ProfileManager::set()
|
||||
{
|
||||
assert(CurrentUser::get()->isRegisteredUser());
|
||||
//CurrentUser::get()->isRegisteredUser()
|
||||
m_is_current_user = true;
|
||||
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
void ProfileManager::set(User * user)
|
||||
{
|
||||
//CurrentUser::get()->isRegisteredUser()
|
||||
m_is_current_user = false;
|
||||
}
|
||||
} // namespace Online
|
80
src/online/profile_manager.hpp
Normal file
80
src/online/profile_manager.hpp
Normal file
@ -0,0 +1,80 @@
|
||||
//
|
||||
// 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_MANAGER_HPP
|
||||
#define HEADER_ONLINE_PROFILE_MANAGER_HPP
|
||||
|
||||
#include "http_manager.hpp"
|
||||
#include "online/request.hpp"
|
||||
#include "online/user.hpp"
|
||||
#include "utils/types.hpp"
|
||||
|
||||
|
||||
#include <irrString.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Online{
|
||||
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* \brief Class that takes care of online profiles
|
||||
* \ingroup online
|
||||
*/
|
||||
class ProfileManager
|
||||
{
|
||||
public:
|
||||
enum State
|
||||
{
|
||||
S_FETCHING = 1,
|
||||
S_READY
|
||||
};
|
||||
|
||||
class ProfileInfoRequest : public XMLRequest
|
||||
{
|
||||
virtual void callback ();
|
||||
public:
|
||||
ProfileInfoRequest() : XMLRequest() {}
|
||||
};
|
||||
|
||||
private:
|
||||
Synchronised<State> m_state;
|
||||
bool m_is_current_user;
|
||||
bool m_has_fetched_overview;
|
||||
|
||||
ProfileManager();
|
||||
|
||||
void setState (State state) { m_state.setAtomic(state); }
|
||||
|
||||
public:
|
||||
/**Singleton */
|
||||
static ProfileManager * get();
|
||||
static void deallocate();
|
||||
|
||||
void set();
|
||||
void set(Online::User *);
|
||||
const State getState() const { return m_state.getAtomic(); }
|
||||
|
||||
}; // class CurrentUser
|
||||
|
||||
} // namespace Online
|
||||
|
||||
#endif
|
||||
|
||||
/*EOF*/
|
@ -113,6 +113,23 @@ void RegistrationDialog::showRegistrationTerms()
|
||||
clearWindow();
|
||||
m_phase = Terms;
|
||||
loadFromFile("online/registration_terms.stkgui");
|
||||
|
||||
|
||||
ListWidget * terms_widget = getWidget<ListWidget>("terms");
|
||||
|
||||
|
||||
terms_widget->addItem("title", "=== STK Terms and Conditions ===", -1 , true );
|
||||
terms_widget->addItem("par1", "You must agree to these terms in order to register an account for STK.", -1 , false );
|
||||
terms_widget->addItem("par2",
|
||||
"Still needs actual content. Preferably in an XML document which can then be parsed to be put here."
|
||||
, -1 , false );
|
||||
terms_widget->addItem("par3",
|
||||
"By checking the box below, you are confirming that you understand these terms."
|
||||
"If you have any questions or comments regarding these terms,"
|
||||
"one of the members of the development team would gladly assist you."
|
||||
, -1 , false );
|
||||
|
||||
|
||||
m_accept_terms_widget = getWidget<CheckBoxWidget>("accepted");
|
||||
assert(m_accept_terms_widget != NULL);
|
||||
m_accept_terms_widget->setState(false);
|
||||
|
@ -1,116 +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.
|
||||
|
||||
#define DEBUG_MENU_ITEM 0
|
||||
|
||||
#include "states_screens/networking_lobby_settings.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#include "challenges/game_slot.hpp"
|
||||
#include "challenges/unlock_manager.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "input/device_manager.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "main_loop.hpp"
|
||||
#include "states_screens/online_screen.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "states_screens/dialogs/message_dialog.hpp"
|
||||
#include "modes/demo_world.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
|
||||
#include "online/current_user.hpp"
|
||||
|
||||
|
||||
using namespace GUIEngine;
|
||||
|
||||
DEFINE_SCREEN_SINGLETON( NetworkingLobbySettings );
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
NetworkingLobbySettings::NetworkingLobbySettings() : Screen("online/lobby_settings.stkgui")
|
||||
{
|
||||
|
||||
} // NetworkingLobbySettings
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void NetworkingLobbySettings::loadedFromFile()
|
||||
{
|
||||
|
||||
} // loadedFromFile
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool NetworkingLobbySettings::hasLostConnection()
|
||||
{
|
||||
bool return_value = ( Online::CurrentUser::get()->getUserState() !=
|
||||
Online::CurrentUser::US_SIGNED_IN);
|
||||
return return_value;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void NetworkingLobbySettings::beforeAddingWidget()
|
||||
{
|
||||
|
||||
} // beforeAddingWidget
|
||||
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void NetworkingLobbySettings::init()
|
||||
{
|
||||
Screen::init();
|
||||
setInitialFocus();
|
||||
DemoWorld::resetIdleTime(); //FIXME : what's this?} // init
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
void NetworkingLobbySettings::onUpdate(float delta, irr::video::IVideoDriver* driver)
|
||||
{
|
||||
} // onUpdate
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void NetworkingLobbySettings::eventCallback(Widget* widget, const std::string& name, const int playerID)
|
||||
{
|
||||
|
||||
} // eventCallback
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void NetworkingLobbySettings::tearDown()
|
||||
{
|
||||
} // tearDown
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void NetworkingLobbySettings::onDisabledItemClicked(const std::string& item)
|
||||
{
|
||||
|
||||
} // onDisabledItemClicked
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void NetworkingLobbySettings::setInitialFocus()
|
||||
{
|
||||
} // setInitialFocus
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void NetworkingLobbySettings::onDialogClose()
|
||||
{
|
||||
setInitialFocus();
|
||||
} // onDialogClose()
|
96
src/states_screens/online_profile_overview.cpp
Normal file
96
src/states_screens/online_profile_overview.cpp
Normal file
@ -0,0 +1,96 @@
|
||||
// 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 <IGUIButton.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
using namespace GUIEngine;
|
||||
using namespace irr::core;
|
||||
using namespace irr::gui;
|
||||
using namespace Online;
|
||||
|
||||
DEFINE_SCREEN_SINGLETON( OnlineProfileOverview );
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
OnlineProfileOverview::OnlineProfileOverview() : Screen("online/profile_overview.stkgui")
|
||||
{
|
||||
} // OnlineProfileOverview
|
||||
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void OnlineProfileOverview::loadedFromFile()
|
||||
{
|
||||
m_profile_tabs = this->getWidget<RibbonWidget>("profile_tabs");
|
||||
assert(m_profile_tabs != NULL);
|
||||
LabelWidget * header = this->getWidget<LabelWidget>("title");
|
||||
assert(header != NULL);
|
||||
header->setText(_("Your profile"), false);
|
||||
|
||||
} // loadedFromFile
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void OnlineProfileOverview::init()
|
||||
{
|
||||
Screen::init();
|
||||
m_profile_tabs->select( "tab_players", PLAYER_ID_GAME_MASTER );
|
||||
|
||||
/*
|
||||
tabBar->getRibbonChildren()[0].setTooltip( _("Graphics") );
|
||||
tabBar->getRibbonChildren()[1].setTooltip( _("Audio") );
|
||||
tabBar->getRibbonChildren()[2].setTooltip( _("User Interface") );
|
||||
tabBar->getRibbonChildren()[4].setTooltip( _("Controls") );*/
|
||||
} // init
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void OnlineProfileOverview::tearDown()
|
||||
{
|
||||
Screen::tearDown();
|
||||
} // tearDown
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void OnlineProfileOverview::eventCallback(Widget* widget, const std::string& name, const int playerID)
|
||||
{
|
||||
if (name == m_profile_tabs->m_properties[PROP_ID])
|
||||
{
|
||||
std::string selection = ((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER).c_str();
|
||||
|
||||
//if (selection == "tab_audio") StateManager::get()->replaceTopMostScreen(OptionsScreenAudio::getInstance());
|
||||
}
|
||||
else if (name == "back")
|
||||
{
|
||||
StateManager::get()->escapePressed();
|
||||
}
|
||||
} // eventCallback
|
||||
|
@ -15,42 +15,32 @@
|
||||
// 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_NETWORKING_LOBBY_SETTINGS_HPP
|
||||
#define HEADER_NETWORKING_LOBBY_SETTINGS_HPP
|
||||
|
||||
#ifndef __HEADER_ONLINE_PROFILE_OVERVIEW_HPP__
|
||||
#define __HEADER_ONLINE_PROFILE_OVERVIEW_HPP__
|
||||
|
||||
#include <string>
|
||||
#include <irrString.h>
|
||||
|
||||
#include "guiengine/screen.hpp"
|
||||
#include "guiengine/widgets/label_widget.hpp"
|
||||
#include "guiengine/widgets/ribbon_widget.hpp"
|
||||
#include "guiengine/widgets/icon_button_widget.hpp"
|
||||
#include "guiengine/widgets.hpp"
|
||||
|
||||
namespace GUIEngine { class Widget; }
|
||||
|
||||
namespace GUIEngine { class Widget; class ListWidget; }
|
||||
|
||||
/**
|
||||
* \brief Handles the main menu
|
||||
* \brief Online profiel overview screen
|
||||
* \ingroup states_screens
|
||||
*/
|
||||
class NetworkingLobbySettings : public GUIEngine::Screen,
|
||||
public GUIEngine::ScreenSingleton<NetworkingLobbySettings>
|
||||
class OnlineProfileOverview : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<OnlineProfileOverview>
|
||||
{
|
||||
private:
|
||||
friend class GUIEngine::ScreenSingleton<NetworkingLobbySettings>;
|
||||
OnlineProfileOverview();
|
||||
|
||||
NetworkingLobbySettings();
|
||||
|
||||
/** \brief Checks if the user is still signed in. */
|
||||
bool hasLostConnection();
|
||||
/** \brief Sets which widget has to be focused. Depends on the user state. */
|
||||
void setInitialFocus();
|
||||
GUIEngine::RibbonWidget* m_profile_tabs;
|
||||
|
||||
public:
|
||||
|
||||
enum Action
|
||||
{
|
||||
Create = 1, // A new server should be created
|
||||
Edit = 2, // The settings of the server should be edited
|
||||
};
|
||||
|
||||
virtual void onUpdate(float delta, irr::video::IVideoDriver* driver) OVERRIDE;
|
||||
friend class GUIEngine::ScreenSingleton<OnlineProfileOverview>;
|
||||
|
||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||
virtual void loadedFromFile() OVERRIDE;
|
||||
@ -59,20 +49,11 @@ public:
|
||||
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
|
||||
const int playerID) OVERRIDE;
|
||||
|
||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||
virtual void beforeAddingWidget() 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;
|
||||
|
||||
/** \brief Implements the callback when a dialog gets closed. */
|
||||
virtual void onDialogClose() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif
|
@ -36,7 +36,7 @@
|
||||
#include "states_screens/networking_lobby.hpp"
|
||||
#include "states_screens/server_selection.hpp"
|
||||
#include "states_screens/create_server_screen.hpp"
|
||||
#include "states_screens/networking_lobby_settings.hpp"
|
||||
#include "states_screens/online_profile_overview.hpp"
|
||||
#include "online/servers_manager.hpp"
|
||||
#include "online/messages.hpp"
|
||||
#include "online/request.hpp"
|
||||
@ -91,6 +91,8 @@ void OnlineScreen::loadedFromFile()
|
||||
assert(m_sign_in_widget != NULL);
|
||||
m_register_widget = (IconButtonWidget *) m_bottom_menu_widget->findWidgetNamed("register");
|
||||
assert(m_register_widget != NULL);
|
||||
m_profile_widget = (IconButtonWidget *) m_bottom_menu_widget->findWidgetNamed("profile");
|
||||
assert(m_profile_widget != NULL);
|
||||
m_sign_out_widget = (IconButtonWidget *) m_bottom_menu_widget->findWidgetNamed("sign_out");
|
||||
assert(m_sign_out_widget != NULL);
|
||||
|
||||
@ -124,6 +126,7 @@ void OnlineScreen::beforeAddingWidget()
|
||||
m_find_server_widget->setDeactivated();
|
||||
m_create_server_widget->setDeactivated();
|
||||
m_sign_out_widget->setVisible(false);
|
||||
m_profile_widget->setVisible(false);
|
||||
if(m_recorded_state == CurrentUser::US_SIGNING_IN || m_recorded_state == CurrentUser::US_SIGNING_OUT)
|
||||
{
|
||||
m_register_widget->setDeactivated();
|
||||
@ -135,6 +138,7 @@ void OnlineScreen::beforeAddingWidget()
|
||||
m_find_server_widget->setDeactivated();
|
||||
m_create_server_widget->setDeactivated();
|
||||
m_sign_in_widget->setVisible(false);
|
||||
m_profile_widget->setVisible(false);
|
||||
}
|
||||
|
||||
} // beforeAddingWidget
|
||||
@ -210,6 +214,10 @@ void OnlineScreen::eventCallback(Widget* widget, const std::string& name, const
|
||||
{
|
||||
CurrentUser::get()->requestSignOut();
|
||||
}
|
||||
else if (selection == m_profile_widget->m_properties[PROP_ID])
|
||||
{
|
||||
StateManager::get()->pushScreen(OnlineProfileOverview::getInstance());
|
||||
}
|
||||
else if (selection == "register")
|
||||
{
|
||||
new RegistrationDialog();
|
||||
|
@ -50,6 +50,7 @@ private:
|
||||
GUIEngine::RibbonWidget * m_bottom_menu_widget;
|
||||
GUIEngine::IconButtonWidget * m_sign_in_widget;
|
||||
GUIEngine::IconButtonWidget * m_register_widget;
|
||||
GUIEngine::IconButtonWidget * m_profile_widget;
|
||||
GUIEngine::IconButtonWidget * m_sign_out_widget;
|
||||
|
||||
Online::CurrentUser::UserState m_recorded_state;
|
||||
|
Loading…
Reference in New Issue
Block a user