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

Screen that creates a new FreQ identity and takes its name from the keyboard. More...

#include <metloadnewfreqscreen.h>

Inheritance diagram for MetLoadNewFreqScreen:
Collaboration diagram for MetLoadNewFreqScreen:

Public Member Functions

 MetLoadNewFreqScreen (MetRenderer *pRenderer, int nPriority)
 Construct the screen.
virtual ~MetLoadNewFreqScreen ()
virtual void EnterAndShow ()
 Set the screen title and the prompt layout, then enter.
virtual void BeginExit ()
 Exit the prompt screen alongside this one, then begin the exit.
virtual void OnKeyboardDismissed ()
 Restore this screen after the keyboard closes.
virtual void OnMsgScreenDismissed (const HxStr &name, int nChoice)
 Restore this screen after a message screen is dismissed.
virtual void UpdateNameLabel ()
 Write the nf_enter label into the first button.
virtual void OnNameButton ()
 Open the keyboard to type a name for the new identity.
virtual void PrepareFreqMakerForSelection ()
 Hand the selected identity to the FreQ maker.
virtual void OnCreateButton ()
 Create a new identity in the FreQ maker.
virtual void AcquireIdentityList ()
 Take the list of prefabricated identities the FreQ maker offers.
virtual void BuildButtonList ()
 Rebuild the button ring with a label on each of the three buttons.
virtual void OnKeyboardTextEntered (const HxStr &text)
 Record the name the keyboard committed on the selected identity.
Public Member Functions inherited from MetLoadFreqBaseScreen
 MetLoadFreqBaseScreen (MetRenderer *pRenderer, int nPriority)
 Construct the screen.
virtual ~MetLoadFreqBaseScreen ()
virtual void HandleCommand (const MetScreenCommand *pCommand)
 Act on one navigation command.
virtual void PlayCycleLeftSound (int nSelector)
 Play the cycle-left sound while the carousel is selected and has more than one entry.
virtual void PlayCycleRightSound (int nSelector)
 Play the cycle-right sound under the same two conditions as PlayCycleLeftSound().
virtual void OnRepeatingSoundFinished (Rnd::Button *pButton)
 Start the exit animation once the selected button has finished alternating.
virtual void OnExitFinished ()
 Act on the departure the exit animation has just finished.
virtual void ResolveContainerViews ()
 Resolve the two cycle arrows after the container load.
virtual void OnEditButton ()
 Act on the second button, whose prompt is cid_edit.
virtual void UpdateCycleArrows ()
 Show the two cycle arrows only while more than one identity exists.
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 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 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 PlayErrorSound (int nSelector)
 Play the sound that accompanies a rejected input.
virtual void UpdateIdle (float flTime)
 Advance whatever the screen updates once per frame while it is idle.
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 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.
Public Member Functions inherited from MetKBUser
virtual ~MetKBUser ()

Static Public Member Functions

static MetScreen * New (MetRenderer *pRenderer, int nPriority)
 Produce a new-identity load screen on the heap.
Static Public Member Functions inherited from MetLoadFreqBaseScreen
static MetScreen * New (MetRenderer *pRenderer, int nPriority)
 Produce a base load 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 MetLoadFreqBaseScreen
void RefreshSelection ()
 Reapply the selected identity to the preview and the label.
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 MetLoadFreqBaseScreen
std::vector< MetPersonaData * > * mIdentityList
MetButtonList * mButtonList
int mSelectedIdentity
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

Screen that creates a new FreQ identity and takes its name from the keyboard.

Its RTTI descriptor is at 0x008f08d0. It has two public non-virtual bases at fixed offsets, MetLoadFreqBaseScreen at +0x00 and MetKBUser at +164. The 47-entry primary vtable is at 0x007f83a8 and the three-entry MetKBUser table at 0x007f8388 adjusts this by -164. That table is where this screen supplies the one MetKBUser pure virtual. The primary is the same length as the MetLoadFreqBaseScreen table, and the class declares no new virtual.

The class declares one data member and the object is therefore at least 0xac bytes. mNameEntered sits above the four bytes of the MetKBUser vptr, and EnterAndShow(), OnKeyboardDismissed(), and OnKeyboardTextEntered() all address it.

The constructor at 0x002a8418 takes only the renderer and the load priority and runs the MetLoadFreqBaseScreen constructor at 0x00291e00. The destructor at 0x002a8458 restores the primary vptr, restores the MetKBUser vptr to 0x007f16a0, runs the MetLoadFreqBaseScreen destructor, and releases the object with the tag MsgSink.

Twelve slots differ from the MetLoadFreqBaseScreen table, and a diff of the two tables reads slots 1, 5, 9, 11, 15, 39, 40, 41, 43, 44, and 45 apart from the type function. This is the only class in the subsystem that fills slot 11. Every other class inherits slot 11 as a two-instruction stub.

The screen labels all three buttons from configuration code 0x258, under the keys nf_enter, nf_edit, and nf_create, and none of the three shows the selected username. The first button opens the keyboard rather than committing a selection. The keyboard button is the whole difference from MetLoadFreqScreen.

Constructor & Destructor Documentation

◆ MetLoadNewFreqScreen()

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

Construct the screen.

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

◆ ~MetLoadNewFreqScreen()

virtual MetLoadNewFreqScreen::~MetLoadNewFreqScreen ( )
virtual
Ghidra address:
NTSC-U/C: 0x002a8458
Ghidra address:
PAL: 0x002c6938

Member Function Documentation

◆ New()

MetScreen * MetLoadNewFreqScreen::New ( MetRenderer * pRenderer,
int nPriority )
static

Produce a new-identity load screen on the heap.

The front end's screen factory at 0x00385180 is the caller.

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

◆ EnterAndShow()

virtual void MetLoadNewFreqScreen::EnterAndShow ( )
virtual

Set the screen title and the prompt layout, then enter.

Slot 5. The title comes from configuration code 0x269 under the key create_char, and the prompt layout is standard_title. mNameEntered is cleared on both paths. The MetLoadFreqBaseScreen body then runs as a direct call.

Ghidra address:
NTSC-U/C: 0x002a3890
Ghidra address:
PAL: 0x002c1698

Reimplemented from MetLoadFreqBaseScreen.

◆ BeginExit()

virtual void MetLoadNewFreqScreen::BeginExit ( )
virtual

Exit the prompt screen alongside this one, then begin the exit.

Slot 9. The prompt screen is exited only while a departure is already recorded in MetScreen::mExitChoice and the first button is the selected one. The MetScreen body then runs as a direct call on every path.

Ghidra address:
NTSC-U/C: 0x002a84c0
Ghidra address:
PAL: 0x002c17b8

Reimplemented from MetScreen.

◆ OnKeyboardDismissed()

virtual void MetLoadNewFreqScreen::OnKeyboardDismissed ( )
virtual

Restore this screen after the keyboard closes.

Slot 11. A set mNameEntered records that OnKeyboardTextEntered() accepted a name, and the screen then stays as OnKeyboardTextEntered() arranged it. A clear mNameEntered is the user cancelling, and this screen and the prompt screen are pushed again.

Ghidra address:
NTSC-U/C: 0x002a3978
Ghidra address:
PAL: 0x002c18a8

Reimplemented from MetScreen.

◆ OnMsgScreenDismissed()

virtual void MetLoadNewFreqScreen::OnMsgScreenDismissed ( const HxStr & name,
int nChoice )
virtual

Restore this screen after a message screen is dismissed.

Slot 15. Only namenogood, the rejected-name dialogue, is handled. The help screen and this screen are pushed again and this screen is activated. The European release passes any other dialogue to MetLoadFreqBaseScreen.

Parameters
nameThe message screen that was dismissed.
nChoiceThe response.
Ghidra address:
NTSC-U/C: 0x002a4910
Ghidra address:
PAL: 0x002c2bc8

Reimplemented from MetScreen.

◆ UpdateNameLabel()

virtual void MetLoadNewFreqScreen::UpdateNameLabel ( )
virtual

Write the nf_enter label into the first button.

Slot 39. Unlike the base and unlike MetLoadFreqScreen, the override shows no username. The label comes from configuration code 0x258 under the key nf_enter.

Ghidra address:
NTSC-U/C: 0x002a85c0
Ghidra address:
PAL: 0x002c69d8

Reimplemented from MetLoadFreqBaseScreen.

◆ OnNameButton()

virtual void MetLoadNewFreqScreen::OnNameButton ( )
virtual

Open the keyboard to type a name for the new identity.

Slot 40. A MetKeyboardRequest is built with this screen's registry key, the prompt FreQ name, an empty initial text, -1 for any controller, and the MetKBUser subobject as the receiver. The width is 176, the length 12, and the ticker name_new_freq_ticker, and the request is then passed to MetKeyboardScreen::Open().

Ghidra address:
NTSC-U/C: 0x002a4108
Ghidra address:
PAL: 0x002c21e8

Reimplemented from MetLoadFreqBaseScreen.

◆ PrepareFreqMakerForSelection()

virtual void MetLoadNewFreqScreen::PrepareFreqMakerForSelection ( )
virtual

Hand the selected identity to the FreQ maker.

Slot 41. The selected identity goes to MetFreqMakerCanvasScreen::LoadPrefab() with no randomisation, the editing mode is selected through MetFreqMakerButtonsScreen::SetEditing(), MetFreqMakerButtonsScreen::mNewPersona is set, and MetLoadNewFreqScreen is recorded in MetFrontEndState::mReturnScreen.

Ghidra address:
NTSC-U/C: 0x002a3f80
Ghidra address:
PAL: 0x002c2000

Reimplemented from MetLoadFreqBaseScreen.

◆ OnCreateButton()

virtual void MetLoadNewFreqScreen::OnCreateButton ( )
virtual

Create a new identity in the FreQ maker.

Slot 43. MetLoadNewFreqScreen is recorded in MetFrontEndState::mReturnScreen, and then MetLoadFreqBaseScreen::OnCreateButton() runs. The European release is slot 49, and it runs MetLoadFreqBaseScreen::OpenFreqMakerForCreate() through the vtable instead.

Ghidra address:
NTSC-U/C: 0x002a8670
Ghidra address:
PAL: 0x002c6aa0

Reimplemented from MetLoadFreqBaseScreen.

◆ AcquireIdentityList()

virtual void MetLoadNewFreqScreen::AcquireIdentityList ( )
virtual

Take the list of prefabricated identities the FreQ maker offers.

Slot 44.

Ghidra address:
NTSC-U/C: 0x002a8590
Ghidra address:
PAL: 0x002c69a8

Reimplemented from MetLoadFreqBaseScreen.

◆ BuildButtonList()

virtual void MetLoadNewFreqScreen::BuildButtonList ( )
virtual

Rebuild the button ring with a label on each of the three buttons.

Slot 45. All three labels come from configuration code 0x258, under the keys nf_enter, nf_edit, and nf_create. UpdateNameLabel() then runs before the prompt list is rebuilt and overwrites the first label with the same nf_enter string. That is what the binary does. The three prompts are the same three the base appends.

Ghidra address:
NTSC-U/C: 0x002a3b08
Ghidra address:
PAL: 0x002c1a98

Reimplemented from MetLoadFreqBaseScreen.

◆ OnKeyboardTextEntered()

virtual void MetLoadNewFreqScreen::OnKeyboardTextEntered ( const HxStr & text)
virtual

Record the name the keyboard committed on the selected identity.

MetKBUser slot 2, in the secondary table at 0x007f8388 with a -164 adjustment. The committed text replaces the selected identity's username, and an empty commit retains the username the identity already had by assigning it over the empty text first. mNameEntered is set to 1 before either assignment for OnKeyboardDismissed() to read.

A current date from FormatCurrentDateTime() replaces the identity's birthday at +0x154. The game manager's personas are then replaced by a copy of the identity, and the first of them goes to MetPersonaSaverScreen::StartSave() with the first card slot of GlobalSettings, 1, and 0. The screens to return to are MetNetPortalScreen in a network game and MetModeScreen otherwise, each followed by MetLeftGizmoScreen and MetHelpScreen.

Parameters
textThe text the user entered.
Ghidra address:
NTSC-U/C: 0x002a4340
Ghidra address:
PAL: 0x002c2548

Implements MetKBUser.


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