bdd985c88a
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4929 178a84e3-b1eb-0310-8ba1-8eac791a3b58
98 lines
3.0 KiB
C++
98 lines
3.0 KiB
C++
#ifndef HEADER_FEATURE_UNLOCKED_HPP
|
|
#define HEADER_FEATURE_UNLOCKED_HPP
|
|
|
|
#include "guiengine/screen.hpp"
|
|
#include "utils/ptr_vector.hpp"
|
|
|
|
namespace irr { namespace scene { class ISceneNode; class ICameraSceneNode; class ILightSceneNode; } }
|
|
class KartProperties;
|
|
|
|
|
|
class FeatureUnlockedCutScene : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<FeatureUnlockedCutScene>
|
|
{
|
|
friend class GUIEngine::ScreenSingleton<FeatureUnlockedCutScene>;
|
|
|
|
FeatureUnlockedCutScene();
|
|
|
|
/** Whichever of these is non-null decides what comes out of the chest */
|
|
struct UnlockedThing
|
|
{
|
|
/** Will be non-null if this unlocked thing is a kart */
|
|
KartProperties* m_unlocked_kart;
|
|
|
|
/** Will be non-null if this unlocked thing is a picture */
|
|
irr::video::ITexture* m_picture;
|
|
/** Will be set if this unlocked thing is a picture */
|
|
float m_w, m_h;
|
|
|
|
/** Contains whatever is in the chest */
|
|
scene::ISceneNode* m_root_gift_node;
|
|
|
|
irr::core::stringw m_unlock_message;
|
|
|
|
UnlockedThing(KartProperties* kart, irr::core::stringw msg)
|
|
{
|
|
m_unlocked_kart = kart;
|
|
m_picture = NULL;
|
|
m_unlock_message = msg;
|
|
}
|
|
UnlockedThing(irr::video::ITexture* pict, float w, float h, irr::core::stringw msg)
|
|
{
|
|
m_unlocked_kart = NULL;
|
|
m_picture = pict;
|
|
m_w = w;
|
|
m_h = h;
|
|
m_unlock_message = msg;
|
|
}
|
|
~UnlockedThing()
|
|
{
|
|
if (m_root_gift_node != NULL) irr_driver->removeNode(m_root_gift_node);
|
|
m_root_gift_node = NULL;
|
|
}
|
|
};
|
|
ptr_vector<UnlockedThing, HOLD> m_unlocked_stuff;
|
|
|
|
|
|
/** sky angle, 0-360 */
|
|
float m_sky_angle;
|
|
|
|
/** Global evolution of time */
|
|
double m_global_time;
|
|
|
|
/** Key position from origin (where the chest is) */
|
|
float m_key_pos;
|
|
|
|
/** Angle of the key (from 0 to 1, simply traces progression) */
|
|
float m_key_angle;
|
|
|
|
irr::scene::ISceneNode* m_sky;
|
|
irr::scene::ICameraSceneNode* m_camera;
|
|
irr::scene::IAnimatedMeshSceneNode* m_chest;
|
|
//irr::scene::ISceneNode* m_chest_top;
|
|
//irr::scene::ISceneNode* m_key;
|
|
irr::scene::ILightSceneNode* m_light;
|
|
|
|
void continueButtonPressed();
|
|
|
|
public:
|
|
|
|
void onUpdate(float dt, irr::video::IVideoDriver*);
|
|
|
|
void init();
|
|
void tearDown();
|
|
|
|
void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
|
|
|
|
/** Call before showing up the screen to make a kart come out of the chest */
|
|
void addUnlockedKart(KartProperties* unlocked_kart, irr::core::stringw msg);
|
|
|
|
/** Call before showing up the screen to make a picture come out of the chest */
|
|
void addUnlockedPicture(irr::video::ITexture* picture, float w, float h, irr::core::stringw msg);
|
|
|
|
/** override from base class to handle escape press */
|
|
virtual bool onEscapePressed();
|
|
};
|
|
|
|
#endif
|
|
|