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

Dialogue that shows one message. More...

#include <metmsgscreen.h>

Inheritance diagram for MetMsgScreen:
Collaboration diagram for MetMsgScreen:

Public Member Functions

 MetMsgScreen (MetRenderer *pRenderer, int nPriority)
 Construct the screen.
virtual ~MetMsgScreen ()
 Delete the two-button list and then the one-button list.
void SetButtons (const std::vector< HxStr > &buttons)
 Replace the button labels.
void Refresh ()
 Rebuild the dialogue for the current name, title, text, and button count.
void SetName (const HxStr &name)
 Assign the dialogue name.
void SetTitle (const HxStr &title)
 Assign the title line.
void SetText (const HxStr &text)
 Assign the message text.
virtual void DispatchPriv (Message *pMsg)
 Discard the message's type and forward the message to the owner.
virtual void EnterAndShow ()
 Clear the showing flag, refresh the dialogue, and show the screen.
virtual void BeginExit ()
 Start the exit, or schedule it for a dialogue with no buttons.
virtual void HandleCommand (const MetScreenCommand *pCommand)
 Act on one navigation command.
virtual void PlaySlideSound (int nSelector)
 Play the slide sound when the dialogue has buttons and accepts nSelector.
virtual void PlayLeaveSound (int)
 Silence the leave sound.
virtual void PlayHighSound (int)
 Silence the high sound.
virtual void PlayCycleLeftSound (int nSelector)
 Play the cycle-left sound when the dialogue has two buttons and accepts nSelector.
virtual void PlayCycleRightSound (int nSelector)
 Play the cycle-right sound when the dialogue has two buttons and accepts nSelector.
virtual void UpdateIdle (float flTime)
 Exit once a scheduled exit time has passed.
virtual void OnEnterFinished ()
 Mark the dialogue as showing and tell the owner.
virtual void OnExitFinished ()
 Mark the dialogue as gone and report the choice to the owner.
virtual void ResolveContainerViews ()
 Build the button lists and resolve the dialogue's text objects and button view.
Public Member Functions inherited from MetScreenMultiSoundBank
 MetScreenMultiSoundBank (MetRenderer *pRenderer, int nPriority, const HxStr &name, const HxStr &directory, const HxStr &file)
 Construct a screen that uses the multiplayer sound bank.
virtual ~MetScreenMultiSoundBank ()
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 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 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 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 MetMsgScreen * New (MetRenderer *pRenderer, int nPriority)
 Build the screen on the heap.
static void Show (const HxStr &name, const HxStr &title, const HxStr &text, int nButtons, const std::vector< HxStr > &buttons, MetScreen *pOwner)
 Fill the registered message screen and bring it up.
static void ShowActive (const HxStr &name, const HxStr &title, const HxStr &text, int nButtons, const std::vector< HxStr > &buttons, MetScreen *pOwner)
 Fill the registered message screen and make it the active panel.
static void SetOwnerPad (int nPad)
 Limit the registered message screen to one controller.
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
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

Dialogue that shows one message.

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

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

The constructor at 0x002ec290 takes only the renderer and the load priority, and supplies dlg for the screen name, metagame/Shared for the directory, and dialogue for the container. It zeroes the two button lists, default-constructs the label vector and the three strings, and sets mChoice and mOwnerPad to -1 and mExitTime and mShowing to zero.

It and MetLogoScreen are the only two classes that override slot 3, MsgSink::DispatchPriv, with a body.

The object is 0xe0 bytes, which the factory at 0x002f02c0 fixes by requesting exactly that many with the tag MsgSink.

Apart from the type function and the destructor, the slots that differ from the MetScreenMultiSoundBank table are 3 0x002f0640, 5 0x002f04d0, 9 0x002f0588, 19 0x002ecba0, 20 0x002f0410, 21 0x002f02b8, 22 0x002f02b0, 23 0x002f0450, 24 0x002f0490, 26 0x002f0540, 33 0x002f0500, 36 0x002f05d0, 38 0x002ec6f8.

Constructor & Destructor Documentation

◆ MetMsgScreen()

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

Construct the screen.

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

◆ ~MetMsgScreen()

virtual MetMsgScreen::~MetMsgScreen ( )
virtual

Delete the two-button list and then the one-button list.

Ghidra address:
NTSC-U/C: 0x002ec450
Ghidra address:
PAL: 0x0030fc00

Member Function Documentation

◆ New()

MetMsgScreen * MetMsgScreen::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: 0x002f02c0
Ghidra address:
PAL: 0x00313d38

◆ Show()

void MetMsgScreen::Show ( const HxStr & name,
const HxStr & title,
const HxStr & text,
int nButtons,
const std::vector< HxStr > & buttons,
MetScreen * pOwner )
static

Fill the registered message screen and bring it up.

The screen registered as MetMsgScreen receives the dialogue name, the title, the text, the button count, and the owner, and mOwnerPad becomes -1. A non-empty button list replaces the labels through SetButtons(). A screen already showing is refreshed in place. Otherwise MetSonyScreen pushes the message screen and makes it the active panel. Neither screen lookup is checked for null. The title is inferred.

Parameters
nameThe dialogue name, which the owner's OnMsgScreenShown() and OnMsgScreenDismissed() receive back.
titleThe title line.
textThe message text.
nButtonsThe number of buttons, which picks the one-button or two-button layout.
buttonsThe button labels, or an empty list to retain the current labels.
pOwnerThe screen the dialogue reports to.
Ghidra address:
NTSC-U/C: 0x002ebc98
Ghidra address:
PAL: 0x0030f1d8

◆ ShowActive()

void MetMsgScreen::ShowActive ( const HxStr & name,
const HxStr & title,
const HxStr & text,
int nButtons,
const std::vector< HxStr > & buttons,
MetScreen * pOwner )
static

Fill the registered message screen and make it the active panel.

The same as Show(), except that a screen already showing is also made the active panel again after the refresh. The title is inferred.

Parameters
nameThe dialogue name.
titleThe title line.
textThe message text.
nButtonsThe number of buttons.
buttonsThe button labels, or an empty list to retain the current labels.
pOwnerThe screen the dialogue reports to.
Ghidra address:
NTSC-U/C: 0x002ebf40
Ghidra address:
PAL: 0x0030f4f8

◆ SetOwnerPad()

void MetMsgScreen::SetOwnerPad ( int nPad)
static

Limit the registered message screen to one controller.

Writes mOwnerPad of the screen registered as MetMsgScreen, which Show() and ShowActive() reset to -1. Every caller passes MetSaveRemix::mOwnerPad, the index of the controller that started the save. The result of the cast is not checked. The title is inferred.

Parameters
nPadThe controller index.
Ghidra address:
NTSC-U/C: 0x002f0348
Ghidra address:
PAL: 0x0030f8f0

◆ SetButtons()

void MetMsgScreen::SetButtons ( const std::vector< HxStr > & buttons)

Replace the button labels.

An empty list does nothing. The title is inferred.

Parameters
buttonsThe new labels.
Ghidra address:
NTSC-U/C: 0x002ec5d8
Ghidra address:
PAL: 0x0030fdc0

◆ Refresh()

void MetMsgScreen::Refresh ( )

Rebuild the dialogue for the current name, title, text, and button count.

Hangs dlg_<n>but.view under mButtonView, writes the title and the text, sizes the frame by hanging dlg_small.view, dlg_medium.view, or dlg_large.view under dlg_group.view for fewer than three, fewer than six, or more text lines, labels the buttons of the list the count selects and selects the first, and sets mChoice to -1. The title is inferred.

Ghidra address:
NTSC-U/C: 0x002ecd10
Ghidra address:
PAL: 0x00310640

◆ SetName()

void MetMsgScreen::SetName ( const HxStr & name)
inline

Assign the dialogue name.

Inline. Show() and ShowActive() expand it, and 0x002f0230 is its uncalled out-of-line copy.

Parameters
nameThe new name.
Ghidra address:
NTSC-U/C: 0x002f0230
Ghidra address:
PAL: 0x00313ca8

◆ SetTitle()

void MetMsgScreen::SetTitle ( const HxStr & title)
inline

Assign the title line.

Inline. 0x002f0250 is its uncalled out-of-line copy.

Parameters
titleThe new title.
Ghidra address:
NTSC-U/C: 0x002f0250
Ghidra address:
PAL: 0x00313cc8

◆ SetText()

void MetMsgScreen::SetText ( const HxStr & text)
inline

Assign the message text.

Inline. 0x002f0270 is its uncalled out-of-line copy.

Parameters
textThe new text.
Ghidra address:
NTSC-U/C: 0x002f0270
Ghidra address:
PAL: 0x00313ce8

◆ DispatchPriv()

virtual void MetMsgScreen::DispatchPriv ( Message * pMsg)
virtual

Discard the message's type and forward the message to the owner.

Slot 3. The type is read through Message::Type() and not used.

Parameters
pMsgThe message.
Ghidra address:
NTSC-U/C: 0x002f0640
Ghidra address:
PAL: 0x00313ff0

Reimplemented from MetScreen.

◆ EnterAndShow()

virtual void MetMsgScreen::EnterAndShow ( )
virtual

Clear the showing flag, refresh the dialogue, and show the screen.

Slot 5.

Ghidra address:
NTSC-U/C: 0x002f04d0
Ghidra address:
PAL: 0x00313e80

Reimplemented from MetScreen.

◆ BeginExit()

virtual void MetMsgScreen::BeginExit ( )
virtual

Start the exit, or schedule it for a dialogue with no buttons.

Slot 9.

A dialogue with no buttons records an exit time 480 units after the renderer's current time, which slot 26 then waits for. Any other dialogue exits at once through MetScreen::BeginExit().

Ghidra address:
NTSC-U/C: 0x002f0588
Ghidra address:
PAL: 0x00313f38

Reimplemented from MetScreen.

◆ HandleCommand()

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

Act on one navigation command.

Slot 19.

A dialogue with no buttons ignores every command, and so does a command from a controller other than mOwnerPad when that is not -1. Left and right move the selection through the button list's slots 2 and 3, and select records the selected index as mChoice, clears the active panel, and exits.

Parameters
pCommandThe command.
Ghidra address:
NTSC-U/C: 0x002ecba0
Ghidra address:
PAL: 0x003104b0

Reimplemented from MetScreen.

◆ PlaySlideSound()

virtual void MetMsgScreen::PlaySlideSound ( int nSelector)
virtual

Play the slide sound when the dialogue has buttons and accepts nSelector.

Slot 20.

Parameters
nSelectorThe controller index the sound is for.
Ghidra address:
NTSC-U/C: 0x002f0410
Ghidra address:
PAL: 0x00313dc0

Reimplemented from MetScreenMultiSoundBank.

◆ PlayLeaveSound()

virtual void MetMsgScreen::PlayLeaveSound ( int )
inlinevirtual

Silence the leave sound.

Slot 21, a two-instruction stub.

Ghidra address:
NTSC-U/C: 0x002f02b8
Ghidra address:
PAL: 0x00313d30

Reimplemented from MetScreenMultiSoundBank.

◆ PlayHighSound()

virtual void MetMsgScreen::PlayHighSound ( int )
inlinevirtual

Silence the high sound.

Slot 22, a two-instruction stub.

Ghidra address:
NTSC-U/C: 0x002f02b0
Ghidra address:
PAL: 0x00313d28

Reimplemented from MetScreenMultiSoundBank.

◆ PlayCycleLeftSound()

virtual void MetMsgScreen::PlayCycleLeftSound ( int nSelector)
virtual

Play the cycle-left sound when the dialogue has two buttons and accepts nSelector.

Slot 23.

Parameters
nSelectorThe controller index the sound is for.
Ghidra address:
NTSC-U/C: 0x002f0450
Ghidra address:
PAL: 0x00313e00

Reimplemented from MetScreenMultiSoundBank.

◆ PlayCycleRightSound()

virtual void MetMsgScreen::PlayCycleRightSound ( int nSelector)
virtual

Play the cycle-right sound when the dialogue has two buttons and accepts nSelector.

Slot 24.

Parameters
nSelectorThe controller index the sound is for.
Ghidra address:
NTSC-U/C: 0x002f0490
Ghidra address:
PAL: 0x00313e40

Reimplemented from MetScreenMultiSoundBank.

◆ UpdateIdle()

virtual void MetMsgScreen::UpdateIdle ( float flTime)
virtual

Exit once a scheduled exit time has passed.

Slot 26.

A zero mExitTime does nothing. Otherwise a time past it clears mExitTime and exits through MetScreen::BeginExit() directly.

Parameters
flTimeThe renderer's current time.
Ghidra address:
NTSC-U/C: 0x002f0540
Ghidra address:
PAL: 0x00313ef0

Reimplemented from MetScreen.

◆ OnEnterFinished()

virtual void MetMsgScreen::OnEnterFinished ( )
virtual

Mark the dialogue as showing and tell the owner.

Slot 33.

Ghidra address:
NTSC-U/C: 0x002f0500
Ghidra address:
PAL: 0x00313eb0

Reimplemented from MetScreen.

◆ OnExitFinished()

virtual void MetMsgScreen::OnExitFinished ( )
virtual

Mark the dialogue as gone and report the choice to the owner.

Slot 36.

The owner's OnMsgScreenDismissed() receives mName and mChoice.

Ghidra address:
NTSC-U/C: 0x002f05d0
Ghidra address:
PAL: 0x00313f80

Reimplemented from MetScreen.

◆ ResolveContainerViews()

virtual void MetMsgScreen::ResolveContainerViews ( )
virtual

Build the button lists and resolve the dialogue's text objects and button view.

Slot 38.

The two-button list holds dlg2_01.but and dlg2_02.but, and the one-button list holds dlg1_01.but, each with an empty label. dlg_warning.txt receives the title, dlg_message.txt the message, and dlg_buts.view the button layout.

Ghidra address:
NTSC-U/C: 0x002ec6f8
Ghidra address:
PAL: 0x0030ff00

Reimplemented from MetScreen.


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