1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/********************************************************************
*
*	Created:	2/7/2012   10:54
*
*	File:		gfCRoundScoreGui.h
*
*	Author:		Mick Waites
*	
*	Purpose:	Screen to display the score at the end of a 
*				scene/mini game
*
*********************************************************************/

#ifndef gfCRoundScoreGuihdr
#define gfCRoundScoreGuihdr

#include "gfIRoundScoreGui.h"

class fsCRevealingTextSpriteComponent;

class gfCRoundScoreGui : public gfIRoundScoreGui
{
	friend class fsCComponentFactory;

public:

	static const fsCUniqueId mContinueGameMsg;
	static const fsCUniqueId mReplayLevelMsg;

	static const fsCUniqueId mTypeId;

	static fsBool miniGameCheck(const fsStr& pLevelName);
	static fsBool miniGameCheck();
	virtual void bonusesCalculate();

	void listenersRegisterDo() override;
	void listenersDeregisterDo() override;
	fsBool messageProcessDo(const fsCUniqueId& pMessageType,
	                        const fsIMessageDispatcher::sMessageParameters& pParam) override;

protected:

	void updateDo(fsS32 pDeltaMs) override;

	void serialiseDo() override;
	void deserialiseDo() override;

	static fsIComponent* create(fsCEntity* pParent);

	fsBool onButtonClicked(fsCButtonComponent* pButtonComp) override;

	void initialiseFromVariableTableDo(const fsCVariableTable& pVars) override;

	virtual ~gfCRoundScoreGui();<--- Destructor in derived class
	gfCRoundScoreGui(fsCEntity* pParent);


	void bonusCreate() override;


private:

	enum
	{
		eSTAGE_BRONZE_STAR = 0,
		eSTAGE_SILVER_STAR,
		eSTAGE_GOLD_STAR,

		eSTAGE_END_STARS_PADDING_EVEN,
		eSTAGE_END_STARS_PADDING,

		eSTAGE_BONUS0_TEXT,
		eSTAGE_BONUS0_VAL,
		eSTAGE_BONUS1_TEXT,
		eSTAGE_BONUS1_VAL,
		eSTAGE_BONUS2_TEXT,
		eSTAGE_BONUS2_VAL,
		eSTAGE_TOT_SCORE_TEXT,
		eSTAGE_TOT_SCORE_VAL,
		eSTAGE_BEST_SCORE_TEXT,
		eSTAGE_BEST_SCORE_VAL,

		eSTAGE_EXTREME_AWARD,

		eTOTAL_STAGES
	};

	enum
	{
		eSLOT_0 = 0,
		eSLOT_1,
		eSLOT_2,
		eSLOT_3,
		eSLOT_4
	};


	struct SGameSpecificBonus : public SBonus
	{
		enum eBONUS_TYPE
		{
			eROUND_COMPLETE = 0,
			eNO_HINTS,

			eTOTAL_BONUS,

			eTOTAL_TYPES
		};

		SGameSpecificBonus() :
			SBonus(eTOTAL_TYPES)
		{
		}
	};

	void timeSet(const fsStr& pSlotName, fsS32 pTimeSecs);
	void runningTimeSet();
	void shortCircuitStars();
	void shortCircuitText();
	void shortCircuit();

	void starShortCircuit(const fsStr& pStarName);
	void starHide(const fsStr& pName);
	void starUpdate(const fsStr& pStarName);
	void completionStarsHide();

	void continuesButtonHandle();
	void replayButtonHandle();

	void revealedBonusApplyToTotalScore();

	fsCRevealingTextSpriteComponent* currAnimTxtBoxGet(fsS32 pTextAnimStage);

	void hintAndContinueButtonsConfigure();

	fsS32 bonusItemScoreGet() const;

	void bonusTextUpdate();

	void slotScoreTextSet(fsS32 pSlot, fsS32 pScore, fsS32 pMaxScore);

	void hideSlot(fsS32 pSlot) const;
	void slotItemTextSet(fsS32 pSlot, const fsStr& pStrKey);


	void configure() override;

	fsBool hintBonusEarned() const;
	static fsBool hintBonusPossible();


	fsBool mMiniGame;

	fsS32 mPause;
	fsS32 mExitCountdown;

	fsS32 mTextAnimStage;

	fsBool mBonusesRevealed;
};

#endif