2009-10-04 19:59:05 -04:00
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
2015-03-29 20:31:42 -04:00
|
|
|
// Copyright (C) 2009-2015 Marianne Gagnon
|
2009-10-04 19:59:05 -04:00
|
|
|
//
|
|
|
|
// 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 3
|
|
|
|
// 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 "states_screens/help_screen_2.hpp"
|
|
|
|
|
|
|
|
#include "guiengine/widget.hpp"
|
2010-04-26 10:41:23 -04:00
|
|
|
#include "guiengine/widgets/ribbon_widget.hpp"
|
2010-08-14 21:15:19 -04:00
|
|
|
#include "states_screens/help_screen_1.hpp"
|
|
|
|
#include "states_screens/help_screen_3.hpp"
|
2010-09-19 15:22:43 -04:00
|
|
|
#include "states_screens/help_screen_4.hpp"
|
2016-10-28 03:47:36 -04:00
|
|
|
#include "states_screens/help_screen_5.hpp"
|
2009-10-04 19:59:05 -04:00
|
|
|
#include "states_screens/state_manager.hpp"
|
2010-03-18 14:18:19 -04:00
|
|
|
|
2009-10-04 19:59:05 -04:00
|
|
|
using namespace GUIEngine;
|
|
|
|
|
2010-03-18 14:18:19 -04:00
|
|
|
DEFINE_SCREEN_SINGLETON( HelpScreen2 );
|
|
|
|
|
2012-07-26 17:24:15 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
2010-03-18 14:18:19 -04:00
|
|
|
|
2009-10-04 19:59:05 -04:00
|
|
|
HelpScreen2::HelpScreen2() : Screen("help2.stkgui")
|
|
|
|
{
|
2010-08-14 21:15:19 -04:00
|
|
|
} // HelpScreen2
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2012-07-26 17:24:15 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2010-05-01 15:16:38 -04:00
|
|
|
void HelpScreen2::loadedFromFile()
|
|
|
|
{
|
2010-08-14 21:15:19 -04:00
|
|
|
} // loadedFromFile
|
2010-05-01 15:16:38 -04:00
|
|
|
|
2012-07-26 17:24:15 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
2010-05-01 15:16:38 -04:00
|
|
|
|
2009-10-28 19:04:38 -04:00
|
|
|
void HelpScreen2::eventCallback(Widget* widget, const std::string& name, const int playerID)
|
2009-10-04 19:59:05 -04:00
|
|
|
{
|
|
|
|
if (name == "category")
|
|
|
|
{
|
2014-07-15 21:11:46 -04:00
|
|
|
std::string selection = ((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2014-07-15 21:11:46 -04:00
|
|
|
Screen *screen = NULL;
|
|
|
|
if (selection == "page1")
|
|
|
|
screen = HelpScreen1::getInstance();
|
|
|
|
//else if (selection == "page2")
|
|
|
|
// screen = HelpScreen2::getInstance();
|
|
|
|
else if (selection == "page3")
|
|
|
|
screen = HelpScreen3::getInstance();
|
|
|
|
else if (selection == "page4")
|
|
|
|
screen = HelpScreen4::getInstance();
|
2016-10-28 03:47:36 -04:00
|
|
|
else if (selection == "page5")
|
|
|
|
screen = HelpScreen5::getInstance();
|
2014-07-15 21:11:46 -04:00
|
|
|
if(screen)
|
|
|
|
StateManager::get()->replaceTopMostScreen(screen);
|
2009-10-04 19:59:05 -04:00
|
|
|
}
|
|
|
|
else if (name == "back")
|
|
|
|
{
|
|
|
|
StateManager::get()->escapePressed();
|
|
|
|
}
|
2010-08-14 21:15:19 -04:00
|
|
|
} // eventCallback
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2012-07-26 17:24:15 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
2010-03-18 14:18:19 -04:00
|
|
|
|
2009-10-04 19:59:05 -04:00
|
|
|
void HelpScreen2::init()
|
|
|
|
{
|
2010-08-14 21:15:19 -04:00
|
|
|
Screen::init();
|
2009-10-04 19:59:05 -04:00
|
|
|
RibbonWidget* w = this->getWidget<RibbonWidget>("category");
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-04-08 17:02:40 -04:00
|
|
|
if (w != NULL) w->select( "page2", PLAYER_ID_GAME_MASTER );
|
2010-08-14 21:15:19 -04:00
|
|
|
} // init
|
2010-03-18 14:18:19 -04:00
|
|
|
|
2012-07-26 17:24:15 -04:00
|
|
|
// -----------------------------------------------------------------------------
|