NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
Pausewindow_c Class Reference

#include <game/bases/d_pausewindow.hpp>

Inheritance diagram for Pausewindow_c:
[legend]

Description

Display a menu that appears when the game is paused inside a course.

Note that this is not responsible for the confirmation menu, just for the two menu buttons "Continue" and "Exit".

States

Definition at line 12 of file d_pausewindow.hpp.

Public Types

enum  T_PANE_e {
  T_tuzukeru_00 ,
  T_tuzukeru_01 ,
  T_modoru_00 ,
  T_modoru_01 ,
  T_worldNum_00 ,
  T_corseNum_00 ,
  T_corsePic_00 ,
  T_osusumeText_00 ,
  T_COUNT
}
 The text boxes used in the layout. More...
 
enum  N_PANE_e {
  N_worldText_00 ,
  N_osusumeText_00 ,
  N_multiText_00 ,
  N_COUNT
}
 The null panes used in the layout. More...
 
enum  P_PANE_e {
  P_SBBase_00 ,
  P_SBBase_02 ,
  P_shadowBlack ,
  P_coin_00 ,
  P_COUNT
}
 The picture panes used in the layout. More...
 
enum  W_PANE_e {
  W_N_pauseMenu_00 ,
  W_COUNT
}
 The window panes used in the layout. More...
 
enum  ANIM_NAME_e {
  inWindow ,
  loopWindow ,
  outWindow ,
  onButton ,
  idleButton ,
  offButon ,
  hitButton ,
  ANIM_NAME_COUNT
}
 The animation names used in the layout. More...
 
enum  ANIM_e {
  ANIM_IN_WINDOW ,
  ANIM_LOOP_WINDOW ,
  ANIM_OUT_WINDOW ,
  ANIM_ON_TUZUKU ,
  ANIM_ON_MENU ,
  ANIM_IDLE_TUZUKU ,
  ANIM_IDLE_MENU ,
  ANIM_OFF_TUZUKU ,
  ANIM_OFF_MENU ,
  ANIM_HIT_TUZUKU ,
  ANIM_HIT_MENU ,
  ANIM_COUNT
}
 The animations used for the layout. More...
 
- Public Types inherited from fBase_c
enum  LIFECYCLE_e {
  CREATING ,
  ACTIVE ,
  DELETING
}
 The possible lifecycle states. More...
 
enum  GROUP_TYPE_e {
  OTHER ,
  SCENE ,
  ACTOR
}
 The possible group types. More...
 
enum  MAIN_STATE_e {
  CANCELED ,
  ERROR ,
  SUCCESS ,
  WAITING
}
 The possible operation results. More...
 
enum  PACK_RESULT_e {
  NOT_READY ,
  SUCCEEDED ,
  FAILED
}
 The possible operation step results. More...
 
enum  PROC_DISABLE_e {
  ROOT_DISABLE_EXECUTE = BIT_FLAG(0) ,
  DISABLE_EXECUTE = BIT_FLAG(1) ,
  ROOT_DISABLE_DRAW = BIT_FLAG(2) ,
  DISABLE_DRAW = BIT_FLAG(3)
}
 Controls if the execute and draw operations should be skipped. More...
 

Public Member Functions

virtual int create ()
 do method for the create operation.
 
virtual int execute ()
 do method for the execute operation.
 
virtual int draw ()
 do method for the draw operation.
 
virtual int doDelete ()
 do method for the delete operation.
 
- Public Member Functions inherited from dBase_c
 dBase_c ()
 Constructs a new base.
 
virtual int preCreate ()
 pre method for the create operation.
 
virtual void postCreate (fBase_c::MAIN_STATE_e status)
 post method for the create operation.
 
virtual int preDelete ()
 pre method for the delete operation.
 
virtual void postDelete (fBase_c::MAIN_STATE_e status)
 post method for the delete operation.
 
virtual int preExecute ()
 pre method for the execute operation.
 
virtual void postExecute (fBase_c::MAIN_STATE_e status)
 post method for the execute operation.
 
virtual int preDraw ()
 pre method for the draw operation.
 
virtual void postDraw (fBase_c::MAIN_STATE_e status)
 post method for the draw operation.
 
virtual ~dBase_c ()
 Destroys the base.
 
virtual const char * getKindString () const
 Gets the base's kind string.
 
- Public Member Functions inherited from fBase_c
 fBase_c ()
 Constructs a new base.
 
void deleteRequest ()
 Requests deletion of the base.
 
fBase_cgetConnectParent () const
 Gets the base's parent.
 
fBase_cgetConnectChild () const
 Gets the base's first child.
 
fBase_cgetConnectBrNext () const
 Gets the base's next sibling.
 
bool checkChildProcessCreateState () const
 Checks if the base has at least one child in the CREATING state.
 
- Public Member Functions inherited from cOwnerSetMg_c
 cOwnerSetMg_c ()
 Constructs a new set container.
 
 ~cOwnerSetMg_c ()
 Destroys the set.
 
void add (cOwnerSetNd_c *nd, void *owner)
 Adds a node to the set.
 
void remove (cOwnerSetNd_c *nd, void *owner)
 Removes a node from the set.
 

Public Attributes

int mNextButton
 The button to be activated next (when the cursor moves).
 
bool mClose
 Whether the window was closed via the back button.
 
bool mButtonHit
 Whether one of the buttons was hit.
 
bool mIsAnimating
 Whether an animation is currently playing.
 
bool mToTitle
 Whether to show "Title Screen" instead of "Exit". [This seems to never be set in-game].
 
- Public Attributes inherited from fBase_c
fBaseID_e mUniqueID
 The base's unique identifier.
 
u32 mParam
 A bitfield that configures the base's behaviour. Its usage varies from profile to profile.
 
ProfileName mProfName
 The base's profile name.
 

Static Public Attributes

static Pausewindow_cm_instance = nullptr
 The static instance of the pause window.
 

Private Member Functions

void setWorldCourseWrite ()
 Sets the world number and course number / icon.
 
void TitleDispChkWrite ()
 Sets the visibility of the panes based on the game mode.
 
void SelectCursorSetup ()
 Sets up the cursor for the buttons.
 

Private Attributes

LytBase_c mLayout
 The layout for the window.
 
sFStateMgr_c< Pausewindow_c, sStateMethodUsr_FI_cmStateMgr
 The state manager for the window.
 
nw4r::lyt::PicturempPicturePanes [P_COUNT]
 The picture panes of the view.
 
nw4r::lyt::WindowmpWindowPanes [W_COUNT]
 The window panes of the view.
 
LytTextBox_cmpTextBoxes [T_COUNT]
 The textboxes of the view.
 
nw4r::lyt::PanempNullPanes [N_COUNT]
 The null panes of the view.
 
int mActiveButton
 The button currently active.
 
int mColor
 The color of the window. Use a value from 0-3 (one per player).
 
bool mHasLoadedLayout
 Whether the layout has been loaded.
 
bool mIsActive
 Whether the window is currently open.
 

Static Private Attributes

static sFStateID_c< Pausewindow_cStateID_InitWait
 Initial state. Switches to OpenAnimeEndWait immediately.
 
static sFStateID_c< Pausewindow_cStateID_OpenAnimeEndWait
 Waiting for the window to finish the opening animation.
 
static sFStateID_c< Pausewindow_cStateID_ButtonChangeAnimeEndWait
 Waiting for the button change animation to finish.
 
static sFStateID_c< Pausewindow_cStateID_PauseDisp
 Showing the pause window.
 
static sFStateID_c< Pausewindow_cStateID_HitAnimeEndWait
 Waiting for the button hit animation to finish and goes to ClouseAnimeEndWait after.
 
static sFStateID_c< Pausewindow_cStateID_ClouseAnimeEndWait
 Waiting for the close animation to finish. Goes back to InitWait.
 

Additional Inherited Members

- Static Public Member Functions inherited from dBase_c
static dBase_csearchBaseByProfName (ProfileName profile, const dBase_c *parent)
 Searches for a base with a given profile name, optionally under a given parent.
 
static void initLoader ()
 Sets the callbacks for the scrapped relocatable profile system.
 
static dBase_ccreateBase (ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType)
 Creates a child base under the given parent.
 
static dBase_ccreateRoot (ProfileName profName, unsigned long param, u8 groupType)
 Creates a root base.
 
- Static Public Member Functions inherited from fBase_c
static void * operator new (size_t)
 new operator override for all bases.
 
static void operator delete (void *)
 delete operator override for all bases.
 
static fBase_ccreateChild (ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType)
 Creates a child base under the given parent.
 
static fBase_ccreateRoot (ProfileName profName, unsigned long param, u8 groupType)
 Creates a root base.
 
- Protected Member Functions inherited from fBase_c
bool isProcControlFlag (u8 flag) const
 Checks if a flag is set in mProcControl.
 
void setProcControlFlag (u8 flag)
 Sets a flag in mProcControl.
 
void clearProcControlFlag (u8 flag)
 Clears a flag in mProcControl.
 
virtual void deleteReady ()
 Informs the base that it's about to be deleted.
 
virtual bool entryFrmHeap (unsigned long size, EGG::Heap *parentHeap)
 Creates a heap of the given size for the base.
 
virtual bool entryFrmHeapNonAdjust (unsigned long size, EGG::Heap *parentHeap)
 Creates a heap of the given size for the base.
 
virtual bool createHeap ()
 [Does nothing].
 
virtual ~fBase_c ()
 Destroys the base.
 
- Protected Attributes inherited from dBase_c
const char * mpKindString
 The base's kind string.
 
const char * mpNameString
 The base's profile name string.
 
- Protected Attributes inherited from fBase_c
u8 mLifecycleState
 The base's lifecycle state. Value is a LIFECYCLE_e.
 
bool mDeleteRequested
 If deletion of the base was requested, but the delete operation has not been scheduled yet.
 
bool mDeferExecute
 If the create operation was completed, but scheduling the execute and draw operations isn't possible at this time.
 
bool mDeferRetryCreate
 If the create operation has not been completed, and rescheduling it isn't possible at this time.
 
u8 mGroupType
 The base's group type. Value is a GROUP_TYPE_e.
 
u8 mProcControl
 The operations to be skipped. Value is a PROC_DISABLE_e.
 
fManager_c mMng
 The base's process manager.
 
fBaHelper_cmpUnusedHelper
 See Unused Content.
 
fLiMgBa_c mUnusedList
 See Unused Content.
 
EGG::FrmHeapmHeap
 The base's dedicated heap.
 
- Static Protected Attributes inherited from fBase_c
static int(* sLoadAsyncCallback )()
 See Unused Content.
 
static void(* sUnloadCallback )()
 See Unused Content.
 

Member Enumeration Documentation

◆ T_PANE_e

The text boxes used in the layout.

Definition at line 17 of file d_pausewindow.hpp.

◆ N_PANE_e

The null panes used in the layout.

Definition at line 29 of file d_pausewindow.hpp.

◆ P_PANE_e

The picture panes used in the layout.

Definition at line 38 of file d_pausewindow.hpp.

◆ W_PANE_e

The window panes used in the layout.

Definition at line 48 of file d_pausewindow.hpp.

◆ ANIM_NAME_e

The animation names used in the layout.

Definition at line 55 of file d_pausewindow.hpp.

◆ ANIM_e

The animations used for the layout.

Definition at line 68 of file d_pausewindow.hpp.

Constructor & Destructor Documentation

◆ Pausewindow_c()

Pausewindow_c::Pausewindow_c ( )

Definition at line 24 of file d_pausewindow.cpp.

◆ ~Pausewindow_c()

Pausewindow_c::~Pausewindow_c ( )
virtual

Definition at line 31 of file d_pausewindow.cpp.

Member Function Documentation

◆ create()

int Pausewindow_c::create ( )
virtual

do method for the create operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 34 of file d_pausewindow.cpp.

◆ execute()

int Pausewindow_c::execute ( )
virtual

do method for the execute operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 150 of file d_pausewindow.cpp.

◆ draw()

int Pausewindow_c::draw ( )
virtual

do method for the draw operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 159 of file d_pausewindow.cpp.

◆ doDelete()

int Pausewindow_c::doDelete ( )
virtual

do method for the delete operation.

This method was renamed due to conflict with the delete C++ keyword.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 166 of file d_pausewindow.cpp.

◆ setWorldCourseWrite()

void Pausewindow_c::setWorldCourseWrite ( )
private

Sets the world number and course number / icon.

Definition at line 174 of file d_pausewindow.cpp.

◆ TitleDispChkWrite()

void Pausewindow_c::TitleDispChkWrite ( )
private

Sets the visibility of the panes based on the game mode.

Definition at line 258 of file d_pausewindow.cpp.

◆ SelectCursorSetup()

void Pausewindow_c::SelectCursorSetup ( )
private

Sets up the cursor for the buttons.

Definition at line 286 of file d_pausewindow.cpp.

Member Data Documentation

◆ StateID_InitWait

sFStateID_c< Pausewindow_c > Pausewindow_c::StateID_InitWait
staticprivate

Initial state. Switches to OpenAnimeEndWait immediately.

Definition at line 89 of file d_pausewindow.hpp.

◆ StateID_OpenAnimeEndWait

sFStateID_c< Pausewindow_c > Pausewindow_c::StateID_OpenAnimeEndWait
staticprivate

Waiting for the window to finish the opening animation.

Definition at line 90 of file d_pausewindow.hpp.

◆ StateID_ButtonChangeAnimeEndWait

sFStateID_c< Pausewindow_c > Pausewindow_c::StateID_ButtonChangeAnimeEndWait
staticprivate

Waiting for the button change animation to finish.

Definition at line 91 of file d_pausewindow.hpp.

◆ StateID_PauseDisp

sFStateID_c< Pausewindow_c > Pausewindow_c::StateID_PauseDisp
staticprivate

Showing the pause window.

Definition at line 92 of file d_pausewindow.hpp.

◆ StateID_HitAnimeEndWait

sFStateID_c< Pausewindow_c > Pausewindow_c::StateID_HitAnimeEndWait
staticprivate

Waiting for the button hit animation to finish and goes to ClouseAnimeEndWait after.

Definition at line 93 of file d_pausewindow.hpp.

◆ StateID_ClouseAnimeEndWait

sFStateID_c< Pausewindow_c > Pausewindow_c::StateID_ClouseAnimeEndWait
staticprivate

Waiting for the close animation to finish. Goes back to InitWait.

Definition at line 94 of file d_pausewindow.hpp.

◆ mLayout

LytBase_c Pausewindow_c::mLayout
private

The layout for the window.

Definition at line 96 of file d_pausewindow.hpp.

◆ mStateMgr

sFStateMgr_c<Pausewindow_c, sStateMethodUsr_FI_c> Pausewindow_c::mStateMgr
private

The state manager for the window.

Definition at line 99 of file d_pausewindow.hpp.

◆ mpPicturePanes

nw4r::lyt::Picture* Pausewindow_c::mpPicturePanes[P_COUNT]
private

The picture panes of the view.

Definition at line 101 of file d_pausewindow.hpp.

◆ mpWindowPanes

nw4r::lyt::Window* Pausewindow_c::mpWindowPanes[W_COUNT]
private

The window panes of the view.

Definition at line 102 of file d_pausewindow.hpp.

◆ mpTextBoxes

LytTextBox_c* Pausewindow_c::mpTextBoxes[T_COUNT]
private

The textboxes of the view.

Definition at line 103 of file d_pausewindow.hpp.

◆ mpNullPanes

nw4r::lyt::Pane* Pausewindow_c::mpNullPanes[N_COUNT]
private

The null panes of the view.

Definition at line 104 of file d_pausewindow.hpp.

◆ mNextButton

int Pausewindow_c::mNextButton

The button to be activated next (when the cursor moves).

Definition at line 107 of file d_pausewindow.hpp.

◆ mActiveButton

int Pausewindow_c::mActiveButton
private

The button currently active.

Definition at line 109 of file d_pausewindow.hpp.

◆ mColor

int Pausewindow_c::mColor
private

The color of the window. Use a value from 0-3 (one per player).

Definition at line 110 of file d_pausewindow.hpp.

◆ mHasLoadedLayout

bool Pausewindow_c::mHasLoadedLayout
private

Whether the layout has been loaded.

Definition at line 111 of file d_pausewindow.hpp.

◆ mIsActive

bool Pausewindow_c::mIsActive
private

Whether the window is currently open.

Definition at line 112 of file d_pausewindow.hpp.

◆ mClose

bool Pausewindow_c::mClose

Whether the window was closed via the back button.

Definition at line 115 of file d_pausewindow.hpp.

◆ mButtonHit

bool Pausewindow_c::mButtonHit

Whether one of the buttons was hit.

Definition at line 116 of file d_pausewindow.hpp.

◆ mIsAnimating

bool Pausewindow_c::mIsAnimating

Whether an animation is currently playing.

Definition at line 117 of file d_pausewindow.hpp.

◆ mToTitle

bool Pausewindow_c::mToTitle

Whether to show "Title Screen" instead of "Exit". [This seems to never be set in-game].

Definition at line 118 of file d_pausewindow.hpp.

◆ m_instance

Pausewindow_c * Pausewindow_c::m_instance = nullptr
static

The static instance of the pause window.

Definition at line 120 of file d_pausewindow.hpp.