wavelength 1.0.0
Loading...
Searching...
No Matches
UIScreen Class Reference

One front-end screen, a set of panels shown together with one panel holding the focus. More...

#include <uiscreen.h>

Inheritance diagram for UIScreen:
Collaboration diagram for UIScreen:

Classes

struct  Transition
 One entry of the screen's transition table. More...

Public Member Functions

 UIScreen (DataArray *pData)
 Construct a screen from its script description.
 ~UIScreen () override
 Destroy the screen.
bool Dispatch (Message *pMsg) override
 Offer a message to the manager, then handle it here, then pass a navigation message on.
bool DispatchPriv (Message *pMsg) override
 Follow the transition of a pressed button or a chosen component.
virtual void Poll (float fTime)
 Advance the panels to a time, and finish the exit or the entry once their animations stop.
virtual void Draw ()
 Draw the panels.
virtual void Exit (UIScreen *pNextScreen, float fTime)
 Start the exit to another screen.
virtual void Enter (UIScreen *pPrevScreen, float fTime)
 Become the current screen and start the entry animations of the panels.
virtual void Print (PrnStream &stream)
 Write a description of the screen, its panels, and its transitions.
void ClearTransitions ()
 Empty the transition table.
void AddTransition (const char *pszComponent, int nButton, const char *pszScreen)
 Append an entry to the transition table.
void AddPanel (UIPanel *pPanel)
 Add a panel to the screen.
bool HandleJoypad (JoypadInputMsg *pMsg)
 Follow the transition of a pressed controller button.
bool HandleSelect (UIComponentSelectMsg *pMsg)
 Follow the transition of a component chosen with the cross button.
void SetFocus (UIPanel *pPanel)
 Move the focus to a panel.
UIComponent * FindComponent (const char *pszName)
 Find a component on any of the screen's panels.
Transition * FindTransition (UIComponent *pComponent, bool bFail)
 Find the transition of a component.
Transition * FindTransition (int nButton, bool bFail)
 Find the transition of a controller button.
void Load ()
 Load the panels.
void Unload ()
 Unload the panels.
bool IsLoaded ()
 Report whether every panel has loaded.
const char * GetName () const
const char * GetGroup () const
UIPanel * GetFocusPanel () const
UIScreen * GetNextScreen () const
UIScreen * GetPrevScreen () const
const std::map< const char *, UIPanel *, StrLess > & GetPanels () const
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the pool heaps under the tag "MsgSink".
void operator delete (void *pBlock)
 Return a sink to the pool heaps.
virtual ~MsgSink ()
void * operator new (size_t size)
 Allocate from the main heap under the name MsgSink.
void operator delete (void *mem)
 Return memory to its heap.
virtual ~MsgSink ()
 Destroy the sink.

Static Public Member Functions

static UIScreen * New (DataArray *pData)
 Create a screen from its script description.

Protected Attributes

const char * mName
const char * mGroup
std::map< const char *, UIPanel *, StrLess > mPanels
UIPanel * mFocusPanel
std::vector< Transition > mTransitions
UIScreen * mPrevScreen
UIScreen * mNextScreen
int mForceEntryExit

Detailed Description

One front-end screen, a set of panels shown together with one panel holding the focus.

The RTTI records the class as deriving from MsgSink. The object is 0x3c bytes. UIManager creates one for each screen entry of the front-end description, through the factory registered for the entry's type. The entry provides these:

  • index 1, the name;
  • panels, the names of the panels the screen shows;
  • focus, the panel that first receives the focus, or the first panel by name;
  • screen_transitions, pairs of a component name or a controller button and the screen that choosing the component or pressing the button leads to;
  • force_entry_exit, whether the panels skip their animations;
  • group, the loading group, which must be one of the allowable_groups of the configuration.

UIManager::GotoScreen() calls Exit() on the current screen. Once the exit animations have played and the next screen has loaded, Poll() unloads this screen's panels and calls Enter() on the next screen, which becomes current. A screen that has entered dispatches a UITransitionCompleteMsg to itself.

Constructor & Destructor Documentation

◆ UIScreen()

UIScreen::UIScreen ( DataArray * pData)
explicit

Construct a screen from its script description.

Parameters
pDataThe script description.
Ghidra address:
NTSC-U/C: 0x0020a600
Ghidra address:
PAL: 0x00213400

◆ ~UIScreen()

UIScreen::~UIScreen ( )
override

Destroy the screen.

Ghidra address:
NTSC-U/C: 0x0020aa10
Ghidra address:
PAL: 0x00213810

Member Function Documentation

◆ New()

UIScreen * UIScreen::New ( DataArray * pData)
inlinestatic

Create a screen from its script description.

UIManager::Init() registers the routine for the entry type screen.

Parameters
pDataThe script description.
Returns
The new screen.
Ghidra address:
NTSC-U/C: 0x00379470
Ghidra address:
PAL: 0x003e7ba0

◆ Dispatch()

bool UIScreen::Dispatch ( Message * pMsg)
overridevirtual

Offer a message to the manager, then handle it here, then pass a navigation message on.

A message that is neither a controller button nor a keyboard key goes first to UIManager. A controller button or keyboard key that the screen does not handle goes to the panel with the focus.

Parameters
pMsgThe message.
Returns
Whether the message was handled.
Ghidra address:
NTSC-U/C: 0x0020af00
Ghidra address:
PAL: 0x00213d00

Reimplemented from MsgSink.

◆ DispatchPriv()

bool UIScreen::DispatchPriv ( Message * pMsg)
overridevirtual

Follow the transition of a pressed button or a chosen component.

Parameters
pMsgThe message.
Returns
Whether the message was handled.
Ghidra address:
NTSC-U/C: 0x0020afb8
Ghidra address:
PAL: 0x00213db8

Implements MsgSink.

Reimplemented in UnlockScreen, UploadNoteScreen, and XProceedScreen.

◆ Poll()

virtual void UIScreen::Poll ( float fTime)
virtual

Advance the panels to a time, and finish the exit or the entry once their animations stop.

Parameters
fTimeThe front-end time in milliseconds.
Ghidra address:
NTSC-U/C: 0x0020b138
Ghidra address:
PAL: 0x00213f38

Reimplemented in ArenaUnlockScreen, BossJourneyScreen, BossUnlockScreen, CardsConnectedScreen, CreditsScreen, IntroScreen, MCCheckScreen, MetaArenaScreen, MetaSongScreen, MetaStartScreen, MultiEndGameScreen, MultiLoadFreqScreen, NetEndGameScreen, NetLpadScreen, NumPlayersScreen, PartUnlockDoneScreen, PartUnlockScreen, RedbookPlaybackScreen, SoloEndGameScreen, and SongDecryptScreen.

◆ Draw()

virtual void UIScreen::Draw ( )
virtual

Draw the panels.

Ghidra address:
NTSC-U/C: 0x0020b3a8
Ghidra address:
PAL: 0x002141a8

Reimplemented in FreqScreen.

◆ Exit()

virtual void UIScreen::Exit ( UIScreen * pNextScreen,
float fTime )
virtual

Start the exit to another screen.

A panel the next screen shares stays, and one of those that is exiting enters again. The others start their exit animations.

Parameters
pNextScreenThe screen to change to.
fTimeThe front-end time in milliseconds.
Ghidra address:
NTSC-U/C: 0x0020b6c8
Ghidra address:
PAL: 0x002144c8

Reimplemented in ArenaUnlockScreen, BossUnlockScreen, ControllerConfigScreen, FreqMakerEmblemScreen, FreqMakerMainScreen, FreqMakerPartConfigScreen, FreqScreen, JukeboxScreen, MainOptionsScreen, MCCheckScreen, MetaMainScreen, MetaSongScreen, MetaStartScreen, NetLpadScreen, NetMainScreen, NetParamsScreen, PartUnlockScreen, and SongDecryptScreen.

◆ Enter()

virtual void UIScreen::Enter ( UIScreen * pPrevScreen,
float fTime )
virtual

Become the current screen and start the entry animations of the panels.

Parameters
pPrevScreenThe screen this one replaces, or null.
fTimeThe front-end time in milliseconds.
Ghidra address:
NTSC-U/C: 0x0020b2e0
Ghidra address:
PAL: 0x002140e0

Reimplemented in ArenaUnlockScreen, BootScreen, BossJourneyScreen, BossUnlockScreen, CardsConnectedScreen, ChooseMemCardScreen, ControllerConfigScreen, CopyFreqScreen, CreditsScreen, FreqConfirmScreen, FreqCopyDelScreen, FreqMakerCustomScreen, FreqMakerEmblemScreen, FreqMakerMainScreen, FreqMakerPartConfigScreen, FreqScreen, GameOptionsScreen, JukeboxScreen, LaunchScreen, MainOptionsScreen, MetaArenaScreen, MetaMainScreen, MetaSkillScreen, MetaSongScreen, MetaStartScreen, ModeScreen, MsgErrorScreen, MultiEndGameScreen, MultiFreqSelectScreen, MultiLoadFreqScreen, MultiSetupRemixSaveScreen, NameErrorScreen, NetChangePasswordScreen, NetChooseIConfigScreen, NetCreateUserScreen, NetEULAScreen, NetHostingScreen, NetLoginScreen, NetLpadScreen, NetMainScreen, NetParamsScreen, NetPasswordScreen, NetRankingScreen, NetSearchScreen, NetServerSelScreen, NetSortedScreen, NetWelcomeScreen, NoControllerScreen, NumPlayersScreen, PartUnlockDoneScreen, PartUnlockScreen, PauseScreen, PlayerSearchResultsScreen, PowerupScreen, PupTipsScreen, RedbookPlaybackScreen, RemixOrFreqScreen, RemixSelectScreen, RemixSongScreen, RemixTypeScreen, SaveFreqScreen, SelLoadedFreqScreen, SelRemixDownloadScreen, SetupNameScreen, SetupNewChatroomScreen, SetupRemixSaveScreen, SoloEndGameScreen, SongDecryptScreen, SpaceErrorScreen, TipsScreen, TransitionErrorScreen, and UploadNoteScreen.

◆ Print()

virtual void UIScreen::Print ( PrnStream & stream)
virtual

Write a description of the screen, its panels, and its transitions.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x0020b888
Ghidra address:
PAL: 0x00214688

◆ ClearTransitions()

void UIScreen::ClearTransitions ( )

Empty the transition table.

Ghidra address:
NTSC-U/C: 0x0020ab10
Ghidra address:
PAL: 0x00213910

◆ AddTransition()

void UIScreen::AddTransition ( const char * pszComponent,
int nButton,
const char * pszScreen )

Append an entry to the transition table.

Both names are interned first.

Parameters
pszComponentThe component that leads to the screen.
nButtonThe controller button that leads to the screen.
pszScreenThe name of the screen.
Ghidra address:
NTSC-U/C: 0x0020ab50
Ghidra address:
PAL: 0x00213950

◆ AddPanel()

void UIScreen::AddPanel ( UIPanel * pPanel)

Add a panel to the screen.

Parameters
pPanelThe panel.
Ghidra address:
NTSC-U/C: 0x0020ad90
Ghidra address:
PAL: 0x00213b90

◆ HandleJoypad()

bool UIScreen::HandleJoypad ( JoypadInputMsg * pMsg)

Follow the transition of a pressed controller button.

Parameters
pMsgThe message of the button.
Returns
Whether the button is ignored because the screen is changing.
Ghidra address:
NTSC-U/C: 0x0020b050
Ghidra address:
PAL: 0x00213e50

◆ HandleSelect()

bool UIScreen::HandleSelect ( UIComponentSelectMsg * pMsg)

Follow the transition of a component chosen with the cross button.

Parameters
pMsgThe message of the choice.
Returns
Whether a transition was found.
Ghidra address:
NTSC-U/C: 0x0020b0c8
Ghidra address:
PAL: 0x00213ec8

◆ SetFocus()

void UIScreen::SetFocus ( UIPanel * pPanel)

Move the focus to a panel.

Parameters
pPanelThe panel, or null.
Ghidra address:
NTSC-U/C: 0x0020b420
Ghidra address:
PAL: 0x00214220

◆ FindComponent()

UIComponent * UIScreen::FindComponent ( const char * pszName)

Find a component on any of the screen's panels.

A name found on two panels is reported, and the component of the later panel by name wins.

Parameters
pszNameThe name.
Returns
The component, or null.
Ghidra address:
NTSC-U/C: 0x0020b490
Ghidra address:
PAL: 0x00214290

◆ FindTransition() [1/2]

Transition * UIScreen::FindTransition ( UIComponent * pComponent,
bool bFail )

Find the transition of a component.

Parameters
pComponentThe component.
bFailTreat a missing transition as an error. The shipped build ignores it.
Returns
The transition, or null.
Ghidra address:
NTSC-U/C: 0x0020b808
Ghidra address:
PAL: 0x00214608

◆ FindTransition() [2/2]

Transition * UIScreen::FindTransition ( int nButton,
bool bFail )

Find the transition of a controller button.

Parameters
nButtonOne of JoypadButton.
bFailTreat a missing transition as an error. The shipped build ignores it.
Returns
The transition, or null.
Ghidra address:
NTSC-U/C: 0x0020b848
Ghidra address:
PAL: 0x00214648

◆ Load()

void UIScreen::Load ( )

Load the panels.

Ghidra address:
NTSC-U/C: 0x0020baf0
Ghidra address:
PAL: 0x002148f0

◆ Unload()

void UIScreen::Unload ( )

Unload the panels.

Ghidra address:
NTSC-U/C: 0x0020bb68
Ghidra address:
PAL: 0x00214968

◆ IsLoaded()

bool UIScreen::IsLoaded ( )

Report whether every panel has loaded.

Returns
Whether the screen is ready to show.
Ghidra address:
NTSC-U/C: 0x0020bbe0
Ghidra address:
PAL: 0x002149e0

◆ GetName()

const char * UIScreen::GetName ( ) const
inline
Returns
The name, a symbol.

◆ GetGroup()

const char * UIScreen::GetGroup ( ) const
inline
Returns
The loading group, a symbol.

◆ GetFocusPanel()

UIPanel * UIScreen::GetFocusPanel ( ) const
inline
Returns
The panel with the focus, or null.

◆ GetNextScreen()

UIScreen * UIScreen::GetNextScreen ( ) const
inline
Returns
The screen this one is exiting to, until the exit finishes.

◆ GetPrevScreen()

UIScreen * UIScreen::GetPrevScreen ( ) const
inline
Returns
The screen this one is entering from, until the entry finishes.

◆ GetPanels()

const std::map< const char *, UIPanel *, StrLess > & UIScreen::GetPanels ( ) const
inline
Returns
The panels by name.

Member Data Documentation

◆ mName

const char* UIScreen::mName
protected

The name, a symbol.

◆ mGroup

const char* UIScreen::mGroup
protected

The loading group, a symbol.

◆ mPanels

std::map<const char *, UIPanel *, StrLess> UIScreen::mPanels
protected

The panels by name. Borrowed.

◆ mFocusPanel

UIPanel* UIScreen::mFocusPanel
protected

The panel with the focus.

◆ mTransitions

std::vector<Transition> UIScreen::mTransitions
protected

The transition table.

◆ mPrevScreen

UIScreen* UIScreen::mPrevScreen
protected

The screen this one is entering from, until the entry finishes.

◆ mNextScreen

UIScreen* UIScreen::mNextScreen
protected

The screen this one is exiting to, until the exit finishes.

◆ mForceEntryExit

int UIScreen::mForceEntryExit
protected

Whether the panels skip their animations.


The documentation for this class was generated from the following file: