|
wavelength 1.0.0
|
The panel at the bottom of the front end that explains the focused control and the buttons. More...
#include <helppanel.h>


Classes | |
| struct | HelpText |
| One run of a help or button text in one font. More... | |
Public Member Functions | |
| HelpPanel (DataArray *pData, const char *pszDir) | |
| Construct a hidden panel from its script description. | |
| ~HelpPanel () override | |
| Destroy the panel. | |
| void | Load () override |
| Take a reference to the panel's file through the loader every help panel shares, creating the loader on the first call. | |
| void | Unload () override |
| Drop a reference to the panel's file, keeping the shared loader on the last reference. | |
| void | FinishLoad () override |
| Find the text objects, the view, and the fonts once the panel's file has loaded, and record where the first help and button texts start. | |
| const char * | FontOf (const char *pszName) |
| Report the font of a font name of the help_fonts entry. | |
| void | ParseText (const String &text) |
| Split a text into runs at its <F<n>> marks into mRuns. | |
| void | ClearHelp () |
| Empty the help text objects. | |
| void | LayoutHelp () |
| Place the runs in the help text objects left to right, and centre them on where the first help text starts. | |
| void | LayoutActions () |
| Place the runs in the button text objects right to left from where the first button text starts. | |
| void | Refresh () |
| Show the help of the component that has the focus on the current screen, or clear the help when no panel has the focus. | |
| void | ShowHelp (UIPanel *pPanel, UIComponent *pComponent) |
| Show the help of a component, from the <screen>_HELP, <panel>_HELP, or <panel>_<component>_HELP token of the locale. | |
| void | ShowActions (UIScreen *pScreen) |
| Show the buttons of a screen, from the <screen>_ACTION or <panel>_ACTION token of the locale, or from default_ACTION. | |
| void | SetHelpText (const char *pszText) |
| Show a help text. | |
| void | SetActionText (const char *pszText) |
| Show a text of the buttons. | |
| Public Member Functions inherited from FreqPanel | |
| FreqPanel (DataArray *pData, const char *pszDir) | |
| Construct a panel from its script description. | |
| ~FreqPanel () override | |
| Destroy the panel. | |
| void | Enter (bool bForce, float fTime) override |
| Start the entry animation and the entry of the panel material animation. | |
| void | Exit (bool bForce, float fTime) override |
| Start the exit animation and the exit of the panel material animation. | |
| void | DrawGizmo () override |
| Stretch the gizmo pyramid from the background mesh to the gizmo and draw it. | |
| void | Poll (float fTime) override |
| Advance the panel to a time and move the panel animation to the panel's frame. | |
| void | Draw () override |
| Move the panel material animations to the front-end time and draw the panel. | |
| void | SetShowing (bool bShowing) override |
| Show or hide the panel's view and the gizmo pyramid. | |
| void | SetFocus (UIComponent *pComponent, int nButton) override |
| Move the focus to a component and play the sound of the directional button that moved it. | |
| void | ShowGizmoMesh (bool bShowing) |
| Show or hide the gizmo pyramid. | |
| void | UpdateBgBox () |
| Measure the background mesh into mBgBox. | |
| Public Member Functions inherited from UIPanel | |
| 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 | 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. | |
| 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 UIPanel * | New (DataArray *pData, const char *pszDir) |
| Create a panel from its script description. | |
| Static Public Member Functions inherited from FreqPanel | |
| static UIPanel * | New (DataArray *pData, const char *pszDir) |
| Create a panel from its script description. | |
| static void | Init (DataArray *pConfig) |
| Read the freq_panel section of the metagame configuration. | |
| Static Public Member Functions inherited from UIPanel | |
| 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. | |
Public Attributes | |
| float | mHelpOrigin [sizeof(Vector3)/sizeof(float)] |
| float | mActionOrigin [sizeof(Vector3)/sizeof(float)] |
| Public Attributes inherited from FreqPanel | |
| Box | mBgBox |
Static Public Attributes | |
| static constexpr int | kNumTexts = 7 |
| The number of text objects for the help and for the buttons. | |
| static std::unique_ptr< RndLoader > | sLoader |
| The loader every help panel shares, or null before the first Load(). | |
| Static Public Attributes inherited from FreqPanel | |
| static constexpr int | kNumGizmoOffsets = 3 |
| The number of gizmo offsets the configuration provides. | |
| static Vector3 | sGizmoOrigPos |
| The position of the gizmo, the panel_gizmo_orig_pos setting. | |
| static Vector3 | sGizmoOffsets [kNumGizmoOffsets] |
| The points of the gizmo the pyramids reach, the panel_gizmo_offset_1 to _3 settings. | |
Additional Inherited Members | |
| Public Types inherited from UIPanel | |
| enum | State { kStateShown = 0 , kStateHidden = 1 , kStateEntering = 2 , kStateExiting = 3 } |
| Where the panel is in its entry and exit, the values of mState. More... | |
| Protected Attributes inherited from UIPanel | |
| 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. | |
The panel at the bottom of the front end that explains the focused control and the buttons.
The RTTI includes the name and records FreqPanel as the base. The object is 0x150 bytes. The screen file builds one under the type help_panel, named help. The panel's file provides the text objects help_help1.txt to help_help7.txt for the help and help_action1.txt to help_action7.txt for the buttons. A text is split into runs at <F<n>> marks, each run in the font the help_fonts entry of the metagame configuration gives for F<n>, and the runs are placed one after another in the text objects. Every panel of the class shares one loader of the panel's file.
| HelpPanel::HelpPanel | ( | DataArray * | pData, |
| const char * | pszDir ) |
Construct a hidden panel from its script description.
| pData | The script description. |
| pszDir | The directory of the description file. |
|
override |
Destroy the panel.
Create a panel from its script description.
Metagame::RegisterScreenClasses() registers the routine for the entry type help_panel.
| pData | The script description. |
| pszDir | The directory of the description file. |
|
overridevirtual |
Take a reference to the panel's file through the loader every help panel shares, creating the loader on the first call.
Reimplemented from UIPanel.
|
overridevirtual |
Drop a reference to the panel's file, keeping the shared loader on the last reference.
Reimplemented from FreqPanel.
|
overridevirtual |
Find the text objects, the view, and the fonts once the panel's file has loaded, and record where the first help and button texts start.
Reimplemented from FreqPanel.
| const char * HelpPanel::FontOf | ( | const char * | pszName | ) |
Report the font of a font name of the help_fonts entry.
| pszName | The font name, such as F1. |
| void HelpPanel::ParseText | ( | const String & | text | ) |
Split a text into runs at its <F<n>> marks into mRuns.
The first run is in F1.
| text | The text. |
| void HelpPanel::ClearHelp | ( | ) |
Empty the help text objects.
| void HelpPanel::LayoutHelp | ( | ) |
Place the runs in the help text objects left to right, and centre them on where the first help text starts.
| void HelpPanel::LayoutActions | ( | ) |
Place the runs in the button text objects right to left from where the first button text starts.
| void HelpPanel::Refresh | ( | ) |
Show the help of the component that has the focus on the current screen, or clear the help when no panel has the focus.
| void HelpPanel::ShowHelp | ( | UIPanel * | pPanel, |
| UIComponent * | pComponent ) |
Show the help of a component, from the <screen>_HELP, <panel>_HELP, or <panel>_<component>_HELP token of the locale.
| pPanel | The panel of the component. |
| pComponent | The component, or null. |
| void HelpPanel::ShowActions | ( | UIScreen * | pScreen | ) |
Show the buttons of a screen, from the <screen>_ACTION or <panel>_ACTION token of the locale, or from default_ACTION.
| pScreen | The screen, or null for the default. |
| void HelpPanel::SetHelpText | ( | const char * | pszText | ) |
Show a help text.
| pszText | The text. |
| void HelpPanel::SetActionText | ( | const char * | pszText | ) |
Show a text of the buttons.
| pszText | The text. |
|
staticconstexpr |
The number of text objects for the help and for the buttons.
|
static |
The loader every help panel shares, or null before the first Load().
| float HelpPanel::mHelpOrigin[sizeof(Vector3)/sizeof(float)] |
Where the help starts.
| float HelpPanel::mActionOrigin[sizeof(Vector3)/sizeof(float)] |
Where the buttons start.