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

#include <game/bases/d_yes_no_window.hpp>

Inheritance diagram for dYesNoWindow_c:
[legend]

Description

Displays a confirmation prompt.

This appears, for example, when the game asks the player if their progress should be saved.

Definition at line 9 of file d_yes_no_window.hpp.

Public Types

enum  WINDOW_TYPE_e {
  SAVE_DATA_CREATED ,
  SAVE ,
  SAVED ,
  EXIT_FREE_MODE ,
  WATCH_UNLOCKED_HINT_MOVIE ,
  SKIP_COURSE ,
  WATCH_HINT_MOVIE ,
  GOT_ALL_STAR_COINS ,
  GOT_ALL_STAR_COINS_MENTION_W9 ,
  BOWSERJR_SINGLEPLAYER ,
  RETURN_TITLE ,
  BOWSERJR_MULTIPLAYER ,
  RETURN_TO_MAP ,
  BACK_TO_COURSE_SELECTION ,
  GOT_ALL_STAR_COINS_ALL_WORLDS ,
  QUICK_SAVE ,
  QUICK_SAVED ,
  ALL_TOAD_HOUSES_RETURNED ,
  ITEM_INFO ,
  COURSE_CLEAR_WITH_SUPER_GUIDE ,
  SKIP_COURSE_CONFIRM ,
  COMPLETED_EVERYTHING ,
  PROGRESS_AUTOSAVE_AFTER_W9_UNLOCK ,
  BLOCK_TRANSFORMATION ,
  BLOCK_TRANSFORMATION_REVERSE ,
  EXIT_COIN_BATTLE ,
  RETURN_TO_MAP2 ,
  PEACH_CASTLE_HINT1 ,
  PEACH_CASTLE_HINT2 ,
  WINDOW_TYPE_COUNT
}
 The prompt type. More...
enum  CURSOR_POS_e {
  POS_YES ,
  POS_NO ,
  POS_OK ,
  POS_COUNT
}
 The possible cursor positions. More...
enum  SOUND_e {
  SOUND_CLOSE ,
  SOUND_WAIT ,
  SOUND_CURSOR_MOVE ,
  SOUND_OPEN_ANIME ,
  SOUND_COUNT
}
 The sound effect types used for the window. More...
enum  ANIM_NAME_e {
  inWindow ,
  loopWindow ,
  inYesNoButton ,
  onYesNoButton ,
  idleYesNoButton ,
  hitYesNoButton ,
  offYesNoButton ,
  inBG ,
  outBG ,
  outWindow ,
  ANIM_NAME_COUNT
}
 The animation names used for the window. More...
enum  ANIMS_e {
  ANIM_IN_WINDOW ,
  ANIM_IN_QUICK_SAVE ,
  ANIM_LOOP_WINDOW ,
  ANIM_LOOP_QUICK_SAVE ,
  ANIM_IN_YES ,
  ANIM_IN_NO ,
  ANIM_IN_OK ,
  ANIM_ON_YES ,
  ANIM_ON_NO ,
  ANIM_ON_OK ,
  ANIM_IDLE_YES ,
  ANIM_IDLE_NO ,
  ANIM_IDLE_OK ,
  ANIM_HIT_YES ,
  ANIM_HIT_NO ,
  ANIM_HIT_OK ,
  ANIM_HIT_QUICK_SAVE ,
  ANIM_OFF_YES ,
  ANIM_OFF_NO ,
  ANIM_OFF_OK ,
  ANIM_IN_BG ,
  ANIM_OUT_BG ,
  ANIM_OUT_WINDOW ,
  ANIM_COUNT
}
 The animations used for the window. More...
enum  P_PANE_e {
  P_yesBase_00 ,
  P_noBase_00 ,
  P_centerBase_00 ,
  P_COUNT
}
 The picture panes used for the window. More...
enum  T_FIXED_PANE_e {
  T_center_00 ,
  T_center_01 ,
  T_otehonTextS_00 ,
  T_otehonText_00 ,
  T_FIXED_COUNT
}
 The fixed text boxes used for the window. More...
enum  T_PANE_e {
  T_questionS_00 ,
  T_question_00 ,
  T_otehonTextS_01 ,
  T_otehonText_01 ,
  T_needCoinX_00 ,
  T_needCoin_00 ,
  T_yes_00 ,
  T_yes_01 ,
  T_no_00 ,
  T_no_01 ,
  T_COUNT
}
 The text boxes used for the window. More...
enum  N_PANE_e {
  N_otehonText_00 ,
  N_saveIcon_00 ,
  N_COUNT
}
 The null panes used for the window. 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

WINDOW_TYPE_e mType
 The type of the window.
int mStarCoinsRequired
 The number of star coins required to unlock a hint movie.
bool mHasLoadedLayout
 Whether the layout has been loaded.
bool mIsActive
 Whether the window is currently open.
bool mHitButton
 Whether a button has been pressed.
bool mIsAnimating
 Whether an animation is currently playing.
bool mKeepOpen
 Whether the window should stay open after a button has been pressed.
bool mCancel
 Whether the window has been cancelled (and closed).
bool mHideBG
 Whether to hide the translucent background that fills the screen.
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.

Private Member Functions

void populateLayout ()
 Fills out the window content according to the settings.

Private Attributes

LytBase_c mLayout
 The layout for the window.
sFStateMgr_c< dYesNoWindow_c, sStateMethodUsr_FI_cmStateMgr
 The state manager for the window.
nw4r::lyt::Pane * mpRootPane
 The root pane of the window.
nw4r::lyt::Picture * mpPictures [P_COUNT]
 The picture panes.
LytTextBox_cmpTextBoxes [T_COUNT]
 The text boxes.
nw4r::lyt::Pane * mpNullPanes [N_COUNT]
 The null panes.
int mCursorPos
 The current cursor position.
int mPrevCursorPos
 The previous cursor position.

Static Private Attributes

static sFStateID_c< dYesNoWindow_cStateID_InitWait
 Initial state. Switches to OpenAnimeStartWait immediately.
static sFStateID_c< dYesNoWindow_cStateID_OpenAnimeEndWait
 Waiting for the window to finish the opening animation.
static sFStateID_c< dYesNoWindow_cStateID_ButtonOnStageAnimeEndWait
 Plays the button appearing animation and waits for it to finish.
static sFStateID_c< dYesNoWindow_cStateID_ButtonChangeAnimeEndWait
 Playing the button change animations.
static sFStateID_c< dYesNoWindow_cStateID_SelectWait
 Waiting for either a button change or button hit to occur.
static sFStateID_c< dYesNoWindow_cStateID_HitAnimeEndWait
 Waiting for the button to finish the hit animation.
static sFStateID_c< dYesNoWindow_cStateID_ClouseAnimeEndWait
 Waiting for the window to finish the closing animation.
static sFStateID_c< dYesNoWindow_cStateID_HitAnimeAfterWait
 Waiting in an infinite loop after the button was pressed.

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::FrmHeap * mHeap
 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

◆ WINDOW_TYPE_e

The prompt type.

Definition at line 13 of file d_yes_no_window.hpp.

◆ CURSOR_POS_e

The possible cursor positions.

Definition at line 47 of file d_yes_no_window.hpp.

◆ SOUND_e

The sound effect types used for the window.

Definition at line 55 of file d_yes_no_window.hpp.

◆ ANIM_NAME_e

The animation names used for the window.

Definition at line 64 of file d_yes_no_window.hpp.

◆ ANIMS_e

The animations used for the window.

Definition at line 79 of file d_yes_no_window.hpp.

◆ P_PANE_e

The picture panes used for the window.

Definition at line 107 of file d_yes_no_window.hpp.

◆ T_FIXED_PANE_e

The fixed text boxes used for the window.

Definition at line 115 of file d_yes_no_window.hpp.

◆ T_PANE_e

The text boxes used for the window.

Definition at line 124 of file d_yes_no_window.hpp.

◆ N_PANE_e

The null panes used for the window.

Definition at line 139 of file d_yes_no_window.hpp.

Constructor & Destructor Documentation

◆ dYesNoWindow_c()

dYesNoWindow_c::dYesNoWindow_c ( )

Definition at line 26 of file d_yes_no_window.cpp.

◆ ~dYesNoWindow_c()

dYesNoWindow_c::~dYesNoWindow_c ( )
virtual

Definition at line 30 of file d_yes_no_window.cpp.

Member Function Documentation

◆ create()

int dYesNoWindow_c::create ( )
virtual

do method for the create operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 32 of file d_yes_no_window.cpp.

◆ execute()

int dYesNoWindow_c::execute ( )
virtual

do method for the execute operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 163 of file d_yes_no_window.cpp.

◆ draw()

int dYesNoWindow_c::draw ( )
virtual

do method for the draw operation.

Returns
A PACK_RESULT_e value.

Reimplemented from fBase_c.

Definition at line 174 of file d_yes_no_window.cpp.

◆ doDelete()

int dYesNoWindow_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 183 of file d_yes_no_window.cpp.

◆ populateLayout()

void dYesNoWindow_c::populateLayout ( )
private

Fills out the window content according to the settings.

This includes:

  • Filling out the text boxes
  • Setting the visibility of the buttons
  • Showing the quick save balloon if necessary

Definition at line 291 of file d_yes_no_window.cpp.

Member Data Documentation

◆ StateID_InitWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_InitWait
staticprivate

Initial state. Switches to OpenAnimeStartWait immediately.

Definition at line 160 of file d_yes_no_window.hpp.

◆ StateID_OpenAnimeEndWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_OpenAnimeEndWait
staticprivate

Waiting for the window to finish the opening animation.

Definition at line 161 of file d_yes_no_window.hpp.

◆ StateID_ButtonOnStageAnimeEndWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_ButtonOnStageAnimeEndWait
staticprivate

Plays the button appearing animation and waits for it to finish.

Definition at line 162 of file d_yes_no_window.hpp.

◆ StateID_ButtonChangeAnimeEndWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_ButtonChangeAnimeEndWait
staticprivate

Playing the button change animations.

Definition at line 163 of file d_yes_no_window.hpp.

◆ StateID_SelectWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_SelectWait
staticprivate

Waiting for either a button change or button hit to occur.

Definition at line 164 of file d_yes_no_window.hpp.

◆ StateID_HitAnimeEndWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_HitAnimeEndWait
staticprivate

Waiting for the button to finish the hit animation.

Definition at line 165 of file d_yes_no_window.hpp.

◆ StateID_ClouseAnimeEndWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_ClouseAnimeEndWait
staticprivate

Waiting for the window to finish the closing animation.

Definition at line 166 of file d_yes_no_window.hpp.

◆ StateID_HitAnimeAfterWait

sFStateID_c< dYesNoWindow_c > dYesNoWindow_c::StateID_HitAnimeAfterWait
staticprivate

Waiting in an infinite loop after the button was pressed.

Definition at line 167 of file d_yes_no_window.hpp.

◆ mLayout

LytBase_c dYesNoWindow_c::mLayout
private

The layout for the window.

Definition at line 169 of file d_yes_no_window.hpp.

◆ mStateMgr

sFStateMgr_c<dYesNoWindow_c, sStateMethodUsr_FI_c> dYesNoWindow_c::mStateMgr
private

The state manager for the window.

Definition at line 172 of file d_yes_no_window.hpp.

◆ mpRootPane

nw4r::lyt::Pane* dYesNoWindow_c::mpRootPane
private

The root pane of the window.

Definition at line 174 of file d_yes_no_window.hpp.

◆ mpPictures

nw4r::lyt::Picture* dYesNoWindow_c::mpPictures[P_COUNT]
private

The picture panes.

Definition at line 175 of file d_yes_no_window.hpp.

◆ mpTextBoxes

LytTextBox_c* dYesNoWindow_c::mpTextBoxes[T_COUNT]
private

The text boxes.

Definition at line 176 of file d_yes_no_window.hpp.

◆ mpNullPanes

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

The null panes.

Definition at line 177 of file d_yes_no_window.hpp.

◆ mCursorPos

int dYesNoWindow_c::mCursorPos
private

The current cursor position.

Definition at line 179 of file d_yes_no_window.hpp.

◆ mPrevCursorPos

int dYesNoWindow_c::mPrevCursorPos
private

The previous cursor position.

Definition at line 180 of file d_yes_no_window.hpp.

◆ mType

WINDOW_TYPE_e dYesNoWindow_c::mType

The type of the window.

This determines the text and the layout of the window.

Definition at line 185 of file d_yes_no_window.hpp.

◆ mStarCoinsRequired

int dYesNoWindow_c::mStarCoinsRequired

The number of star coins required to unlock a hint movie.

This is only to be used with the WATCH_UNLOCKED_HINT_MOVIE type.

Definition at line 189 of file d_yes_no_window.hpp.

◆ mHasLoadedLayout

bool dYesNoWindow_c::mHasLoadedLayout

Whether the layout has been loaded.

Definition at line 191 of file d_yes_no_window.hpp.

◆ mIsActive

bool dYesNoWindow_c::mIsActive

Whether the window is currently open.

Definition at line 192 of file d_yes_no_window.hpp.

◆ mHitButton

bool dYesNoWindow_c::mHitButton

Whether a button has been pressed.

Definition at line 193 of file d_yes_no_window.hpp.

◆ mIsAnimating

bool dYesNoWindow_c::mIsAnimating

Whether an animation is currently playing.

Definition at line 194 of file d_yes_no_window.hpp.

◆ mKeepOpen

bool dYesNoWindow_c::mKeepOpen

Whether the window should stay open after a button has been pressed.

Definition at line 195 of file d_yes_no_window.hpp.

◆ mCancel

bool dYesNoWindow_c::mCancel

Whether the window has been cancelled (and closed).

Definition at line 196 of file d_yes_no_window.hpp.

◆ mHideBG

bool dYesNoWindow_c::mHideBG

Whether to hide the translucent background that fills the screen.

Definition at line 197 of file d_yes_no_window.hpp.