resonance 1.0.1
Loading...
Searching...
No Matches
metsaveremixscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "met/metsaveremix.h"
6#include "os/hxstr.h"
7
8class MetButtonList;
10class MetRemixSaver;
11
12namespace Rnd {
13class Object;
14class Text;
15} // namespace Rnd
16
68public:
77 MetSaveRemixScreen(MetRenderer *pRenderer, int nPriority);
78
84
94 static MetSaveRemixScreen *New(MetRenderer *pRenderer, int nPriority);
95
116 static void Open(MetPersonaData *pPersona,
117 int nPad,
118 MetRemixSaver *pSaver,
119 const MemcardConnectState &slot,
120 const std::vector<FreqAppearance> &appearances,
121 int bClearName);
122
130 void SetPersona(MetPersonaData *pPersona);
131
139 void SetOwnerPad(int nPad);
140
148 void SetSaver(MetRemixSaver *pSaver);
149
157 void SetAppearances(const std::vector<FreqAppearance> &appearances);
158
166 void SetEnteredName(const HxStr &text);
167
187 virtual void EnterAndShow();
188
200 virtual void OnPanelActivated();
201
215 virtual void OnMsgScreenDismissed(const HxStr &name, int nChoice);
216
232 virtual void HandleCommand(const MetScreenCommand *pCommand);
233
244 virtual void PlaySlideSound(int nSelector);
245
256 virtual void PlayLeaveSound(int) {
257 }
258
265 virtual void PlayHighSound(int) {
266 }
267
274 virtual void PlayCycleLeftSound(int) {
275 }
276
283 virtual void PlayCycleRightSound(int) {
284 }
285
297 virtual void OnRepeatingSoundFinished(Rnd::Button *pButton);
298
311 virtual void OnExitFinished();
312
324 virtual void ResolveContainerViews();
325
334 virtual void OnSaveAbandoned();
335
344 virtual void OnSaveDialogueClosed();
345
359
371 virtual void OnKeyboardTextEntered(const HxStr &text);
372
373private:
374 // The one-button list ResolveContainerViews() fills with `save_copy.but`. +0xe8
375 MetButtonList *mButtonList;
376 // The persona saving the remix. Open() stores it, and EnterAndShow() falls back to
377 // MetFrontEndState::GetFirstPersona() when it is null. +0xec
378 MetPersonaData *mPersona;
379 Rnd::Text *mFreqNameText; // +0xf0, `ers_freqname_player.txt`
380 Rnd::Text *mInstructionsText; // +0xf4, `ers_instructions.txt`
381 // The text object the entered name is drawn into, `ers_remix_title_val.txt`. +0xf8
382 Rnd::Text *mRemixNameText;
383 // The screen that asked for the save, which Open() stores through SetSaver(). Slots 7, 15,
384 // 30, 40, and 41 and HandleCommand() dispatch its slots 2, 3, and 4. +0xfc
385 MetRemixSaver *mSaver;
386 // Set once the user has declined the save. Slot 36 tests and clears it. +0x100
387 int mDeclined;
388 // The name typed last, recorded by select. EnterAndShow() shows it when it is not empty.
389 // Default-constructed, and its buffer is what the destructor releases at `+0x108`. +0x104
390 HxStr mEnteredName;
391};
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Ring of front-end buttons with one of them selected.
Definition metbuttonlist.h:34
Saved record of one player persona.
Definition metpersonadata.h:39
Mix-in for a screen that writes a remix to a memory card.
Definition metremixsaver.h:26
Front-end renderer that owns the screen stack and drives every MetScreen.
Definition metrenderer.h:68
virtual void PlayCycleLeftSound(int)
Silence the cycle-left sound.
Definition metsaveremixscreen.h:274
virtual void ResolveContainerViews()
Resolve the three text objects the screen draws into.
static void Open(MetPersonaData *pPersona, int nPad, MetRemixSaver *pSaver, const MemcardConnectState &slot, const std::vector< FreqAppearance > &appearances, int bClearName)
Fill the registered save screen with a save request and bring it up over MetLoadGameScreen.
void SetSaver(MetRemixSaver *pSaver)
Store the screen slots 40 and 41 report back to.
void SetOwnerPad(int nPad)
Store the controller the save belongs to in MetSaveRemix::mOwnerPad.
virtual void EnterAndShow()
Show the screen and fill it from the finished session.
virtual void PlaySlideSound(int nSelector)
Play the slide sound when the selector matches MetSaveRemix::mOwnerPad.
virtual void OnExitFinished()
Act on the button the user chose once the exit animation has finished.
void SetEnteredName(const HxStr &text)
Assign the name typed last, mEnteredName.
virtual void OnRepeatingSoundFinished(Rnd::Button *pButton)
Depart to the help screen.
virtual void PlayLeaveSound(int)
Silence the leave sound.
Definition metsaveremixscreen.h:256
virtual ~MetSaveRemixScreen()
void SetAppearances(const std::vector< FreqAppearance > &appearances)
Copy the players' appearances into MetSaveRemix::mAppearances.
virtual void PlayCycleRightSound(int)
Silence the cycle-right sound.
Definition metsaveremixscreen.h:283
MetSaveRemixScreen(MetRenderer *pRenderer, int nPriority)
Construct the screen.
virtual void OnSaveAbandoned()
Report to the saver through MetRemixSaver::OnSaveFinished() with a zero argument.
void SetPersona(MetPersonaData *pPersona)
Store the persona saving the remix.
virtual void OnMsgScreenDismissed(const HxStr &name, int nChoice)
Act on the discard confirmation.
virtual void OnSaveDialogueClosed()
Report to the saver through MetRemixSaver::OnSaveFinished() with an argument of one.
virtual void OnPanelActivated()
Return from the keyboard once the panel has finished activating.
virtual void OnDuplicateNameDeclined()
Request a remix name from the on-screen keyboard.
virtual void PlayHighSound(int)
Silence the high sound.
Definition metsaveremixscreen.h:265
static MetSaveRemixScreen * New(MetRenderer *pRenderer, int nPriority)
Build the screen on the heap.
virtual void HandleCommand(const MetScreenCommand *pCommand)
Act on a navigation command from the one controller that owns the screen.
virtual void OnKeyboardTextEntered(const HxStr &text)
Draw the entered name and forward it to the saver once.
MetSaveRemix(MetRenderer *pRenderer, int nPriority, const HxStr &name, const HxStr &directory, const HxStr &file)
Construct the saver.
Selectable widget, as one mesh and one text run plus a palette for each.
Definition button.h:39
Base of every object the renderer can load, resolve by name, and serialise.
Definition object.h:43
Run of text drawn as a quad per glyph.
Definition text.h:57
The rendering engine.
Definition animhelper.h:3
What one card slot reports about itself, and the memory-card location the front end stores.
Definition memcardconnectstate.h:21
One navigation command delivered to a screen.
Definition metscreen.h:46