From 3813127d787826e681f93eb6dca9c49904092cee Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 15 Jul 2008 02:09:27 +0000 Subject: [PATCH] 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 --- src/gui/char_sel.cpp | 6 +++--- src/gui/track_sel.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/char_sel.cpp b/src/gui/char_sel.cpp index 596a29392..5ca0f8a6c 100644 --- a/src/gui/char_sel.cpp +++ b/src/gui/char_sel.cpp @@ -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 diff --git a/src/gui/track_sel.cpp b/src/gui/track_sel.cpp index 5fabf3790..15414049b 100644 --- a/src/gui/track_sel.cpp +++ b/src/gui/track_sel.cpp @@ -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