resonance 1.0.1
Loading...
Searching...
No Matches
MetStageFinishScreen Class Reference

Congratulation screen shown when a stage is finished. More...

#include <metstagefinishscreen.h>

Inheritance diagram for MetStageFinishScreen:
Collaboration diagram for MetStageFinishScreen:

Public Member Functions

 MetStageFinishScreen (MetRenderer *pRenderer, int nPriority)
 Construct the screen.
virtual ~MetStageFinishScreen ()
virtual void EnterAndShow ()
 Record the finished stage, queue the messages it earns, and save or show them.
virtual void HandleCommand (const MetScreenCommand *pCommand)
 Start the continue button alternating once the messages are done.
virtual void PlayLeaveSound (int nSelector)
 Play no leave sound.
virtual void PlayHighSound (int nSelector)
 Play no high sound.
virtual void PlayCycleLeftSound (int nSelector)
 Play no left cycle sound.
virtual void PlayCycleRightSound (int nSelector)
 Play no right cycle sound.
virtual void PlayErrorSound (int nSelector)
 Play no error sound.
virtual void UpdateIdle (float flTime)
 Show the next queued message, or the continue button after the last.
virtual void OnRepeatingSoundFinished (Rnd::Button *pButton)
 Start this screen's exit animation.
virtual void OnEnterFinished ()
 Select no button, record the time the first message appears, and clear the panel.
virtual void OnExitFinished ()
 Hand over to the solo win screen.
virtual void ResolveContainerViews ()
 Resolve the base views, add the continue button, and fill the four congratulation texts.
Public Member Functions inherited from MetScreen
 MetScreen (MetRenderer *pRenderer, int nPriority, const HxStr &name, const HxStr &directory, const HxStr &file)
 Construct a screen and start its container load.
virtual ~MetScreen ()
 Unregister from the renderer and release the container.
void DeliverCommand (const MetScreenCommand *pCommand)
 Play the sound one navigation command calls for and then act on the command.
void UpdateAnimationFrame (float flTime)
 Drive the frame of whichever animation is running and run the idle hook when none is.
void UpdateFrame (float flTime)
 Advance one screen by one frame.
virtual void PushNamedScreen (const HxStr &name)
 Bring one named screen onto the renderer's screen stack.
virtual void ActivateNamedPanel (const HxStr &name)
 Make one named screen the renderer's active panel.
virtual void OnPanelActivated ()
 Act on this screen having become the renderer's active panel.
virtual void ExitScreenByName (const HxStr &name)
 Start one named screen's exit animation.
virtual void BeginExit ()
 Start this screen's exit animation at the renderer's current time.
virtual void OnUnusedHook ()
 Do nothing.
virtual void OnKeyboardDismissed ()
 Take control back after the keyboard screen has finished.
virtual void OnDrawPass ()
 Contribute to the renderer's draw pass.
virtual void OnDestroying ()
 Release what the screen acquired, ahead of the rest of destruction.
virtual int PollContainerLoad ()
 Advance this screen's container load and resolve its views once the load finishes.
virtual void OnMsgScreenDismissed (const HxStr &name, int nChoice)
 Act on the choice the user made in a message dialogue.
virtual void OnMsgScreenShown (const HxStr &name)
 Act on a message dialogue becoming visible.
virtual void SetShowing (int nShowing)
 Show or hide the view and every drawable the container loaded.
virtual void BeginContainerLoad (const HxStr &directory, const HxStr &file)
 Intern a container load under this screen's container name and enqueue it.
virtual void PlaySlideSound (int nSelector)
 Play the sound that accompanies sliding between screens.
virtual void UpdateIdleAnimation (float flTime)
 Advance whatever the screen animates while it is neither entering nor exiting.
virtual void StartRepeatingSound (float flStartTime, float flInterval, Rnd::Button *pButton, int nCycles)
 Start alternating one button between its states 2 and 1.
virtual void UpdateRepeatingSound (float flTime)
 Advance the alternation that StartRepeatingSound() started.
virtual void StartEnterAnimation (float flTime)
 Rewind the enter animation and record the time it starts at.
virtual void UpdateEnterAnimation (float flTime)
 Drive the enter animation and finish it once it passes its end.
virtual void StartExitAnimation (float flTime)
 Record the time the exit animation starts at.
virtual void UpdateExitAnimation (float flTime)
 Drive the exit animation and hide the screen once it passes its end.
virtual void Draw ()
 Draw the view.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.

Static Public Member Functions

static MetStageFinishScreen * New (MetRenderer *pRenderer, int nPriority)
 Build the screen on the heap.
Static Public Member Functions inherited from MetScreen
static std::map< HxStr, MetContainerLoad * > & ContainerLoaderMap ()
 Shared table of container loads, interned under the container name.
static std::map< HxStr, MetScreenEntry > & ScreenRegistry ()
 Shared table of live screens, interned under the screen registry key.
static MetScreen * FindScreenByName (const HxStr &name)
 Resolve one screen by its registry key.
static MetScreen * FindEndScreen (MetRenderer *pRenderer, const HxStr &name)
 Resolve one end-of-game screen by its registry key, failing fatally when it is absent.
static void CreateMainMenuScreens (MetRenderer *pRenderer)
 Create the main-menu screens.
static void DestroyAllScreens ()
 Delete every registered screen and release every container loader.
static void CreateStartupScreens (MetRenderer *pRenderer)
 Create the four screens the front end needs before its containers have loaded.
static void CreateFrontEndScreens (MetRenderer *pRenderer)
 Create every remaining front-end screen, once.
static void DestroyCategory2Screens ()
 Delete and unregister every screen in category 2.
static void DestroyCategory1Screens ()
 Delete and unregister every screen in category 1.
static void DestroyNonDefaultScreens ()
 Delete and unregister every screen outside category 0, then rewind the rndMetLocAndNet zone.
static void PollContainerLoads ()
 Poll every container load that has not finished, and hide the drawables of each that does.

Additional Inherited Members

Public Attributes inherited from MetScreen
Rnd::View * mView
 The container's root view.
int mEnterPending
 Set when the screen was pushed before its container load finished.
int mActivatePending
 Set when the screen was activated as a panel before its container load finished.
float mRepeatScale
 Scale on the input auto-repeat interval.
Protected Member Functions inherited from MetScreen
virtual void DispatchPriv (Message *pMsg)
 Act on a message.
void ResolveAnimationViews ()
 Resolves the two animation views from the screen name and records the enter animation's end frame.
Protected Attributes inherited from MetScreen
float mAnimEndFrame
float mEnterStartTime
MetRenderer * mRenderer
int mExitChoice
int mAcceptsCommands
Rnd::View * mEnterAnim
std::vector< HxStr > mHelpKeys
int mViewsUnresolved
int mPlaysCommandSounds
int mShowsLoadedDrawables

Detailed Description

Congratulation screen shown when a stage is finished.

Its RTTI descriptor is at 0x008ef8e0. It has MetScreen as its one public non-virtual base at offset 0.

The 39-entry primary vtable is at 0x0080f9e0, the same length as the MetScreen table, so the class declares no virtual of its own.

The constructor at 0x003bdbb8 takes only the renderer and the load priority, and supplies egc for the screen name, metagame/_Solo for the directory, and end_game_congrats for the container.

The object is 0xb8 bytes, which the allocation in New() fixes.

The destructor is at 0x003bded8.

Apart from the type function and the destructor, the slots that differ from the MetScreen table are 5 0x003be2a8, 19 0x003bf788, 21 0x003c4228, 22 0x003c4230, 23 0x003c4238, 24 0x003c4240, 25 0x003c4248, 26 0x003bf5e8, 30 0x003c4390, 33 0x003c42d8, 36 0x003c0530, 38 0x003be068.

Slot 5 compares the campaign statistics before and after recording the finished stage, and queues one message for each change through the private builders. Slot 26 then shows the queued messages one at a time, 360 frames apart, and shows the continue button after the last.

Constructor & Destructor Documentation

◆ MetStageFinishScreen()

MetStageFinishScreen::MetStageFinishScreen ( MetRenderer * pRenderer,
int nPriority )

Construct the screen.

Parameters
pRendererThe front-end renderer this screen registers on.
nPriorityThe load priority.
Ghidra address:
NTSC-U/C: 0x003bdbb8
Ghidra address:
PAL: 0x003f2908

◆ ~MetStageFinishScreen()

virtual MetStageFinishScreen::~MetStageFinishScreen ( )
virtual
Ghidra address:
NTSC-U/C: 0x003bded8
Ghidra address:
PAL: 0x003f2c98

Member Function Documentation

◆ New()

MetStageFinishScreen * MetStageFinishScreen::New ( MetRenderer * pRenderer,
int nPriority )
static

Build the screen on the heap.

The object is allocated with the tag MsgSink. MetScreen::CreateFrontEndScreens() is the one caller.

Parameters
pRendererThe front-end renderer the screen registers on.
nPriorityThe load priority.
Returns
The new screen.
Ghidra address:
NTSC-U/C: 0x003c4250
Ghidra address:
PAL: 0x003f96d0

◆ EnterAndShow()

virtual void MetStageFinishScreen::EnterAndShow ( )
virtual

Record the finished stage, queue the messages it earns, and save or show them.

Slot 5.

Unless the stage is already recorded or a saved game is loading, the body records the game's score and the level as beaten in the first persona's CampaignStats, updates the persona's skill status, and queues one message for each change the recording made. The level named second of a two-level secret stage additionally queues end_game_end_super_secret. When the level was not beaten before or its high score was beaten, and MetFrontEndState::mUnlockAll is clear, the persona is saved through MetPersonaSaverScreen::StartSave() with this screen to return to, to the first card location GlobalSettings records when MetFrontEndState::mUsingMemcard is set and to location 1 otherwise, and the body returns. Otherwise, when MetFrontEndState::mUsingMemcard and mSettingsDirty are both 1, the global settings are saved first through MetGlobalSettingsSaverScreen::StartSave(), and ShowMessages() runs in every other case.

Ghidra address:
NTSC-U/C: 0x003be2a8
Ghidra address:
PAL: 0x003f30e8

Reimplemented from MetScreen.

◆ HandleCommand()

virtual void MetStageFinishScreen::HandleCommand ( const MetScreenCommand * pCommand)
virtual

Start the continue button alternating once the messages are done.

Slot 19.

Every command is discarded during the message sequence, and every command other than kMetScreenCommandSelect is discarded afterwards, so the screen cannot be departed with the back button.

Parameters
pCommandThe command to route.
Ghidra address:
NTSC-U/C: 0x003bf788
Ghidra address:
PAL: 0x003f4840

Reimplemented from MetScreen.

◆ PlayLeaveSound()

virtual void MetStageFinishScreen::PlayLeaveSound ( int nSelector)
virtual

Play no leave sound.

Slot 21.

Parameters
nSelectorThe pad index of the command, which the body does not read.
Ghidra address:
NTSC-U/C: 0x003c4228
Ghidra address:
PAL: 0x003f96a8

Reimplemented from MetScreen.

◆ PlayHighSound()

virtual void MetStageFinishScreen::PlayHighSound ( int nSelector)
virtual

Play no high sound.

Slot 22.

Parameters
nSelectorThe controller index, which the body does not read.
Ghidra address:
NTSC-U/C: 0x003c4230
Ghidra address:
PAL: 0x003f96b0

Reimplemented from MetScreen.

◆ PlayCycleLeftSound()

virtual void MetStageFinishScreen::PlayCycleLeftSound ( int nSelector)
virtual

Play no left cycle sound.

Slot 23.

Parameters
nSelectorThe controller index, which the body does not read.
Ghidra address:
NTSC-U/C: 0x003c4238
Ghidra address:
PAL: 0x003f96b8

Reimplemented from MetScreen.

◆ PlayCycleRightSound()

virtual void MetStageFinishScreen::PlayCycleRightSound ( int nSelector)
virtual

Play no right cycle sound.

Slot 24.

Parameters
nSelectorThe controller index, which the body does not read.
Ghidra address:
NTSC-U/C: 0x003c4240
Ghidra address:
PAL: 0x003f96c0

Reimplemented from MetScreen.

◆ PlayErrorSound()

virtual void MetStageFinishScreen::PlayErrorSound ( int nSelector)
virtual

Play no error sound.

Slot 25.

Parameters
nSelectorThe controller index, which the body does not read.
Ghidra address:
NTSC-U/C: 0x003c4248
Ghidra address:
PAL: 0x003f96c8

Reimplemented from MetScreen.

◆ UpdateIdle()

virtual void MetStageFinishScreen::UpdateIdle ( float flTime)
virtual

Show the next queued message, or the continue button after the last.

Slot 26.

The slot acts only inside the message sequence slot 33 starts, and only once 360 frames have passed since the last step. It shows the drawable of the next message when one remains and advances the index. Once the index passes the message count it shows and selects the continue button, clears the time the message appeared, and activates the panel MetStageFinishScreen; otherwise it records the current time. The test is against the index after it advances, so the button appears one interval after the last message rather than with it.

Parameters
flTimeThe current frame position.
Ghidra address:
NTSC-U/C: 0x003bf5e8
Ghidra address:
PAL: 0x003f4680

Reimplemented from MetScreen.

◆ OnRepeatingSoundFinished()

virtual void MetStageFinishScreen::OnRepeatingSoundFinished ( Rnd::Button * pButton)
virtual

Start this screen's exit animation.

Slot 30.

Parameters
pButtonThe button slot 29 finished with, which the body does not read.
Ghidra address:
NTSC-U/C: 0x003c4390
Ghidra address:
PAL: 0x003f9830

Reimplemented from MetScreen.

◆ OnEnterFinished()

virtual void MetStageFinishScreen::OnEnterFinished ( )
virtual

Select no button, record the time the first message appears, and clear the panel.

Slot 33.

MetScreen slot 32 runs the slot once the enter animation has finished.

Ghidra address:
NTSC-U/C: 0x003c42d8
Ghidra address:
PAL: 0x003f9758

Reimplemented from MetScreen.

◆ OnExitFinished()

virtual void MetStageFinishScreen::OnExitFinished ( )
virtual

Hand over to the solo win screen.

Slot 36.

MetScreen slot 35 runs the slot once the exit animation has finished. The body clears mStageRecorded, passes mDifficultyUnlocked to MetSoloWinScreen::SetDifficultyUnlocked(), pushes and activates MetSoloWinScreen, selects no button, empties the messages, and hides the four congratulation texts.

Ghidra address:
NTSC-U/C: 0x003c0530
Ghidra address:
PAL: 0x003f5820

Reimplemented from MetScreen.

◆ ResolveContainerViews()

virtual void MetStageFinishScreen::ResolveContainerViews ( )
virtual

Resolve the base views, add the continue button, and fill the four congratulation texts.

Slot 38.

Each of egc_congrat1.txt through egc_congrat4.txt receives the configuration string for end_game_congrats. The text is not tested for null after the lookup.

Ghidra address:
NTSC-U/C: 0x003be068
Ghidra address:
PAL: 0x003f2e40

Reimplemented from MetScreen.


The documentation for this class was generated from the following file: