wavelength 1.0.0
Loading...
Searching...
No Matches
metasongscreen.h
Go to the documentation of this file.
1#pragma once
2
3#include "game/songentry.h"
4#include "met/freqscreen.h"
6#include "os/string.h"
7#include "script/dataarray.h"
8#include "ui/uicomponent.h"
11#include "ui/uimanager.h"
12#include "ui/uipanel.h"
14
28class MetaSongScreen : public FreqScreen {
29public:
36 ~MetaSongScreen() override = default;
37
39 static constexpr int kNumSongButtons = 6;
40
48 explicit MetaSongScreen(DataArray *pData);
49
60 static UIScreen *New(DataArray *pData) {
61 return new MetaSongScreen(pData);
62 }
63
73 bool DispatchPriv(Message *pMsg) override;
74
86 void Poll(float fTime) override;
87
88#ifdef VIDEO_STANDARD_PAL
97 void GotoScreenAfterPreview(const char *pszScreen);
98#else
108 void Exit(UIScreen *pNextScreen, float fTime) override;
109#endif
110
123 void Enter(UIScreen *pPrevScreen, float fTime) override;
124
135 const char *Title() override;
136
146
159 void UpdatePreview(UIComponent *pButton, UIPanel *pPanel);
160
170 void ShowPicture(bool bShowPicture);
171
184 void SetUpSongButton(SongEntry *pSong, int nIndex, bool bLocked);
185
200
213
223
233
234private:
235 // Go to a screen, once the preview ends in the PAL build.
236 void GotoNextScreen(const char *pszScreen) {
237#ifdef VIDEO_STANDARD_PAL
238 GotoScreenAfterPreview(pszScreen);
239#else
240 TheUI.GotoScreen(pszScreen);
241#endif
242 }
243
244 String mSong;
245 String mPreviewSong;
246 float mPreviewMixTime;
247 UIPanel *mBandPanel;
248#ifndef VIDEO_STANDARD_PAL
249 UIScreen *mExitScreen;
250 float mExitTime;
251#endif
252 int mExitPending;
253 float mExitStart;
254 int mSongChosen;
255#ifdef VIDEO_STANDARD_PAL
256 String mExitScreenName;
257#endif
258};
Reference-counted array of script data nodes.
Definition dataarray.h:20
FreqScreen(DataArray *pData)
Construct a screen from its script description.
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
void Poll(float fTime) override
Advance the screen, the song preview, and the pending exit.
static UIScreen * New(DataArray *pData)
Create a screen from its script description.
Definition metasongscreen.h:60
bool HandleSelect(UIComponentSelectMsg *pMsg)
Start the game of the song chosen with the cross button.
void ShowPicture(bool bShowPicture)
Show the band picture or the biography of the song.
MetaSongScreen(DataArray *pData)
Construct the screen from its script description.
static constexpr int kNumSongButtons
The number of song buttons in the s_g_sel_song_band panel.
Definition metasongscreen.h:39
bool HandleJoypad(JoypadInputMsg *pMsg)
Practise the song with the focus with the square button, toggle the picture with the circle button,...
bool HandleTransitionComplete(UITransitionCompleteMsg *pMsg)
Show the details of the focused song once this screen has entered.
void UpdatePreview(UIComponent *pButton, UIPanel *pPanel)
Show the details of the song of a button that receives the focus in the s_g_sel_song_band panel.
void SetUpSongButton(SongEntry *pSong, int nIndex, bool bLocked)
Fill the button, the score label, and the grade mesh of a song.
bool HandleFocusChange(UIComponentFocusChangeMsg *pMsg)
Show the details of the song that receives the focus.
~MetaSongScreen() override=default
Destroy the object.
void Enter(UIScreen *pPrevScreen, float fTime) override
Fill the song buttons of the chosen arena, focus a song, and show the arena scores.
bool DispatchPriv(Message *pMsg) override
Route a chosen button, a focus change, the end of the entry, and a controller button,...
void Exit(UIScreen *pNextScreen, float fTime) override
End the song preview and defer the exit until the preview went idle.
const char * Title() override
Report the title of the screen.
SongEntry FindSong(UIComponent *pButton)
Report the song of a song button, 0<n> being the song n of the chosen arena.
View of the entry of one song in the "songs" section of the configuration.
Definition songentry.h:13
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
One control of a front-end panel, such as a label, a button, or a list.
Definition uicomponent.h:21
Group of components drawn from one .rnd file, which a screen shows.
Definition uipanel.h:35
One front-end screen, a set of panels shown together with one panel holding the focus.
Definition uiscreen.h:35
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
UIManager TheUI
The front-end manager.