Fixed handling of ESC (which previously would close the screen, without removing the

actual race result gui). ESC now allows some skipping of animations.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5776 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-08-25 13:54:28 +00:00
parent d6ab91d14d
commit a3dc17a7dd
2 changed files with 31 additions and 34 deletions

@ -42,17 +42,6 @@ RaceResultGUI::RaceResultGUI() : Screen("race_result.stkgui", /*pause race*/ fal
{
} // RaceResultGUI
//-----------------------------------------------------------------------------
/** Destructor. */
RaceResultGUI::~RaceResultGUI()
{
} // ~Racegui
//-----------------------------------------------------------------------------
void RaceResultGUI::loadedFromFile()
{
} // loadedFromFile
//-----------------------------------------------------------------------------
/** Besides calling init in the base class this makes all buttons of this
* screen invisible. The buttons will only displayed once the animation is
@ -221,20 +210,6 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget,
}
} // eventCallback
//-----------------------------------------------------------------------------
/** This function is called when one of the player presses 'fire'. The next
* phase of the animation will be displayed. E.g.
* in a GP: pressing fire while/after showing the latest race result will
* start the animation for the current GP result
* in a normal race: when pressing fire while an animation is played,
* start the menu showing 'rerun, new race, back to main' etc.
*/
void RaceResultGUI::nextPhase()
{
// This will trigger the next phase in the next render call.
// FIXME ... work in progress m_timer = 9999;
} // nextPhase
//-----------------------------------------------------------------------------
/** This determines the layout, i.e. the size of all columns, font size etc.
*/
@ -355,6 +330,33 @@ void RaceResultGUI::determineTableLayout()
} // determineTableLayout
//-----------------------------------------------------------------------------
/** This function is called when one of the player presses 'fire'. The next
* phase of the animation will be displayed. E.g.
* in a GP: pressing fire while/after showing the latest race result will
* start the animation for the current GP result
* in a normal race: when pressing fire while an animation is played,
* start the menu showing 'rerun, new race, back to main' etc.
*/
void RaceResultGUI::nextPhase()
{
// This will trigger the next phase in the next render call.
m_timer = 9999;
} // nextPhase
//-----------------------------------------------------------------------------
/** If escape is pressed, don't do the default option (close the screen), but
* advance to the next animation phase.
*/
bool RaceResultGUI::onEscapePressed()
{
nextPhase();
return false; // indicates 'do not close'
} // onEscapePressed
//-----------------------------------------------------------------------------
/** Called once a frame, this now triggers the rendering of the actual
* race result gui.
*/
void RaceResultGUI::onUpdate(float dt, irr::video::IVideoDriver*)
{
renderGlobal(dt);

@ -156,19 +156,14 @@ private:
public:
RaceResultGUI();
virtual ~RaceResultGUI();
virtual void renderGlobal(float dt);
/** \brief Implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile();
virtual void loadedFromFile() {};
/** \brief implement callback from parent class GUIEngine::Screen */
void init();
/** \brief implement callback from parent class GUIEngine::Screen */
void tearDown();
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void init();
virtual void tearDown();
virtual bool onEscapePressed();
void eventCallback(GUIEngine::Widget* widget, const std::string& name,
const int playerID);