2021-04-13 09:47:52 +02:00
|
|
|
#include "common.h"
|
2021-10-18 17:58:32 +02:00
|
|
|
#include "hud_element.h"
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-06-09 21:03:11 +02:00
|
|
|
extern HudScript HES_HandPointer;
|
|
|
|
extern HudScript HES_StatusStarPiece;
|
|
|
|
extern HudScript HES_GreenArrowDown;
|
|
|
|
extern HudScript HES_GreenArrowUp;
|
|
|
|
extern HudScript HES_EmptyBar;
|
|
|
|
extern HudScript HES_PartnerRank1A;
|
|
|
|
extern HudScript HES_PartnerRank1B;
|
|
|
|
extern HudScript HES_PartnerRank2A;
|
|
|
|
extern HudScript HES_PartnerRank2B;
|
|
|
|
|
|
|
|
HudScript* D_80109890[] = { &HES_PartnerRank1A, &HES_PartnerRank2A };
|
|
|
|
HudScript* D_80109898[] = { &HES_PartnerRank1B, &HES_PartnerRank2B };
|
2021-12-28 12:43:24 +01:00
|
|
|
s16 D_801098A0[] = {
|
|
|
|
0x008C, 0x008C, 0x008D, 0x007C, 0x0086, 0x0077, 0x008D, 0x008D, 0x006C, 0x008D, 0x0084, 0x0084, 0x008D, 0x008C,
|
|
|
|
};
|
|
|
|
s16 D_801098BC[] = {
|
|
|
|
0x0089, 0x0085, 0x0089, 0x009A, 0x00A4, 0x0122, 0x0089, 0x0089, 0x00A7, 0x0089, 0x0089, 0x0093, 0x0089, 0x0089,
|
|
|
|
0x0000, 0x0000, 0x0000, 0x0000,
|
|
|
|
};
|
|
|
|
|
|
|
|
extern s32 D_8010D640;
|
|
|
|
extern s32 D_8010D644;
|
|
|
|
extern s32 D_8010D648;
|
|
|
|
extern s32 D_8010D64C;
|
2021-09-25 14:14:28 +02:00
|
|
|
extern s32 D_8010D650;
|
2021-12-28 12:43:24 +01:00
|
|
|
extern s8 D_8010D654;
|
|
|
|
extern s8 D_8010D655;
|
2022-10-04 16:09:23 +02:00
|
|
|
extern s8 D_8010D656;
|
2021-12-28 12:43:24 +01:00
|
|
|
extern s16 D_8010D658;
|
|
|
|
extern s16 D_8010D65A;
|
|
|
|
extern s32 D_8010D65C;
|
2021-09-25 14:14:28 +02:00
|
|
|
extern s32 D_8010D660;
|
|
|
|
extern s32 D_8010D664;
|
|
|
|
extern s32 D_8010D668;
|
|
|
|
extern s32 D_8010D66C;
|
|
|
|
extern s32 D_8010D670;
|
|
|
|
extern s32 D_8010D674;
|
|
|
|
extern s32 D_8010D678;
|
2021-12-28 12:43:24 +01:00
|
|
|
extern s16 D_8010D67C;
|
|
|
|
extern s16 D_8010D67E;
|
|
|
|
extern s16 D_8010D680;
|
|
|
|
extern s16 D_8010D682;
|
|
|
|
extern s16 D_8010D684;
|
|
|
|
extern s16 D_8010D686;
|
|
|
|
extern s16 D_8010D688;
|
|
|
|
extern s16 D_8010D68A;
|
|
|
|
extern s16 D_8010D68C;
|
2022-10-04 16:09:23 +02:00
|
|
|
extern s8 D_8010D68E; // bool
|
2021-09-25 14:14:28 +02:00
|
|
|
extern s8 D_8010D68F;
|
2021-12-28 12:43:24 +01:00
|
|
|
extern s8 D_8010D690;
|
2021-09-25 14:14:28 +02:00
|
|
|
extern s8 D_8010D691;
|
|
|
|
extern s8 D_8010D692;
|
2022-10-04 16:09:23 +02:00
|
|
|
extern s8 D_8010D693;
|
2021-09-25 14:14:28 +02:00
|
|
|
extern s32 D_8010D694;
|
|
|
|
extern s8 D_8010D698;
|
2021-12-28 12:43:24 +01:00
|
|
|
extern s8 D_8010D699;
|
|
|
|
extern s8 D_8010D69A;
|
|
|
|
extern PopupMenu* gPopupMenu;
|
|
|
|
extern MessagePrintState* D_8010D6A0;
|
|
|
|
extern s32 D_8010D6A4;
|
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
s8 func_800E98D4(void);
|
|
|
|
|
|
|
|
enum PopupTypes {
|
|
|
|
POPUP_TYPE_USE_ITEM,
|
|
|
|
POPUP_TYPE_SWITCH_PARTNER,
|
|
|
|
POPUP_TYPE_THROW_AWAY_ITEM,
|
|
|
|
POPUP_TYPE_TRADE_FOR_BADGE,
|
|
|
|
POPUP_TYPE_UPGRADE_PARTNER,
|
|
|
|
POPUP_TYPE_SELL_ITEM,
|
|
|
|
POPUP_TYPE_CHECK_ITEM,
|
|
|
|
POPUP_TYPE_CLAIM_ITEM,
|
|
|
|
POPUP_TYPE_READ_LETTER,
|
|
|
|
POPUP_TYPE_TAKE_FROM_CHEST,
|
|
|
|
POPUP_TYPE_READ_DIARY_PAGE,
|
|
|
|
POPUP_TYPE_READ_POSTCARD,
|
|
|
|
POPUP_TYPE_USE_KEY,
|
|
|
|
};
|
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
void popup_menu_draw_menu_contents(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening);
|
|
|
|
void popup_menu_draw_title_contents(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening);
|
|
|
|
void func_800F48F4(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening);
|
|
|
|
void func_800F4944(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening);
|
|
|
|
void func_800F4C1C(PopupMessage* popup, s32 x, s32 y);
|
|
|
|
void func_800F4C6C(PopupMessage* popup, s32 x, s32 y);
|
|
|
|
void func_800F4CF0(PopupMessage* popup, s32 x, s32 y);
|
|
|
|
void func_800F4D28(PopupMessage* popup, s32 x, s32 y);
|
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
void hide_popup_menu(void) {
|
|
|
|
if (D_8010D68E) {
|
|
|
|
switch (gPopupMenu->popupType) {
|
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
|
|
|
set_window_update(WINDOW_ID_14, (s32) basic_hidden_window_update);
|
|
|
|
set_window_update(WINDOW_ID_19, (s32) basic_hidden_window_update);
|
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
|
|
|
set_window_update(WINDOW_ID_14, (s32) basic_hidden_window_update);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
set_window_update(WINDOW_ID_21, 2);
|
|
|
|
} else {
|
|
|
|
switch (gPopupMenu->popupType) {
|
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
|
|
|
set_window_update(WINDOW_ID_14, 2);
|
|
|
|
set_window_update(WINDOW_ID_19, 2);
|
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
|
|
|
set_window_update(WINDOW_ID_14, 2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
|
|
|
set_window_update(WINDOW_ID_16, (s32) basic_hidden_window_update);
|
|
|
|
set_window_update(WINDOW_ID_20, (s32) basic_hidden_window_update);
|
|
|
|
}
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
|
|
|
set_window_update(WINDOW_ID_18, (s32) basic_hidden_window_update);
|
|
|
|
}
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
|
|
|
set_window_update(WINDOW_ID_16, (s32) basic_hidden_window_update);
|
|
|
|
set_window_update(WINDOW_ID_20, (s32) basic_hidden_window_update);
|
|
|
|
}
|
|
|
|
D_8010D640 = 10;
|
|
|
|
D_8010D644 = D_8010D692;
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
void destroy_popup_menu(void) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(D_8010D65C);
|
|
|
|
hud_element_free(D_8010D678);
|
|
|
|
hud_element_free(D_8010D66C);
|
|
|
|
hud_element_free(D_8010D670);
|
|
|
|
hud_element_free(D_8010D674);
|
2021-09-25 14:14:28 +02:00
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
if (gPopupMenu->popupType == POPUP_TYPE_TRADE_FOR_BADGE) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(D_8010D660);
|
|
|
|
hud_element_free(D_8010D664);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
if (gPopupMenu->popupType == POPUP_TYPE_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(D_8010D660);
|
|
|
|
hud_element_free(D_8010D664);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
if (gPopupMenu->popupType == POPUP_TYPE_SWITCH_PARTNER || gPopupMenu->popupType == POPUP_TYPE_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(D_8010D668);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
if (gPopupMenu->popupType == POPUP_TYPE_SELL_ITEM) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(D_8010D660);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
if ((gPopupMenu->popupType <= POPUP_TYPE_USE_ITEM ||
|
|
|
|
gPopupMenu->popupType == POPUP_TYPE_SWITCH_PARTNER ||
|
|
|
|
gPopupMenu->popupType == POPUP_TYPE_THROW_AWAY_ITEM ||
|
|
|
|
gPopupMenu->popupType == POPUP_TYPE_TRADE_FOR_BADGE ||
|
|
|
|
gPopupMenu->popupType == POPUP_TYPE_UPGRADE_PARTNER ||
|
|
|
|
gPopupMenu->popupType == POPUP_TYPE_USE_KEY
|
2021-09-25 14:14:28 +02:00
|
|
|
) && !gGameStatusPtr->isBattle) {
|
|
|
|
if (D_8010D69A == 0) {
|
2022-12-06 00:29:22 +01:00
|
|
|
status_menu_respond_to_changes();
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
close_status_menu();
|
|
|
|
}
|
|
|
|
|
|
|
|
D_8010D640 = -4;
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
void func_800F16CC(void) {
|
|
|
|
if (D_8010D68E) {
|
|
|
|
switch (gPopupMenu->popupType) {
|
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
|
|
|
set_window_update(WINDOW_ID_14, (s32) basic_window_update);
|
|
|
|
sfx_play_sound(SOUND_1);
|
|
|
|
set_window_update(WINDOW_ID_19, (s32) basic_window_update);
|
|
|
|
break;
|
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
set_window_update(WINDOW_ID_14, (s32) basic_window_update);
|
|
|
|
sfx_play_sound(SOUND_2);
|
|
|
|
set_window_update(WINDOW_ID_19, (s32) basic_window_update);
|
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
|
|
|
set_window_update(WINDOW_ID_14, (s32) basic_window_update);
|
|
|
|
sfx_play_sound(SOUND_1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
set_window_update(WINDOW_ID_21, (s32) basic_window_update);
|
|
|
|
} else {
|
|
|
|
switch (gPopupMenu->popupType) {
|
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
|
|
|
set_window_update(WINDOW_ID_14, 1);
|
|
|
|
set_window_update(WINDOW_ID_19, 1);
|
|
|
|
break;
|
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
set_window_update(WINDOW_ID_14, 1);
|
|
|
|
set_window_update(WINDOW_ID_19, 1);
|
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
|
|
|
set_window_update(WINDOW_ID_14, 1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
|
|
|
set_window_update(WINDOW_ID_16, (s32) basic_window_update);
|
|
|
|
set_window_update(WINDOW_ID_20, (s32) basic_window_update);
|
|
|
|
}
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
|
|
|
set_window_update(WINDOW_ID_18, (s32) basic_window_update);
|
|
|
|
}
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
|
|
|
set_window_update(WINDOW_ID_16, (s32) basic_window_update);
|
|
|
|
}
|
|
|
|
hud_element_set_tint(D_8010D65C, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D678, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D66C, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D670, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D674, 255, 255, 255);
|
|
|
|
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
|
|
|
hud_element_set_tint(D_8010D660, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D664, 255, 255, 255);
|
|
|
|
}
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
|
|
|
hud_element_set_tint(D_8010D660, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D664, 255, 255, 255);
|
|
|
|
}
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SWITCH_PARTNER || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
|
|
|
hud_element_set_tint(D_8010D668, 255, 255, 255);
|
|
|
|
}
|
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
|
|
|
hud_element_set_tint(D_8010D660, 255, 255, 255);
|
|
|
|
}
|
|
|
|
hud_element_set_script(D_8010D66C, &HES_AnimatedHandPointer);
|
2022-11-02 13:30:07 +01:00
|
|
|
D_8010D690 = MSG_PAL_STANDARD;
|
2022-10-04 16:09:23 +02:00
|
|
|
D_8010D640 = 0x14;
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
s32 popup_menu_update(void) {
|
|
|
|
s32 posX;
|
|
|
|
s32 posY;
|
|
|
|
s32 width;
|
|
|
|
s32 elementID;
|
|
|
|
s32 cond;
|
|
|
|
s32 buttons;
|
|
|
|
s32 msgID;
|
|
|
|
s32 one;
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
switch (D_8010D640) {
|
|
|
|
case 0:
|
|
|
|
D_8010D67C = 20;
|
|
|
|
D_8010D67E = 72;
|
|
|
|
D_8010D680 = 20;
|
|
|
|
D_8010D682 = 186;
|
|
|
|
D_8010D684 = 16;
|
|
|
|
D_8010D686 = 88;
|
|
|
|
D_8010D688 = 32;
|
|
|
|
D_8010D68A = 164;
|
2022-10-04 16:09:23 +02:00
|
|
|
if (D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D67C = D_801098A0[gPopupMenu->popupType] + 20;
|
|
|
|
}
|
|
|
|
if (D_8010D68F >= 7) {
|
|
|
|
D_8010D67E = 62;
|
|
|
|
}
|
|
|
|
D_8010D68C = 0;
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = hud_element_create(&HES_EmptyBar);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D65C = elementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
|
|
|
hud_element_set_tint(elementID, 255, 255, 255);
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType != POPUP_MENU_THROW_AWAY_ITEM) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
one = 1; // required to match (why is 1 loaded so early?)
|
2022-03-26 12:47:10 +01:00
|
|
|
elementID = hud_element_create(gPopupMenu->ptrIcon[0]);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D678 = elementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_scale(elementID, 0.45f);
|
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_FILTER_TEX | HUD_ELEMENT_FLAGS_80);
|
2021-12-28 12:43:24 +01:00
|
|
|
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = hud_element_create(&HES_AnimatedHandPointer);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D66C = elementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80);
|
2021-12-28 12:43:24 +01:00
|
|
|
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = hud_element_create(&HES_GreenArrowUp);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D670 = elementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80);
|
2021-12-28 12:43:24 +01:00
|
|
|
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = hud_element_create(&HES_GreenArrowDown);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D674 = elementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80);
|
2021-12-28 12:43:24 +01:00
|
|
|
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
2022-06-09 21:03:11 +02:00
|
|
|
D_8010D660 = hud_element_create(&HES_StatusStarPiece);
|
2021-12-28 12:43:24 +01:00
|
|
|
elementID = D_8010D660;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
|
|
|
hud_element_set_tint(elementID, 255, 255, 255);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-06-09 21:03:11 +02:00
|
|
|
D_8010D660 = hud_element_create(&HES_StatusStarPiece);
|
2021-12-28 12:43:24 +01:00
|
|
|
elementID = D_8010D660;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_FILTER_TEX | HUD_ELEMENT_FLAGS_80);
|
|
|
|
hud_element_set_tint(elementID, 255, 255, 255);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
2022-06-09 21:03:11 +02:00
|
|
|
D_8010D660 = hud_element_create(&HES_StatusCoin);
|
2021-12-28 12:43:24 +01:00
|
|
|
elementID = D_8010D660;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
|
|
|
hud_element_set_tint(elementID, 255, 255, 255);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-06-09 21:03:11 +02:00
|
|
|
D_8010D664 = hud_element_create(&HES_MenuTimes);
|
2021-12-28 12:43:24 +01:00
|
|
|
elementID = D_8010D664;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
|
|
|
hud_element_set_tint(elementID, 255, 255, 255);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == one || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
D_8010D668 = hud_element_create(D_80109890[0]);
|
2021-12-28 12:43:24 +01:00
|
|
|
elementID = D_8010D668;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
|
|
|
hud_element_set_tint(elementID, 255, 255, 255);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
D_8010D65A = -200;
|
|
|
|
D_8010D644 = D_8010D691;
|
2022-10-04 16:09:23 +02:00
|
|
|
if (!D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D644 = 1;
|
|
|
|
}
|
2022-11-02 13:30:07 +01:00
|
|
|
D_8010D690 = MSG_PAL_STANDARD;
|
2021-12-28 12:43:24 +01:00
|
|
|
|
|
|
|
posX = D_8010D67C;
|
|
|
|
posY = D_8010D67E;
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_USEKEY:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0x91, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
if (gPopupMenu->unk_31C == 0) {
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 0x19, -6, 0x5F, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2021-12-28 12:43:24 +01:00
|
|
|
} else {
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 0xC, -6, 0x79, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0x8B, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_17, 0xD, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0xA2, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 0x11, -6, 0x60, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0x92, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_17, 0xC, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0xA7, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 0x16, -6, 0x5F, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0xAA, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 0x20, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0x91, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 0xC, -6, 0x79, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0x80, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 0xC, -6, 0x68, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0x95, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_15, 6, -6, 0x8B, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_D:
|
|
|
|
set_window_properties(WINDOW_ID_14, posX, posY, 0x83, (D_8010D656 * 13) + 0x1A, 0x14, popup_menu_draw_menu_contents, NULL, -1);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_17, 0xA, -6, 0x72, 0x10, 0x15, popup_menu_draw_title_contents, NULL, 0xE);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_15, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_17, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_16, 0x7E, -0xE, 0x20, 0x20, 0x15, func_800F4C6C, NULL, 0xE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SELL_ITEM:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_16, 0x83, -0xE, 0x20, 0x20, 0x15, func_800F4C6C, NULL, 0xE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
|
|
|
set_window_properties(WINDOW_ID_20, D_8010D688, D_8010D68A, 0x40, 0x14, 0x15, func_800F4D28, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
cond = FALSE;
|
|
|
|
if (D_8010D648 >= D_8010D654 + D_8010D655 - 1) {
|
|
|
|
D_8010D654++;
|
|
|
|
if (D_8010D654 > gPopupMenu->numEntries - D_8010D68F) {
|
|
|
|
D_8010D654 = gPopupMenu->numEntries - D_8010D68F;
|
|
|
|
if (D_8010D654 < 0) {
|
|
|
|
D_8010D654 = 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
cond = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (cond);
|
|
|
|
|
|
|
|
D_8010D655 = D_8010D654 + D_8010D68F;
|
2022-10-04 16:09:23 +02:00
|
|
|
D_8010D658 = -D_8010D654 * 13;
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType >= POPUP_MENU_USE_ITEM
|
2022-10-04 16:09:23 +02:00
|
|
|
&& (gPopupMenu->popupType < POPUP_MENU_READ_DIARY_PAGE || gPopupMenu->popupType == POPUP_MENU_USEKEY))
|
|
|
|
{
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_19, D_8010D680, D_8010D682, 0x118, 0x20, 0x14, func_800F48F4, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
posX = D_8010D684;
|
|
|
|
posY = D_8010D686;
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_21, posX, posY, 0x90, 0x20, 0x14, func_800F4944, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_D:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_21, posX, posY, 0x90, 0x28, 0x14, func_800F4944, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_21, posX, posY, 0x80, 0x28, 0x14, func_800F4944, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_21, posX, posY, 0x88, 0x28, 0x14, func_800F4944, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_LETTER:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_21, posX, posY, 0x70, 0x28, 0x14, func_800F4944, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SELL_ITEM:
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_21, posX, posY, 0x78, 0x20, 0x14, func_800F4944, NULL, -1);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
if (!D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, (s32)basic_window_update);
|
2022-09-08 14:21:07 +02:00
|
|
|
sfx_play_sound(SOUND_1);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_19, (s32)basic_window_update);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, (s32)basic_window_update);
|
2022-09-08 14:21:07 +02:00
|
|
|
sfx_play_sound(SOUND_2);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_19, (s32)basic_window_update);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, (s32)basic_window_update);
|
2022-09-08 14:21:07 +02:00
|
|
|
sfx_play_sound(SOUND_1);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_21, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_16, (s32)basic_window_update);
|
|
|
|
set_window_update(WINDOW_ID_20, (s32)basic_window_update);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_18, (s32)basic_window_update);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_16, (s32)basic_window_update);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
D_8010D640 = 1;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
if (D_8010D644 != 0) {
|
|
|
|
D_8010D644--;
|
|
|
|
} else {
|
|
|
|
D_8010D64C = D_8010D648;
|
|
|
|
|
2022-06-13 18:34:22 +02:00
|
|
|
if (gGameStatusPtr->heldButtons[0] & (BUTTON_STICK_UP | BUTTON_Z) &&
|
2022-08-06 14:14:04 +02:00
|
|
|
(D_8010D648 > 0 || (gGameStatusPtr->pressedButtons[0] & (BUTTON_STICK_UP | BUTTON_Z))))
|
2021-12-28 12:43:24 +01:00
|
|
|
{
|
|
|
|
do {
|
|
|
|
D_8010D648--;
|
|
|
|
} while (0); // required to match
|
|
|
|
}
|
|
|
|
|
2022-06-13 18:34:22 +02:00
|
|
|
if (gGameStatusPtr->heldButtons[0] & (BUTTON_STICK_DOWN | BUTTON_R) &&
|
|
|
|
((D_8010D648 < gPopupMenu->numEntries - 1) || (gGameStatusPtr->pressedButtons[0] & (BUTTON_STICK_DOWN | BUTTON_R))))
|
2021-12-28 12:43:24 +01:00
|
|
|
{
|
|
|
|
do {
|
|
|
|
D_8010D648++;
|
|
|
|
} while (0); // required to match
|
|
|
|
}
|
|
|
|
|
|
|
|
if (D_8010D648 < 0) {
|
|
|
|
D_8010D648 = gPopupMenu->numEntries - 1;
|
|
|
|
}
|
|
|
|
if (D_8010D648 > gPopupMenu->numEntries - 1) {
|
|
|
|
D_8010D648 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (D_8010D64C != D_8010D648) {
|
2022-02-08 19:24:51 +01:00
|
|
|
sfx_play_sound(SOUND_MENU_CHANGE_SELECTION);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
if (D_8010D648 < D_8010D654 + 1) {
|
|
|
|
D_8010D654--;
|
|
|
|
if (D_8010D654 < 0) {
|
|
|
|
D_8010D654 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
if (D_8010D648 >= D_8010D655 - 1) {
|
|
|
|
D_8010D654++;
|
|
|
|
if (D_8010D654 > gPopupMenu->numEntries - D_8010D68F) {
|
|
|
|
D_8010D654 = gPopupMenu->numEntries - D_8010D68F;
|
|
|
|
if (D_8010D654 < 0) {
|
|
|
|
D_8010D654 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
D_8010D655 = D_8010D654 + D_8010D68F;
|
|
|
|
}
|
|
|
|
|
2022-06-13 18:34:22 +02:00
|
|
|
if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
|
2021-12-28 12:43:24 +01:00
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_LETTER:
|
2021-12-28 12:43:24 +01:00
|
|
|
sfx_play_sound(SOUND_MENU_NEXT);
|
2022-10-04 16:09:23 +02:00
|
|
|
if (!D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = -1;
|
|
|
|
} else {
|
|
|
|
D_8010D640 = -2;
|
|
|
|
}
|
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_D:
|
2021-12-28 12:43:24 +01:00
|
|
|
sfx_play_sound(SOUND_MENU_NEXT);
|
2022-10-04 16:09:23 +02:00
|
|
|
if (!D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = -1;
|
|
|
|
} else {
|
|
|
|
D_8010D640 = -2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (gPopupMenu->enabled[D_8010D648]) {
|
|
|
|
sfx_play_sound(SOUND_MENU_NEXT);
|
2022-10-04 16:09:23 +02:00
|
|
|
if (!D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = -1;
|
|
|
|
} else {
|
|
|
|
D_8010D640 = -2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2022-10-04 16:09:23 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SWITCH_PARTNER) {
|
2022-02-08 19:24:51 +01:00
|
|
|
sfx_play_sound(SOUND_MENU_ERROR);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = 0x1E;
|
|
|
|
break;
|
|
|
|
}
|
2022-10-04 16:09:23 +02:00
|
|
|
if (D_8010D68E && (gPopupMenu->popupType == POPUP_MENU_USE_ITEM || gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE)) {
|
2022-02-08 19:24:51 +01:00
|
|
|
sfx_play_sound(SOUND_MENU_ERROR);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_USEKEY:
|
|
|
|
if (D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
buttons = BUTTON_B | BUTTON_C_LEFT;
|
|
|
|
} else {
|
|
|
|
buttons = BUTTON_B;
|
|
|
|
}
|
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
if (D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
buttons = BUTTON_B | BUTTON_C_RIGHT;
|
|
|
|
} else {
|
|
|
|
buttons = BUTTON_B;
|
|
|
|
}
|
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
2021-12-28 12:43:24 +01:00
|
|
|
buttons = BUTTON_B;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
buttons = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-06-13 18:34:22 +02:00
|
|
|
if (gGameStatusPtr->pressedButtons[0] & buttons) {
|
2022-06-10 20:06:12 +02:00
|
|
|
sfx_play_sound(SOUND_MENU_BACK);
|
2021-12-28 12:43:24 +01:00
|
|
|
if (D_8010D698 != 0) {
|
2022-10-04 16:09:23 +02:00
|
|
|
if (!D_8010D68E) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = -3;
|
|
|
|
} else {
|
|
|
|
D_8010D640 = -7;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (D_8010D699 == 0) {
|
|
|
|
D_8010D640 = 30;
|
|
|
|
} else {
|
|
|
|
D_8010D640 = 100;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (gPopupMenu->popupType) {
|
|
|
|
default:
|
|
|
|
buttons = 0;
|
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
2021-12-28 12:43:24 +01:00
|
|
|
buttons = BUTTON_C_RIGHT;
|
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
2021-12-28 12:43:24 +01:00
|
|
|
buttons = BUTTON_C_LEFT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
if (D_8010D68E && (gGameStatusPtr->pressedButtons[0] & buttons)) {
|
2022-06-10 20:06:12 +02:00
|
|
|
sfx_play_sound(SOUND_MENU_BACK);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = -6;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -1:
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D65C, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D678, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D66C, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D670, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D674, 160, 160, 160);
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(D_8010D66C, &HES_HandPointer);
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D664, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D664, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-10-04 16:09:23 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SWITCH_PARTNER || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D668, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-11-02 13:30:07 +01:00
|
|
|
D_8010D690 = MSG_PAL_0D;
|
2021-12-28 12:43:24 +01:00
|
|
|
|
|
|
|
gPopupMenu->result = D_8010D648 + 1;
|
|
|
|
return D_8010D648 + 1;
|
|
|
|
case -2:
|
|
|
|
gPopupMenu->result = D_8010D648 + 1;
|
|
|
|
return D_8010D648 + 1;
|
|
|
|
case -3:
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
destroy_popup_menu();
|
2022-11-22 05:12:28 +01:00
|
|
|
free_worker(D_8010D694);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = -5;
|
|
|
|
gPopupMenu->result = 255;
|
|
|
|
return 255;
|
|
|
|
case -4:
|
2022-11-22 05:12:28 +01:00
|
|
|
free_worker(D_8010D694);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = -5;
|
|
|
|
gPopupMenu->result = 255;
|
|
|
|
return 255;
|
|
|
|
case -6:
|
|
|
|
gPopupMenu->result = -2;
|
|
|
|
return 255;
|
|
|
|
case -7:
|
|
|
|
case -5:
|
|
|
|
gPopupMenu->result = 255;
|
|
|
|
return 255;
|
|
|
|
case 10:
|
|
|
|
D_8010D644--;
|
|
|
|
if (D_8010D644 == 0) {
|
|
|
|
D_8010D640 = 0xB;
|
|
|
|
gPopupMenu->result = D_8010D648 + 1;
|
|
|
|
return D_8010D648 + 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 20:
|
|
|
|
D_8010D644++;
|
|
|
|
if (D_8010D644 >= D_8010D692) {
|
|
|
|
D_8010D640 = 1;
|
|
|
|
gPopupMenu->result = D_8010D648 + 1;
|
|
|
|
return D_8010D648 + 1;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 30:
|
|
|
|
D_8010D640 = 0x1F;
|
|
|
|
gPopupMenu->result = -1;
|
|
|
|
return 0;
|
|
|
|
case 31:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
|
2022-10-04 16:09:23 +02:00
|
|
|
if (D_8010D68E) {
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_21, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
width = get_msg_width(0x1D006B, 0) + 23;
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_9, 160 - (width / 2), 0x50, width, 0x28, 0x14, func_800F4CF0, NULL, -1);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_9, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D644 = 0x3C;
|
|
|
|
D_8010D640 = 0x20;
|
|
|
|
return 0;
|
|
|
|
case 32:
|
2022-06-13 18:34:22 +02:00
|
|
|
if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_B | BUTTON_C_RIGHT)) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D644 = 0;
|
|
|
|
}
|
|
|
|
if (D_8010D644 != 0) {
|
|
|
|
D_8010D644--;
|
|
|
|
return 0;
|
|
|
|
}
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_9, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
|
2022-10-04 16:09:23 +02:00
|
|
|
if (D_8010D68E) {
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_21, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
D_8010D640 = 1;
|
|
|
|
gPopupMenu->result = 0;
|
|
|
|
break;
|
|
|
|
case 100:
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D65C, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D678, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D66C, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D670, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D674, 160, 160, 160);
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(D_8010D66C, &HES_HandPointer);
|
2021-12-28 12:43:24 +01:00
|
|
|
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D664, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D664, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == 1 || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D668, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-11-02 13:30:07 +01:00
|
|
|
D_8010D690 = MSG_PAL_0D;
|
2021-12-28 12:43:24 +01:00
|
|
|
if (D_8010D699 == 1) {
|
|
|
|
msgID = 0x1D0068;
|
|
|
|
} else {
|
|
|
|
msgID = 0x1D0069;
|
|
|
|
}
|
|
|
|
width = get_msg_width(msgID, 0) + 23;
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_21, 160 - (width / 2), 76, width, 32, 0x13, func_800F4C1C, NULL, -1);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_21, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D6A0 = msg_get_printer_for_msg(0x1E001D, &D_8010D6A4);
|
|
|
|
msg_printer_set_origin_pos(D_8010D6A0, 160, 0x90);
|
|
|
|
D_8010D640 = 0x65;
|
|
|
|
break;
|
|
|
|
case 101:
|
|
|
|
if (D_8010D6A4 == 1) {
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_21, WINDOW_UPDATE_HIDE);
|
2021-12-28 12:43:24 +01:00
|
|
|
switch (D_8010D6A0->currentOption) {
|
|
|
|
case 0:
|
|
|
|
D_8010D640 = 0x66;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
D_8010D640 = 0x67;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 102:
|
|
|
|
D_8010D640 = -3;
|
|
|
|
break;
|
|
|
|
case 103:
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D65C, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D678, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D66C, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D670, 255, 255, 255);
|
|
|
|
hud_element_set_tint(D_8010D674, 255, 255, 255);
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_TRADE_FOR_BADGE) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D664, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
|
|
|
hud_element_set_tint(D_8010D664, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == 1 || gPopupMenu->popupType == POPUP_MENU_UPGRADE_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D668, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-08-06 14:14:04 +02:00
|
|
|
if (gPopupMenu->popupType == POPUP_MENU_SELL_ITEM) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_tint(D_8010D660, 160, 160, 160);
|
2021-12-28 12:43:24 +01:00
|
|
|
}
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(D_8010D66C, &HES_HandPointer);
|
2021-12-28 12:43:24 +01:00
|
|
|
|
|
|
|
switch (gPopupMenu->popupType) {
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
case POPUP_MENU_USEKEY:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
|
|
|
|
set_window_update(WINDOW_ID_19, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
2022-10-04 16:09:23 +02:00
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
case POPUP_MENU_D:
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_14, WINDOW_UPDATE_SHOW);
|
2021-12-28 12:43:24 +01:00
|
|
|
break;
|
|
|
|
}
|
2022-11-02 13:30:07 +01:00
|
|
|
D_8010D690 = MSG_PAL_STANDARD;
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D640 = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gPopupMenu->result = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-06-30 04:27:12 +02:00
|
|
|
INCLUDE_ASM(s32, "8a860_len_3f30", popup_menu_draw_menu_contents);
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
void popup_menu_draw_title_contents(
|
|
|
|
s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
|
|
|
|
{
|
|
|
|
switch (gPopupMenu->popupType) {
|
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
switch (gPopupMenu->unk_31C) {
|
|
|
|
case 0:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D003F, baseX + 26, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0041, baseX + 4, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
|
|
|
draw_number(gPopupMenu->unk_320, baseX + 94, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT);
|
|
|
|
draw_number(2, baseX + 114, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0042, baseX + 6, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
|
|
|
draw_number(gPopupMenu->unk_320, baseX + 94, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT);
|
|
|
|
draw_number(3, baseX + 114, baseY + 2, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_32, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1F0032, baseX + 27, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1F0033, baseX + 23, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D00D7, baseX + 4, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D00CE, baseX + 8, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D00D0, baseX + 6, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_USEKEY:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D003F, baseX + 27, baseY + 2, D_8010D650, MSG_PAL_32, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
case POPUP_MENU_D:
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D003D, baseX + 8, baseY + 2, D_8010D650, MSG_PAL_34, DRAW_MSG_STYLE_MENU);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
void func_800F48F4(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
|
|
|
|
draw_msg(gPopupMenu->descMsg[D_8010D648], baseX + 8, baseY, D_8010D650, D_8010D690, 0);
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
void func_800F4944(s32* userData, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) {
|
|
|
|
s32 msgWidth;
|
|
|
|
|
|
|
|
baseY += 7;
|
|
|
|
|
|
|
|
if (D_8010D68E) {
|
|
|
|
switch (gPopupMenu->popupType) {
|
|
|
|
case POPUP_MENU_USE_ITEM:
|
|
|
|
msgWidth = get_msg_width(0x1D0061, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0061, baseX, baseY, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_SWITCH_PARTNER:
|
|
|
|
msgWidth = get_msg_width(0x1D0063, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0063, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_THROW_AWAY_ITEM:
|
|
|
|
msgWidth = get_msg_width(0x1D0064, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0064, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_TRADE_FOR_BADGE:
|
|
|
|
msgWidth = get_msg_width(0x1D0070, 0);
|
|
|
|
baseX += 64 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0070, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_UPGRADE_PARTNER:
|
|
|
|
msgWidth = get_msg_width(0x1D006A, 0);
|
|
|
|
baseX += 68 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D006A, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_SELL_ITEM:
|
|
|
|
msgWidth = get_msg_width(0x1D0065, 0);
|
|
|
|
baseX += 60 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0065, baseX, baseY, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_CHECK_ITEM:
|
|
|
|
msgWidth = get_msg_width(0x1D0066, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0066, baseX, baseY, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_CLAIM_ITEM:
|
|
|
|
msgWidth = get_msg_width(0x1D0067, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0067, baseX, baseY, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_D:
|
|
|
|
msgWidth = get_msg_width(0x1D006F, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D006F, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_LETTER:
|
|
|
|
msgWidth = get_msg_width(0x1D006D, 0);
|
|
|
|
baseX += 56 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_TAKE_FROM_CHEST:
|
|
|
|
msgWidth = get_msg_width(0x1D00D6, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D00D6, baseX, baseY, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_DIARY_PAGE:
|
|
|
|
msgWidth = get_msg_width(0x1D006C, 0);
|
|
|
|
baseX += 64 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D006C, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_READ_POSTCARD:
|
|
|
|
msgWidth = get_msg_width(0x1D006D, 0);
|
|
|
|
baseX += 64 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D006D, baseX, baseY - 4, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
case POPUP_MENU_USEKEY:
|
|
|
|
msgWidth = get_msg_width(0x1D0062, 0);
|
|
|
|
baseX += 72 - (msgWidth / 2);
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D0062, baseX, baseY, 255, MSG_PAL_0F, 0);
|
2022-10-04 16:09:23 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
void func_800F4C1C(PopupMessage* popup, s32 x, s32 y) {
|
|
|
|
s32 msg = 0x1D0069;
|
|
|
|
s32 xPos = x + 11;
|
|
|
|
s32 yPos = y + 8;
|
|
|
|
|
|
|
|
if (D_8010D699 == 1) {
|
|
|
|
msg = 0x1D0068;
|
|
|
|
}
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(msg, xPos, yPos, 255, MSG_PAL_0F, 0);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
void func_800F4C6C(PopupMessage* popup, s32 x, s32 y) {
|
|
|
|
s32 hudElement;
|
|
|
|
s32 xPos;
|
|
|
|
s32 yPos;
|
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
switch (gPopupMenu->popupType) {
|
2021-09-25 14:14:28 +02:00
|
|
|
case POPUP_TYPE_TRADE_FOR_BADGE:
|
|
|
|
xPos = x + 16;
|
|
|
|
hudElement = D_8010D660;
|
|
|
|
yPos = y + 16;
|
|
|
|
break;
|
|
|
|
case POPUP_TYPE_SELL_ITEM:
|
|
|
|
xPos = x + 17;
|
|
|
|
hudElement = D_8010D660;
|
|
|
|
yPos = y + 17;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
2021-10-18 17:58:32 +02:00
|
|
|
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(hudElement, xPos, yPos);
|
|
|
|
hud_element_set_alpha(hudElement, D_8010D650);
|
|
|
|
hud_element_draw_clipped(hudElement);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
void func_800F4CF0(PopupMessage* popup, s32 x, s32 y) {
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_msg(0x1D006B, x + 16, y + 2, 255, MSG_PAL_0F, 0);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
void func_800F4D28(PopupMessage* popup, s32 x, s32 y) {
|
|
|
|
s32 hudElement = D_8010D660;
|
|
|
|
PlayerData* playerData = &gPlayerData;
|
|
|
|
s32 xPos = x + 14;
|
|
|
|
s32 yPos = y + 9;
|
|
|
|
s32 type;
|
|
|
|
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_alpha(hudElement, D_8010D650);
|
2021-09-25 14:14:28 +02:00
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
if (gPopupMenu->popupType == POPUP_TYPE_TRADE_FOR_BADGE) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(hudElement, xPos, yPos);
|
2021-09-25 14:14:28 +02:00
|
|
|
} else {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(hudElement, xPos, y + 10);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_draw_clipped(hudElement);
|
2021-09-25 14:14:28 +02:00
|
|
|
hudElement = D_8010D664;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(hudElement, x + 26, y + 11);
|
|
|
|
hud_element_set_alpha(hudElement, D_8010D650);
|
|
|
|
hud_element_draw_clipped(hudElement);
|
2021-09-25 14:14:28 +02:00
|
|
|
|
2021-12-28 12:43:24 +01:00
|
|
|
type = gPopupMenu->popupType;
|
2021-09-25 14:14:28 +02:00
|
|
|
if (type == POPUP_TYPE_TRADE_FOR_BADGE) {
|
2022-11-02 13:30:07 +01:00
|
|
|
draw_number(playerData->starPieces, x + 58, y + 4, DRAW_NUMBER_CHARSET_THIN, MSG_PAL_STANDARD, D_8010D650, DRAW_NUMBER_STYLE_MONOSPACE | DRAW_NUMBER_STYLE_ALIGN_RIGHT);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
void create_popup_menu(PopupMenu* popup) {
|
|
|
|
PopupMenu* otherPopup;
|
|
|
|
s8 entryCount;
|
2022-01-19 12:25:14 +01:00
|
|
|
s32 initialPos;
|
|
|
|
s32 numEntries;
|
2021-09-25 14:14:28 +02:00
|
|
|
|
|
|
|
D_8010D69A = func_800E98D4();
|
2022-12-06 00:29:22 +01:00
|
|
|
status_menu_ignore_changes();
|
2021-09-25 14:14:28 +02:00
|
|
|
open_status_menu_short();
|
2021-12-28 12:43:24 +01:00
|
|
|
gPopupMenu = popup;
|
2021-09-25 14:14:28 +02:00
|
|
|
popup->result = 0;
|
|
|
|
popup->unk_31C = 0;
|
|
|
|
popup->unk_320 = 0;
|
|
|
|
D_8010D699 = 0;
|
|
|
|
D_8010D698 = 1;
|
2022-10-04 16:09:23 +02:00
|
|
|
if (popup->popupType >= 100) {
|
|
|
|
popup->popupType -= 100;
|
2021-09-25 14:14:28 +02:00
|
|
|
D_8010D699 = 1;
|
2022-10-04 16:09:23 +02:00
|
|
|
if (popup->popupType >= 100) {
|
|
|
|
popup->popupType -= 100;
|
2021-09-25 14:14:28 +02:00
|
|
|
D_8010D699 = 2;
|
|
|
|
}
|
|
|
|
D_8010D698 = 0;
|
|
|
|
}
|
2022-01-19 12:25:14 +01:00
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
D_8010D68E = TRUE;
|
2022-01-19 12:25:14 +01:00
|
|
|
D_8010D68F = 6;
|
2021-09-25 14:14:28 +02:00
|
|
|
D_8010D640 = 0;
|
2022-01-19 12:25:14 +01:00
|
|
|
|
|
|
|
initialPos = gPopupMenu->initialPos;
|
|
|
|
numEntries = gPopupMenu->numEntries;
|
|
|
|
D_8010D648 = initialPos;
|
|
|
|
if (initialPos >= numEntries) {
|
|
|
|
D_8010D648 = numEntries - 1;
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
|
|
|
D_8010D654 = 0;
|
|
|
|
D_8010D64C = D_8010D648;
|
2021-10-18 17:58:32 +02:00
|
|
|
|
2022-01-19 12:25:14 +01:00
|
|
|
entryCount = gPopupMenu->numEntries;
|
2021-09-25 14:14:28 +02:00
|
|
|
D_8010D656 = entryCount;
|
2022-01-19 12:25:14 +01:00
|
|
|
if (D_8010D68F < entryCount) {
|
2021-09-25 14:14:28 +02:00
|
|
|
D_8010D656 = 6;
|
|
|
|
}
|
2022-01-19 12:25:14 +01:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
D_8010D655 = 6;
|
2022-01-19 12:25:14 +01:00
|
|
|
if (gPopupMenu->numEntries < D_8010D68F) {
|
2021-12-28 12:43:24 +01:00
|
|
|
D_8010D655 = gPopupMenu->numEntries;
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
2022-01-19 12:25:14 +01:00
|
|
|
|
2021-09-25 14:14:28 +02:00
|
|
|
D_8010D650 = 255;
|
|
|
|
D_8010D691 = 4;
|
|
|
|
D_8010D692 = 6;
|
2022-11-22 05:12:28 +01:00
|
|
|
D_8010D694 = create_worker_frontUI(popup_menu_update, NULL);
|
2021-09-25 14:14:28 +02:00
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
void func_800F4FC4(PopupMenu* popup) {
|
|
|
|
gPopupMenu = popup;
|
|
|
|
|
|
|
|
popup->result = 0;
|
|
|
|
popup->unk_31C = 0;
|
|
|
|
popup->unk_320 = 0;
|
|
|
|
D_8010D69A = func_800E98D4();
|
|
|
|
D_8010D699 = 0;
|
|
|
|
D_8010D698 = 1;
|
|
|
|
if (gPopupMenu->popupType >= 100) {
|
|
|
|
gPopupMenu->popupType -= 100;
|
|
|
|
D_8010D699 = 1;
|
|
|
|
if (gPopupMenu->popupType >= 100) {
|
|
|
|
gPopupMenu->popupType -= 100;
|
|
|
|
D_8010D699 = 2;
|
|
|
|
}
|
|
|
|
D_8010D698 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
D_8010D68E = TRUE;
|
|
|
|
D_8010D68F = 6;
|
|
|
|
D_8010D640 = 0;
|
|
|
|
D_8010D648 = gPopupMenu->initialPos;
|
|
|
|
if (D_8010D648 >= gPopupMenu->numEntries) {
|
|
|
|
D_8010D648 = gPopupMenu->numEntries - 1;
|
|
|
|
}
|
|
|
|
D_8010D654 = 0;
|
|
|
|
D_8010D64C = D_8010D648;
|
|
|
|
D_8010D656 = gPopupMenu->numEntries;
|
|
|
|
|
|
|
|
if (D_8010D656 > D_8010D68F) {
|
|
|
|
D_8010D656 = D_8010D68F;
|
|
|
|
}
|
|
|
|
|
|
|
|
D_8010D655 = D_8010D68F;
|
|
|
|
if (gPopupMenu->numEntries < D_8010D68F) {
|
|
|
|
D_8010D655 = gPopupMenu->numEntries;
|
|
|
|
}
|
|
|
|
|
|
|
|
D_8010D650 = 255;
|
|
|
|
D_8010D691 = 4;
|
|
|
|
D_8010D692 = 6;
|
2022-11-22 05:12:28 +01:00
|
|
|
D_8010D694 = create_worker_frontUI(popup_menu_update, NULL);
|
2022-10-04 16:09:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void func_800F513C(PopupMenu* popup) {
|
|
|
|
gPopupMenu = popup;
|
|
|
|
|
|
|
|
popup->result = 0;
|
|
|
|
D_8010D693 = popup->unk_320;
|
|
|
|
D_8010D69A = func_800E98D4();
|
|
|
|
D_8010D699 = 0;
|
|
|
|
D_8010D698 = 1;
|
|
|
|
if (gPopupMenu->popupType >= 100) {
|
|
|
|
gPopupMenu->popupType -= 100;
|
|
|
|
D_8010D699 = 1;
|
|
|
|
if (gPopupMenu->popupType >= 100) {
|
|
|
|
gPopupMenu->popupType -= 100;
|
|
|
|
D_8010D699 = 2;
|
|
|
|
}
|
|
|
|
D_8010D698 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
D_8010D68F = 6;
|
|
|
|
D_8010D68E = FALSE;
|
|
|
|
D_8010D640 = 0;
|
|
|
|
D_8010D648 = gPopupMenu->initialPos;
|
|
|
|
if (D_8010D648 >= gPopupMenu->numEntries) {
|
|
|
|
D_8010D648 = gPopupMenu->numEntries - 1;
|
|
|
|
}
|
|
|
|
D_8010D654 = 0;
|
|
|
|
D_8010D64C = D_8010D648;
|
|
|
|
D_8010D656 = gPopupMenu->numEntries;
|
|
|
|
|
|
|
|
if (D_8010D656 > D_8010D68F) {
|
|
|
|
D_8010D656 = D_8010D68F;
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-10-04 16:09:23 +02:00
|
|
|
D_8010D655 = D_8010D68F;
|
|
|
|
if (gPopupMenu->numEntries < D_8010D68F) {
|
|
|
|
D_8010D655 = gPopupMenu->numEntries;
|
|
|
|
}
|
|
|
|
|
|
|
|
D_8010D650 = 255;
|
|
|
|
D_8010D691 = 9;
|
|
|
|
D_8010D692 = 2;
|
2022-11-22 05:12:28 +01:00
|
|
|
D_8010D694 = create_worker_frontUI(popup_menu_update, NULL);
|
2022-10-04 16:09:23 +02:00
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
|
|
|
void func_800F52BC(void) {
|
2021-06-30 04:27:12 +02:00
|
|
|
popup_menu_update();
|
2021-04-13 09:47:52 +02:00
|
|
|
}
|