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

The controller menu, which assigns each game event to a button or a stick. More...

#include <controllerconfigscreen.h>

Inheritance diagram for ControllerConfigScreen:
Collaboration diagram for ControllerConfigScreen:

Public Member Functions

 ~ControllerConfigScreen () override=default
 Destroy the object.
 ControllerConfigScreen (DataArray *pData)
 Construct the screen from its script description.
bool DispatchPriv (Message *pMsg) override
 Route the start of a choice, a focus change, and a controller button, and pass on every other message.
void Exit (UIScreen *pNextScreen, float fTime) override
 Exit, and stop showing the controller map.
void Enter (UIScreen *pPrevScreen, float fTime) override
 Enter, remember the screen to return to, read the event lists, and show the first player's bindings.
void LoadBindings (InputMap *pMap)
 Show the bindings of an input map.
void SaveBindings ()
 Store the bindings the menu shows in the input map of the first player.
DataArray * FindButtonEvent (int nAction, int nButton)
 Find the button event that binds an action and may take a button.
DataArray * FindStickEvent (int nAction, int nStick)
 Find the stick event that binds an action.
DataArray * FindEvent (const char *pszName, int *pnButton)
 Find an event by name among the button events, then among the stick events.
const char * ButtonLabel (int nButton) const
 Report the label of a button.
const char * StickLabel (int nStick) const
 Report the label of a stick.
void ApplyLabel (const char *pszComponent, const char *pszLabel, bool bButton)
 Show a label on the component of an event in the style of a button or of a stick.
int EventSlot (DataArray *pEvent)
 Report the slot of an event in its list.
const char * EventName (DataArray *pEvent) const
 Report the name of an event.
int EventAction (DataArray *pEvent) const
 Report the InputMap action an event binds.
DataArray * ChoiceList (DataArray *pEvent)
 Report the choice list of an event.
int ChoiceColumn (DataArray *pEvent, int nValue)
 Report the column of the choice list of an event that holds a button or a stick.
bool Validate ()
 Mark every other event of the kind of the focused event that takes the same choice, and report whether every event has a choice.
void ResetBindings ()
 Show the default bindings.
void CycleChoice (const char *pszComponent, int nButton)
 Step the choice of an event back or forward with the directional buttons.
void ShowOnMap (const char *pszComponent)
 Highlight the button or the stick of an event on the controller map.
bool HandleSelectStart (UIComponentSelectStartMsg *pMsg)
 Restore the defaults on default, store the bindings and leave on save, and step the choice of an event with the directional buttons.
bool HandleJoypad (JoypadInputMsg *pMsg)
 Check the choices when the focus moves up or down, and go back on Triangle, unless the screen is between screens.
bool HandleFocusChange (UIComponentFocusChangeMsg *pMsg)
 Highlight the event that gained the focus on the controller map and show its hint.
Public Member Functions inherited from FreqScreen
 FreqScreen (DataArray *pData)
 Construct a screen from its script description.
 ~FreqScreen () override
 Destroy the screen.
bool DispatchPriv (Message *pMsg) override
 Play the sound of a chosen component, follow a shortcut, and keep unused controllers out.
void Draw () override
 Draw what goes under each panel, then the panels.
void Exit (UIScreen *pNextScreen, float fTime) override
 Move the projector to the next screen's place and start the exit.
void Enter (UIScreen *pPrevScreen, float fTime) override
 Play the entry sound, show or hide the projector, and start the entry.
virtual const char * Title ()
 Report the localised title of the screen, the token <name>_TITLE.
virtual void PlayButtonSound (int nButton)
 Play the menu sound of a controller button.
bool HandleSelectStart (UIComponentSelectStartMsg *pMsg)
 Play the sound of the button that chooses a component.
bool HandleTransitionComplete (UITransitionCompleteMsg *pMsg)
 Choose the component the shortcuts section of the metagame configuration lists for the screen.
bool HandleJoypad (JoypadInputMsg *pMsg)
 Pass on a controller button of a controller the players use, and swallow any other.
Public Member Functions inherited from UIScreen
 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 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.
Static Public Member Functions inherited from FreqScreen
static UIScreen * New (DataArray *pData)
 Create a screen from its script description.
Static Public Member Functions inherited from UIScreen
static UIScreen * New (DataArray *pData)
 Create a screen from its script description.

Additional Inherited Members

Public Attributes inherited from FreqScreen
Vector3 mGizmoOrig
Quat mGizmoRot
Protected Attributes inherited from UIScreen
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

The controller menu, which assigns each game event to a button or a stick.

The RTTI records the class as deriving from FreqScreen. The object is 0xb0 bytes and its vtable is at 0x003cc310. The metagame entry of the system configuration lists the events in button_events and stick_events and, in control_choice_lists, the buttons or sticks each event may take. Each event entry gives its name, the InputMap action it binds, and the name of its choice list. Each component of the o_controller panel is named after an event and shows the button or stick chosen for it, as a column of its choice list.

Constructor & Destructor Documentation

◆ ~ControllerConfigScreen()

ControllerConfigScreen::~ControllerConfigScreen ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x00356a00
Ghidra address:
PAL: 0x003c3c60

◆ ControllerConfigScreen()

ControllerConfigScreen::ControllerConfigScreen ( DataArray * pData)
explicit

Construct the screen from its script description.

Parameters
pDataThe script description.
Ghidra address:
NTSC-U/C: 0x0016c0a8
Ghidra address:
PAL: 0x0016f230

Member Function Documentation

◆ New()

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

Create a screen from its script description.

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

◆ DispatchPriv()

bool ControllerConfigScreen::DispatchPriv ( Message * pMsg)
overridevirtual

Route the start of a choice, a focus change, and a controller button, and pass on every other message.

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

Implements MsgSink.

◆ Exit()

void ControllerConfigScreen::Exit ( UIScreen * pNextScreen,
float fTime )
overridevirtual

Exit, and stop showing the controller map.

Parameters
pNextScreenThe screen that replaces this one.
fTimeThe front-end time in milliseconds.
Ghidra address:
NTSC-U/C: 0x0016c2f0
Ghidra address:
PAL: 0x0016f4c8

Reimplemented from UIScreen.

◆ Enter()

void ControllerConfigScreen::Enter ( UIScreen * pPrevScreen,
float fTime )
overridevirtual

Enter, remember the screen to return to, read the event lists, and show the first player's bindings.

Parameters
pPrevScreenThe screen this one replaces, and the one save returns to.
fTimeThe front-end time in milliseconds.
Ghidra address:
NTSC-U/C: 0x0016c100
Ghidra address:
PAL: 0x0016f288

Reimplemented from UIScreen.

◆ LoadBindings()

void ControllerConfigScreen::LoadBindings ( InputMap * pMap)

Show the bindings of an input map.

Parameters
pMapThe input map.
Ghidra address:
NTSC-U/C: 0x0016c310
Ghidra address:
PAL: 0x0016f4e8

◆ SaveBindings()

void ControllerConfigScreen::SaveBindings ( )

Store the bindings the menu shows in the input map of the first player.

Every button a choice list names is cleared first.

Ghidra address:
NTSC-U/C: 0x0016c488
Ghidra address:
PAL: 0x0016f660

◆ FindButtonEvent()

DataArray * ControllerConfigScreen::FindButtonEvent ( int nAction,
int nButton )

Find the button event that binds an action and may take a button.

Parameters
nActionThe InputMap action.
nButtonThe button, one of JoypadButton.
Returns
The event, or null.
Ghidra address:
NTSC-U/C: 0x0016c690
Ghidra address:
PAL: 0x0016f868

◆ FindStickEvent()

DataArray * ControllerConfigScreen::FindStickEvent ( int nAction,
int nStick )

Find the stick event that binds an action.

Parameters
nActionThe InputMap action.
nStickThe stick. The body does not read it.
Returns
The event, or null.
Ghidra address:
NTSC-U/C: 0x0016c798
Ghidra address:
PAL: 0x0016f970

◆ FindEvent()

DataArray * ControllerConfigScreen::FindEvent ( const char * pszName,
int * pnButton )

Find an event by name among the button events, then among the stick events.

The names are symbols and are compared as pointers.

Parameters
pszNameThe name.
pnButtonReceives 1 for a button event, or 0 for a stick event.
Returns
The event, or null with a warning.
Ghidra address:
NTSC-U/C: 0x0016c828
Ghidra address:
PAL: 0x0016fa00

◆ ButtonLabel()

const char * ControllerConfigScreen::ButtonLabel ( int nButton) const

Report the label of a button.

Parameters
nButtonThe button, one of JoypadButton.
Returns
The letter of the button's icon, or an empty string past the shoulder buttons and the face buttons.
Ghidra address:
NTSC-U/C: 0x0016c948
Ghidra address:
PAL: 0x0016fb20

◆ StickLabel()

const char * ControllerConfigScreen::StickLabel ( int nStick) const

Report the label of a stick.

Parameters
nStick0 for the left stick or 1 for the right stick.
Returns
The localized label, or an empty string for another value.
Ghidra address:
NTSC-U/C: 0x0016c9d8
Ghidra address:
PAL: 0x0016fbb0

◆ ApplyLabel()

void ControllerConfigScreen::ApplyLabel ( const char * pszComponent,
const char * pszLabel,
bool bButton )

Show a label on the component of an event in the style of a button or of a stick.

Parameters
pszComponentThe component, named after the event.
pszLabelThe label.
bButtonWhether the label is a button's.
Ghidra address:
NTSC-U/C: 0x0016ca38
Ghidra address:
PAL: 0x0016fc10

◆ EventSlot()

int ControllerConfigScreen::EventSlot ( DataArray * pEvent)

Report the slot of an event in its list.

Parameters
pEventThe event.
Returns
The index of the event after the list's name, or 0 with a warning.
Ghidra address:
NTSC-U/C: 0x0016cb40
Ghidra address:
PAL: 0x0016fd18

◆ EventName()

const char * ControllerConfigScreen::EventName ( DataArray * pEvent) const

Report the name of an event.

Parameters
pEventThe event.
Returns
The name, a symbol.
Ghidra address:
NTSC-U/C: 0x0016cc30
Ghidra address:
PAL: 0x0016fe08

◆ EventAction()

int ControllerConfigScreen::EventAction ( DataArray * pEvent) const

Report the InputMap action an event binds.

Parameters
pEventThe event.
Returns
The action.
Ghidra address:
NTSC-U/C: 0x0016cc50
Ghidra address:
PAL: 0x0016fe28

◆ ChoiceList()

DataArray * ControllerConfigScreen::ChoiceList ( DataArray * pEvent)

Report the choice list of an event.

Parameters
pEventThe event.
Returns
The choice list.
Ghidra address:
NTSC-U/C: 0x0016cc70
Ghidra address:
PAL: 0x0016fe48

◆ ChoiceColumn()

int ControllerConfigScreen::ChoiceColumn ( DataArray * pEvent,
int nValue )

Report the column of the choice list of an event that holds a button or a stick.

Parameters
pEventThe event.
nValueThe button or the stick.
Returns
The column, or 0 with a warning.
Ghidra address:
NTSC-U/C: 0x0016ccb0
Ghidra address:
PAL: 0x0016fe88

◆ Validate()

bool ControllerConfigScreen::Validate ( )

Mark every other event of the kind of the focused event that takes the same choice, and report whether every event has a choice.

Returns
Whether no component shows the mark ?.
Ghidra address:
NTSC-U/C: 0x0016cd80
Ghidra address:
PAL: 0x0016ff58

◆ ResetBindings()

void ControllerConfigScreen::ResetBindings ( )

Show the default bindings.

Ghidra address:
NTSC-U/C: 0x0016d028
Ghidra address:
PAL: 0x00170200

◆ CycleChoice()

void ControllerConfigScreen::CycleChoice ( const char * pszComponent,
int nButton )

Step the choice of an event back or forward with the directional buttons.

The choices start at column 2 of the choice list and wrap at either end.

Parameters
pszComponentThe component of the event.
nButtonThe button pressed, one of JoypadButton.
Ghidra address:
NTSC-U/C: 0x0016d070
Ghidra address:
PAL: 0x00170248

◆ ShowOnMap()

void ControllerConfigScreen::ShowOnMap ( const char * pszComponent)

Highlight the button or the stick of an event on the controller map.

Parameters
pszComponentThe component of the event.
Ghidra address:
NTSC-U/C: 0x0016d1b8
Ghidra address:
PAL: 0x00170390

◆ HandleSelectStart()

bool ControllerConfigScreen::HandleSelectStart ( UIComponentSelectStartMsg * pMsg)

Restore the defaults on default, store the bindings and leave on save, and step the choice of an event with the directional buttons.

Parameters
pMsgThe message.
Returns
The result of FreqScreen::HandleSelectStart().
Ghidra address:
NTSC-U/C: 0x0016d368
Ghidra address:
PAL: 0x00170540

◆ HandleJoypad()

bool ControllerConfigScreen::HandleJoypad ( JoypadInputMsg * pMsg)

Check the choices when the focus moves up or down, and go back on Triangle, unless the screen is between screens.

Parameters
pMsgThe message.
Returns
The result of FreqScreen::HandleJoypad(), or true between screens.
Ghidra address:
NTSC-U/C: 0x0016d578
Ghidra address:
PAL: 0x00170750

◆ HandleFocusChange()

bool ControllerConfigScreen::HandleFocusChange ( UIComponentFocusChangeMsg * pMsg)

Highlight the event that gained the focus on the controller map and show its hint.

Parameters
pMsgThe message.
Returns
false.
Ghidra address:
NTSC-U/C: 0x0016d618
Ghidra address:
PAL: 0x00170840

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