Merge branch 'master' of https://github.com/quizywiz/stk-code into quizywiz-master
This commit is contained in:
commit
31c4b2c475
@ -479,8 +479,9 @@ void UserInfoDialog::onUpdate(float dt)
|
||||
// It's unsafe to delete from inside the event handler so we do it here
|
||||
if (m_self_destroy)
|
||||
{
|
||||
bool enter_profile = m_enter_profile;
|
||||
ModalDialog::dismiss();
|
||||
if (m_enter_profile)
|
||||
if (enter_profile)
|
||||
StateManager::get()->replaceTopMostScreen(OnlineProfileAchievements::getInstance());
|
||||
return;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include "states_screens/online_profile_base.hpp"
|
||||
|
||||
#include "config/player_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "guiengine/screen.hpp"
|
||||
@ -71,6 +72,8 @@ void OnlineProfileBase::beforeAddingWidget()
|
||||
m_visiting_profile = ProfileManager::get()->getVisitingProfile();
|
||||
if (!m_visiting_profile || !m_visiting_profile->isCurrentUser())
|
||||
m_settings_tab->setVisible(false);
|
||||
else
|
||||
m_settings_tab->setVisible(true);
|
||||
|
||||
// If not logged in, don't show profile or friends
|
||||
if (!m_visiting_profile)
|
||||
@ -103,6 +106,19 @@ void OnlineProfileBase::init()
|
||||
|
||||
} // init
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
bool OnlineProfileBase::onEscapePressed()
|
||||
{
|
||||
//return to main menu if it's your profile
|
||||
if (!m_visiting_profile || m_visiting_profile->isCurrentUser())
|
||||
return true;
|
||||
|
||||
//return to your profile if it's another profile
|
||||
ProfileManager::get()->setVisiting(PlayerManager::getCurrentOnlineId());
|
||||
StateManager::get()->replaceTopMostScreen(OnlineProfileAchievements::getInstance());
|
||||
return false;
|
||||
} // onEscapePressed
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** Called when an event occurs (i.e. user clicks on something).
|
||||
*/
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
/** \brief implement callback from parent class GUIEngine::Screen */
|
||||
virtual void init() OVERRIDE;
|
||||
|
||||
virtual bool onEscapePressed() OVERRIDE;
|
||||
|
||||
virtual void beforeAddingWidget() OVERRIDE;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user