|
wavelength 1.0.0
|
Component the player chooses with the cross button. More...
#include <uibutton.h>


Public Member Functions | |
| 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 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. | |
Protected Attributes | |
| 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 |
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... | |
| 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. | |
Component the player chooses with the cross button.
The RTTI records the class as deriving from UIComponent. The object is 0x40 bytes and its vtable is at 0x003d2390. The panel description provides the name at index 1, the style at index 2, and optionally the base of the object names at index 3, with the name standing in for a missing base. The button shows a mesh <panel>_<base>.mesh and a text object <panel>_<base>.txt, and its style selects the material of the mesh and the font of the text for each state.
Pressing the cross button sends a UIComponentSelectStartMsg. Unless a handler stops the choice, the button then flashes between the selected and the normal state, and sends a UIComponentSelectMsg once the flash ends.
| UIButton::UIButton | ( | DataArray * | pData, |
| const char * | pszPanel ) |
Construct a button from its script description.
| pData | The script description. |
| pszPanel | The name of the panel the button belongs to. |
|
override |
Destroy the button.
|
inlinestatic |
Create a button from its script description.
UIManager::Init() registers the routine for the component type button_comp.
| pData | The script description. |
| pszPanel | The name of the panel the button belongs to. |
|
overridevirtual |
Handle a controller button, or pass any other message to UIComponent.
| pMsg | The message. |
Implements MsgSink.
|
overridevirtual |
Show or hide the button, its text, and its mesh.
| bShowing | Whether the button shows. |
Reimplemented from UIComponent.
|
overridevirtual |
Report the text of the text object.
The text object must exist.
Reimplemented from UIComponent.
|
overridevirtual |
Replace the text of the text object.
The text object must exist.
| pszText | The text. |
Reimplemented from UIComponent.
|
overridevirtual |
Change the state and give the mesh and the text the material and the font the style lists for it.
| nState | One of UIComponent::State. |
| bForce | Apply the state even when it does not change. |
Reimplemented from UIComponent.
|
overridevirtual |
Stop a flash that runs and return to the state from before it.
Reimplemented from UIComponent.
|
overridevirtual |
Advance the flash to a time, and send the UIComponentSelectMsg once it ends.
| fTime | The front-end time in milliseconds. |
Reimplemented from UIComponent.
|
overridevirtual |
Write the name, the visibility, the state, and the flash.
| stream | The stream to write to. |
Implements UIComponent.
|
virtual |
Start a flash between two states.
The first selected phase is already over at fTime, and the flash ends after nFlashes periods and a last normal phase. The state from before the flash is restored when it ends.
| fTime | The front-end time in milliseconds. |
| nFlashes | The number of flashes. |
| nSelectedState | The state of the selected phase. |
| nNormalState | The state of the normal phase. |
| fSelectedMs | The length of the selected phase. |
| fNormalMs | The length of the normal phase. |
Reimplemented in LRButton.
| void UIButton::SetStyle | ( | UIStyle * | pStyle | ) |
Replace the style and apply the current state again.
| pStyle | The style. |
| bool UIButton::HandleSelect | ( | JoypadInputMsg * | pMsg | ) |
Start the flash when the cross button goes down.
| pMsg | The message of the button. |
|
inline |
|
protected |
Whether no flash runs.
|
protected |
The time the first flash period started.
|
protected |
The length of one selected and one normal phase.
|
protected |
The length of the selected phase.
|
protected |
The length of the normal phase.
|
protected |
The time the flash ends.
|
protected |
The state of the normal phase.
|
protected |
The state of the selected phase.
|
protected |
The state to restore when the flash ends.
|
protected |
The mesh, or null when the file has no mesh of that name.
|
protected |
The text object, or null when the file has no text object of that name.
|
protected |
The style.