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

Canvas of the FreQ maker, the screen the avatar under edit is drawn on. More...

#include <metfreqmakercanvasscreen.h>

Inheritance diagram for MetFreqMakerCanvasScreen:
Collaboration diagram for MetFreqMakerCanvasScreen:

Public Member Functions

 MetFreqMakerCanvasScreen (MetRenderer *pRenderer, int nPriority)
 Construct the screen.
virtual ~MetFreqMakerCanvasScreen ()
virtual void EnterAndShow ()
 Show the screen and hang the avatar view from fm_canvas.view again.
virtual int PollContainerLoad ()
 Report the container load finished once the FreQ maker assets are resident as well.
virtual void HandleCommand (const MetScreenCommand *pCommand)
 Ignore the command.
virtual void PlayCycleLeftSound (int nSelector)
 Play nothing.
virtual void PlayCycleRightSound (int nSelector)
 Play nothing.
virtual void OnRepeatingSoundFinished (Rnd::Button *pButton)
 Do nothing.
virtual void OnExitFinished ()
 Unhang the avatar view from fm_canvas.view.
virtual void ResolveContainerViews ()
 Resolve the base views, hang the avatar view from fm_canvas.view, and record that it is hung.
void CommitPersona ()
 Write the avatar and its name into the persona being edited, or into a new one, and make that persona the game manager's one persona.
void SetFreqName (const HxStr &name)
 Rename the avatar and show the name on FREQ_NAME.txt.
void SelectTemplate (const HxStr &name)
 Start placing a part of one template.
void PlaceCursor ()
 Place the previewed part, or stop editing the selected one, and mark the canvas modified.
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.
void SetColor (const Color &color, const Vector2 &palettePosition)
 Apply a colour to the previewed or selected part.
std::list< FreqPart * > & GetParts ()
 Report the parts of the avatar.
FreqPart * SelectPart (int nIndex)
 Mark the canvas modified and start editing one part.
void LoadPersona (MetPersonaData *pPersona)
 Load one persona's avatar and name for editing.
void LoadPrefab (MetPersonaData *pSource, int nRandomize)
 Start a new persona from a pre-fab one's avatar, optionally randomised.
void RevertSelection ()
 Restore the selected part from the copy taken when it was selected.
HxStr * GetFreqName ()
 Report the avatar's name.
void DeletePart (int nIndex)
 Delete one part and mark the canvas modified.
void Randomize ()
 Randomise the avatar and mark the canvas modified.
void RecentrePart (int nIndex)
 Move one part to the origin, bring it to the front, and mark the canvas modified.
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 OnPanelActivated ()
 Act on this screen having become the renderer's active panel.
virtual void ExitScreenByName (const HxStr &name)
 Start one named screen's exit animation.
virtual void BeginExit ()
 Start this screen's exit animation at the renderer's current time.
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 void OnMsgScreenDismissed (const HxStr &name, int nChoice)
 Act on the choice the user made in a message dialogue.
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 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 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 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 OnConnectState (MemcardConnectState state, int nStatus)
 Report the state of one slot.
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 OnCardFormatted (int nPortSlot, int nStatus)
 Report a finished format.
virtual void OnCardUnformatted (int nPortSlot, int nStatus)
 Report a finished unformat.
virtual void OnPersonasSaved (int nPortSlot, int nStatus)
 Report a finished save of the FreQ roster.
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 OnPersonasLoaded (int nPortSlot, int nStatus)
 Report a finished load of the FreQ roster.
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.

Static Public Member Functions

static MetFreqMakerCanvasScreen * New (MetRenderer *pRenderer, int nPriority)
 Build the screen on the heap.
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.

Public Attributes

MetPersonaData * mPersona
 The persona being edited, or null for a new one.
int mModified
 Non-zero after any edit, and cleared on commit or load.
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.

Additional Inherited Members

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

Canvas of the FreQ maker, the screen the avatar under edit is drawn on.

Its RTTI descriptor is at 0x00902a60. It has two public non-virtual bases at fixed offsets, MetScreen at +0x00, and MemcardUser at +140.

The 39-entry primary vtable is at 0x007f1cd8, the same length as the MetScreen table, so the class declares no virtual of its own.

The twenty-one-entry MemcardUser table at 0x007f1c28 adjusts this by -140 in every entry.

The object is 0x160 bytes, which the allocation in New() fixes. It embeds the avatar under edit as a FreqAppearanceDetail at +0xa0, and the inventory and buttons screens drive that avatar through the members below. Every edit that changes the avatar marks the canvas modified.

The translation unit spans 0x0025e5a8 to 0x00262810. Besides the members below, it has the static initialiser at 0x00261d50, which builds the default name player1, per-unit copies of MsgSink and MemcardUser routines, and template library emissions.

Apart from the type function and the destructor, the slots that differ from the MetScreen table are 5, 14, 19, 23, 24, 30, 36, and 38.

Constructor & Destructor Documentation

◆ MetFreqMakerCanvasScreen()

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

Construct the screen.

Supplies fm_canvas for the screen name, metagame/persona for the directory, and freq_maker_canvas for the container, builds an empty avatar, and calls it player1. The European release takes the name from its text table instead, in this routine and in the two that load an avatar.

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

◆ ~MetFreqMakerCanvasScreen()

virtual MetFreqMakerCanvasScreen::~MetFreqMakerCanvasScreen ( )
virtual
Ghidra address:
NTSC-U/C: 0x00262030
Ghidra address:
PAL: 0x002787c0

Member Function Documentation

◆ New()

MetFreqMakerCanvasScreen * MetFreqMakerCanvasScreen::New ( MetRenderer * pRenderer,
int nPriority )
static

Build the screen on the heap.

The routine at 0x00385180 that creates every front-end screen is the caller.

Parameters
pRendererThe front-end renderer the screen registers on.
nPriorityThe load priority.
Returns
The new screen.
Ghidra address:
NTSC-U/C: 0x00261fa8
Ghidra address:
PAL: 0x00278738

◆ EnterAndShow()

virtual void MetFreqMakerCanvasScreen::EnterAndShow ( )
virtual

Show the screen and hang the avatar view from fm_canvas.view again.

Slot 5.

Ghidra address:
NTSC-U/C: 0x0025e978
Ghidra address:
PAL: 0x00274dd0

Reimplemented from MetScreen.

◆ PollContainerLoad()

virtual int MetFreqMakerCanvasScreen::PollContainerLoad ( )
virtual

Report the container load finished once the FreQ maker assets are resident as well.

Slot 14.

Returns
Non-zero once both loads have finished.
Ghidra address:
NTSC-U/C: 0x002620d8
Ghidra address:
PAL: 0x00278878

Reimplemented from MetScreen.

◆ HandleCommand()

virtual void MetFreqMakerCanvasScreen::HandleCommand ( const MetScreenCommand * pCommand)
virtual

Ignore the command.

Slot 19. The body is empty.

Parameters
pCommandThe command.
Ghidra address:
NTSC-U/C: 0x002620c8
Ghidra address:
PAL: 0x00278868

Reimplemented from MetScreen.

◆ PlayCycleLeftSound()

virtual void MetFreqMakerCanvasScreen::PlayCycleLeftSound ( int nSelector)
virtual

Play nothing.

Slot 23. The body is empty.

Parameters
nSelectorThe value the override compares against its own recorded selector.
Ghidra address:
NTSC-U/C: 0x00261f80
Ghidra address:
PAL: 0x00278710

Reimplemented from MetScreen.

◆ PlayCycleRightSound()

virtual void MetFreqMakerCanvasScreen::PlayCycleRightSound ( int nSelector)
virtual

Play nothing.

Slot 24. The body is empty.

Parameters
nSelectorThe value the override compares against its own recorded selector.
Ghidra address:
NTSC-U/C: 0x00261f88
Ghidra address:
PAL: 0x00278718

Reimplemented from MetScreen.

◆ OnRepeatingSoundFinished()

virtual void MetFreqMakerCanvasScreen::OnRepeatingSoundFinished ( Rnd::Button * pButton)
virtual

Do nothing.

Slot 30. The body is empty.

Parameters
pButtonThe button slot 29 finished with.
Ghidra address:
NTSC-U/C: 0x002620d0
Ghidra address:
PAL: 0x00278870

Reimplemented from MetScreen.

◆ OnExitFinished()

virtual void MetFreqMakerCanvasScreen::OnExitFinished ( )
virtual

Unhang the avatar view from fm_canvas.view.

Slot 36.

Ghidra address:
NTSC-U/C: 0x0025e898
Ghidra address:
PAL: 0x00274cd0

Reimplemented from MetScreen.

◆ ResolveContainerViews()

virtual void MetFreqMakerCanvasScreen::ResolveContainerViews ( )
virtual

Resolve the base views, hang the avatar view from fm_canvas.view, and record that it is hung.

Slot 38. The European release also fills FREQ CANVAS.txt with the canvas title from its text table.

Ghidra address:
NTSC-U/C: 0x0025e798
Ghidra address:
PAL: 0x00274a60

Reimplemented from MetScreen.

◆ CommitPersona()

void MetFreqMakerCanvasScreen::CommitPersona ( )

Write the avatar and its name into the persona being edited, or into a new one, and make that persona the game manager's one persona.

A new persona also takes the current date and time when they are available, and the copy the game manager keeps becomes the persona being edited. The canvas is then marked unmodified. MetFreqMakerButtonsScreen's slots 15 and 19 call it. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0025ea68
Ghidra address:
PAL: 0x00275158

◆ SetFreqName()

void MetFreqMakerCanvasScreen::SetFreqName ( const HxStr & name)

Rename the avatar and show the name on FREQ_NAME.txt.

The canvas is marked modified. The title is inferred.

Parameters
nameThe new name.
Ghidra address:
NTSC-U/C: 0x0025ec80
Ghidra address:
PAL: 0x002753a0

◆ SelectTemplate()

void MetFreqMakerCanvasScreen::SelectTemplate ( const HxStr & name)

Start placing a part of one template.

The title is inferred.

Parameters
nameThe template name.
Ghidra address:
NTSC-U/C: 0x00262120
Ghidra address:
PAL: 0x002788c0

◆ PlaceCursor()

void MetFreqMakerCanvasScreen::PlaceCursor ( )

Place the previewed part, or stop editing the selected one, and mark the canvas modified.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x00262140
Ghidra address:
PAL: 0x002788e0

◆ ResetCursor()

void MetFreqMakerCanvasScreen::ResetCursor ( )

Return the placement state to its unset values.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x00262170
Ghidra address:
PAL: 0x00278910

◆ HandleCanvasCommand()

void MetFreqMakerCanvasScreen::HandleCanvasCommand ( const MetScreenCommand * pCommand)

Apply one of the canvas editing commands, codes 13 through 21, to the avatar.

The inventory screen forwards the commands. The title is inferred.

Parameters
pCommandThe command.
Ghidra address:
NTSC-U/C: 0x00262190
Ghidra address:
PAL: 0x00278930

◆ SetColor()

void MetFreqMakerCanvasScreen::SetColor ( const Color & color,
const Vector2 & palettePosition )

Apply a colour to the previewed or selected part.

The title is inferred.

Parameters
colorThe colour.
palettePositionThe palette position the colour came from.
Ghidra address:
NTSC-U/C: 0x00262250
Ghidra address:
PAL: 0x002789f0

◆ GetParts()

std::list< FreqPart * > & MetFreqMakerCanvasScreen::GetParts ( )

Report the parts of the avatar.

The title is inferred.

Returns
The part list.
Ghidra address:
NTSC-U/C: 0x00262270
Ghidra address:
PAL: 0x00278a10

◆ SelectPart()

FreqPart * MetFreqMakerCanvasScreen::SelectPart ( int nIndex)

Mark the canvas modified and start editing one part.

The title is inferred.

Parameters
nIndexThe part's position in the part list.
Returns
The part, or null for an index outside the list.
Ghidra address:
NTSC-U/C: 0x00262290
Ghidra address:
PAL: 0x00278a30

◆ LoadPersona()

void MetFreqMakerCanvasScreen::LoadPersona ( MetPersonaData * pPersona)

Load one persona's avatar and name for editing.

With a null persona the avatar is emptied and named player1. The canvas is marked unmodified. The title is inferred.

Parameters
pPersonaThe persona to edit, or null.
Ghidra address:
NTSC-U/C: 0x002622b8
Ghidra address:
PAL: 0x00274ee0

◆ LoadPrefab()

void MetFreqMakerCanvasScreen::LoadPrefab ( MetPersonaData * pSource,
int nRandomize )

Start a new persona from a pre-fab one's avatar, optionally randomised.

The persona being edited is cleared, the avatar is copied from pSource and named player1, and with nRandomize set randomize() runs a random number of times from 0 to 9. The canvas is marked modified. The title is inferred.

Parameters
pSourceThe pre-fab persona.
nRandomizeNon-zero to randomise the copy.
Ghidra address:
NTSC-U/C: 0x00262350
Ghidra address:
PAL: 0x00274ff0

◆ RevertSelection()

void MetFreqMakerCanvasScreen::RevertSelection ( )

Restore the selected part from the copy taken when it was selected.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x00262440
Ghidra address:
PAL: 0x00278a58

◆ GetFreqName()

HxStr * MetFreqMakerCanvasScreen::GetFreqName ( )

Report the avatar's name.

The title is inferred.

Returns
The name.
Ghidra address:
NTSC-U/C: 0x00262460
Ghidra address:
PAL: 0x00278a78

◆ DeletePart()

void MetFreqMakerCanvasScreen::DeletePart ( int nIndex)

Delete one part and mark the canvas modified.

The title is inferred.

Parameters
nIndexThe part's position in the part list.
Ghidra address:
NTSC-U/C: 0x00262468
Ghidra address:
PAL: 0x00278a80

◆ Randomize()

void MetFreqMakerCanvasScreen::Randomize ( )

Randomise the avatar and mark the canvas modified.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x00262498
Ghidra address:
PAL: 0x00278ab0

◆ RecentrePart()

void MetFreqMakerCanvasScreen::RecentrePart ( int nIndex)

Move one part to the origin, bring it to the front, and mark the canvas modified.

The title is inferred.

Parameters
nIndexThe part's position in the part list.
Ghidra address:
NTSC-U/C: 0x002624c8
Ghidra address:
PAL: 0x00278ae0

Member Data Documentation

◆ mPersona

MetPersonaData* MetFreqMakerCanvasScreen::mPersona

The persona being edited, or null for a new one.

Public because MetFreqMakerButtonsScreen's slots 15 and 36 pass it to MetPersonaSaverScreen::StartSave(), and the image has no accessor. +0x90

◆ mModified

int MetFreqMakerCanvasScreen::mModified

Non-zero after any edit, and cleared on commit or load.

Public because MetFreqMakerButtonsScreen's slot 36 reads it to decide whether to raise the save-before-leaving dialogue, and the image has no accessor. +0x150


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