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