2#include "message_ids.h"
6#include "sprite/npc/Goombaria.h"
7#include "sprite/npc/WorldGoombario.h"
8#include "sprite/npc/Goompa.h"
31static s32 gPauseTutorialFrameCounter;
35static s32 gPauseCommonIconIDs[8];
36static s32 gPauseShownDescMsg;
37static s32 gPauseDescTextMaxPos;
38static s32 gPauseDescTextPos;
39static s32 gPauseDescTextOffset;
40static HudScript* gPauseShownDescIconScript;
41static s32 gPauseTutorialSprites[3];
63u8
D_8024EFEC[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x11, 0x00, 0x25, 0x00, 0x3C,
64 0x00, 0x55, 0x00, 0x6E };
103u8
gPauseMenuTextScrollInterpEasingLUT[] = { 0, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8};
104u8
gPauseMenuPageScrollInterpEasingLUT[] = { 0, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8};
108 ANIM_Goombaria_Still,
114 ANIM_WorldGoombario_Still,
115 ANIM_WorldGoombario_Idle,
116 ANIM_WorldGoombario_Talk,
128 .vscale = { 640, 480, 511, 0 },
129 .vtrans = { 640, 480, 511, 0 },
137 .pos = { .x = 12, .y = 20 },
151 .pos = { .x = 0, .y = 138 },
165 .pos = { .x = 20, .y = 164 },
179 .pos = { .x = 0, .y = 0 },
205 s8 parent = window->
parent;
237 s8 parent = window->
parent;
266 if ((xDelta == 0) && (yDelta == 0)) {
290 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
297void func_80242FBC(s32 windowIndex, s32*
flags, s32* posX, s32* posY, s32* posZ, f32* scaleX, f32* scaleY,
298 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
307 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
311 if (updateCounter == 0) {
312 window->
flags &= ~WINDOW_FLAG_HIDDEN;
315 if (updateCounter == 5) {
319 if (updateCounter < 10) {
320 *darkening = (updateCounter + 1) * 16;
323 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
328 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
334 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
338void func_802430E4(s32 windowIndex, s32*
flags, s32* posX, s32* posY, s32* posZ, f32* scaleX, f32* scaleY,
339 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
343 if (updateCounter == 0) {
344 window->
flags &= ~WINDOW_FLAG_HIDDEN;
347 if (updateCounter < 16) {
348 *opacity = updateCounter * 16;
351 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
355void func_8024313C(s32 windowIndex, s32*
flags, s32* posX, s32* posY, s32* posZ, f32* scaleX, f32* scaleY,
356 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
360 if (updateCounter < 16) {
361 *opacity = 255 - (updateCounter * 16);
364 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
370 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
374 if (updateCounter == 0) {
375 window->
flags &= ~WINDOW_FLAG_HIDDEN;
377 if (updateCounter < 7) {
383 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
388 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
392 if (updateCounter == 0) {
393 window->
flags &= ~WINDOW_FLAG_HIDDEN;
395 if (updateCounter < 7) {
401 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
406 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
410 if (updateCounter < 5) {
416 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
422 f32* rotX, f32* rotY, f32* rotZ, s32* darkening, s32* opacity) {
426 if (updateCounter < 5) {
432 window->
flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
439 s32 db = abs(deltaBefore);
440 s32 s =
sign(deltaBefore);
453 s32 db = abs(deltaBefore);
454 s32 s =
sign(deltaBefore);
473 if (currentOpacity > 0) {
474 if (currentOpacity > 255) {
475 currentOpacity = 255;
487 s32 msgID = gPauseShownDescMsg;
489 if (msgID == MSG_NONE) {
493 if (gPauseDescTextPos != 0) {
498 if (gPauseDescTextPos < gPauseDescTextMaxPos) {
504 gDPSetScissor(
gMainGfxPos++, G_SC_NON_INTERLACE, baseX + 1, baseY + 1, baseX + width - 1, baseY + height - 1);
506 if (gPauseShownDescIconScript != 0) {
520 f32 (*matrix2ptr)[4];
525 s32 msgMaxLinesPerPage;
528 s32 msgMaxLineChars2;
530 s32 msgMaxLinesPerPage2;
540 gDPSetRenderMode(
gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
541 gDPSetCombineMode(
gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
542 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 55, 55, 55, 255);
543 pause_draw_rect(baseX * 4, baseY * 4, (baseX + width) * 4, (baseY + 12) * 4, 0, 0, 0, 0, 0);
545 gDPSetPrimColor(
gMainGfxPos++, 0, 0, 185, 185, 185, 255);
546 pause_draw_rect(baseX * 4, (baseY + 12) * 4, (baseX + width) * 4, (baseY + height) * 4, 0, 0, 0, 0, 0);
549 guOrthoF(matrix1, 0.0f, 320.0f, 240.0f, 0.0f, -100.0f, 100.0f, 1.0f);
553 for (i = 0; i < 3; i++) {
555 matrix2ptr = matrix2;
559 guScaleF(matrix2ptr, -0.8f, 0.8f, 1.0f);
563 guScaleF(matrix2ptr, -0.8f, 0.8f, 1.0f);
567 guScaleF(matrix2ptr, 0.8f, 0.8f, 1.0f);
572 guRotateF(matrix2ptr, 180.0f, 0.0f, 0.0f, 1.0f);
574 guRotateF(matrix2ptr, 180.0f, 0.0f, 1.0f, 0.0f);
584 margin = (s32)(width - msgWidth) >> 1;
587 gDPSetScissor(
gMainGfxPos++, G_SC_NON_INTERLACE, baseX + 1, baseY + 1, baseX + width - 1, baseY + height - 1);
590 margin2 = (s32)(width - msgWidth2) >> 1;
614 for (i = 0; i <
ARRAY_COUNT(gPauseIconScripts); i++) {
625 gPauseShownDescMsg = 0;
626 gPauseDescTextPos = 0;
627 gPauseDescTextOffset = 0;
628 gPauseDescTextMaxPos = 0;
629 gPauseShownDescIconScript = 0;
636 if ((*menuPanels)->fpInit) {
637 (*menuPanels)->
fpInit(*menuPanels);
642 for (i = 6; i > 0; i--) {
667 s32 pressedOld = *pressed;
668 s32 pressedNew = *pressed;
677 if (pressedOld && pressedNew == 0) {
686 gPauseTutorialFrameCounter = 0;
692 if (--gPauseTutorialFrameCounter <= 0) {
699 gPauseTutorialFrameCounter = 16;
706 if (--gPauseTutorialFrameCounter <= 0) {
714 *pressed = pressedNew;
729 for (i = 0; i <
ARRAY_COUNT(gPauseTutorialSprites); i++) {
751 if (currentDescMsg != gPauseShownDescMsg) {
752 gPauseShownDescMsg = currentDescMsg;
753 gPauseDescTextPos = 0;
754 gPauseDescTextOffset = 0;
755 if (currentDescMsg != 0) {
756 get_msg_properties(currentDescMsg, &height, &width, &maxLineChars, &numLines, NULL, NULL, 0);
760 gPauseDescTextMaxPos = numLines - 2;
761 if (gPauseDescTextMaxPos < 0) {
762 gPauseDescTextMaxPos = 0;
765 gPauseDescTextMaxPos = 0;
769 gPauseDescTextPos -= 2;
770 if (gPauseDescTextPos < 0) {
771 gPauseDescTextPos = 0;
775 gPauseDescTextPos += 2;
776 if (gPauseDescTextPos > gPauseDescTextMaxPos) {
777 gPauseDescTextPos = gPauseDescTextMaxPos;
788 if ((*menuPanels)->initialized) {
789 if ((*menuPanels)->fpUpdate) {
790 (*menuPanels)->
fpUpdate(*menuPanels);
800 for (i = 0; i <
ARRAY_COUNT(gPauseCommonIconIDs); i++) {
805 for (i = 0; i <
ARRAY_COUNT(gPauseTutorialSprites); i++) {
812 if ((*menuPanels)->initialized) {
813 if ((*menuPanels)->fpCleanup) {
832 if (itemID != ITEM_NONE) {
841void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileIdx, s32 uls, s32 ult, s32 dsdx, s32 dtdy) {
842 if (ulx <= -2688 || uly <= -2688 || lrx <= 0 || lry <= 0) {
845 if (ulx >= 1280 || uly >= 960 || lrx >= 2688 || lry >= 2688) {
848 gSPScisTextureRectangle(
gMainGfxPos++, ulx, uly, lrx, lry, tileIdx, uls, ult, dsdx, dtdy);
855 }
else if (len == 2) {
857 if (compare(&arr[0], &arr[1]) > 0) {
872 while ((gap /= 2) != 0) {
875 for (window_end = &arr[gap]; window_end < end; window_end++) {
876 s16* cur_elem = window_end - gap;
880 if (cur_elem >= arr && cur_elem < end) {
882 s16* elem_a = cur_elem;
883 s16* elem_b = cur_elem + gap;
885 if (compare(elem_a, elem_b) > 0) {
893 }
while (cur_elem >= arr && cur_elem < end);
900static const f32 rodata_padding[] = {0.0f, 0.0f, 0.0f};
HudScript HES_PressAButton
HudScript HES_StickTapRight
@ WINDOW_FLAG_INITIAL_ANIMATION
@ WINDOW_FLAG_HIDDEN
Updated but not rendered.
s32 evt_get_variable(Evt *script, Bytecode var)
void set_window_update(s32 panelID, s32)
void basic_window_update(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
void update_window_hierarchy(s32 windowIndex, u8 arg1)
void setup_pause_menu_tab(MenuWindowBP *bpArray, s32 arraySize)
void get_msg_properties(s32 msgID, s32 *height, s32 *width, s32 *maxLineChars, s32 *numLines, s32 *maxLinesPerPage, s32 *arg6, u16 charset)
void enforce_hpfp_limits(void)
void set_game_mode(s32 modeID)
@ GAME_MODE_END_FILE_SELECT
HudScript HES_PressStartButton
HudScript HES_StartButtonText
void hud_element_set_scale(s32 index, f32 scale)
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)
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_DROP_SHADOW
@ HUD_ELEMENT_FLAG_FILTER_TEX
WindowStyleCustom gPauseWS_2
WindowStyleCustom gPauseWS_0
WindowStyleCustom gPauseWS_1
s32 pause_get_menu_msg(s32 index)
@ PAUSE_MSG_TUT_NAME_BADGES
u8 gPauseWindowFlipUpFlags[]
u8 gPauseMenuPageScrollInterpEasingLUT[]
s32 gPauseCursorTargetPosX
void pause_handle_input(s32 pressed, s32 held)
MenuPanel gPausePanelSpirits
s32 gPauseTutorialInputState
s16 gPauseWindowFlipUpAngles_2[]
MenuPanel gPausePanelTabs
void pause_update_page_active_2(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
s32 pause_interp_vertical_scroll(s32 deltaBefore)
void pause_tutorial_draw_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
BSS s8 gPauseMenuCurrentTab
void func_802430E4(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
BSS s32 gPausePressedButtons
s32 gPauseTutorialSpriteAnims[][4]
s32 gPauseTutorialScrollPos
s16 gPauseWindowFlipDownAngles[]
s32 gPauseTutorialDescMessages[]
BSS HudScript * gPauseCurrentDescIconScript
MenuPanel gPausePanelStats
s32 gPauseTutorialCmdMessages[]
void pause_main_draw_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
BSS s32 gPauseCursorIconID
s32 gPauseCursorTargetPosY
void pause_update_page_inactive_2(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
void func_80242FBC(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
s32 pause_get_total_equipped_bp_cost(void)
MenuPanel * gPausePanels[]
s32 pause_interp_text_scroll(s32 deltaBefore)
u8 gPauseWindowFlipDownFlags[]
void pause_set_cursor_opacity(s32 val)
void pause_update_tab_inactive(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
void func_8024313C(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
BSS s32 gPauseHeldButtons
void pause_interp_cursor(void)
void pause_draw_cursor(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
void pause_set_cursor_pos_immediate(s32 windowID, s32 posX, s32 posY)
void pause_update_tab_active(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
u8 gPauseMenuTextScrollInterpEasingLUT[]
MenuPanel gPausePanelItems
void pause_textbox_draw_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
Vp gPauseTutorialViewport
void pause_update_page_inactive_1(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
void pause_update_tab_default(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
s16 gPauseWindowFlipDownAngles_2[]
BSS s32 gPauseCurrentDescMsg
void pause_update_page_active_1(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
s16 gPauseWindowFlipUpAngles[]
s32 gPauseTutorialIconIDs[]
MenuPanel gPausePanelPartners
s32 gPauseTutorialButtons[]
void pause_set_cursor_pos(s32 windowID, s32 posX, s32 posY)
void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileIdx, s32 uls, s32 ult, s32 dsdx, s32 dtdy)
s32 gPauseCursorTargetOpacity
void pause_sort_item_list(s16 *arr, s32 len, s32(*compare)(s16 *, s16 *))
void pause_tutorial_input(s32 *pressed, s32 *held)
MenuWindowBP gPauseCommonWindowsBPs[]
MenuPanel gPausePanelBadges
void sfx_play_sound(s32 soundID)
#define DMA_COPY_SEGMENT(segment)
s32 spr_draw_npc_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR *paletteList, Matrix4f mtx)
s32 spr_update_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale)
s32 spr_free_sprite(s32 spriteInstanceID)
void set_npc_imgfx_all(s32 spriteIdx, ImgFXType imgfxType, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 imgfxArg5)
s32 spr_load_npc_sprite(s32 animID, u32 *extraAnimList)
#define ANIM_LIST_END
Terminates an extraAnimationList.
DisplayContext * gDisplayContext