Back to index

supertuxkart  0.5+dfsg1
help_page_three.cpp
Go to the documentation of this file.
00001 //  $Id: help_menu.cpp 812 2006-10-07 11:43:57Z hiker $
00002 //
00003 //  SuperTuxKart - a fun racing game with go-kart
00004 //  Copyright (C) 2006 Joerg Henrichs
00005 //
00006 //  This program is free software; you can redistribute it and/or
00007 //  modify it under the terms of the GNU General Public License
00008 //  as published by the Free Software Foundation; either version 2
00009 //  of the License, or (at your option) any later version.
00010 //
00011 //  This program is distributed in the hope that it will be useful,
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //  GNU General Public License for more details.
00015 //
00016 //  You should have received a copy of the GNU General Public License
00017 //  along with this program; if not, write to the Free Software
00018 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 
00020 #include "help_page_three.hpp"
00021 #include "widget_manager.hpp"
00022 #include "race_manager.hpp"
00023 #include "menu_manager.hpp"
00024 #include "user_config.hpp"
00025 #include "player.hpp"
00026 #include "collectable_manager.hpp"
00027 #include "material.hpp"
00028 #include "translation.hpp"
00029 #include "unlock_manager.hpp"
00030 
00031 enum WidgetTokens
00032 {
00033     WTOK_TITLE,
00034 
00035     WTOK_TXT1,
00036     WTOK_TXT2,
00037     WTOK_TXT3,
00038     WTOK_TXT4,
00039 
00040     WTOK_SECOND_PAGE,
00041     WTOK_QUIT
00042 };
00043 
00044 HelpPageThree::HelpPageThree()
00045 {
00046     widget_manager->switchOrder();
00047     widget_manager->addTitleWgt( WTOK_TITLE, 100, 8, _("Game modes"));
00048 
00049     widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 100, 2 );
00050 
00051     if(!unlock_manager->isLocked("grandprix"))
00052     {
00053         widget_manager->addTextWgt( WTOK_TXT1, 100, 15,
00054             _("Grand Prix: Win victory points \n\
00055 by racing through a group of tracks,  \n\
00056 most points wins (shortest time in case of a tie!)          "));
00057         widget_manager->setWgtTextSize( WTOK_TXT1, WGT_FNT_SML );
00058         widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 100, 1 );
00059     }
00060 
00061     widget_manager->addTextWgt( WTOK_TXT2, 100, 15,
00062         _("Quick race: Pick a single track, shortest time wins.         "));
00063         widget_manager->setWgtTextSize( WTOK_TXT2, WGT_FNT_SML );
00064     widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 100, 1 );
00065 
00066     widget_manager->addTextWgt( WTOK_TXT3, 100, 15,
00067         _("Time Trial: As quick race, but no items.                       "));
00068         widget_manager->setWgtTextSize( WTOK_TXT3, WGT_FNT_SML );
00069     widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 100, 1 );
00070 
00071     if(!unlock_manager->isLocked("followleader"))
00072     {
00073         widget_manager->addTextWgt( WTOK_TXT4, 100, 15,
00074             _("Follow the leader: Stay behind the leader kart.                 \n\
00075 When the countdown reaches zero, a kart ahead\n\
00076 of the leader or the last kart is eliminated."));
00077         widget_manager->setWgtTextSize( WTOK_TXT4, WGT_FNT_SML );
00078         widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 100, 13 );
00079     }
00080 
00081     /*Buttons at the bottom*/
00082     widget_manager->addTextButtonWgt( WTOK_SECOND_PAGE, 25, 7,
00083         _("Previous help screen"));
00084     widget_manager->setWgtTextSize( WTOK_SECOND_PAGE, WGT_FNT_SML );
00085 
00086     widget_manager->addTextButtonWgt( WTOK_QUIT, 40, 7,
00087         _("Go back to the menu"));
00088     widget_manager->setWgtTextSize( WTOK_QUIT, WGT_FNT_SML );
00089 
00090     widget_manager->layout( WGT_AREA_TOP );
00091 }   // HelpMenu
00092 
00093 //-----------------------------------------------------------------------------
00094 HelpPageThree::~HelpPageThree()
00095 {
00096     widget_manager->reset();
00097 }   // ~HelpMenu
00098 
00099 //-----------------------------------------------------------------------------
00100 void HelpPageThree::select()
00101 {
00102     switch ( widget_manager->getSelectedWgt() )
00103     {
00104         case WTOK_SECOND_PAGE:
00105             menu_manager->popMenu();
00106             menu_manager->pushMenu(MENUID_HELP2);
00107             break;
00108 
00109         case WTOK_QUIT:
00110             menu_manager->popMenu();
00111             break;
00112     }
00113 }   // select
00114 
00115 /* EOF */