Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Protected Attributes | Private Attributes
StartRaceFeedback Class Reference

#include <start_race_feedback.hpp>

Inheritance diagram for StartRaceFeedback:
Inheritance graph
[legend]
Collaboration diagram for StartRaceFeedback:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StartRaceFeedback ()
 ~StartRaceFeedback ()
void update (float DELTA)
void select ()
virtual void handle (GameAction, int)
virtual void inputKeyboard (SDLKey, int)
virtual void countdown ()
void inputPointer (int x, int y)
void lockInput ()
void unlockInput ()
void TimeToString (const double time, char *s)

Protected Attributes

bool m_locked
int m_menu_id

Private Attributes

bool m_updated

Detailed Description

Definition at line 23 of file start_race_feedback.hpp.


Constructor & Destructor Documentation

Definition at line 31 of file start_race_feedback.cpp.

                                     : m_updated( false )
{
    //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);
}

Here is the call graph for this function:

Definition at line 40 of file start_race_feedback.cpp.

Here is the call graph for this function:


Member Function Documentation

void BaseGUI::countdown ( ) [virtual, inherited]

Reimplemented in DisplayResConfirm.

Definition at line 147 of file base_gui.cpp.

{
}
void BaseGUI::handle ( GameAction  action,
int  value 
) [virtual, inherited]

Reimplemented in RaceGUI, LeaderResult, PlayerControls, RaceResultsGUI, DisplayResConfirm, MainMenu, Options, and RaceMenu.

Definition at line 43 of file base_gui.cpp.

{
    if( m_locked ) return;

    // Skip on keypress, act on keyrelease only.
    if (value) return;

       int previous = widget_manager->getSelectedWgt();

    switch ( action )
    {
    case GA_CURSOR_LEFT:
              animateWidget(previous,
                                     widget_manager->handleLeft());

              break;
    case GA_CURSOR_RIGHT:
              animateWidget(previous,
                                     widget_manager->handleRight());
              break;
    case GA_CURSOR_UP:
              animateWidget(previous,
                                     widget_manager->handleUp());
              break;
    case GA_CURSOR_DOWN:
              animateWidget(previous,
                                     widget_manager->handleDown());
              break;
       case GA_INC_SCROLL_SPEED:
              widget_manager->increaseScrollSpeed();
              break;
       case GA_INC_SCROLL_SPEED_FAST:
              widget_manager->increaseScrollSpeed(true);
              break;
       case GA_DEC_SCROLL_SPEED:
              widget_manager->decreaseScrollSpeed();
              break;
       case GA_DEC_SCROLL_SPEED_FAST:
              widget_manager->decreaseScrollSpeed(true);
              break;
    case GA_ENTER:
        select();
        break;
    case GA_LEAVE:
        if (menu_manager->getMenuStackSize() > 1)
        {
           if(menu_manager->isCurrentMenu(MENUID_RACEMENU))
             world->unpause();

           menu_manager->popMenu();
        }
        break;

    default:
        break;
    }   // switch
}   // handle

Here is the call graph for this function:

Here is the caller graph for this function:

void BaseGUI::inputKeyboard ( SDLKey  ,
int   
) [virtual, inherited]

Reimplemented in PlayerControls.

Definition at line 139 of file base_gui.cpp.

{
       // This method is not supposed to be called since BaseGUI does not
       // handle low-level keyboard input.
       assert(false);
}

Here is the caller graph for this function:

void BaseGUI::inputPointer ( int  x,
int  y 
) [inherited]

Definition at line 102 of file base_gui.cpp.

{
    if( m_locked ) return;

    const int PREV_SELECTED_WGT = widget_manager->getSelectedWgt();
    const int SELECTED_WGT = widget_manager->handlePointer( x, y );

    if( SELECTED_WGT != WidgetManager::WGT_NONE )
    {
        if( PREV_SELECTED_WGT != WidgetManager::WGT_NONE )
        {
            widget_manager->darkenWgtColor( PREV_SELECTED_WGT );
        }

        widget_manager->lightenWgtColor( SELECTED_WGT );
        widget_manager->pulseWgt( SELECTED_WGT );
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void BaseGUI::lockInput ( ) [inline, inherited]

Definition at line 49 of file base_gui.hpp.

{ m_locked = true; }
void StartRaceFeedback::select ( ) [inline, virtual]

Implements BaseGUI.

Definition at line 32 of file start_race_feedback.hpp.

{};
void BaseGUI::TimeToString ( const double  time,
char *  s 
) [inherited]

Definition at line 130 of file base_gui.cpp.

{
    int min     = (int) floor ( TIME / 60.0 ) ;
    int sec     = (int) floor ( TIME - (double) ( 60 * min ) ) ;
    int tenths  = (int) floor ( 10.0f * (TIME - (double)(sec + 60* min)));
    sprintf ( s, "%d:%02d:%d", min,  sec,  tenths ) ;
}   // TimeToString

Here is the caller graph for this function:

void BaseGUI::unlockInput ( ) [inline, inherited]

Definition at line 50 of file base_gui.hpp.

{ m_locked = false; }
void StartRaceFeedback::update ( float  DELTA) [virtual]

Reimplemented from BaseGUI.

Definition at line 47 of file start_race_feedback.cpp.

{
    widget_manager->update(0.0f);

    //I consider that in this case, a static variable is cleaner than a
    //member variable of this class. -Coz
    if( m_updated == true ) race_manager->startNew();
    else m_updated = true;
}

Here is the call graph for this function:


Member Data Documentation

bool BaseGUI::m_locked [protected, inherited]

Definition at line 55 of file base_gui.hpp.

int BaseGUI::m_menu_id [protected, inherited]

Definition at line 56 of file base_gui.hpp.

Definition at line 25 of file start_race_feedback.hpp.


The documentation for this class was generated from the following files: