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

Key of the front-end keyboard. More...

#include <keyboardkey.h>

Inheritance diagram for KeyboardKey:
Collaboration diagram for KeyboardKey:

Public Member Functions

 KeyboardKey (DataArray *pData, const char *pszPanel)
 Construct a key from its script description.
 ~KeyboardKey () override
 Destroy the key.
bool DispatchPriv (Message *pMsg) override
 Route controller buttons, and pass every other message to UIButton.
bool HandleJoypad (JoypadInputMsg *pMsg)
 Report the choice as the cross button goes down, and flash once when no sink handled it.
void Flash ()
 Flash once, as when the key is chosen.
Public Member Functions inherited from UIButton
 UIButton (DataArray *pData, const char *pszPanel)
 Construct a button from its script description.
 ~UIButton () override
 Destroy the button.
bool DispatchPriv (Message *pMsg) override
 Handle a controller button, or pass any other message to UIComponent.
void SetShowing (bool bShowing) override
 Show or hide the button, its text, and its mesh.
const char * Text () const override
 Report the text of the text object.
void SetText (const char *pszText) override
 Replace the text of the text object.
void SetState (int nState, bool bForce) override
 Change the state and give the mesh and the text the material and the font the style lists for it.
void Unfocus () override
 Stop a flash that runs and return to the state from before it.
void Poll (float fTime) override
 Advance the flash to a time, and send the UIComponentSelectMsg once it ends.
void Print (PrnStream &stream) override
 Write the name, the visibility, the state, and the flash.
virtual void StartFlash (float fTime, int nFlashes, int nSelectedState, int nNormalState, float fSelectedMs, float fNormalMs)
 Start a flash between two states.
void SetStyle (UIStyle *pStyle)
 Replace the style and apply the current state again.
bool HandleSelect (JoypadInputMsg *pMsg)
 Start the flash when the cross button goes down.
UIStyle * GetStyle () const
Public Member Functions inherited from UIComponent
 UIComponent (DataArray *pData)
 Construct a showing component in the normal state.
bool Dispatch (Message *pMsg) override
 Offer a message to the focused panel of the current screen, then handle it here.
bool DispatchPriv (Message *pMsg) override
 Handle a message sent to the component.
virtual bool IsShowing () const
 Report whether the component is showing.
virtual int GetState () const
 Report the state the component shows.
virtual void Focus ()
 React to the panel giving the component the focus.
const char * GetName () const
int GetShowing () 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 UIComponent * New (DataArray *pData, const char *pszPanel)
 Create a key from its script description.
Static Public Member Functions inherited from UIButton
static UIComponent * New (DataArray *pData, const char *pszPanel)
 Create a button from its script description.
Static Public Member Functions inherited from UIComponent
static void Init (DataArray *pConfig)
 Read the parameters of the flash a button shows when it is chosen.

Static Public Attributes

static int sNumFlashes
 Number of flashes of a chosen key.
static float sSelectedMs
 Milliseconds of each flash a chosen key spends in the selected state.
static float sNormalMs
 Milliseconds of each flash a chosen key spends in the normal state.

Additional Inherited Members

Public Types inherited from UIComponent
enum  State { kStateNormal = 0 , kStateSelected = 1 , kStateDisabled = 2 }
 The state a component shows, the values of mState and the index UIStyle selects with. More...
Protected Attributes inherited from UIButton
int mFlashDone
float mFlashStart
float mFlashPeriod
float mSelectedMs
float mNormalMs
float mFlashEnd
int mNormalState
int mSelectedState
int mRevertState
RndMesh * mMesh
RndText * mText
UIStyle * mStyle
Protected Attributes inherited from UIComponent
const char * mName
int mShowing
int mState
Static Protected Attributes inherited from UIComponent
static int sNumFlashes
 Number of times a chosen button flashes before it reports the choice.
static float sSelectedMs
 Milliseconds of each flash a chosen button spends in the selected state.
static float sNormalMs
 Milliseconds of each flash a chosen button spends in the normal state.

Detailed Description

Key of the front-end keyboard.

The RTTI records the class as deriving from UIButton. The object is 0x40 bytes and its vtable is at 0x003d03f8. The metagame registers the class for the component type key_comp. Unlike a button, a key reports its choice as soon as the cross button goes down and flashes once afterwards.

Constructor & Destructor Documentation

◆ KeyboardKey()

KeyboardKey::KeyboardKey ( DataArray * pData,
const char * pszPanel )

Construct a key from its script description.

Parameters
pDataThe script description.
pszPanelThe name of the panel the key belongs to.
Ghidra address:
NTSC-U/C: 0x00362520
Ghidra address:
PAL: 0x003d0a38

◆ ~KeyboardKey()

KeyboardKey::~KeyboardKey ( )
override

Destroy the key.

Ghidra address:
NTSC-U/C: 0x00362438
Ghidra address:
PAL: 0x003d0950

Member Function Documentation

◆ New()

UIComponent * KeyboardKey::New ( DataArray * pData,
const char * pszPanel )
inlinestatic

Create a key from its script description.

The metagame registers the routine for the component type key_comp.

Parameters
pDataThe script description.
pszPanelThe name of the panel the key belongs to.
Returns
The new key.
Ghidra address:
NTSC-U/C: 0x003624d0
Ghidra address:
PAL: 0x003d09e8

◆ DispatchPriv()

bool KeyboardKey::DispatchPriv ( Message * pMsg)
overridevirtual

Route controller buttons, and pass every other message to UIButton.

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

Implements MsgSink.

◆ HandleJoypad()

bool KeyboardKey::HandleJoypad ( JoypadInputMsg * pMsg)

Report the choice as the cross button goes down, and flash once when no sink handled it.

The key must not be flashing already.

Parameters
pMsgThe message.
Returns
True for a press of the cross button, otherwise false.
Ghidra address:
NTSC-U/C: 0x001a8948
Ghidra address:
PAL: 0x001b0638

◆ Flash()

void KeyboardKey::Flash ( )

Flash once, as when the key is chosen.

KeyboardPanel flashes the key a controller button stands for.

Ghidra address:
NTSC-U/C: 0x001a8a50
Ghidra address:
PAL: 0x001b0740

Member Data Documentation

◆ sNumFlashes

int KeyboardKey::sNumFlashes
static

Number of flashes of a chosen key.

Ghidra address:
NTSC-U/C: 0x003af8e0
Ghidra address:
PAL: 0x0042e774

◆ sSelectedMs

float KeyboardKey::sSelectedMs
static

Milliseconds of each flash a chosen key spends in the selected state.

Ghidra address:
NTSC-U/C: 0x003af8e4
Ghidra address:
PAL: 0x0042e778

◆ sNormalMs

float KeyboardKey::sNormalMs
static

Milliseconds of each flash a chosen key spends in the normal state.

Ghidra address:
NTSC-U/C: 0x003af8e8
Ghidra address:
PAL: 0x0042e77c

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