Back to index

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

#include <help_page_two.hpp>

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

List of all members.

Public Member Functions

 HelpPageTwo ()
 ~HelpPageTwo ()
void select ()
virtual void update (float dt)
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

Detailed Description

Definition at line 26 of file help_page_two.hpp.


Constructor & Destructor Documentation

Definition at line 47 of file help_page_two.cpp.

{
    //FIXME: instead of using setInitialTextState, the gui & widget manager macros should improve it's design
    widget_manager->setInitialTextState
    (
        false,
        "",
        WGT_FNT_SML,
        WGT_FONT_GUI,
        WGT_WHITE,
        false
    );

    widget_manager->addTextWgt( WTOK_MSG, 100, 7,
        _("To help you win, there are certain collectables you can grab:"));
    widget_manager->breakLine();

    widget_manager->addImgWgt( WTOK_IMG1, 10, 12,
        collectable_manager->getIcon(COLLECT_MISSILE)->getState()->getTextureHandle());

    widget_manager->addTextWgt( WTOK_TXT1, 90, 12,
        _("Missile - fast stopper in a straight line"));
    widget_manager->setWgtRoundCorners( WTOK_TXT1, WGT_AREA_RGT );
    widget_manager->breakLine();

    widget_manager->addImgWgt(WTOK_IMG2, 10, 12,
        collectable_manager->getIcon(COLLECT_HOMING)->getState()->getTextureHandle());

    widget_manager->addTextWgt(WTOK_TXT2, 90, 12,
        _("Homing missile - follows rivals, but is slower than the missile"));
    widget_manager->setWgtRoundCorners( WTOK_TXT2, WGT_AREA_RGT );
    widget_manager->breakLine();

    widget_manager->addImgWgt(WTOK_IMG3, 10, 12,
        collectable_manager->getIcon(COLLECT_SPARK)->getState()->getTextureHandle());

    widget_manager->addTextWgt(WTOK_TXT3, 90, 12,
        _("Fuzzy blob/Spark - very slow, but bounces from walls"));
    widget_manager->setWgtRoundCorners( WTOK_TXT3, WGT_AREA_RGT );
    widget_manager->breakLine();

    widget_manager->addImgWgt(WTOK_IMG4, 10, 12,
        collectable_manager->getIcon(COLLECT_ZIPPER)->getState()->getTextureHandle());

    widget_manager->addTextWgt(WTOK_TXT4, 90, 12,
        _("Zipper - speed boost"));
    widget_manager->setWgtRoundCorners(WTOK_TXT4, WGT_AREA_RGT);
    widget_manager->breakLine();

    widget_manager->addImgWgt(WTOK_IMG5, 10, 12,
        collectable_manager->getIcon(COLLECT_PARACHUTE)->getState()->getTextureHandle());

    widget_manager->addTextWgt(WTOK_TXT5, 90, 12,
        _("Parachute - slows down all karts in a better position!"));
    widget_manager->setWgtRoundCorners(WTOK_TXT5, WGT_AREA_RGT);
    widget_manager->breakLine();

    widget_manager->addImgWgt(WTOK_IMG6, 10, 12,
        collectable_manager->getIcon(COLLECT_ANVIL)->getState()->getTextureHandle());

    widget_manager->addTextWgt(WTOK_TXT6, 90, 12,
        _("Anvil - slows down greatly the kart in the first position"));
    widget_manager->setWgtRoundCorners(WTOK_TXT6, WGT_AREA_RGT);
    widget_manager->breakLine();

    /*Buttons at the bottom*/
    widget_manager->addTextButtonWgt(WTOK_FIRST_PAGE, 40, 7,
        _("Previous screen"));
    widget_manager->breakLine();

    widget_manager->addTextButtonWgt(WTOK_THIRD_PAGE, 40, 7,
        _("Next help screen"));
    widget_manager->breakLine();

    widget_manager->addTextButtonWgt(WTOK_QUIT, 40, 7,
        _("Back to the menu"));

    widget_manager->layout( WGT_AREA_TOP );
}   // HelpMenu

Here is the call graph for this function:

Definition at line 128 of file help_page_two.cpp.

{
    widget_manager->reset();
}   // ~HelpMenu

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 HelpPageTwo::select ( ) [virtual]

Implements BaseGUI.

Definition at line 134 of file help_page_two.cpp.

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: