wavelength 1.0.0
Loading...
Searching...
No Matches
freqmakermainscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "game/campaign.h"
7#include "met/keyboarduser.h"
9#include "os/string.h"
10#include "script/dataarray.h"
11#include "ui/uicomponent.h"
16
32public:
41
49
60 static UIScreen *New(DataArray *pData) {
61 return new FreqMakerMainScreen(pData);
62 }
63
73 bool DispatchPriv(Message *pMsg) override;
74
89 void Enter(UIScreen *pPrevScreen, float fTime) override;
90
91#ifdef VIDEO_STANDARD_PAL
99 void ShowFreqName();
100#endif
101
111 void Exit(UIScreen *pNextScreen, float fTime) override;
112
119 void Undo() override;
120
129 int ReceiveKeyboardText(const char *pszText) override;
130
140 DataArray *FindPrefab(const char *pszPrefab);
141
149
157 void ShowSaveHelp(UIComponent *pComponent);
158
169 void GotoSave();
170
180
190
200
217
228
230 void SetSaveStarted(int nSaveStarted) {
231 mSaveStarted = nSaveStarted;
232 }
233
235 void SetEditing(int nEditing) {
236 mEditing = nEditing;
237 }
238
240 void SetFreqName(const char *pszFreqName) {
241 mFreqName = pszFreqName;
242 }
243
245 void SetProfile(Campaign profile) {
246 mProfile = profile;
247 }
248
249private:
250 int mReserved74[3]; // +0x74, not yet recovered.
251 int mPrefabIndex;
252 std::vector<const char *> mPrefabs;
253 int mEditing;
254 int mNameTyped;
255 int mChanged;
256 int mSaveStarted;
257 int mNameTrimmed;
258 int mSaveOnName;
259 String mFreqName;
260 Campaign mProfile;
261 DataArray *mPrefabsData;
262 DataArray *mLockedPrefabsData;
263};
Saved settings and progress of one player, among them the controller bindings.
Definition campaign.h:20
Reference-counted array of script data nodes.
Definition dataarray.h:20
void Exit(UIScreen *pNextScreen, float fTime) override
Start the exit, and turn the camera to the bust of the Freq unless the custom screen follows.
bool HandleSelectStart(UIComponentSelectStartMsg *pMsg)
Act on a button about to be chosen.
~FreqMakerMainScreen() override
Destroy the screen.
void Undo() override
Restore the profile the screen started from and forget the name.
void OpenKeyboard()
Open the keyboard to type the name, starting from the current name or player_1.
void SetProfile(Campaign profile)
Definition freqmakermainscreen.h:245
DataArray * FindPrefab(const char *pszPrefab)
Find the description of a prefab among the prefabs and locked_prefabs of the metagame configuration.
bool DispatchPriv(Message *pMsg) override
Route chosen buttons, focus changes, controller buttons, and the end of the entry,...
bool HandleFocusChange(UIComponentFocusChangeMsg *pMsg)
Show the help of the component that received the focus.
void ShowSaveHelp(UIComponent *pComponent)
Show the help of the save button, naming the memory card.
bool HandleTransitionComplete(UITransitionCompleteMsg *pMsg)
Show the help of the focused component once this screen has entered.
int ReceiveKeyboardText(const char *pszText) override
Receive the name the player typed, and go to the save screen when saving waits for it.
bool HandleSelect(UIComponentSelectMsg *pMsg)
Go to the save screen when save was chosen with the cross button.
static UIScreen * New(DataArray *pData)
Create a screen from its script description.
Definition freqmakermainscreen.h:60
void GotoSave()
Give the first player the name and mark the profile as the player's own, then go to the save screen.
void SetEditing(int nEditing)
Definition freqmakermainscreen.h:235
FreqMakerMainScreen(DataArray *pData)
Construct the screen from its script description.
void Enter(UIScreen *pPrevScreen, float fTime) override
Show the Freq and list the prefabs, then start the entry.
void SetSaveStarted(int nSaveStarted)
Definition freqmakermainscreen.h:230
bool HandleJoypad(JoypadInputMsg *pMsg)
Return to the Freq menu on the triangle button, through f_maker_lose_main_changes when the Freq chang...
void SetFreqName(const char *pszFreqName)
Definition freqmakermainscreen.h:240
FreqMakerUndoScreen(DataArray *pData)
Construct the screen from its script description.
Definition freqmakerundoscreen.h:20
Message the controller poll sends when a button is pressed or released.
Definition joypadinputmsg.h:23
Mix-in for a screen that receives the text the player types on the front-end keyboard.
Definition keyboarduser.h:9
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
Growable text buffer that is also a PrnStream.
Definition string.h:19
Message a panel sends before it moves its focus to another component.
Definition uicomponentfocuschangemsg.h:26
Message a component sends when the player chooses it.
Definition uicomponentselectmsg.h:28
Message a component sends when the player presses the button that chooses it.
Definition uicomponentselectstartmsg.h:27
One control of a front-end panel, such as a label, a button, or a list.
Definition uicomponent.h:21
UIScreen(DataArray *pData)
Construct a screen from its script description.
Message a screen sends itself once its panels have finished their entry animations.
Definition uitransitioncompletemsg.h:23