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

The panel at the bottom of the front end that explains the focused control and the buttons. More...

#include <helppanel.h>

Inheritance diagram for HelpPanel:
Collaboration diagram for HelpPanel:

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ HelpPanel()

HelpPanel::HelpPanel ( DataArray * pData,
const char * pszDir )

Construct a hidden panel from its script description.

Parameters
pDataThe script description.
pszDirThe directory of the description file.
Ghidra address:
NTSC-U/C: 0x001a5568
Ghidra address:
PAL: 0x001ad258

◆ ~HelpPanel()

HelpPanel::~HelpPanel ( )
override

Destroy the panel.

Ghidra address:
NTSC-U/C: 0x001a5b08
Ghidra address:
PAL: 0x001ad7f8

Member Function Documentation

◆ New()

UIPanel * HelpPanel::New ( DataArray * pData,
const char * pszDir )
inlinestatic

Create a panel from its script description.

Metagame::RegisterScreenClasses() registers the routine for the entry type help_panel.

Parameters
pDataThe script description.
pszDirThe directory of the description file.
Returns
The new panel.
Ghidra address:
NTSC-U/C: 0x003618d0
Ghidra address:
PAL: 0x003cfde8

◆ Load()

void HelpPanel::Load ( )
overridevirtual

Take a reference to the panel's file through the loader every help panel shares, creating the loader on the first call.

Ghidra address:
NTSC-U/C: 0x001a55d8
Ghidra address:
PAL: 0x001ad2c8

Reimplemented from UIPanel.

◆ Unload()

void HelpPanel::Unload ( )
overridevirtual

Drop a reference to the panel's file, keeping the shared loader on the last reference.

Ghidra address:
NTSC-U/C: 0x001a5640
Ghidra address:
PAL: 0x001ad330

Reimplemented from FreqPanel.

◆ FinishLoad()

void HelpPanel::FinishLoad ( )
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.

Ghidra address:
NTSC-U/C: 0x001a5670
Ghidra address:
PAL: 0x001ad360

Reimplemented from FreqPanel.

◆ FontOf()

const char * HelpPanel::FontOf ( const char * pszName)

Report the font of a font name of the help_fonts entry.

Parameters
pszNameThe font name, such as F1.
Returns
The font.
Ghidra address:
NTSC-U/C: 0x001a5c90
Ghidra address:
PAL: 0x001ad980

◆ ParseText()

void HelpPanel::ParseText ( const String & text)

Split a text into runs at its <F<n>> marks into mRuns.

The first run is in F1.

Parameters
textThe text.
Ghidra address:
NTSC-U/C: 0x001a5cc0
Ghidra address:
PAL: 0x001ad9b0

◆ ClearHelp()

void HelpPanel::ClearHelp ( )

Empty the help text objects.

Ghidra address:
NTSC-U/C: 0x001a6388
Ghidra address:
PAL: 0x001ae078

◆ LayoutHelp()

void HelpPanel::LayoutHelp ( )

Place the runs in the help text objects left to right, and centre them on where the first help text starts.

Ghidra address:
NTSC-U/C: 0x001a6430
Ghidra address:
PAL: 0x001ae120

◆ LayoutActions()

void HelpPanel::LayoutActions ( )

Place the runs in the button text objects right to left from where the first button text starts.

Ghidra address:
NTSC-U/C: 0x001a6708
Ghidra address:
PAL: 0x001ae3f8

◆ Refresh()

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.

Ghidra address:
NTSC-U/C: 0x001a6998
Ghidra address:
PAL: 0x001ae688

◆ ShowHelp()

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.

Parameters
pPanelThe panel of the component.
pComponentThe component, or null.
Ghidra address:
NTSC-U/C: 0x001a69e0
Ghidra address:
PAL: 0x001ae6d0

◆ ShowActions()

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.

Parameters
pScreenThe screen, or null for the default.
Ghidra address:
NTSC-U/C: 0x001a6b30
Ghidra address:
PAL: 0x001ae820

◆ SetHelpText()

void HelpPanel::SetHelpText ( const char * pszText)

Show a help text.

Parameters
pszTextThe text.
Ghidra address:
NTSC-U/C: 0x001a6ca0
Ghidra address:
PAL: 0x001ae990

◆ SetActionText()

void HelpPanel::SetActionText ( const char * pszText)

Show a text of the buttons.

Parameters
pszTextThe text.
Ghidra address:
NTSC-U/C: 0x001a6cf0
Ghidra address:
PAL: 0x001ae9e0

Member Data Documentation

◆ kNumTexts

int HelpPanel::kNumTexts = 7
staticconstexpr

The number of text objects for the help and for the buttons.

◆ sLoader

std::unique_ptr<RndLoader> HelpPanel::sLoader
static

The loader every help panel shares, or null before the first Load().

Ghidra address:
NTSC-U/C: 0x003af8dc
Ghidra address:
PAL: 0x0042e770

◆ mHelpOrigin

float HelpPanel::mHelpOrigin[sizeof(Vector3)/sizeof(float)]

Where the help starts.

◆ mActionOrigin

float HelpPanel::mActionOrigin[sizeof(Vector3)/sizeof(float)]

Where the buttons start.


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