Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
menu_moves.c File Reference

Go to the source code of this file.

Macros

#define MENU_CAPACITY   24
 
#define MENU_LINE_HEIGHT   13
 
#define MENU_MAX_VISIBLE   6
 
#define Y_VAR1   0
 
#define X_VAR1   108
 
#define X_VAR2   93
 

Enumerations

enum  {
  BTL_SUBMENU_STATE_CANCEL = -2 , BTL_SUBMENU_STATE_SELECT = -1 , BTL_SUBMENU_STATE_INIT = 0 , BTL_SUBMENU_STATE_CHOOSING = 1 ,
  BTL_SUBMENU_STATE_HIDE_INIT = 10 , BTL_SUBMENU_STATE_HIDE_HOLD = 11 , BTL_SUBMENU_STATE_RESTORE = 20 , BTL_SUBMENU_STATE_LOCK = 30 ,
  BTL_SUBMENU_STATE_ERROR_INIT = 40 , BTL_SUBMENU_STATE_ERROR_SHOW = 41 , BTL_SUBMENU_STATE_ERROR_DONE = 42
}
 

Functions

void btl_menu_moves_draw_content (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_title (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_icon (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_desc (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_error (void *data, s32 x, s32 y)
 
void btl_submenu_moves_init (void)
 
void btl_submenu_moves_hide (void)
 
void btl_submenu_moves_destroy (void)
 
void btl_submenu_moves_resume_choose (void)
 
void btl_submenu_moves_restore_choose (void)
 
void btl_submenu_moves_restore_locked (void)
 
s32 btl_submenu_moves_update (void)
 

Variables

HudScript HES_GreenArrowDown
 
HudScript HES_GreenArrowUp
 
HudScript HES_HandPointer
 
BSS HudElemID HID_MovesArrowUp
 
BSS HudElemID HID_MovesArrowDown
 
BSS HudElemID HID_MovesCursor
 
BSS HudElemID HID_MovesTitle
 
HudScript HES_MenuStarPower
 
HudScript HES_FPCost
 
HudScript HES_FPCostReduced
 
HudScript HES_FPCostReducedTwice
 
HudScript HES_POWCost
 
HudScript HES_POWCostReduced
 
HudScript HES_POWCostReducedTwice
 
HudScript HES_StatusFlower
 
HudScript HES_NotEnoughFP
 
HudScript HES_NotEnoughPOW
 
BSS s16 MovesMenuPosX
 
BSS s16 MovesMenuPosY
 
BSS s8 MovesMenuState
 
BSS s32 MovesPrevSelected
 
BSS s32 MovesOptionIndexMap [24]
 
BSS HudScriptMovesOptionHudScripts [24]
 
BSS HudElemID MovesOptionHIDs [24]
 
BSS HudElemID MovesOptionCostHIDs [24]
 
BSS MsgID MovesOptionNames [24]
 
BSS MsgID MovesOptionDesc [24]
 
BSS s32 MovesOptionDisplayCosts [24]
 
BSS s32 MovesOptionDiscounts [24]
 
BSS s32 MovesOptionDiscountColors [24]
 
BSS s32 MovesOptionBPCosts [24]
 
BSS s32 MovesOptionIndices [24]
 
BSS s32 MovesOptionEnabled [24]
 
BSS s8 MovesOptionSortPriority [24]
 
BSS s8 MovesOptionError [24]
 
BSS s32 MovesOptionCount
 
BSS s8 MovesCursorPos
 
BSS s8 MovesPrevCursorPos
 
BSS s8 MovesVisibleStart
 
BSS s8 MovesVisibleEnd
 
BSS s8 MovesMenuLines
 
BSS b8 MovesDescVisible
 
BSS s16 MovesScrollOffset
 
BSS s16 MovesCursorOffset
 
BSS s32 MovesErrorCode
 
BSS s8 MovesErrorTimer
 
BSS s16 MovesTextColor
 
BSS s16 MovesTextAlpha
 
BSS b32 UsingSpiritsSubmenu
 
BSS s32 SelectedMovesIndex
 
s16 ErrorMessageHeight [] = { 28, 40 }
 
s16 ErrorMessageAdjustY [] = { 0, -2 }
 

Macro Definition Documentation

◆ MENU_CAPACITY

#define MENU_CAPACITY   24

Definition at line 4 of file menu_moves.c.

◆ MENU_LINE_HEIGHT

#define MENU_LINE_HEIGHT   13

◆ MENU_MAX_VISIBLE

#define MENU_MAX_VISIBLE   6

Definition at line 6 of file menu_moves.c.

Referenced by btl_submenu_moves_init(), and btl_submenu_moves_update().

◆ Y_VAR1

#define Y_VAR1   0

Definition at line 630 of file menu_moves.c.

Referenced by btl_menu_moves_draw_content().

◆ X_VAR1

#define X_VAR1   108

Definition at line 631 of file menu_moves.c.

Referenced by btl_menu_moves_draw_content().

◆ X_VAR2

#define X_VAR2   93

Definition at line 632 of file menu_moves.c.

Referenced by btl_menu_moves_draw_content().

Enumeration Type Documentation

◆ anonymous enum

Enumerator
BTL_SUBMENU_STATE_CANCEL 
BTL_SUBMENU_STATE_SELECT 
BTL_SUBMENU_STATE_INIT 
BTL_SUBMENU_STATE_CHOOSING 
BTL_SUBMENU_STATE_HIDE_INIT 
BTL_SUBMENU_STATE_HIDE_HOLD 
BTL_SUBMENU_STATE_RESTORE 
BTL_SUBMENU_STATE_LOCK 
BTL_SUBMENU_STATE_ERROR_INIT 
BTL_SUBMENU_STATE_ERROR_SHOW 
BTL_SUBMENU_STATE_ERROR_DONE 

Definition at line 8 of file menu_moves.c.

8 {
9 BTL_SUBMENU_STATE_CANCEL = -2, // selection is canceled
10 BTL_SUBMENU_STATE_SELECT = -1, // a result is selected
11 BTL_SUBMENU_STATE_INIT = 0, // build and initialize the menu
12 BTL_SUBMENU_STATE_CHOOSING = 1, // selecting an option
13 BTL_SUBMENU_STATE_HIDE_INIT = 10, // begin hiding the menu, will quickly change to HIDE_HOLD
15 BTL_SUBMENU_STATE_RESTORE = 20, // reappear and resume choosing
20};
@ BTL_SUBMENU_STATE_RESTORE
Definition menu_moves.c:15
@ BTL_SUBMENU_STATE_LOCK
Definition menu_moves.c:16
@ BTL_SUBMENU_STATE_HIDE_HOLD
Definition menu_moves.c:14
@ BTL_SUBMENU_STATE_CANCEL
Definition menu_moves.c:9
@ BTL_SUBMENU_STATE_SELECT
Definition menu_moves.c:10
@ BTL_SUBMENU_STATE_ERROR_DONE
Definition menu_moves.c:19
@ BTL_SUBMENU_STATE_HIDE_INIT
Definition menu_moves.c:13
@ BTL_SUBMENU_STATE_ERROR_SHOW
Definition menu_moves.c:18
@ BTL_SUBMENU_STATE_CHOOSING
Definition menu_moves.c:12
@ BTL_SUBMENU_STATE_INIT
Definition menu_moves.c:11
@ BTL_SUBMENU_STATE_ERROR_INIT
Definition menu_moves.c:17

Function Documentation

◆ btl_menu_moves_draw_content()

void btl_menu_moves_draw_content ( void * data,
s32 x,
s32 y )

Definition at line 635 of file menu_moves.c.

635 {
636 s32 target, cur, delta;
637 s32 x1, y1, x2, y2;
638 s32 xPos, yPos;
640 s32 palette;
641 s32 hid;
642 s32 index;
643 s32 i;
644
645 switch (MovesMenuState) {
653 // simple midpoint easing, move half the distance each frame
656 delta = (target - cur) * 0.5;
657 MovesScrollOffset = (delta != 0) ? cur + delta : target;
658
659 x1 = x + 2;
660 x2 = x + 153;
661 y1 = y + 18;
662 y2 = y + 19 + (MovesMenuLines * MENU_LINE_HEIGHT);
664
665 xPos = x + 31;
666 yPos = y + 19 + MovesScrollOffset;
667
668 for (i = 0; i < MovesOptionCount; i++) {
669 // find the array index for current list display index
670 index = MovesOptionIndexMap[i];
671
672 if (i >= MovesVisibleStart - 1 && MovesVisibleStart + MovesMenuLines >= i) {
673 palette = MovesTextColor;
674
675 if (MovesOptionEnabled[index] <= 0) {
676 palette = MSG_PAL_0B;
677 }
678
679 if (MovesOptionNames[index] >= 0) {
680 draw_msg(
682 );
683 }
684
687
688 if (baseCost != 0 && cost <= 0) {
689 cost = 1;
690 }
691
692 if (UsingSpiritsSubmenu ) {
693 if (i == MovesCursorPos) {
694 if (cost == 0 || MovesOptionEnabled[index] <= 0) {
696 } else {
698 }
699 }
700 } else {
701 if (i == MovesCursorPos) {
702 if (cost == 0 || MovesOptionEnabled[index] <= 0) {
704 } else {
706 }
707 }
708 }
709
710 switch (MovesOptionDiscountColors[i]) {
711 case 0:
712 palette = MSG_PAL_STANDARD;
713 break;
714 case 1:
715 palette = MSG_PAL_37;
716 break;
717 default:
718 palette = MSG_PAL_38;
719 break;
720 }
721
722 if (MovesOptionEnabled[index] <= 0) {
723 palette = MSG_PAL_0B;
724 }
725
726 if (MovesOptionDisplayCosts[index] != 0) {
728
733 );
734 if (MovesOptionEnabled[index] <= 0) {
736 }
738 } else {
742 );
743 if (MovesOptionEnabled[index] <= 0) {
745 }
747 }
750 }
751 }
753 }
754
755 // draw option icons
756 xPos = x + 24;
757 yPos = y + 24 + MovesScrollOffset;
758
759 for (i = 0; i < MovesOptionCount; i++) {
760 if (i < MovesVisibleStart - 1) {
762 } else if (MovesVisibleStart + MovesMenuLines < i) {
764 } else {
765 hid = MovesOptionHIDs[i];
770 }
771 }
772
773 // instant snap to target, no easing
776 delta = (target - cur) * 1.0;
777 MovesCursorOffset = (delta != 0) ? cur + delta : target;
778
779 // draw the cursor
780 xPos = x + 10;
781 yPos = y + 26 + MovesCursorOffset;
782
787
788 // draw nav arrows
789 if (MovesVisibleStart > 0) {
791 hud_element_set_render_pos(hid, x + 72, y + 15);
794 }
797 hud_element_set_render_pos(hid, x + 72, y + 100);
800 }
801
803 if (!UsingSpiritsSubmenu) {
805 } else {
807 }
808 }
809 break;
810 }
811}
BSS s32 PopupMenu_SelectedIndex
#define draw_msg
@ DRAW_MSG_STYLE_MENU
Definition enums.h:4970
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
Definition enums.h:4978
@ DRAW_NUMBER_STYLE_MONOSPACE
Definition enums.h:4979
@ MSG_PAL_38
Definition enums.h:5046
@ MSG_PAL_37
Definition enums.h:5045
@ MSG_PAL_STANDARD
Definition enums.h:5000
@ MSG_PAL_0B
Definition enums.h:5001
@ DRAW_NUMBER_CHARSET_THIN
Definition enums.h:4986
void status_bar_start_blinking_fp(void)
Definition inventory.c:1563
void status_bar_stop_blinking_sp(void)
Definition inventory.c:1619
void status_bar_stop_blinking_fp(void)
Definition inventory.c:1576
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2225
void status_bar_start_blinking_sp_bars(s32 numBarsToBlink)
Definition inventory.c:1628
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_draw_without_clipping(s32 id)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
void hud_element_draw_clipped(s32 id)
BSS s32 MovesOptionDiscountColors[24]
Definition menu_moves.c:59
BSS s32 MovesOptionCount
Definition menu_moves.c:65
BSS HudElemID MovesOptionCostHIDs[24]
Definition menu_moves.c:54
BSS s16 MovesTextAlpha
Definition menu_moves.c:80
BSS s32 MovesOptionEnabled[24]
Definition menu_moves.c:62
#define Y_VAR1
Definition menu_moves.c:630
HudScript HES_NotEnoughFP
#define X_VAR2
Definition menu_moves.c:632
BSS HudElemID HID_MovesCursor
Definition menu_moves.c:28
BSS HudElemID HID_MovesArrowUp
Definition menu_moves.c:26
#define MENU_LINE_HEIGHT
Definition menu_moves.c:5
BSS s32 MovesOptionDiscounts[24]
Definition menu_moves.c:58
BSS s16 MovesScrollOffset
Definition menu_moves.c:73
BSS s32 MovesOptionIndexMap[24]
Definition menu_moves.c:50
BSS s16 MovesCursorOffset
Definition menu_moves.c:74
BSS HudElemID MovesOptionHIDs[24]
Definition menu_moves.c:53
BSS HudElemID HID_MovesArrowDown
Definition menu_moves.c:27
HudScript HES_NotEnoughPOW
BSS s8 MovesCursorPos
Definition menu_moves.c:67
#define X_VAR1
Definition menu_moves.c:631
BSS b32 UsingSpiritsSubmenu
Definition menu_moves.c:82
BSS s8 MovesMenuState
Definition menu_moves.c:45
BSS s8 MovesMenuLines
Definition menu_moves.c:71
BSS s32 MovesOptionDisplayCosts[24]
Definition menu_moves.c:57
BSS s8 MovesVisibleEnd
Definition menu_moves.c:70
BSS s16 MovesTextColor
Definition menu_moves.c:79
BSS s8 MovesVisibleStart
Definition menu_moves.c:69
BSS MsgID MovesOptionNames[24]
Definition menu_moves.c:55
Gfx * gMainGfxPos
Definition cam_main.c:14

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_title()

void btl_menu_moves_show_title ( void * data,
s32 x,
s32 y )

Definition at line 813 of file menu_moves.c.

813 {
814 s32 msgID;
815 s32 posX;
816 s32 posY;
817 s32 opacity;
818 s32 palette;
819
820 if (!UsingSpiritsSubmenu) {
821 msgID = MSG_Menus_Abilities;
822 posX = x + 16;
823 posY = y + 2;
824 opacity = MovesTextAlpha;
825 palette = MSG_PAL_30;
826 } else {
827 msgID = MSG_Menus_StarSpirits;
828 posX = x + 6;
829 posY = y + 2;
830 opacity = MovesTextAlpha;
831 palette = MSG_PAL_31;
832 }
833 draw_msg(msgID, posX, posY, opacity, palette, DRAW_MSG_STYLE_MENU);
834}
@ MSG_PAL_30
Definition enums.h:5038
@ MSG_PAL_31
Definition enums.h:5039

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_icon()

void btl_menu_moves_show_icon ( void * data,
s32 x,
s32 y )

Definition at line 836 of file menu_moves.c.

836 {
838
839 hud_element_set_render_pos(hid, x + 16, y + 15);
842}
BSS HudElemID HID_MovesTitle
Definition menu_moves.c:29

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_desc()

void btl_menu_moves_show_desc ( void * data,
s32 x,
s32 y )

Definition at line 844 of file menu_moves.c.

844 {
845 switch (MovesMenuState) {
851 if (MovesDescVisible) {
853 x + 8, y, MovesTextAlpha, MovesTextColor, 0);
854 }
855 break;
856 }
857}
BSS MsgID MovesOptionDesc[24]
Definition menu_moves.c:56
BSS b8 MovesDescVisible
Definition menu_moves.c:72

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_error()

void btl_menu_moves_show_error ( void * data,
s32 x,
s32 y )

Definition at line 859 of file menu_moves.c.

859 {
860 s32 msgID;
861
862 posX += 11;
863 posY += 6;
864 posY += ErrorMessageAdjustY[get_msg_lines(msgID) - 1];
865
866 if (MovesErrorCode != 0) {
868 } else if (UsingSpiritsSubmenu) {
870 } else {
871 msgID = MSG_Menus_NotEnoughFP;
872 }
873 draw_msg(msgID, posX, posY, 255, MSG_PAL_0F, 0);
874}
@ MSG_PAL_0F
Definition enums.h:5005
s32 get_msg_lines(s32 messageID)
Definition msg.c:1981
s16 ErrorMessageAdjustY[]
Definition menu_moves.c:86
BSS s32 MovesErrorCode
Definition menu_moves.c:76

Referenced by btl_submenu_moves_update().

◆ btl_submenu_moves_init()

void btl_submenu_moves_init ( void )

Definition at line 94 of file menu_moves.c.

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ btl_submenu_moves_hide()

void btl_submenu_moves_hide ( void )

◆ btl_submenu_moves_destroy()

void btl_submenu_moves_destroy ( void )

Definition at line 138 of file menu_moves.c.

138 {
139 s32 i;
140
142
143 if (!UsingSpiritsSubmenu) {
146 } else {
149 }
150
152
153 for (i = 0; i < MovesOptionCount; i++) {
155 }
156
161
162 for (i = 0; i < MovesOptionCount; i++) {
164 }
165}
@ WINDOW_UPDATE_HIDE
Definition enums.h:4897
@ WIN_BTL_MOVES_ICON
Definition enums.h:4829
@ WIN_BTL_SPIRITS_TITLE
Definition enums.h:4830
@ WIN_BTL_MOVES_MENU
Definition enums.h:4827
@ WIN_BTL_MOVES_TITLE
Definition enums.h:4828
@ WIN_BTL_SPIRITS_ICON
Definition enums.h:4831
@ WIN_BTL_DESC_BOX
Definition enums.h:4834
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void hud_element_free(s32 id)

Referenced by btl_state_update_partner_menu(), btl_state_update_player_menu(), and btl_submenu_moves_update().

◆ btl_submenu_moves_resume_choose()

void btl_submenu_moves_resume_choose ( void )

Definition at line 167 of file menu_moves.c.

167 {
170 s32 i;
171
173
174 for (i = 0; i < MovesOptionCount; i++) {
175 hud_element_set_tint(moveOptionIconIDs[i], 255, 255, 255);
176 }
177
181 hud_element_set_tint(HID_MovesTitle, 255, 255, 255);
182
184
185 for (i = 0; i < MovesOptionCount; i++) {
187 }
188
191
192 if (!UsingSpiritsSubmenu) {
195 } else {
198 }
199
202 MovesDescVisible = true;
203 MovesTextAlpha = 255;
205}
@ WINDOW_UPDATE_SHOW
Definition enums.h:4896
@ WINDOW_UPDATE_TRANSPARENT
Definition enums.h:4900
HudScript HES_AnimatedHandPointer
void hud_element_set_tint(s32 id, s32 r, s32 g, s32 b)

Referenced by btl_state_update_player_menu().

◆ btl_submenu_moves_restore_choose()

void btl_submenu_moves_restore_choose ( void )

◆ btl_submenu_moves_restore_locked()

void btl_submenu_moves_restore_locked ( void )

◆ btl_submenu_moves_update()

s32 btl_submenu_moves_update ( void )

Definition at line 254 of file menu_moves.c.

254 {
256 s32 x, y;
257 s32 msgWidth;
258 s32 msgHeight;
259 s32 msgID;
260 s32 cond;
262 s32 i;
263 s32 j;
264
265 switch (MovesMenuState) {
269 MovesMenuPosX = 20;
270 MovesMenuPosY = 68;
271
272 for (i = 0; i < MovesOptionCount; i++) {
273 MovesOptionIndexMap[i] = i;
274 }
275
276 if (!UsingSpiritsSubmenu) {
277 for (i = 0; i < (MovesOptionCount - 1); i++) {
278 for (j = i + 1; j < MovesOptionCount; j++) {
281
283 continue;
284 }
285
286 if (
291 )
292 {
296 }
297 }
298 }
299 }
300
301 for (i = 0; i < MovesOptionCount; i++) {
303 MovesOptionHIDs[i] = hid;
306 }
307
312
317
322
323 if (!UsingSpiritsSubmenu) {
327 } else {
332 }
334
335 for (i = 0; i < MovesOptionCount; i++) {
336 if (!UsingSpiritsSubmenu) {
337 switch (MovesOptionDiscountColors[i]) {
338 case 0:
341 break;
342 case 1:
345 break;
346 default:
349 break;
350 }
351 } else {
352 switch (MovesOptionDiscountColors[i]) {
353 case 0:
356 break;
357 case 1:
360 break;
361 default:
364 break;
365 }
366 }
369 }
370
372 x = MovesMenuPosX;
373 y = MovesMenuPosY;
374 if (!UsingSpiritsSubmenu) {
376 set_window_properties(WIN_BTL_MOVES_TITLE, x + 16, y - 6, 90, 16, 1, btl_menu_moves_show_title, nullptr, -1);
377 set_window_properties(WIN_BTL_MOVES_ICON, x + 114, y - 12, 32, 32, 1, btl_menu_moves_show_icon, nullptr, -1);
378 } else {
381 set_window_properties(WIN_BTL_SPIRITS_ICON, x + 110, y - 12, 32, 35, 1, btl_menu_moves_show_icon, 0, -1);
382 }
383
386 if (!UsingSpiritsSubmenu) {
389 } else {
392 }
394
395 do {
396 cond = false;
401 if (MovesVisibleStart < 0) {
403 }
404 } else {
405 cond = true;
406 }
407 }
408 } while (cond);
409
414 break;
417
418 // only wrap selection on stick press, not when held
419 if (battleStatus->curButtonsHeld & (BUTTON_STICK_UP | BUTTON_Z)) {
420 if (MovesCursorPos > 0) {
422 } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_UP | BUTTON_Z)) {
424 }
425 }
426
427 if (battleStatus->curButtonsHeld & (BUTTON_STICK_DOWN | BUTTON_R)) {
430 } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_DOWN | BUTTON_R)) {
432 }
433 }
434
435 // wrap the selected index
436 if (MovesCursorPos < 0) {
438 }
440 MovesCursorPos = 0;
441 }
442
446 }
447
450 if (MovesVisibleStart < 0) {
452 }
453 }
454
455 if (MovesCursorPos >= (MovesVisibleEnd - 1)) {
459 if (MovesVisibleStart < 0) {
461 }
462 }
463 }
464
466 if (battleStatus->curButtonsPressed & BUTTON_A) {
470 } else {
474 }
475 break;
476 }
477
478 if (battleStatus->curButtonsPressed & BUTTON_B) {
482 }
483 break;
485 for (i = 0; i < MovesOptionCount; i++) {
486 hid = MovesOptionHIDs[i];
487 hud_element_set_tint(hid, 160, 160, 160);
488 }
492 hud_element_set_tint(HID_MovesTitle, 160, 160, 160);
493
494 for (i = 0; i < MovesOptionCount; i++) {
496 hud_element_set_tint(hid, 160, 160, 160);
497 }
498
502 if (!UsingSpiritsSubmenu) {
505 } else {
508 }
510 if (!UsingSpiritsSubmenu) {
512 } else {
514 }
518 if (!UsingSpiritsSubmenu) {
520 } else {
522 }
523 return POPUP_RESULT_CANCEL;
526 if (!UsingSpiritsSubmenu) {
529 } else {
532 }
534 if (!UsingSpiritsSubmenu) {
536 } else {
538 }
547 if (!UsingSpiritsSubmenu) {
550 } else {
553 }
560 if (!UsingSpiritsSubmenu) {
563 } else {
566 }
569 break;
576 if (!UsingSpiritsSubmenu) {
579 } else {
582 }
584
585 if (MovesErrorCode != 0) {
587 } else if (UsingSpiritsSubmenu) {
589 } else {
590 msgID = MSG_Menus_NotEnoughFP;
591 }
592
593 msgWidth = get_msg_width(msgID, 0) + 23;
594 msgHeight = ErrorMessageHeight[get_msg_lines(msgID) - 1];
595 x = (SCREEN_WIDTH / 2) - (msgWidth / 2);
596 set_window_properties(WIN_BTL_POPUP, x, 80, msgWidth, msgHeight, 20, btl_menu_moves_show_error, nullptr, -1);
598 MovesErrorTimer = 60;
603 MovesErrorTimer = 0;
604 }
605 if (MovesErrorTimer != 0) {
608 }
611 if (!UsingSpiritsSubmenu) {
614 } else {
617 }
620 break;
621 }
623}
u32 pressedButtons[4]
s32 HudElemID
#define get_msg_width
@ BUTTON_A
Definition enums.h:2776
@ BUTTON_R
Definition enums.h:2767
@ BUTTON_STICK_UP
Definition enums.h:2777
@ BUTTON_STICK_DOWN
Definition enums.h:2778
@ BUTTON_B
Definition enums.h:2775
@ BUTTON_Z
Definition enums.h:2774
@ WINDOW_PRIORITY_20
Definition enums.h:3220
@ MSG_PAL_0D
Definition enums.h:5003
@ WINDOW_UPDATE_9
Definition enums.h:4904
@ WINDOW_UPDATE_DARKENED
Definition enums.h:4899
@ POPUP_RESULT_CANCEL
Definition enums.h:3212
@ POPUP_RESULT_CHOOSING
Definition enums.h:3211
@ POPUP_RESULT_INVALID
Definition enums.h:3209
@ SOUND_MENU_BACK
Definition enums.h:704
@ SOUND_MENU_CHANGE_SELECTION
Definition enums.h:701
@ SOUND_MENU_NEXT
Definition enums.h:703
@ SOUND_MENU_ERROR
Definition enums.h:936
@ WIN_BTL_POPUP
Definition enums.h:4835
void set_window_properties(s32 panelID, s32 posX, s32 posY, s32 width, s32 height, u8, void *drawContents, void *drawContentsArg, s8 parent)
Definition windows.c:373
void hud_element_set_scale(s32 index, f32 scale)
HudElemID 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.
@ HUD_ELEMENT_FLAG_DROP_SHADOW
Definition hud_element.h:97
@ HUD_ELEMENT_FLAG_MANUAL_RENDER
Definition hud_element.h:78
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:86
HudScript HES_POWCostReducedTwice
void btl_menu_moves_show_error(void *data, s32 x, s32 y)
Definition menu_moves.c:859
HudScript HES_FPCostReducedTwice
HudScript HES_HandPointer
BSS s16 MovesMenuPosY
Definition menu_moves.c:43
void btl_menu_moves_show_desc(void *data, s32 x, s32 y)
Definition menu_moves.c:844
BSS s8 MovesOptionSortPriority[24]
Definition menu_moves.c:63
void btl_menu_moves_show_title(void *data, s32 x, s32 y)
Definition menu_moves.c:813
void btl_submenu_moves_destroy(void)
Definition menu_moves.c:138
BSS s32 MovesOptionBPCosts[24]
Definition menu_moves.c:60
HudScript HES_GreenArrowDown
BSS s16 MovesMenuPosX
Definition menu_moves.c:42
HudScript HES_GreenArrowUp
s16 ErrorMessageHeight[]
Definition menu_moves.c:85
HudScript HES_FPCost
BSS HudScript * MovesOptionHudScripts[24]
Definition menu_moves.c:52
void btl_menu_moves_draw_content(void *data, s32 x, s32 y)
Definition menu_moves.c:635
BSS s8 MovesErrorTimer
Definition menu_moves.c:77
HudScript HES_POWCostReduced
BSS s8 MovesOptionError[24]
Definition menu_moves.c:64
HudScript HES_POWCost
void btl_menu_moves_show_icon(void *data, s32 x, s32 y)
Definition menu_moves.c:836
HudScript HES_FPCostReduced
HudScript HES_StatusFlower
HudScript HES_MenuStarPower
void sfx_play_sound(s32 soundID)
#define SCREEN_WIDTH
Definition macros.h:108
GameStatus * gGameStatusPtr
Definition main_loop.c:31
BattleStatus gBattleStatus
Definition battle.cpp:14

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

Variable Documentation

◆ HES_GreenArrowDown

HudScript HES_GreenArrowDown
extern

Definition at line 1866 of file global_hud_scripts.c.

1866 {
1868 hs_SetCustomSize(16, 8)
1869 hs_Loop
1875 hs_End
1876};
#define hs_SetCustomSize(arg0, arg1)
#define hs_SetVisible
#define hs_End
@ HUD_ELEMENT_FLAG_INVISIBLE
Definition hud_element.h:92
#define hs_Restart
#define hs_Loop
#define hs_SetCI(time, name)
#define hs_ClearFlags(arg0)
#define hs_SetFlags(arg0)

Referenced by btl_submenu_moves_update().

◆ HES_GreenArrowUp

HudScript HES_GreenArrowUp
extern

◆ HES_HandPointer

HudScript HES_HandPointer
extern

Definition at line 727 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HID_MovesArrowUp

◆ HID_MovesArrowDown

◆ HID_MovesCursor

◆ HID_MovesTitle

◆ HES_MenuStarPower

HudScript HES_MenuStarPower
extern

Definition at line 2168 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_FPCost

HudScript HES_FPCost
extern

Definition at line 1821 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_FPCostReduced

HudScript HES_FPCostReduced
extern

Definition at line 1823 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_FPCostReducedTwice

HudScript HES_FPCostReducedTwice
extern

Definition at line 1825 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_POWCost

HudScript HES_POWCost
extern

Definition at line 1829 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_POWCostReduced

HudScript HES_POWCostReduced
extern

Definition at line 1831 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_POWCostReducedTwice

HudScript HES_POWCostReducedTwice
extern

Definition at line 1833 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_StatusFlower

HudScript HES_StatusFlower
extern

Definition at line 2069 of file global_hud_scripts.c.

2069 {
2071 hs_Loop
2074 hs_End
2075};
#define hs_SetTileSize(size)
#define hs_SetRGBA(time, image)
@ HUD_ELEMENT_SIZE_16x16
Definition hud_element.h:44

Referenced by btl_submenu_moves_update().

◆ HES_NotEnoughFP

HudScript HES_NotEnoughFP
extern

Definition at line 1827 of file global_hud_scripts.c.

Referenced by btl_menu_moves_draw_content().

◆ HES_NotEnoughPOW

HudScript HES_NotEnoughPOW
extern

Definition at line 1835 of file global_hud_scripts.c.

Referenced by btl_menu_moves_draw_content().

◆ MovesMenuPosX

BSS s16 MovesMenuPosX

Definition at line 42 of file menu_moves.c.

Referenced by btl_submenu_moves_update().

◆ MovesMenuPosY

BSS s16 MovesMenuPosY

Definition at line 43 of file menu_moves.c.

Referenced by btl_submenu_moves_update().

◆ MovesMenuState

◆ MovesPrevSelected

BSS s32 MovesPrevSelected

◆ MovesOptionIndexMap

BSS s32 MovesOptionIndexMap[24]

◆ MovesOptionHudScripts

BSS HudScript* MovesOptionHudScripts[24]

◆ MovesOptionHIDs

◆ MovesOptionCostHIDs

◆ MovesOptionNames

BSS MsgID MovesOptionNames[24]

◆ MovesOptionDesc

BSS MsgID MovesOptionDesc[24]

◆ MovesOptionDisplayCosts

◆ MovesOptionDiscounts

BSS s32 MovesOptionDiscounts[24]

◆ MovesOptionDiscountColors

◆ MovesOptionBPCosts

BSS s32 MovesOptionBPCosts[24]

◆ MovesOptionIndices

BSS s32 MovesOptionIndices[24]

Definition at line 61 of file menu_moves.c.

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ MovesOptionEnabled

◆ MovesOptionSortPriority

BSS s8 MovesOptionSortPriority[24]

◆ MovesOptionError

BSS s8 MovesOptionError[24]

◆ MovesOptionCount

◆ MovesCursorPos

◆ MovesPrevCursorPos

BSS s8 MovesPrevCursorPos

Definition at line 68 of file menu_moves.c.

Referenced by btl_submenu_moves_init(), and btl_submenu_moves_update().

◆ MovesVisibleStart

BSS s8 MovesVisibleStart

◆ MovesVisibleEnd

BSS s8 MovesVisibleEnd

◆ MovesMenuLines

BSS s8 MovesMenuLines

◆ MovesDescVisible

◆ MovesScrollOffset

BSS s16 MovesScrollOffset

◆ MovesCursorOffset

BSS s16 MovesCursorOffset

◆ MovesErrorCode

BSS s32 MovesErrorCode

Definition at line 76 of file menu_moves.c.

Referenced by btl_menu_moves_show_error(), and btl_submenu_moves_update().

◆ MovesErrorTimer

BSS s8 MovesErrorTimer

Definition at line 77 of file menu_moves.c.

Referenced by btl_submenu_moves_update().

◆ MovesTextColor

◆ MovesTextAlpha

◆ UsingSpiritsSubmenu

◆ SelectedMovesIndex

◆ ErrorMessageHeight

s16 ErrorMessageHeight[] = { 28, 40 }

Definition at line 85 of file menu_moves.c.

85{ 28, 40 };

Referenced by btl_submenu_moves_update().

◆ ErrorMessageAdjustY

s16 ErrorMessageAdjustY[] = { 0, -2 }

Definition at line 86 of file menu_moves.c.

86{ 0, -2 };

Referenced by btl_menu_moves_show_error().