Fixed pre-selection of track/character.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2165 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
936f363467
commit
3813127d78
@ -45,8 +45,8 @@ enum WidgetTokens
|
||||
WTOK_EMPTY_DOWN,
|
||||
WTOK_DOWN,
|
||||
WTOK_EMPTY0 = 10,
|
||||
WTOK_NAME0 = 20,
|
||||
WTOK_RACER0 = 30
|
||||
WTOK_NAME0 = 2000,
|
||||
WTOK_RACER0 = 3000
|
||||
};
|
||||
|
||||
CharSel::CharSel(int whichPlayer)
|
||||
@ -122,7 +122,7 @@ CharSel::CharSel(int whichPlayer)
|
||||
}
|
||||
m_offset = local_index - m_max_entries/2;
|
||||
if(m_offset<0) m_offset+=(int)m_index_avail_karts.size();
|
||||
widget_manager->setSelectedWgt(WTOK_RACER0 + local_index);
|
||||
widget_manager->setSelectedWgt(WTOK_NAME0 +(m_max_entries-1)/2);
|
||||
switchCharacter(local_index);
|
||||
}
|
||||
else
|
||||
|
@ -90,12 +90,12 @@ TrackSel::TrackSel()
|
||||
switchGroup();
|
||||
updateScrollPosition();
|
||||
|
||||
widget_manager->layout(WGT_AREA_TOP);
|
||||
// Make sure to select one track. The call to update() here is necessary,
|
||||
// since it guarantees that selectedWgt is indeed a track (otherwise the
|
||||
// manager might select e.g. arrow up, and then no track is displayed).
|
||||
widget_manager->setSelectedWgt(WTOK_TRACK0+(m_max_entries-1)/2);
|
||||
displayImages(0);
|
||||
widget_manager->layout(WGT_AREA_TOP);
|
||||
//update(0);
|
||||
} // TrackSel
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user