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:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user