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

Dialogue that writes a persona to a memory card, copies it to another card, or deletes it. More...

#include <metpersonasaverscreen.h>

Inheritance diagram for MetPersonaSaverScreen:
Collaboration diagram for MetPersonaSaverScreen:

Public Member Functions

 MetPersonaSaverScreen (MetRenderer *pRenderer, int nPriority)
 Construct the screen.
virtual ~MetPersonaSaverScreen ()
 Delete the loaded roster.
virtual void EnterAndShow ()
 Hide the screen.
virtual void OnPanelActivated ()
 Start the request.
virtual void BeginExit ()
 Exit to the screens the request listed.
virtual void OnMsgScreenDismissed (const HxStr &name, int nChoice)
 Act on a dismissed dialogue.
virtual void ResolveContainerViews ()
 Resolve the container views.
virtual void OnConnectState (MemcardConnectState state, int nStatus)
 Check the target card, then load its roster.
virtual void OnCardFormatted (int nPortSlot, int nStatus)
 Report a finished format.
virtual void OnPersonasSaved (int nPortSlot, int nStatus)
 Report a finished roster save.
virtual void OnPersonasLoaded (int nPortSlot, int nStatus)
 Merge the persona into the loaded roster and save it.
virtual void OnKeyboardTextEntered (const HxStr &text)
 Take the name the keyboard committed as the persona's FreQ name.
virtual void PlayCycleLeftSound (int)
 Silence the cycle-left sound.
virtual void PlayCycleRightSound (int)
 Silence the cycle-right sound.
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 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 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 HandleCommand (const MetScreenCommand *pCommand)
 Act on a navigation command.
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 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 OnExitFinished ()
 Act on the exit animation having finished.
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 MemcardUser
virtual ~MemcardUser ()
 Release the receiver.
virtual void OnAllConnectStates ()
 Report that every slot has been enquired about.
virtual void OnMinimumSaveSpace (int nPortSlot, int nSpace)
 Report the space a save would need against the space a card has.
virtual void OnCardUnformatted (int nPortSlot, int nStatus)
 Report a finished unformat.
virtual void OnRemixSaved (int nPortSlot, int nStatus)
 Report a finished save of one remix.
virtual void OnGlobalSettingsSaved (int nPortSlot, int nStatus)
 Report a finished save of the global settings.
virtual void OnJukeboxPlayListSaved (int nPortSlot, int nStatus)
 Report a finished save of a jukebox playlist.
virtual void OnRemixesListed (int nPortSlot, int nStatus)
 Report a finished listing of the saved remixes.
virtual void OnRemixLoaded (int nPortSlot, int nStatus)
 Report a finished load of one remix.
virtual void OnGlobalSettingsLoaded (int nPortSlot, int nStatus)
 Report a finished load of the global settings.
virtual void OnJukeboxPlayListLoaded (int nPortSlot, int nStatus)
 Report a finished load of a jukebox playlist.
virtual void OnRemixDeleted (int nPortSlot, int nStatus)
 Report a finished deletion of one remix.
virtual void UnusedFirstReport (int nPortSlot, int nStatus)
 Do nothing.
virtual void UnusedSecondReport (int nPortSlot, int nStatus)
 Do nothing.
virtual void OnFileLoaded (int nStatus)
 Report a finished load of one file.
virtual void OnFileSaved (int nStatus)
 Report a finished save of one file.
Public Member Functions inherited from MetKBUser
virtual ~MetKBUser ()

Static Public Member Functions

static MetPersonaSaverScreen * New (MetRenderer *pRenderer, int nPriority)
 Build the screen on the heap.
static void StartSave (const std::vector< HxStr > &screens, MetPersonaData *pPersona, const MemcardConnectState &slot, int nConfirmReplace, int nIsCopy)
 Hand a save request to the registered saver screen and show it over MetLoadGameScreen.
static void StartDelete (const std::vector< HxStr > &screens, MetPersonaData *pPersona, const MemcardConnectState &slot)
 Hand a delete request to the registered saver screen and show it over MetLoadGameScreen.
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

Dialogue that writes a persona to a memory card, copies it to another card, or deletes it.

Its RTTI descriptor is at 0x008f0060. It has three public non-virtual bases at fixed offsets: MetScreen at +0x00, MemcardUser at +140, and MetKBUser at +144. New() allocates 0xd8 bytes.

The 39-entry primary vtable at 0x00805600 is the same length as the MetScreen table, and the class declares no new virtual. The twenty-one-entry MemcardUser table at 0x00805550 adjusts this by -140 in every entry, and the three-entry MetKBUser table at 0x00805530 by -144.

The constructor at 0x0032ece0 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 mIsCopy, mConfirmReplace, and mRefreshingSettingsCard, and default-constructs the vectors and mTargetSlot.

A request runs as a chain of memory-card tasks. OnPanelActivated() starts CommitSave(), and CommitSave() requests the target card's state. OnConnectState() checks the card and loads its roster, OnPersonasLoaded() merges the persona into the roster and saves it, and OnPersonasSaved() refreshes the load list. Every failure raises a MetMsgScreen dialogue that OnMsgScreenDismissed() acts on.

Constructor & Destructor Documentation

◆ MetPersonaSaverScreen()

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

Construct the screen.

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

◆ ~MetPersonaSaverScreen()

virtual MetPersonaSaverScreen::~MetPersonaSaverScreen ( )
virtual

Delete the loaded roster.

Ghidra address:
NTSC-U/C: 0x0032f020
Ghidra address:
PAL: 0x003576d0

Member Function Documentation

◆ New()

MetPersonaSaverScreen * MetPersonaSaverScreen::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: 0x00338f98
Ghidra address:
PAL: 0x00362f70

◆ StartSave()

void MetPersonaSaverScreen::StartSave ( const std::vector< HxStr > & screens,
MetPersonaData * pPersona,
const MemcardConnectState & slot,
int nConfirmReplace,
int nIsCopy )
static

Hand a save request to the registered saver screen and show it over MetLoadGameScreen.

The saver is resolved under MetPersonaSaverScreen and narrowed with dynamic_cast, and the result is used without a null test. After SetSaveRequest(), mIsCopy takes nIsCopy, mConfirmReplace takes nConfirmReplace, and mIsDelete is cleared. The screen registered under MetLoadGameScreen then pushes the saver and activates it. MetStageFinishScreen, the FreQ maker, and the memory-card screens call it.

Parameters
screensThe registry keys of the screens to return to.
pPersonaThe persona to save.
slotThe card location.
nConfirmReplaceNon-zero to prompt before saving over a persona of the same name.
nIsCopyNon-zero for a copy to another card.
Ghidra address:
NTSC-U/C: 0x0032e858
Ghidra address:
PAL: 0x00356da0

◆ StartDelete()

void MetPersonaSaverScreen::StartDelete ( const std::vector< HxStr > & screens,
MetPersonaData * pPersona,
const MemcardConnectState & slot )
static

Hand a delete request to the registered saver screen and show it over MetLoadGameScreen.

The same sequence as StartSave(), except that mIsDelete is set to 1 and mIsCopy and mConfirmReplace are cleared. MetMCFreqDelScreen's slot 15 is the caller. The title is inferred.

Parameters
screensThe registry keys of the screens to return to.
pPersonaThe persona to delete.
slotThe card location.
Ghidra address:
NTSC-U/C: 0x0032eaa8
Ghidra address:
PAL: 0x00357068

◆ EnterAndShow()

virtual void MetPersonaSaverScreen::EnterAndShow ( )
virtual

Hide the screen.

Slot 5.

The body is SetShowing(0) alone, and MetScreen::EnterAndShow() does not run.

Ghidra address:
NTSC-U/C: 0x003390c0
Ghidra address:
PAL: 0x00363098

Reimplemented from MetScreen.

◆ OnPanelActivated()

virtual void MetPersonaSaverScreen::OnPanelActivated ( )
virtual

Start the request.

Slot 7.

Clears mRefreshingSettingsCard and runs CommitSave().

Ghidra address:
NTSC-U/C: 0x003390f0
Ghidra address:
PAL: 0x003630c8

Reimplemented from MetScreen.

◆ BeginExit()

virtual void MetPersonaSaverScreen::BeginExit ( )
virtual

Exit to the screens the request listed.

Slot 9.

The screen is removed from the renderer, each screen in mReturnScreens is pushed, and the first is made the active panel.

Ghidra address:
NTSC-U/C: 0x00339110
Ghidra address:
PAL: 0x003630e8

Reimplemented from MetScreen.

◆ OnMsgScreenDismissed()

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

Act on a dismissed dialogue.

Slot 15.

mem_check exits on its second button and retries otherwise. mem_format_check formats the card on its second button and retries otherwise. mem_format_done retries. format_fail retries on its first button and raises no_save_warn otherwise. The two no-space dialogues retry on their first button and exit otherwise. freq_replace saves over the old persona on its second button, and both it and new_name_required otherwise open the keyboard for a new FreQ name. freq_limit and any other dialogue exit.

In the European release the second button of mem_check and of the no-space dialogues runs LeaveWithoutSaving(), as does no_save_warn. Declining mem_format_check raises save_fail_no_format with the Save aborted. text. That dialogue acts like the no-space dialogues. The second button of freq_replace_catastrophe copies the persona over the load-list entry with the same name and runs BeginExit(), and the first opens the keyboard.

Parameters
nameThe dialogue that was dismissed.
nChoiceThe button chosen.
Ghidra address:
NTSC-U/C: 0x003346c8
Ghidra address:
PAL: 0x0035dbd8

Reimplemented from MetScreen.

◆ ResolveContainerViews()

virtual void MetPersonaSaverScreen::ResolveContainerViews ( )
virtual

Resolve the container views.

Slot 38, the MetScreen body alone.

Ghidra address:
NTSC-U/C: 0x003390a0
Ghidra address:
PAL: 0x00363078

Reimplemented from MetScreen.

◆ OnConnectState()

virtual void MetPersonaSaverScreen::OnConnectState ( MemcardConnectState state,
int nStatus )
virtual

Check the target card, then load its roster.

MemcardUser slot 2.

After a save to the settings card (mRefreshingSettingsCard set), the state is recorded as the first GlobalSettings::mCardSlots entry and MetMsgScreen exits. A save or copy to a card with less free space than GlobalSettings::mPersonaMinimumFreeClusters raises a no-space dialogue. Otherwise the roster is loaded into mPersonas and the progress dialogue for the save, the delete, or the copy is raised. An unformatted card raises mem_format_check, and a failed enquiry mem_check.

The European release omits the free-space test, treats a status of kMemcardStatusNotFormatted as an unformatted card, and raises the deleting dialogue for a delete. The North American release raises the save dialogue for a delete. A save that finds no card identifies the first card slot through FirstCardSlotName().

Parameters
stateThe card's state, passed by value.
nStatusThe enquiry status.
Ghidra address:
NTSC-U/C: 0x0032f5a0
Ghidra address:
PAL: 0x00357ca8

Reimplemented from MemcardUser.

◆ OnCardFormatted()

virtual void MetPersonaSaverScreen::OnCardFormatted ( int nPortSlot,
int nStatus )
virtual

Report a finished format.

MemcardUser slot 5.

Success and status 13 both raise mem_format_done as the active panel, with the format_success or format_already text. Any other status raises format_fail.

Parameters
nPortSlotThe packed port and slot. The body does not read it.
nStatusThe format status.
Ghidra address:
NTSC-U/C: 0x00331358
Ghidra address:
PAL: 0x00359ed0

Reimplemented from MemcardUser.

◆ OnPersonasSaved()

virtual void MetPersonaSaverScreen::OnPersonasSaved ( int nPortSlot,
int nStatus )
virtual

Report a finished roster save.

MemcardUser slot 7.

Success on the settings card copies the roster into MetPersonaData::loadList(), sets mRefreshingSettingsCard, and requests the card's state again. Success elsewhere exits MetMsgScreen. A full card raises a no-space dialogue, status 15 the no-card dialogue, and any other status save_fail_no_space with the save_fail_general text. In the European release both no-space texts receive nKilobytes.

Parameters
nPortSlotThe packed port and slot the roster went to.
nStatusThe save status.
nKilobytesThe kilobytes the card lacked. European release only.
Ghidra address:
NTSC-U/C: 0x00333210
Ghidra address:
PAL: 0x0035c120

Reimplemented from MemcardUser.

◆ OnPersonasLoaded()

virtual void MetPersonaSaverScreen::OnPersonasLoaded ( int nPortSlot,
int nStatus )
virtual

Merge the persona into the loaded roster and save it.

MemcardUser slot 13.

A persona without a name raises new_name_required. The roster is searched by the name the persona was last loaded under and by its present name. A delete removes the old entry, or raises mem_check when there is none. A renamed persona whose new name is taken raises new_name_required. A persona whose name is taken replaces that entry, after prompting when mConfirmReplace is set. Any other persona is appended, unless CheckPersonaLimit() refuses. Neither argument is read.

Parameters
nPortSlotThe packed port and slot.
nStatusThe load status.
Ghidra address:
NTSC-U/C: 0x00332428
Ghidra address:
PAL: 0x0035b1a8

Reimplemented from MemcardUser.

◆ OnKeyboardTextEntered()

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

Take the name the keyboard committed as the persona's FreQ name.

MetKBUser slot 2, in the secondary table at 0x00805530 with a -144 adjustment. The body is MetPersonaData::SetName() expanded in place.

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

Implements MetKBUser.

◆ PlayCycleLeftSound()

virtual void MetPersonaSaverScreen::PlayCycleLeftSound ( int )
inlinevirtual

Silence the cycle-left sound.

Both overrides are two-instruction stubs, written inline with an empty body.

Ghidra address:
NTSC-U/C: 0x00338f88
Ghidra address:
PAL: 0x00362dc8

Reimplemented from MetScreen.

◆ PlayCycleRightSound()

virtual void MetPersonaSaverScreen::PlayCycleRightSound ( int )
inlinevirtual

Silence the cycle-right sound.

Ghidra address:
NTSC-U/C: 0x00338f90
Ghidra address:
PAL: 0x00362dd0

Reimplemented from MetScreen.


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