resonance 1.0.1
Loading...
Searching...
No Matches
metpersonasaverscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
7#include "met/metkbuser.h"
9#include "met/metscreen.h"
10#include "os/hxstr.h"
11
34class MetPersonaSaverScreen : public MetScreen, public MemcardUser, public MetKBUser {
35public:
44 MetPersonaSaverScreen(MetRenderer *pRenderer, int nPriority);
45
53
63 static MetPersonaSaverScreen *New(MetRenderer *pRenderer, int nPriority);
64
82 static void StartSave(const std::vector<HxStr> &screens,
83 MetPersonaData *pPersona,
84 const MemcardConnectState &slot,
85 int nConfirmReplace,
86 int nIsCopy);
87
101 static void StartDelete(const std::vector<HxStr> &screens,
102 MetPersonaData *pPersona,
103 const MemcardConnectState &slot);
104
113 virtual void EnterAndShow();
114
123 virtual void OnPanelActivated();
124
134 virtual void BeginExit();
135
157 virtual void OnMsgScreenDismissed(const HxStr &name, int nChoice);
158
165 virtual void ResolveContainerViews();
166
187 virtual void OnConnectState(MemcardConnectState state, int nStatus);
188
200 virtual void OnCardFormatted(int nPortSlot, int nStatus);
201
217#ifdef VIDEO_STANDARD_PAL
218 virtual void OnPersonasSaved(int nPortSlot, int nStatus, int nKilobytes);
219#else
220 virtual void OnPersonasSaved(int nPortSlot, int nStatus);
221#endif
222
238 virtual void OnPersonasLoaded(int nPortSlot, int nStatus);
239
250 virtual void OnKeyboardTextEntered(const HxStr &text);
251
260 virtual void PlayCycleLeftSound(int) {
261 }
262
269 virtual void PlayCycleRightSound(int) {
270 }
271
272private:
284 void CommitSave();
285
295 void ClearPersonas();
296
306 int CheckPersonaLimit();
307
316 void SyncActivePersona();
317
329#ifdef VIDEO_STANDARD_PAL
330 void AskToReplace(int bInLoadList);
331
341 void KeepInLoadList();
342
350 void LeaveWithoutSaving();
351#else
352 void AskToReplace();
353#endif
354
367 void SetSaveRequest(const std::vector<HxStr> &screens,
368 MetPersonaData *pPersona,
369 const MemcardConnectState &slot);
370
371 // 1 for a delete request from StartDelete(), cleared by StartSave(). The constructor does not
372 // write it. +0x94
373 int mIsDelete;
374 // Non-zero for a copy to another card. Written by StartSave() from its last argument. +0x98
375 int mIsCopy;
376 // Non-zero to prompt before saving over a persona of the same name. Written by StartSave() from
377 // its fourth argument. +0x9c
378 int mConfirmReplace;
379 // The roster loaded from the target card. ClearPersonas() deletes every element. +0xa0
380 std::vector<MetPersonaData *> mPersonas;
381 // The registry keys of the screens to return to after the request. +0xac
382 std::vector<HxStr> mReturnScreens;
383 // The persona to save, recorded by SetSaveRequest(). Not written by the constructor. +0xb8
384 MetPersonaData *mPersona;
385 // Set while the settings card's state is being read again after a save. +0xbc
386 int mRefreshingSettingsCard;
387 // The card location to save to. The constructor's inline MemcardConnectState construction
388 // stores mType, mFormatted, and mFree out of offset order. +0xc0
389 MemcardConnectState mTargetSlot;
390};
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Receiver notified once a memory-card task has finished.
Definition memcarduser.h:24
Mix-in for a screen that receives text from the front-end keyboard.
Definition metkbuser.h:24
Saved record of one player persona.
Definition metpersonadata.h:39
virtual void OnCardFormatted(int nPortSlot, int nStatus)
Report a finished format.
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.
virtual void EnterAndShow()
Hide the screen.
virtual void BeginExit()
Exit to the screens the request listed.
virtual void OnPersonasLoaded(int nPortSlot, int nStatus)
Merge the persona into the loaded roster and save it.
static MetPersonaSaverScreen * New(MetRenderer *pRenderer, int nPriority)
Build the screen on the heap.
virtual void PlayCycleRightSound(int)
Silence the cycle-right sound.
Definition metpersonasaverscreen.h:269
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.
virtual void OnKeyboardTextEntered(const HxStr &text)
Take the name the keyboard committed as the persona's FreQ name.
virtual ~MetPersonaSaverScreen()
Delete the loaded roster.
virtual void OnPanelActivated()
Start the request.
virtual void OnConnectState(MemcardConnectState state, int nStatus)
Check the target card, then load its roster.
virtual void PlayCycleLeftSound(int)
Silence the cycle-left sound.
Definition metpersonasaverscreen.h:260
MetPersonaSaverScreen(MetRenderer *pRenderer, int nPriority)
Construct the screen.
virtual void OnMsgScreenDismissed(const HxStr &name, int nChoice)
Act on a dismissed dialogue.
virtual void ResolveContainerViews()
Resolve the container views.
virtual void OnPersonasSaved(int nPortSlot, int nStatus)
Report a finished roster save.
Front-end renderer that owns the screen stack and drives every MetScreen.
Definition metrenderer.h:68
MetScreen(MetRenderer *pRenderer, int nPriority, const HxStr &name, const HxStr &directory, const HxStr &file)
Construct a screen and start its container load.
What one card slot reports about itself, and the memory-card location the front end stores.
Definition memcardconnectstate.h:21