command_row.c
The row of command icons the player picks a command from.
games/tbs/src/window/battle_command/command_row.c on GitHub
The row of command icons the player picks a command from. Part of battle_command.c, the menu object, compiled only through it.
Functions
UiText_ShowMessageAndWaitComplete
struct UiWindow *UiText_ShowMessageAndWaitComplete(s32 message, s32 x, s32 y)
Opens a message at (x, y), waits for its text to finish, and returns its window so the caller can hold it open for a separate prompt.
Used by Battle_CollectPartyCommands, Menu_RunCommandRow.
Menu_RunCommandRow
s32 Menu_RunCommandRow(s32 mode)
Runs a battle command row: the commands as icons along the bottom of the screen, the selected one pulsing as a sprite and named in a window, until a command is chosen. Returns the command chosen (its name is MsgCommandName + command), -1 when B cancels, or -2 when L or R asks for the status screen; the last two in a member's row only. When the link battle's time runs out the row takes its first command. Battle_CollectPartyCommands runs both rows.
Mode 0 is the party's row at the start of a round: Fight (14), Flee (4) and Status (7). Any other mode is a member's row: Attack (0), Psynergy (1), Djinn (15) once the party's Djinn are enough for a summon (BattleSummonState.availableMask), Summon (16) while any Djinni is on standby, Item (2) and Defend (3). Each row remembers its choice in BattleMenuWork.commandSelection. While the Djinn tutorial runs, the row presses the keys for the player.
Used by Battle_CollectPartyCommands.
Ui_SetRectHighlight
void Ui_SetRectHighlight(s32 x, s32 y, s32 width, s32 height, s32 paletteBit)
Switches the UI tilemap entries of the width x height tile rectangle
at screen tile (x, y) to palette 15 or 14 by bit 12, keeping the rest of
each entry: the menus' row highlight. paletteBit is the palette number,
of which only the low bit counts (15 plain, 14 highlighted). Clipped as
UiWindow_SetTileAttributeBitRect clips; each row changed is marked for
upload.
Used by BattleLayout_HighlightPartyPanels, BattleMenu_RunActionSelection, Battle_SelectAbility, ItemList_SelectEntry, SummonMenu_SelectSummon, Ui_RunOwnerStatusScreen.
BattleLayout_HighlightPartyPanels
s32 BattleLayout_HighlightPartyPanels(u16 *ids)
Clears the highlight from the party status window's member columns, then
highlights the columns of the units in ids (up to four, ended by 0xff):
the member whose commands are being chosen. A unit not in the party is
skipped. The window is right-aligned on the 30-tile row, so its member
columns start at column 29 - 6 * members (the Djinn column, when shown,
lies left of them). Returns 0. Battle_CollectPartyCommands calls it.
Used by Battle_CollectPartyCommands.