wavelength 1.0.0
Loading...
Searching...
No Matches
freqpanel.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/box.h"
4#include "math/vector3.h"
5#include "rnd/rndmesh.h"
6#include "rnd/rndview.h"
7#include "script/dataarray.h"
8#include "ui/uicomponent.h"
9#include "ui/uipanel.h"
10
24class FreqPanel : public UIPanel {
25public:
27 static constexpr int kNumGizmoOffsets = 3;
28
37 FreqPanel(DataArray *pData, const char *pszDir);
38
45 ~FreqPanel() override;
46
58 static UIPanel *New(DataArray *pData, const char *pszDir) {
59 return new FreqPanel(pData, pszDir);
60 }
61
69 static void Init(DataArray *pConfig);
70
78 void Unload() override;
79
88 void Enter(bool bForce, float fTime) override;
89
98 void Exit(bool bForce, float fTime) override;
99
106 void DrawGizmo() override;
107
115 void Poll(float fTime) override;
116
123 void Draw() override;
124
132 void SetShowing(bool bShowing) override;
133
142 void SetFocus(UIComponent *pComponent, int nButton) override;
143
153 void FinishLoad() override;
154
162 void ShowGizmoMesh(bool bShowing);
163
171
177 alignas(16) static Vector3 sGizmoOrigPos;
178
185
186 alignas(16) Box mBgBox;
187
188private:
195 static const char *sPanelAnimName;
196
203 static float sMatEnterStart;
204
211 static float sMatEnterStop;
212
219 static float sMatExitStart;
220
227 static float sMatExitStop;
228
229 RndMesh *mGizmoMesh;
230 RndMesh *mBgMesh;
231 int mGizmoOffsetIndex;
232 RndView *mMatEnterExitAnim;
233 RndView *mMatAlwaysAnim;
234 RndView *mPanelAnim;
235 float mMatStart;
236 int mMatEntering;
237};
Axis-aligned bounding box.
Definition box.h:12
Reference-counted array of script data nodes.
Definition dataarray.h:20
void Exit(bool bForce, float fTime) override
Start the exit animation and the exit of the panel material animation.
void Unload() override
Drop a reference to the panel's file, forgetting the meshes and the animation on the last reference.
void Poll(float fTime) override
Advance the panel to a time and move the panel animation to the panel's frame.
void DrawGizmo() override
Stretch the gizmo pyramid from the background mesh to the gizmo and draw it.
Box mBgBox
Definition freqpanel.h:186
static void Init(DataArray *pConfig)
Read the freq_panel section of the metagame configuration.
void Draw() override
Move the panel material animations to the front-end time and draw the panel.
void FinishLoad() override
Find the meshes and animations of the panel once its file has loaded.
void SetShowing(bool bShowing) override
Show or hide the panel's view and the gizmo pyramid.
static Vector3 sGizmoOffsets[kNumGizmoOffsets]
The points of the gizmo the pyramids reach, the panel_gizmo_offset_1 to _3 settings.
Definition freqpanel.h:184
FreqPanel(DataArray *pData, const char *pszDir)
Construct a panel from its script description.
static Vector3 sGizmoOrigPos
The position of the gizmo, the panel_gizmo_orig_pos setting.
Definition freqpanel.h:177
void Enter(bool bForce, float fTime) override
Start the entry animation and the entry of the panel material animation.
void UpdateBgBox()
Measure the background mesh into mBgBox.
static UIPanel * New(DataArray *pData, const char *pszDir)
Create a panel from its script description.
Definition freqpanel.h:58
void ShowGizmoMesh(bool bShowing)
Show or hide the gizmo pyramid.
void SetFocus(UIComponent *pComponent, int nButton) override
Move the focus to a component and play the sound of the directional button that moved it.
static constexpr int kNumGizmoOffsets
The number of gizmo offsets the configuration provides.
Definition freqpanel.h:27
~FreqPanel() override
Destroy the panel.
Triangle mesh with a material.
Definition rndmesh.h:31
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27
One control of a front-end panel, such as a label, a button, or a list.
Definition uicomponent.h:21
UIPanel(DataArray *pData, const char *pszDir)
Construct a hidden panel from its script description.
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14