Move assign mode to exit callback

This commit is contained in:
Benau 2018-03-16 21:31:46 +08:00
parent 78ac3a922d
commit 8c702a376e
2 changed files with 11 additions and 1 deletions

View File

@ -147,7 +147,6 @@ void NetworkKartSelectionScreen::playerConfirm(const int playerID)
kart.addUInt8(LobbyProtocol::LE_KART_SELECTION).addUInt8(player_count)
.encodeString(selection);
STKHost::get()->sendToServer(&kart, true);
input_manager->getDeviceManager()->setAssignMode(ASSIGN);
// Remove kart screen
StateManager::get()->popMenu();
TracksScreen::getInstance()->setNetworkTracks();
@ -155,11 +154,19 @@ void NetworkKartSelectionScreen::playerConfirm(const int playerID)
}
} // playerConfirm
// ----------------------------------------------------------------------------
void NetworkKartSelectionScreen::tearDown()
{
KartSelectionScreen::tearDown();
input_manager->getDeviceManager()->setAssignMode(ASSIGN);
} // tearDown
// ----------------------------------------------------------------------------
bool NetworkKartSelectionScreen::onEscapePressed()
{
// then remove the lobby screen (you left the server)
StateManager::get()->popMenu();
STKHost::get()->shutdown();
input_manager->getDeviceManager()->setAssignMode(NO_ASSIGN);
return true; // remove the screen
} // onEscapePressed

View File

@ -50,6 +50,9 @@ public:
}
virtual void init() OVERRIDE;
virtual bool onEscapePressed() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void tearDown() OVERRIDE;
};
#endif // NETWORK_KART_SELECTION_HPP