2009-10-03 21:16:00 -04:00
|
|
|
#ifndef HEADER_FEATURE_UNLOCKED_HPP
|
|
|
|
#define HEADER_FEATURE_UNLOCKED_HPP
|
|
|
|
|
2009-10-04 19:59:05 -04:00
|
|
|
#include "guiengine/screen.hpp"
|
2010-03-01 20:25:29 -05:00
|
|
|
#include "utils/ptr_vector.hpp"
|
2009-10-03 21:16:00 -04:00
|
|
|
|
2009-10-04 16:20:41 -04:00
|
|
|
namespace irr { namespace scene { class ISceneNode; class ICameraSceneNode; class ILightSceneNode; } }
|
2009-12-05 20:30:39 -05:00
|
|
|
class KartProperties;
|
|
|
|
|
2009-10-03 21:16:00 -04:00
|
|
|
|
2009-10-13 15:14:17 -04:00
|
|
|
class FeatureUnlockedCutScene : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<FeatureUnlockedCutScene>
|
2009-10-03 21:16:00 -04:00
|
|
|
{
|
2009-10-04 19:59:05 -04:00
|
|
|
friend class GUIEngine::ScreenSingleton<FeatureUnlockedCutScene>;
|
|
|
|
|
2009-10-03 21:16:00 -04:00
|
|
|
FeatureUnlockedCutScene();
|
|
|
|
|
2010-03-01 20:25:29 -05:00
|
|
|
/** Whichever of these is non-null decides what comes out of the chest */
|
|
|
|
struct UnlockedThing
|
|
|
|
{
|
|
|
|
KartProperties* m_unlocked_kart;
|
|
|
|
irr::video::ITexture* m_picture;
|
|
|
|
|
|
|
|
/** 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, irr::core::stringw msg)
|
|
|
|
{
|
|
|
|
m_unlocked_kart = NULL;
|
|
|
|
m_picture = pict;
|
|
|
|
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;
|
2009-12-05 20:30:39 -05:00
|
|
|
|
|
|
|
|
2009-10-04 16:20:41 -04:00
|
|
|
/** sky angle, 0-360 */
|
2009-12-05 20:30:39 -05:00
|
|
|
float m_sky_angle;
|
|
|
|
|
|
|
|
/** Global evolution of time */
|
|
|
|
double m_global_time;
|
2009-10-04 16:20:41 -04:00
|
|
|
|
|
|
|
/** 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;
|
2010-02-01 16:02:30 -05:00
|
|
|
irr::scene::IAnimatedMeshSceneNode* m_chest;
|
|
|
|
//irr::scene::ISceneNode* m_chest_top;
|
|
|
|
//irr::scene::ISceneNode* m_key;
|
2009-10-04 16:20:41 -04:00
|
|
|
irr::scene::ILightSceneNode* m_light;
|
2010-03-01 18:40:20 -05:00
|
|
|
|
|
|
|
void continueButtonPressed();
|
|
|
|
|
2009-10-03 21:16:00 -04:00
|
|
|
public:
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2009-10-03 21:16:00 -04:00
|
|
|
void onUpdate(float dt, irr::video::IVideoDriver*);
|
2009-10-04 19:59:05 -04:00
|
|
|
|
|
|
|
void init();
|
|
|
|
void tearDown();
|
|
|
|
|
2009-10-28 19:04:38 -04:00
|
|
|
void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
|
2009-12-05 20:30:39 -05:00
|
|
|
|
|
|
|
/** Call before showing up the screen to make a kart come out of the chest */
|
2010-03-01 20:25:29 -05:00
|
|
|
void addUnlockedKart(KartProperties* unlocked_kart, irr::core::stringw msg);
|
2009-12-05 20:30:39 -05:00
|
|
|
|
|
|
|
/** Call before showing up the screen to make a picture come out of the chest */
|
2010-03-01 20:25:29 -05:00
|
|
|
void addUnlockedPicture(irr::video::ITexture* picture, irr::core::stringw msg);
|
2010-03-01 18:40:20 -05:00
|
|
|
|
|
|
|
/** override from base class to handle escape press */
|
|
|
|
virtual bool onEscapePressed();
|
2009-10-03 21:16:00 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|