Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
pause_badges.c
Go to the documentation of this file.
1#include "pause_common.h"
2#include "message_ids.h"
3
4extern Gfx PauseGfxOrbs[];
5
6void pause_badges_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening);
11
12static s16 gPauseBadgesItemIds[128];
13static s32 gPauseBadgesCurrentPage;
14#if !VERSION_IQUE
15static s32 D_80270284;
16#endif
17static PauseItemPage gPauseBadgesPages[20];
18static s32 gPauseBadgesSelectedIndex;
19static s32 D_8027037C;
20static s32 gPauseBadgesSelectedItem;
21static s16 gPauseBadgesNumItems;
22static s32 D_80270388;
23static s32 gPauseBadgesCurrentScrollPos;
24static s32 gPauseBadgesTargetScrollPos;
25static s32 gPauseBadgesTargetScrollIndex;
26static s32 gPauseBadgesLevel;
27static s32 gPauseBadgesCurrentTab;
28static s32 gPauseBadgesShowNotEnoughBP;
29#if !VERSION_IQUE
30static s32 D_802703A4;
31#endif
32static s32 gPauseBadgesIconIDs[22];
33
34// Fake "badge" for the None entry that appears on the equipped badges page when nothing is equipped
35#define BADGE_NONE_STANDIN 0x7FFE
36// Invalid badge ID filled in unused slots of gPauseBadgesItemIds
37#define BADGE_INVALID 0x7FFF
38
39// return value of pause_badges_try_remove if the player tried to remove a negative bp badge while not having enough remaining bp
40#define TRY_REMOVE_NOT_ENOUGH_BP_RESULT -1
41
42#if VERSION_IQUE
43#define OFFSET_1_X 47
44#define OFFSET_1_Y 82
45#define OFFSET_2_X 10
46#define OFFSET_3_X 73
47#define OFFSET_3_Y 76
48#else
49#define OFFSET_1_X 43
50#define OFFSET_1_Y 81
51#define OFFSET_2_X 16
52#define OFFSET_3_X 69
53#define OFFSET_3_Y 74
54#endif
55
92
93#if VERSION_PAL
94extern u8 D_PAL_80271B2C[];
95#endif
96
98 {
100 .unk_01 = 0,
101 .pos = { .x = 3, .y = 16 },
102 .width = 289,
103 .height = 154,
104 .priority = WINDOW_PRIORITY_1,
105 .fpDrawContents = &pause_badges_draw_contents,
106 .tab = NULL,
107 .parentID = WIN_PAUSE_MAIN,
108 .fpUpdate = { WINDOW_UPDATE_HIDE },
109 .extraFlags = 0,
110 .style = { .customStyle = &gPauseWS_16 }
111 }
112};
114 .initialized = FALSE,
115 .col = 0,
116 .row = 0,
117 .selected = 0,
118 .state = 0,
119 .numCols = 0,
120 .numRows = 0,
121 .numPages = 0,
122 .gridData = NULL,
123 .fpInit = &pause_badges_init,
124 .fpHandleInput = &pause_badges_handle_input,
125 .fpUpdate = &pause_badges_update,
126 .fpCleanup = &pause_badges_cleanup
127};
128
129s32 pause_badges_comparator(s16* a, s16* b) {
130 s16 aVal;
131 s16 bVal;
132
133 if (*a == 0) {
134 aVal = BADGE_INVALID;
135 } else {
136 aVal = gItemTable[*a].sortValue;
137 }
138
139 if (*b == 0) {
140 bVal = BADGE_INVALID;
141 } else {
142 bVal = gItemTable[*b].sortValue;
143 }
144
145 if (aVal == bVal) {
146 return 0;
147 } else if (aVal < bVal) {
148 return -1;
149 } else {
150 return 1;
151 }
152}
153
155 PlayerData* playerData = &gPlayerData;
156 s32 i;
157
159
160 for (i = 0; i < ARRAY_COUNT(playerData->badges); i++) {
161 if (playerData->badges[i] == 0) {
162 break;
163 }
164 }
165
166 return i;
167}
168
170 PlayerData* playerData = &gPlayerData;
171 s32 i;
172
174
175 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
176 if (playerData->equippedBadges[i] == 0) {
177 break;
178 }
179 }
180
181 return i;
182}
183
184s32 pause_badges_get_pos_x(s32 page, s32 itemIndex) {
185 return (itemIndex % BADGE_MENU_PAGE(page)->numCols) * 141;
186}
187
188s32 pause_badges_get_pos_y(s32 page, s32 itemIndex) {
189 return ((page + 1) * 11) + (BADGE_MENU_PAGE(page)->listStart * 16) + ((itemIndex / BADGE_MENU_PAGE(
190 page)->numCols) * 16);
191}
192
193s32 pause_badges_get_column(s32 page, s32 itemIdx) {
194 return itemIdx % BADGE_MENU_PAGE(page)->numCols;
195}
196
197s32 pause_badges_get_row(s32 page, s32 itemIdx) {
198 return BADGE_MENU_PAGE(page)->listStart + (itemIdx / BADGE_MENU_PAGE(page)->numCols);
199}
200
202 if (y < gPauseBadgesCurrentScrollPos - 32) {
203 return FALSE;
204 } else {
205 return y < gPauseBadgesCurrentScrollPos + 128;
206 }
207}
208
210 return offset - gPauseBadgesCurrentScrollPos;
211}
212
214 return x;
215}
216
217s32 pause_badges_try_remove(s16 badgeID) {
218 s16 *currentSlot = gPlayerData.equippedBadges;
219 s16 *slotToRemove = currentSlot;
220 s32 result = 0;
221 s32 i;
222 s32 bpCost;
223
224 if (badgeID == BADGE_INVALID) {
225 return 0;
226 }
227
228 // handle negative bp cost badges
229 bpCost = gMoveTable[gItemTable[badgeID].moveID].costBP;
230 if (bpCost < 0 && gPlayerData.maxBP < pause_get_total_equipped_bp_cost() - bpCost) {
232 }
233
234 for (i = 0; i < ARRAY_COUNT(gPlayerData.equippedBadges); i++, currentSlot++) {
235 if (badgeID == *currentSlot) {
236 slotToRemove = currentSlot;
237 result = 1;
238 break;
239 }
240 }
241
242 // Remove and shift array contents
243 for (; i < ARRAY_COUNT(gPlayerData.equippedBadges) - 1; i++, currentSlot++) {
244 *currentSlot = *(currentSlot + 1);
245 }
246 *currentSlot = 0;
247
248 if (*slotToRemove == 0) {
249 result = 2;
250 }
251 return result;
252}
253
260
261s32 pause_badges_try_equip(s16 badgeID) {
262 PlayerData* playerData = &gPlayerData;
263 s16 *badgeSlot = &playerData->equippedBadges[0];
264 s32 i;
265 s32 totalEquippedBP;
266
267 if (badgeID == BADGE_NONE_STANDIN) {
268 badgeID = 0;
269 }
270 if (badgeID == BADGE_INVALID) {
271 badgeID = 0;
272 }
273 if (badgeID == 0) {
275 }
276
277 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++, badgeSlot++) {
278 if (*badgeSlot == badgeID) {
280 }
281 }
282
283 totalEquippedBP = pause_get_total_equipped_bp_cost();
284 if (badgeID != 0) {
285 u8 moveID = gItemTable[badgeID].moveID;
286 s32 requiredBP = totalEquippedBP + gMoveTable[moveID].costBP;
287
288 if (playerData->maxBP < requiredBP) {
290 }
291 }
292
293 badgeSlot = &playerData->equippedBadges[0];
294 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++, badgeSlot++) {
295 if (*badgeSlot == 0) {
296 *badgeSlot = badgeID;
297 break;
298 }
299 }
300 if (i == ARRAY_COUNT(playerData->equippedBadges)) {
302 } else {
304 }
305}
306
307void pause_badges_draw_bp_orbs(s32 orbState, s32 x, s32 y) {
308 s32 orbSize = 8;
309
310 switch (orbState) {
311 case 0:
312 pause_draw_rect(x * 4, y * 4, (x + orbSize) * 4, (y + orbSize) * 4, 0, 0, 256, 1024, 1024);
313 break;
314 case 1:
315 pause_draw_rect(x * 4, y * 4, (x + orbSize) * 4, (y + orbSize) * 4, 0, 0, 0, 1024, 1024);
316 break;
317 default:
318 pause_draw_rect(x * 4, y * 4, (x + orbSize) * 4, (y + orbSize) * 4, 0, 0, 512, 1024, 1024);
319 break;
320 }
321}
322
323void pause_badges_draw_contents(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
324 s32 pageIndex, i;
325 s32 badgeIndex;
326 s32 currentBadgeRow;
327 s32 currentBadgeColumn;
328 s32 style;
329 s32 palette;
330 s32 bpAvailable;
331 s32 costBP;
332 s32 canBeEquipped;
333 PauseItemPage* page;
334 s32 badgeListX;
335 s32 badgeListY;
336 s32 isEquipped;
337 s32 isNone;
338 s32 cannotBeEquipped;
339 s32 x1, y1, x2, y2;
340 s16 badgeID;
341 s32 isSelected;
342 s32 badgeEntryOffsetX, badgeEntryOffsetY;
343 s32 posX, posY, cursorOffsetX, cursorOffsetY, selectedPosX, selectedPosY;
344 s32 orbOffsetY;
345 s32 numOrbs;
346 s32 orbY, orbX;
347 s32 bpAmount;
348 s32 bpAvailOffsetX;
349 s32 bpAvailOffsetY;
350 f32 orbBlinkValue;
351 s32 orbBlinkOpacity;
352 s32 orbColorR, orbColorG, orbColorB;
353 s32 orbColorR1, orbColorG1, orbColorB1;
354 s32 badgeIconElement;
355 s32 msg;
356 s32 msgX, msgY;
357 s32 msgOpacity;
358 s32 maxBP;
359 s32 itemIndex, j;
360 s16* equippedBadges;
361 s32 itemID;
362 s32 orbIndex;
363 s32* iconIDs;
364 PlayerData* playerData = &gPlayerData;
365 PauseItemPage* currentPage = &gPauseBadgesPages[gPauseBadgesCurrentPage];
366 s32 bpAmountX;
367 s32 msg2;
368
369 costBP = 0;
370 canBeEquipped = FALSE;
371 style = DRAW_MSG_STYLE_MENU;
373 currentBadgeColumn = gPauseBadgesSelectedIndex / currentPage->numCols;
374 currentBadgeRow = gPauseBadgesSelectedIndex % currentPage->numCols;
375
376 draw_box(DRAW_FLAG_NO_CLIP, &gPauseWS_15, baseX + 84, baseY, 0, width - 84, height, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
377 hud_element_set_render_pos(gPauseBadgesIconIDs[20], baseX + 241, baseY + 11);
378 palette = MSG_PAL_STANDARD;
379 hud_element_draw_without_clipping(gPauseBadgesIconIDs[20]);
380
381 x1 = baseX + 1;
382 y1 = baseY + 14;
383 x2 = baseX + width - 1;
384 y2 = baseY + height - 9;
385
386 if (x1 <= 0) {
387 x1 = 1;
388 }
389 if (y1 <= 0) {
390 y1 = 1;
391 }
392
393 if (x2 <= 0 || y2 <= 0 || x1 >= SCREEN_WIDTH - 1 || y1 >= SCREEN_HEIGHT - 1) {
394 return;
395 }
396
397 if (x2 >= SCREEN_WIDTH - 1) {
398 x2 = SCREEN_WIDTH - 1;
399 }
400 if (y2 >= SCREEN_HEIGHT - 1) {
401 y2 = SCREEN_HEIGHT - 1;
402 }
403 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2);
404
405 badgeIndex = 0;
406 for (i = 0; i < 3; i++) {
407 for (pageIndex = 0; pageIndex < 20; pageIndex++) {
408 iconIDs = gPauseBadgesIconIDs;
409 badgeListX = baseX + 119;
410 badgeListY = baseY + 17;
411
412 page = &gPauseBadgesPages[pageIndex];
413 if (!page->enabled) {
414 break;
415 }
416
417 pause_badges_get_pos_y(pageIndex, 0);
418
419 for (itemIndex = 0; itemIndex < page->count; itemIndex++) {
420 badgeID = gPauseBadgesItemIds[page->startIndex + itemIndex];
421 isEquipped = FALSE;
422 isSelected = FALSE;
423 equippedBadges = gPlayerData.equippedBadges;
424 cannotBeEquipped = FALSE;
425 if (badgeID == BADGE_INVALID) {
426 continue;
427 }
428
429 posX = pause_badges_get_pos_x(pageIndex, itemIndex);
430 posY = pause_badges_get_pos_y(pageIndex, itemIndex);
431 isNone = badgeID == BADGE_NONE_STANDIN;
432
433 for (j = 0; j < ARRAY_COUNT(gPlayerData.equippedBadges); equippedBadges++, j++) {
434 if (badgeID == *equippedBadges) {
435 isEquipped = TRUE;
436 break;
437 }
438 }
439
440 if (gPauseMenuCurrentTab == 2 &&
441 gPauseBadgesLevel == 1 &&
442 pause_badges_get_column(pageIndex, itemIndex) == currentBadgeRow &&
443 pause_badges_get_row(pageIndex, itemIndex) == currentBadgeColumn) {
444 itemID = badgeID;
445 isSelected = TRUE;
446 if (!isNone) {
447 costBP = gMoveTable[gItemTable[itemID].moveID].costBP;
448 if (!isEquipped && bpAvailable >= costBP) {
449 canBeEquipped = TRUE;
450 }
451 }
452 }
453
454 if (!isNone && bpAvailable < gMoveTable[gItemTable[badgeID].moveID].costBP) {
455 cannotBeEquipped = TRUE;
456 }
457
458 badgeEntryOffsetX = 0;
459 badgeEntryOffsetY = 0;
460 if (isSelected) {
461 badgeEntryOffsetX = -1;
462 badgeEntryOffsetY = -1;
463 }
464
465 if (i == 0) {
466 style = DRAW_MSG_STYLE_MENU;
467 palette = MSG_PAL_STANDARD;
468 if (isSelected) {
470 }
471
472 if (isEquipped) {
474 baseY + pause_badges_scroll_offset_y(posY) + 17, 0, 200, 13, 255, 0, 0, 0, 0, 0,
475 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
476 } else if (cannotBeEquipped) {
477 palette = MSG_PAL_0B;
478 }
479 }
480
481 if (!pause_badges_is_visible(posY)) {
482 continue;
483 }
484
485 if (i == 0) {
486 if (isNone) {
487 draw_msg(pause_get_menu_msg(PAUSE_MSG_NO_BADGE), badgeListX + pause_badges_scroll_offset_x(posX) + badgeEntryOffsetX,
488 badgeListY + pause_badges_scroll_offset_y(posY) + badgeEntryOffsetY, 255, palette, style);
489 } else {
490 if (gItemTable[badgeID].nameMsg) {
491 if (gItemTable[badgeID].nameMsg > 0) {
492 draw_msg(gItemTable[badgeID].nameMsg, badgeListX + pause_badges_scroll_offset_x(posX) + badgeEntryOffsetX,
493 badgeListY + pause_badges_scroll_offset_y(posY) + badgeEntryOffsetY, 255, palette, style);
494 }
495 }
496 draw_number(gMoveTable[gItemTable[badgeID].moveID].costBP, baseX + 235 + pause_badges_scroll_offset_x(posX),
498 }
499 }
500
501 if (i == 1) {
502 badgeIconElement = iconIDs[badgeIndex];
505 if (isNone) {
506 badgeIconElement = gPauseBadgesIconIDs[21];
507 } else {
508 if (isSelected) {
511 }
512
513 if (!isEquipped && cannotBeEquipped) {
514 hud_element_set_script(badgeIconElement, gItemHudScripts[gItemTable[badgeID].hudElemID].disabled);
515 } else {
516 hud_element_set_script(badgeIconElement, gItemHudScripts[gItemTable[badgeID].hudElemID].enabled);
517 }
518
519 hud_element_set_scale(badgeIconElement, 0.670816f);
520 }
521
522 hud_element_set_render_pos(badgeIconElement, baseX + 107 + pause_badges_scroll_offset_x(posX) + badgeEntryOffsetX,
523 baseY + 23 + pause_badges_scroll_offset_y(posY) + badgeEntryOffsetY);
524 if (badgeIndex == 0) {
525 hud_element_draw_without_clipping(badgeIconElement);
526 } else {
527 hud_element_draw_next(badgeIconElement);
528 }
529
530 badgeIndex++;
531 }
532
533 if (i == 2 && !isNone) {
534 numOrbs = gMoveTable[gItemTable[badgeID].moveID].costBP;
535 orbOffsetY = 1;
536 if (numOrbs < 11) {
537 orbOffsetY = 4;
538 }
539
540 orbColorR1 = 0;
541 orbColorG1 = 255;
542 orbColorB1 = 100;
543
544 gSPDisplayList(gMainGfxPos++, PauseGfxOrbs);
545 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
546
547 if (isEquipped == 0) {
548 for (j = 0; j < numOrbs; j++) {
549 gDPSetPrimColor(gMainGfxPos++, 0, 0, 227, 227, 227, 255);
550 orbX = baseX + 235 + pause_badges_scroll_offset_x(posX) + 1 + (j % 5) * 6;
551 orbY = baseY + 17 + pause_badges_scroll_offset_y(posY) + orbOffsetY;
552 if (numOrbs > 5) {
553 orbY += j / 5 * 6 - 3;
554 }
555 pause_badges_draw_bp_orbs(0, orbX, orbY);
556 }
557
558 gDPPipeSync(gMainGfxPos++);
559 gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
560 gDPSetPrimColor(gMainGfxPos++, 0, 0, orbColorR1, orbColorG1, orbColorB1, 128);
561
562 for (j = 0; j < numOrbs; j++) {
563 if (j < bpAvailable) {
564 orbX = baseX + 235 + pause_badges_scroll_offset_x(posX) + 1 + (j % 5) * 6;
565 orbY = baseY + 17 + pause_badges_scroll_offset_y(posY) + orbOffsetY;
566 if (numOrbs > 5) {
567 orbY += j / 5 * 6 - 3;
568 }
569 pause_badges_draw_bp_orbs(1, orbX, orbY);
570 }
571 }
572 } else {
573 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 255, 100, 255);
574 for (j = 0; j < numOrbs; j++) {
575 orbX = baseX + 235 + pause_badges_scroll_offset_x(posX) + 1 + (j % 5) * 6;
576 orbY = baseY + 17 + pause_badges_scroll_offset_y(posY) + orbOffsetY;
577 if (numOrbs > 5) {
578 orbY += j / 5 * 6 - 3;
579 }
580 pause_badges_draw_bp_orbs(2, orbX, orbY);
581 }
582 gDPPipeSync(gMainGfxPos++);
583 }
584 }
585 }
586 }
587 }
588
589 x1 = baseX + 1;
590 y1 = baseY + 1;
591 x2 = baseX + width - 1;
592 y2 = baseY + height - 1;
593 gDPPipeSync(gMainGfxPos++);
594
595 if (x1 <= 0) {
596 x1 = 1;
597 }
598 if (y1 <= 0) {
599 y1 = 1;
600 }
601
602 if (x2 <= 0 || y2 <= 0 || x1 >= SCREEN_WIDTH - 1 || y1 >= SCREEN_HEIGHT - 1) {
603 return;
604 }
605
606 if (x2 >= SCREEN_WIDTH - 1) {
607 x2 = SCREEN_WIDTH - 1;
608 }
609 if (y2 >= SCREEN_HEIGHT - 1) {
610 y2 = SCREEN_HEIGHT - 1;
611 }
612
613 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2);
614
615 if (gPauseMenuCurrentTab == 2 && gPauseBadgesLevel == 1) {
616 if (gPauseBadgesCurrentPage > 0) {
617 hud_element_set_render_pos(gPauseBadgesIconIDs[17], baseX + 278, baseY + 14);
618 hud_element_draw_without_clipping(gPauseBadgesIconIDs[17]);
619 }
620
621 if (gPauseBadgesPages[gPauseBadgesCurrentPage + 1].enabled) {
622 hud_element_set_render_pos(gPauseBadgesIconIDs[18], baseX + 278, baseY + 146);
623 hud_element_draw_without_clipping(gPauseBadgesIconIDs[18]);
624 }
625 }
626
627 hud_element_set_render_pos(gPauseBadgesIconIDs[16], baseX + OFFSET_1_X, baseY + OFFSET_1_Y);
628 hud_element_draw_without_clipping(gPauseBadgesIconIDs[16]);
631 bpAmount = playerData->maxBP - pause_get_total_equipped_bp_cost();
632 bpAvailOffsetX = 0;
633 bpAvailOffsetY = (playerData->maxBP - 1) / 10 * 8;
634 if (bpAmount < 10) {
635 bpAvailOffsetX = -4;
636 }
637 pause_draw_menu_label(PAUSE_LBL_AVAILABLE, baseX + 12, baseY + 100 + bpAvailOffsetY);
638
639#if VERSION_PAL
640 bpAmountX = baseX + (73 + bpAvailOffsetX);
642 bpAmountX += 8;
643 }
644#else
645 bpAmountX = baseX + 73 + bpAvailOffsetX;
646#endif
647
648 draw_number(bpAmount, bpAmountX, baseY + 100 + bpAvailOffsetY, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_STANDARD, 255,
650
651 orbColorR = 0;
652 orbColorG = 255;
653 orbColorB = 100;
654 maxBP = playerData->maxBP;
655 gSPDisplayList(gMainGfxPos++, PauseGfxOrbs);
656 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
657 for (orbIndex = 0; orbIndex < maxBP; orbIndex++) {
658 gDPSetPrimColor(gMainGfxPos++, 0, 0, 227, 227, 227, 255);
659 pause_badges_draw_bp_orbs(0, baseX + 11 + (orbIndex % 10) * 6, baseY + 92 + (orbIndex / 10) * 8);
660 }
661
662 gDPPipeSync(gMainGfxPos++);
663 if (canBeEquipped) {
664 gDPSetPrimColor(gMainGfxPos++, 0, 0, orbColorR, orbColorG, orbColorB, 255);
665 for (orbIndex = 0; orbIndex < bpAvailable - costBP; orbIndex++) {
666 pause_badges_draw_bp_orbs(2, baseX + 11 +(orbIndex % 10) * 6, baseY + 92 + (orbIndex / 10) * 8);
667 }
668
669 gDPPipeSync(gMainGfxPos++);
670 orbBlinkValue = (sin_deg(gGameStatusPtr->frameCounter * 15) + 1.0f) * 0.2 + 0.5;
671 gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
672
673 orbBlinkOpacity = orbBlinkValue * 255.0f;
674 gDPSetPrimColor(gMainGfxPos++, 0, 0, orbColorR, orbColorG, orbColorB, orbBlinkOpacity);
675
676 for (orbIndex = bpAvailable - costBP; orbIndex < bpAvailable; orbIndex++) {
677 pause_badges_draw_bp_orbs(2, baseX + 11 +(orbIndex % 10) * 6, baseY + 92 + (orbIndex / 10) * 8);
678 }
679 gDPPipeSync(gMainGfxPos++);
680 } else {
681 gDPSetPrimColor(gMainGfxPos++, 0, 0, orbColorR, orbColorG, orbColorB, 255);
682 for (orbIndex = 0; orbIndex < bpAvailable; orbIndex++) {
683 pause_badges_draw_bp_orbs(2, baseX + 11 + (orbIndex % 10) * 6, baseY + 92 + (orbIndex / 10) * 8);
684 }
685 gDPPipeSync(gMainGfxPos++);
686 }
687
688 draw_box(DRAW_FLAG_NO_CLIP, &gPauseWS_13, gPauseBadgesCurrentTab == 0 ? baseX + 9 : baseX, baseY + 7, 0,
689 91, 34, 255, gPauseBadgesCurrentTab == 1 ? 128 : 0, 0, 0,
690 0, 0, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
691
692#if VERSION_PAL
693 if (gCurrentLanguage < 2) {
695 msgX = baseX + 10;
696 if (gPauseBadgesCurrentTab == 0) {
697 msgX = baseX + 19;
698 }
699 msgOpacity = 255;
700 msgY = baseY + 17;
701 if (gPauseBadgesCurrentTab == 1) {
702 msgOpacity = 191;
703 }
704 draw_msg(msg2, msgX, msgY, msgOpacity, 0, 1);
705 } else {
707 msgX = baseX + 12;
708 if (gPauseBadgesCurrentTab == 0) {
709 msgX = baseX + 21;
710 }
711 draw_msg(msg2, msgX, baseY + 12, gPauseBadgesCurrentTab == 1 ? 191 : 255, 0, 1);
712
713 msg = pause_get_menu_msg(PAUSE_MSG_PAL_42);
714 msgX = baseX + 24;
715 if (gCurrentLanguage == 2) {
716 msgX = baseX + 26;
717 }
718 if (gPauseBadgesCurrentTab == 0) {
719 msgX += 9;
720 }
721 msgY = baseY + 22;
722 msgOpacity = 255;
723 if (gPauseBadgesCurrentTab == 1) {
724 msgOpacity = 191;
725 }
726 draw_msg(msg, msgX, msgY, msgOpacity, 0, 1);
727 }
728
729 draw_box(4, &gPauseWS_13, gPauseBadgesCurrentTab == 1 ? baseX + 9 : baseX, baseY + 37, 0, 91, 34, 255,
730 gPauseBadgesCurrentTab != 0 ? 0 : 128, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL,
732
734 msgX = baseX + 12;
735 if (gPauseBadgesCurrentTab == 1) {
736 msgX = baseX + 21;
737 }
738 draw_msg(msg2, msgX, baseY + 42, gPauseBadgesCurrentTab == 0 ? 191 : 255, 0, 1);
739
740 draw_msg(pause_get_menu_msg(PAUSE_MSG_BADGES), (gPauseBadgesCurrentTab == 1) ? baseX + D_PAL_80271B2C[gCurrentLanguage] + 9 :baseX + D_PAL_80271B2C[gCurrentLanguage], baseY + 52, gPauseBadgesCurrentTab == 0 ? 191 : 255, 0, 1);
741#else
743 msgX = baseX + 10;
744 if (gPauseBadgesCurrentTab == 0) {
745 msgX = baseX + 19;
746 }
747 msgOpacity = 255;
748 msgY = baseY + 17;
749 if (gPauseBadgesCurrentTab == 1) {
750 msgOpacity = 191;
751 }
752 draw_msg(msg, msgX, msgY, msgOpacity, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
753
754 draw_box(DRAW_FLAG_NO_CLIP, &gPauseWS_13, gPauseBadgesCurrentTab == 1 ? baseX + 9 : baseX, baseY + 37, 0, 91, 34, 255,
755 gPauseBadgesCurrentTab == 0 ? 128 : 0, 0, 0, 0, 0, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
756
758 msgX = baseX + 12;
759 if (gPauseBadgesCurrentTab == 1) {
760 msgX = baseX + 21;
761 }
762 msgY = baseY + 42;
763 msgOpacity = 255;
764 if (gPauseBadgesCurrentTab == 0) {
765 msgOpacity = 191;
766 }
767 draw_msg(msg, msgX, msgY, msgOpacity, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
768
770 msgX = baseX + 26;
771 if (gPauseBadgesCurrentTab == 1) {
772 msgX = baseX + 35;
773 }
774 msgY = baseY + 52;
775 msgOpacity = 255;
776 if (gPauseBadgesCurrentTab == 0) {
777 msgOpacity = 191;
778 }
779 draw_msg(msg, msgX, msgY, msgOpacity, MSG_PAL_WHITE, DRAW_MSG_STYLE_MENU);
780#endif
781
782 if (gPauseMenuCurrentTab == 2) {
783 if (gPauseBadgesLevel == 0) {
784 pause_set_cursor_pos(32, baseX + 10, baseY + 26 + gPauseBadgesCurrentTab * 32);
785 } else {
786 selectedPosX = pause_badges_get_pos_x(gPauseBadgesCurrentPage, gPauseBadgesSelectedIndex - gPauseBadgesPages[gPauseBadgesCurrentPage].listStart * gPauseBadgesPages[gPauseBadgesCurrentPage].numCols);
787 selectedPosY = pause_badges_get_pos_y(gPauseBadgesCurrentPage, gPauseBadgesSelectedIndex - gPauseBadgesPages[gPauseBadgesCurrentPage].listStart * gPauseBadgesPages[gPauseBadgesCurrentPage].numCols);
788 cursorOffsetX = pause_badges_scroll_offset_x(selectedPosX);
789 cursorOffsetY = pause_badges_scroll_offset_y(selectedPosY);
790 if (cursorOffsetY < 0) {
791 cursorOffsetY = 0;
792 } else if (cursorOffsetY > 112) {
793 cursorOffsetY = 112;
794 }
795
796 if (gPauseBadgesCurrentScrollPos != gPauseBadgesTargetScrollPos) {
797 pause_set_cursor_pos_immediate(WIN_PAUSE_BADGES, baseX + 93 + cursorOffsetX, baseY + 23 + cursorOffsetY);
798 } else {
799 pause_set_cursor_pos(WIN_PAUSE_BADGES, baseX + 93 + cursorOffsetX, baseY + 23 + cursorOffsetY);
800 }
801 }
802 }
803
804 if (gPauseBadgesShowNotEnoughBP != 0) {
806 if (gPauseBadgesShowNotEnoughBP == 1) {
807#if VERSION_PAL
809
810 draw_box(DRAW_FLAG_NO_CLIP, &gPauseWS_13, baseX + (256 - wid) / 2, baseY + 60, 0, wid + 36, 26, 255,
811 0, 0, 0, 0, 0, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
812 draw_msg(pause_get_menu_msg(PAUSE_MSG_NOT_ENOUGH_BP), baseX + (292 - wid) / 2, baseY + 66, 255,
814#else
815 draw_box(DRAW_FLAG_NO_CLIP, &gPauseWS_13, baseX + 67, baseY + 60, 0, 137, 26, 255,
816 0, 0, 0, 0, 0, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
817 draw_msg(pause_get_menu_msg(PAUSE_MSG_NOT_ENOUGH_BP), baseX + 86, baseY + 66, 255,
819#endif
820 } else {
821 draw_box(DRAW_FLAG_NO_CLIP, &gPauseWS_13, baseX + 67, baseY + 60, 0, 173, 26, 255,
822 0, 0, 0, 0, 0, 0, 0, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0);
823 draw_msg(pause_get_menu_msg(PAUSE_MSG_DONT_WEAR_MORE), baseX + 90, baseY + 66, 255,
825 }
826 }
827}
828
829void pause_badges_load_badges(s32 onlyEquipped) {
830 PlayerData* playerData = &gPlayerData;
831 s32 numItems = 0;
832 PauseItemPage* page;
833 s32 i;
834
835 D_80270388 = 0;
836 if (!onlyEquipped) {
837 for (i = 0; i < ARRAY_COUNT(playerData->badges); i++) {
838 s16 badgeItemID = playerData->badges[i];
839
840 if (badgeItemID == ITEM_NONE) {
841 continue;
842 } else {
843 gPauseBadgesItemIds[numItems] = badgeItemID;
844 numItems += 1;
845 }
846 }
847 } else {
848 s16* equippedBadges;
849
850 // This is just called to sort equippedBadges, the count is discarded
852
853 equippedBadges = playerData->equippedBadges;
854 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
855 // This can be written more clearly as equippedBadges[i],
856 // but that causes some instruction reordering
857 s16 badgeItemID = *equippedBadges;
858
859 if (badgeItemID != 0) {
860 gPauseBadgesItemIds[numItems] = badgeItemID;
861 numItems += 1;
862 }
863 equippedBadges++;
864 }
865 }
866 if (numItems == 0) {
867 gPauseBadgesItemIds[0] = BADGE_NONE_STANDIN;
868 numItems = 1;
869 }
870 gPauseBadgesNumItems = numItems;
871 for (i = numItems; i < ARRAY_COUNT(gPauseBadgesItemIds); i++) {
872 gPauseBadgesItemIds[i] = BADGE_INVALID;
873 }
874
875 gPauseBadgesSelectedIndex = 0;
876 gPauseBadgesSelectedItem = 0;
877 D_8027037C = 0;
878 gPauseBadgesTargetScrollIndex = 0;
879 gPauseBadgesCurrentPage = 0;
880
881 page = &gPauseBadgesPages[0];
882 for (i = 0; i < gPauseBadgesNumItems / 8; i++, page++) {
883 page->listStart = i * 8;
884 page->numCols = 1;
885 page->numRows = 8;
886 page->enabled = TRUE;
887 page->startIndex = i * 8;
888 page->count = 8;
889 }
890
891 if ((gPauseBadgesNumItems % 8) != 0) {
892 page->listStart = i * 8;
893 page->numCols = 1;
894 page->enabled = TRUE;
895 page->startIndex = i * 8;
896 page->count = gPauseBadgesNumItems % 8;
897 page->numRows = page->count;
898 i++;
899 page++;
900 }
901
902 while (i < ARRAY_COUNT(gPauseBadgesPages)) {
903 page->enabled = FALSE;
904 i++;
905 page++;
906 }
907
908 gPauseBadgesTargetScrollPos = gPauseBadgesCurrentScrollPos = pause_badges_get_pos_y(0, 0);
909}
910
912 s32 i;
913
914 // This sorts the badge list and then discards the count
916
917 gPauseBadgesLevel = 0;
918 gPauseBadgesCurrentTab = 0;
919 gPauseBadgesShowNotEnoughBP = 0;
920
922 if (gPauseBadgesItemIds[0] == BADGE_NONE_STANDIN) {
923 panel->initialized = FALSE;
924 return;
925 }
926
927 for (i = 0; i < ARRAY_COUNT(gPauseBadgesIconIDs); i++) {
929
930 gPauseBadgesIconIDs[i] = iconID;
932 }
933
934 for (i = 0; i < ARRAY_COUNT(gPauseBadgesWindowBPs); i++) {
935 gPauseBadgesWindowBPs[i].tab = panel;
936 }
938 panel->initialized = TRUE;
939}
940
942 s32 selectedIndex = gPauseBadgesSelectedIndex;
943 s32 numCols = gPauseBadgesPages[gPauseBadgesCurrentPage].numCols;
944
945 s32 selectedCol = selectedIndex % numCols;
946 s32 selectedRow = selectedIndex / numCols;
947
949 s16 badgeID;
950
951 if (gPauseBadgesShowNotEnoughBP != 0) {
952 gPauseBadgesShowNotEnoughBP = 0;
953 } else if (gPauseBadgesLevel == 0) {
954 if (gPauseBadgesItemIds[selectedIndex] == BADGE_NONE_STANDIN) {
956 } else {
957 gPauseBadgesLevel = 1;
959 }
960 } else {
961 badgeID = gPauseBadgesItemIds[selectedIndex];
962 switch (pause_badges_try_equip(badgeID)) {
964 switch (pause_badges_try_remove(badgeID)) {
967 gPauseBadgesShowNotEnoughBP = 1;
968 break;
969 default:
971 break;
972 }
973 break;
976 gPauseBadgesShowNotEnoughBP = 1;
977 break;
980 gPauseBadgesShowNotEnoughBP = 2;
981 break;
984 break;
985 }
986 }
987 return;
988 }
989
990 if ((gPausePressedButtons != 0) || (gPauseHeldButtons != 0)) {
991 gPauseBadgesShowNotEnoughBP = 0;
992 }
993
994 if (gPauseBadgesNumItems != 0) {
995 if (gPauseBadgesLevel == 0) {
996 s32 oldTab = gPauseBadgesCurrentTab;
997
999 gPauseBadgesCurrentTab ^= 1;
1000 }
1001 if (oldTab != gPauseBadgesCurrentTab) {
1003 pause_badges_load_badges(gPauseBadgesCurrentTab);
1004 }
1005 } else {
1006 s32 heldButtons = gPauseHeldButtons;
1007 s32 heldButtons2;
1008 u8 newPageNumCols;
1009
1010 if (heldButtons & (BUTTON_STICK_UP | BUTTON_Z)) {
1011 if (heldButtons & BUTTON_STICK_UP) {
1012 selectedRow -= 1;
1013 if (selectedRow < 0) {
1014 selectedRow = 0;
1015 }
1016 if (selectedRow < gPauseBadgesPages[gPauseBadgesCurrentPage].listStart) {
1017 gPauseBadgesCurrentPage -= 1;
1018 }
1019 } else {
1020 // Z button press
1021 gPauseBadgesCurrentPage -= 1;
1022 if (gPauseBadgesCurrentPage < 0) {
1023 gPauseBadgesCurrentPage = 0;
1024 }
1025 selectedRow = gPauseBadgesPages[gPauseBadgesCurrentPage].listStart;
1026 }
1027 }
1028
1029 // Need to re-read button state here for strange regalloc reasons
1030 heldButtons2 = gPauseHeldButtons;
1031 if (heldButtons2 & (BUTTON_STICK_DOWN | BUTTON_R)) {
1032 if (heldButtons2 & BUTTON_STICK_DOWN) {
1033 PauseItemPage* page = &gPauseBadgesPages[gPauseBadgesCurrentPage];
1034
1035 selectedRow += 1;
1036 if (selectedRow >= (page->listStart + page->numRows)) {
1037 gPauseBadgesCurrentPage += 1;
1038 if (!gPauseBadgesPages[gPauseBadgesCurrentPage].enabled) {
1039 gPauseBadgesCurrentPage -= 1;
1040 selectedRow -= 1;
1041 }
1042 }
1043 } else {
1044 // R button press
1045 PauseItemPage* newPage;
1046
1047 gPauseBadgesCurrentPage++;
1048 newPage = &gPauseBadgesPages[gPauseBadgesCurrentPage];
1049
1050 if (!newPage->enabled) {
1051 gPauseBadgesCurrentPage -= 1;
1052 } else {
1053 selectedRow = newPage->listStart;
1054 }
1055 }
1056 }
1057
1058 newPageNumCols = gPauseBadgesPages[gPauseBadgesCurrentPage].numCols;
1059 if (gPauseBadgesItemIds[selectedRow * newPageNumCols] != BADGE_NONE_STANDIN) {
1061 selectedCol -= 1;
1062 if (selectedCol < 0) {
1063 selectedCol = newPageNumCols - 1;
1064 }
1066 selectedCol += 1;
1067 if (selectedCol >= newPageNumCols) {
1068 selectedCol = 0;
1069 }
1070 }
1071 } else {
1072 selectedCol = 0;
1073 }
1074 gPauseBadgesSelectedIndex = selectedCol + (selectedRow * gPauseBadgesPages[gPauseBadgesCurrentPage].numCols);
1075 if (gPauseBadgesSelectedIndex != selectedIndex) {
1077 }
1078 gPauseBadgesSelectedItem = gPauseBadgesItemIds[gPauseBadgesSelectedIndex];
1079 }
1080 }
1081
1082 if (gPauseBadgesLevel == 1) {
1083 s32 itemID = gPauseBadgesSelectedItem;
1084
1085 if (((itemID != BADGE_NONE_STANDIN) && (itemID != BADGE_INVALID) && (itemID != 0))) {
1087 } else {
1088 gPauseCurrentDescMsg = MSG_NONE;
1090 }
1091 } else {
1094 }
1095
1097 if (gPauseBadgesLevel == 0) {
1100 } else {
1102 gPauseBadgesLevel = 0;
1104 if (gPauseBadgesCurrentTab == 1) {
1106 }
1107 }
1108 }
1109}
1110
1112 PauseItemPage* menuPages = gPauseBadgesPages;
1113 PauseItemPage* currentMenuPage = &menuPages[gPauseBadgesCurrentPage];
1114 s32 itemIndex = (gPauseBadgesSelectedIndex / currentMenuPage->numCols) - currentMenuPage->listStart;
1115
1116 if (itemIndex < 2 || currentMenuPage->numRows < 9) {
1117 gPauseBadgesTargetScrollIndex = 0;
1118 } else if (itemIndex >= currentMenuPage->numRows - 2) {
1119 gPauseBadgesTargetScrollIndex = currentMenuPage->numRows - 8;
1120 } else {
1121 if (itemIndex - gPauseBadgesTargetScrollIndex >= 7) {
1122 gPauseBadgesTargetScrollIndex = itemIndex - 6;
1123 } else if (itemIndex - gPauseBadgesTargetScrollIndex <= 0) {
1124 gPauseBadgesTargetScrollIndex = itemIndex - 1;
1125 }
1126 }
1127
1128 gPauseBadgesTargetScrollPos = pause_badges_get_pos_y(gPauseBadgesCurrentPage, gPauseBadgesTargetScrollIndex * currentMenuPage->numCols);
1129 gPauseBadgesCurrentScrollPos += pause_interp_vertical_scroll(gPauseBadgesTargetScrollPos - gPauseBadgesCurrentScrollPos);
1130}
1131
1133 s32 i;
1134
1135 for (i = 0; i < ARRAY_COUNT(gPauseBadgesIconIDs); i++) {
1136 hud_element_free(gPauseBadgesIconIDs[i]);
1137 }
1138}
IconHudScriptPair gItemHudScripts[]
s16 equippedBadges[64]
s16 badges[128]
#define get_msg_width
#define sin_deg
#define draw_msg
#define draw_box
@ DRAW_MSG_STYLE_DROP_SHADOW
Definition enums.h:5388
@ DRAW_MSG_STYLE_MENU
Definition enums.h:5385
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
Definition enums.h:5393
@ DRAW_NUMBER_STYLE_MONOSPACE
Definition enums.h:5394
@ BUTTON_A
Definition enums.h:2790
@ BUTTON_R
Definition enums.h:2781
@ 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
@ BUTTON_Z
Definition enums.h:2788
@ LANGUAGE_DE
Definition enums.h:6401
@ LANGUAGE_ES
Definition enums.h:6403
@ LANGUAGE_FR
Definition enums.h:6402
@ WINDOW_PRIORITY_1
Definition enums.h:3183
@ DRAW_FLAG_NO_CLIP
Definition enums.h:5005
@ MSG_PAL_WHITE
Definition enums.h:5405
@ MSG_PAL_STANDARD
Definition enums.h:5415
@ MSG_PAL_0B
Definition enums.h:5416
@ WINDOW_UPDATE_HIDE
Definition enums.h:5312
@ DRAW_NUMBER_CHARSET_THIN
Definition enums.h:5401
#define LANGUAGE_DEFAULT
Definition enums.h:6398
@ SOUND_MENU_BADGE_EQUIP
Definition enums.h:552
@ SOUND_MENU_BADGE_UNEQUIP
Definition enums.h:553
@ SOUND_MENU_BACK
Definition enums.h:701
@ SOUND_MENU_CHANGE_TAB
Definition enums.h:699
@ SOUND_MENU_CHANGE_SELECTION
Definition enums.h:698
@ SOUND_MENU_NEXT
Definition enums.h:700
@ SOUND_MENU_ERROR
Definition enums.h:933
@ WIN_PAUSE_MAIN
Definition enums.h:5263
@ WIN_PAUSE_BADGES
Definition enums.h:5275
void setup_pause_menu_tab(MenuWindowBP *bpArray, s32 arraySize)
Definition windows.c:461
void enforce_hpfp_limits(void)
Definition inventory.c:457
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2223
HudScript HES_StatusStar1
void hud_element_set_scale(s32 index, f32 scale)
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_clear_flags(s32 id, s32 flags)
Turns off the given flags.
void hud_element_free(s32 id)
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
@ HUD_ELEMENT_FLAG_DROP_SHADOW
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:88
s32 HudScript[]
Definition hud_element.h:9
HudScript * enabled
HudScript HES_Dash
HudScript HES_ListPrevPage
HudScript HES_LabelBpNeeded
HudScript HES_ListNextPage
HudScript HES_StatBp
void pause_badges_init(MenuPanel *panel)
void pause_badges_draw_bp_orbs(s32 orbState, s32 x, s32 y)
s32 pause_badges_get_column(s32 page, s32 itemIdx)
#define BADGE_INVALID
void pause_badges_load_badges(s32 onlyEquipped)
#define OFFSET_3_X
s32 pause_badges_try_equip(s16 badgeID)
#define OFFSET_3_Y
s32 pause_badges_scroll_offset_x(s32 x)
#define BADGE_NONE_STANDIN
#define TRY_REMOVE_NOT_ENOUGH_BP_RESULT
MenuWindowBP gPauseBadgesWindowBPs[]
void pause_badges_handle_input(MenuPanel *panel)
s32 pause_badges_get_row(s32 page, s32 itemIdx)
s32 pause_badges_get_pos_y(s32 page, s32 itemIndex)
s32 pause_badges_scroll_offset_y(s32 offset)
s32 pause_badges_count_equipped(void)
void pause_badges_cleanup(MenuPanel *panel)
s32 pause_badges_try_remove(s16 badgeID)
void pause_badges_draw_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
#define OFFSET_1_Y
#define OFFSET_2_X
void pause_badges_update(MenuPanel *panel)
#define OFFSET_1_X
s32 pause_badges_is_visible(s32 y)
s32 pause_badges_comparator(s16 *a, s16 *b)
Gfx PauseGfxOrbs[]
Definition pause_gfx.c:264
s32 pause_badges_count_all(void)
s32 pause_badges_get_pos_x(s32 page, s32 itemIndex)
MenuPanel gPausePanelBadges
BadgeEquipResult
@ EQUIP_RESULT_SUCCESS
@ EQUIP_RESULT_TOO_MANY_BADGES
@ EQUIP_RESULT_NOT_ENOUGH_BP
@ EQUIP_RESULT_ALREADY_EQUIPPED
HudScript * gPauseBadgesElements[][22]
s32 gPausePressedButtons
Definition pause_main.c:24
HudScript * gPauseCurrentDescIconScript
Definition pause_main.c:26
s32 pause_interp_vertical_scroll(s32 deltaBefore)
Definition pause_main.c:451
WindowStyleCustom gPauseWS_13
s32 pause_get_total_equipped_bp_cost(void)
Definition pause_main.c:825
void pause_set_cursor_opacity(s32 val)
Definition pause_main.c:192
WindowStyleCustom gPauseWS_14
void pause_set_cursor_pos_immediate(s32 windowID, s32 posX, s32 posY)
Definition pause_main.c:196
s32 pause_get_menu_msg(s32 index)
Definition pause_gfx.c:583
WindowStyleCustom gPauseWS_15
@ PAUSE_MSG_DONT_WEAR_MORE
@ PAUSE_MSG_NO_BADGE
@ PAUSE_MSG_BADGES
@ PAUSE_MSG_ACTIVE
@ PAUSE_MSG_ALL_BADGES
@ PAUSE_MSG_BAGDE_DESC_ALL
@ PAUSE_MSG_BADGE_BP
@ PAUSE_MSG_NOT_ENOUGH_BP
@ PAUSE_MSG_BAGDE_DESC_ACTIVE
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
void pause_set_cursor_pos(s32 windowID, s32 posX, s32 posY)
Definition pause_main.c:228
void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileIdx, s32 uls, s32 ult, s32 dsdx, s32 dtdy)
Definition pause_main.c:841
void pause_sort_item_list(s16 *arr, s32 len, s32(*compare)(s16 *, s16 *))
Definition pause_main.c:851
WindowStyleCustom gPauseWS_16
@ PAUSE_LBL_AVAILABLE
s32 gPauseCurrentDescMsg
Definition pause_main.c:25
void sfx_play_sound(s32 soundID)
Definition sfx.c:517
#define SCREEN_WIDTH
Definition macros.h:105
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define SCREEN_HEIGHT
Definition macros.h:106
#define BADGE_MENU_PAGE(index)
Definition macros.h:73
MenuPanel * tab
ItemData gItemTable[]
#define gCurrentLanguage
Definition variables.h:115
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Gfx * gMainGfxPos
Definition cam_main.c:15
PlayerData gPlayerData
Definition 77480.c:40
MoveData gMoveTable[]