Merge remote-tracking branch 'lpw/malice'

This commit is contained in:
Benau 2016-11-05 11:25:19 +08:00
commit 0c0581f97a
12 changed files with 204 additions and 3 deletions

View File

@ -13,6 +13,8 @@
I18N="Tab in help menu" text="Game Modes"/>
<icon-button id="page4" width="128" height="128" icon="gui/options_input.png"
I18N="Tab in help menu" text="Multi-player"/>
<icon-button id="page5" width="128" height="128" icon="gui/banana.png"
I18N="Tab in help menu" text="Bananas"/>
</tabs>
<box proportion="1" width="100%" layout="vertical-row">

View File

@ -13,6 +13,8 @@
I18N="Tab in help menu" text="Game Modes"/>
<icon-button id="page4" width="128" height="128" icon="gui/options_input.png"
I18N="Tab in help menu" text="Multi-player"/>
<icon-button id="page5" width="128" height="128" icon="gui/banana.png"
I18N="Tab in help menu" text="Bananas"/>
</tabs>
<box proportion="1" width="100%" layout="vertical-row">

View File

@ -13,6 +13,8 @@
I18N="Tab in help menu" text="Game Modes"/>
<icon-button id="page4" width="128" height="128" icon="gui/options_input.png"
I18N="Tab in help menu" text="Multi-player"/>
<icon-button id="page5" width="128" height="128" icon="gui/banana.png"
I18N="Tab in help menu" text="Bananas"/>
</tabs>
<box proportion="1" width="100%" layout="vertical-row">

View File

@ -13,6 +13,8 @@
I18N="Tab in help menu" text="Game Modes"/>
<icon-button id="page4" width="128" height="128" icon="gui/options_input.png"
I18N="Tab in help menu" text="Multi-player"/>
<icon-button id="page5" width="128" height="128" icon="gui/banana.png"
I18N="Tab in help menu" text="Bananas"/>
</tabs>
<box proportion="1" width="100%" layout="vertical-row">

49
data/gui/help5.stkgui Normal file
View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<stkgui>
<div x="1%" y="1%" width="98%" height="98%" layout="vertical-row" >
<header align="center" width="80%" text="SuperTuxKart Help" text_align="center"/>
<spacer height="15" width="10"/>
<tabs id="category" height="10%" max_height="110" x="2%" width="98%" align="center">
<icon-button id="page1" width="100" height="128" icon="gui/track_random.png"
I18N="Tab in help menu" text="General"/>
<icon-button id="page2" width="100" height="128" icon="gui/weapons.png"
I18N="Tab in help menu" text="Weapons"/>
<icon-button id="page3" width="100" height="128" icon="gui/mode_ftl.png"
I18N="Tab in help menu" text="Game Modes"/>
<icon-button id="page4" width="100" height="128" icon="gui/options_input.png"
I18N="Tab in help menu" text="Multi-player"/>
<icon-button id="page5" width="100" height="128" icon="gui/banana.png"
I18N="Tab in help menu" text="Bananas"/>
</tabs>
<box proportion="1" width="100%" layout="vertical-row">
<label align="center" text="Hitting a banana can result in one of the following being attached to the kart:"/>
<div width="100%" proportion="2" layout="horizontal-row">
<icon align="center" width="64" height="64" icon="models/anchor-icon.png"/>
<spacer width="64" height="64"/>
<bubble proportion="1" height="100%"
I18N="In the help menu"
text="Anchor - slows down the kart."/>
</div>
<div width="100%" proportion="2" layout="horizontal-row">
<icon align="center" width="64" height="64" icon="models/parachute-icon.png"/>
<spacer width="64" height="64"/>
<bubble proportion="1" height="100%"
I18N="In the help menu"
text="Parachute - slows down the kart less than the anchor."/>
</div>
<div width="100%" proportion="2" layout="horizontal-row">
<icon align="center" width="128" height="128" icon="models/bomb-attach-icon.png"/>
<bubble proportion="1" height="100%"
I18N="In the help menu"
text="Bomb - detonates after a short amount of time to throw the kart up in the air. Bump into another kart to transfer the bomb to another player."/>
</div>
</box>
</div>
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
</stkgui>

View File

@ -31,6 +31,7 @@
#include "states_screens/help_screen_2.hpp"
#include "states_screens/help_screen_3.hpp"
#include "states_screens/help_screen_4.hpp"
#include "states_screens/help_screen_5.hpp"
#include "states_screens/state_manager.hpp"
using namespace GUIEngine;
@ -101,6 +102,8 @@ void HelpScreen1::eventCallback(Widget* widget, const std::string& name, const i
screen = HelpScreen3::getInstance();
else if (selection == "page4")
screen = HelpScreen4::getInstance();
else if (selection == "page5")
screen = HelpScreen5::getInstance();
if(screen)
StateManager::get()->replaceTopMostScreen(screen);
}

View File

@ -22,6 +22,7 @@
#include "states_screens/help_screen_1.hpp"
#include "states_screens/help_screen_3.hpp"
#include "states_screens/help_screen_4.hpp"
#include "states_screens/help_screen_5.hpp"
#include "states_screens/state_manager.hpp"
using namespace GUIEngine;
@ -57,6 +58,8 @@ void HelpScreen2::eventCallback(Widget* widget, const std::string& name, const i
screen = HelpScreen3::getInstance();
else if (selection == "page4")
screen = HelpScreen4::getInstance();
else if (selection == "page5")
screen = HelpScreen5::getInstance();
if(screen)
StateManager::get()->replaceTopMostScreen(screen);
}

View File

@ -23,6 +23,7 @@
#include "states_screens/help_screen_1.hpp"
#include "states_screens/help_screen_2.hpp"
#include "states_screens/help_screen_4.hpp"
#include "states_screens/help_screen_5.hpp"
#include "states_screens/state_manager.hpp"
using namespace GUIEngine;
@ -59,6 +60,8 @@ void HelpScreen3::eventCallback(Widget* widget, const std::string& name, const i
// screen = HelpScreen3::getInstance();
else if (selection == "page4")
screen = HelpScreen4::getInstance();
else if (selection == "page5")
screen = HelpScreen5::getInstance();
if(screen)
StateManager::get()->replaceTopMostScreen(screen);
}

View File

@ -23,6 +23,7 @@
#include "states_screens/help_screen_1.hpp"
#include "states_screens/help_screen_2.hpp"
#include "states_screens/help_screen_3.hpp"
#include "states_screens/help_screen_5.hpp"
#include "states_screens/state_manager.hpp"
using namespace GUIEngine;
@ -59,6 +60,8 @@ void HelpScreen4::eventCallback(Widget* widget, const std::string& name, const i
screen = HelpScreen3::getInstance();
//else if (selection == "page4")
// screen = HelpScreen4::getInstance();
else if (selection == "page5")
screen = HelpScreen5::getInstance();
if(screen)
StateManager::get()->replaceTopMostScreen(screen);
}

View File

@ -0,0 +1,83 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2016 C. Michael Murphey
//
// 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_5.hpp"
#include "guiengine/widget.hpp"
#include "guiengine/widgets/ribbon_widget.hpp"
#include "states_screens/help_screen_1.hpp"
#include "states_screens/help_screen_2.hpp"
#include "states_screens/help_screen_3.hpp"
#include "states_screens/help_screen_4.hpp"
#include "states_screens/state_manager.hpp"
using namespace GUIEngine;
DEFINE_SCREEN_SINGLETON( HelpScreen5 );
// -----------------------------------------------------------------------------
HelpScreen5::HelpScreen5() : Screen("help5.stkgui")
{
} // HelpScreen5
// -----------------------------------------------------------------------------
void HelpScreen5::loadedFromFile()
{
} // loadedFromFile
// -----------------------------------------------------------------------------
void HelpScreen5::eventCallback(Widget* widget, const std::string& name, const int playerID)
{
if (name == "category")
{
std::string selection = ((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER);
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();
//else if (selection == "page5")
// screen = HelpScreen5::getInstance();
if(screen)
StateManager::get()->replaceTopMostScreen(screen);
}
else if (name == "back")
{
StateManager::get()->escapePressed();
}
} // eventCallback
// -----------------------------------------------------------------------------
void HelpScreen5::init()
{
Screen::init();
RibbonWidget* w = this->getWidget<RibbonWidget>("category");
if (w != NULL) w->select( "page5", PLAYER_ID_GAME_MASTER );
} // init
// -----------------------------------------------------------------------------

View File

@ -0,0 +1,49 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2016 C. Michael Murphey
//
// 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.
#ifndef HEADER_HELP_SCREEN_5_HPP
#define HEADER_HELP_SCREEN_5_HPP
#include "guiengine/screen.hpp"
namespace GUIEngine { class Widget; }
/**
* \brief Help screen, part 5
* \ingroup states_screens
*/
class HelpScreen5 : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<HelpScreen5>
{
friend class GUIEngine::ScreenSingleton<HelpScreen5>;
HelpScreen5();
public:
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
const int playerID) OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void init() OVERRIDE;
};
#endif