|
wavelength 1.0.0
|
Group of components drawn from one .rnd file, which a screen shows. More...
#include <uipanel.h>


Public Types | |
| enum | State { kStateShown = 0 , kStateHidden = 1 , kStateEntering = 2 , kStateExiting = 3 } |
| Where the panel is in its entry and exit, the values of mState. More... | |
Public Member Functions | |
| UIPanel (DataArray *pData, const char *pszDir) | |
| Construct a hidden panel from its script description. | |
| ~UIPanel () override | |
| Destroy the panel, its components, and the objects its file loaded. | |
| bool | Dispatch (Message *pMsg) override |
| Offer a message to the current screen, the panel, the navigator, and the component with the focus. | |
| bool | DispatchPriv (Message *pMsg) override |
| Handle a message sent to the panel. | |
| virtual void | Load () |
| Take a reference to the panel's file, queueing the file on the first reference. | |
| virtual void | Unload () |
| Drop a reference to the panel's file, destroying the components and the loader on the last reference. | |
| virtual void | Enter (bool bForce, float fTime) |
| Start the entry animation. | |
| virtual void | Exit (bool bForce, float fTime) |
| Start the exit animation. | |
| virtual void | Focus () |
| React to the screen giving the panel the focus by letting the navigator move the focus. | |
| virtual void | Unfocus () |
| React to the screen taking the focus away. | |
| virtual void | DrawGizmo () |
| Draw what goes under the panel. | |
| virtual void | Poll (float fTime) |
| Advance the panel's animations and its components to a time. | |
| virtual void | Draw () |
| Draw the panel's view once it has loaded, unless the panel is hidden. | |
| virtual void | SetShowing (bool bShowing) |
| Show or hide the panel's view. | |
| virtual void | SetFocus (UIComponent *pComponent, int nButton) |
| Move the focus to a component. | |
| virtual void | FinishLoad () |
| Find the loaded objects and create the components once the panel's file has loaded. | |
| bool | IsLoaded () |
| Report whether the panel's file has loaded, finishing the load when it has. | |
| void | AddComponent (UIComponent *pComponent) |
| Register a component under its name. | |
| void | SetTextsShowing (bool bShowing) |
| Show or hide every text object of the panel's file. | |
| float | ComputeFrame (float fTime) |
| Report the frame of the entry and exit animation at a time. | |
| UIComponent * | FindComponent (const char *pszName, bool bFail) |
| Find a component by name. | |
| void | LocalizeTexts (const char *pszFile, std::list< RndObject * > &objects) |
| Collect and localise the text objects of the panel's file. | |
| const char * | GetName () const |
| UIComponent * | GetFocus () const |
| int | GetState () const |
| float | GetTransitionStart () const |
| const std::map< const char *, std::unique_ptr< UIComponent >, StrLess > & | GetComponents () 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 void | Init (DataArray *pConfig) |
| Read the default frames of the entry and exit animation. | |
| static UIPanel * | New (DataArray *pData, const char *pszDir) |
| Create a panel from its script description. | |
Protected Attributes | |
| float | mFrame |
| float | mIdleFrame |
| const char * | mName |
| String | mFile |
| int | mState |
| RndView * | mView |
| const char * | mFocusName |
| float | mLoopStart |
| RndAnimatable * | mLoopAnim |
| RndAnimatable * | mEnterExitAnim |
| float | mTransitionStart |
| float | mShownFrame |
| float | mHiddenFrame |
| float | mEnterMs |
| float | mExitMs |
| int | mEnterReversed |
| int | mExitReversed |
| float | mEnterStartFrame |
| float | mExitStartFrame |
| int | mLoadRefs |
| int | mLoaded |
| DataArray * | mData |
| std::list< RndText * > | mTexts |
| std::map< const char *, std::unique_ptr< UIComponent >, StrLess > | mComponents |
| std::unique_ptr< UINavigator > | mNavigator |
| UIComponent * | mFocus |
| RndLoader * | mLoader |
| std::unique_ptr< RndLoader > | mOwnedLoader |
| The loader the panel created, or null when it has none or uses a shared one. | |
Group of components drawn from one .rnd file, which a screen shows.
The RTTI records the class as deriving from MsgSink. The object is 0x90 bytes. UIManager creates one for each panel entry of the front-end description, through the factory registered for the entry's type. Index 1 of the entry is the name, and the file is <directory>/<name>.rnd beside the description. From index 2 the entry lists the components (each entry type that includes comp), the component that first receives the focus (focus), the navigator (navigator), and the frames of the entry and exit animation (panel_enter_exit).
Load() and Unload() count references. The first Load() queues the file, and IsLoaded() creates the components once the file has loaded. The file provides the view <name>.view, the looping animation <name>_always.anim, and the entry and exit animation <name>_enterexit.anim. Enter() and Exit() play the entry and exit animation over the time given by its frames, and mState follows them.
| enum UIPanel::State |
| UIPanel::UIPanel | ( | DataArray * | pData, |
| const char * | pszDir ) |
Construct a hidden panel from its script description.
The panel takes a reference to the description.
| pData | The script description. |
| pszDir | The directory of the description file. |
|
override |
Destroy the panel, its components, and the objects its file loaded.
|
static |
Read the default frames of the entry and exit animation.
The panel_enter_exit section of the configuration provides enter_start_frame, enter_stop_frame, exit_start_frame, and exit_stop_frame. Without the section the defaults remain. A panel's own panel_enter_exit entry overrides them.
| pConfig | The ui section of the configuration. |
Create a panel from its script description.
UIManager::Init() registers the routine for the entry type panel.
| pData | The script description. |
| pszDir | The directory of the description file. |
|
overridevirtual |
Offer a message to the current screen, the panel, the navigator, and the component with the focus.
A message that is neither a controller button nor a keyboard key goes first to the current screen and goes no further than the navigator. A controller button or keyboard key skips the screen and reaches the component with the focus when nothing before handles it.
| pMsg | The message. |
Reimplemented from MsgSink.
|
overridevirtual |
Handle a message sent to the panel.
The routine asks the message for its type and handles nothing.
| pMsg | The message. |
Implements MsgSink.
|
virtual |
Take a reference to the panel's file, queueing the file on the first reference.
The first reference also hides the panel.
Reimplemented in BonusPicPanel, and HelpPanel.
|
virtual |
Drop a reference to the panel's file, destroying the components and the loader on the last reference.
The name of the component with the focus is kept, and that component receives the focus again after the next load.
Reimplemented in BonusPicPanel, ChatPanel, FreqPanel, FreqSelPanel, HelpPanel, SoloLoseTipsPanel, and SoloWinStatsPanel.
|
virtual |
Start the entry animation.
A panel that is exiting reverses into its entry at the matching point of the animation.
| bForce | Show the panel at once instead of animating. |
| fTime | The front-end time in milliseconds. |
Reimplemented in AvatarPanel, ChatPanel, ControllerPanel, DialogPanel, FreqPanel, FreqSelPanel, KeyboardPanel, LaunchMTVPanel, MCDialogPanel, NetFoundPlayerPanel, NetLPadGamePanel, NetLPadPlayerPanel, NetMainPanel, NetMainPlayersPanel, NetRankedPlayersPanel, NetSortedLaunchpadsPanel, and SoloLoseTipsPanel.
|
virtual |
Start the exit animation.
A panel that is entering reverses into its exit at the matching point of the animation.
| bForce | Hide the panel at once instead of animating. |
| fTime | The front-end time in milliseconds. |
Reimplemented in AvatarPanel, ChatPanel, FreqPanel, KeyboardPanel, NetMainPanel, NetMainPlayersPanel, SoloWinStatsPanel, and SongPicPanel.
|
virtual |
React to the screen giving the panel the focus by letting the navigator move the focus.
Reimplemented in FocusChangePanel, NetHostLPadButtonPanel, NetLPadPlayerPanel, NetMainLaunchpadsPanel, NetMainLobbiesPanel, NetMainPlayersPanel, NetSongPanel, and PlaylistPanel.
|
inlinevirtual |
React to the screen taking the focus away.
The base routine does nothing.
Reimplemented in FocusChangePanel, NetHostLPadButtonPanel, NetLPadPlayerPanel, NetMainLaunchpadsPanel, NetMainLobbiesPanel, NetMainPlayersPanel, NetSongPanel, and PlaylistPanel.
|
inlinevirtual |
Draw what goes under the panel.
FreqScreen::Draw() calls the routine for each panel before the panels draw. The base routine draws nothing.
Reimplemented in FreqPanel.
|
virtual |
Advance the panel's animations and its components to a time.
| fTime | The front-end time in milliseconds. |
Reimplemented in ControllerPanel, FreqPanel, FullRankedPanel, KeyboardPanel, NetMainPanel, SoloLoseTipsPanel, SoloWinStatsPanel, and SongPicPanel.
|
virtual |
Draw the panel's view once it has loaded, unless the panel is hidden.
Reimplemented in AvatarPanel, FreqPanel, and NetMainPlayersPanel.
|
virtual |
Show or hide the panel's view.
| bShowing | Whether the view shows. |
Reimplemented in FreqPanel.
|
virtual |
Move the focus to a component.
The panel first dispatches a UIComponentFocusChangeMsg to itself, and a handler that reports it as handled keeps the focus where it is.
| pComponent | The component, or null. |
| nButton | The controller button that moved the focus, or kPadNone. The base routine ignores it. |
Reimplemented in FreqPanel, and KeyboardPanel.
|
virtual |
Find the loaded objects and create the components once the panel's file has loaded.
Reimplemented in AvatarPanel, ChatPanel, DialogPanel, FreqPanel, FullRankedPanel, HelpPanel, NetButtonPanel, NetMainPanel, NetMainPlayersPanel, and SongPicPanel.
| bool UIPanel::IsLoaded | ( | ) |
Report whether the panel's file has loaded, finishing the load when it has.
| void UIPanel::AddComponent | ( | UIComponent * | pComponent | ) |
Register a component under its name.
| pComponent | The component. |
| void UIPanel::SetTextsShowing | ( | bool | bShowing | ) |
Show or hide every text object of the panel's file.
| bShowing | Whether the texts show. |
| float UIPanel::ComputeFrame | ( | float | fTime | ) |
Report the frame of the entry and exit animation at a time.
An entry or exit that has run its length ends here, which hides the texts of an exit.
| fTime | The front-end time in milliseconds. |
| UIComponent * UIPanel::FindComponent | ( | const char * | pszName, |
| bool | bFail ) |
Find a component by name.
| pszName | The name. |
| bFail | Treat a missing component as an error. The shipped build ignores it. |
| void UIPanel::LocalizeTexts | ( | const char * | pszFile, |
| std::list< RndObject * > & | objects ) |
Collect and localise the text objects of the panel's file.
Each text object is hidden, and its name with any .txt removed is the token the locale translates. In the edit mode of the ui configuration the routine counts each token's uses and records the tokens the locale lacks for UIManager::ReportLocalizeErrors().
| pszFile | The panel's file. |
| objects | The objects the file loaded. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
The frame of the entry and exit animation.
|
protected |
The frame ComputeFrame() reports while neither animation plays.
|
protected |
The name, a symbol.
|
protected |
The .rnd file.
|
protected |
One of State.
|
protected |
The view of the file, or null. Borrowed.
|
protected |
The component that receives the focus after a load.
|
protected |
The time the looping animation's frame counts from.
|
protected |
The looping animation, or null. Borrowed.
|
protected |
The entry and exit animation, or null. Borrowed.
|
protected |
The time the entry or exit started, or 0 for neither.
|
protected |
The frame the entry stops at.
|
protected |
The frame the exit stops at.
|
protected |
The length of the entry.
|
protected |
The length of the exit.
|
protected |
Whether the entry plays its frames backwards.
|
protected |
Whether the exit plays its frames backwards.
|
protected |
The frame the entry starts at.
|
protected |
The frame the exit starts at.
|
protected |
Whether FinishLoad() has run since the last load.
|
protected |
The script description. Borrowed (reference counted).
|
protected |
The text objects of the file. Borrowed.
|
protected |
Components.
|
protected |
The navigator that moves the focus.
|
protected |
The component with the focus, or null. Borrowed.
|
protected |
The loader of the file in use, or null. See mOwnedLoader.
|
protected |
The loader the panel created, or null when it has none or uses a shared one.