resonance 1.0.1
Loading...
Searching...
No Matches
metfreqmakerinventoryscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <vector>
5
6#include "met/metscreen.h"
7#include "os/hxstr.h"
8
9class FreqPart;
11struct Color;
12struct Vector2;
13namespace Rnd {
14class Mesh;
15class Object;
16class Text;
17class View;
18} // namespace Rnd
19
44public:
58 MetFreqMakerInventoryScreen(MetRenderer *pRenderer, int nPriority);
59
67
79 static MetFreqMakerInventoryScreen *New(MetRenderer *pRenderer, int nPriority);
80
89 virtual void EnterAndShow();
90
102 virtual void OnPanelActivated();
103
114 virtual int PollContainerLoad();
115
131 virtual void HandleCommand(const MetScreenCommand *pCommand);
132
142 virtual void PlaySlideSound(int nSelector);
143
153 virtual void PlayLeaveSound(int nSelector);
154
164 virtual void PlayHighSound(int nSelector);
165
175 virtual void PlayCycleLeftSound(int nSelector);
176
186 virtual void PlayCycleRightSound(int nSelector);
187
198 virtual void OnRepeatingSoundFinished(Rnd::Button *pButton);
199
215 virtual void ResolveContainerViews();
216
226 virtual void OnEnterFinished();
227
236
245
254
263
272
282 void HidePages();
283
296
305 virtual void PlayMoveSound();
306
315 virtual void PlayFlipSound();
316
325 virtual void PlayModeToggleSound();
326
335 virtual void PlayToggleSound();
336
345 virtual void PlayDeleteSound();
346
347private:
348 // The editing mode selects the sounds the slots play. The names are inferred.
349 enum Mode { kModeNone = 0, kModeColor = 1, kModePart = 2, kModeInventory = 3 };
350
351 // The panel SetHighlight() draws with its highlight material. The names are inferred.
352 enum Highlight { kHighlightCanvas = 0, kHighlightInventory = 1, kHighlightNone = 2 };
353
360 void ShowPalette(int nShowing);
361
371 void ShowInventory(int nShowing);
372
381 void SetHighlight(int nHighlight);
382
383 // Show one part page with its row count and heading. The five page routines expand it.
384 void ShowPartPage(Rnd::View *pView, int nRowCount, const HxStr &heading);
385
386 // Apply the palette colour on the canvas, move the cross to it, and on the edit page colour the
387 // mesh under the grid cursor. Slot 19 expands it for each palette move.
388 void ApplyPaletteToCurrentMesh();
389
396 void HideGridCursor();
397
404 void UpdateGridCursor();
405
413 void ShowDirections(int nPage);
414
421 bool IsCurrentCellFilled();
422
429 std::vector<HxStr> *GetCurrentPageNames();
430
437 void PreviewCurrentTemplate();
438
445 void GetPalettePosition(Vector2 &position);
446
453 void MoveCrossOrigin(const Vector2 &position);
454
463 void MoveCrossOrigin(float flX, float flY);
464
471 void UpdateCrossOrigin();
472
479 Color *PaletteColorAt(const Vector2 &position);
480
487 void ApplyPaletteColor(Color &color);
488
496 void SetPaletteFromPart(FreqPart *pPart);
497
504 FreqPart *SelectCurrentPart();
505
512 void DeleteCurrentPart();
513
522 void OnGridTopReached();
523
532 void OnGridBottomReached();
533
540 float PartScale(FreqPart *pPart);
541
542 Rnd::View *mMainInventoryView; // +0x8c
543 Rnd::View *mBodyView; // +0x90
544 Rnd::View *mHeadView; // +0x94
545 Rnd::View *mFaceView; // +0x98
546 Rnd::View *mDetailsView; // +0x9c
547 Rnd::View *mLogosView; // +0xa0
548 Rnd::View *mEditView; // +0xa4
549 Rnd::View *mCurrentView; // +0xa8, the page shown
550 std::list<Rnd::Object *> mPartMeshes; // +0xac, one clone for each part template
551 int mBodyRowCount; // +0xb0
552 int mFaceRowCount; // +0xb4
553 int mHeadRowCount; // +0xb8
554 int mDetailsRowCount; // +0xbc
555 int mLogosRowCount; // +0xc0
556 int mCurrentRowCount; // +0xc4, the bound slot 19 moves mGridRow within
557 int mEditRowCount; // +0xc8
558 Rnd::Mesh *mWire16; // +0xcc, `fm_wire_16.mesh`
559 Rnd::Mesh *mWire30; // +0xd0, `fm_wire_30.mesh`
560 Rnd::Text *mLimitText; // +0xd4, `fminv_limit.txt`
561 std::vector<Rnd::Mesh *> mEditMeshes; // +0xd8, the part meshes of the edit page
562 int mPaletteColumn; // +0xe4, 0 through 15
563 int mPaletteRow; // +0xe8, 0 through 7
564 int mViewsResolved; // +0xec, set by slot 38
565 MetFreqMakerCanvasScreen *mCanvas; // +0xf0
566 Rnd::View *mCrossOrigin; // +0xf4, `fm_cross_origin.view`
567 int mGridColumn; // +0xf8, 0 through 7
568 int mGridRow; // +0xfc
569 Mode mMode; // +0x100
570 std::vector<HxStr> mFaceNames; // +0x104
571 std::vector<HxStr> mHeadNames; // +0x110
572 std::vector<HxStr> mBodyNames; // +0x11c
573 std::vector<HxStr> mDetailsNames; // +0x128
574 std::vector<HxStr> mLogosNames; // +0x134
575};
One placed part of a FreQ avatar.
Definition freqpart.h:25
Canvas of the FreQ maker, the screen the avatar under edit is drawn on.
Definition metfreqmakercanvasscreen.h:37
static MetFreqMakerInventoryScreen * New(MetRenderer *pRenderer, int nPriority)
Build the screen on the heap.
virtual void PlayModeToggleSound()
Play SND_MET_FM_TOGGLE.
void HidePages()
Hide every page, the palette, and the inventory decorations, and clear the heading.
virtual int PollContainerLoad()
Report the container load finished once the FreQ maker assets and the directions screen's container a...
virtual void PlayMoveSound()
Play SND_MET_FM_COLOR_MOVE in the colour mode or SND_MET_FM_PART_MOVE in the part mode.
virtual void PlayLeaveSound(int nSelector)
Play the base leave sound while an editing mode is active.
virtual void PlayCycleLeftSound(int nSelector)
Play SND_MET_FM_PART_SELECT while the inventory is browsed.
virtual void OnRepeatingSoundFinished(Rnd::Button *pButton)
Make this screen the active panel again, through ActivateNamedPanel() with MetFreqMakerInventoryScree...
virtual void OnPanelActivated()
Start browsing the inventory.
virtual void ResolveContainerViews()
Resolve the base views, list every part template on its page, and resolve the screen's objects.
virtual void PlayFlipSound()
Play SND_MET_FM_FLIP_BUBBLE.
void ShowFacePage()
Show the face page.
void ShowDetailsPage()
Show the details page.
void ShowBodyPage()
Show the body page.
virtual void PlayCycleRightSound(int nSelector)
Play SND_MET_FM_PART_SELECT while the inventory is browsed.
MetFreqMakerInventoryScreen(MetRenderer *pRenderer, int nPriority)
Construct the screen.
void ShowEditPage()
Rebuild the edit page from the canvas's parts and show it.
virtual void PlayToggleSound()
Play SND_MET_FM_TOGGLE.
virtual void HandleCommand(const MetScreenCommand *pCommand)
Apply one command to the grid, the palette, or the part under edit, by editing mode.
virtual void PlayHighSound(int nSelector)
Play SND_MET_FM_PART_SELECT while the inventory is browsed.
virtual ~MetFreqMakerInventoryScreen()
Delete the seven views and every part mesh, and empty the five name lists.
virtual void EnterAndShow()
Show the screen with no editing mode active.
virtual void PlayDeleteSound()
Play SND_MET_FM_DELETE.
void ShowLogosPage()
Show the logos page.
virtual void OnEnterFinished()
Hide the palette and the inventory, and return the palette cursor to its starting cell and colour.
void ShowHeadPage()
Show the head page.
virtual void PlaySlideSound(int nSelector)
Play the base slide sound while an editing mode is active.
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
Indexed triangle mesh with one material.
Definition mesh.h:46
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
Root of a loadable scene.
Definition view.h:47
The rendering engine.
Definition animhelper.h:3
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