From bdec3c7121c7ba242eec81b1df02dfdae6d50e80 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 15 May 2008 02:53:03 +0000 Subject: [PATCH] Redesigned game_mode menu, removed some unnecessary title widgets. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1898 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/gui/game_mode.cpp | 1 - src/gui/grand_prix_select.cpp | 2 +- src/gui/race_options.cpp | 41 +++++++++++++---------------------- src/gui/track_sel.cpp | 5 +++-- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/src/gui/game_mode.cpp b/src/gui/game_mode.cpp index f21ddbd9d..5112da46f 100644 --- a/src/gui/game_mode.cpp +++ b/src/gui/game_mode.cpp @@ -42,7 +42,6 @@ enum WidgetTokens GameMode::GameMode() { widget_manager->switchOrder(); - widget_manager->addTitleWgt(WTOK_TITLE, 60, 7, _("Choose a Race Mode")); widget_manager->addTextButtonWgt( WTOK_GP, 60, 7, _("Grand Prix")); diff --git a/src/gui/grand_prix_select.cpp b/src/gui/grand_prix_select.cpp index 53483cc20..74268fb05 100644 --- a/src/gui/grand_prix_select.cpp +++ b/src/gui/grand_prix_select.cpp @@ -47,7 +47,7 @@ enum WidgetTokens GrandPrixSelect::GrandPrixSelect() : m_curr_track_img(0), m_clock(0.0f) { widget_manager->switchOrder(); - widget_manager->addTitleWgt(WTOK_TITLE, 60, 7, _("Choose a Grand Prix") ); + widget_manager->addEmptyWgt(WTOK_TITLE, 60, 7); // Findout which grand prixs are available and load them std::set result; diff --git a/src/gui/race_options.cpp b/src/gui/race_options.cpp index b4b09655e..d7ef23c74 100644 --- a/src/gui/race_options.cpp +++ b/src/gui/race_options.cpp @@ -58,28 +58,26 @@ RaceOptions::RaceOptions() : { // Difficulty // ========== - widget_manager->switchOrder(); widget_manager->addTextWgt( WTOK_DIFFICULTY_TITLE, 38, 7, _("Difficulty") ); - widget_manager->switchOrder(); - widget_manager->addTextButtonWgt( WTOK_DIFFICULTY_DOWN, 3, 7, "<" ); + widget_manager->hideWgtRect(WTOK_DIFFICULTY_TITLE); + widget_manager->setWgtTextSize(WTOK_DIFFICULTY_TITLE, WGT_FNT_LRG); + widget_manager->addTextButtonWgt( WTOK_DIFFICULTY_DOWN, 3, 7, " < " ); widget_manager->addTextWgt( WTOK_DIFFICULTY, 32, 7, getDifficultyString(m_difficulty)); widget_manager->setWgtBorderPercentage( WTOK_DIFFICULTY, 10 ); widget_manager->showWgtBorder( WTOK_DIFFICULTY ); widget_manager->hideWgtRect( WTOK_DIFFICULTY ); - widget_manager->addTextButtonWgt( WTOK_DIFFICULTY_UP, 3, 7, ">" ); + widget_manager->addTextButtonWgt( WTOK_DIFFICULTY_UP, 3, 7, " > " ); widget_manager->breakLine(); - widget_manager->breakLine(); - widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 2, 1); // Number of karts // =============== - widget_manager->switchOrder(); widget_manager->addTextWgt( WTOK_KARTS_TITLE, 38, 7, _("Number of karts") ); - widget_manager->switchOrder(); - widget_manager->addTextButtonWgt( WTOK_KARTS_DOWN, 3, 7, "<" ); + widget_manager->hideWgtRect(WTOK_KARTS_TITLE); + widget_manager->setWgtTextSize(WTOK_KARTS_TITLE, WGT_FNT_LRG); + widget_manager->addTextButtonWgt( WTOK_KARTS_DOWN, 3, 7, " < " ); char string_num_karts[MAX_MESSAGE_LENGTH]; snprintf(string_num_karts, MAX_MESSAGE_LENGTH, "%d", m_num_karts); @@ -88,13 +86,8 @@ RaceOptions::RaceOptions() : widget_manager->showWgtBorder( WTOK_KARTS ); widget_manager->hideWgtRect( WTOK_KARTS ); - widget_manager->addTextButtonWgt( WTOK_KARTS_UP, 3, 7, ">" ); + widget_manager->addTextButtonWgt( WTOK_KARTS_UP, 3, 7, " > " ); - widget_manager->breakLine(); - widget_manager->breakLine(); - widget_manager->breakLine(); - - widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 2, 1); widget_manager->breakLine(); // Number of laps @@ -102,10 +95,10 @@ RaceOptions::RaceOptions() : if( race_manager->getRaceMode() != RaceManager::RM_GRAND_PRIX && race_manager->getRaceMode() != RaceManager::RM_FOLLOW_LEADER ) { - widget_manager->switchOrder(); widget_manager->addTextWgt( WTOK_LAPS_TITLE, 38, 7, _("Number of laps") ); - widget_manager->switchOrder(); - widget_manager->addTextButtonWgt( WTOK_LAPS_DOWN, 3, 7, "<" ); + widget_manager->hideWgtRect(WTOK_LAPS_TITLE); + widget_manager->setWgtTextSize(WTOK_LAPS_TITLE, WGT_FNT_LRG); + widget_manager->addTextButtonWgt( WTOK_LAPS_DOWN, 3, 7, " < " ); char string_num_laps[MAX_MESSAGE_LENGTH]; snprintf(string_num_laps, MAX_MESSAGE_LENGTH, "%d", m_num_laps); @@ -114,23 +107,19 @@ RaceOptions::RaceOptions() : widget_manager->showWgtBorder( WTOK_LAPS ); widget_manager->hideWgtRect( WTOK_LAPS ); - widget_manager->addTextButtonWgt( WTOK_LAPS_UP, 3, 7, ">" ); - widget_manager->breakLine(); - widget_manager->breakLine(); + widget_manager->addTextButtonWgt( WTOK_LAPS_UP, 3, 7, " > " ); } - + widget_manager->breakLine(); + widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 10, 10 ); widget_manager->breakLine(); //Lower buttons //============= - widget_manager->switchOrder(); - widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 1, 10); - widget_manager->addTextButtonWgt( WTOK_START, 60, 7, _("Start race") ); widget_manager->setWgtBorderPercentage( WTOK_START, 20 ); widget_manager->setWgtBorderColor( WTOK_START, WGT_TRANS_BLUE ); widget_manager->showWgtBorder( WTOK_START ); - + widget_manager->breakLine(); widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 1, 10); widget_manager->addTextButtonWgt( WTOK_QUIT, 60, 7, _("Press to go back") ); diff --git a/src/gui/track_sel.cpp b/src/gui/track_sel.cpp index 8689e8c0c..0db82013e 100644 --- a/src/gui/track_sel.cpp +++ b/src/gui/track_sel.cpp @@ -46,7 +46,8 @@ enum WidgetTokens TrackSel::TrackSel() { - widget_manager->addTitleWgt( WTOK_TITLE, 40, 7, _("Choose a track") ); + // widget_manager->addTitleWgt( WTOK_TITLE, 40, 7, _("Choose a track") ); + widget_manager->addEmptyWgt(WTOK_TITLE, 40, 7); widget_manager->breakLine(); widget_manager->addWgt( WidgetManager::WGT_NONE, 100, 1); @@ -84,7 +85,7 @@ TrackSel::TrackSel() widget_manager->breakLine(); widget_manager->addTextWgt( WTOK_AUTHOR, 80, 9, _("No track selected") ); - + widget_manager->hideWgtRect(WTOK_AUTHOR); widget_manager->layout(WGT_AREA_TOP); }