wavelength 1.0.0
Loading...
Searching...
No Matches
ovyremixgenpanel.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <vector>
5
6#include "rnd/rndfont.h"
7#include "rnd/rndmat.h"
8#include "rnd/rndmesh.h"
9#include "rnd/rndobject.h"
10#include "rnd/rndtext.h"
12
21public:
27
34
36 static constexpr float kNoFlash = -1e9f;
37
45
53
61 virtual void Poll(float fDelta);
62
69 virtual void Draw();
70
87 void Load(char chHud, const char *pszPrefix, int nPlayer, RndTransformable *pParent);
88
98 RndObject *Clone(const char *pszName, int nPlayer);
99
108 void SetText(int nIndex, const char *pszText);
109
116 void Flash();
117
125 void Select(int nIndex);
126
135 void SetLit(int nIndex, bool bLit);
136
138 RndMesh *GetPanel() const {
139 return mPanel;
140 }
141
142protected:
145
146private:
147 std::vector<Option> mOptions;
148 std::list<RndObject *> mClones;
149 RndMat *mCursorOffMat;
150 RndMat *mCursorOnMat;
151 RndFont *mFonts[kNumFonts];
152 RndMesh *mUpArrow;
153 RndMesh *mDownArrow;
154 RndMesh *mRule;
155 Option *mSelected;
156 float mFlashTime;
157};
virtual ~OvyRemixGenPanel()
Destroy the panel and the objects it cloned.
RndMesh * mPanel
Definition ovyremixgenpanel.h:144
virtual void Draw()
Draw the panel.
RndMesh * mBackground
Definition ovyremixgenpanel.h:143
void Select(int nIndex)
Move the cursor to an option.
static constexpr float kNoFlash
The value of mFlashTime when no blink runs.
Definition ovyremixgenpanel.h:36
RndMesh * GetPanel() const
Definition ovyremixgenpanel.h:138
virtual void Poll(float fDelta)
Blink the cursor of the selected option for 179 ticks after Flash().
FontIndex
The indices of mFonts.
Definition ovyremixgenpanel.h:29
@ kFontNormal
Definition ovyremixgenpanel.h:30
@ kNumFonts
Definition ovyremixgenpanel.h:32
@ kFontSelected
Definition ovyremixgenpanel.h:31
void SetLit(int nIndex, bool bLit)
Draw the label of an option in the selected font or the normal one.
void Load(char chHud, const char *pszPrefix, int nPlayer, RndTransformable *pParent)
Clone the panel's objects from the loaded scene and build its options.
RndObject * Clone(const char *pszName, int nPlayer)
Clone one object of the loaded scene as <name> pl <player>, and own the clone.
void Flash()
Start blinking the cursor of the selected option, when there is one.
void SetText(int nIndex, const char *pszText)
Set the label of an option.
OvyRemixGenPanel()
Construct an empty panel.
Bitmap font, a grid of character cells in the texture of a material's first stage.
Definition rndfont.h:20
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
Triangle mesh with a material.
Definition rndmesh.h:31
Base of every object the renderer can load, resolve by name, and serialise.
Definition rndobject.h:20
Text drawn with a bitmap font as a mesh of one quad per character.
Definition rndtext.h:27
Mix-in for an object with a local transform and a world transform derived from its parent's.
Definition rndtransformable.h:17
One option: the mesh behind it and its label.
Definition ovyremixgenpanel.h:23
RndText * mText
Definition ovyremixgenpanel.h:25
RndMesh * mMesh
Definition ovyremixgenpanel.h:24