Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
equip_panel.c
Go to the documentation of this file.
1/* The third object of STSTATUS.PRO (see card_screen.c), the fifth screen's
2 panel of STSTATUS_createEquipPanel: its rodata starts at 0x800826CC (USA). */
3
4#include "menus/field_menu.h"
5
6/* Creates the equipment panel's windows: the six slots, the list of items that
7 fit the chosen one, their counts, the help and the slot's item */
9 s32 i;
10
11 windows->title = createTextWindow(panel->layer, 1, 0x98, 0x13);
12 windows->cursor = createCursor(panel->layer, panel->depth - 1, 0xA5, 0x31);
13 windows->cursor->setVisible(windows->cursor, 0);
14 for (i = 0; i < 6; i++) {
15 windows->slots[i] = createTextWindow(panel->layer, 1, 0xC0, i * 14 + 0x31);
16 }
17 windows->listTitle = createTextWindow(panel->layer, 1, 0x7F, 0x3B);
18 windows->listCursor = createCursor(panel->layer, panel->depth - 1, 0x86, 0x4B);
19 windows->listCursor->setVisible(windows->listCursor, 0);
20 for (i = 0; i < 8; i++) {
21 windows->rows[i].name = createTextWindow(panel->layer, 1, 0xA0, i * 14 + 0x4B);
22 windows->rows[i].times = createTextWindow(panel->layer, 1, 0x10D, i * 14 + 0x4B);
23 windows->rows[i].count = createTextWindow(panel->layer, 1, 0x120, i * 14 + 0x4B);
24 }
25 windows->help = createTextWindow(panel->layer, 1, 0x14, 0xC6);
26 windows->kind = createTextWindow(panel->layer, 1, 0x14, 0xD5);
27 windows->slotTitle = createTextWindow(panel->layer, 1, 0xA7, 0x13);
28 windows->slotItem = createTextWindow(panel->layer, 1, 0xC0, 0x23);
29}
30
31/* The partner's equipment, or the slots' names where it has none */
33 PartnerStats *stats;
34 s16 item;
35 s32 i;
36
37 if (show) {
38 stats = GAME.funcs.getPartnerStats(panel->partner);
39 for (i = 0; i < 6; i++) {
40 item = stats->equip[i];
41 if (item > 0) {
42 windows->slots[i]->setString(windows->slots[i], FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_NAMES)), item);
43 } else {
45 }
46 }
47 } else {
48 for (i = 0; i < 6; i++) {
49 windows->slots[i]->setVisible(windows->slots[i], 0);
50 }
51 }
52}
53
54/* An item's name and, for slots 2 and 3, its kind (none: string 0x51) */
56 ItemData *data;
57
58 if (item > 0) {
59 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_INFO)), item);
60 if (panel->slot == 2 || panel->slot == 3) {
61 data = ITEM_FUNCS.get(item)->data.record;
63 return;
64 }
65 } else {
66 windows->help->setString(windows->help, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x51);
67 }
68 windows->kind->setVisible(windows->kind, 0);
69}
70
71/* Fills the list of the items that fit the slot */
73 s32 i;
74 s32 row;
75 s32 item;
76
77 if (show) {
79 for (i = 0; i < 8; i++) {
80 row = panel->scroll + i;
81 if (row > panel->count - 1) {
82 break;
83 }
84 item = panel->items[row];
85 if (item > 0) {
86 if (STSTATUS_data.funcs.canEquip(panel->partner, panel->slot, item)) {
87 windows->rows[i].name->setPalette(windows->rows[i].name, PALETTE_WHITE);
88 } else {
89 windows->rows[i].name->setPalette(windows->rows[i].name, PALETTE_GREY);
90 }
91 windows->rows[i].name->setString(windows->rows[i].name, FILE_CACHE.load(TEXT_FILE(TEXT_ITEM_NAMES)), item);
92 windows->rows[i].times->setString(windows->rows[i].times, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x40);
93 windows->rows[i].times->setRightAlign(windows->rows[i].times, 1);
94 windows->rows[i].count->setNumber(windows->rows[i].count, 0, GAME.items[item]);
95 windows->rows[i].count->setRightAlign(windows->rows[i].count, 1);
96 } else {
97 if (item == -1) {
98 windows->rows[i].name->setString(windows->rows[i].name, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x45);
99 windows->rows[i].name->setPalette(windows->rows[i].name, PALETTE_WHITE);
100 } else {
101 windows->rows[i].name->setVisible(windows->rows[i].name, 0);
102 }
103 windows->help->setVisible(windows->help, 0);
104 windows->kind->setVisible(windows->kind, 0);
105 windows->rows[i].times->setVisible(windows->rows[i].times, 0);
106 windows->rows[i].count->setVisible(windows->rows[i].count, 0);
107 }
108 }
109 STSTATUS_showEquipItem(panel, windows, panel->items[panel->cursor + panel->scroll]);
110 } else {
111 windows->listTitle->setVisible(windows->listTitle, 0);
112 for (i = 0; i < 8; i++) {
113 windows->rows[i].name->setVisible(windows->rows[i].name, 0);
114 windows->rows[i].times->setVisible(windows->rows[i].times, 0);
115 windows->rows[i].count->setVisible(windows->rows[i].count, 0);
116 }
117 windows->help->setVisible(windows->help, 0);
118 windows->kind->setVisible(windows->kind, 0);
119 }
120}
121
122/* The item in the slot being changed, or the slot's name if it's empty */
124 PartnerStats *stats;
125 s32 item;
126
127 if (show) {
128 stats = GAME.funcs.getPartnerStats(panel->partner);
129 item = *(stats->equip + panel->slot); /* the match depends on this form: equip[slot] adds the base to the index */
130 windows->slotTitle->setString(windows->slotTitle, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x20);
131 if (item > 0) {
133 } else {
135 }
136 } else {
137 windows->slotTitle->setVisible(windows->slotTitle, 0);
138 windows->slotItem->setVisible(windows->slotItem, 0);
139 }
140}
141
142/* Draws the equipment panels: the partner's equipment, the list of items
143 that fit the slot and the slot's item */
145 SpriteDrawer sprite;
146 PartnerStats *stats;
147 s32 level;
148 s32 item;
149 s32 index;
150 s32 i;
151
152 stats = GAME.funcs.getPartnerStats(panel->partner);
153 initSpriteDrawer(&sprite);
154 if (panel->panels[0].level != 0) {
155 sprite.setTexture(0x140, 0);
156 sprite.setLayerId(panel->layer, 6);
157 level = panel->panels[0].level;
158 if (level != ONE) {
159 sprite.setScale(level, ONE, ONE);
160 sprite.setPivot(0x140, 0x19);
161 }
162 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), 0x18, 0x22, 0xD);
163 }
164 sprite.setLayerId(panel->layer, panel->depth);
165 level = panel->panels[1].level;
166 if (level != 0) {
167 if (level != ONE) {
168 sprite.setScale(level, ONE, ONE);
169 sprite.setPivot(0x140, 0x58);
170 } else {
171 sprite.setScale(ONE, ONE, ONE);
172 sprite.setTexture(0x140, 0);
173 for (i = 0; i < 6; i++) {
174 item = stats->equip[i];
175 if (item > 0) {
176 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), ITEM_FUNCS.getCategory(item), 0xB2, i * 14 + 0x31);
177 }
178 }
179 }
180 sprite.setTexture(0x280, 0x100);
181 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x2A, 0x9D, 0x28);
182 }
183 level = panel->panels[2].level;
184 if (level != 0) {
185 if (level != ONE) {
186 sprite.setScale(level, ONE, ONE);
187 sprite.setPivot(0x140, 0x89);
188 } else {
189 sprite.setScale(ONE, ONE, ONE);
190 for (i = 0; i < 8; i++) {
191 index = panel->scroll + i;
192 if (index < panel->count) {
193 item = panel->items[index];
194 if (item == -1 || item > 0) {
195 sprite.setTexture(0x280, 0x100);
196 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x31, 0x91, i * 14 + 0x4B);
197 if (item > 0) {
198 sprite.setTexture(0x140, 0);
199 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), ITEM_FUNCS.getCategory(item), 0x91, i * 14 + 0x4B);
200 }
201 }
202 }
203 }
204 if (panel->count > 8) {
205 if (GFX.funcs.getTime() - panel->arrowTime >= 9) {
206 panel->arrowTime = GFX.funcs.getTime();
207 panel->arrowShown = 1 - panel->arrowShown;
208 }
209 sprite.setTexture(0x280, 0x100);
210 if (panel->arrowShown) {
211 if (panel->scroll > 0) {
212 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x32, 0x126, 0x45);
213 }
214 if (panel->scroll < panel->count - 8) {
215 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x33, 0x126, 0xB3);
216 }
217 }
218 }
219 }
220 sprite.setTexture(0x280, 0x100);
221 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x2B, 0x77, 0x39);
222 if (panel->panels[2].level != ONE) {
223 sprite.setPivot(0, 0xD3);
224 }
225 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x20, 0, 0xC2);
226 }
227 level = panel->panels[3].level;
228 if (level != 0) {
229 if (level != ONE) {
230 sprite.setScale(level, ONE, ONE);
231 sprite.setPivot(0x140, 0x20);
232 } else {
233 sprite.setScale(ONE, ONE, ONE);
234 if (panel->showSlot) {
235 item = *(stats->equip + panel->slot); /* the match depends on this form: equip[slot] adds the base to the index */
236 if (item > 0) {
237 sprite.setTexture(0x140, 0);
238 sprite.draw(FILE_CACHE.getEntry(FILE_MENU_SPRITES << 16), ITEM_FUNCS.getCategory(item), 0xB2, 0x23);
239 }
240 }
241 }
242 sprite.setTexture(0x280, 0x100);
243 sprite.draw(FILE_CACHE.getEntry(FILE_STATUS_SPRITES << 16), 0x2C, 0xA0, 0x11);
244 }
245}
246
247/* Once the title's panel is in, shows the title and starts the slots' panel */
248static inline void STSTATUS_openEquipTitle(EquipPanel *panel, EquipPanelWindows *windows) {
249 if (STSTATUS_data.funcs.updateFade(&panel->panels[0])) {
250 windows->title->setString(windows->title, FILE_CACHE.load(TEXT_FILE(TEXT_STATUS)), 0x3F);
251 STSTATUS_data.funcs.startFade(&panel->panels[1], 1);
252 panel->substate++;
253 }
254}
255
256/* Once the slots' panel is in, shows the equipment and the slot cursor */
257static inline void STSTATUS_openEquipSlots(EquipPanel *panel, EquipPanelWindows *windows) {
258 if (STSTATUS_data.funcs.updateFade(&panel->panels[1])) {
259 STSTATUS_showEquipment(panel, windows, 1);
260 windows->cursor->setVisible(windows->cursor, 1);
261 panel->substate++;
262 }
263}
264
265/* Choosing a slot: up and down move the cursor, cross lists the owned items
266 for the slot ("none" first, then those the partner can equip, then the
267 others), triangle closes the panel */
268static inline void STSTATUS_chooseEquipSlot(EquipPanel *panel, EquipPanelWindows *windows) {
269 s32 oldSlot;
270 s32 count;
271 s32 n;
272 s32 i;
273
274 oldSlot = panel->slot;
276 panel->slot--;
277 if (panel->slot < 0) {
278 panel->slot = 0;
279 }
280 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
281 panel->slot++;
282 if (panel->slot >= 6) {
283 panel->slot = 5;
284 }
285 }
286 if (oldSlot != panel->slot) {
288 windows->cursor->setPos(windows->cursor, 0xA5, panel->slot * 14 + 0x31);
289 } else if (PAD_PRESSED(PAD_CROSS)) {
291 n = 1;
292 count = STSTATUS_data.funcs.listItems(STSTATUS_slotLists[panel->slot], panel->owned);
293 for (i = 0; i < count; i++) {
294 if (STSTATUS_data.funcs.canEquip(panel->partner, panel->slot, panel->owned[i])) {
295 panel->items[n++] = panel->owned[i];
296 }
297 }
298 for (i = 0; i < count; i++) {
299 if (!STSTATUS_data.funcs.canEquip(panel->partner, panel->slot, panel->owned[i])) {
300 panel->items[n++] = panel->owned[i];
301 }
302 }
303 panel->count = count + 1;
304 panel->items[0] = -1;
305 panel->substate = 10;
306 }
309 panel->substate = 0x32;
310 }
311}
312
313/* Starts closing the slots' panel for the item list */
314static inline void STSTATUS_closeEquipSlots(EquipPanel *panel, EquipPanelWindows *windows) {
315 STSTATUS_data.funcs.startFade(&panel->panels[1], 0);
316 STSTATUS_showEquipment(panel, windows, 0);
317 windows->cursor->setVisible(windows->cursor, 0);
318 panel->cursor = 0;
319 panel->scroll = 0;
320 panel->substate++;
321}
322
323/* Once the title's panel is closed, starts the slot's item panel */
324static inline void STSTATUS_openSlotItem(EquipPanel *panel) {
325 if (STSTATUS_data.funcs.updateFade(&panel->panels[0])) {
326 STSTATUS_data.funcs.startFade(&panel->panels[3], 1);
327 panel->substate++;
328 }
329}
330
331/* Once the slot's item panel is in, shows the slot's item and starts the
332 list's panel */
333static inline void STSTATUS_openEquipList(EquipPanel *panel, EquipPanelWindows *windows) {
334 if (STSTATUS_data.funcs.updateFade(&panel->panels[3])) {
335 panel->showSlot = 1;
336 STSTATUS_showSlotItem(panel, windows, 1);
337 STSTATUS_data.funcs.startFade(&panel->panels[2], 1);
338 panel->substate++;
339 }
340}
341
342/* Once the list's panel is in, shows the list, its cursor, the stats with
343 the slot emptied and, past 8 items, the scroll bar */
344static inline void STSTATUS_enterEquipList(EquipPanel *panel, EquipPanelWindows *windows) {
345 if (STSTATUS_data.funcs.updateFade(&panel->panels[2])) {
346 STSTATUS_showEquipList(panel, windows, 1);
347 windows->listCursor->setPos(windows->listCursor, 0x89, 0x4B);
348 windows->listCursor->setVisible(windows->listCursor, 1);
349 panel->screen->previewStats(panel->screen, panel->slot, 0);
350 if (panel->count >= 9) {
352 windows->scrollBar->setX(windows->scrollBar, 0x125, 0xC);
353 windows->scrollBar->setRange(windows->scrollBar, 0x4E, 0xB3);
354 windows->scrollBar->setCount(windows->scrollBar, 8, panel->count);
355 windows->scrollBar->setPos(windows->scrollBar, 0);
356 }
357 panel->substate++;
358 }
359}
360
361/* Choosing the item: up and down move the cursor, L1 and R1 scroll a page,
362 the stats show the item's effect, cross equips it, triangle goes back */
363static inline void STSTATUS_chooseEquipItem(EquipPanel *panel, EquipPanelWindows *windows) {
364 s32 oldCursor;
365 s32 oldScroll;
366 s32 item;
367
368 oldCursor = panel->cursor;
369 oldScroll = panel->scroll;
370 if (panel->count >= 9) {
372 panel->scroll -= 8;
373 if (panel->scroll < 0) {
374 panel->scroll = 0;
375 }
376 } else if ((!PAD_HELD(PAD_L1) && PAD_PRESSED(PAD_R1)) || (!PAD_HELD(PAD_L1) && PAD_REPEATED(PAD_R1))) {
377 panel->scroll += 8;
378 if (panel->scroll > panel->count - 8) {
379 panel->scroll = panel->count - 8;
380 }
381 }
382 }
384 panel->cursor--;
385 if (panel->cursor < 0) {
386 panel->cursor = 0;
387 panel->scroll--;
388 if (panel->scroll < 0) {
389 panel->scroll = 0;
390 }
391 }
392 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
393 if (panel->count < 8) {
394 panel->cursor++;
395 if (panel->cursor > panel->count - 1) {
396 panel->cursor = panel->count - 1;
397 }
398 } else {
399 panel->cursor++;
400 if (panel->cursor >= 8) {
401 panel->cursor = 7;
402 panel->scroll++;
403 if (panel->scroll > panel->count - 8) {
404 panel->scroll = panel->count - 8;
405 }
406 }
407 }
408 }
409 if (oldCursor != panel->cursor) {
411 windows->listCursor->setPos(windows->listCursor, 0x86, panel->cursor * 14 + 0x4B);
412#if VERSION_US
413 if (windows->scrollBar != NULL) {
414 windows->scrollBar->setPos(windows->scrollBar, panel->cursor + panel->scroll);
415 }
416#endif
417 }
418 if (oldScroll != panel->scroll) {
420 STSTATUS_showEquipList(panel, windows, 1);
421 if (windows->scrollBar != NULL) {
422#if VERSION_US
423 /* the USA version's bar follows the chosen item, the European and
424 Japanese ones the page */
425 windows->scrollBar->setPos(windows->scrollBar, panel->cursor + panel->scroll);
426#else
427 windows->scrollBar->setPos(windows->scrollBar, panel->scroll);
428#endif
429 }
430 }
431 item = panel->items[panel->cursor + panel->scroll];
432 if (oldCursor != panel->cursor || oldScroll != panel->scroll) {
433 if (STSTATUS_data.funcs.canEquip(panel->partner, panel->slot, item)) {
434 panel->screen->previewStats(panel->screen, panel->slot, item);
435 } else {
436 panel->screen->previewStats(panel->screen, -1, 0);
437 }
438 STSTATUS_showEquipItem(panel, windows, item);
439 } else if (PAD_PRESSED(PAD_CROSS)) {
440 if (STSTATUS_data.funcs.canEquip(panel->partner, panel->slot, item)) {
441 STSTATUS_data.funcs.equip(panel->partner, panel->slot, item);
442 panel->substate = 0x14;
443 panel->showSlot = 0;
444 panel->screen->previewStats(panel->screen, panel->slot, item);
445 if (windows->scrollBar != NULL) {
446 windows->scrollBar->state = 3;
447 }
449 }
450 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
452 panel->screen->previewStats(panel->screen, -1, 0);
453 panel->substate = 0x14;
454 panel->showSlot = 0;
455 if (windows->scrollBar != NULL) {
456 windows->scrollBar->state = 3;
457 }
458 }
459}
460
461/* Starts closing the list's panel */
462static inline void STSTATUS_closeEquipList(EquipPanel *panel, EquipPanelWindows *windows) {
463 STSTATUS_data.funcs.startFade(&panel->panels[2], 0);
464 STSTATUS_showEquipList(panel, windows, 0);
465 windows->listCursor->setVisible(windows->listCursor, 0);
466 panel->substate++;
467}
468
469/* Once the list's panel is closed, starts closing the slot's item panel */
470static inline void STSTATUS_closeSlotItem(EquipPanel *panel, EquipPanelWindows *windows) {
471 if (STSTATUS_data.funcs.updateFade(&panel->panels[2])) {
472 STSTATUS_data.funcs.startFade(&panel->panels[3], 0);
473 STSTATUS_showSlotItem(panel, windows, 0);
474 panel->substate++;
475 }
476}
477
478/* Starts closing the panel: the slots' panel, the equipment and the cursor */
479static inline void STSTATUS_closeEquipPanel(EquipPanel *panel, EquipPanelWindows *windows) {
480 STSTATUS_data.funcs.startFade(&panel->panels[1], 0);
481 STSTATUS_showEquipment(panel, windows, 0);
482 windows->cursor->setVisible(windows->cursor, 0);
483 panel->substate++;
484}
485
486/* Once the slots' panel is closed, starts closing the title's panel */
487static inline void STSTATUS_closeEquipTitle(EquipPanel *panel, EquipPanelWindows *windows) {
488 if (STSTATUS_data.funcs.updateFade(&panel->panels[1])) {
489 windows->title->setVisible(windows->title, 0);
490 STSTATUS_data.funcs.startFade(&panel->panels[0], 0);
491 panel->substate++;
492 }
493}
494
495/* The equipment panel's steps: a slot is chosen, then an item from the list
496 of those that fit it, the ones the partner can equip first */
498 switch (panel->substate) {
499 case 0:
500 default:
501 STSTATUS_data.funcs.startFade(&panel->panels[0], 1);
502 panel->substate++;
503 break;
504 case 1:
505 STSTATUS_openEquipTitle(panel, windows);
506 break;
507 case 2:
508 STSTATUS_openEquipSlots(panel, windows);
509 break;
510 case 3:
511 STSTATUS_chooseEquipSlot(panel, windows);
512 break;
513 case 10:
514 STSTATUS_closeEquipSlots(panel, windows);
515 break;
516 case 12:
518 break;
519 case 13:
520 STSTATUS_openEquipList(panel, windows);
521 break;
522 case 14:
523 STSTATUS_enterEquipList(panel, windows);
524 break;
525 case 15:
526 STSTATUS_chooseEquipItem(panel, windows);
527 break;
528 case 0x14:
529 STSTATUS_closeEquipList(panel, windows);
530 break;
531 case 0x15:
532 STSTATUS_closeSlotItem(panel, windows);
533 break;
534 case 0x16:
535 if (STSTATUS_data.funcs.updateFade(&panel->panels[3])) {
536 panel->substate = 0;
537 }
538 break;
539 case 0x32:
540 STSTATUS_closeEquipPanel(panel, windows);
541 break;
542 case 11:
543 case 0x33:
544 STSTATUS_closeEquipTitle(panel, windows);
545 break;
546 case 0x34:
547 if (STSTATUS_data.funcs.updateFade(&panel->panels[0])) {
548 panel->state = 3;
549 }
550 break;
551 }
552}
553
554/* The equipment panel's task: creates its windows, then runs and draws it; when
555 killed it clears the fifth screen's unk70 */
557 switch (panel->state) {
558 case TASK_INIT:
559 default:
560 panel->nextState(panel);
561 panel->scroll = 0;
562 STSTATUS_createEquipWindows(panel, windows);
563 panel->panels[3].duration = 10;
564 panel->panels[1].duration = 10;
565 panel->panels[2].duration = 10;
566 panel->panels[0].duration = 10;
567 break;
568 case TASK_RUN:
569 STSTATUS_runEquipPanel(panel, windows);
571 break;
572 case TASK_KILL:
573 panel->screen->unk70 = 0;
574 /* fallthrough */
575 case TASK_DONE:
576 break;
577 }
578}
579
580/* Creates the fifth screen's equipment panel (task) for its chosen party member */
583
584 panel->layer = SCREEN_LAYER;
585 panel->depth = 4;
586 panel->screen = screen;
587 panel->partner = GAME.funcs.getPartyMember(screen->member);
588 return panel;
589}
590
591/* The strings of the empty equipment slots */
593 65, 66, 67, 77,
594 68, 68,
595};
596/* The strings of the item kinds (WeaponData.kind), from 1 */
598 67, 77, 79, 65,
599 66, 68, 80, 68,
600};
601/* The item list of each equipment slot */
603 6, 7, 5, 5,
604 4, 4,
605};
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
Definition cursor.c:92
s32 STSTATUS_slotStrings[]
The strings of the empty equipment slots.
static void STSTATUS_closeEquipSlots(EquipPanel *panel, EquipPanelWindows *windows)
Starts closing the slots' panel for the item list.
void STSTATUS_showEquipList(EquipPanel *panel, EquipPanelWindows *windows, s32 show)
Fills the list of the items that fit the slot.
Definition equip_panel.c:72
void STSTATUS_showEquipItem(EquipPanel *panel, EquipPanelWindows *windows, s32 item)
An item's name and, for slots 2 and 3, its kind (none: string 0x51)
Definition equip_panel.c:55
void STSTATUS_updateEquipPanel(EquipPanel *panel, EquipPanelWindows *windows)
The equipment panel's task: creates its windows, then runs and draws it; when killed it clears the fi...
void STSTATUS_showSlotItem(EquipPanel *panel, EquipPanelWindows *windows, s32 show)
The item in the slot being changed, or the slot's name if it's empty.
static void STSTATUS_closeSlotItem(EquipPanel *panel, EquipPanelWindows *windows)
Once the list's panel is closed, starts closing the slot's item panel.
void STSTATUS_drawEquipPanel(EquipPanel *panel)
Draws the equipment panels: the partner's equipment, the list of items that fit the slot and the slot...
void STSTATUS_showEquipment(EquipPanel *panel, EquipPanelWindows *windows, s32 show)
The partner's equipment, or the slots' names where it has none.
Definition equip_panel.c:32
EquipPanel * STSTATUS_createEquipPanel(StatsScreen *screen)
Creates the fifth screen's equipment panel (task) for its chosen party member.
void STSTATUS_createEquipWindows(EquipPanel *panel, EquipPanelWindows *windows)
Creates the equipment panel's windows: the six slots, the list of items that fit the chosen one,...
Definition equip_panel.c:8
static void STSTATUS_openEquipList(EquipPanel *panel, EquipPanelWindows *windows)
Once the slot's item panel is in, shows the slot's item and starts the list's panel.
s32 STSTATUS_slotLists[]
The item list of each equipment slot.
static void STSTATUS_chooseEquipSlot(EquipPanel *panel, EquipPanelWindows *windows)
Choosing a slot: up and down move the cursor, cross lists the owned items for the slot ("none" first,...
static void STSTATUS_openSlotItem(EquipPanel *panel)
Once the title's panel is closed, starts the slot's item panel.
s32 STSTATUS_kindStrings[]
The strings of the item kinds (WeaponData.kind), from 1.
static void STSTATUS_closeEquipPanel(EquipPanel *panel, EquipPanelWindows *windows)
Starts closing the panel: the slots' panel, the equipment and the cursor.
static void STSTATUS_openEquipSlots(EquipPanel *panel, EquipPanelWindows *windows)
Once the slots' panel is in, shows the equipment and the slot cursor.
static void STSTATUS_enterEquipList(EquipPanel *panel, EquipPanelWindows *windows)
Once the list's panel is in, shows the list, its cursor, the stats with the slot emptied and,...
static void STSTATUS_closeEquipTitle(EquipPanel *panel, EquipPanelWindows *windows)
Once the slots' panel is closed, starts closing the title's panel.
static void STSTATUS_chooseEquipItem(EquipPanel *panel, EquipPanelWindows *windows)
Choosing the item: up and down move the cursor, L1 and R1 scroll a page, the stats show the item's ef...
static void STSTATUS_closeEquipList(EquipPanel *panel, EquipPanelWindows *windows)
Starts closing the list's panel.
void STSTATUS_runEquipPanel(EquipPanel *panel, EquipPanelWindows *windows)
The equipment panel's steps: a slot is chosen, then an item from the list of those that fit it,...
static void STSTATUS_openEquipTitle(EquipPanel *panel, EquipPanelWindows *windows)
Once the title's panel is in, shows the title and starts the slots' panel.
STSTATUS.PRO: the field menu's screens.
ScrollBar * STSTATUS_createScrollBar(void)
#define FILE_STATUS_SPRITES
The menu's sprite sheet; the next file is its texture archive.
Definition field_menu.h:20
#define TEXT_ITEM_INFO
ITMINF.
Definition file.h:214
#define TEXT_FILE(file)
Definition file.h:190
#define TEXT_STATUS
STATUS: the field menu's and STSTATUS's.
Definition file.h:225
#define TEXT_ITEM_NAMES
ITMNAM.
Definition file.h:215
#define FILE_MENU_SPRITES
Files the engine loads by number.
Definition file.h:188
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
Definition gfx.h:45
StatusData STSTATUS_data
Definition helpers.c:356
ItemFuncs ITEM_FUNCS
Definition items.c:890
#define PAD_CROSS
Definition pad.h:31
#define PAD_DOWN
Definition pad.h:24
#define PAD_TRIANGLE
Definition pad.h:32
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
Definition pad.h:140
#define PAD_UP
Definition pad.h:22
#define PAD_L1
Definition pad.h:28
#define PAD_HELD(button)
Definition pad.h:142
#define PAD_R1
Definition pad.h:29
#define PAD_REPEATED(button)
Definition pad.h:141
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
#define SOUND_SELECT
Sounds the overlays share, with SOUNDTST's names.
Definition sound.h:38
#define SOUND_MENU_CANCEL
SYSTEM01.
Definition sound.h:39
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
Definition sound.h:40
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)
Definition text.h:34
void(* setVisible)()
(cursor, visible)
Definition text.h:33
struct EquipPanelWindows::@16 rows[8]
TextWindow * help
Definition field_menu.h:228
TextWindow * slotItem
Definition field_menu.h:231
TextWindow * slotTitle
Definition field_menu.h:230
TextWindow * listTitle
Definition field_menu.h:221
ScrollBar * scrollBar
for more than 8 items
Definition field_menu.h:232
TextWindow * kind
Definition field_menu.h:229
TextWindow * times
the "x" before count
Definition field_menu.h:225
TextWindow * name
Definition field_menu.h:224
TextWindow * title
Definition field_menu.h:218
TextWindow * slots[6]
the equipment
Definition field_menu.h:219
TextWindow * count
how many are owned
Definition field_menu.h:226
Cursor * listCursor
Definition field_menu.h:222
A list of the fifth screen (STSTATUS_createEquipPanel)
Definition field_menu.h:199
PanelAnim panels[4]
Definition field_menu.h:214
StatsScreen * screen
Definition field_menu.h:201
s32 slot
the equipment slot being changed
Definition field_menu.h:205
s32 arrowShown
the scroll arrows blink
Definition field_menu.h:209
s32 count
items
Definition field_menu.h:207
s16 items[0x194]
those that fit the slot, -1: remove
Definition field_menu.h:211
s32 showSlot
draw the slot's item icon
Definition field_menu.h:213
void(* nextState)(struct EquipPanel *task)
Definition field_menu.h:200
s32 cursor
the list's row
Definition field_menu.h:206
s32 scroll
the first one shown
Definition field_menu.h:208
s16 owned[0x194]
listItems' result, sorted into items
Definition field_menu.h:212
void *(* load)(u32 file)
Definition file.h:92
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
struct PartnerStats *(* getPartnerStats)(s32 partner)
Definition game_state.h:38
s32(* getPartyMember)(u32 index)
Definition game_state.h:24
s8 items[0x193]
counts, up to 99
Definition game_state.h:512
GameFuncs funcs
Definition game_state.h:582
s32(* getTime)(void)
Definition gfx.h:31
GfxFuncs funcs
Definition gfx.h:77
s32(* getCategory)(s32 item)
getItemCategory
Definition game_state.h:671
struct ItemInfo *(* get)(s32 item)
getItem
Definition game_state.h:670
ItemRecord data
the type's record, or the usable items' effect
Definition game_state.h:226
s32 level
Definition menu.h:21
s32 duration
Definition menu.h:19
A partner Digimon from its name on (Partner.info), as getPartnerStats gives it.
Definition game_state.h:303
void(* setCount)(struct ScrollBar *bar, s32 pageSize, s32 count)
Definition menu.h:57
void(* setPos)(struct ScrollBar *bar, s32 pos)
Definition menu.h:58
void(* setRange)(struct ScrollBar *bar, s32 top, s32 bottom)
Definition menu.h:56
s32 state
Definition menu.h:39
void(* setX)(struct ScrollBar *bar, s32 x, s32 width)
Definition menu.h:55
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
Definition gfx.h:223
void(* setPivot)()
(x, y)
Definition gfx.h:250
void(* setScale)()
(x, y, z), ONE = 1.0
Definition gfx.h:248
void(* setLayerId)()
(id, depth)
Definition gfx.h:244
void(* draw)()
(sheet, frame, x, y)
Definition gfx.h:246
void(* setTexture)()
(x, y)
Definition gfx.h:242
The field menu's fifth screen (STSTATUS_createStatusScreen)
Definition field_menu.h:117
void(* previewStats)(struct StatsScreen *screen, s32 slot, s32 item)
Definition field_menu.h:135
s32 unk70
only cleared, when the equipment panel closes
Definition field_menu.h:125
s32 member
in the party
Definition field_menu.h:128
StatusFuncs funcs
Definition field_menu.h:445
s32(* updateFade)(PanelAnim *fade)
Definition field_menu.h:276
s32(* canEquip)(s32 partner, s32 slot, s32 item)
Definition field_menu.h:281
s32(* listItems)(s32 list, s16 *out)
6, 7: special lists; returns the count
Definition field_menu.h:280
void(* startFade)(PanelAnim *fade, s32 fadeIn)
Definition field_menu.h:275
void(* equip)(s32 partner, s32 slot, s32 item)
Definition field_menu.h:282
void(* setPalette)(struct TextWindow *obj, u8 arg)
Definition text.h:174
void(* setRightAlign)()
no prototype: callers would truncate u8 args
Definition text.h:178
void(* setNumber)()
Definition text.h:166
void(* setString)()
Definition text.h:165
void(* setVisible)(struct TextWindow *obj, u8 arg)
Definition text.h:177
u8 kind
EQUIP_KIND_*.
Definition game_state.h:146
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105
#define PALETTE_WHITE
The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs,...
Definition text.h:112
#define PALETTE_GREY
what is unavailable
Definition text.h:119
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
ItemInfo.data's record, by ItemInfo.type.
Definition game_state.h:188
WeaponData weapon
Definition game_state.h:189
ItemData * record
Definition game_state.h:210