14 for (i = 0; i < 8; i++) {
15 for (j = 0; j < 2; j++) {
17 windows->
items[i][j] = window;
27 (panel->
cursor % 16) / 2 * 14 + 0x25);
39 first = panel->
page * 16;
40 for (i = 0; i < 8; i++) {
41 for (j = 0; j < 2; j++) {
42 if (panel->
items[first + i * 2 + j] != 0) {
44 panel->
items[first + i * 2 + j]);
50 if (panel->
page == 0) {
66 for (i = 0; i < 8; i++) {
67 for (j = 0; j < 2; j++) {
80 if (panel->
page == 0) {
117 if (panel->
page < 0) {
126 if (page != panel->
page) {
136 last = (page + 1) * 16 - 1;
137 if (last > panel->
count - 1) {
138 last = panel->
count - 1;
142 if (panel->
cursor < first) {
147 if (panel->
cursor > last) {
154 if (panel->
cursor < first) {
161 if (panel->
cursor > last) {
166 if (cursor != panel->
cursor) {
194 (panel->
cursor % 16) / 2 * 14 + 0x25);
202 if (panel->
list == 0) {
275 (panel->
cursor % 16) / 2 * 14 + 0x25);
277 first = panel->
page * 16;
278 for (i = 0; i < 8; i++) {
279 for (j = 0; j < 2; j++) {
280 if (panel->
items[first + i * 2 + j]) {
313 switch (panel->
state) {
318 if (panel->
count / 16 != 0) {
325 for (i = 0; panel->
items[i] != 0; i++) {
328 panel->
page = i / 16;
335 if (panel->
items[last] > 0) {
338 }
else if (last - 1 > 0) {
340 panel->
page = (last - 1) / 16;
GfxState GFX
GFX: the graphics state and its methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
#define TEXT_STATUS
STATUS: the field menu's and STSTATUS's.
#define TEXT_ITEM_NAMES
ITMNAM.
#define FILE_MENU_SPRITES
Files the engine loads by number.
FileCache FILE_CACHE
The file cache.
#define ITEM_USE_MENU
ItemEffect.flags.
#define STRETCH_SPRITE(sprite, level, x, y)
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
#define STRETCH_SPRITE_V(sprite, level, x, y)
void STSTATUS_fadeItemInfo(ItemScreen *screen, s32 show)
Opens or closes the chosen item's panel (its icon and frame); closing it also hides the item's name,...
s32 STSTATUS_itemInfoFaded(ItemScreen *screen)
Moves the chosen item's panel on; 1 once it is fully open or closed.
void STSTATUS_showItemHelp(ItemScreen *screen, s32 mode)
The help line: 1 the chosen item and the kind of a weapon, 2 a question with two answers,...
void STSTATUS_showChosenItem(ItemScreen *screen, s32 show)
Shows or hides the chosen item's name and how many are equipped and owned.
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
#define PAD_REPEATED(button)
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_SELECT
Sounds the overlays share, with SOUNDTST's names.
#define SOUND_MENU_CANCEL
SYSTEM01.
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
void(* setPos)()
(cursor, x, y)
void(* setVisible)()
(cursor, visible)
void *(* getEntry)(u32 fileAndIndex)
s32(* getCategory)(s32 item)
getItemCategory
struct ItemInfo *(* get)(s32 item)
getItem
An item (ITEMS, ITEM_FUNCS)
u8 type
2-14 weapons, 15-20 armour, 21-24 accessories
ItemRecord data
the type's record, or the usable items' effect
TextWindow * pageSeparator
A list of the first screen (STSTATUS_createItemList)
void(* nextState)(struct ItemList *task)
s32 arrowFrame
the page arrows' palette
s32 hasPrev
pages before and after this one
s32 active
the player can move the cursor
s32 startItem
an item to put the cursor on
s32 list
into STSTATUS_itemLists
The field menu's first screen (STSTATUS_createItemScreen)
short(* playSound)(s32 id)
returns the voice of a key-on
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
s32(* updateFade)(PanelAnim *fade)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setVisible)(struct TextWindow *obj, u8 arg)
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
void STSTATUS_fillItemList(ItemList *panel)
Fills the item list with the owned items of its option's list (STSTATUS_itemLists) and counts them.
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)