Make sure that dialog window and screen keyboard are deleted before changing screen in lobby
This commit is contained in:
parent
d0b24487eb
commit
a60a84b05a
@ -21,6 +21,7 @@
|
|||||||
#include "config/user_config.hpp"
|
#include "config/user_config.hpp"
|
||||||
#include "guiengine/engine.hpp"
|
#include "guiengine/engine.hpp"
|
||||||
#include "guiengine/modaldialog.hpp"
|
#include "guiengine/modaldialog.hpp"
|
||||||
|
#include "guiengine/screen_keyboard.hpp"
|
||||||
#include "guiengine/screen.hpp"
|
#include "guiengine/screen.hpp"
|
||||||
#include "input/device_manager.hpp"
|
#include "input/device_manager.hpp"
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ void AbstractStateManager::enterGameState()
|
|||||||
{
|
{
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
assert(!ModalDialog::isADialogActive());
|
assert(!ModalDialog::isADialogActive());
|
||||||
|
assert(!ScreenKeyboard::isActive());
|
||||||
|
|
||||||
if (getCurrentScreen() != NULL) getCurrentScreen()->tearDown();
|
if (getCurrentScreen() != NULL) getCurrentScreen()->tearDown();
|
||||||
m_menu_stack.clear();
|
m_menu_stack.clear();
|
||||||
@ -90,6 +92,7 @@ void AbstractStateManager::pushMenu(Screen* screen)
|
|||||||
|
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
assert(!ModalDialog::isADialogActive());
|
assert(!ModalDialog::isADialogActive());
|
||||||
|
assert(!ScreenKeyboard::isActive());
|
||||||
|
|
||||||
if (UserConfigParams::logGUI())
|
if (UserConfigParams::logGUI())
|
||||||
{
|
{
|
||||||
@ -122,6 +125,7 @@ void AbstractStateManager::pushScreen(Screen* screen)
|
|||||||
{
|
{
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
assert(!ModalDialog::isADialogActive());
|
assert(!ModalDialog::isADialogActive());
|
||||||
|
assert(!ScreenKeyboard::isActive());
|
||||||
|
|
||||||
if (UserConfigParams::logGUI())
|
if (UserConfigParams::logGUI())
|
||||||
{
|
{
|
||||||
@ -146,6 +150,7 @@ void AbstractStateManager::replaceTopMostScreen(Screen* screen, GUIEngine::GameS
|
|||||||
//assert(m_game_mode != GAME);
|
//assert(m_game_mode != GAME);
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
assert(!ModalDialog::isADialogActive());
|
assert(!ModalDialog::isADialogActive());
|
||||||
|
assert(!ScreenKeyboard::isActive());
|
||||||
|
|
||||||
if (!screen->isLoaded()) screen->loadFromFile();
|
if (!screen->isLoaded()) screen->loadFromFile();
|
||||||
std::string name = screen->getName();
|
std::string name = screen->getName();
|
||||||
@ -179,6 +184,7 @@ void AbstractStateManager::reshowTopMostMenu()
|
|||||||
assert(m_game_mode != GAME);
|
assert(m_game_mode != GAME);
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
assert(!ModalDialog::isADialogActive());
|
assert(!ModalDialog::isADialogActive());
|
||||||
|
assert(!ScreenKeyboard::isActive());
|
||||||
|
|
||||||
// Send tear-down event to previous menu
|
// Send tear-down event to previous menu
|
||||||
if (m_menu_stack.size() > 0)
|
if (m_menu_stack.size() > 0)
|
||||||
@ -243,6 +249,7 @@ void AbstractStateManager::resetAndGoToScreen(Screen* screen)
|
|||||||
{
|
{
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
assert(!ModalDialog::isADialogActive());
|
assert(!ModalDialog::isADialogActive());
|
||||||
|
assert(!ScreenKeyboard::isActive());
|
||||||
|
|
||||||
std::string name = screen->getName();
|
std::string name = screen->getName();
|
||||||
|
|
||||||
@ -271,6 +278,7 @@ void AbstractStateManager::resetAndSetStack(Screen* screens[])
|
|||||||
assert(screens[0] != NULL);
|
assert(screens[0] != NULL);
|
||||||
// you need to close any dialog before calling this
|
// you need to close any dialog before calling this
|
||||||
assert(!ModalDialog::isADialogActive());
|
assert(!ModalDialog::isADialogActive());
|
||||||
|
assert(!ScreenKeyboard::isActive());
|
||||||
|
|
||||||
if (m_game_mode != GAME) getCurrentScreen()->tearDown();
|
if (m_game_mode != GAME) getCurrentScreen()->tearDown();
|
||||||
m_menu_stack.clear();
|
m_menu_stack.clear();
|
||||||
|
@ -218,6 +218,10 @@ bool ClientLobby::notifyEventAsynchronous(Event* event)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void ClientLobby::addAllPlayers(Event* event)
|
void ClientLobby::addAllPlayers(Event* event)
|
||||||
{
|
{
|
||||||
|
// In case the user opened a user info dialog
|
||||||
|
GUIEngine::ModalDialog::dismiss();
|
||||||
|
GUIEngine::ScreenKeyboard::dismiss();
|
||||||
|
|
||||||
if (!checkDataSize(event, 1))
|
if (!checkDataSize(event, 1))
|
||||||
{
|
{
|
||||||
// If recieved invalid message for players leave now
|
// If recieved invalid message for players leave now
|
||||||
@ -364,6 +368,7 @@ void ClientLobby::update(int ticks)
|
|||||||
m_received_server_result = true;
|
m_received_server_result = true;
|
||||||
// In case someone opened paused race dialog or menu in network game
|
// In case someone opened paused race dialog or menu in network game
|
||||||
GUIEngine::ModalDialog::dismiss();
|
GUIEngine::ModalDialog::dismiss();
|
||||||
|
GUIEngine::ScreenKeyboard::dismiss();
|
||||||
if (StateManager::get()->getGameState() == GUIEngine::INGAME_MENU)
|
if (StateManager::get()->getGameState() == GUIEngine::INGAME_MENU)
|
||||||
StateManager::get()->enterGameState();
|
StateManager::get()->enterGameState();
|
||||||
World::getWorld()->enterRaceOverState();
|
World::getWorld()->enterRaceOverState();
|
||||||
@ -904,6 +909,10 @@ void ClientLobby::raceFinished(Event* event)
|
|||||||
*/
|
*/
|
||||||
void ClientLobby::exitResultScreen(Event *event)
|
void ClientLobby::exitResultScreen(Event *event)
|
||||||
{
|
{
|
||||||
|
// In case the user opened a user info dialog
|
||||||
|
GUIEngine::ModalDialog::dismiss();
|
||||||
|
GUIEngine::ScreenKeyboard::dismiss();
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
m_state.store(CONNECTED);
|
m_state.store(CONNECTED);
|
||||||
RaceResultGUI::getInstance()->backToLobby();
|
RaceResultGUI::getInstance()->backToLobby();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user