Added a simple screen for feedback when the race starts.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1755 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
cosmosninja
2008-04-27 07:35:02 +00:00
parent 1d1aa18f35
commit 146c058ab1
6 changed files with 96 additions and 1 deletions

View File

@@ -119,6 +119,7 @@ supertuxkart_SOURCES = main.cpp \
gui/race_options.cpp gui/race_options.hpp \
gui/char_sel.cpp gui/char_sel.hpp \
gui/leader_result.cpp gui/leader_result.hpp \
gui/start_race_feedback.cpp gui/start_race_feedback.hpp \
gui/main_menu.cpp gui/main_menu.hpp \
gui/help_page_one.cpp gui/help_page_one.hpp \
gui/help_page_two.cpp gui/help_page_two.hpp \

View File

@@ -53,6 +53,7 @@
#include "challenges_menu.hpp"
#include "feature_unlocked.hpp"
#include "leader_result.hpp"
#include "start_race_feedback.hpp"
using namespace std;
@@ -233,6 +234,8 @@ void MenuManager::update()
case MENUID_CREDITS:
m_current_menu = new CreditsMenu();
break;
case MENUID_START_RACE_FEEDBACK:
m_current_menu = new StartRaceFeedback();
default:
break;
} // switch

View File

@@ -45,6 +45,7 @@ enum MenuManagerIDs
MENUID_EXITGAME,
MENUID_GRANDPRIXSELECT,
MENUID_UNLOCKED_FEATURE,
MENUID_START_RACE_FEEDBACK,
// menu configuration
MENUID_CONFIG_DISPLAY,

View File

@@ -234,7 +234,7 @@ void RaceOptions::select()
race_manager->setNumLaps( m_num_laps );
}
race_manager->startNew();
menu_manager->pushMenu(MENUID_START_RACE_FEEDBACK);
break;
case WTOK_QUIT:
menu_manager->popMenu();

View File

@@ -0,0 +1,57 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2006 SuperTuxKart-Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <SDL/SDL.h>
#include "widget_manager.hpp"
#include "race_manager.hpp"
#include "translation.hpp"
#include "start_race_feedback.hpp"
enum WidgetTokens
{
WTOK_MSG
};
StartRaceFeedback::StartRaceFeedback()
{
//Add some feedback so people know they are going to start the race
widget_manager->reset();
widget_manager->addTextWgt( WTOK_MSG, 60, 7, _("Loading race...") );
widget_manager->layout(WGT_AREA_ALL);
}
//-----------------------------------------------------------------------------
StartRaceFeedback::~StartRaceFeedback()
{
widget_manager->reset();
}
//-----------------------------------------------------------------------------
void StartRaceFeedback::update( const float DELTA )
{
widget_manager->update(0.0f);
//I consider that in this case, a static variable is cleaner than a
//member variable of this class. -Coz
static bool updated = false;
if( updated == true ) race_manager->startNew();
else updated = true;
}

View File

@@ -0,0 +1,33 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2006 SuperTuxKart-Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef HEADER_START_RACE_FEEDBACK_H
#define HEADER_START_RACE_FEEDBACK_H
#include "base_gui.hpp"
class StartRaceFeedback: public BaseGUI
{
public:
StartRaceFeedback();
~StartRaceFeedback();
void update( const float DELTA );
void select(){};
};
#endif