Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
shop.c
Go to the documentation of this file.
1/* The card shop's main task, which opens the pack screen or the buy screen;
2 the files it loads; its helpers; and the shops' stock and prices */
3
5
6/* Creates the shop's windows and its cursor */
8 TextWindow **windows;
9 s32 i;
10 s32 j;
11
12 win->title = createTextWindow(shop->layer, 1, 0x1D, 0x16);
13 win->help = createTextWindow(shop->layer, 1, 0xD3, 0xCC);
14 win->money = createTextWindow(shop->layer, 3, 0x117, 0x1C);
15 win->moneyLabel = createTextWindow(shop->layer, 3, 0x11A, 0x1C);
16 for (i = 0; i < 3; i++) {
17 win->options[i] = createTextWindow(shop->layer, 1, 0xA7, i * 14 + 0x35);
18 }
19 win->cursor = createCursor(shop->layer, shop->depth - 2, 0xA7, shop->cursor * 14 + 0x35);
20 win->cursor->setVisible(win->cursor, 0);
21 win->message = createTextWindow(shop->layer, 1, 0x9A, 0x71);
22 windows = shop->children;
23 /* the match depends on this loop having a counter of its own: sharing i
24 swaps the registers of the options loop's counter and y */
25 for (j = 0; j < shop->childCount - 3; j++, windows++) {
26 (*windows)->setDepth(*windows, shop->depth - 2);
27 }
28}
29
30/* Shows or hides the shop's title and the money */
32 if (show) {
35 win->money->setNumber(win->money, 0, GAME.money);
36 win->money->setRightAlign(win->money, 1);
37 } else {
38 win->title->setVisible(win->title, 0);
39 win->moneyLabel->setVisible(win->moneyLabel, 0);
40 win->money->setVisible(win->money, 0);
41 }
42}
43
44/* Shows or hides the options (buy cards, open a pack, edit the decks) and the help */
46 s32 i;
47
48 if (show) {
49 for (i = 0; i < 3; i++) {
51 }
53 } else {
54 for (i = 0; i < 3; i++) {
55 win->options[i]->setVisible(win->options[i], 0);
56 }
57 win->help->setVisible(win->help, 0);
58 }
59}
60
61/* Draws the scrolling background and the panels as they open */
63 SpriteDrawer sprite;
64
65 initSpriteDrawer(&sprite);
66 sprite.setLayerId(shop->layer, 7);
67 sprite.setTexture(0x280, 0);
68 if (shop->scrollWait != 0) {
69 shop->scroll++;
70 shop->scroll = shop->scroll < 0x60 ? shop->scroll : 0;
71 shop->scrollWait = 0;
72 } else {
73 shop->scrollWait = 1;
74 }
75 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 8, shop->scroll, shop->scroll);
76 sprite.setLayerId(shop->layer, shop->depth - 1);
77 if (shop->fades[0].level != 0) {
78 if (shop->fades[0].level != ONE) {
79 sprite.setScale(shop->fades[0].level, ONE, ONE);
80 sprite.setPivot(0x57, 0x1B);
81 }
82 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x28, 0x16, 0x14);
83 if (shop->fades[0].level != ONE) {
84 sprite.setPivot(0x140, 0x1D);
85 }
86 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x29, 0xD6, 0x15);
87 }
88 if (shop->fades[1].level != 0) {
89 if (shop->fades[1].level != ONE) {
90 sprite.setScale(shop->fades[1].level, ONE, ONE);
91 sprite.setPivot(0x140, 0x49);
92 }
93 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x2F, 0x92, 0x2E);
94 if (shop->fades[1].level != ONE) {
95 sprite.setPivot(0x140, 0xD2);
96 }
97 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0xF, 0xC6, 0xC4);
98 }
99 if (shop->fades[2].level != 0) {
100 if (shop->fades[2].level != ONE) {
101 sprite.setScale(shop->fades[2].level, ONE, ONE);
102 sprite.setPivot(0x140, 0x77);
103 }
104 sprite.draw(FILE_CACHE.getEntry(FILE_CARDSHOP_SPRITES << 16), 0x2C, 0x7B, 0x6B);
105 }
106}
107
108/* Up/down choose buy one card, open booster or edit folder; cross starts it,
109 triangle leaves the shop */
110static inline void STCRDSHP_chooseOption(CardShop *shop, CardShopWindows *win) {
111 s32 cursor;
112
113 cursor = shop->cursor;
115 if (--shop->cursor < 0) {
116 shop->cursor = 0;
117 }
118 } else if (PAD_PRESSED(PAD_DOWN) || PAD_REPEATED(PAD_DOWN)) {
119 if (++shop->cursor >= 3) {
120 shop->cursor = 2;
121 }
122 }
123 if (cursor != shop->cursor) {
125 win->cursor->setPos(win->cursor, 0x9A, shop->cursor * 14 + 0x35);
126 }
127 if (PAD_PRESSED(PAD_CROSS)) {
129 shop->substate = 10;
130 } else if (PAD_PRESSED(PAD_TRIANGLE)) {
132 shop->setSubstate(shop, 50);
133 }
134}
135
136/* Starts what was chosen: the screen to buy cards, the one to open a pack when
137 the bag has one (else a message), or the deck editor once the shop has
138 closed */
139static inline void STCRDSHP_startOption(CardShop *shop, CardShopWindows *win) {
140 s32 count;
141 s32 i;
142
143 shop->step = 1;
144 switch (shop->cursor) {
145 case 0:
146 default:
147 win->dialog = (Task *)STCRDSHP_createBuy(shop, shop->shop);
148 shop->substate = 50;
149 break;
150 case 1:
151 count = ITEM_FUNCS.list(1, shop->items);
152 for (i = 0; i < count; i++) {
154 win->dialog = (Task *)STCRDSHP_createPackOpen(shop);
155 shop->substate = 50;
156 break;
157 }
158 }
159 if (win->dialog == NULL) {
160 shop->setSubstate(shop, 20);
161 }
162 break;
163 case 2:
164 shop->substate = 100;
165 shop->toDeckEditor = 1;
166 break;
167 }
168}
169
170/* Hides the options and the cursor and closes their panel; leaving the shop
171 (step unset), also fades the screen out */
172static inline void STCRDSHP_closeOptions(CardShop *shop, CardShopWindows *win) {
173 if (shop->step == 0) {
174 win->fade = STCRDSHP_createFader();
175 win->fade->start(win->fade, 0, 0x1E);
176 win->fade->depth = 6;
177 }
178 STCRDSHP_showOptions(shop, win, 0);
179 win->cursor->setVisible(win->cursor, 0);
180 STCRDSHP_funcs.startFade(&shop->fades[1], 0);
181 shop->substate++;
182}
183
184/* Once the options' panel has closed: waits for the screen chosen, or closes
185 the title's panel to leave */
186static inline void STCRDSHP_endOptions(CardShop *shop, CardShopWindows *win) {
187 if (STCRDSHP_funcs.updateFade(&shop->fades[1]) != 0) {
188 if (shop->step == 0) {
189 STCRDSHP_showTitle(shop, win, 0);
190 STCRDSHP_funcs.startFade(&shop->fades[0], 0);
191 shop->substate++;
192 } else {
193 shop->substate = 11;
194 }
195 }
196}
197
198/* Opens the panels, moves the cursor and starts what was chosen */
200 switch (shop->substate) {
201 case 0:
202 default:
203 STCRDSHP_funcs.startFade(&shop->fades[0], 1);
204 shop->substate++;
205 break;
206 case 1:
207 if (STCRDSHP_funcs.updateFade(&shop->fades[0]) != 0) {
208 STCRDSHP_showTitle(shop, win, 1);
209 STCRDSHP_funcs.startFade(&shop->fades[1], 1);
210 shop->substate++;
211 }
212 break;
213 case 2:
214 if (STCRDSHP_funcs.updateFade(&shop->fades[1]) != 0) {
215 STCRDSHP_showOptions(shop, win, 1);
216 win->cursor->setPos(win->cursor, 0x9A, shop->cursor * 14 + 0x35);
217 win->cursor->setVisible(win->cursor, 1);
218 shop->substate++;
219 }
220 break;
221 case 3:
222 STCRDSHP_chooseOption(shop, win);
223 break;
224 case 10:
225 STCRDSHP_startOption(shop, win);
226 break;
227 case 11:
228 if (win->dialog == NULL) {
229 shop->substate = 1;
230 }
231 break;
232 case 20:
233 win->cursor->setStill(win->cursor, 1);
235 STCRDSHP_funcs.startFade(&shop->fades[2], 1);
236 shop->substate++;
237 break;
238 case 21:
239 if (STCRDSHP_funcs.updateFade(&shop->fades[2]) != 0) {
241 shop->substate++;
242 }
243 break;
244 case 22:
245 if (PAD_PRESSED(PAD_CROSS)) {
247 win->message->setVisible(win->message, 0);
248 STCRDSHP_funcs.startFade(&shop->fades[2], 0);
249 shop->substate++;
250 }
251 break;
252 case 23:
253 if (STCRDSHP_funcs.updateFade(&shop->fades[2]) != 0) {
254 win->cursor->setStill(win->cursor, 0);
256 shop->substate = 3;
257 }
258 break;
259 case 50:
260 STCRDSHP_closeOptions(shop, win);
261 break;
262 case 51:
263 STCRDSHP_endOptions(shop, win);
264 break;
265 case 52:
266 if (STCRDSHP_funcs.updateFade(&shop->fades[0]) != 0) {
267 shop->substate = 101;
268 }
269 break;
270 case 100:
271 win->fade = STCRDSHP_createFader();
272 win->fade->start(win->fade, 0, 10);
273 shop->substate++;
274 break;
275 case 101:
276 if (win->fade->state == TASK_DONE) {
277 shop->state = TASK_KILL;
278 }
279 break;
280 }
281}
282
283/* Shows the money left (after buying) */
285 CardShopWindows *win = shop->children;
286
287 win->money->setNumber(win->money, 0, GAME.money);
288 win->money->setRightAlign(win->money, 1);
289}
290
291/* The shop's update: loads its files, then runs it; leaves to the field or
292 the deck editor */
294 switch (shop->state) {
295 case TASK_INIT:
296 default:
297 switch (shop->substate) {
298 case 0:
299 default:
301 shop->substate++;
302 break;
303 case 1:
304 if (STCRDSHP_funcs.filesLoading() == 0) {
306 shop->fades[0].duration = 10;
307 shop->fades[1].duration = 10;
308 shop->fades[2].duration = 10;
309 shop->nextState(shop);
310 }
311 break;
312 }
313 break;
314 case TASK_RUN:
315 STCRDSHP_runShop(shop, win);
316 STCRDSHP_drawShop(shop);
317 break;
318 case TASK_DONE:
319 break;
320 case TASK_KILL:
321 if (shop->toDeckEditor != 0) {
323 } else {
325 }
326 break;
327 }
328}
329
330/* Creates the card shop (task) for the shop of the mode's argument, titled for
331 the field it is opened from; the cursor starts on the deck editor's option
332 when coming back from it. Requests the card data and strings */
335 s32 mode;
336 s32 i;
337
339 shop->layer = SCREEN_LAYER;
340 shop->depth = 7;
341 shop->shop = GAME.funcs.getModeArg();
342 mode = GAME.fieldMode;
343 for (i = 0; STCRDSHP_titles[i].mode != 0; i++) {
344 if (STCRDSHP_titles[i].mode == mode) {
345 shop->title = STCRDSHP_titles[i].title;
346 }
347 }
348 if (shop->title == 0) {
349 shop->title = 0x1F;
350 }
352 shop->cursor = 2;
353 }
361 return shop;
362}
363
364/* Loads the shop's textures and requests its strings */
377
378/* Whether the shop's strings are still loading */
381 return 1;
382 }
384 return 1;
385 }
387 return 1;
388 }
390 return 1;
391 }
393}
394
399
400/* The stock of a shop (the first one's if it has none), counting its cards */
402 s32 found = -1;
403 s32 i;
404
405 for (i = 0; STCRDSHP_stocks[i].shop != -1; i++) {
406 if (STCRDSHP_stocks[i].shop == shop) {
407 found = i;
408 break;
409 }
410 }
411 if (found == -1) {
412 found = 0;
413 }
414 STCRDSHP_stocks[found].count = 0;
415 for (i = 0; STCRDSHP_stocks[found].cards[i] != 0; i++) {
416 STCRDSHP_stocks[found].count++;
417 }
418 return &STCRDSHP_stocks[found];
419}
420
421/* The price of a card */
423 s32 i;
424
425 for (i = 0; STCRDSHP_prices[i].card != 0; i++) {
426 if (STCRDSHP_prices[i].card == card) {
427 return STCRDSHP_prices[i].price;
428 }
429 }
430 return 1;
431}
432
433/* The shop's title for each field it is opened from, up to mode 0 */
435 { 529, 31 }, { 640, 32 }, { 559, 33 }, { 669, 34 }, { 574, 35 },
436 { 683, 36 }, { 606, 37 }, { 711, 38 }, { 623, 39 }, { 726, 40 },
437 { 0, 31 },
438};
439/* The shops' helpers */
444/* The cards each shop sells (STCRDSHP_stocks), up to 0 */
446 { 65, 235, 277, 194, 204, 59, 0, 0 },
447 { 10, 210, 80, 168, 30, 59, 0, 0 },
448 { 209, 167, 82, 128, 30, 59, 0, 0 },
449 { 75, 202, 164, 121, 27, 59, 0, 0 },
450 { 115, 157, 73, 204, 249, 27, 0, 0 },
451 { 201, 116, 153, 284, 27, 30, 0, 0 },
452 { 96, 226, 140, 185, 265, 259, 0, 0 },
453 { 209, 167, 252, 82, 128, 259, 0, 0 },
454 { 72, 115, 157, 73, 204, 249, 0, 0 },
455 { 72, 115, 157, 73, 204, 285, 0, 0 },
456 { 96, 10, 210, 80, 168, 30, 0, 0 },
457 { 209, 167, 252, 82, 128, 259, 0, 0 },
458 { 209, 72, 201, 116, 204, 249, 0, 0 },
459 { 72, 115, 157, 73, 204, 285, 0, 0 },
460 { 209, 167, 252, 82, 128, 259, 0, 0 },
461 { 72, 115, 157, 73, 204, 249, 0, 0 },
462 { 209, 72, 201, 116, 204, 249, 0, 0 },
463 { 72, 201, 116, 157, 153, 284, 0, 0 },
464 { 65, 106, 150, 194, 277, 235, 0, 0 },
465 { 30, 75, 202, 164, 121, 27, 0, 0 },
466 { 156, 75, 202, 109, 153, 285, 0, 0 },
467 { 115, 157, 73, 204, 249, 30, 0, 0 },
468 { 156, 70, 200, 109, 285, 27, 0, 0 },
469 { 116, 285, 66, 106, 150, 194, 0, 0 },
470};
471/* The cards the shops sell and their prices */
473 { 10, 2200 }, { 27, 11000 }, { 30, 4000 }, { 59, 1000 }, { 65, 10000 }, { 66, 10000 },
474 { 70, 7000 }, { 72, 7700 }, { 73, 7700 }, { 75, 6600 }, { 80, 2200 }, { 82, 3000 },
475 { 96, 500 }, { 106, 10000 }, { 109, 8000 }, { 115, 7700 }, { 116, 7700 }, { 121, 4000 },
476 { 128, 3000 }, { 140, 500 }, { 150, 10000 }, { 153, 8000 }, { 156, 7000 }, { 157, 7700 },
477 { 164, 4000 }, { 167, 3300 }, { 168, 2200 }, { 185, 500 }, { 194, 10000 }, { 200, 7000 },
478 { 201, 7700 }, { 202, 6600 }, { 204, 5500 }, { 209, 4400 }, { 210, 2200 }, { 226, 500 },
479 { 235, 13000 }, { 249, 6600 }, { 252, 4400 }, { 259, 1000 }, { 265, 500 }, { 277, 10000 },
480 { 284, 9000 }, { 285, 9000 }, { 0, 1 },
481};
482/* Each shop's cards */
484 { 49, 0, STCRDSHP_shopCards[0] },
485 { 50, 0, STCRDSHP_shopCards[1] },
486 { 51, 0, STCRDSHP_shopCards[2] },
487 { 52, 0, STCRDSHP_shopCards[3] },
488 { 53, 0, STCRDSHP_shopCards[4] },
489 { 54, 0, STCRDSHP_shopCards[5] },
490 { 55, 0, STCRDSHP_shopCards[6] },
491 { 56, 0, STCRDSHP_shopCards[7] },
492 { 57, 0, STCRDSHP_shopCards[8] },
493 { 58, 0, STCRDSHP_shopCards[9] },
494 { 59, 0, STCRDSHP_shopCards[10] },
495 { 60, 0, STCRDSHP_shopCards[11] },
496 { 61, 0, STCRDSHP_shopCards[12] },
497 { 62, 0, STCRDSHP_shopCards[13] },
498 { 63, 0, STCRDSHP_shopCards[14] },
499 { 64, 0, STCRDSHP_shopCards[15] },
500 { 65, 0, STCRDSHP_shopCards[16] },
501 { 66, 0, STCRDSHP_shopCards[17] },
502 { 67, 0, STCRDSHP_shopCards[18] },
503 { 70, 0, STCRDSHP_shopCards[19] },
504 { 71, 0, STCRDSHP_shopCards[20] },
505 { 72, 0, STCRDSHP_shopCards[21] },
506 { 73, 0, STCRDSHP_shopCards[22] },
507 { 74, 0, STCRDSHP_shopCards[23] },
508 { -1, 0, NULL },
509};
CardShopBuy * STCRDSHP_createBuy(CardShop *shop, s32 shopId)
Creates the screen to buy the cards of a shop.
Definition buy.c:473
STCRDSHP.PRO: the card packs (mode 0x1300).
s32 STCRDSHP_updateLerp(MenuLerp *lerp)
#define CARD_PACK_CATEGORY
getItemCategory's value for the card packs (the item type 28)
Definition card_packs.h:25
s32 STCRDSHP_updateFade(PanelAnim *fade)
#define FILE_CARDSHOP_SPRITES
The sprite sheet of the screen, the shop's textures and the card data (five files,...
Definition card_packs.h:34
#define FILE_CARDSHOP_IMAGES
Definition card_packs.h:35
#define FILE_CARD_DATA
Definition card_packs.h:36
ScreenFade * STCRDSHP_createFader(void)
void STCRDSHP_startFade(PanelAnim *fade, s32 fadeIn)
void STCRDSHP_startLerp(MenuLerp *lerp, s32 from, s32 to, s32 frames)
CardShopStock * STCRDSHP_getStock(s32 shop)
The stock of a shop (the first one's if it has none), counting its cards.
Definition shop.c:401
static void STCRDSHP_startOption(CardShop *shop, CardShopWindows *win)
Starts what was chosen: the screen to buy cards, the one to open a pack when the bag has one (else a ...
Definition shop.c:139
void STCRDSHP_drawShop(CardShop *shop)
Draws the scrolling background and the panels as they open.
Definition shop.c:62
s16 STCRDSHP_getPrice(s32 card)
The price of a card.
Definition shop.c:422
s32 STCRDSHP_filesLoading(void)
Whether the shop's strings are still loading.
Definition shop.c:379
static void STCRDSHP_endOptions(CardShop *shop, CardShopWindows *win)
Once the options' panel has closed: waits for the screen chosen, or closes the title's panel to leave...
Definition shop.c:186
CardPrice STCRDSHP_prices[]
The cards the shops sell and their prices.
Definition shop.c:472
CardShopStock STCRDSHP_stocks[]
Each shop's cards.
Definition shop.c:483
s16 STCRDSHP_shopCards[24][8]
The cards each shop sells (STCRDSHP_stocks), up to 0.
Definition shop.c:445
void STCRDSHP_showOptions(CardShop *shop, CardShopWindows *win, s32 show)
Shows or hides the options (buy cards, open a pack, edit the decks) and the help.
Definition shop.c:45
CardShopTitle STCRDSHP_titles[]
The shop's title for each field it is opened from, up to mode 0.
Definition shop.c:434
void STCRDSHP_showTitle(CardShop *shop, CardShopWindows *win, s32 show)
Shows or hides the shop's title and the money.
Definition shop.c:31
CardShopFuncs STCRDSHP_funcs
The shops' helpers.
Definition shop.c:440
static void STCRDSHP_closeOptions(CardShop *shop, CardShopWindows *win)
Hides the options and the cursor and closes their panel; leaving the shop (step unset),...
Definition shop.c:172
CardShop * STCRDSHP_createShop(void)
Creates the card shop (task) for the shop of the mode's argument, titled for the field it is opened f...
Definition shop.c:333
void STCRDSHP_showMoney(CardShop *shop)
Shows the money left (after buying)
Definition shop.c:284
static void STCRDSHP_chooseOption(CardShop *shop, CardShopWindows *win)
Up/down choose buy one card, open booster or edit folder; cross starts it, triangle leaves the shop.
Definition shop.c:110
void STCRDSHP_updateShop(CardShop *shop, CardShopWindows *win)
The shop's update: loads its files, then runs it; leaves to the field or the deck editor.
Definition shop.c:293
void STCRDSHP_runShop(CardShop *shop, CardShopWindows *win)
Opens the panels, moves the cursor and starts what was chosen.
Definition shop.c:199
void STCRDSHP_loadFiles(void)
Loads the shop's textures and requests its strings.
Definition shop.c:365
void STCRDSHP_createShopWindows(CardShop *shop, CardShopWindows *win)
Creates the shop's windows and its cursor.
Definition shop.c:7
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
signed short s16
Definition common.h:9
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
#define TEXT_CARD_SHOP
CRDSHP: STCRDSHP's, and STCRDDEK's.
Definition file.h:207
#define TEXT_CARD_NAMES
CARDNM.
Definition file.h:203
#define TEXT_CARD_EFFECTS
CARDST.
Definition file.h:204
#define TEXT_FILE(file)
Definition file.h:190
#define TEXT_ITEM_NAMES
ITMNAM.
Definition file.h:215
#define TEXT_SHOP_NAMES
SHPNAM.
Definition file.h:221
FileCache FILE_CACHE
The file cache.
Definition file_cache.c:7
#define MODE_DECK_EDITOR
STCRDDEK.
Definition game_state.h:430
#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
ItemFuncs ITEM_FUNCS
Definition items.c:890
CardPackOpen * STCRDSHP_createPackOpen(CardShop *shop)
Creates the screen to open a pack.
Definition pack_open.c:596
#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_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_MENU_CONFIRM
SYSTEM07.
Definition sound.h:44
#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...
A card's price.
Definition card_packs.h:68
The shop's helpers (STCRDSHP_funcs)
Definition card_packs.h:206
s32(* updateFade)(PanelAnim *fade)
Definition card_packs.h:210
s32(* filesLoading)(void)
Definition card_packs.h:208
void(* loadFiles)(void)
Definition card_packs.h:207
void(* startFade)(PanelAnim *fade, s32 fadeIn)
Definition card_packs.h:209
The cards a shop sells.
Definition card_packs.h:61
s16 * cards
0-terminated
Definition card_packs.h:64
The shop's title for the field it is opened from.
Definition card_packs.h:74
s32 title
string of file 0x95
Definition card_packs.h:76
s32 mode
GAME.fieldMode; 0 ends the list.
Definition card_packs.h:75
The children of the shop.
Definition card_packs.h:97
Task * dialog
buying cards or opening a pack
Definition card_packs.h:105
TextWindow * moneyLabel
Definition card_packs.h:101
TextWindow * money
Definition card_packs.h:102
TextWindow * help
Definition card_packs.h:99
ScreenFade * fade
Definition card_packs.h:106
Cursor * cursor
Definition card_packs.h:104
TextWindow * title
Definition card_packs.h:98
TextWindow * options[3]
Definition card_packs.h:103
TextWindow * message
Definition card_packs.h:100
The card shop's main task (STCRDSHP_createShop): buy cards, open packs or edit the decks.
Definition card_packs.h:81
void(* showMoney)(struct CardShop *shop)
Definition card_packs.h:93
s32 depth
Definition card_packs.h:84
s16 items[0x194]
the bag's, to look for packs
Definition card_packs.h:91
s32 cursor
Definition card_packs.h:90
s32 layer
Definition card_packs.h:83
s32 toDeckEditor
Definition card_packs.h:89
s32 scrollWait
it moves every other frame
Definition card_packs.h:86
void(* nextState)(struct CardShop *task)
Definition card_packs.h:82
s32 scroll
of the background
Definition card_packs.h:85
s32 title
Definition card_packs.h:88
PanelAnim fades[3]
Definition card_packs.h:92
void * children
Definition card_packs.h:82
s32 childCount
Definition card_packs.h:82
s32 state
Definition card_packs.h:82
s32 substate
Definition card_packs.h:82
void(* setSubstate)(struct CardShop *task, s32 substate)
Definition card_packs.h:82
s32 shop
the game mode's argument
Definition card_packs.h:87
void(* setPalette)()
Definition text.h:35
void(* setPos)()
(cursor, x, y)
Definition text.h:34
void(* setStill)()
Definition text.h:38
void(* setVisible)()
(cursor, visible)
Definition text.h:33
void *(* load)(u32 file)
Definition file.h:92
s32(* isLoading)(s32 file)
Definition file.h:88
void(* request)(s32 file)
Definition file.h:90
void *(* getEntry)(u32 fileAndIndex)
Definition file.h:96
s32(* getModeArg)()
Definition game_state.h:20
void(* requestMode)(s32 mode, s32 arg)
Definition game_state.h:21
s32(* getPrevMode)()
Definition game_state.h:23
s32 fieldMode
where the menu returns to
Definition game_state.h:503
GameFuncs funcs
Definition game_state.h:582
s32(* getCategory)(s32 item)
getItemCategory
Definition game_state.h:671
s32(* list)(s32 type, s16 *out)
listItems
Definition game_state.h:673
s32 level
Definition menu.h:21
s32 duration
Definition menu.h:19
s32 depth
Definition gfx.h:364
void(* start)(struct ScreenFade *fade, s32 fadeIn, s32 frames)
TASK_DONE when done.
Definition gfx.h:368
s32 state
Definition gfx.h:362
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
Any task, seen through its header.
Definition task.h:62
A text window (createTextWindow): up to six text buffers (0 is shown, 1-5 are "work" buffers that con...
Definition text.h:131
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
Uploads TIM images to VRAM (initTimLoader); acts on TIM_LOADER.
Definition gfx.h:325
void(* setImagePos)()
(x, y)
Definition gfx.h:336
void(* loadArchive)()
(archive): each image 64 halfwords to the right
Definition gfx.h:338
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)
void initTimLoader(TimLoader *obj)
Clears a TIM loader, gives it its methods and binds it.
Definition tim_loader.c:119