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 631 of file menu_moves.c.

Referenced by btl_menu_moves_draw_content().

◆ X_VAR1

#define X_VAR1   108

Definition at line 632 of file menu_moves.c.

Referenced by btl_menu_moves_draw_content().

◆ X_VAR2

#define X_VAR2   93

Definition at line 633 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 636 of file menu_moves.c.

636 {
637 s32 target, cur, delta;
638 s32 x1, y1, x2, y2;
639 s32 xPos, yPos;
641 s32 palette;
642 s32 hid;
643 s32 index;
644 s32 i;
645
646 switch (MovesMenuState) {
654 // simple midpoint easing, move half the distance each frame
657 delta = (target - cur) * 0.5;
658 MovesScrollOffset = (delta != 0) ? cur + delta : target;
659
660 x1 = x + 2;
661 x2 = x + 153;
662 y1 = y + 18;
663 y2 = y + 19 + (MovesMenuLines * MENU_LINE_HEIGHT);
665
666 xPos = x + 31;
667 yPos = y + 19 + MovesScrollOffset;
668
669 for (i = 0; i < MovesOptionCount; i++) {
670 // find the array index for current list display index
671 index = MovesOptionIndexMap[i];
672
673 if (i >= MovesVisibleStart - 1 && MovesVisibleStart + MovesMenuLines >= i) {
674 palette = MovesTextColor;
675
676 if (MovesOptionEnabled[index] <= 0) {
677 palette = MSG_PAL_0B;
678 }
679
680 if (MovesOptionNames[index] >= 0) {
681 draw_msg(
683 );
684 }
685
688
689 if (baseCost != 0 && cost <= 0) {
690 cost = 1;
691 }
692
693 if (UsingSpiritsSubmenu ) {
694 if (i == MovesCursorPos) {
695 if (cost == 0 || MovesOptionEnabled[index] <= 0) {
697 } else {
699 }
700 }
701 } else {
702 if (i == MovesCursorPos) {
703 if (cost == 0 || MovesOptionEnabled[index] <= 0) {
705 } else {
707 }
708 }
709 }
710
711 switch (MovesOptionDiscountColors[i]) {
712 case 0:
713 palette = MSG_PAL_STANDARD;
714 break;
715 case 1:
716 palette = MSG_PAL_37;
717 break;
718 default:
719 palette = MSG_PAL_38;
720 break;
721 }
722
723 if (MovesOptionEnabled[index] <= 0) {
724 palette = MSG_PAL_0B;
725 }
726
727 if (MovesOptionDisplayCosts[index] != 0) {
729
734 );
735 if (MovesOptionEnabled[index] <= 0) {
737 }
739 } else {
743 );
744 if (MovesOptionEnabled[index] <= 0) {
746 }
748 }
751 }
752 }
754 }
755
756 // draw option icons
757 xPos = x + 24;
758 yPos = y + 24 + MovesScrollOffset;
759
760 for (i = 0; i < MovesOptionCount; i++) {
761 if (i < MovesVisibleStart - 1) {
763 } else if (MovesVisibleStart + MovesMenuLines < i) {
765 } else {
766 hid = MovesOptionHIDs[i];
771 }
772 }
773
774 // instant snap to target, no easing
777 delta = (target - cur) * 1.0;
778 MovesCursorOffset = (delta != 0) ? cur + delta : target;
779
780 // draw the cursor
781 xPos = x + 10;
782 yPos = y + 26 + MovesCursorOffset;
783
788
789 // draw nav arrows
790 if (MovesVisibleStart > 0) {
792 hud_element_set_render_pos(hid, x + 72, y + 15);
795 }
798 hud_element_set_render_pos(hid, x + 72, y + 100);
801 }
802
804 if (!UsingSpiritsSubmenu) {
806 } else {
808 }
809 }
810 break;
811 }
812}
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:2229
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:631
HudScript HES_NotEnoughFP
#define X_VAR2
Definition menu_moves.c:633
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:632
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 814 of file menu_moves.c.

814 {
815 s32 msgID;
816 s32 posX;
817 s32 posY;
818 s32 opacity;
819 s32 palette;
820
821 if (!UsingSpiritsSubmenu) {
822 msgID = MSG_Menus_Abilities;
823 posX = x + 16;
824 posY = y + 2;
825 opacity = MovesTextAlpha;
826 palette = MSG_PAL_30;
827 } else {
828 msgID = MSG_Menus_StarSpirits;
829 posX = x + 6;
830 posY = y + 2;
831 opacity = MovesTextAlpha;
832 palette = MSG_PAL_31;
833 }
834 draw_msg(msgID, posX, posY, opacity, palette, DRAW_MSG_STYLE_MENU);
835}
@ 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 837 of file menu_moves.c.

837 {
839
840 hud_element_set_render_pos(hid, x + 16, y + 15);
843}
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 845 of file menu_moves.c.

845 {
846 switch (MovesMenuState) {
852 if (MovesDescVisible) {
854 x + 8, y, MovesTextAlpha, MovesTextColor, 0);
855 }
856 break;
857 }
858}
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 860 of file menu_moves.c.

860 {
861 s32 msgID;
862
863 posX += 11;
864 posY += 6;
865 posY += ErrorMessageAdjustY[get_msg_lines(msgID) - 1];
866
867 if (MovesErrorCode != 0) {
869 } else if (UsingSpiritsSubmenu) {
871 } else {
872 msgID = MSG_Menus_NotEnoughFP;
873 }
874 draw_msg(msgID, posX, posY, 255, MSG_PAL_0F, 0);
875}
@ MSG_PAL_0F
Definition enums.h:5005
s32 get_msg_lines(s32 messageID)
Definition msg.c:1985
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
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 msgX;
260 s32 msgID;
261 s32 cond;
263 s32 i;
264 s32 j;
265
266 switch (MovesMenuState) {
270 MovesMenuPosX = 20;
271 MovesMenuPosY = 68;
272
273 for (i = 0; i < MovesOptionCount; i++) {
274 MovesOptionIndexMap[i] = i;
275 }
276
277 if (!UsingSpiritsSubmenu) {
278 for (i = 0; i < (MovesOptionCount - 1); i++) {
279 for (j = i + 1; j < MovesOptionCount; j++) {
282
284 continue;
285 }
286
287 if (
292 )
293 {
297 }
298 }
299 }
300 }
301
302 for (i = 0; i < MovesOptionCount; i++) {
304 MovesOptionHIDs[i] = hid;
307 }
308
313
318
323
324 if (!UsingSpiritsSubmenu) {
328 } else {
333 }
335
336 for (i = 0; i < MovesOptionCount; i++) {
337 if (!UsingSpiritsSubmenu) {
338 switch (MovesOptionDiscountColors[i]) {
339 case 0:
342 break;
343 case 1:
346 break;
347 default:
350 break;
351 }
352 } else {
353 switch (MovesOptionDiscountColors[i]) {
354 case 0:
357 break;
358 case 1:
361 break;
362 default:
365 break;
366 }
367 }
370 }
371
373 x = MovesMenuPosX;
374 y = MovesMenuPosY;
375 if (!UsingSpiritsSubmenu) {
379 } else {
382 set_window_properties(WIN_BTL_SPIRITS_ICON, x + 110, y - 12, 32, 35, 1, btl_menu_moves_show_icon, 0, -1);
383 }
384
387 if (!UsingSpiritsSubmenu) {
390 } else {
393 }
395
396 do {
397 cond = FALSE;
402 if (MovesVisibleStart < 0) {
404 }
405 } else {
406 cond = TRUE;
407 }
408 }
409 } while (cond);
410
415 break;
418
419 // only wrap selection on stick press, not when held
420 if (battleStatus->curButtonsHeld & (BUTTON_STICK_UP | BUTTON_Z)) {
421 if (MovesCursorPos > 0) {
423 } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_UP | BUTTON_Z)) {
425 }
426 }
427
428 if (battleStatus->curButtonsHeld & (BUTTON_STICK_DOWN | BUTTON_R)) {
431 } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_DOWN | BUTTON_R)) {
433 }
434 }
435
436 // wrap the selected index
437 if (MovesCursorPos < 0) {
439 }
441 MovesCursorPos = 0;
442 }
443
447 }
448
451 if (MovesVisibleStart < 0) {
453 }
454 }
455
456 if (MovesCursorPos >= (MovesVisibleEnd - 1)) {
460 if (MovesVisibleStart < 0) {
462 }
463 }
464 }
465
467 if (battleStatus->curButtonsPressed & BUTTON_A) {
471 } else {
475 }
476 break;
477 }
478
479 if (battleStatus->curButtonsPressed & BUTTON_B) {
483 }
484 break;
486 for (i = 0; i < MovesOptionCount; i++) {
487 hid = MovesOptionHIDs[i];
488 hud_element_set_tint(hid, 160, 160, 160);
489 }
493 hud_element_set_tint(HID_MovesTitle, 160, 160, 160);
494
495 for (i = 0; i < MovesOptionCount; i++) {
497 hud_element_set_tint(hid, 160, 160, 160);
498 }
499
503 if (!UsingSpiritsSubmenu) {
506 } else {
509 }
511 if (!UsingSpiritsSubmenu) {
513 } else {
515 }
519 if (!UsingSpiritsSubmenu) {
521 } else {
523 }
524 return POPUP_RESULT_CANCEL;
527 if (!UsingSpiritsSubmenu) {
530 } else {
533 }
535 if (!UsingSpiritsSubmenu) {
537 } else {
539 }
548 if (!UsingSpiritsSubmenu) {
551 } else {
554 }
561 if (!UsingSpiritsSubmenu) {
564 } else {
567 }
570 break;
577 if (!UsingSpiritsSubmenu) {
580 } else {
583 }
585
586 if (MovesErrorCode != 0) {
588 } else if (UsingSpiritsSubmenu) {
590 } else {
591 msgID = MSG_Menus_NotEnoughFP;
592 }
593
594 msgWidth = get_msg_width(msgID, 0) + 23;
595 msgHeight = ErrorMessageHeight[get_msg_lines(msgID) - 1];
596 x = (SCREEN_WIDTH / 2) - (msgWidth / 2);
597 set_window_properties(WIN_BTL_POPUP, x, 80, msgWidth, msgHeight, 20, btl_menu_moves_show_error, NULL, -1);
599 MovesErrorTimer = 60;
604 MovesErrorTimer = 0;
605 }
606 if (MovesErrorTimer != 0) {
609 }
612 if (!UsingSpiritsSubmenu) {
615 } else {
618 }
621 break;
622 }
624}
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)
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.
@ 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:860
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:845
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:814
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:636
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:837
HudScript HES_FPCostReduced
HudScript HES_StatusFlower
HudScript HES_MenuStarPower
void sfx_play_sound(s32 soundID)
#define SCREEN_WIDTH
Definition macros.h:109
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().