Skip to Content
The Alchemy Project

include/window/select.h

The selection screen: the row of icons a command, item or Psynergy is picked from, its icons and their sprites.

Included by menu_internal.h and window_internal.h.

Structures

NameDescription
structSELECTION_SPRA selection screen sprite: a list link and its OAM attributes.
structSELECTION_NODEAn icon of the selection screen: its list links, the entry it shows, its place and its slide toward a target, its zoom and its sprite.
structSELECTION_MENU_STATEThe selection screen (HEAP_SLOT_SELECTION_MENU): the row of icons the player picks from, with arrows at each end and a pointing hand over the chosen target.

Macros

NameDescription
#defineSELECTION_STATUS_SCROLLING 33SELECTION_MENU_STATE.status: the cursor stepping, or the row shown.
#defineSELECTION_STATUS_SHOWN 1
#defineSELECTION_CURSOR_RESET 0x80The bit of SELECTION_MENU_STATE.cursorIndex set as an entry is chosen, on which mnSelectionMenuClear puts the next list's top and cursor back to its first entry.

Enumerations

NameDescription
enumICON_KIND { ICON_KIND_NONE, ICON_KIND_COMMAND, ICON_KIND_ITEM, ICON_KIND … }The kinds of icon the selection screen lists (SELECTION_NODE.kind) and mnSelectionIconLoad loads.
enumSELECTION_RECORD { SELECTION_RECORD_ROW, SELECTION_RECORD_CHOSEN, SELECTION_REC … }The entries of SELECTION_MENU_STATE.records.

Functions

NameDescription
void *mnIconMenuOpen (void)Allocates and clears the icon menu's state, which lives in HEAP_SLOT_ICON_MENU until mnIconMenuClose frees it, and starts the event that draws its icons.
voidmnIconMenuAddIcon (Sint32 icon)Appends a command icon while the menu has room for one (ICON_MENU_STATE's six entries).
voidmnIconMenuClose (void)Stops drawing the icons, closes the label window and releases each loaded icon before freeing the icon menu's state (HEAP_SLOT_ICON_MENU), then waits a tick.
voidmnSelectionMenuFreeLargeIcon (void)Frees the large icon's VRAM cache entry, if it holds one, and marks it empty.
voidmnIconMenuLayoutIcons (Sint32 x, Sint32 y, Sint32 w, Sint32 h)Places the icons three tiles apart from tile (x, y), then opens their label window, width + 2 tiles wide, just after them.
Sint32mnIconMenuRun (Sint32 init)Selects an icon position with wrapped directional input.
Sint32mnSelectionIconLoad (Uint32 mode, Sint32 value)Loads the icon of a selection entry of kind mode (ICON_KIND) into a free sprite tile slot and returns the slot, or -1.
SELECTION_NODE *mnSelectionMenuGetCursorNode (SELECTION_MENU_STATE *screen)Returns the icon of the row the hand points at (cursorIndex).

Description

The selection screen: the row of icons a command, item or Psynergy is picked from, its icons and their sprites.

Macros in detail

SELECTION_STATUS_SCROLLING

#define SELECTION_STATUS_SCROLLING 33

SELECTION_MENU_STATE.status: the cursor stepping, or the row shown.

Referenced by mnConfirmSelection(), mnMoveSelectionBackward(), mnMoveSelectionForward(), mnSelectionMenuStepLeft() and mnSelectionMenuStepRight().

Definition at line 132 of file select.h.

SELECTION_STATUS_SHOWN

#define SELECTION_STATUS_SHOWN 1

Referenced by mnMoveSelectionBackward(), mnMoveSelectionForward(), mnSelectionMenuStepLeft() and mnSelectionMenuStepRight().

Definition at line 133 of file select.h.

SELECTION_CURSOR_RESET

#define SELECTION_CURSOR_RESET 0x80

The bit of SELECTION_MENU_STATE.cursorIndex set as an entry is chosen, on which mnSelectionMenuClear puts the next list's top and cursor back to its first entry.

Referenced by mnConfirmSelection(), mnSelectionMenuClear() and mnSelectionMenuCreate().

Definition at line 148 of file select.h.

Enumerations in detail

ICON_KIND

enum ICON_KIND

The kinds of icon the selection screen lists (SELECTION_NODE.kind) and mnSelectionIconLoad loads.

EnumeratorValueDescription
ICON_KIND_NONE0a free selection icon entry
ICON_KIND_COMMAND1a command's icon, from its number
ICON_KIND_ITEM2an item's icon
ICON_KIND_ABILITY4a Psynergy's icon, from its ability number
ICON_KIND_YES_NO6a yes or no command, drawn as a command
ICON_KIND_EQUIPMENT_ITEM7An item's icon without the broken mark, for the equipment view
ICON_KIND_PATTERN8one of the other icons

Definition at line 59 of file select.h.

SELECTION_RECORD

enum SELECTION_RECORD

The entries of SELECTION_MENU_STATE.records.

EnumeratorValueDescription
SELECTION_RECORD_ROW2the first of the row's seven icons
SELECTION_RECORD_CHOSEN9the first of the five icons chosen
SELECTION_RECORD_HAND14the pointing hand
SELECTION_RECORD_LARGE_ICON15
SELECTION_RECORD_COUNT16

Definition at line 72 of file select.h.