2009-06-19 20:28:25 -04:00
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
|
|
|
// Copyright (C) 2009 Marianne Gagnon
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
2009-05-17 15:07:27 -04:00
|
|
|
#ifndef HEADER_CREDITS_HPP
|
|
|
|
#define HEADER_CREDITS_HPP
|
|
|
|
|
2009-06-11 06:00:43 -04:00
|
|
|
#include "irrlicht.h"
|
2009-10-04 19:59:05 -04:00
|
|
|
#include "guiengine/screen.hpp"
|
2009-06-02 08:37:29 -04:00
|
|
|
#include "utils/ptr_vector.hpp"
|
2009-05-17 15:07:27 -04:00
|
|
|
|
2010-04-23 16:48:56 -04:00
|
|
|
|
|
|
|
class CreditsSection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Screen where STK credits are shown
|
|
|
|
* \ingroup states_screens
|
|
|
|
*/
|
|
|
|
class CreditsScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<CreditsScreen>
|
2009-05-17 15:07:27 -04:00
|
|
|
{
|
2010-04-23 16:48:56 -04:00
|
|
|
float m_time_element;
|
|
|
|
|
2011-02-03 17:20:53 -05:00
|
|
|
PtrVector<CreditsSection, HOLD> m_sections;
|
2010-04-23 16:48:56 -04:00
|
|
|
CreditsSection* getCurrentSection();
|
|
|
|
|
2011-05-03 20:01:55 -04:00
|
|
|
int m_x, m_y, m_w, m_h;
|
2010-04-23 16:48:56 -04:00
|
|
|
core::rect< s32 > m_section_rect;
|
|
|
|
|
|
|
|
int m_curr_section;
|
|
|
|
int m_curr_element;
|
|
|
|
|
|
|
|
float time_before_next_step;
|
|
|
|
|
|
|
|
friend class GUIEngine::ScreenSingleton<CreditsScreen>;
|
|
|
|
CreditsScreen();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
void setArea(const int x, const int y, const int w, const int h);
|
|
|
|
|
|
|
|
// start from beginning again
|
|
|
|
void reset();
|
|
|
|
|
2010-05-01 15:16:38 -04:00
|
|
|
/** \brief implement callback from parent class GUIEngine::Screen */
|
|
|
|
virtual void loadedFromFile();
|
|
|
|
|
|
|
|
/** \brief implement optional callback from parent class GUIEngine::Screen */
|
2010-04-23 16:48:56 -04:00
|
|
|
void onUpdate(float dt, irr::video::IVideoDriver*);
|
|
|
|
|
2010-05-01 15:16:38 -04:00
|
|
|
/** \brief implement callback from parent class GUIEngine::Screen */
|
2010-04-23 16:48:56 -04:00
|
|
|
void init();
|
2010-05-01 15:16:38 -04:00
|
|
|
|
|
|
|
/** \brief implement callback from parent class GUIEngine::Screen */
|
2010-04-23 16:48:56 -04:00
|
|
|
void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
|
|
|
|
};
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2009-05-17 15:07:27 -04:00
|
|
|
#endif
|