NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_pausewindow.hpp
1#pragma once
2#include <game/bases/d_base.hpp>
3#include <game/bases/d_lytbase.hpp>
5
6/// @brief Display a menu that appears when the game is paused inside a course.
7/// @details Note that this is not responsible for the confirmation menu,
8/// just for the two menu buttons "Continue" and "Exit".
9/// ## States
10/// @statetable
11/// @ingroup bases
12class Pausewindow_c : public dBase_c {
13public:
14
15 /// @brief The text boxes used in the layout.
16 /// @unofficial
17 enum T_PANE_e {
18 T_tuzukeru_00, T_tuzukeru_01,
19 T_modoru_00, T_modoru_01,
20 T_worldNum_00,
21 T_corseNum_00,
22 T_corsePic_00,
23 T_osusumeText_00,
24 T_COUNT
25 };
26
27 /// @brief The null panes used in the layout.
28 /// @unofficial
29 enum N_PANE_e {
30 N_worldText_00,
31 N_osusumeText_00,
32 N_multiText_00,
33 N_COUNT
34 };
35
36 /// @brief The picture panes used in the layout.
37 /// @unofficial
38 enum P_PANE_e {
39 P_SBBase_00,
40 P_SBBase_02,
41 P_shadowBlack,
42 P_coin_00,
43 P_COUNT
44 };
45
46 /// @brief The window panes used in the layout.
47 /// @unofficial
48 enum W_PANE_e {
49 W_N_pauseMenu_00,
50 W_COUNT
51 };
52
53 /// @brief The animation names used in the layout.
54 /// @unofficial
56 inWindow,
57 loopWindow,
58 outWindow,
59 onButton,
60 idleButton,
61 offButon,
62 hitButton,
63 ANIM_NAME_COUNT
64 };
65
66 /// @brief The animations used for the layout.
67 /// @unofficial
68 enum ANIM_e {
69 ANIM_IN_WINDOW, ANIM_LOOP_WINDOW, ANIM_OUT_WINDOW,
70 ANIM_ON_TUZUKU, ANIM_ON_MENU,
71 ANIM_IDLE_TUZUKU, ANIM_IDLE_MENU,
72 ANIM_OFF_TUZUKU, ANIM_OFF_MENU,
73 ANIM_HIT_TUZUKU, ANIM_HIT_MENU,
74 ANIM_COUNT
75 };
76
78 virtual ~Pausewindow_c();
79 virtual int create();
80 virtual int execute();
81 virtual int draw();
82 virtual int doDelete();
83
84private:
85 void setWorldCourseWrite(); ///< Sets the world number and course number / icon.
86 void TitleDispChkWrite(); ///< Sets the visibility of the panes based on the game mode.
87 void SelectCursorSetup(); ///< Sets up the cursor for the buttons.
88
89 STATE_FUNC_DECLARE(Pausewindow_c, InitWait); ///< Initial state. Switches to OpenAnimeEndWait immediately.
90 STATE_FUNC_DECLARE(Pausewindow_c, OpenAnimeEndWait); ///< Waiting for the window to finish the opening animation.
91 STATE_FUNC_DECLARE(Pausewindow_c, ButtonChangeAnimeEndWait); ///< Waiting for the button change animation to finish.
92 STATE_FUNC_DECLARE(Pausewindow_c, PauseDisp); ///< Showing the pause window.
93 STATE_FUNC_DECLARE(Pausewindow_c, HitAnimeEndWait); ///< Waiting for the button hit animation to finish and goes to ClouseAnimeEndWait after.
94 STATE_FUNC_DECLARE(Pausewindow_c, ClouseAnimeEndWait); ///< Waiting for the close animation to finish. Goes back to InitWait.
95
96 LytBase_c mLayout; ///< The layout for the window.
97
98 /// @brief The state manager for the window.
100
101 nw4r::lyt::Picture *mpPicturePanes[P_COUNT]; ///< The picture panes of the view.
102 nw4r::lyt::Window *mpWindowPanes[W_COUNT]; ///< The window panes of the view.
103 LytTextBox_c *mpTextBoxes[T_COUNT]; ///< The textboxes of the view.
104 nw4r::lyt::Pane *mpNullPanes[N_COUNT]; ///< The null panes of the view.
105
106public:
107 int mNextButton; ///< The button to be activated next (when the cursor moves).
108private:
109 int mActiveButton; ///< The button currently active.
110 int mColor; ///< The color of the window. Use a value from 0-3 (one per player).
111 bool mHasLoadedLayout; ///< Whether the layout has been loaded.
112 bool mIsActive; ///< Whether the window is currently open.
113
114public:
115 bool mClose; ///< Whether the window was closed via the back button.
116 bool mButtonHit; ///< Whether one of the buttons was hit.
117 bool mIsAnimating; ///< Whether an animation is currently playing.
118 bool mToTitle; ///< Whether to show "Title Screen" instead of "Exit". [This seems to never be set in-game].
119
120 static Pausewindow_c *m_instance; ///< The static instance of the pause window.
121};
Display a menu that appears when the game is paused inside a course.
nw4r::lyt::Pane * mpNullPanes[N_COUNT]
The null panes of the view.
ANIM_NAME_e
The animation names used in the layout.
ANIM_e
The animations used for the layout.
virtual int create()
do method for the create operation.
virtual int draw()
do method for the draw operation.
static Pausewindow_c * m_instance
The static instance of the pause window.
int mColor
The color of the window. Use a value from 0-3 (one per player).
sFStateMgr_c< Pausewindow_c, sStateMethodUsr_FI_c > mStateMgr
The state manager for the window.
void setWorldCourseWrite()
Sets the world number and course number / icon.
bool mButtonHit
Whether one of the buttons was hit.
void SelectCursorSetup()
Sets up the cursor for the buttons.
N_PANE_e
The null panes used in the layout.
W_PANE_e
The window panes used in the layout.
nw4r::lyt::Window * mpWindowPanes[W_COUNT]
The window panes of the view.
bool mHasLoadedLayout
Whether the layout has been loaded.
int mNextButton
The button to be activated next (when the cursor moves).
virtual int doDelete()
do method for the delete operation.
virtual int execute()
do method for the execute operation.
bool mClose
Whether the window was closed via the back button.
bool mIsActive
Whether the window is currently open.
void TitleDispChkWrite()
Sets the visibility of the panes based on the game mode.
LytTextBox_c * mpTextBoxes[T_COUNT]
The textboxes of the view.
bool mToTitle
Whether to show "Title Screen" instead of "Exit". [This seems to never be set in-game].
nw4r::lyt::Picture * mpPicturePanes[P_COUNT]
The picture panes of the view.
T_PANE_e
The text boxes used in the layout.
LytBase_c mLayout
The layout for the window.
int mActiveButton
The button currently active.
P_PANE_e
The picture panes used in the layout.
bool mIsAnimating
Whether an animation is currently playing.
dBase_c()
Constructs a new base.
Definition d_base.cpp:13
A wrapper for sStateMgr_c that uses sFStateFct_c and sStateIDChk_c.
#define STATE_FUNC_DECLARE(class, name)
Declares a state.
Definition s_State.hpp:12