Alchemy
Loading...
Searching...
No Matches

inventory_menu.h

Go to the documentation of this file.
1#ifndef ALCHEMY_INVENTORY_MENU_H
2#define ALCHEMY_INVENTORY_MENU_H
3
4/// @file
5/// The item menu's state and commands.
6
7#include "unit/menu/menu.h"
8#include "global_cells.h"
9#include "static_assert.h"
10#include "menu_result.h"
11#include "render_input.h"
12#include "text/msg_ids.h"
13#include "farcall.h"
14
15struct AnimationObject;
16
17struct UiWindow;
18
19/// The item menu's work, in the HEAP_SLOT_MENU work slot: its windows, the
20/// party figures, the items listed and the two choices a command makes.
22 u8 unk000[8]; ///< not named by TBS code
23 s32 selectedOwner; ///< the party member chosen
24 u8 unk00c[4]; ///< not named by TBS code
26 /// The two panes: the member whose items are shown, and the one an item is
27 /// given to.
28 ///@{
30 s8 paneIndex[2]; ///< the member chosen, in ownerIds; -1 for none at first
31 s8 paneCount[2]; ///< members to choose from; 1 at first
32 ///@}
39 struct UiWindow *unknownWindow38; ///< only closed by name in TBS
41 struct UiWindow *unknownWindow40; ///< only closed by name in TBS
42 struct RenderOutput *gridCursor; ///< only prepared by name in TBS
45 u8 unk0e8[0x24]; ///< not named by TBS code
47 /// The cursor grid: its place and its size, 1 by 1 at first.
48 ///@{
53 ///@}
54 struct AnimationObject *ownerObjects[8]; ///< the party members' figures
55 s16 ownerX[8]; ///< screen pixels
56 s16 ownerY[8]; ///< screen pixels
57 s32 ownerScale[8]; ///< 16.16 fixed point, 0x10000 full size
58 u16 selectedSlots[2]; ///< each pane's inventory slot chosen
59 u16 selectedItems[2]; ///< each pane's inventory entry chosen
61 u8 unk180[0x48]; ///< not named by TBS code
62 u16 items[32]; ///< the inventory entries listed
63 u16 ownerIds[8]; ///< the party in order (Party_ListActiveOwners)
66 u8 paneOwner[2]; ///< each pane's member
68 u16 flags; ///< 1 while the item's name and command grid are drawn
69 s16 completionFlag; ///< set to 1 as item commands end; not read by name
70 u8 unk224[0x36]; ///< not named by TBS code
71 s16 messageOffset; ///< the item use's result, after MsgItemUseResult
72 s8 equipPreview; ///< 1 while the stats preview a removal, not an equip
73 u8 listMode; ///< the command chosen last; 0xff for none
74 u8 unk25e[2]; ///< not named by TBS code
75 s8 selectedIndexByOwner[8]; ///< each member's entry chosen last
76 u8 mode; ///< not named through this struct; PsynergyMenuState.mode
77 u8 unk269[0x129]; ///< not named by TBS code
78 s16 resourceSlots[2]; ///< VRAM cache slots of two arrow pictures
79};
80
81STATIC_ASSERT(offsetof(struct InventoryMenuState, paneIcons) == 0x14);
82STATIC_ASSERT(offsetof(struct InventoryMenuState, paneIndex) == 0x1c);
83STATIC_ASSERT(offsetof(struct InventoryMenuState, paneCount) == 0x1e);
84STATIC_ASSERT(offsetof(struct InventoryMenuState, itemWindow) == 0x20);
85STATIC_ASSERT(offsetof(struct InventoryMenuState, infoWindow) == 0x2c);
86STATIC_ASSERT(offsetof(struct InventoryMenuState, gridCursor) == 0x44);
87STATIC_ASSERT(offsetof(struct InventoryMenuState, entryIcons) == 0x48);
88STATIC_ASSERT(offsetof(struct InventoryMenuState, categoryIcons) == 0xc8);
89STATIC_ASSERT(offsetof(struct InventoryMenuState, messageWindow) == 0x10c);
90STATIC_ASSERT(offsetof(struct InventoryMenuState, selectedColumn) == 0x110);
91STATIC_ASSERT(offsetof(struct InventoryMenuState, selectedRow) == 0x111);
92STATIC_ASSERT(offsetof(struct InventoryMenuState, columnCount) == 0x112);
93STATIC_ASSERT(offsetof(struct InventoryMenuState, rowCount) == 0x113);
94STATIC_ASSERT(offsetof(struct InventoryMenuState, ownerObjects) == 0x114);
95STATIC_ASSERT(offsetof(struct InventoryMenuState, ownerX) == 0x134);
96STATIC_ASSERT(offsetof(struct InventoryMenuState, ownerY) == 0x144);
97STATIC_ASSERT(offsetof(struct InventoryMenuState, ownerScale) == 0x154);
98STATIC_ASSERT(offsetof(struct InventoryMenuState, selectedSlots) == 0x174);
99STATIC_ASSERT(offsetof(struct InventoryMenuState, selectedItems) == 0x178);
100STATIC_ASSERT(offsetof(struct InventoryMenuState, cursor) == 0x17c);
102STATIC_ASSERT(offsetof(struct InventoryMenuState, ownerIds) == 0x208);
103STATIC_ASSERT(offsetof(struct InventoryMenuState, itemCount) == 0x218);
104STATIC_ASSERT(offsetof(struct InventoryMenuState, paneOwner) == 0x21a);
105STATIC_ASSERT(offsetof(struct InventoryMenuState, selectedItemIcon) == 0x21c);
106STATIC_ASSERT(offsetof(struct InventoryMenuState, messageOffset) == 0x25a);
107STATIC_ASSERT(offsetof(struct InventoryMenuState, equipPreview) == 0x25c);
108STATIC_ASSERT(offsetof(struct InventoryMenuState, selectedIndexByOwner) ==
109 0x260);
111STATIC_ASSERT(offsetof(struct InventoryMenuState, resourceSlots) == 0x392);
112STATIC_ASSERT(sizeof(struct InventoryMenuState) == 0x398);
113
121};
122
123struct BattleUnit;
124
125#endif
Public interfaces to the engine's code banks.
The work slots of gWorkSlot, read through their own names.
ItemMenuCommand
@ ITEM_COMMAND_REMOVE
@ ITEM_COMMAND_GIVE
@ ITEM_COMMAND_DROP
@ ITEM_COMMAND_USE
@ ITEM_COMMAND_INSPECT
@ ITEM_COMMAND_EQUIP
MenuResult, what a menu returns.
The sprite renderer's inputs and outputs: render inputs, OAM attributes and render output lists.
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
The item menu's work, in the HEAP_SLOT_MENU work slot: its windows, the party figures,...
u8 unk00c[4]
not named by TBS code
struct RenderOutput * cursor
struct UiWindow * unknownWindow38
only closed by name in TBS
struct UiWindow * equipWindow
struct UiWindow * modalWindow
u8 unk0e8[0x24]
not named by TBS code
s32 selectedOwner
the party member chosen
u8 unk25e[2]
not named by TBS code
s16 completionFlag
set to 1 as item commands end; not read by name
struct UiWindow * unknownWindow40
only closed by name in TBS
u8 unk180[0x48]
not named by TBS code
s16 ownerX[8]
screen pixels
s8 selectedIndexByOwner[8]
each member's entry chosen last
u16 selectedItems[2]
each pane's inventory entry chosen
s16 messageOffset
the item use's result, after MsgItemUseResult
struct RenderOutput * selectedItemIcon
u8 unk224[0x36]
not named by TBS code
struct UiWindow * helpWindow
u8 unk000[8]
not named by TBS code
struct UiWindow * infoWindow
struct RenderOutput * paneIcons[2]
The two panes: the member whose items are shown, and the one an item is given to.
struct RenderOutput * gridCursor
only prepared by name in TBS
u8 unk269[0x129]
not named by TBS code
s8 equipPreview
1 while the stats preview a removal, not an equip
u16 flags
1 while the item's name and command grid are drawn
s8 paneCount[2]
members to choose from; 1 at first
u16 items[32]
the inventory entries listed
struct UiWindow * listWindow
struct UiWindow * mainWindow
u8 paneOwner[2]
each pane's member
u16 selectedSlots[2]
each pane's inventory slot chosen
struct AnimationObject * ownerObjects[8]
the party members' figures
u8 listMode
the command chosen last; 0xff for none
s16 ownerY[8]
screen pixels
struct UiWindow * statusWindow
u16 ownerIds[8]
the party in order (Party_ListActiveOwners)
struct RenderOutput * entryIcons[32]
struct UiWindow * messageWindow
s16 resourceSlots[2]
VRAM cache slots of two arrow pictures.
u8 mode
not named through this struct; PsynergyMenuState.mode
s8 paneIndex[2]
the member chosen, in ownerIds; -1 for none at first
struct RenderOutput * categoryIcons[8]
struct UiWindow * itemWindow
u8 selectedColumn
The cursor grid: its place and its size, 1 by 1 at first.
s32 ownerScale[8]
16.16 fixed point, 0x10000 full size
A render output: a sprite in a window's output list (a character, an icon or a portrait),...
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
signed int s32
Definition types.h:14
signed char s8
Definition types.h:10
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11