Move assign mode to exit callback
This commit is contained in:
parent
78ac3a922d
commit
8c702a376e
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user