The item menu: the item picker events open, the command loop, the member and item lists, and Use, Equip, Give, Drop, Remove and Details. More...
Go to the source code of this file.
Data Structures | |
| struct | ItemPickerResult |
| The event work as the item picker sees it: what the player chose, for the event script. More... | |
Macros | |
| #define | ITEM_MODAL_SHORT_X 14 |
| #define | ITEM_MODAL_REMOVED_X 14 |
| #define | ITEM_CANNOT_TRADE_X 15 |
| #define | ITEM_TRADED_X 15 |
| #define | ITEM_TRADE_PROMPT_X 0 |
| #define | ITEM_COMMAND_TEXT_X 32 |
| #define | ITEM_QUANTITY_WINDOW_WIDTH 30 |
| #define | ITEM_GIVE_CURSOR_X 128 |
| #define | ITEM_GIVE_ASK_X 32 |
| #define | ITEM_GIVE_ASK_Y 0 |
| #define | ITEM_DROP_QUESTION_X 0 |
| #define | ITEM_LIST_PAGE_ICONS_X 116 |
| #define | ITEM_LIST_NAME_X 24 |
| #define | ITEM_STACK_MAX 30 |
| The most items of one kind a stack holds. | |
| #define | ITEM_IWRAM_COPY_WORDS ((ItemWordCopyFn)(IwramIrqMain + Iwram_CopyWordsOffset)) |
| #define | ITEM_COMMAND_STATE_DISABLED (-1) |
| Each item command's state in the grid. | |
| #define | ITEM_COMMAND_STATE_AVAILABLE 1 |
| #define | TEXT_COLOR_DISABLED 14 |
Typedefs | |
| typedef s32(*) | ItemWordCopyFn(void *dst, const void *src, s32 size) |
| The resident IWRAM word copy, called through its address. | |
Enumerations | |
| enum | ItemMenuStep { ITEM_STEP_OWNER = 0 , ITEM_STEP_ITEM = 1 , ITEM_STEP_USE = 2 , ITEM_STEP_EQUIP = 3 , ITEM_STEP_GIVE = 4 , ITEM_STEP_DROP = 5 , ITEM_STEP_TARGET = 6 , ITEM_STEP_TRADE = 7 , ITEM_STEP_IDLE = 8 , ITEM_STEP_COMMAND = 9 , ITEM_STEP_INSPECT = 10 , ITEM_STEP_REMOVE = 11 , ITEM_STEP_QUANTITY = 12 } |
| The steps of the item menu's command loop (ItemMenu_RunCommands). More... | |
Functions | |
| s32 | ItemMenu_Run (void) |
| The item picker an event script opens (window command 3): the item menu, in which the player chooses one party member's item. | |
| static __inline__ s32 | Item_CopyWords (ItemWordCopyFn copy, void *dst, const void *src, s32 size) |
| s32 | ItemMenu_RunCommands (s32 *ownerOut, s32 *targetOut, s32 *itemOut) |
| Runs the item menu: choose a party member, one of their items and a command (Use, Equip, Give, Drop, Remove or Inspect), then carry it out, until the player backs out or presses Start. | |
| s32 | ItemMenu_Use (void) |
| Uses the selected item from the owner in pane 0 on the member in pane 1. | |
| void | ItemMenu_Initialize (s32 x, s32 y, s32 mode, s32 columns) |
| Sets up the item menu's first screen: the cursor window with the party's figures, the info window along the bottom, and an 8 by 2 cursor grid. | |
| void | Menu_SpawnIconEntries (struct InventoryMenuState *state, struct UiWindow *window) |
| Creates the 32 item icon sprites in window, off screen until placed: slots 0 to 7 at x 248, the rest at x 256, all at y 168, each showing item graphic slot of the same number. | |
| void | ItemMenu_HideAllIcons (void) |
| Hides all 32 item icons. | |
| void | ItemMenu_HidePageIcons (void) |
| Hides the item icons in the first column of the five-wide item grid. | |
| void | ItemMenu_Close (void) |
| Closes the item menu: releases the party figures, hides the icons and the cursor, and closes every window the menu opened. | |
| s32 | ItemMenu_SelectMember (s32 pane) |
| Lets the player choose a party member in pane (0 or 1), starting from the member chosen last. | |
| s32 | ItemMenu_RunOwnerSelection (u16 *ownerIds, u16 *items) |
| The party member row of the item menu. | |
| void | ItemMenu_OpenCategory (s32 ownerId) |
| Shows the equipment view of member ownerId's items in the item window. | |
| s32 | ItemMenu_SelectTarget (s32 mode) |
| Chooses the party member to use (mode 0) or give (mode 1) the selected item to. | |
| void | EquipmentMenu_UpdateCompatibilityIndicators (void) |
| Scheduler callback while choosing a member to give an item to: every 32 frames, sets each party figure's animation by whether that member can equip the item (3) or not (1). | |
| void | EquipmentMenu_StartCompatibilityIndicators (void) |
| Ends EquipmentMenu_UpdateCompatibilityIndicators: puts every party figure back to animation 1 and removes the callback. | |
| s32 | ItemMenu_IsSpecial (s32 itemId) |
| Returns 1 for the items that raise a stat for good (Apple, Hard Nut, Mint and Lucky Pepper), whose use shows the stats panel instead of HP and PP. | |
| void | ItemMenu_DrawMessage (s32 unused, s32 message) |
| Clears the message window and writes message into it. | |
| void | Menu_HideEmptyEntryIcons (const u16 *items) |
| Hides the icon of each of the 32 list entries whose item is 0. | |
| s32 | ItemMenu_CountItems (s32 ownerId) |
| Returns how many of member ownerId's 15 inventory slots hold an item. | |
| s32 | InventoryMenu_GetItemQuantity (s32 ownerId, s32 itemId) |
| Returns how many of itemId the unit ownerId holds: the quantity of its first stack, or 0. | |
| s32 | ItemMenu_CollectItems (struct BattleUnit *unit, u16 *items, s32 mode) |
| Copies the unit's items into the list items (32 entries), skipping empty slots and clearing the rest. | |
| void | ItemMenu_DrawIcons (u16 *inventoryEntries, s32 iconStyle) |
| Loads each listed item's icon into its item icon sprite, the first 15 entries of inventoryEntries, and hides the icons of empty entries. | |
| void | ItemMenu_RefreshOwner (s32 ownerId, s32 mode) |
| Shows member ownerId's items in the item window, laid out for layout mode (see ItemMenu_RefreshEntry), or "no items" when there are none. | |
| UNUSED void | InventoryMenu_NoOp (void) |
| Nothing calls it. | |
| void | ItemMenu_DrawEquipPreview (s32 owner, s32 slot, s32 mode, s32 target) |
| Shows in the status panel what the item in owner's inventory slot would mean to member target: for a usable item, target's status; for equipment, target's stats with it equipped; for a Psynergy item, the Psynergy it teaches. | |
| s32 | Inventory_RemoveFirstUnflagged (s32 ownerId) |
| Makes room in ownerId's inventory: if no slot is free, removes the whole stack in the first slot that is not equipped. | |
| s32 | ItemMenu_CommandCursorX (s32 column, s32 row) |
| The x and y of the item command cursor on column and row of the command grid (three commands to a row). | |
| s32 | ItemMenu_CommandCursorY (s32 column, s32 row) |
| s32 | ItemMenu_ChooseCommand (void) |
| The item command grid: Use, Equip and Details on the top row, Give, Remove and Drop below (grid index = row * 3 + column, as ItemMenuCommand counts them). | |
| void | ItemMenu_BuildCommands (s8 *commandStates) |
| Fills commandStates (indexed by ItemMenuCommand) for the selected item: Use for usable items the owner can use here and for field items, Equip for equipment the owner can wear and is not wearing, Remove for worn equipment that is not cursed, Give with someone to give to, Drop unless the item is indispensable, and neither for cursed equipment being worn. | |
| void | ItemMenu_DrawCommands (const s8 *commandStates, struct UiWindow *window) |
| Writes the six command names into window, the disabled ones in grey. | |
| s32 | Item_ClassifyUseMode (s32 ownerId, s32 inventoryEntry) |
| Says how ownerId can use inventoryEntry from the item menu: 0 the item works on the field (BattleFx_HasTriggerFar), or its action is usable neither in the field nor in battle, and is used once the menu closes; 1 usable in the field: choose a party member to use it on; 2 usable in the field on the whole party at once (range 0xff); -1 it cannot be used here: it has no action, it is equipment the owner cannot wear or of use type 3, or its action is usable only in battle. | |
| void | ItemMenu_TryBreak (void) |
| After the selected item is used: an item of use type 2 breaks one time in eight, with the break sound. | |
| s32 | ItemMenu_OpenDetail (s32 itemIndex) |
| Opens the details window (top left, 13 by 10 tiles) and describes the item in pane itemIndex there. | |
| s32 | Menu_SelectQuantity (s32 value) |
| The item menu's Details screen: describes the item entry value in a large window (the whole top half after patch 1) and waits for A or B. | |
| void | ItemMenu_DrawItemDetails (struct UiWindow *window, s32 inventoryEntry) |
| Writes the description of the inventoryEntry into window, one line a row: for equipment its Attack and Defense bonuses, then each of its effects (flat bonuses, rates as multipliers, elemental Power and Resist with the element's icon, and the effects that are only text), whether it is cursed or bestows Psynergy, whether it is used up or may break, and for a stack how many there are. | |
| void | ItemMenu_DrawStat (s32 statChange, s32 unused, struct UiWindow *window, s32 x, s32 y) |
| Writes a signed stat change at (x, y) of window: the number, with a plus or minus sign just before its first digit. | |
| void | ItemMenu_SetItemWindowRow5 (void) |
| Moves the item window to row 5 of the right-hand side. | |
| void | ItemMenu_SetItemWindowRow3 (void) |
| Moves the item window to row 3 of the right-hand side. | |
| void | ItemMenu_SetMessageWindowHeight5 (void) |
| Makes the message window, along the top right, 5 rows tall. | |
| void | ItemMenu_SetMessageWindowHeight6 (void) |
| void | ItemMenu_SetMessageWindowHeight7 (void) |
| void | ItemMenu_SetMessageWindowHeight3 (void) |
| s32 | ItemMenu_SelectGiveQuantity (s32 baseQuantity, s32 quantityRange, s32 dropMode) |
| Asks how many of the selected item stack to give or drop: Left and Right choose a number from 1 to quantityRange (shown as baseQuantity + 1 up to baseQuantity + quantityRange on a dial of digit sprites), with the owner's remaining count and, when giving (dropMode 0), the receiver's new count beside their names. | |
| void | ItemMenu_DrawItemHead (void) |
| Shows the selected item at the top of the message window: its icon, its owner's name and its name. | |
| s32 | ItemMenu_ConfirmDrop (s32 item) |
| Asks whether to drop item (an inventory entry): its name, the question, and Yes or No, No first. | |
| s32 | ItemMenu_ConfirmEquip (s32 unused) |
| After giving or trading the selected item to the member in pane 1, offers to equip it there, showing the stats it would give. | |
| void | Resource_LoadPairedBlocks (void) |
| Loads the stat arrows (up and down) into two free VRAM blocks, kept in the menu work's resource slots. | |
| s32 | ItemMenu_PageResult (struct MenuResult *result, s32 index) |
| Fills result with the item list of the member in pane index: their unit, how many items they hold, and the page and row of the item chosen last for them (kept within the list), five items to a page. | |
| s32 | ItemMenu_DrawItemDetailPage (struct UiWindow *window, void *ownerWork, struct MenuResult *pageState) |
| Updates the item list for the row under the cursor: puts the selected item's plain name in the info window and highlights its row of the five. | |
| s32 | ItemMenu_DrawNamePage (struct UiWindow *window, s32 unused, const struct MenuResult *pageState) |
| Draws one page of the item list into window: up to five item names with their icons, and the page numbers when there is more than one page. | |
| UNUSED s32 | InventoryMenu_ItemNamePageReturnTrue (void) |
| Nothing calls it. | |
| UNUSED void | InventoryMenu_ItemNamePageNoOp (void) |
| Nothing calls it. | |
| s32 | ItemMenu_RunList (s32 paneIndex) |
| The item list of the member in paneIndex (0: the owner, 1: the receiver of a trade), five items a page. | |
The item menu: the item picker events open, the command loop, the member and item lists, and Use, Equip, Give, Drop, Remove and Details.
Part of menu.c, the menu object, compiled only through it.
Definition in file item.c.
| #define ITEM_MODAL_SHORT_X 14 |
Definition at line 14 of file item.c.
Referenced by ItemMenu_RunCommands().
| #define ITEM_MODAL_REMOVED_X 14 |
Definition at line 15 of file item.c.
Referenced by ItemMenu_RunCommands().
| #define ITEM_CANNOT_TRADE_X 15 |
Definition at line 24 of file item.c.
Referenced by ItemMenu_RunCommands().
| #define ITEM_TRADED_X 15 |
Definition at line 30 of file item.c.
Referenced by ItemMenu_RunCommands().
| #define ITEM_TRADE_PROMPT_X 0 |
Definition at line 34 of file item.c.
Referenced by ItemMenu_SelectTarget().
| #define ITEM_COMMAND_TEXT_X 32 |
Definition at line 41 of file item.c.
Referenced by ItemMenu_DrawCommands().
| #define ITEM_QUANTITY_WINDOW_WIDTH 30 |
Definition at line 47 of file item.c.
Referenced by Menu_SelectQuantity().
| #define ITEM_GIVE_CURSOR_X 128 |
Definition at line 54 of file item.c.
Referenced by ItemMenu_SelectGiveQuantity().
| #define ITEM_GIVE_ASK_X 32 |
Definition at line 55 of file item.c.
Referenced by ItemMenu_SelectGiveQuantity().
| #define ITEM_GIVE_ASK_Y 0 |
Definition at line 56 of file item.c.
Referenced by ItemMenu_SelectGiveQuantity().
| #define ITEM_DROP_QUESTION_X 0 |
Definition at line 64 of file item.c.
Referenced by ItemMenu_ConfirmDrop().
| #define ITEM_LIST_PAGE_ICONS_X 116 |
Definition at line 71 of file item.c.
Referenced by ItemMenu_DrawNamePage().
| #define ITEM_LIST_NAME_X 24 |
Definition at line 72 of file item.c.
Referenced by ItemMenu_DrawNamePage().
| #define ITEM_STACK_MAX 30 |
The most items of one kind a stack holds.
Definition at line 168 of file item.c.
Referenced by ItemMenu_RunCommands().
| #define ITEM_IWRAM_COPY_WORDS ((ItemWordCopyFn)(IwramIrqMain + Iwram_CopyWordsOffset)) |
Definition at line 173 of file item.c.
Referenced by ItemMenu_RunCommands().
| #define ITEM_COMMAND_STATE_DISABLED (-1) |
Each item command's state in the grid.
Definition at line 1624 of file item.c.
Referenced by ItemMenu_BuildCommands(), ItemMenu_ChooseCommand(), and ItemMenu_DrawCommands().
| #define ITEM_COMMAND_STATE_AVAILABLE 1 |
Definition at line 1625 of file item.c.
Referenced by ItemMenu_BuildCommands(), and ItemMenu_ChooseCommand().
| #define TEXT_COLOR_DISABLED 14 |
Definition at line 1868 of file item.c.
Referenced by ItemMenu_DrawCommands().
| enum ItemMenuStep |
The steps of the item menu's command loop (ItemMenu_RunCommands).
| s32 ItemMenu_Run | ( | void | ) |
The item picker an event script opens (window command 3): the item menu, in which the player chooses one party member's item.
Records the choice in the event work and returns 1 if one was made.
Definition at line 90 of file item.c.
Referenced by ItemMenu_Run().
|
static |
Definition at line 176 of file item.c.
Referenced by Item_CopyWords(), and ItemMenu_RunCommands().
Runs the item menu: choose a party member, one of their items and a command (Use, Equip, Give, Drop, Remove or Inspect), then carry it out, until the player backs out or presses Start.
Returns 1 when an item is to be used outside the menu, with its owner, target and item id in the out parameters; -1 when the player backed out or pressed Start; 0 otherwise.
Definition at line 206 of file item.c.
Referenced by ItemMenu_Run(), and ItemMenu_RunCommands().
| s32 ItemMenu_Use | ( | void | ) |
Uses the selected item from the owner in pane 0 on the member in pane 1.
On failure plays the error sound, shows why in the info window and returns -1; otherwise plays the item's animation, recalculates both members and returns 1.
Definition at line 831 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_Use().
Sets up the item menu's first screen: the cursor window with the party's figures, the info window along the bottom, and an 8 by 2 cursor grid.
The parameters are not used.
Definition at line 860 of file item.c.
Referenced by DjinnMenu_Run(), ItemMenu_Initialize(), ItemMenu_Run(), and PsynergyMenu_Run().
| void Menu_SpawnIconEntries | ( | struct InventoryMenuState * | state, |
| struct UiWindow * | window ) |
Creates the 32 item icon sprites in window, off screen until placed: slots 0 to 7 at x 248, the rest at x 256, all at y 168, each showing item graphic slot of the same number.
Definition at line 886 of file item.c.
Referenced by ItemMenu_RunOwnerSelection(), ItemMenu_SelectItem(), Menu_CreateWindowAndEntryObjects(), Menu_SpawnIconEntries(), PsynergyMenu_SelectAction(), and PsynergyMenu_SelectMember().
| void ItemMenu_HideAllIcons | ( | void | ) |
Hides all 32 item icons.
Definition at line 927 of file item.c.
Referenced by ItemMenu_ChooseCommand(), ItemMenu_Close(), ItemMenu_DrawCategory(), ItemMenu_HideAllIcons(), ItemMenu_RunCommands(), ItemMenu_SelectItem(), PsynergyMenu_DrawPreparedPsynergyIcons(), and PsynergyMenu_SelectAction().
| void ItemMenu_HidePageIcons | ( | void | ) |
Hides the item icons in the first column of the five-wide item grid.
Definition at line 943 of file item.c.
Referenced by ItemMenu_HidePageIcons(), and ItemMenu_RunCommands().
| void ItemMenu_Close | ( | void | ) |
Closes the item menu: releases the party figures, hides the icons and the cursor, and closes every window the menu opened.
Definition at line 962 of file item.c.
Referenced by DjinnMenu_Run(), ItemMenu_Close(), ItemMenu_Run(), Menu_OpenCharacterSelector(), PsynergyMenu_Run(), and StatusMenu_Run().
Lets the player choose a party member in pane (0 or 1), starting from the member chosen last.
Returns the member's id, or -1 when the player backs out.
Definition at line 988 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SelectMember().
The party member row of the item menu.
Left and Right move between members, showing each one's items and status; holding R shows their equipment instead; L + A sorts the member's items, a new sort order each press; A chooses a member who has items and B backs out. Returns the chosen member's id, or -1.
Definition at line 1016 of file item.c.
Referenced by ItemMenu_RunOwnerSelection(), and ItemMenu_SelectMember().
| void ItemMenu_OpenCategory | ( | s32 | ownerId | ) |
Shows the equipment view of member ownerId's items in the item window.
Definition at line 1130 of file item.c.
Referenced by ItemMenu_OpenCategory(), and ItemMenu_RunOwnerSelection().
Chooses the party member to use (mode 0) or give (mode 1) the selected item to.
Using shows each member's status as the cursor passes; giving shows each member's items, how many of this item they already hold, or that they would have to trade, and the equipment preview. The party members who can equip the item move while the cursor is up. Returns the chosen member's id, or -1 when the player backs out; giving cannot choose the item's owner.
Definition at line 1145 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SelectTarget().
| void EquipmentMenu_UpdateCompatibilityIndicators | ( | void | ) |
Scheduler callback while choosing a member to give an item to: every 32 frames, sets each party figure's animation by whether that member can equip the item (3) or not (1).
Definition at line 1282 of file item.c.
Referenced by EquipmentMenu_StartCompatibilityIndicators(), EquipmentMenu_UpdateCompatibilityIndicators(), ItemMenu_ChooseCommand(), and ItemMenu_SelectTarget().
| void EquipmentMenu_StartCompatibilityIndicators | ( | void | ) |
Ends EquipmentMenu_UpdateCompatibilityIndicators: puts every party figure back to animation 1 and removes the callback.
Definition at line 1305 of file item.c.
Referenced by EquipmentMenu_StartCompatibilityIndicators(), ItemMenu_ChooseCommand(), and ItemMenu_SelectTarget().
Returns 1 for the items that raise a stat for good (Apple, Hard Nut, Mint and Lucky Pepper), whose use shows the stats panel instead of HP and PP.
Definition at line 1323 of file item.c.
Referenced by ItemMenu_IsSpecial(), ItemMenu_RunCommands(), and ItemMenu_SelectTarget().
Clears the message window and writes message into it.
Definition at line 1335 of file item.c.
Referenced by ItemMenu_DrawMessage(), ItemMenu_RunCommands(), and Menu_ResolveSelectedAction().
| void Menu_HideEmptyEntryIcons | ( | const u16 * | items | ) |
Hides the icon of each of the 32 list entries whose item is 0.
Definition at line 1344 of file item.c.
Referenced by ItemMenu_DrawIcons(), Menu_HideEmptyEntryIcons(), PsynergyMenu_DrawPsynergyIcons(), and PsynergyMenu_SelectOwner().
Returns how many of member ownerId's 15 inventory slots hold an item.
Definition at line 1357 of file item.c.
Referenced by ItemMenu_CountItems(), ItemMenu_PageResult(), ItemMenu_RefreshOwner(), ItemMenu_RunCommands(), ItemMenu_RunOwnerSelection(), and ItemMenu_SelectTarget().
Returns how many of itemId the unit ownerId holds: the quantity of its first stack, or 0.
The Spanish and Italian editions add up every stack of it.
Definition at line 1380 of file item.c.
Referenced by InventoryMenu_GetItemQuantity(), ItemMenu_RunCommands(), ItemMenu_SelectGiveQuantity(), and ItemMenu_SelectTarget().
| s32 ItemMenu_CollectItems | ( | struct BattleUnit * | unit, |
| u16 * | items, | ||
| s32 | mode ) |
Copies the unit's items into the list items (32 entries), skipping empty slots and clearing the rest.
Returns how many there are. mode is not used.
Definition at line 1409 of file item.c.
Referenced by Item_Use(), ItemMenu_CollectItems(), ItemMenu_RefreshOwner(), ItemMenu_RunCommands(), ItemMenu_RunList(), ItemMenu_RunOwnerSelection(), ItemMenu_SelectItem(), and ItemMenu_SelectMember().
Loads each listed item's icon into its item icon sprite, the first 15 entries of inventoryEntries, and hides the icons of empty entries.
iconStyle 0 draws the list's icons; any other iconStyle the equipment view's (graphics kind 7).
Definition at line 1431 of file item.c.
Referenced by ItemMenu_DrawCategory(), ItemMenu_DrawIcons(), ItemMenu_RefreshOwner(), ItemMenu_RunCommands(), ItemMenu_RunList(), and ItemMenu_SelectItem().
Shows member ownerId's items in the item window, laid out for layout mode (see ItemMenu_RefreshEntry), or "no items" when there are none.
Definition at line 1457 of file item.c.
Referenced by ItemMenu_RefreshOwner(), ItemMenu_RunCommands(), ItemMenu_RunOwnerSelection(), and ItemMenu_SelectTarget().
| UNUSED void InventoryMenu_NoOp | ( | void | ) |
Shows in the status panel what the item in owner's inventory slot would mean to member target: for a usable item, target's status; for equipment, target's stats with it equipped; for a Psynergy item, the Psynergy it teaches.
When target is someone else, the item is put into a copy of target's inventory for the preview, making room first if it is full, and target is restored after. mode 1 redraws only the lower part of the panel.
Definition at line 1482 of file item.c.
Referenced by ItemMenu_ChooseCommand(), ItemMenu_ConfirmEquip(), ItemMenu_DrawEquipPreview(), ItemMenu_RunCommands(), ItemMenu_RunList(), and ItemMenu_SelectTarget().
Makes room in ownerId's inventory: if no slot is free, removes the whole stack in the first slot that is not equipped.
Returns 1 when a slot is free (or was freed), 0 otherwise.
Definition at line 1573 of file item.c.
Referenced by Inventory_RemoveFirstUnflagged(), and ItemMenu_DrawEquipPreview().
The x and y of the item command cursor on column and row of the command grid (three commands to a row).
Definition at line 1605 of file item.c.
Referenced by ItemMenu_ChooseCommand(), and ItemMenu_CommandCursorX().
Definition at line 1611 of file item.c.
Referenced by ItemMenu_ChooseCommand(), and ItemMenu_CommandCursorY().
| s32 ItemMenu_ChooseCommand | ( | void | ) |
The item command grid: Use, Equip and Details on the top row, Give, Remove and Drop below (grid index = row * 3 + column, as ItemMenuCommand counts them).
Disabled commands are grey and refuse A. The status panel follows the cursor: the owner's status on Use, the stats with the item equipped on Equip and Details, and without it on the bottom row, where Give also shows who can equip it. The cursor starts on the command chosen last, or on the first available one. Returns the command chosen, or -1 when the player backs out.
Definition at line 1634 of file item.c.
Referenced by ItemMenu_ChooseCommand(), and ItemMenu_RunCommands().
| void ItemMenu_BuildCommands | ( | s8 * | commandStates | ) |
Fills commandStates (indexed by ItemMenuCommand) for the selected item: Use for usable items the owner can use here and for field items, Equip for equipment the owner can wear and is not wearing, Remove for worn equipment that is not cursed, Give with someone to give to, Drop unless the item is indispensable, and neither for cursed equipment being worn.
Definition at line 1811 of file item.c.
Referenced by ItemMenu_BuildCommands(), and ItemMenu_ChooseCommand().
Writes the six command names into window, the disabled ones in grey.
Definition at line 1871 of file item.c.
Referenced by ItemMenu_ChooseCommand(), and ItemMenu_DrawCommands().
Says how ownerId can use inventoryEntry from the item menu: 0 the item works on the field (BattleFx_HasTriggerFar), or its action is usable neither in the field nor in battle, and is used once the menu closes; 1 usable in the field: choose a party member to use it on; 2 usable in the field on the whole party at once (range 0xff); -1 it cannot be used here: it has no action, it is equipment the owner cannot wear or of use type 3, or its action is usable only in battle.
Usable items always qualify; equipment only when the owner can wear it.
Definition at line 1923 of file item.c.
Referenced by Item_ClassifyUseMode(), ItemMenu_BuildCommands(), and ItemMenu_RunCommands().
| void ItemMenu_TryBreak | ( | void | ) |
After the selected item is used: an item of use type 2 breaks one time in eight, with the break sound.
"It broke!"
Definition at line 1969 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_TryBreak().
Opens the details window (top left, 13 by 10 tiles) and describes the item in pane itemIndex there.
Returns 1.
Definition at line 1988 of file item.c.
Referenced by ItemMenu_OpenDetail().
The item menu's Details screen: describes the item entry value in a large window (the whole top half after patch 1) and waits for A or B.
Up and Down move an unused counter from 0 to 4. Returns the counter, or -1 after B.
Definition at line 2003 of file item.c.
Referenced by ItemMenu_RunCommands(), and Menu_SelectQuantity().
Writes the description of the inventoryEntry into window, one line a row: for equipment its Attack and Defense bonuses, then each of its effects (flat bonuses, rates as multipliers, elemental Power and Resist with the element's icon, and the effects that are only text), whether it is cursed or bestows Psynergy, whether it is used up or may break, and for a stack how many there are.
An item with nothing to say is rare, important, or undescribed.
Definition at line 2094 of file item.c.
Referenced by ItemMenu_DrawItemDetails(), ItemMenu_OpenDetail(), and Menu_SelectQuantity().
Writes a signed stat change at (x, y) of window: the number, with a plus or minus sign just before its first digit.
Definition at line 2296 of file item.c.
Referenced by ItemMenu_DrawItemDetails(), and ItemMenu_DrawStat().
| void ItemMenu_SetItemWindowRow5 | ( | void | ) |
Moves the item window to row 5 of the right-hand side.
Definition at line 2328 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SetItemWindowRow5().
| void ItemMenu_SetItemWindowRow3 | ( | void | ) |
Moves the item window to row 3 of the right-hand side.
Definition at line 2335 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SetItemWindowRow3().
| void ItemMenu_SetMessageWindowHeight5 | ( | void | ) |
Makes the message window, along the top right, 5 rows tall.
Definition at line 2342 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SetMessageWindowHeight5().
| void ItemMenu_SetMessageWindowHeight6 | ( | void | ) |
Definition at line 2348 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SetMessageWindowHeight6().
| void ItemMenu_SetMessageWindowHeight7 | ( | void | ) |
Definition at line 2354 of file item.c.
Referenced by ItemMenu_ChooseCommand(), ItemMenu_SelectGiveQuantity(), and ItemMenu_SetMessageWindowHeight7().
| void ItemMenu_SetMessageWindowHeight3 | ( | void | ) |
Definition at line 2360 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SetMessageWindowHeight3().
Asks how many of the selected item stack to give or drop: Left and Right choose a number from 1 to quantityRange (shown as baseQuantity + 1 up to baseQuantity + quantityRange on a dial of digit sprites), with the owner's remaining count and, when giving (dropMode 0), the receiver's new count beside their names.
Returns the number less one, or -1 when the player backs out.
Definition at line 2372 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_SelectGiveQuantity().
| void ItemMenu_DrawItemHead | ( | void | ) |
Shows the selected item at the top of the message window: its icon, its owner's name and its name.
Definition at line 2476 of file item.c.
Referenced by ItemMenu_ChooseCommand(), ItemMenu_DrawItemHead(), and ItemMenu_RunCommands().
Asks whether to drop item (an inventory entry): its name, the question, and Yes or No, No first.
Returns 0 for Yes and 1 for No, B or Start.
Definition at line 2494 of file item.c.
Referenced by ItemMenu_ConfirmDrop(), and ItemMenu_RunCommands().
After giving or trading the selected item to the member in pane 1, offers to equip it there, showing the stats it would give.
Returns 0 when it is equipped; 1 when the player says No, backs out, or the member cannot equip it, and the member is left as before.
Definition at line 2556 of file item.c.
Referenced by ItemMenu_ConfirmEquip(), and ItemMenu_RunCommands().
| void Resource_LoadPairedBlocks | ( | void | ) |
Loads the stat arrows (up and down) into two free VRAM blocks, kept in the menu work's resource slots.
Definition at line 2643 of file item.c.
Referenced by ItemMenu_Run(), and Resource_LoadPairedBlocks().
| s32 ItemMenu_PageResult | ( | struct MenuResult * | result, |
| s32 | index ) |
Fills result with the item list of the member in pane index: their unit, how many items they hold, and the page and row of the item chosen last for them (kept within the list), five items to a page.
Returns 1.
Definition at line 2657 of file item.c.
Referenced by ItemMenu_PageResult(), and ItemMenu_RunList().
| s32 ItemMenu_DrawItemDetailPage | ( | struct UiWindow * | window, |
| void * | ownerWork, | ||
| struct MenuResult * | pageState ) |
Updates the item list for the row under the cursor: puts the selected item's plain name in the info window and highlights its row of the five.
window and ownerWork are not used.
Definition at line 2690 of file item.c.
Referenced by ItemMenu_DrawItemDetailPage(), and ItemMenu_RunList().
| s32 ItemMenu_DrawNamePage | ( | struct UiWindow * | window, |
| s32 | unused, | ||
| const struct MenuResult * | pageState ) |
Draws one page of the item list into window: up to five item names with their icons, and the page numbers when there is more than one page.
Definition at line 2730 of file item.c.
Referenced by ItemMenu_DrawNamePage(), and ItemMenu_RunList().
Nothing calls it.
Definition at line 2772 of file item.c.
Referenced by InventoryMenu_ItemNamePageReturnTrue().
| UNUSED void InventoryMenu_ItemNamePageNoOp | ( | void | ) |
Nothing calls it.
Definition at line 2775 of file item.c.
Referenced by InventoryMenu_ItemNamePageNoOp().
The item list of the member in paneIndex (0: the owner, 1: the receiver of a trade), five items a page.
The cursor's item is named in the info window and previewed in the status panel, its icon animates, and the party members who can equip it move. Up and Down move the cursor, Left and Right turn pages, and in paneIndex 0 L and R switch to the previous or next member who has items. Returns the chosen inventory entry, or -1 when the player backs out.
Definition at line 2783 of file item.c.
Referenced by ItemMenu_RunCommands(), and ItemMenu_RunList().