Select the appropriate identity when starting a new race from what was selected on the welcome screen

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10365 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2011-12-06 18:55:18 +00:00
parent 52e735e2ab
commit 61070ece57
3 changed files with 7 additions and 4 deletions

View File

@@ -21,6 +21,8 @@
#include <map>
#include "config/user_config.hpp"
#include "challenges/challenge_data.hpp"
#include "challenges/game_slot.hpp"
@@ -73,6 +75,8 @@ public:
void setCurrentSlot(int slotid) { m_current_game_slot = slotid; }
PlayerProfile* getCurrentPlayer() { return UserConfigParams::m_all_players.get(m_current_game_slot); };
}; // UnlockManager
extern UnlockManager* unlock_manager;

View File

@@ -172,8 +172,7 @@ void ChallengesScreen::eventCallback(GUIEngine::Widget* widget, const std::strin
// Use latest used device
InputDevice* device = input_manager->getDeviceList()->getLatestUsedDevice();
// Create player and associate player with device (FIXME: ask for player ident)
int id = StateManager::get()->createActivePlayer( UserConfigParams::m_all_players.get(0), device );
int id = StateManager::get()->createActivePlayer( unlock_manager->getCurrentPlayer(), device );
input_manager->getDeviceList()->setSinglePlayer( StateManager::get()->getActivePlayer(id) );
// Set up race manager appropriately

View File

@@ -1168,7 +1168,7 @@ bool KartSelectionScreen::playerJoin(InputDevice* device, bool firstPlayer)
kartsAreaWidget->m_y + kartsAreaWidget->m_h);
// ---- Create new active player
PlayerProfile* profileToUse = UserConfigParams::m_all_players.get(0);
PlayerProfile* profileToUse = unlock_manager->getCurrentPlayer();
if (!firstPlayer)
{
@@ -1182,7 +1182,7 @@ bool KartSelectionScreen::playerJoin(InputDevice* device, bool firstPlayer)
}
}
// Remove multiplayer message
if (m_multiplayer_message != NULL)
{