wavelength 1.0.0
Loading...
Searching...
No Matches
multiloadfreqscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5#include "game/campaign.h"
7#include "met/errorscreen.h"
8#include "script/dataarray.h"
9#include "ui/uiscreen.h"
11
22public:
24 static constexpr int kMaxPlayers = 4;
25
33 explicit MultiLoadFreqScreen(DataArray *pData) : ErrorScreen(pData), mLoaded(0) {
34 }
35
43 }
44
53 static UIScreen *New(DataArray *pData) {
54 return new MultiLoadFreqScreen(pData);
55 }
56
64 const char *Title() override {
65 return "";
66 }
67
76 bool DispatchPriv(Message *pMsg) override;
77
86 void Enter(UIScreen *pPrevScreen, float fTime) override;
87
96 void Poll(float fTime) override;
97
107 void OnFreqsLoaded(int nStatus, std::vector<Campaign> *pProfiles) override;
108
109#ifdef VIDEO_STANDARD_PAL
117 void Reset();
118#endif
119
121 void SetLoaded(int nLoaded) {
122 mLoaded = nLoaded;
123 }
124
125private:
135 void LoadNextSlot();
136
148 bool HandleTransitionComplete(UITransitionCompleteMsg *pMsg);
149
150 std::vector<Campaign> mProfiles; // The Freqs of every slot, then the prefabs.
151 int mSelected[kMaxPlayers]; // The Freq each player starts on, or -1.
152 int mFirstProfile[kMaxPlayers]; // The first Freq of each slot in mProfiles, or -1.
153 int mLoaded; // Whether the next poll moves on to the next slot.
154};
Reference-counted array of script data nodes.
Definition dataarray.h:20
ErrorScreen(DataArray *pData)
Construct the screen from its script description.
Receiver of the outcome of the memory card work MCManager runs.
Definition memcarduser.h:19
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:40
static constexpr int kMaxPlayers
The number of players whose Freqs the screen loads.
Definition multiloadfreqscreen.h:24
void SetLoaded(int nLoaded)
Definition multiloadfreqscreen.h:121
MultiLoadFreqScreen(DataArray *pData)
Construct the screen from its script description.
Definition multiloadfreqscreen.h:33
static UIScreen * New(DataArray *pData)
Create a screen from its script description.
Definition multiloadfreqscreen.h:53
const char * Title() override
Report the empty title of the screen.
Definition multiloadfreqscreen.h:64
void Enter(UIScreen *pPrevScreen, float fTime) override
Enter, returning to m_mode in a duel and to m_player otherwise.
~MultiLoadFreqScreen() override
Destroy the screen.
Definition multiloadfreqscreen.h:42
void Poll(float fTime) override
Move on to the next slot once a load has ended.
bool DispatchPriv(Message *pMsg) override
Route the end of the entry to HandleTransitionComplete().
void OnFreqsLoaded(int nStatus, std::vector< Campaign > *pProfiles) override
Add the Freqs of a slot, or read the slot again after a card change.
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