Back to index

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

#include <options.hpp>

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

List of all members.

Public Member Functions

 Options ()
 ~Options ()
void select ()
void handle (GameAction, int)
virtual void update (float dt)
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

Detailed Description

Definition at line 25 of file options.hpp.


Constructor & Destructor Documentation

Definition at line 37 of file options.cpp.

{
    widget_manager->switchOrder();
    widget_manager->addTitleWgt( WTOK_TITLE, 45, 7, _("Options") );
    widget_manager->addTextButtonWgt( WTOK_CONTROLS, 45, 7, _("Player Config") );

    // Don't display the fullscreen menu when called from within the race.
    // The fullscreen mode will reload all textures, reload the models,
    // ... basically creating a big mess!!  (and all of this only thanks
    // to windows, who discards all textures, ...)
    if(!menu_manager->isSomewhereOnStack( MENUID_RACE ))
    {
        widget_manager->addTextButtonWgt( WTOK_DISPLAY, 45, 7, _("Display") );
    }

    widget_manager->addTextButtonWgt( WTOK_SOUND, 45, 7, _("Sound") );

    widget_manager->addEmptyWgt( WidgetManager::WGT_NONE, 1, 7 );

    widget_manager->addTextButtonWgt( WTOK_QUIT, 45, 7,
        _("Press <ESC> to go back") );
    widget_manager->setWgtTextSize( WTOK_QUIT, WGT_FNT_SML );

    widget_manager->layout(WGT_AREA_ALL);
}

Here is the call graph for this function:

Definition at line 64 of file options.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 Options::handle ( GameAction  action,
int  value 
) [virtual]

Reimplemented from BaseGUI.

Definition at line 95 of file options.cpp.

{
       // Save config on leave.
       if (!value && action == GA_LEAVE)
              user_config->saveConfig();

       BaseGUI::handle(action, value);
}

Here is the call 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 Options::select ( ) [virtual]

Implements BaseGUI.

Definition at line 70 of file options.cpp.

{
    switch ( widget_manager->getSelectedWgt() )
    {
    case WTOK_CONTROLS:
        menu_manager->pushMenu(MENUID_CONFIG_CONTROLS);
        break;
    case WTOK_DISPLAY:
        menu_manager->pushMenu(MENUID_CONFIG_DISPLAY);
        break;
    case WTOK_SOUND:
        menu_manager->pushMenu(MENUID_CONFIG_SOUND);
        break;
    case WTOK_QUIT:
        //FIXME: this shouldn't be in this screen
              // Make config changes permanent.
              user_config->saveConfig();

        menu_manager->popMenu();
        break;
    default:
        break;
    }  // switch
}

Here is the call graph for this function:

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 BaseGUI::update ( float  dt) [virtual, inherited]

Reimplemented in RaceGUI, CharSel, HelpPageOne, GrandPrixEnd, LeaderResult, GrandPrixSelect, ChallengesMenu, StartRaceFeedback, and TrackSel.

Definition at line 123 of file base_gui.cpp.

{
    widget_manager->update(dt);
}   // update

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.


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