NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_SmallScore.hpp
1#pragma once
2#include <game/bases/d_resource.hpp>
3#include <game/bases/d_lytbase.hpp>
4#include <game/mLib/m_vec.hpp>
5#include <nw4r/lyt.h>
6
7
8class dSmallScore_c {
9public:
10 enum STATE_e {
11 STATE_MAKE_START = 0,
12 STATE_UP_MOVE = 1,
13 STATE_DISP_WAIT = 2,
14 STATE_GOAL_DISP = 3,
15 STATE_NONE = 4
16 };
17
18 /// @brief The different types of the small score popups.
20 POPUP_TYPE_100, ///< The number 100.
21 POPUP_TYPE_200, ///< The number 200.
22 POPUP_TYPE_400, ///< The number 400.
23 POPUP_TYPE_800, ///< The number 800.
24 POPUP_TYPE_1000, ///< The number 1000.
25 POPUP_TYPE_2000, ///< The number 2000.
26 POPUP_TYPE_4000, ///< The number 4000.
27 POPUP_TYPE_8000, ///< The number 8000.
28 POPUP_TYPE_1, ///< The number 1, used for red coins and toad balloons.
29 POPUP_TYPE_2, ///< The number 2, used for red coins and toad balloons.
30 POPUP_TYPE_3, ///< The number 3, used for red coins and toad balloons.
31 POPUP_TYPE_4, ///< The number 4, used for red coins and toad balloons.
32 POPUP_TYPE_5, ///< The number 5, used for red coins and toad balloons.
33 POPUP_TYPE_6, ///< The number 6, used for red coins and toad balloons.
34 POPUP_TYPE_7, ///< The number 7, used for red coins and toad balloons.
35 POPUP_TYPE_8, ///< The number 8, used for red coins and toad balloons.
36 POPUP_TYPE_1UP, ///< The text "1-UP".
37 POPUP_TYPE_2UP, ///< The text "2-UP".
38 POPUP_TYPE_3UP, ///< The text "3-UP".
39 POPUP_TYPE_4UP, ///< The text "4-UP".
40 POPUP_TYPE_1UP_COLOR_CHANGE, ///< The text "1-UP", but changes color (see chgColor). Used when a 1-UP is awarded to multiple players.
41 POPUP_TYPE_COIN_2, ///< [Coin icon]x2. Used in Coin Battle.
42 POPUP_TYPE_COIN_3, ///< [Coin icon]x3. Used in Coin Battle.
43 POPUP_TYPE_COIN_5, ///< [Coin icon]x5. Used in Coin Battle.
44 POPUP_TYPE_COIN_10, ///< [Coin icon]x10. Used in Coin Battle.
45 POPUP_TYPE_COIN_15, ///< [Coin icon]x15. Used in Coin Battle.
46 POPUP_TYPE_COIN_20 ///< [Coin icon]x20. Used in Coin Battle.
47 };
48
49 typedef void (dSmallScore_c::*ProcFunc)();
50
52 virtual ~dSmallScore_c();
53
54 bool createLayout(d2d::ResAccMultLoader_c *);
55 void execute();
56 void draw();
57 bool doDelete();
58
59 void setPlayer1upColor(int);
60 void setPlayer1000Color(int);
61 void setPlayer100Color(int);
62 void chgColor();
63
64 void setNormalOrBlueColor();
65
66 void ScissorMaskSet();
67 void BigSmallAnime();
68
69 void MakeStart();
70 void UpMove();
71 void DispWait();
72 void GoalScoreDisp();
73
74 void PositionSet();
75 void CreateSmallScore(const mVec3_c &, int, int);
76 void PosSet(const mVec3_c &);
77
78 void setClipScale(mVec2_c v) { mClipScale = v; }
79
80 LytBase_c mLayout;
81 mVec2_c mPos;
82 mVec2_c mPosDelta;
83 mVec2_c mPosDeceleration;
84 mVec2_c mPosOffset;
85 mVec2_c mScale;
86 mVec2_c mClipScale;
87 mVec2_c mAnimScale;
88 nw4r::lyt::Pane *mpRootPane;
89 LytTextBox_c *T_100_00;
90 LytTextBox_c *T_1000_00;
91 LytTextBox_c *T_red2_00;
92 LytTextBox_c *T_1UP_00;
93 LytTextBox_c *T_coin_x_00;
94 LytTextBox_c *T_coinPoint_00;
95 nw4r::lyt::Pane *N_coin_00;
96 float mMaxHeight;
97 STATE_e mState; ///< Determines the state the score popup is in
98 int mPopupType;
99 int mDispWaitCounter; ///< Counter that is incremented every frame while in the 'DispWait' state
100 int mDispWaitTime; ///< Number of frames to wait in 'DispWait' (unless mPlayerType is 4, in which case the default value is 60)
101 int mPlayerType;
102 int mChgColorCounter; ///< Counter that is incremented every call to dSmallScore_c::chgColor(), which ensures that the 1-up color is only set once every 10 calls.
103 u32 mPlayerColor;
104 int mAnimCounter;
105 u32 mCurTextbox;
106 bool mIsGoalScore;
107 bool mInitialized;
108 bool mEnableColorChange;
109 bool mEnableBigSmallAnim;
110 bool mAnimIsShrinking;
111 bool mHasBlueColor;
112
113 /// @brief Gets the n-th text box.
114 LytTextBox_c *getTextBox(int n) { return (&T_100_00)[n]; }
115
116 static dSmallScore_c *m_instance;
117
118};
int mChgColorCounter
Counter that is incremented every call to dSmallScore_c::chgColor(), which ensures that the 1-up colo...
STATE_e mState
Determines the state the score popup is in.
POPUP_TYPE_e
The different types of the small score popups.
@ POPUP_TYPE_4UP
The text "4-UP".
@ POPUP_TYPE_1000
The number 1000.
@ POPUP_TYPE_5
The number 5, used for red coins and toad balloons.
@ POPUP_TYPE_8000
The number 8000.
@ POPUP_TYPE_200
The number 200.
@ POPUP_TYPE_COIN_15
[Coin icon]x15. Used in Coin Battle.
@ POPUP_TYPE_1UP_COLOR_CHANGE
The text "1-UP", but changes color (see chgColor). Used when a 1-UP is awarded to multiple players.
@ POPUP_TYPE_COIN_10
[Coin icon]x10. Used in Coin Battle.
@ POPUP_TYPE_1UP
The text "1-UP".
@ POPUP_TYPE_COIN_3
[Coin icon]x3. Used in Coin Battle.
@ POPUP_TYPE_6
The number 6, used for red coins and toad balloons.
@ POPUP_TYPE_COIN_5
[Coin icon]x5. Used in Coin Battle.
@ POPUP_TYPE_3UP
The text "3-UP".
@ POPUP_TYPE_1
The number 1, used for red coins and toad balloons.
@ POPUP_TYPE_2
The number 2, used for red coins and toad balloons.
@ POPUP_TYPE_4
The number 4, used for red coins and toad balloons.
@ POPUP_TYPE_2000
The number 2000.
@ POPUP_TYPE_COIN_20
[Coin icon]x20. Used in Coin Battle.
@ POPUP_TYPE_400
The number 400.
@ POPUP_TYPE_8
The number 8, used for red coins and toad balloons.
@ POPUP_TYPE_7
The number 7, used for red coins and toad balloons.
@ POPUP_TYPE_2UP
The text "2-UP".
@ POPUP_TYPE_3
The number 3, used for red coins and toad balloons.
@ POPUP_TYPE_COIN_2
[Coin icon]x2. Used in Coin Battle.
@ POPUP_TYPE_4000
The number 4000.
@ POPUP_TYPE_800
The number 800.
@ POPUP_TYPE_100
The number 100.
int mDispWaitCounter
Counter that is incremented every frame while in the 'DispWait' state.
int mDispWaitTime
Number of frames to wait in 'DispWait' (unless mPlayerType is 4, in which case the default value is 6...
LytTextBox_c * getTextBox(int n)
Gets the n-th text box.
A two-dimensional floating point vector.
Definition m_vec.hpp:9
A three-dimensional floating point vector.
Definition m_vec.hpp:100