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

Component that shows a scrolling window of rows over a longer list of items. More...

#include <uilist.h>

Inheritance diagram for UIList:
Collaboration diagram for UIList:

Classes

struct  Cell
 One cell of a row. More...

Public Member Functions

 UIList (DataArray *pData, const char *pszPanel)
 Construct a list from its script description, cloning the template row once for each row.
 ~UIList () override
 Destroy the row clones and every object cloned with them.
bool DispatchPriv (Message *pMsg) override
 Pass a controller button to HandleJoypad().
void Print (PrnStream &stream) override
 Write a description of the list.
virtual void UpdateRow (int nRow, int nItem)
 Fill the cells of a row with an item.
virtual void UpdateCursor ()
 Move the cursor to the row with the selection, or dim it when the list is empty.
virtual void SetCursorSelected (bool bSelected)
 Give the cursor the material of the selected or of the normal state.
virtual bool HandleJoypad (JoypadInputMsg *pMsg)
 Scroll for up and down, and pass the cross button to the panel's cursor component.
virtual void ScrollUp ()
 Select the previous item.
virtual void ScrollDown ()
 Select the next item.
RndView * CloneRow (int nRow, RndView *pTemplate)
 Clone the template row for one row.
void BuildRowCells (RndView *pRow)
 Record the cells of a row, emptying each text and hiding each mesh.
void SetCellMat (int nRow, int nColumn, RndMat *pMat)
 Show the mesh of a cell with a material.
void SetCellText (int nRow, int nColumn, const char *pszText)
 Set the text of a cell.
void SetCellFont (int nRow, int nColumn, RndFont *pFont)
 Set the font of a cell's text.
void SetRowFont (int nRow, RndFont *pFont)
 Set the font of every text of a row.
void SetSelected (int nSelected)
 Select an item, keeping the number of items.
void Refresh (int nItemCount, int nSelected)
 Set the number of items and the selection, and fill the rows.
int GetSelected () const
int GetItemCount () const
int GetRowCount () const
RndMesh * GetUpArrow () const
RndMesh * GetDownArrow () const
void SetShowUpArrow (int nShow)
void SetShowDownArrow (int nShow)
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.
virtual bool IsShowing () const
 Report whether the component is showing.
virtual void SetShowing (bool bShowing)
 Show or hide the component.
virtual const char * Text () const
 Report the text the component shows.
virtual void SetText (const char *pszText)
 Replace the text the component shows.
virtual int GetState () const
 Report the state the component shows.
virtual void SetState (int nState, bool bForce)
 Change the state the component shows.
virtual void Focus ()
 React to the panel giving the component the focus.
virtual void Unfocus ()
 React to the panel taking the focus away.
virtual void Poll (float fTime)
 Advance the component to a time.
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 list 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 constexpr int kKeepSelection = -99999
 The value of Refresh()'s selection that keeps the selected item.

Protected Attributes

UIStyle * mStyle
int mItemCount
int mRowCount
int mColumnCount
int mCursorRow
int mSelected
int mRowPitch
std::list< std::vector< Cell > > mRowCells
std::vector< RndView * > mRows
std::vector< RndText * > mTextCells
const char * mPanelName
RndMesh * mCursor
RndMesh * mUpArrow
RndMesh * mDownArrow
Transform mCursorXfm
int mShowUpArrow
int mShowDownArrow
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.

Detailed Description

Component that shows a scrolling window of rows over a longer list of items.

The RTTI records the class as deriving from UIComponent. The object is 0xc0 bytes, and the vtable is at 0x003d2268. Index 2 of the script description names the style, index 3 the number of rows, index 4 the number of columns, and index 5 the distance between rows. The panel's file provides the template row <panel>_<name>_row.view, the cursor <panel>_<name>_cursor.mesh, and the arrows <panel>_<name>_up.mesh and <panel>_<name>_down.mesh.

The constructor clones the template once for each row, the clone of row N being named v_NN_<template>, and spaces the clones down by the row distance. Each text or mesh the template draws becomes one cell of the row. A derived list fills the cells of a row in UpdateRow().

Constructor & Destructor Documentation

◆ UIList()

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

Construct a list from its script description, cloning the template row once for each row.

Parameters
pDataThe script description.
pszPanelThe name of the panel the list belongs to.
Ghidra address:
NTSC-U/C: 0x00205830
Ghidra address:
PAL: 0x0020e5e8

◆ ~UIList()

UIList::~UIList ( )
override

Destroy the row clones and every object cloned with them.

Ghidra address:
NTSC-U/C: 0x00205d30
Ghidra address:
PAL: 0x0020eae8

Member Function Documentation

◆ New()

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

Create a list from its script description.

UIManager::Init() registers the routine for the entry type list_comp.

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

◆ DispatchPriv()

bool UIList::DispatchPriv ( Message * pMsg)
overridevirtual

Pass a controller button to HandleJoypad().

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

Reimplemented from UIComponent.

◆ Print()

void UIList::Print ( PrnStream & stream)
overridevirtual

Write a description of the list.

The routine writes nothing.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x00206840
Ghidra address:
PAL: 0x0020f5f8

Implements UIComponent.

◆ UpdateRow()

virtual void UIList::UpdateRow ( int nRow,
int nItem )
inlinevirtual

Fill the cells of a row with an item.

The base routine does nothing.

Parameters
nRowThe row.
nItemThe item.
Ghidra address:
NTSC-U/C: 0x00377658
Ghidra address:
PAL: 0x003e5d88

Reimplemented in FreqLoadList, NetMainLaunchpadsList, NetMainLobbiesList, NetMainPlayersList, NetRankedPlayersList, PlayList, RemixDownloadList, RemixLoadList, and SongSelList.

◆ UpdateCursor()

virtual void UIList::UpdateCursor ( )
virtual

Move the cursor to the row with the selection, or dim it when the list is empty.

Ghidra address:
NTSC-U/C: 0x00207138
Ghidra address:
PAL: 0x0020fef0

Reimplemented in FreqLoadList, NetMainLaunchpadsList, NetMainPlayersList, NetRankedPlayersList, NetSortedLaunchpadsList, PlayList, RemixDownloadList, RemixLoadList, and SongSelList.

◆ SetCursorSelected()

virtual void UIList::SetCursorSelected ( bool bSelected)
virtual

Give the cursor the material of the selected or of the normal state.

Parameters
bSelectedWhether the cursor shows the selected state.
Ghidra address:
NTSC-U/C: 0x002071f8
Ghidra address:
PAL: 0x0020ffb0

Reimplemented in NetMainPlayersList, and NetRankedPlayersList.

◆ HandleJoypad()

virtual bool UIList::HandleJoypad ( JoypadInputMsg * pMsg)
virtual

Scroll for up and down, and pass the cross button to the panel's cursor component.

Parameters
pMsgThe message of the button.
Returns
Whether the cursor component handled the cross button.
Ghidra address:
NTSC-U/C: 0x002072d0
Ghidra address:
PAL: 0x00210088

Reimplemented in NetMainLaunchpadsList, NetMainLobbiesList, and NetMainPlayersList.

◆ ScrollUp()

virtual void UIList::ScrollUp ( )
virtual

Select the previous item.

Ghidra address:
NTSC-U/C: 0x00206d70
Ghidra address:
PAL: 0x0020fb28

Reimplemented in FreqList, NetRankedPlayersList, and NetSortedLaunchpadsList.

◆ ScrollDown()

virtual void UIList::ScrollDown ( )
virtual

Select the next item.

Ghidra address:
NTSC-U/C: 0x00206df0
Ghidra address:
PAL: 0x0020fba8

Reimplemented in FreqList, NetRankedPlayersList, and NetSortedLaunchpadsList.

◆ CloneRow()

RndView * UIList::CloneRow ( int nRow,
RndView * pTemplate )

Clone the template row for one row.

Parameters
nRowThe row.
pTemplateThe template row.
Returns
The clone, or null.
Ghidra address:
NTSC-U/C: 0x00205fd0
Ghidra address:
PAL: 0x0020ed88

◆ BuildRowCells()

void UIList::BuildRowCells ( RndView * pRow)

Record the cells of a row, emptying each text and hiding each mesh.

Parameters
pRowThe row.
Ghidra address:
NTSC-U/C: 0x002060e0
Ghidra address:
PAL: 0x0020ee98

◆ SetCellMat()

void UIList::SetCellMat ( int nRow,
int nColumn,
RndMat * pMat )

Show the mesh of a cell with a material.

Parameters
nRowThe row.
nColumnThe column.
pMatThe material.
Ghidra address:
NTSC-U/C: 0x00206848
Ghidra address:
PAL: 0x0020f600

◆ SetCellText()

void UIList::SetCellText ( int nRow,
int nColumn,
const char * pszText )

Set the text of a cell.

Parameters
nRowThe row.
nColumnThe column.
pszTextThe text.
Ghidra address:
NTSC-U/C: 0x00206a18
Ghidra address:
PAL: 0x0020f7d0

◆ SetCellFont()

void UIList::SetCellFont ( int nRow,
int nColumn,
RndFont * pFont )

Set the font of a cell's text.

Parameters
nRowThe row.
nColumnThe column.
pFontThe font.
Ghidra address:
NTSC-U/C: 0x00206be0
Ghidra address:
PAL: 0x0020f998

◆ SetRowFont()

void UIList::SetRowFont ( int nRow,
RndFont * pFont )

Set the font of every text of a row.

Parameters
nRowThe row.
pFontThe font.
Ghidra address:
NTSC-U/C: 0x00206c88
Ghidra address:
PAL: 0x0020fa40

◆ SetSelected()

void UIList::SetSelected ( int nSelected)

Select an item, keeping the number of items.

Parameters
nSelectedThe item.
Ghidra address:
NTSC-U/C: 0x00206e80
Ghidra address:
PAL: 0x0020fc38

◆ Refresh()

void UIList::Refresh ( int nItemCount,
int nSelected )

Set the number of items and the selection, and fill the rows.

The selection stays within the items, and the cursor stays within the rows.

Parameters
nItemCountThe number of items.
nSelectedThe item to select, or kKeepSelection.
Ghidra address:
NTSC-U/C: 0x00206ea0
Ghidra address:
PAL: 0x0020fc58

◆ GetSelected()

int UIList::GetSelected ( ) const
inline
Returns
The selected item.

◆ GetItemCount()

int UIList::GetItemCount ( ) const
inline
Returns
The number of items.

◆ GetRowCount()

int UIList::GetRowCount ( ) const
inline
Returns
The number of rows.

◆ GetUpArrow()

RndMesh * UIList::GetUpArrow ( ) const
inline
Returns
The arrow above the rows, or null.

◆ GetDownArrow()

RndMesh * UIList::GetDownArrow ( ) const
inline
Returns
The arrow below the rows, or null.

◆ SetShowUpArrow()

void UIList::SetShowUpArrow ( int nShow)
inline
Parameters
nShowWhether the up arrow shows even when no item lies above.

◆ SetShowDownArrow()

void UIList::SetShowDownArrow ( int nShow)
inline
Parameters
nShowWhether the down arrow shows even when no item lies below.

Member Data Documentation

◆ kKeepSelection

int UIList::kKeepSelection = -99999
staticconstexpr

The value of Refresh()'s selection that keeps the selected item.

◆ mStyle

UIStyle* UIList::mStyle
protected

The style of the cursor.

◆ mItemCount

int UIList::mItemCount
protected

The number of items.

◆ mRowCount

int UIList::mRowCount
protected

The number of rows.

◆ mColumnCount

int UIList::mColumnCount
protected

The number of cells of each row.

◆ mCursorRow

int UIList::mCursorRow
protected

The row of the selected item.

◆ mSelected

int UIList::mSelected
protected

The selected item.

◆ mRowPitch

int UIList::mRowPitch
protected

The distance between rows.

◆ mRowCells

std::list<std::vector<Cell> > UIList::mRowCells
protected

The cells of each row.

◆ mRows

std::vector<RndView *> UIList::mRows
protected

The row clones.

◆ mTextCells

std::vector<RndText *> UIList::mTextCells
protected

The text cells of every row.

◆ mPanelName

const char* UIList::mPanelName
protected

The name of the panel the list belongs to.

◆ mCursor

RndMesh* UIList::mCursor
protected

The cursor, or null.

◆ mUpArrow

RndMesh* UIList::mUpArrow
protected

The arrow above the rows, or null.

◆ mDownArrow

RndMesh* UIList::mDownArrow
protected

The arrow below the rows, or null.

◆ mCursorXfm

Transform UIList::mCursorXfm
protected

The cursor's transform on the first row.

◆ mShowUpArrow

int UIList::mShowUpArrow
protected

Whether the up arrow shows even when no item lies above.

◆ mShowDownArrow

int UIList::mShowDownArrow
protected

Whether the down arrow shows even when no item lies below.


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