resonance 1.0.1
Loading...
Searching...
No Matches
metfreqmakercanvasscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
6#include "math/color.h"
7#include "math/vector2.h"
9#include "met/metscreen.h"
10#include "os/hxstr.h"
11
12class FreqPart;
13class MetPersonaData;
14
38public:
52 MetFreqMakerCanvasScreen(MetRenderer *pRenderer, int nPriority);
53
59
71 static MetFreqMakerCanvasScreen *New(MetRenderer *pRenderer, int nPriority);
72
81 virtual void EnterAndShow();
82
92 virtual int PollContainerLoad();
93
103 virtual void HandleCommand(const MetScreenCommand *pCommand);
104
114 virtual void PlayCycleLeftSound(int nSelector);
115
125 virtual void PlayCycleRightSound(int nSelector);
126
136 virtual void OnRepeatingSoundFinished(Rnd::Button *pButton);
137
146 virtual void OnExitFinished();
147
158 virtual void ResolveContainerViews();
159
172
182 void SetFreqName(const HxStr &name);
183
191 void SelectTemplate(const HxStr &name);
192
201
209
220
229 void SetColor(const Color &color, const Vector2 &palettePosition);
230
238 std::list<FreqPart *> &GetParts();
239
248 FreqPart *SelectPart(int nIndex);
249
261
274 void LoadPrefab(MetPersonaData *pSource, int nRandomize);
275
283
292
300 void DeletePart(int nIndex);
301
308 void Randomize();
309
318 void RecentrePart(int nIndex);
319
320 // Declared in recovered offset order, with the access specifiers interleaved.
321
329
330private:
331 unsigned char mReserved[0xc]; // +0x94, never read or written
332 FreqAppearanceDetail mAppearance; // +0xa0, the avatar under edit
333
334public:
342
343private:
344 HxStr mFreqName; // +0x154
345 int mViewAttached; // +0x15c, set once slot 38 has hung the avatar view
346};
Avatar an appearance stores apart from its username.
Definition freqappearancedetail.h:36
One placed part of a FreQ avatar.
Definition freqpart.h:25
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Receiver notified once a memory-card task has finished.
Definition memcarduser.h:24
virtual void PlayCycleRightSound(int nSelector)
Play nothing.
void SetFreqName(const HxStr &name)
Rename the avatar and show the name on FREQ_NAME.txt.
std::list< FreqPart * > & GetParts()
Report the parts of the avatar.
FreqPart * SelectPart(int nIndex)
Mark the canvas modified and start editing one part.
void CommitPersona()
Write the avatar and its name into the persona being edited, or into a new one, and make that persona...
virtual int PollContainerLoad()
Report the container load finished once the FreQ maker assets are resident as well.
virtual void OnExitFinished()
Unhang the avatar view from fm_canvas.view.
virtual void PlayCycleLeftSound(int nSelector)
Play nothing.
void Randomize()
Randomise the avatar and mark the canvas modified.
virtual void OnRepeatingSoundFinished(Rnd::Button *pButton)
Do nothing.
static MetFreqMakerCanvasScreen * New(MetRenderer *pRenderer, int nPriority)
Build the screen on the heap.
void DeletePart(int nIndex)
Delete one part and mark the canvas modified.
MetFreqMakerCanvasScreen(MetRenderer *pRenderer, int nPriority)
Construct the screen.
int mModified
Non-zero after any edit, and cleared on commit or load.
Definition metfreqmakercanvasscreen.h:341
void LoadPrefab(MetPersonaData *pSource, int nRandomize)
Start a new persona from a pre-fab one's avatar, optionally randomised.
void PlaceCursor()
Place the previewed part, or stop editing the selected one, and mark the canvas modified.
virtual void ResolveContainerViews()
Resolve the base views, hang the avatar view from fm_canvas.view, and record that it is hung.
virtual void HandleCommand(const MetScreenCommand *pCommand)
Ignore the command.
HxStr * GetFreqName()
Report the avatar's name.
virtual ~MetFreqMakerCanvasScreen()
void RecentrePart(int nIndex)
Move one part to the origin, bring it to the front, and mark the canvas modified.
MetPersonaData * mPersona
The persona being edited, or null for a new one.
Definition metfreqmakercanvasscreen.h:328
void SetColor(const Color &color, const Vector2 &palettePosition)
Apply a colour to the previewed or selected part.
void RevertSelection()
Restore the selected part from the copy taken when it was selected.
void SelectTemplate(const HxStr &name)
Start placing a part of one template.
void ResetCursor()
Return the placement state to its unset values.
void HandleCanvasCommand(const MetScreenCommand *pCommand)
Apply one of the canvas editing commands, codes 13 through 21, to the avatar.
virtual void EnterAndShow()
Show the screen and hang the avatar view from fm_canvas.view again.
void LoadPersona(MetPersonaData *pPersona)
Load one persona's avatar and name for editing.
Saved record of one player persona.
Definition metpersonadata.h:39
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.
Selectable widget, as one mesh and one text run plus a palette for each.
Definition button.h:39
Linear colour with four float components.
Definition color.h:10
One navigation command delivered to a screen.
Definition metscreen.h:46
Two-component vector, used for texture coordinates.
Definition vector2.h:10