Fixes that characters previously selected wouldn't be selected the next time you go into the character selection menu.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1331 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
748dc0841f
commit
a28879b077
@ -105,8 +105,20 @@ CharSel::CharSel(int whichPlayer)
|
||||
//FIXME: widget_manager says that token -1 is already in use
|
||||
widget_manager->layout(WGT_AREA_TOP);
|
||||
|
||||
|
||||
m_current_kart = -1;
|
||||
|
||||
const int LAST_KART = user_config->m_player[m_player_index].getLastKartId();
|
||||
if( LAST_KART != -1 )
|
||||
{
|
||||
widget_manager->set_selected_wgt(WTOK_RACER0 + LAST_KART);
|
||||
switchCharacter(LAST_KART);
|
||||
}
|
||||
else
|
||||
{
|
||||
switchCharacter(0);
|
||||
}
|
||||
|
||||
|
||||
m_clock = 0;
|
||||
//test
|
||||
|
@ -31,16 +31,16 @@ class Player
|
||||
private:
|
||||
std::string m_name;
|
||||
Input m_action_map[KA_LAST+1];
|
||||
unsigned int m_last_kart_id;
|
||||
int m_last_kart_id;
|
||||
|
||||
public:
|
||||
Player(){}
|
||||
Player(const std::string &name_):m_name(name_){}
|
||||
Player(const std::string &name_):m_name(name_),m_last_kart_id(-1){}
|
||||
void setName(const std::string &name_){m_name = name_;}
|
||||
|
||||
std::string getName() {return m_name;}
|
||||
|
||||
unsigned int getLastKartId(){ return m_last_kart_id; }
|
||||
int getLastKartId(){ return m_last_kart_id; }
|
||||
void setLastKartId(int newLastKartId){ m_last_kart_id = newLastKartId; }
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user