resonance 1.0.1
Loading...
Searching...
No Matches
metsaveremix.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
8#include "met/metkbuser.h"
10#include "met/metscreen.h"
11#include "os/hxstr.h"
12
66class MetSaveRemix : public MetScreen, public MemcardUser, public MetKBUser {
67public:
80 int nPriority,
81 const HxStr &name,
82 const HxStr &directory,
83 const HxStr &file);
84
89 virtual ~MetSaveRemix();
90
115 virtual void RecordPendingSave(const MemcardConnectState &selection,
116 int nOwnerPad,
117 HxStr remixName,
118 HxStr levelName,
119 std::vector<FreqAppearance> appearances,
120 int nAlbumNumber);
121
132 virtual void OnSaveAbandoned();
133
143 virtual void OnSaveDialogueClosed();
144
156
171 virtual void OnKeyboardTextEntered(const HxStr &text);
172
189 virtual void OnConnectState(MemcardConnectState state, int nStatus);
190
203 virtual void OnCardFormatted(int nPortSlot, int nStatus);
204
222#ifdef VIDEO_STANDARD_PAL
223 virtual void OnRemixSaved(int nPortSlot, int nStatus, int nKilobytes);
224#else
225 virtual void OnRemixSaved(int nPortSlot, int nStatus);
226#endif
227
240 virtual void OnRemixesListed(int nPortSlot, int nStatus);
241
259 virtual void OnMsgScreenDismissed(const HxStr &name, int nChoice);
260
261private:
262 // NTSC-U/C: 0x00372760, PAL: 0x003a12e8
263 // Raises the `save_remix` dialogue, headed `save_title` with the `mem_save` text for a save, or
264 // `copy_title` with the `mem_copy12` text identifying the next card slot for a copy.
265 void BeginSave();
266
267protected:
268 // The card location to save to. Protected because MetSaveRemixScreen::Open() assigns it
269 // directly. +0x94
271 // The players' appearances. Protected because MetSaveRemixScreen::SetAppearances() assigns
272 // it. +0xac
273 std::vector<FreqAppearance> mAppearances;
274
275 // The remix name. Protected because slot 42 of MetSaveRemixScreen hands it to the keyboard.
276 // +0xb8
278
279private:
280 // The level the remix was built over, passed to CreateSaveRemixTask(). +0xc0
281 HxStr mLevelName;
282
283protected:
284 // The controller the save belongs to. Every dialogue is limited to it. Protected because the
285 // MetSaveRemixScreen sound overrides compare their argument against it. The declarations
286 // below return to private to preserve the recovered offset order.
287 int mOwnerPad; // +0xc8
288
289private:
290 // The remixes already on the target card. OnRemixesListed() searches them for a duplicate.
291 std::vector<MetRemixRecord> mCardRemixes; // +0xcc
292 // Set by a successful save to port 1. OnConnectState() then records the next connect state as
293 // the first GlobalSettings::mCardSlots entry. +0xd8
294 int mRefreshFirstCardSlot;
295
296protected:
297 // Non-zero for a copy rather than a save. Protected because
298 // MetSaveRemixScreen::EnterAndShow() clears it. +0xdc
300
301 // Set while a keyboard request from slot 42 is outstanding. Protected because the
302 // MetSaveRemixScreen constructor clears it. This class's constructor never writes it.
303 int mKeyboardPending; // +0xe0
304
305private:
306 // The album number the remix index records, passed to CreateSaveRemixTask(). +0xe4
307 int mAlbumNumber;
308};
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
Front-end renderer that owns the screen stack and drives every MetScreen.
Definition metrenderer.h:68
std::vector< FreqAppearance > mAppearances
Definition metsaveremix.h:273
virtual void OnRemixesListed(int nPortSlot, int nStatus)
Check the listing of the target card before saving.
virtual void RecordPendingSave(const MemcardConnectState &selection, int nOwnerPad, HxStr remixName, HxStr levelName, std::vector< FreqAppearance > appearances, int nAlbumNumber)
Record the remix a save is about to write and enquire about the target card.
HxStr mRemixName
Definition metsaveremix.h:277
MetSaveRemix(MetRenderer *pRenderer, int nPriority, const HxStr &name, const HxStr &directory, const HxStr &file)
Construct the saver.
virtual ~MetSaveRemix()
int mCopying
Definition metsaveremix.h:299
virtual void OnSaveDialogueClosed()
React to the closing of a save dialogue that OnMsgScreenDismissed() does not handle.
virtual void OnDuplicateNameDeclined()
React to NO on mem_remix_dupe.
MemcardConnectState mTargetSlot
Definition metsaveremix.h:270
int mKeyboardPending
Definition metsaveremix.h:303
virtual void OnConnectState(MemcardConnectState state, int nStatus)
Act on the state of the card the save targets.
virtual void OnCardFormatted(int nPortSlot, int nStatus)
Report a finished format.
virtual void OnMsgScreenDismissed(const HxStr &name, int nChoice)
Act on the answer to one of the save dialogues.
int mOwnerPad
Definition metsaveremix.h:287
virtual void OnSaveAbandoned()
React to the user giving up on the save.
virtual void OnKeyboardTextEntered(const HxStr &text)
Record the entered name and start the save.
virtual void OnRemixSaved(int nPortSlot, int nStatus)
Report a finished remix save.
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