Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
pause_stats.c
Go to the documentation of this file.
1#include "pause_common.h"
2
3void pause_stats_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening);
4void pause_stats_init(MenuPanel* panel);
7
8static s32 gPauseStatsIconIDs[12];
9
10#if VERSION_IQUE
11#define NUMBER_OFFSET_Y 2
12#define ROW_1_Y 48
13#define ROW_2_Y 49
14#define ROW_3_Y 83
15#define ROW_4_Y 116
16#define COL_A_X 17
17#define COL_B_X 80
18#define COL_C_X 110
19#define POS_1_X 60
20#define POS_2_X 100
21#else
22#define NUMBER_OFFSET_Y 0
23#define ROW_1_Y 51
24#define ROW_2_Y 51
25#define ROW_3_Y 85
26#define ROW_4_Y 119
27#define COL_A_X 25
28#define COL_B_X 78
29#define COL_C_X 105
30#define POS_1_X 67
31#define POS_2_X 106
32#endif
33
34// Probably only used here, but could theoretically be used in the main menu too
35typedef struct {
39} StatsEntryData; // size = 0xC
40
41enum {
54};
55
70
71#if VERSION_PAL
72#define PAUSE_MSG_3B PAUSE_MSG_NO_BADGE
73#define PAUSE_MSG_3F PAUSE_MSG_NO_BADGE
74#endif
75
81 0, 4,
82 1, 5,
83 1, 6,
84 2, 7,
85 2, 8,
86 3, 9,
87 3, 10
88};
89
90#if VERSION_PAL
91#define STAR_POWER_X 122
92#define COLLECTABLES_X 127
93#else
94#define STAR_POWER_X 132
95#define COLLECTABLES_X 125
96#endif
97
98
100 { .cursorX = 9, .cursorY = 20, .baseMsgID = PAUSE_MSG_TIP_CONTROLS },
101 { .cursorX = 17, .cursorY = 55, .baseMsgID = PAUSE_MSG_TIP_HP },
102 { .cursorX = 17, .cursorY = 90, .baseMsgID = PAUSE_MSG_TIP_FP },
103 { .cursorX = 17, .cursorY = 124, .baseMsgID = PAUSE_MSG_TIP_BP },
104 { .cursorX = 138, .cursorY = 28, .baseMsgID = PAUSE_MSG_TIP_BOOTS_1 },
105 { .cursorX = 138, .cursorY = 53, .baseMsgID = PAUSE_MSG_TIP_HAMMER_0 },
106 { .cursorX = STAR_POWER_X, .cursorY = 76, .baseMsgID = PAUSE_MSG_TIP_STAR_POWER },
107 { .cursorX = COLLECTABLES_X, .cursorY = 91, .baseMsgID = PAUSE_MSG_TIP_STAR_POINTS },
108 { .cursorX = COLLECTABLES_X, .cursorY = 106, .baseMsgID = PAUSE_MSG_TIP_COINS },
109 { .cursorX = COLLECTABLES_X, .cursorY = 121, .baseMsgID = PAUSE_MSG_TIP_SECRETS },
110 { .cursorX = COLLECTABLES_X, .cursorY = 138, .baseMsgID = PAUSE_MSG_TIP_TIME },
111};
112
113#if VERSION_PAL
114s32 D_pause_80253814[] = { 0, -16, -7, -19 };
115#endif
116
124s32 D_8024F46C[] = { -1, 1, 2, 4, 5, 7, 8 };
125// s32 D_8024F46C = -1;
126// s32 D_8024F470 = 1;
127// s32 D_8024F474 = 2;
128// s32 D_8024F478 = 4;
129// s32 D_8024F47C = 5;
130// s32 D_8024F480 = 7;
131// s32 D_8024F484 = 8;
132
134 {
136 .unk_01 = 0,
137 .pos = { .x = 3, .y = 16 },
138 .width = 289,
139 .height = 154,
140 .priority = WINDOW_PRIORITY_0,
141 .fpDrawContents = &pause_stats_draw_contents,
142 .tab = NULL,
143 .parentID = WIN_PAUSE_MAIN,
144 .fpUpdate = { WINDOW_UPDATE_HIDE },
145 .extraFlags = 0,
146 .style = { .customStyle = &gPauseWS_12 }
147 }
148};
150 .initialized = FALSE,
151 .col = 0,
152 .row = 0,
153 .selected = 0,
154 .state = 0,
155 .numCols = 2,
156 .numRows = 7,
157 .numPages = 0,
158 .gridData = gPauseStatsGridData,
159 .fpInit = &pause_stats_init,
160 .fpHandleInput = &pause_stats_handle_input,
161 .fpUpdate = NULL,
162 .fpCleanup = &pause_stats_cleanup
163};
164
165
166#if VERSION_PAL
167INCLUDE_ASM(void, "pause/pause_stats", pause_stats_draw_contents);
168#else
169void pause_stats_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
170 StatsEntryData* statsEntryData;
171 PlayerData* playerData;
172 s16 bootsLevel;
173 s16 hammerLevel;
174 s32 powHudElemID;
175 s32 powIncrements;
176 s32 powIncIdx;
177 s32 curIncrement;
178 b32 drawingFirst;
179 s32 powBarIdx;
180 s32 boxWidth;
181 s16 level;
182 s32 frameCount;
183 s32 powFullBars;
184
185 // draw coin count
186 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_COIN], baseX + 143, baseY + 109);
188 draw_msg(pause_get_menu_msg(PAUSE_MSG_LBL_COINS), baseX + 155, baseY + 101, 255, MSG_PAL_STANDARD, 1);
189 draw_number(gPlayerData.coins, baseX + 281, baseY + 101 + NUMBER_OFFSET_Y, 1, MSG_PAL_STANDARD, 255, 3);
190 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_TIMES], baseX + 248, baseY + 108);
192
193 // draw star point count
194 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_STAR_POINT], baseX + 143, baseY + 94);
196 draw_msg(pause_get_menu_msg(PAUSE_MSG_LBL_STAR_POINTS), baseX + 155, baseY + 86, 255, MSG_PAL_STANDARD, 1);
197 draw_number(gPlayerData.starPoints, baseX + 281, baseY + 86 + NUMBER_OFFSET_Y, 1, MSG_PAL_STANDARD, 255, 3);
198 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_TIMES], baseX + 248, baseY + 93);
200
201 // draw star piece count
202 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_STAR_PIECE], baseX + 143, baseY + 123);
204 draw_msg(pause_get_menu_msg(PAUSE_MSG_LBL_STAR_PIECES), baseX + 155, baseY + 116, 255, MSG_PAL_STANDARD, 1);
205 draw_number(gPlayerData.starPieces, baseX + 281, baseY + 116 + NUMBER_OFFSET_Y, 1, MSG_PAL_STANDARD, 255, 3);
206 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_TIMES], baseX + 248, baseY + 123);
208
209 // draw HP count
210 pause_draw_menu_label(PAUSE_LBL_HP, baseX + 21, baseY + 35);
211 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_HP], baseX + 52, baseY + 57);
214 draw_number(gPlayerData.curHP, baseX + 78, baseY + 51, 1, 0, 255, 3);
216 draw_number(gPlayerData.curMaxHP, baseX + COL_C_X, baseY + ROW_2_Y + NUMBER_OFFSET_Y, 1, 0, 255, 3);
217
218 // draw FP count
219 pause_draw_menu_label(PAUSE_LBL_FP, baseX + 21, baseY + 69);
220 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_FP], baseX + 52, baseY + 92);
223 draw_number(gPlayerData.curFP, baseX + 78, baseY + 85, 1, MSG_PAL_WHITE, 255, 3);
226
227 // draw BP count
228 pause_draw_menu_label(PAUSE_LBL_BP, baseX + 21, baseY + 103);
229 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_BP], baseX + 52, baseY + 126);
232 draw_number(gPlayerData.maxBP, baseX + 78, baseY + 119, 1, MSG_PAL_WHITE, 255, 3);
233
234 #define MINUTE (60 * 60)
235 #define HOUR (MINUTE * 60)
236
237 // draw play time
238 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_CLOCK], baseX + 143, baseY + 140);
240 draw_msg(pause_get_menu_msg(PAUSE_MSG_LBL_TIME), baseX + 155, baseY + 133, 255, MSG_PAL_STANDARD, 1);
241 frameCount = gPlayerData.frameCounter;
242 if (frameCount >= (100 * HOUR)) {
243 frameCount = (100 * HOUR) - 1;
244 }
245 // draw hours
246 draw_number((frameCount / (10 * HOUR)) % 10, baseX + 237, baseY + 133 + NUMBER_OFFSET_Y, 1, MSG_PAL_STANDARD, 255, 2);
247 draw_number((frameCount / HOUR) % 10, baseX + 246, baseY + 133 + NUMBER_OFFSET_Y, 1, MSG_PAL_STANDARD, 255, 2);
248 draw_msg(pause_get_menu_msg(PAUSE_MSG_DOT), baseX + 257, baseY + 132, 255, MSG_PAL_STANDARD, 1);
249 draw_msg(pause_get_menu_msg(PAUSE_MSG_DOT), baseX + 257, baseY + 127, 255, MSG_PAL_STANDARD, 1);
250 // draw minutes
251 draw_number((frameCount / (10 * MINUTE)) % 6, baseX + 264, baseY + 133 + NUMBER_OFFSET_Y, 1, MSG_PAL_STANDARD, 255, 2);
252 draw_number((frameCount / MINUTE) % 10, baseX + 273, baseY + 133 + NUMBER_OFFSET_Y, 1, MSG_PAL_STANDARD, 255, 2);
253
254 bootsLevel = gPlayerData.bootsLevel;
255 hammerLevel = gPlayerData.hammerLevel;
256 level = gPlayerData.level;
257 draw_box(4, &gPauseWS_10, baseX + 7, baseY + 12, 0, level >= 10 ? 121 : 113, 17, 255, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
258
259 // draw level
260#if !VERSION_IQUE
261 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_MARIO], baseX + 61, baseY + 21);
263#endif
264 draw_msg(pause_get_menu_msg(PAUSE_MSG_MARIO), baseX + 16, baseY + 14, 255, MSG_PAL_WHITE, 1);
265 draw_msg(pause_get_menu_msg(PAUSE_MSG_LEVEL), baseX + POS_1_X, baseY + 14, 255, MSG_PAL_WHITE, 1);
266 draw_number(level, baseX + POS_2_X, baseY + 14 + NUMBER_OFFSET_Y, 1, MSG_PAL_WHITE, 255, 2);
267
268 bootsLevel++;
269 if (bootsLevel < 0) {
270 bootsLevel = 0;
271 }
272 if (bootsLevel > 3) {
273 bootsLevel = 3;
274 }
275
276 hammerLevel++;
277 if (hammerLevel < 0) {
278 hammerLevel = 0;
279 }
280 if (hammerLevel > 3) {
281 hammerLevel = 3;
282 }
283
284 pause_draw_menu_label(PAUSE_LBL_BOOTS, baseX + 137, baseY + 10);
285 pause_draw_menu_label(PAUSE_LBL_HAMMER, baseX + 137, baseY + 35);
286
287 // draw boots
288 hud_element_set_script(gPauseStatsIconIDs[STAT_ICON_BOOTS], gStatsBootsElements[bootsLevel]);
289 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_BOOTS], baseX + 163, baseY + 29);
291 draw_msg(pause_get_menu_msg(gPauseStatsBootsMessages[bootsLevel]), baseX + 176, baseY + 23, 255, MSG_PAL_WHITE, 1);
292
293 // draw hammer
294 hud_element_set_script(gPauseStatsIconIDs[STAT_ICON_HAMMER], gStatsHammerElements[hammerLevel]);
295 hud_element_set_render_pos(gPauseStatsIconIDs[STAT_ICON_HAMMER], baseX + 163, baseY + 54);
297 draw_msg(pause_get_menu_msg(gPauseStatsHammerMessages[hammerLevel]), baseX + 176, baseY + 48, 255, MSG_PAL_WHITE, 1);
298
299 // draw star power bar
300 pause_draw_menu_label(PAUSE_LBL_STATS, baseX + 130, baseY + 69);
301 pause_draw_menu_label(PAUSE_LBL_ENERGY, baseX + 138, baseY + 60);
302
303 drawingFirst = TRUE;
304 curIncrement = 0;
305 powBarIdx = 0; // which bar of the power meter we're drawing
306 powIncIdx = 0; // which increment of the bar we're drawing
307 powHudElemID = gPauseStatsIconIDs[STAT_ICON_STAR];
308
309 // get number of full power increments
310 playerData = &gPlayerData;
311 powFullBars = playerData->starPower / SP_PER_BAR;
312 powIncrements = playerData->starPower % SP_PER_BAR; // get remainder in unfilled bar
313 powIncrements /= SP_PER_SEG; // subdivide unfilled bar into 8 segments (8 = 256/32)
314 powIncrements += powFullBars * 8; // add 8 increments per full bar
315
316 // draw filled bars
317 while (TRUE) {
318 if (curIncrement >= powIncrements) {
319 break;
320 }
321
322 curIncrement++;
323 hud_element_set_script(powHudElemID, gPauseStatsSPIncElements[powBarIdx]);
324 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[0], baseY + 75);
325 if (drawingFirst) {
327 drawingFirst = FALSE;
328 } else {
329 hud_element_draw_next(powHudElemID);
330 }
331 powIncIdx++;
332
333 if (curIncrement >= powIncrements) {
334 break;
335 }
336
337 curIncrement++;
338 hud_element_set_script(powHudElemID, gPauseStatsSPIncElements[powBarIdx]);
339 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[1], baseY + 75);
340 if (drawingFirst) {
342 drawingFirst = FALSE;
343 } else {
344 hud_element_draw_next(powHudElemID);
345 }
346 powIncIdx++;
347
348 if (curIncrement >= powIncrements) {
349 break;
350 }
351
352 curIncrement++;
353 hud_element_set_script(powHudElemID, gPauseStatsSPIncElements[powBarIdx]);
354 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[2], baseY + 75);
355 if (drawingFirst) {
357 drawingFirst = FALSE;
358 } else {
359 hud_element_draw_next(powHudElemID);
360 }
361 powIncIdx++;
362
363 if (curIncrement >= powIncrements) {
364 break;
365 }
366
367 curIncrement++;
368 hud_element_set_script(powHudElemID, gPauseStatsSPIncElements[powBarIdx]);
369 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[3], baseY + 75);
370 if (drawingFirst) {
372 drawingFirst = FALSE;
373 } else {
374 hud_element_draw_next(powHudElemID);
375 }
376 powIncIdx++;
377
378 if (curIncrement >= powIncrements) {
379 break;
380 }
381
382 curIncrement++;
383 hud_element_set_script(powHudElemID, gPauseStatsSPIncElements[powBarIdx]);
384 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[4], baseY + 75);
385 if (drawingFirst) {
387 drawingFirst = FALSE;
388 } else {
389 hud_element_draw_next(powHudElemID);
390 }
391 powIncIdx++;
392
393 if (curIncrement >= powIncrements) {
394 break;
395 }
396
397 curIncrement++;
398 hud_element_set_script(powHudElemID, gPauseStatsSPIncElements[powBarIdx]);
399 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[5], baseY + 75);
400 if (drawingFirst) {
402 drawingFirst = FALSE;
403 } else {
404 hud_element_draw_next(powHudElemID);
405 }
406 powIncIdx++;
407
408 if (curIncrement >= powIncrements) {
409 break;
410 }
411
412 curIncrement++;
413 hud_element_set_script(powHudElemID, gPauseStatsSPIncElements[powBarIdx]);
414 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[6], baseY + 75);
415 if (drawingFirst) {
417 drawingFirst = FALSE;
418 } else {
419 hud_element_draw_next(powHudElemID);
420 }
421 powIncIdx++;
422
423 if (curIncrement >= powIncrements) {
424 break;
425 }
426
427 curIncrement++;
428 hud_element_set_script(powHudElemID, gPauseStatsStarElements[powBarIdx]);
429 hud_element_set_render_pos(powHudElemID, baseX + 152 + (powBarIdx * 20), baseY + 77);
430 if (drawingFirst) {
432 drawingFirst = FALSE;
433 } else {
434 hud_element_draw_next(powHudElemID);
435 }
436 powIncIdx++;
437
438 powIncIdx = 0;
439 powBarIdx += 1;
440 if (curIncrement >= powIncrements) {
441 break;
442 }
443 }
444
445 // get number of total power increments
446 powFullBars = playerData->maxStarPower;
447 powIncrements = 8 * powFullBars;
448
449 // draw empty bars
450 while (TRUE) {
451 if (curIncrement >= powIncrements) {
452 break;
453 }
454
455 if (powIncIdx == 0) {
456 curIncrement++;
458 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[0], baseY + 75);
459 if (drawingFirst) {
461 drawingFirst = FALSE;
462 } else {
463 hud_element_draw_next(powHudElemID);
464 }
465 if (curIncrement >= powIncrements) {
466 break;
467 }
468 powIncIdx++;
469 }
470
471 if (powIncIdx == 1) {
472 curIncrement++;
474 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[1], baseY + 75);
475 if (drawingFirst) {
477 drawingFirst = FALSE;
478 } else {
479 hud_element_draw_next(powHudElemID);
480 }
481 powIncIdx++;
482
483 if (curIncrement >= powIncrements) {
484 break;
485 }
486 }
487
488 if (powIncIdx == 2) {
489 curIncrement++;
491 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[2], baseY + 75);
492 if (drawingFirst) {
494 drawingFirst = FALSE;
495 } else {
496 hud_element_draw_next(powHudElemID);
497 }
498 powIncIdx++;
499
500 if (curIncrement >= powIncrements) {
501 break;
502 }
503 }
504
505 if (powIncIdx == 3) {
506 curIncrement++;
508 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[3], baseY + 75);
509 if (drawingFirst) {
511 drawingFirst = FALSE;
512 } else {
513 hud_element_draw_next(powHudElemID);
514 }
515 powIncIdx++;
516
517 if (curIncrement >= powIncrements) {
518 break;
519 }
520 }
521
522 if (powIncIdx == 4) {
523 curIncrement++;
525 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[4], baseY + 75);
526 if (drawingFirst) {
528 drawingFirst = FALSE;
529 } else {
530 hud_element_draw_next(powHudElemID);
531 }
532 powIncIdx++;
533
534 if (curIncrement >= powIncrements) {
535 break;
536 }
537 }
538
539 if (powIncIdx == 5) {
540 curIncrement++;
542 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[5], baseY + 75);
543 if (drawingFirst) {
545 drawingFirst = FALSE;
546 } else {
547 hud_element_draw_next(powHudElemID);
548 }
549 powIncIdx++;
550
551 if (curIncrement >= powIncrements) {
552 break;
553 }
554 }
555
556 if (powIncIdx == 6) {
557 curIncrement++;
559 hud_element_set_render_pos(powHudElemID, baseX + 140 + (powBarIdx * 20) + D_8024F46C[6], baseY + 75);
560 if (drawingFirst) {
562 drawingFirst = FALSE;
563 } else {
564 hud_element_draw_next(powHudElemID);
565 }
566 powIncIdx++;
567
568 if (curIncrement >= powIncrements) {
569 break;
570 }
571 }
572
573 if (powIncIdx == 7) {
574 curIncrement++;
576 hud_element_set_render_pos(powHudElemID, baseX + 152 + (powBarIdx * 20), baseY + 77);
577 if (drawingFirst) {
579 drawingFirst = FALSE;
580 } else {
581 hud_element_draw_next(powHudElemID);
582 }
583 powIncIdx++;
584
585 if (curIncrement >= powIncrements) {
586 break;
587 }
588 }
589 powIncIdx = 0;
590 powBarIdx++;
591 }
592
593 if (gPauseMenuCurrentTab == 1) {
595
596 pause_set_cursor_pos(WIN_PAUSE_STATS, baseX + entry->cursorX, baseY + entry->cursorY);
597 }
598}
599#endif
600
602 s32 i;
603
604 for (i = 0; i < ARRAY_COUNT(gPauseStatsIconIDs); i++) {
605 s32 iconID = hud_element_create(gStatsMenuElements[i]);
606
607 gPauseStatsIconIDs[i] = iconID;
609 }
610
611 for (i = 0; i < ARRAY_COUNT(gStatsMenuWindowBPs); i++) {
612 gStatsMenuWindowBPs[i].tab = panel;
613 }
614
616 panel->initialized = TRUE;
617}
618
620 s32 initialSelection = panel->selected;
621 s16 bootsMsgIdx;
622 s16 hammerMsgIdx;
623 s32 msgOffset;
624
626 while (TRUE) {
627 panel->col--;
628 if (panel->col < 0) {
629 panel->col = 0;
630 break;
631 } else if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
632 break;
633 }
634 }
635 }
636
638 while (TRUE) {
639 panel->col++;
640 if (panel->col >= panel->numCols) {
641 panel->col = panel->numCols - 1;
642 break;
643 } else if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
644 break;
645 }
646 }
647 }
648
650 while (TRUE) {
651 panel->row--;
652 if (panel->row < 0) {
653 panel->row = 0;
654 break;
655 } else if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
656 break;
657 }
658 }
659 }
660
662 while (TRUE) {
663 panel->row++;
664 if (panel->row >= panel->numRows) {
665 panel->row = panel->numRows - 1;
666 break;
667 } else if (panel->selected != MENU_PANEL_SELECTED_GRID_DATA(panel)) {
668 break;
669 }
670 }
671 }
672
674 if (panel->selected != initialSelection) {
676 }
677
678 msgOffset = 0;
679 bootsMsgIdx = gPlayerData.bootsLevel;
680 hammerMsgIdx = gPlayerData.hammerLevel;
681
682 bootsMsgIdx++;
683 if (bootsMsgIdx < 0) {
684 bootsMsgIdx = 0;
685 }
686 if (bootsMsgIdx > 3) {
687 bootsMsgIdx = 3;
688 }
689
690 hammerMsgIdx++;
691 if (hammerMsgIdx < 0) {
692 hammerMsgIdx = 0;
693 }
694 if (hammerMsgIdx > 3) {
695 hammerMsgIdx = 3;
696 }
697
698 switch (gStatsMenuEntries[panel->selected].baseMsgID) {
700 if (bootsMsgIdx > 1) {
701 msgOffset = bootsMsgIdx - 1;
702 }
703 break;
705 msgOffset = hammerMsgIdx;
706 break;
709 msgOffset = 1;
710 }
711 break;
712 }
713
716
720 }
721}
722
724 s32 i;
725
726 for (i = 0; i < ARRAY_COUNT(gPauseStatsIconIDs); i++) {
727 hud_element_free(gPauseStatsIconIDs[i]);
728 }
729}
s32 b32
#define draw_msg
#define draw_box
@ BUTTON_STICK_UP
Definition enums.h:2791
@ BUTTON_STICK_DOWN
Definition enums.h:2792
@ BUTTON_STICK_LEFT
Definition enums.h:2793
@ BUTTON_STICK_RIGHT
Definition enums.h:2794
@ BUTTON_B
Definition enums.h:2789
@ WINDOW_PRIORITY_0
Definition enums.h:3182
@ MSG_PAL_WHITE
Definition enums.h:5405
@ MSG_PAL_STANDARD
Definition enums.h:5415
@ WINDOW_UPDATE_HIDE
Definition enums.h:5312
@ SOUND_MENU_BACK
Definition enums.h:701
@ SOUND_MENU_CHANGE_SELECTION
Definition enums.h:698
@ WIN_PAUSE_MAIN
Definition enums.h:5263
@ WIN_PAUSE_STATS
Definition enums.h:5274
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
void setup_pause_menu_tab(MenuWindowBP *bpArray, s32 arraySize)
Definition windows.c:461
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2223
HudScript HES_StatusSPIncrement6
HudScript HES_StatusSPIncrement4
HudScript HES_StatusStar1
HudScript HES_StatusSPIncrement3
HudScript HES_StatusStarEmpty
HudScript HES_StatusStarPoint
HudScript HES_StatusStar2
HudScript HES_StatusStar3
HudScript HES_StatusSPIncrement7
HudScript HES_StatusCoin
HudScript HES_StatusStar7
HudScript HES_StatusStar5
HudScript HES_StatusSPIncrement5
HudScript HES_StatusSPIncrement2
HudScript HES_StatusStar6
HudScript HES_StatusHeart
HudScript HES_StatusStar4
HudScript HES_StatusSPEmptyIncrement
HudScript HES_StatusSPIncrement1
void hud_element_draw_without_clipping(s32 id)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_draw_next(s32 id)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
void hud_element_free(s32 id)
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
s32 HudScript[]
Definition hud_element.h:9
#define INCLUDE_ASM(TYPE, FOLDER, NAME, ARGS...)
Definition include_asm.h:21
HudScript HES_MarioHeadSmall
HudScript HES_StatBoots3
HudScript HES_StatHammer3
HudScript HES_StatHammer1
HudScript HES_StatBoots1
HudScript HES_Clock
HudScript HES_StatBoots0
HudScript HES_StatFp_1
HudScript HES_StatBoots2
HudScript HES_StatHammer0
HudScript HES_StatBp
HudScript HES_StatStarPiece_1
HudScript HES_StatHammer2
HudScript HES_StatTimes
s32 gPausePressedButtons
Definition pause_main.c:24
HudScript * gPauseCurrentDescIconScript
Definition pause_main.c:26
s32 pause_get_menu_msg(s32 index)
Definition pause_gfx.c:583
@ PAUSE_MSG_TIP_BP
@ PAUSE_MSG_TIP_FP
@ PAUSE_MSG_LBL_TIME
@ PAUSE_MSG_LBL_STAR_PIECES
@ PAUSE_MSG_TIP_BOOTS_1
@ PAUSE_MSG_LBL_FP
@ PAUSE_MSG_TIP_STAR_POINTS
@ PAUSE_MSG_3F
@ PAUSE_MSG_40
@ PAUSE_MSG_3E
@ PAUSE_MSG_TIP_TIME
@ PAUSE_MSG_TIP_HAMMER_0
@ PAUSE_MSG_LBL_HP
@ PAUSE_MSG_LBL_COINS
@ PAUSE_MSG_TIP_SECRETS
@ PAUSE_MSG_41
@ PAUSE_MSG_LEVEL
@ PAUSE_MSG_TIP_HP
@ PAUSE_MSG_LBL_BP
@ PAUSE_MSG_SLASH
@ PAUSE_MSG_42
@ PAUSE_MSG_LBL_STAR_POINTS
@ PAUSE_MSG_3D
@ PAUSE_MSG_TIP_CONTROLS
@ PAUSE_MSG_MARIO
@ PAUSE_MSG_3C
@ PAUSE_MSG_TIP_STAR_POWER
@ PAUSE_MSG_DOT
@ PAUSE_MSG_TIP_COINS
@ PAUSE_MSG_3B
s32 gPauseHeldButtons
Definition pause_main.c:23
s8 gPauseMenuCurrentTab
Definition pause_main.c:28
void pause_draw_menu_label(s32 index, s32 x, s32 y)
Definition pause_gfx.c:587
WindowStyleCustom gPauseWS_12
void pause_set_cursor_pos(s32 windowID, s32 posX, s32 posY)
Definition pause_main.c:228
WindowStyleCustom gPauseWS_10
@ PAUSE_LBL_ENERGY
@ PAUSE_LBL_BOOTS
@ PAUSE_LBL_HAMMER
@ PAUSE_LBL_HP
@ PAUSE_LBL_STATS
@ PAUSE_LBL_BP
@ PAUSE_LBL_FP
s32 gPauseCurrentDescMsg
Definition pause_main.c:25
#define ROW_1_Y
Definition pause_stats.c:23
void pause_stats_cleanup(MenuPanel *panel)
#define STAR_POWER_X
Definition pause_stats.c:94
#define NUMBER_OFFSET_Y
Definition pause_stats.c:22
#define COLLECTABLES_X
Definition pause_stats.c:95
s32 gPauseStatsHammerMessages[]
Definition pause_stats.c:79
#define HOUR
#define COL_C_X
Definition pause_stats.c:29
MenuPanel gPausePanelStats
HudScript * gStatsBootsElements[]
Definition pause_stats.c:76
void pause_stats_init(MenuPanel *panel)
void pause_stats_handle_input(MenuPanel *panel)
StatsEntryData gStatsMenuEntries[]
Definition pause_stats.c:99
#define ROW_4_Y
Definition pause_stats.c:26
#define COL_A_X
Definition pause_stats.c:27
s32 gPauseStatsBootsMessages[]
Definition pause_stats.c:78
#define POS_2_X
Definition pause_stats.c:31
#define POS_1_X
Definition pause_stats.c:30
HudScript * gPauseStatsStarElements[]
s32 D_8024F46C[]
#define MINUTE
#define COL_B_X
Definition pause_stats.c:28
#define ROW_3_Y
Definition pause_stats.c:25
HudScript * gStatsMenuElements[]
Definition pause_stats.c:56
#define ROW_2_Y
Definition pause_stats.c:24
void pause_stats_draw_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
MenuWindowBP gStatsMenuWindowBPs[]
HudScript * gStatsHammerElements[]
Definition pause_stats.c:77
@ STAT_ICON_BP
Definition pause_stats.c:51
@ STAT_ICON_FP
Definition pause_stats.c:50
@ STAT_ICON_HAMMER
Definition pause_stats.c:44
@ STAT_ICON_STAR
Definition pause_stats.c:52
@ STAT_ICON_BOOTS
Definition pause_stats.c:43
@ STAT_ICON_HP
Definition pause_stats.c:49
@ STAT_ICON_TIMES
Definition pause_stats.c:53
@ STAT_ICON_CLOCK
Definition pause_stats.c:48
@ STAT_ICON_STAR_POINT
Definition pause_stats.c:46
@ STAT_ICON_STAR_PIECE
Definition pause_stats.c:47
@ STAT_ICON_COIN
Definition pause_stats.c:45
@ STAT_ICON_MARIO
Definition pause_stats.c:42
s8 gPauseStatsGridData[]
Definition pause_stats.c:80
HudScript * gPauseStatsSPIncElements[]
void sfx_play_sound(s32 soundID)
Definition sfx.c:517
@ GF_Tutorial_GotStarPiece
#define SCREEN_WIDTH
Definition macros.h:105
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define SCREEN_HEIGHT
Definition macros.h:106
#define SP_PER_SEG
Definition macros.h:103
#define SP_PER_BAR
Definition macros.h:102
#define MENU_PANEL_SELECTED_GRID_DATA(panel)
Definition macros.h:76
MenuPanel * tab
PlayerData gPlayerData
Definition 77480.c:40