wavelength 1.0.0
Loading...
Searching...
No Matches
gameoptionsscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include "met/freqscreen.h"
5#include "script/dataarray.h"
7
17public:
24 ~GameOptionsScreen() override = default;
25
31
39 explicit GameOptionsScreen(DataArray *pData) : FreqScreen(pData) {
40 }
41
50 static UIScreen *New(DataArray *pData) {
51 return new GameOptionsScreen(pData);
52 }
53
62 bool DispatchPriv(Message *pMsg) override;
63
72 void Enter(UIScreen *pPrevScreen, float fTime) override;
73
80 void Refresh();
81
89 void RefreshToggle(const char *pszComponent);
90
97 void Commit();
98
107 bool IsToggleOn(unsigned char nToggle) const;
108
118 void FlipToggle(unsigned char nToggle);
119
128 void SetToggle(unsigned char nToggle, int nOn);
129
138 const char *FreqSizeLabel(int nFreqSize) const;
139
148 const char *OnOffLabel(bool bOn) const;
149
158 const char *OutputModeLabel(int nOutputMode) const;
159
172
183
184private:
185 int mFreqSize;
186 int mOutputMode;
187 unsigned char mToggles;
188 UIScreen *mReturnScreen;
189};
Reference-counted array of script data nodes.
Definition dataarray.h:20
FreqScreen(DataArray *pData)
Construct a screen from its script description.
void SetToggle(unsigned char nToggle, int nOn)
Turn toggles on or off.
GameOptionsScreen(DataArray *pData)
Construct the screen from its script description.
Definition gameoptionsscreen.h:39
static UIScreen * New(DataArray *pData)
Create a screen from its script description.
Definition gameoptionsscreen.h:50
bool DispatchPriv(Message *pMsg) override
Route the start of a choice and a controller button, and pass on every other message.
void Commit()
Store the settings of the menu in the game database.
void Refresh()
Copy the stored settings into the menu and show them.
Toggle
Bits of mToggles.
Definition gameoptionsscreen.h:27
@ kToggleHelpText
Definition gameoptionsscreen.h:29
@ kToggleForceFeedback
Definition gameoptionsscreen.h:28
bool IsToggleOn(unsigned char nToggle) const
Report whether toggles are on.
void FlipToggle(unsigned char nToggle)
Turn toggles over.
const char * FreqSizeLabel(int nFreqSize) const
Report the label of a size of the track display.
void RefreshToggle(const char *pszComponent)
Show whether one of the two toggles is on.
const char * OutputModeLabel(int nOutputMode) const
Report the label of a speaker output mode.
~GameOptionsScreen() override=default
Destroy the object.
bool HandleSelectStart(UIComponentSelectStartMsg *pMsg)
Change the setting of the component a button starts to choose, or leave with done.
bool HandleJoypad(JoypadInputMsg *pMsg)
Go back to the screen the menu was entered from on Triangle, unless the screen is between screens.
const char * OnOffLabel(bool bOn) const
Report the label of a toggle.
void Enter(UIScreen *pPrevScreen, float fTime) override
Enter, remember the screen to return to, and show the stored settings.
Message the controller poll sends when a button is pressed or released.
Definition joypadinputmsg.h:23
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Message a component sends when the player presses the button that chooses it.
Definition uicomponentselectstartmsg.h:27
UIScreen(DataArray *pData)
Construct a screen from its script description.