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

Help and options screen, which also shows the prompt line every other screen posts. More...

#include <methelpscreen.h>

Inheritance diagram for MetHelpScreen:
Collaboration diagram for MetHelpScreen:

Public Member Functions

 MetHelpScreen (MetRenderer *pRenderer, int nPriority)
 Construct the screen.
virtual ~MetHelpScreen ()
void ApplyPreset (const HxStr &name)
 Record one named layout and fill the title texts from it.
void PostText (const HxStr &text, float flTime)
 Post one prompt at one time.
virtual void HandleCommand (const MetScreenCommand *pCommand)
 Depart on a back command.
virtual void UpdateIdle (float flTime)
 Advance the show and hide animations.
virtual void OnExitFinished ()
 Empty the info texts, forget both prompts, and stop the hide animation.
virtual void ResolveContainerViews ()
 Resolve the container views, the six info texts, the four title texts, and both animations.
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 EnterAndShow ()
 Show this screen and start its enter animation.
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 PlayLeaveSound (int nSelector)
 Play the sound that accompanies departing a screen.
virtual void PlayHighSound (int nSelector)
 Play the sound that accompanies the emphasised selection.
virtual void PlayCycleLeftSound (int nSelector)
 Play the sound that accompanies cycling a value to the left.
virtual void PlayCycleRightSound (int nSelector)
 Play the sound that accompanies cycling a value to the right.
virtual void PlayErrorSound (int nSelector)
 Play the sound that accompanies a rejected input.
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 OnRepeatingSoundFinished (Rnd::Button *pButton)
 Act on the alternation that StartRepeatingSound() started having finished.
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 OnEnterFinished ()
 Act on the enter animation having finished.
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 MetHelpScreen * New (MetRenderer *pRenderer, int nPriority)
 Build the screen on the heap.
static void SetText (const HxStr &text, float flTime)
 Replace the shared prompt text and repost it.
static void SelectPreset (const HxStr &name)
 Select one named prompt layout.
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

Help and options screen, which also shows the prompt line every other screen posts.

Its RTTI descriptor is at 0x009021e0. It has MetScreen as its one public non-virtual base at offset 0. New() allocates 0x100 bytes, the highest member ending at +0xf8 and the quadword-aligned Vector3 members rounding the total up.

The 39-entry primary vtable is at 0x00802420, the same length as the MetScreen table, so the class declares no virtual of its own. It is one of only three classes that inherit slot 5 unchanged rather than overriding it.

A prompt is posted through SetText(). The screen fills the six info texts from script template 0x268, or in the European release from the prompt text itself, and plays so_TT_01.anim to show them. A new prompt arriving while one is shown plays so_TT_02.anim to hide the old one first, and the new one is shown when the hide finishes. UpdateIdle() advances both animations. The four title texts are filled the same way from the layout SelectPreset() chooses.

Constructor & Destructor Documentation

◆ MetHelpScreen()

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

Construct the screen.

The screen name is so, the directory metagame/shared, and the container options_sl. MetScreen::mShowsLoadedDrawables is cleared.

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

◆ ~MetHelpScreen()

virtual MetHelpScreen::~MetHelpScreen ( )
virtual
Ghidra address:
NTSC-U/C: 0x00312770
Ghidra address:
PAL: 0x00338640

Member Function Documentation

◆ New()

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

Build the screen on the heap.

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

◆ SetText()

void MetHelpScreen::SetText ( const HxStr & text,
float flTime )
static

Replace the shared prompt text and repost it.

The routine resolves the screen registered under the literal MetHelpScreen, casts it to this class, and forwards to PostText(). A front end with no help screen registered forwards through a null receiver. It is a static member rather than a free function, because it takes no receiver and vends exactly one class. The North American release passes a key that FillTexts() looks up, and the European release passes the text itself.

Parameters
textThe prompt to display.
flTimeThe renderer time to post the prompt at.
Ghidra address:
NTSC-U/C: 0x00317368
Ghidra address:
PAL: 0x0033d550

◆ SelectPreset()

void MetHelpScreen::SelectPreset ( const HxStr & name)
static

Select one named prompt layout.

The routine resolves the same registered screen SetText() does and forwards to ApplyPreset(). MetLoadFreqScreen::EnterAndShow() passes standard_title. The European release passes the layout text itself rather than a name.

Parameters
nameThe layout name.
Ghidra address:
NTSC-U/C: 0x00317298
Ghidra address:
PAL: 0x00338328

◆ ApplyPreset()

void MetHelpScreen::ApplyPreset ( const HxStr & name)

Record one named layout and fill the title texts from it.

The titles are filled only once the container views are resolved.

Parameters
nameThe layout name.
Ghidra address:
NTSC-U/C: 0x00317758
Ghidra address:
PAL: 0x0033d960

◆ PostText()

void MetHelpScreen::PostText ( const HxStr & text,
float flTime )

Post one prompt at one time.

An empty prompt over an empty one, the prompt already shown while no animation runs, and a screen whose views are not resolved yet are all ignored. With nothing shown the prompt is shown at once. Otherwise the hide animation starts and the prompt waits in mWaitingText.

Parameters
textThe prompt to display.
flTimeThe renderer time to post the prompt at.
Ghidra address:
NTSC-U/C: 0x00312f70
Ghidra address:
PAL: 0x00338f20

◆ HandleCommand()

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

Depart on a back command.

Slot 19.

Parameters
pCommandThe command.
Ghidra address:
NTSC-U/C: 0x00317448
Ghidra address:
PAL: 0x0033d650

Reimplemented from MetScreen.

◆ UpdateIdle()

virtual void MetHelpScreen::UpdateIdle ( float flTime)
virtual

Advance the show and hide animations.

Slot 26.

Parameters
flTimeThe renderer time.
Ghidra address:
NTSC-U/C: 0x00312df0
Ghidra address:
PAL: 0x00338da0

Reimplemented from MetScreen.

◆ OnExitFinished()

virtual void MetHelpScreen::OnExitFinished ( )
virtual

Empty the info texts, forget both prompts, and stop the hide animation.

Slot 36. The show animation's start time is not cleared.

Ghidra address:
NTSC-U/C: 0x00317480
Ghidra address:
PAL: 0x0033d688

Reimplemented from MetScreen.

◆ ResolveContainerViews()

virtual void MetHelpScreen::ResolveContainerViews ( )
virtual

Resolve the container views, the six info texts, the four title texts, and both animations.

Slot 38. The texts are sl_pan_opt_info_0N.txt and sl_opt_title_0N.txt for N from 1, each emptied and shown. The resting translation of the first text of each group is recorded. The animations are so_TT_01.anim and so_TT_02.anim, whose end frames are recorded when they resolve. No text is tested for null.

Ghidra address:
NTSC-U/C: 0x003128d0
Ghidra address:
PAL: 0x003387d0

Reimplemented from MetScreen.


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