+5
-5
@@ -2014,7 +2014,7 @@ task00_8084310: @ 8084310
|
|||||||
ldrsh r6, [r4, r0]
|
ldrsh r6, [r4, r0]
|
||||||
cmp r6, 0
|
cmp r6, 0
|
||||||
bne _08084350
|
bne _08084350
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
beq _08084376
|
beq _08084376
|
||||||
@@ -2287,7 +2287,7 @@ _08084560: .4byte gSprites
|
|||||||
sub_8084564: @ 8084564
|
sub_8084564: @ 8084564
|
||||||
push {r4,lr}
|
push {r4,lr}
|
||||||
adds r4, r0, 0
|
adds r4, r0, 0
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
beq _08084578
|
beq _08084578
|
||||||
@@ -4002,7 +4002,7 @@ sub_8085274: @ 8085274
|
|||||||
adds r4, r0, 0
|
adds r4, r0, 0
|
||||||
adds r5, r1, 0
|
adds r5, r1, 0
|
||||||
adds r6, r2, 0
|
adds r6, r2, 0
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
beq _080852B4
|
beq _080852B4
|
||||||
@@ -5025,7 +5025,7 @@ _08085A50: .4byte gTasks
|
|||||||
sub_8085A54: @ 8085A54
|
sub_8085A54: @ 8085A54
|
||||||
push {r4,lr}
|
push {r4,lr}
|
||||||
adds r4, r0, 0
|
adds r4, r0, 0
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
beq _08085A78
|
beq _08085A78
|
||||||
@@ -5492,7 +5492,7 @@ _08085E08: .4byte gTasks
|
|||||||
sub_8085E0C: @ 8085E0C
|
sub_8085E0C: @ 8085E0C
|
||||||
push {r4-r6,lr}
|
push {r4-r6,lr}
|
||||||
adds r6, r0, 0
|
adds r6, r0, 0
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
beq _08085E82
|
beq _08085E82
|
||||||
|
|||||||
+3
-3
@@ -1889,8 +1889,8 @@ _0807AA68: .4byte 0x000006ca
|
|||||||
_0807AA6C: .4byte 0x000006cb
|
_0807AA6C: .4byte 0x000006cb
|
||||||
thumb_func_end FieldWeather_StartFadingOutCreditsMap
|
thumb_func_end FieldWeather_StartFadingOutCreditsMap
|
||||||
|
|
||||||
thumb_func_start sub_807AA70
|
thumb_func_start field_weather_is_fade_finished
|
||||||
sub_807AA70: @ 807AA70
|
field_weather_is_fade_finished: @ 807AA70
|
||||||
ldr r0, _0807AA84 @ =gUnknown_2037F34
|
ldr r0, _0807AA84 @ =gUnknown_2037F34
|
||||||
ldr r1, _0807AA88 @ =0x000006c6
|
ldr r1, _0807AA88 @ =0x000006c6
|
||||||
adds r0, r1
|
adds r0, r1
|
||||||
@@ -1904,7 +1904,7 @@ sub_807AA70: @ 807AA70
|
|||||||
.align 2, 0
|
.align 2, 0
|
||||||
_0807AA84: .4byte gUnknown_2037F34
|
_0807AA84: .4byte gUnknown_2037F34
|
||||||
_0807AA88: .4byte 0x000006c6
|
_0807AA88: .4byte 0x000006c6
|
||||||
thumb_func_end sub_807AA70
|
thumb_func_end field_weather_is_fade_finished
|
||||||
|
|
||||||
thumb_func_start sub_807AA8C
|
thumb_func_start sub_807AA8C
|
||||||
sub_807AA8C: @ 807AA8C
|
sub_807AA8C: @ 807AA8C
|
||||||
|
|||||||
+2
-2
@@ -204,7 +204,7 @@ _080BED8C:
|
|||||||
movs r0, 0
|
movs r0, 0
|
||||||
movs r1, 0
|
movs r1, 0
|
||||||
bl SetGpuReg
|
bl SetGpuReg
|
||||||
ldr r0, _080BEDB0 @ =gUnknown_203AAC4
|
ldr r0, _080BEDB0 @ =gPlayerPcMenuManager
|
||||||
ldrb r0, [r0, 0x9]
|
ldrb r0, [r0, 0x9]
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
bne _080BEDB4
|
bne _080BEDB4
|
||||||
@@ -212,7 +212,7 @@ _080BED8C:
|
|||||||
bl HelpSystem_SetSomeVariable2
|
bl HelpSystem_SetSomeVariable2
|
||||||
b _080BF0F4
|
b _080BF0F4
|
||||||
.align 2, 0
|
.align 2, 0
|
||||||
_080BEDB0: .4byte gUnknown_203AAC4
|
_080BEDB0: .4byte gPlayerPcMenuManager
|
||||||
_080BEDB4:
|
_080BEDB4:
|
||||||
movs r0, 0x1E
|
movs r0, 0x1E
|
||||||
bl HelpSystem_SetSomeVariable2
|
bl HelpSystem_SetSomeVariable2
|
||||||
|
|||||||
+9
-9
@@ -11978,7 +11978,7 @@ task_launch_hm_phase_2: @ 81248C8
|
|||||||
push {r4,lr}
|
push {r4,lr}
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r4, r0, 24
|
lsrs r4, r0, 24
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r0, 24
|
lsrs r0, 24
|
||||||
cmp r0, 0x1
|
cmp r0, 0x1
|
||||||
@@ -17272,15 +17272,15 @@ _081273D0:
|
|||||||
bx r1
|
bx r1
|
||||||
thumb_func_end sub_81273AC
|
thumb_func_end sub_81273AC
|
||||||
|
|
||||||
thumb_func_start sub_81273D8
|
thumb_func_start PartyMenuInit_FromPlayerPc
|
||||||
sub_81273D8: @ 81273D8
|
PartyMenuInit_FromPlayerPc: @ 81273D8
|
||||||
push {lr}
|
push {lr}
|
||||||
sub sp, 0xC
|
sub sp, 0xC
|
||||||
movs r0, 0x6
|
movs r0, 0x6
|
||||||
str r0, [sp]
|
str r0, [sp]
|
||||||
ldr r0, _081273FC @ =sub_811FB28
|
ldr r0, _081273FC @ =sub_811FB28
|
||||||
str r0, [sp, 0x4]
|
str r0, [sp, 0x4]
|
||||||
ldr r0, _08127400 @ =sub_80EC500
|
ldr r0, _08127400 @ =CB2_PlayerPC_ReturnFromPartyMenu
|
||||||
str r0, [sp, 0x8]
|
str r0, [sp, 0x8]
|
||||||
movs r0, 0
|
movs r0, 0
|
||||||
movs r1, 0
|
movs r1, 0
|
||||||
@@ -17292,8 +17292,8 @@ sub_81273D8: @ 81273D8
|
|||||||
bx r0
|
bx r0
|
||||||
.align 2, 0
|
.align 2, 0
|
||||||
_081273FC: .4byte sub_811FB28
|
_081273FC: .4byte sub_811FB28
|
||||||
_08127400: .4byte sub_80EC500
|
_08127400: .4byte CB2_PlayerPC_ReturnFromPartyMenu
|
||||||
thumb_func_end sub_81273D8
|
thumb_func_end PartyMenuInit_FromPlayerPc
|
||||||
|
|
||||||
thumb_func_start sub_8127404
|
thumb_func_start sub_8127404
|
||||||
sub_8127404: @ 8127404
|
sub_8127404: @ 8127404
|
||||||
@@ -17311,7 +17311,7 @@ sub_8127404: @ 8127404
|
|||||||
movs r0, 0
|
movs r0, 0
|
||||||
strb r0, [r1]
|
strb r0, [r1]
|
||||||
ldr r2, _0812745C @ =gSaveBlock1Ptr
|
ldr r2, _0812745C @ =gSaveBlock1Ptr
|
||||||
ldr r0, _08127460 @ =gUnknown_203AAC4
|
ldr r0, _08127460 @ =gPlayerPcMenuManager
|
||||||
ldrh r1, [r0]
|
ldrh r1, [r0]
|
||||||
adds r1, 0x6
|
adds r1, 0x6
|
||||||
ldrh r0, [r0, 0x2]
|
ldrh r0, [r0, 0x2]
|
||||||
@@ -17337,7 +17337,7 @@ _08127450: .4byte gUnknown_203B0A0
|
|||||||
_08127454: .4byte gPlayerParty
|
_08127454: .4byte gPlayerParty
|
||||||
_08127458: .4byte gUnknown_203B0C0
|
_08127458: .4byte gUnknown_203B0C0
|
||||||
_0812745C: .4byte gSaveBlock1Ptr
|
_0812745C: .4byte gSaveBlock1Ptr
|
||||||
_08127460: .4byte gUnknown_203AAC4
|
_08127460: .4byte gPlayerPcMenuManager
|
||||||
_08127464: .4byte 0x00002cd0
|
_08127464: .4byte 0x00002cd0
|
||||||
_08127468: .4byte gUnknown_8416D17
|
_08127468: .4byte gUnknown_8416D17
|
||||||
_0812746C:
|
_0812746C:
|
||||||
@@ -19373,7 +19373,7 @@ task_hm_without_phase_2: @ 81283FC
|
|||||||
push {r4,lr}
|
push {r4,lr}
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r4, r0, 24
|
lsrs r4, r0, 24
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
beq _0812841A
|
beq _0812841A
|
||||||
|
|||||||
-1919
File diff suppressed because it is too large
Load Diff
@@ -1455,7 +1455,7 @@ _0808C3E0:
|
|||||||
.align 2, 0
|
.align 2, 0
|
||||||
_0808C444: .4byte gUnknown_83CDA20
|
_0808C444: .4byte gUnknown_83CDA20
|
||||||
_0808C448:
|
_0808C448:
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
bne _0808C454
|
bne _0808C454
|
||||||
|
|||||||
+1
-1
@@ -386,7 +386,7 @@ sub_809AD8C: @ 809AD8C
|
|||||||
push {r4,lr}
|
push {r4,lr}
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r4, r0, 24
|
lsrs r4, r0, 24
|
||||||
bl sub_807AA70
|
bl field_weather_is_fade_finished
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r0, 24
|
lsrs r0, 24
|
||||||
cmp r0, 0x1
|
cmp r0, 0x1
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -139,37 +139,6 @@ gUnknown_84020E6:: @ 84020E6
|
|||||||
gUnknown_84020F8:: @ 84020F8
|
gUnknown_84020F8:: @ 84020F8
|
||||||
.incbin "baserom.gba", 0x4020F8, 0xE4
|
.incbin "baserom.gba", 0x4020F8, 0xE4
|
||||||
|
|
||||||
gUnknown_84021DC:: @ 84021DC
|
|
||||||
.incbin "baserom.gba", 0x4021DC, 0xC
|
|
||||||
|
|
||||||
gUnknown_84021E8:: @ 84021E8
|
|
||||||
.incbin "baserom.gba", 0x4021E8, 0x18
|
|
||||||
|
|
||||||
gUnknown_8402200:: @ 8402200
|
|
||||||
.incbin "baserom.gba", 0x402200, 0x3
|
|
||||||
|
|
||||||
gUnknown_8402203:: @ 8402203
|
|
||||||
.incbin "baserom.gba", 0x402203, 0x5
|
|
||||||
|
|
||||||
gUnknown_8402208:: @ 8402208
|
|
||||||
.incbin "baserom.gba", 0x402208, 0x18
|
|
||||||
|
|
||||||
gUnknown_8402220:: @ 8402220
|
|
||||||
.incbin "baserom.gba", 0x402220, 0x8
|
|
||||||
|
|
||||||
gUnknown_8402228:: @ 8402228
|
|
||||||
.incbin "baserom.gba", 0x402228, 0x20
|
|
||||||
|
|
||||||
gUnknown_8402248:: @ 8402248
|
|
||||||
.incbin "baserom.gba", 0x402248, 0x8
|
|
||||||
|
|
||||||
gUnknown_8402250:: @ 8402250
|
|
||||||
.incbin "baserom.gba", 0x402250, 0x8
|
|
||||||
|
|
||||||
gUnknown_8402258:: @ 8402258
|
|
||||||
.incbin "baserom.gba", 0x402258, 0x8
|
|
||||||
|
|
||||||
|
|
||||||
.section .rodata.battle_anim_special
|
.section .rodata.battle_anim_special
|
||||||
|
|
||||||
gUnknown_840BF3C:: @ 840BF3C
|
gUnknown_840BF3C:: @ 840BF3C
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ PalletTown_PlayersHouse_2F_EventScript_168CE4:: @ 8168CE4
|
|||||||
releaseall
|
releaseall
|
||||||
end
|
end
|
||||||
|
|
||||||
gUnknown_8168D17:: @ 8168D17
|
EventScript_PalletTown_PlayersHouse_2F_ShutDownPC:: @ 8168D17
|
||||||
setvar VAR_0x8004, 1
|
setvar VAR_0x8004, 1
|
||||||
playse SE_PC_OFF
|
playse SE_PC_OFF
|
||||||
special sub_80CA9A8
|
special sub_80CA9A8
|
||||||
|
|||||||
+15
-15
@@ -475,11 +475,11 @@ gUnknown_841623D:: @ 841623D
|
|||||||
.string "YES\n"
|
.string "YES\n"
|
||||||
.string "NO$"
|
.string "NO$"
|
||||||
|
|
||||||
gUnknown_8416244::
|
gText_GoBackToThePreviousMenu::
|
||||||
.string "Go back to the\n"
|
.string "Go back to the\n"
|
||||||
.string "previous menu.$"
|
.string "previous menu.$"
|
||||||
|
|
||||||
gUnknown_8416262:: @ 8416262
|
gText_WhatWouldYouLikeToDo:: @ 8416262
|
||||||
.string "What would you like to do?$"
|
.string "What would you like to do?$"
|
||||||
|
|
||||||
gUnknown_841627D::
|
gUnknown_841627D::
|
||||||
@@ -1135,37 +1135,37 @@ gUnknown_84176CE:: @ 0x84176CE
|
|||||||
gUnknown_84176CF:: @ 84176CF
|
gUnknown_84176CF:: @ 84176CF
|
||||||
.string "Cancel the battle?$"
|
.string "Cancel the battle?$"
|
||||||
|
|
||||||
gUnknown_84176E2:: @ 0x84176E2
|
gText_TurnOff:: @ 0x84176E2
|
||||||
.string "TURN OFF$"
|
.string "TURN OFF$"
|
||||||
|
|
||||||
gUnknown_84176EB:: @ 0x84176EB
|
gUnknown_84176EB:: @ 0x84176EB
|
||||||
.string "もようがえ$"
|
.string "もようがえ$"
|
||||||
|
|
||||||
gUnknown_84176F1:: @ 0x84176F1
|
gText_ItemStorage:: @ 0x84176F1
|
||||||
.string "ITEM STORAGE$"
|
.string "ITEM STORAGE$"
|
||||||
|
|
||||||
gUnknown_84176FE:: @ 84176FE
|
gText_Mailbox:: @ 84176FE
|
||||||
.string "MAILBOX$"
|
.string "MAILBOX$"
|
||||||
|
|
||||||
gUnknown_8417706:: @ 0x8417706
|
gText_DepositItem2:: @ 0x8417706
|
||||||
.string "DEPOSIT ITEM$"
|
.string "DEPOSIT ITEM$"
|
||||||
|
|
||||||
gUnknown_8417713:: @ 0x8417713
|
gText_WithdrawItem2:: @ 0x8417713
|
||||||
.string "WITHDRAW ITEM$"
|
.string "WITHDRAW ITEM$"
|
||||||
|
|
||||||
gUnknown_8417721:: @ 0x8417721
|
gUnknown_8417721:: @ 0x8417721
|
||||||
.string "どうぐを すてる$"
|
.string "どうぐを すてる$"
|
||||||
|
|
||||||
gUnknown_841772A:: @ 0x841772A
|
gText_StoreItemsInThePC:: @ 0x841772A
|
||||||
.string "Store items in the PC.$"
|
.string "Store items in the PC.$"
|
||||||
|
|
||||||
gUnknown_8417741:: @ 0x8417741
|
gText_TakeOutItemsFromThePC:: @ 0x8417741
|
||||||
.string "Take out items from the PC.$"
|
.string "Take out items from the PC.$"
|
||||||
|
|
||||||
gUnknown_841775D:: @ 0x841775D
|
gUnknown_841775D:: @ 0x841775D
|
||||||
.string "パソコンに あずけている\nどうぐを すてます$"
|
.string "パソコンに あずけている\nどうぐを すてます$"
|
||||||
|
|
||||||
gUnknown_8417774:: @ 8417774
|
gText_ThereAreNoItems:: @ 8417774
|
||||||
.string "There are no items.{PAUSE_UNTIL_PRESS}$"
|
.string "There are no items.{PAUSE_UNTIL_PRESS}$"
|
||||||
|
|
||||||
gText_NoMoreRoomInBag:: @ 841778A
|
gText_NoMoreRoomInBag:: @ 841778A
|
||||||
@@ -1189,19 +1189,19 @@ gOtherText_MoveToBag::
|
|||||||
gOtherText_Give2::
|
gOtherText_Give2::
|
||||||
.string "GIVE$"
|
.string "GIVE$"
|
||||||
|
|
||||||
gUnknown_84177EE:: @ 84177EE
|
gText_TheresNoMailHere:: @ 84177EE
|
||||||
.string "There's no MAIL here.{PAUSE_UNTIL_PRESS}$"
|
.string "There's no MAIL here.{PAUSE_UNTIL_PRESS}$"
|
||||||
|
|
||||||
gUnknown_8417806:: @ 8417806
|
gText_WhatWouldYouLikeToDoWithPlayersMail:: @ 8417806
|
||||||
.string "What would you like to do with\n{STR_VAR_1}'s MAIL?$"
|
.string "What would you like to do with\n{STR_VAR_1}'s MAIL?$"
|
||||||
|
|
||||||
gUnknown_8417830:: @ 8417830
|
gText_MessageWillBeLost:: @ 8417830
|
||||||
.string "The message will be lost.\nIs that okay?$"
|
.string "The message will be lost.\nIs that okay?$"
|
||||||
|
|
||||||
gUnknown_8417858:: @ 8417858
|
gText_BagIsFull:: @ 8417858
|
||||||
.string "The BAG is full.{PAUSE_UNTIL_PRESS}$"
|
.string "The BAG is full.{PAUSE_UNTIL_PRESS}$"
|
||||||
|
|
||||||
gUnknown_841786B:: @ 841786B
|
gText_MailReturnedToBagMessageErased:: @ 841786B
|
||||||
.string "The MAIL was returned to the BAG\nwith its message erased.{PAUSE_UNTIL_PRESS}$"
|
.string "The MAIL was returned to the BAG\nwith its message erased.{PAUSE_UNTIL_PRESS}$"
|
||||||
|
|
||||||
gText_WithdrawItem:: @ 84178A7
|
gText_WithdrawItem:: @ 84178A7
|
||||||
|
|||||||
@@ -1158,4 +1158,7 @@ extern const u8 EventScript_ItemfinderDigUpUnderfootItem[];
|
|||||||
// new_game
|
// new_game
|
||||||
extern const u8 EventScript_ResetAllMapFlags[];
|
extern const u8 EventScript_ResetAllMapFlags[];
|
||||||
|
|
||||||
|
// player_pc
|
||||||
|
extern const u8 EventScript_PalletTown_PlayersHouse_2F_ShutDownPC[];
|
||||||
|
|
||||||
#endif //GUARD_EVENT_SCRIPTS_H
|
#endif //GUARD_EVENT_SCRIPTS_H
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ void DoCurrentWeather(void);
|
|||||||
void SetSav1WeatherFromCurrMapHeader(void);
|
void SetSav1WeatherFromCurrMapHeader(void);
|
||||||
void sub_807B0C4(u16 *, u16 *, u32);
|
void sub_807B0C4(u16 *, u16 *, u32);
|
||||||
void PlayRainStoppingSoundEffect(void);
|
void PlayRainStoppingSoundEffect(void);
|
||||||
bool8 sub_807AA70(void);
|
bool8 field_weather_is_fade_finished(void);
|
||||||
void SetWeatherScreenFadeOut(void);
|
void SetWeatherScreenFadeOut(void);
|
||||||
void sub_807B070(void);
|
void sub_807B070(void);
|
||||||
u8 GetCurrentWeather(void);
|
u8 GetCurrentWeather(void);
|
||||||
|
|||||||
@@ -89,5 +89,7 @@ void HelpSystem_FillPanel3(void);
|
|||||||
void PrintListMenuItems(void);
|
void PrintListMenuItems(void);
|
||||||
void PlaceListMenuCursor(void);
|
void PlaceListMenuCursor(void);
|
||||||
bool8 MoveCursor(u8 by, u8 dirn);
|
bool8 MoveCursor(u8 by, u8 dirn);
|
||||||
|
void sub_812B234(void);
|
||||||
|
void sub_812B248(void);
|
||||||
|
|
||||||
#endif //GUARD_HELP_SYSTEM_H
|
#endif //GUARD_HELP_SYSTEM_H
|
||||||
|
|||||||
@@ -77,5 +77,6 @@ u16 GetPcItemQuantity(u16 *);
|
|||||||
void ItemPcCompaction(void);
|
void ItemPcCompaction(void);
|
||||||
void RemoveItemFromPC(u16 itemId, u16 quantity);
|
void RemoveItemFromPC(u16 itemId, u16 quantity);
|
||||||
void SortAndCompactBagPocket(struct BagPocket * pocket);
|
void SortAndCompactBagPocket(struct BagPocket * pocket);
|
||||||
|
u8 CountItemsInPC(void);
|
||||||
|
|
||||||
#endif // GUARD_ITEM_H
|
#endif // GUARD_ITEM_H
|
||||||
|
|||||||
@@ -38,5 +38,6 @@ void sub_810A1F8(u8 taskId);
|
|||||||
void sub_8107ECC(void);
|
void sub_8107ECC(void);
|
||||||
void sub_8108DC8(u8 pocketId);
|
void sub_8108DC8(u8 pocketId);
|
||||||
void sub_81089F4(u8 pocketId);
|
void sub_81089F4(u8 pocketId);
|
||||||
|
void sub_8107DB4(u8 menuType, u8 pocket, MainCallback callback);
|
||||||
|
|
||||||
#endif //GUARD_ITEM_MENU_H
|
#endif //GUARD_ITEM_MENU_H
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
#ifndef GUARD_MAILBOX_PC_H
|
#ifndef GUARD_MAILBOX_PC_H
|
||||||
#define GUARD_MAILBOX_PC_H
|
#define GUARD_MAILBOX_PC_H
|
||||||
|
|
||||||
|
#include "player_pc.h"
|
||||||
|
|
||||||
bool8 MailboxPC_InitBuffers(u8 num);
|
bool8 MailboxPC_InitBuffers(u8 num);
|
||||||
u8 MailboxPC_GetAddWindow(u8 winIdx);
|
u8 MailboxPC_GetAddWindow(u8 winIdx);
|
||||||
void MailboxPC_RemoveWindow(u8 winIdx);
|
void MailboxPC_RemoveWindow(u8 winIdx);
|
||||||
u8 MailboxPC_GetWindowId(u8 winIdx);
|
u8 MailboxPC_GetWindowId(u8 winIdx);
|
||||||
u8 MailboxPC_InitListMenu(struct PlayerPC_Unk_203AAC4 * playerPcStruct);
|
u8 MailboxPC_InitListMenu(struct PlayerPCItemPageStruct * playerPcStruct);
|
||||||
void MailboxPC_AddScrollIndicatorArrows(struct PlayerPC_Unk_203AAC4 * playerPcStruct);
|
void MailboxPC_AddScrollIndicatorArrows(struct PlayerPCItemPageStruct * playerPcStruct);
|
||||||
void MailboxPC_DestroyListMenuBuffer(void);
|
void MailboxPC_DestroyListMenuBuffer(void);
|
||||||
|
|
||||||
#endif //GUARD_MAILBOX_PC_H
|
#endif //GUARD_MAILBOX_PC_H
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ u32 sub_8054C04(void);
|
|||||||
extern u8 gDisableMapMusicChangeOnMapLoad;
|
extern u8 gDisableMapMusicChangeOnMapLoad;
|
||||||
extern u8 gUnknown_2036E28;
|
extern u8 gUnknown_2036E28;
|
||||||
|
|
||||||
extern void (*gFieldCallback)(void);
|
|
||||||
extern bool8 (* gFieldCallback2)(void);
|
extern bool8 (* gFieldCallback2)(void);
|
||||||
|
|
||||||
void SetLastHealLocationWarp(u8 healLocaionId);
|
void SetLastHealLocationWarp(u8 healLocaionId);
|
||||||
|
|||||||
@@ -82,5 +82,6 @@ void OpenPartyMenuInBattle(u8 arg);
|
|||||||
void sub_8127EC4(u8 battlerId, u8 unk, u8 arrayIndex);
|
void sub_8127EC4(u8 battlerId, u8 unk, u8 arrayIndex);
|
||||||
bool8 IsMultiBattle(void);
|
bool8 IsMultiBattle(void);
|
||||||
void sub_8126EDC(void);
|
void sub_8126EDC(void);
|
||||||
|
void PartyMenuInit_FromPlayerPc(void);
|
||||||
|
|
||||||
#endif // GUARD_PARTY_MENU_H
|
#endif // GUARD_PARTY_MENU_H
|
||||||
|
|||||||
+7
-5
@@ -6,14 +6,16 @@
|
|||||||
|
|
||||||
// Exported type declarations
|
// Exported type declarations
|
||||||
|
|
||||||
struct PlayerPC_Unk_203AAC4
|
struct PlayerPCItemPageStruct
|
||||||
{
|
{
|
||||||
u16 selectedRow;
|
u16 selectedRow;
|
||||||
u16 scrollOffset;
|
u16 scrollOffset;
|
||||||
u8 unk_4;
|
u8 pageItems;
|
||||||
u8 unk_5;
|
u8 count;
|
||||||
u8 filler_6[4];
|
u8 filler_6[3];
|
||||||
u8 unk_A;
|
u8 unk_9;
|
||||||
|
u8 scrollIndicatorId;
|
||||||
|
u8 filler_B[5];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Exported RAM declarations
|
// Exported RAM declarations
|
||||||
|
|||||||
@@ -426,4 +426,24 @@ extern const u8 gText_HaventReceivedGiftOkayToDiscard[];
|
|||||||
extern const u8 gText_SendingWonderCard[];
|
extern const u8 gText_SendingWonderCard[];
|
||||||
extern const u8 gText_SendingWonderNews[];
|
extern const u8 gText_SendingWonderNews[];
|
||||||
|
|
||||||
|
// player_pc
|
||||||
|
extern const u8 gText_WhatWouldYouLikeToDo[];
|
||||||
|
extern const u8 gText_TakeOutItemsFromThePC[];
|
||||||
|
extern const u8 gText_StoreItemsInThePC[];
|
||||||
|
extern const u8 gText_GoBackToThePreviousMenu[];
|
||||||
|
extern const u8 gText_ItemStorage[];
|
||||||
|
extern const u8 gText_Mailbox[];
|
||||||
|
extern const u8 gText_TurnOff[];
|
||||||
|
extern const u8 gText_WithdrawItem2[];
|
||||||
|
extern const u8 gText_DepositItem2[];
|
||||||
|
extern const u8 gOtherText_Read[];
|
||||||
|
extern const u8 gOtherText_MoveToBag[];
|
||||||
|
extern const u8 gOtherText_Give2[];
|
||||||
|
extern const u8 gText_TheresNoMailHere[];
|
||||||
|
extern const u8 gText_ThereAreNoItems[];
|
||||||
|
extern const u8 gText_WhatWouldYouLikeToDoWithPlayersMail[];
|
||||||
|
extern const u8 gText_MessageWillBeLost[];
|
||||||
|
extern const u8 gText_BagIsFull[];
|
||||||
|
extern const u8 gText_MailReturnedToBagMessageErased[];
|
||||||
|
|
||||||
#endif //GUARD_STRINGS_H
|
#endif //GUARD_STRINGS_H
|
||||||
|
|||||||
+2
-1
@@ -209,7 +209,7 @@ SECTIONS {
|
|||||||
src/fldeff_softboiled.o(.text);
|
src/fldeff_softboiled.o(.text);
|
||||||
asm/battle_tower.o(.text);
|
asm/battle_tower.o(.text);
|
||||||
asm/battle_controller_oak.o(.text);
|
asm/battle_controller_oak.o(.text);
|
||||||
asm/player_pc.o(.text);
|
src/player_pc.o(.text);
|
||||||
src/intro.o(.text);
|
src/intro.o(.text);
|
||||||
asm/battle_anim_special.o(.text);
|
asm/battle_anim_special.o(.text);
|
||||||
asm/hall_of_fame.o(.text);
|
asm/hall_of_fame.o(.text);
|
||||||
@@ -448,6 +448,7 @@ SECTIONS {
|
|||||||
data/data_83FECCC.o(.rodata);
|
data/data_83FECCC.o(.rodata);
|
||||||
src/battle_controller_safari.o(.rodata);
|
src/battle_controller_safari.o(.rodata);
|
||||||
data/data_83FECCC.o(.rodata.83FEDE4);
|
data/data_83FECCC.o(.rodata.83FEDE4);
|
||||||
|
src/player_pc.o(.rodata);
|
||||||
src/intro.o(.rodata);
|
src/intro.o(.rodata);
|
||||||
data/data_83FECCC.o(.rodata.battle_anim_special);
|
data/data_83FECCC.o(.rodata.battle_anim_special);
|
||||||
src/credits.o(.rodata);
|
src/credits.o(.rodata);
|
||||||
|
|||||||
@@ -522,7 +522,7 @@ static bool32 sub_807E40C(void)
|
|||||||
|
|
||||||
bool32 sub_807E418(void)
|
bool32 sub_807E418(void)
|
||||||
{
|
{
|
||||||
if (sub_807AA70() == TRUE && sub_80F83B0())
|
if (field_weather_is_fade_finished() == TRUE && sub_80F83B0())
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
+2
-2
@@ -117,7 +117,7 @@ void sub_80A1084(void)
|
|||||||
|
|
||||||
void sub_80A109C(u8 taskId)
|
void sub_80A109C(u8 taskId)
|
||||||
{
|
{
|
||||||
if (sub_807AA70() == TRUE)
|
if (field_weather_is_fade_finished() == TRUE)
|
||||||
{
|
{
|
||||||
sItemUseOnFieldCB(taskId);
|
sItemUseOnFieldCB(taskId);
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ bool8 sub_80A1194(void)
|
|||||||
|
|
||||||
void sub_80A11C0(u8 taskId)
|
void sub_80A11C0(u8 taskId)
|
||||||
{
|
{
|
||||||
if (sub_807AA70() == TRUE)
|
if (field_weather_is_fade_finished() == TRUE)
|
||||||
{
|
{
|
||||||
UnfreezeMapObjects();
|
UnfreezeMapObjects();
|
||||||
ScriptContext2_Disable();
|
ScriptContext2_Disable();
|
||||||
|
|||||||
+5
-5
@@ -94,10 +94,10 @@ static void ItemPrintFunc(u8 windowId, s32 itemId, u8 y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 MailboxPC_InitListMenu(struct PlayerPC_Unk_203AAC4 * playerPcStruct)
|
u8 MailboxPC_InitListMenu(struct PlayerPCItemPageStruct * playerPcStruct)
|
||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
for (i = 0; i < playerPcStruct->unk_5; i++)
|
for (i = 0; i < playerPcStruct->count; i++)
|
||||||
{
|
{
|
||||||
sListMenuItems[i].label = sString_Dummy;
|
sListMenuItems[i].label = sString_Dummy;
|
||||||
sListMenuItems[i].index = i;
|
sListMenuItems[i].index = i;
|
||||||
@@ -106,7 +106,7 @@ u8 MailboxPC_InitListMenu(struct PlayerPC_Unk_203AAC4 * playerPcStruct)
|
|||||||
sListMenuItems[i].index = -2;
|
sListMenuItems[i].index = -2;
|
||||||
|
|
||||||
gMultiuseListMenuTemplate.items = sListMenuItems;
|
gMultiuseListMenuTemplate.items = sListMenuItems;
|
||||||
gMultiuseListMenuTemplate.totalItems = playerPcStruct->unk_5 + 1;
|
gMultiuseListMenuTemplate.totalItems = playerPcStruct->count + 1;
|
||||||
gMultiuseListMenuTemplate.windowId = sWindowIds[1];
|
gMultiuseListMenuTemplate.windowId = sWindowIds[1];
|
||||||
gMultiuseListMenuTemplate.header_X = 0;
|
gMultiuseListMenuTemplate.header_X = 0;
|
||||||
gMultiuseListMenuTemplate.item_X = GetMenuCursorDimensionByFont(2, 0);
|
gMultiuseListMenuTemplate.item_X = GetMenuCursorDimensionByFont(2, 0);
|
||||||
@@ -132,9 +132,9 @@ static void MoveCursorFunc(s32 itemIndex, bool8 onInit, struct ListMenu * list)
|
|||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MailboxPC_AddScrollIndicatorArrows(struct PlayerPC_Unk_203AAC4 * playerPcStruct)
|
void MailboxPC_AddScrollIndicatorArrows(struct PlayerPCItemPageStruct * playerPcStruct)
|
||||||
{
|
{
|
||||||
playerPcStruct->unk_A = AddScrollIndicatorArrowPairParameterized(2, 0xC2, 0xC, 0x94, playerPcStruct->unk_5 - playerPcStruct->unk_4 + 1, 110, 110, &playerPcStruct->scrollOffset);
|
playerPcStruct->scrollIndicatorId = AddScrollIndicatorArrowPairParameterized(2, 0xC2, 0xC, 0x94, playerPcStruct->count - playerPcStruct->pageItems + 1, 110, 110, &playerPcStruct->scrollOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MailboxPC_DestroyListMenuBuffer(void)
|
void MailboxPC_DestroyListMenuBuffer(void)
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ static void sub_80F83D0(u8 taskId)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (sub_807AA70())
|
if (field_weather_is_fade_finished())
|
||||||
{
|
{
|
||||||
Overworld_PlaySpecialMapMusic();
|
Overworld_PlaySpecialMapMusic();
|
||||||
data[0]++;
|
data[0]++;
|
||||||
|
|||||||
+741
@@ -0,0 +1,741 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "palette.h"
|
||||||
|
#include "item.h"
|
||||||
|
#include "task.h"
|
||||||
|
#include "menu_indicators.h"
|
||||||
|
#include "new_menu_helpers.h"
|
||||||
|
#include "strings.h"
|
||||||
|
#include "menu.h"
|
||||||
|
#include "mail.h"
|
||||||
|
#include "mail_data.h"
|
||||||
|
#include "help_system.h"
|
||||||
|
#include "sound.h"
|
||||||
|
#include "overworld.h"
|
||||||
|
#include "script.h"
|
||||||
|
#include "mailbox_pc.h"
|
||||||
|
#include "player_pc.h"
|
||||||
|
#include "field_weather.h"
|
||||||
|
#include "event_scripts.h"
|
||||||
|
#include "field_fadetransition.h"
|
||||||
|
#include "string_util.h"
|
||||||
|
#include "item_menu.h"
|
||||||
|
#include "item_pc.h"
|
||||||
|
#include "party_menu.h"
|
||||||
|
#include "constants/items.h"
|
||||||
|
#include "constants/songs.h"
|
||||||
|
|
||||||
|
#define PC_ITEM_ID 0
|
||||||
|
#define PC_QUANTITY 1
|
||||||
|
#define NEW_GAME_PC_ITEMS(i, type) (((u16 *)gNewGamePCItems + type)[i * 2])
|
||||||
|
|
||||||
|
#define tCount data[2]
|
||||||
|
#define tPageItems data[4]
|
||||||
|
#define tItemPcParam data[6]
|
||||||
|
#define tWindowId data[10]
|
||||||
|
#define tListMenuTaskId data[11]
|
||||||
|
|
||||||
|
static EWRAM_DATA const u8 *sItemOrder = NULL;
|
||||||
|
static EWRAM_DATA u8 sTopMenuItemCount = 0;
|
||||||
|
EWRAM_DATA struct PlayerPCItemPageStruct gPlayerPcMenuManager = {};
|
||||||
|
|
||||||
|
#define SELECTED_MAIL (gSaveBlock1Ptr->mail[PC_MAIL_NUM(gPlayerPcMenuManager.scrollOffset) + gPlayerPcMenuManager.selectedRow])
|
||||||
|
|
||||||
|
static void Task_DrawPlayerPcTopMenu(u8 taskId);
|
||||||
|
static void Task_TopMenuHandleInput(u8 taskId);
|
||||||
|
static void Task_PlayerPcItemStorage(u8 taskId);
|
||||||
|
static void Task_PlayerPcMailbox(u8 taskId);
|
||||||
|
static void Task_PlayerPcTurnOff(u8 taskId);
|
||||||
|
static void Task_CreateItemStorageSubmenu(u8 taskId, u8 cursorPos);
|
||||||
|
static void PrintStringOnWindow0WithDialogueFrame(const u8 *str);
|
||||||
|
static void Task_TopMenu_ItemStorageSubmenu_HandleInput(u8 taskId);
|
||||||
|
static void Task_PlayerPcDepositItem(u8 taskId);
|
||||||
|
static void Task_DepositItem_WaitFadeAndGoToBag(u8 taskId);
|
||||||
|
static void CB2_ReturnFromDepositMenu(void);
|
||||||
|
static void Task_PlayerPcWithdrawItem(u8 taskId);
|
||||||
|
static void CB2_ReturnFromWithdrawMenu(void);
|
||||||
|
static void Task_WithdrawItemBeginFade(u8 taskId);
|
||||||
|
static void Task_PlayerPcCancel(u8 taskId);
|
||||||
|
static void Task_SetPageItemVars(u8 taskId);
|
||||||
|
static u8 CountPCMail(void);
|
||||||
|
static void PCMailCompaction(void);
|
||||||
|
static void Task_DrawMailboxPcMenu(u8 taskId);
|
||||||
|
static void Task_MailboxPcHandleInput(u8 taskId);
|
||||||
|
static void Task_PrintWhatToDoWithSelectedMail(u8 taskId);
|
||||||
|
static void Task_DestroyMailboxPcViewAndCancel(u8 taskId);
|
||||||
|
static void Task_DrawMailSubmenu(u8 taskId);
|
||||||
|
static void Task_MailSubmenuHandleInput(u8 taskId);
|
||||||
|
static void Task_PlayerPcReadMail(u8 taskId);
|
||||||
|
static void Task_WaitFadeAndReadSelectedMail(u8 taskId);
|
||||||
|
static void CB2_SetCbToReturnToMailbox(void);
|
||||||
|
static void Task_PlayerPcMoveMailToBag(u8 taskId);
|
||||||
|
static void Task_DrawYesNoMenuToConfirmMoveToBag(u8 taskId);
|
||||||
|
static void Task_MoveToBagYesNoMenuHandleInput(u8 taskId);
|
||||||
|
static void Task_TryPutMailInBag_DestroyMsgIfSuccessful(u8 taskId);
|
||||||
|
static void Task_DeclinedMoveMailToBag(u8 taskId);
|
||||||
|
static void Task_PlayerPcGiveMailToMon(u8 taskId);
|
||||||
|
static void Task_WaitFadeAndGoToPartyMenu(u8 taskId);
|
||||||
|
static void Task_Error_NoPokemon(u8 taskId);
|
||||||
|
static void Task_PlayerPcExitMailSubmenu(u8 taskId);
|
||||||
|
|
||||||
|
static const u8 *const sItemStorageActionDescriptionPtrs[] = {
|
||||||
|
gText_TakeOutItemsFromThePC,
|
||||||
|
gText_StoreItemsInThePC,
|
||||||
|
gText_GoBackToThePreviousMenu
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct MenuAction sMenuActions_TopMenu[] = {
|
||||||
|
{gText_ItemStorage, Task_PlayerPcItemStorage},
|
||||||
|
{gText_Mailbox, Task_PlayerPcMailbox},
|
||||||
|
{gText_TurnOff, Task_PlayerPcTurnOff}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const u8 gUnknown_8402200[] = { 0, 1, 2 };
|
||||||
|
static const u8 gUnknown_8402203[] = { 0, 1, 2 };
|
||||||
|
|
||||||
|
static const struct MenuAction sMenuActions_ItemPc[] = {
|
||||||
|
{gText_WithdrawItem2, Task_PlayerPcWithdrawItem},
|
||||||
|
{gText_DepositItem2, Task_PlayerPcDepositItem},
|
||||||
|
{gFameCheckerText_Cancel, Task_PlayerPcCancel}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct ItemSlot gNewGamePCItems[] = {
|
||||||
|
{ ITEM_POTION, 1 },
|
||||||
|
{ ITEM_NONE, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct MenuAction sMenuActions_MailSubmenu[] = {
|
||||||
|
{gOtherText_Read, Task_PlayerPcReadMail},
|
||||||
|
{gOtherText_MoveToBag, Task_PlayerPcMoveMailToBag},
|
||||||
|
{gOtherText_Give2, Task_PlayerPcGiveMailToMon},
|
||||||
|
{gOtherText_Exit, Task_PlayerPcExitMailSubmenu}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct WindowTemplate sWindowTemplate_TopMenu_3Items = {
|
||||||
|
.bg = 0,
|
||||||
|
.tilemapLeft = 1,
|
||||||
|
.tilemapTop = 1,
|
||||||
|
.width = 13,
|
||||||
|
.height = 6,
|
||||||
|
.paletteNum = 15,
|
||||||
|
.baseBlock = 0x008
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct WindowTemplate sWindowTemplate_TopMenu_4Items = {
|
||||||
|
.bg = 0,
|
||||||
|
.tilemapLeft = 1,
|
||||||
|
.tilemapTop = 1,
|
||||||
|
.width = 13,
|
||||||
|
.height = 8,
|
||||||
|
.paletteNum = 15,
|
||||||
|
.baseBlock = 0x008
|
||||||
|
};
|
||||||
|
|
||||||
|
static const struct WindowTemplate sWindowTemplate_ItemStorageSubmenu = {
|
||||||
|
.bg = 0,
|
||||||
|
.tilemapLeft = 1,
|
||||||
|
.tilemapTop = 1,
|
||||||
|
.width = 14,
|
||||||
|
.height = 6,
|
||||||
|
.paletteNum = 15,
|
||||||
|
.baseBlock = 0x008
|
||||||
|
};
|
||||||
|
|
||||||
|
void NewGameInitPCItems(void)
|
||||||
|
{
|
||||||
|
u8 i;
|
||||||
|
|
||||||
|
for (i = 0, ClearPCItemSlots(); NEW_GAME_PC_ITEMS(i, PC_ITEM_ID) && NEW_GAME_PC_ITEMS(i, PC_QUANTITY) &&
|
||||||
|
AddPCItem(NEW_GAME_PC_ITEMS(i, PC_ITEM_ID), NEW_GAME_PC_ITEMS(i, PC_QUANTITY)) == TRUE; i++)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_80EB6AC(void)
|
||||||
|
{
|
||||||
|
u8 taskId;
|
||||||
|
|
||||||
|
gPlayerPcMenuManager.unk_9 = 0;
|
||||||
|
sub_812B234();
|
||||||
|
sItemOrder = gUnknown_8402200;
|
||||||
|
sTopMenuItemCount = 3;
|
||||||
|
taskId = CreateTask(TaskDummy, 0);
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_WhatWouldYouLikeToDo, Task_DrawPlayerPcTopMenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_80EB6FC(void)
|
||||||
|
{
|
||||||
|
u8 taskId;
|
||||||
|
|
||||||
|
gPlayerPcMenuManager.unk_9 = 1;
|
||||||
|
sub_812B234();
|
||||||
|
sItemOrder = gUnknown_8402203;
|
||||||
|
sTopMenuItemCount = 3;
|
||||||
|
taskId = CreateTask(TaskDummy, 0);
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_WhatWouldYouLikeToDo, Task_DrawPlayerPcTopMenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_DrawPlayerPcTopMenu(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
if (sTopMenuItemCount == 3)
|
||||||
|
tWindowId = AddWindow(&sWindowTemplate_TopMenu_3Items);
|
||||||
|
else
|
||||||
|
tWindowId = AddWindow(&sWindowTemplate_TopMenu_4Items);
|
||||||
|
SetStdWindowBorderStyle(tWindowId, 0);
|
||||||
|
AddItemMenuActionTextPrinters(tWindowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, GetFontAttribute(2, FONTATTR_LETTER_SPACING), 16, sTopMenuItemCount, sMenuActions_TopMenu, sItemOrder);
|
||||||
|
Menu_InitCursor(tWindowId, 2, 0, 2, 16, sTopMenuItemCount, 0);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
gTasks[taskId].func = Task_TopMenuHandleInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_TopMenuHandleInput(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
s8 input = Menu_ProcessInputNoWrapAround();
|
||||||
|
switch (input)
|
||||||
|
{
|
||||||
|
case -2:
|
||||||
|
break;
|
||||||
|
case -1:
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
ClearStdWindowAndFrameToTransparent(tWindowId, FALSE);
|
||||||
|
ClearWindowTilemap(tWindowId);
|
||||||
|
RemoveWindow(tWindowId);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
gTasks[taskId].func = Task_PlayerPcTurnOff;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ClearStdWindowAndFrameToTransparent(tWindowId, FALSE);
|
||||||
|
ClearWindowTilemap(tWindowId);
|
||||||
|
RemoveWindow(tWindowId);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
gTasks[taskId].func = sMenuActions_TopMenu[sItemOrder[input]].func.void_u8;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_ReturnToTopMenu(u8 taskId)
|
||||||
|
{
|
||||||
|
sub_812B248();
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_WhatWouldYouLikeToDo, Task_DrawPlayerPcTopMenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcItemStorage(u8 taskId)
|
||||||
|
{
|
||||||
|
Task_CreateItemStorageSubmenu(taskId, FALSE);
|
||||||
|
gTasks[taskId].func = Task_TopMenu_ItemStorageSubmenu_HandleInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcMailbox(u8 taskId)
|
||||||
|
{
|
||||||
|
gPlayerPcMenuManager.count = CountPCMail();
|
||||||
|
if (gPlayerPcMenuManager.count == 0)
|
||||||
|
{
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_TheresNoMailHere, Task_ReturnToTopMenu);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gPlayerPcMenuManager.selectedRow = 0;
|
||||||
|
gPlayerPcMenuManager.scrollOffset = 0;
|
||||||
|
PCMailCompaction();
|
||||||
|
Task_SetPageItemVars(taskId);
|
||||||
|
if (gPlayerPcMenuManager.unk_9 == 0)
|
||||||
|
HelpSystem_SetSomeVariable2(34);
|
||||||
|
else
|
||||||
|
HelpSystem_SetSomeVariable2(30);
|
||||||
|
if (MailboxPC_InitBuffers(gPlayerPcMenuManager.count) == TRUE)
|
||||||
|
{
|
||||||
|
ClearDialogWindowAndFrame(0, FALSE);
|
||||||
|
Task_DrawMailboxPcMenu(taskId);
|
||||||
|
gTasks[taskId].func = Task_MailboxPcHandleInput;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_TheresNoMailHere, Task_ReturnToTopMenu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcTurnOff(u8 taskId)
|
||||||
|
{
|
||||||
|
if (gPlayerPcMenuManager.unk_9 == 0)
|
||||||
|
ScriptContext1_SetupScript(EventScript_PalletTown_PlayersHouse_2F_ShutDownPC);
|
||||||
|
else
|
||||||
|
EnableBothScriptContexts();
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_CreateItemStorageSubmenu(u8 taskId, u8 cursorPos)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
if (gPlayerPcMenuManager.unk_9 == 0)
|
||||||
|
HelpSystem_SetSomeVariable2(33);
|
||||||
|
else
|
||||||
|
HelpSystem_SetSomeVariable2(29);
|
||||||
|
tWindowId = AddWindow(&sWindowTemplate_ItemStorageSubmenu);
|
||||||
|
SetStdWindowBorderStyle(tWindowId, FALSE);
|
||||||
|
PrintTextArray(tWindowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, 16, 3, sMenuActions_ItemPc);
|
||||||
|
Menu_InitCursor(tWindowId, 2, 0, 2, 16, 3, cursorPos);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
PrintStringOnWindow0WithDialogueFrame(sItemStorageActionDescriptionPtrs[cursorPos]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PrintStringOnWindow0WithDialogueFrame(const u8 *str)
|
||||||
|
{
|
||||||
|
DrawDialogueFrame(0, FALSE);
|
||||||
|
AddTextPrinterParameterized(0, 2, str, 0, 1, 0, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_TopMenu_ItemStorageSubmenu_HandleInput(u8 taskId)
|
||||||
|
{
|
||||||
|
if (JOY_REPT(DPAD_UP))
|
||||||
|
{
|
||||||
|
if (Menu_GetCursorPos() != 0)
|
||||||
|
{
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
Menu_MoveCursor(-1);
|
||||||
|
PrintStringOnWindow0WithDialogueFrame(sItemStorageActionDescriptionPtrs[Menu_GetCursorPos()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (JOY_REPT(DPAD_DOWN))
|
||||||
|
{
|
||||||
|
if (Menu_GetCursorPos() != 2)
|
||||||
|
{
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
Menu_MoveCursor(+1);
|
||||||
|
PrintStringOnWindow0WithDialogueFrame(sItemStorageActionDescriptionPtrs[Menu_GetCursorPos()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (JOY_NEW(A_BUTTON))
|
||||||
|
{
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
sMenuActions_ItemPc[Menu_GetCursorPos()].func.void_u8(taskId);
|
||||||
|
}
|
||||||
|
else if (JOY_NEW(B_BUTTON))
|
||||||
|
{
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
sMenuActions_ItemPc[2].func.void_u8(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_DepositItem_WaitFadeAndGoToBag(u8 taskId)
|
||||||
|
{
|
||||||
|
if (!gPaletteFade.active)
|
||||||
|
{
|
||||||
|
CleanupOverworldWindowsAndTilemaps();
|
||||||
|
sub_8107DB4(3, POCKET_ITEMS - 1, CB2_ReturnToField);
|
||||||
|
gFieldCallback = CB2_ReturnFromDepositMenu;
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcDepositItem(u8 taskId)
|
||||||
|
{
|
||||||
|
gTasks[taskId].func = Task_DepositItem_WaitFadeAndGoToBag;
|
||||||
|
fade_screen(1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_ReturnToItemStorageSubmenu(u8 taskId)
|
||||||
|
{
|
||||||
|
if (field_weather_is_fade_finished() == TRUE)
|
||||||
|
gTasks[taskId].func = Task_TopMenu_ItemStorageSubmenu_HandleInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CB2_ReturnFromDepositMenu(void)
|
||||||
|
{
|
||||||
|
u8 taskId;
|
||||||
|
sub_80F6E9C();
|
||||||
|
DrawDialogueFrame(0, TRUE);
|
||||||
|
taskId = CreateTask(Task_ReturnToItemStorageSubmenu, 0);
|
||||||
|
Task_CreateItemStorageSubmenu(taskId, 1);
|
||||||
|
sub_807DC00();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcWithdrawItem(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
tCount = CountItemsInPC();
|
||||||
|
if (tCount != 0)
|
||||||
|
{
|
||||||
|
tItemPcParam = 0;
|
||||||
|
gTasks[taskId].func = Task_WithdrawItemBeginFade;
|
||||||
|
gFieldCallback = CB2_ReturnFromWithdrawMenu;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearStdWindowAndFrameToTransparent(tWindowId, FALSE);
|
||||||
|
ClearWindowTilemap(tWindowId);
|
||||||
|
RemoveWindow(tWindowId);
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_ThereAreNoItems, Task_PlayerPcItemStorage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CB2_ReturnFromWithdrawMenu(void)
|
||||||
|
{
|
||||||
|
u8 taskId;
|
||||||
|
sub_80F6E9C();
|
||||||
|
DrawDialogueFrame(0, TRUE);
|
||||||
|
taskId = CreateTask(Task_ReturnToItemStorageSubmenu, 0);
|
||||||
|
Task_CreateItemStorageSubmenu(taskId, 0);
|
||||||
|
sub_807DC00();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_WithdrawItem_WaitFadeAndGoToItemStorage(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
if (!gPaletteFade.active)
|
||||||
|
{
|
||||||
|
CleanupOverworldWindowsAndTilemaps();
|
||||||
|
ItemPc_Init(tItemPcParam, CB2_ReturnToField);
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_WithdrawItemBeginFade(u8 taskId)
|
||||||
|
{
|
||||||
|
gTasks[taskId].func = Task_WithdrawItem_WaitFadeAndGoToItemStorage;
|
||||||
|
ItemPc_SetInitializedFlag(0);
|
||||||
|
fade_screen(1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcCancel(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
ClearStdWindowAndFrameToTransparent(tWindowId, FALSE);
|
||||||
|
ClearWindowTilemap(tWindowId);
|
||||||
|
CopyWindowToVram(tWindowId, 1);
|
||||||
|
RemoveWindow(tWindowId);
|
||||||
|
Task_ReturnToTopMenu(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_SetPageItemVars(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
if (tCount >= 8)
|
||||||
|
tPageItems = 8;
|
||||||
|
else
|
||||||
|
tPageItems = tCount + 1;
|
||||||
|
if (gPlayerPcMenuManager.count >= 8)
|
||||||
|
gPlayerPcMenuManager.pageItems = 8;
|
||||||
|
else
|
||||||
|
gPlayerPcMenuManager.pageItems = gPlayerPcMenuManager.count + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static u8 CountPCMail(void)
|
||||||
|
{
|
||||||
|
u8 count = 0;
|
||||||
|
u8 i;
|
||||||
|
|
||||||
|
for (i = PC_MAIL_NUM(0); i < MAIL_COUNT; i++)
|
||||||
|
{
|
||||||
|
if (gSaveBlock1Ptr->mail[i].itemId != ITEM_NONE)
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void PCMailCompaction(void)
|
||||||
|
{
|
||||||
|
u8 i;
|
||||||
|
u8 j;
|
||||||
|
for (i = PC_MAIL_NUM(0); i < MAIL_COUNT - 1; i++)
|
||||||
|
{
|
||||||
|
for (j = i + 1; j < MAIL_COUNT; j++)
|
||||||
|
{
|
||||||
|
if (gSaveBlock1Ptr->mail[i].itemId == ITEM_NONE)
|
||||||
|
{
|
||||||
|
struct MailStruct mail = gSaveBlock1Ptr->mail[i];
|
||||||
|
gSaveBlock1Ptr->mail[i] = gSaveBlock1Ptr->mail[j];
|
||||||
|
gSaveBlock1Ptr->mail[j] = mail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_DrawMailboxPcMenu(u8 taskId)
|
||||||
|
{
|
||||||
|
u8 windowId = MailboxPC_GetAddWindow(0);
|
||||||
|
s32 width = GetStringWidth(2, gText_Mailbox, 0);
|
||||||
|
MailboxPC_GetAddWindow(1);
|
||||||
|
AddTextPrinterParameterized(windowId, 2, gText_Mailbox, (80 - width) / 2, 2, 0, NULL);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
gTasks[taskId].tListMenuTaskId = MailboxPC_InitListMenu(&gPlayerPcMenuManager);
|
||||||
|
MailboxPC_AddScrollIndicatorArrows(&gPlayerPcMenuManager);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_MailboxPcHandleInput(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
s32 input;
|
||||||
|
if (!gPaletteFade.active)
|
||||||
|
{
|
||||||
|
input = ListMenu_ProcessInput(tListMenuTaskId);
|
||||||
|
ListMenuGetScrollAndRow(tListMenuTaskId, &gPlayerPcMenuManager.scrollOffset, &gPlayerPcMenuManager.selectedRow);
|
||||||
|
switch (input)
|
||||||
|
{
|
||||||
|
case -1:
|
||||||
|
break;
|
||||||
|
case -2:
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
RemoveScrollIndicatorArrowPair(gPlayerPcMenuManager.scrollIndicatorId);
|
||||||
|
Task_DestroyMailboxPcViewAndCancel(taskId);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
MailboxPC_RemoveWindow(0);
|
||||||
|
MailboxPC_RemoveWindow(1);
|
||||||
|
DestroyListMenuTask(tListMenuTaskId, &gPlayerPcMenuManager.scrollOffset, &gPlayerPcMenuManager.selectedRow);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
RemoveScrollIndicatorArrowPair(gPlayerPcMenuManager.scrollIndicatorId);
|
||||||
|
gTasks[taskId].func = Task_PrintWhatToDoWithSelectedMail;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PrintWhatToDoWithSelectedMail(u8 taskId)
|
||||||
|
{
|
||||||
|
s32 length;
|
||||||
|
s32 i;
|
||||||
|
u8 *ptr;
|
||||||
|
StringCopy(gStringVar1, SELECTED_MAIL.playerName);
|
||||||
|
length = StringLength(gStringVar1);
|
||||||
|
if (length > 5)
|
||||||
|
{
|
||||||
|
for (ptr = gStringVar1 + length - 1; ptr >= gStringVar1; ptr--)
|
||||||
|
{
|
||||||
|
if (*ptr)
|
||||||
|
break;
|
||||||
|
*ptr = EOS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ConvertInternationalString(gStringVar1, LANGUAGE_JAPANESE);
|
||||||
|
}
|
||||||
|
StringExpandPlaceholders(gStringVar4, gText_WhatWouldYouLikeToDoWithPlayersMail);
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gStringVar4, Task_DrawMailSubmenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_DestroyMailboxPcViewAndCancel(u8 taskId)
|
||||||
|
{
|
||||||
|
s16 *data = gTasks[taskId].data;
|
||||||
|
MailboxPC_RemoveWindow(0);
|
||||||
|
MailboxPC_RemoveWindow(1);
|
||||||
|
DestroyListMenuTask(tListMenuTaskId, NULL, NULL);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
MailboxPC_DestroyListMenuBuffer();
|
||||||
|
Task_ReturnToTopMenu(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_DrawMailSubmenu(u8 taskId)
|
||||||
|
{
|
||||||
|
u8 windowId = MailboxPC_GetAddWindow(2);
|
||||||
|
PrintTextArray(windowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, 16, 4, sMenuActions_MailSubmenu);
|
||||||
|
Menu_InitCursor(windowId, 2, 0, 2, 16, 4, 0);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
gTasks[taskId].func = Task_MailSubmenuHandleInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_MailSubmenuHandleInput(u8 taskId)
|
||||||
|
{
|
||||||
|
s8 input = Menu_ProcessInput_other();
|
||||||
|
switch (input)
|
||||||
|
{
|
||||||
|
case -1:
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
Task_PlayerPcExitMailSubmenu(taskId);
|
||||||
|
break;
|
||||||
|
case -2:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
sMenuActions_MailSubmenu[input].func.void_u8(taskId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcReadMail(u8 taskId)
|
||||||
|
{
|
||||||
|
fade_screen(1, 0);
|
||||||
|
gTasks[taskId].func = Task_WaitFadeAndReadSelectedMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_WaitFadeAndReadSelectedMail(u8 taskId)
|
||||||
|
{
|
||||||
|
if (!gPaletteFade.active)
|
||||||
|
{
|
||||||
|
MailboxPC_DestroyListMenuBuffer();
|
||||||
|
CleanupOverworldWindowsAndTilemaps();
|
||||||
|
sub_80BEBEC(&SELECTED_MAIL, CB2_SetCbToReturnToMailbox, 1);
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_WaitFadeAndReturnToMailboxPcInputHandler(u8 taskId)
|
||||||
|
{
|
||||||
|
if (field_weather_is_fade_finished() == TRUE)
|
||||||
|
gTasks[taskId].func = Task_MailboxPcHandleInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CB2_ReturnToMailbox(void)
|
||||||
|
{
|
||||||
|
u8 taskId;
|
||||||
|
if (gPlayerPcMenuManager.unk_9 == 0)
|
||||||
|
HelpSystem_SetSomeVariable2(34);
|
||||||
|
else
|
||||||
|
HelpSystem_SetSomeVariable2(30);
|
||||||
|
sub_80F6E9C();
|
||||||
|
taskId = CreateTask(Task_WaitFadeAndReturnToMailboxPcInputHandler, 0);
|
||||||
|
if (MailboxPC_InitBuffers(gPlayerPcMenuManager.count) == TRUE)
|
||||||
|
Task_DrawMailboxPcMenu(taskId);
|
||||||
|
else
|
||||||
|
DestroyTask(taskId);
|
||||||
|
sub_807DC00();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CB2_SetCbToReturnToMailbox(void)
|
||||||
|
{
|
||||||
|
gFieldCallback = CB2_ReturnToMailbox;
|
||||||
|
SetMainCallback2(CB2_ReturnToField);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcMoveMailToBag(u8 taskId)
|
||||||
|
{
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_MessageWillBeLost, Task_DrawYesNoMenuToConfirmMoveToBag);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_DrawYesNoMenuToConfirmMoveToBag(u8 taskId)
|
||||||
|
{
|
||||||
|
DisplayYesNoMenuDefaultYes();
|
||||||
|
gTasks[taskId].func = Task_MoveToBagYesNoMenuHandleInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_MoveToBagYesNoMenuHandleInput(u8 taskId)
|
||||||
|
{
|
||||||
|
switch (Menu_ProcessInputNoWrapClearOnChoose())
|
||||||
|
{
|
||||||
|
case -2:
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
Task_TryPutMailInBag_DestroyMsgIfSuccessful(taskId);
|
||||||
|
break;
|
||||||
|
case -1:
|
||||||
|
PlaySE(SE_SELECT);
|
||||||
|
// fallthrough
|
||||||
|
case 1:
|
||||||
|
Task_DeclinedMoveMailToBag(taskId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_TryPutMailInBag_DestroyMsgIfSuccessful(u8 taskId)
|
||||||
|
{
|
||||||
|
struct MailStruct * mail = &SELECTED_MAIL;
|
||||||
|
if (!AddBagItem(mail->itemId, 1))
|
||||||
|
{
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_BagIsFull, Task_PlayerPcExitMailSubmenu);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_MailReturnedToBagMessageErased, Task_PlayerPcExitMailSubmenu);
|
||||||
|
ClearMailStruct(mail);
|
||||||
|
PCMailCompaction();
|
||||||
|
gPlayerPcMenuManager.count--;
|
||||||
|
if (gPlayerPcMenuManager.count < gPlayerPcMenuManager.pageItems + gPlayerPcMenuManager.scrollOffset)
|
||||||
|
{
|
||||||
|
if (gPlayerPcMenuManager.scrollOffset != 0)
|
||||||
|
gPlayerPcMenuManager.scrollOffset--;
|
||||||
|
}
|
||||||
|
Task_SetPageItemVars(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_DeclinedMoveMailToBag(u8 taskId)
|
||||||
|
{
|
||||||
|
Task_PlayerPcExitMailSubmenu(taskId);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcGiveMailToMon(u8 taskId)
|
||||||
|
{
|
||||||
|
if (CalculatePlayerPartyCount() == 0)
|
||||||
|
{
|
||||||
|
Task_Error_NoPokemon(taskId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fade_screen(1, 0);
|
||||||
|
gTasks[taskId].func = Task_WaitFadeAndGoToPartyMenu;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_WaitFadeAndGoToPartyMenu(u8 taskId)
|
||||||
|
{
|
||||||
|
if (!gPaletteFade.active)
|
||||||
|
{
|
||||||
|
MailboxPC_DestroyListMenuBuffer();
|
||||||
|
CleanupOverworldWindowsAndTilemaps();
|
||||||
|
PartyMenuInit_FromPlayerPc();
|
||||||
|
DestroyTask(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CB2_ReturnToMailboxPc_UpdateScrollVariables(void)
|
||||||
|
{
|
||||||
|
u8 taskId;
|
||||||
|
u8 count;
|
||||||
|
if (gPlayerPcMenuManager.unk_9 == 0)
|
||||||
|
HelpSystem_SetSomeVariable2(34);
|
||||||
|
else
|
||||||
|
HelpSystem_SetSomeVariable2(30);
|
||||||
|
taskId = CreateTask(Task_WaitFadeAndReturnToMailboxPcInputHandler, 0);
|
||||||
|
count = gPlayerPcMenuManager.count;
|
||||||
|
gPlayerPcMenuManager.count = CountPCMail();
|
||||||
|
PCMailCompaction();
|
||||||
|
if (count != gPlayerPcMenuManager.count)
|
||||||
|
{
|
||||||
|
if (gPlayerPcMenuManager.count < gPlayerPcMenuManager.pageItems + gPlayerPcMenuManager.scrollOffset)
|
||||||
|
{
|
||||||
|
if (gPlayerPcMenuManager.scrollOffset != 0)
|
||||||
|
gPlayerPcMenuManager.scrollOffset--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Task_SetPageItemVars(taskId);
|
||||||
|
sub_80F6E9C();
|
||||||
|
if (MailboxPC_InitBuffers(gPlayerPcMenuManager.count) == TRUE)
|
||||||
|
Task_DrawMailboxPcMenu(taskId);
|
||||||
|
else
|
||||||
|
DestroyTask(taskId);
|
||||||
|
sub_807DC00();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CB2_PlayerPC_ReturnFromPartyMenu(void)
|
||||||
|
{
|
||||||
|
gFieldCallback = CB2_ReturnToMailboxPc_UpdateScrollVariables;
|
||||||
|
SetMainCallback2(CB2_ReturnToField);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_Error_NoPokemon(u8 taskId)
|
||||||
|
{
|
||||||
|
DisplayItemMessageOnField(taskId, 2, gText_ThereIsNoPokemon, Task_PlayerPcExitMailSubmenu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_RedrawPlayerPcMailboxAndSetUpInputHandler(u8 taskId)
|
||||||
|
{
|
||||||
|
ClearDialogWindowAndFrame(0, FALSE);
|
||||||
|
Task_DrawMailboxPcMenu(taskId);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
gTasks[taskId].func = Task_MailboxPcHandleInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Task_PlayerPcExitMailSubmenu(u8 taskId)
|
||||||
|
{
|
||||||
|
MailboxPC_RemoveWindow(2);
|
||||||
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
|
gTasks[taskId].func = Task_RedrawPlayerPcMailboxAndSetUpInputHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef tListMenuTaskId
|
||||||
|
#undef tWindowId
|
||||||
|
#undef tItemPcParam
|
||||||
|
#undef tPageItems
|
||||||
|
#undef tCount
|
||||||
+3
-12
@@ -978,18 +978,9 @@ gUnknown_203AAB4: @ 203AAB4
|
|||||||
gUnknown_203AAB8: @ 203AAB8
|
gUnknown_203AAB8: @ 203AAB8
|
||||||
.space 0x4
|
.space 0x4
|
||||||
|
|
||||||
gUnknown_203AABC: @ 203AABC
|
.align 2
|
||||||
.space 0x4
|
.include "src/player_pc.o"
|
||||||
|
.align 2
|
||||||
gUnknown_203AAC0: @ 203AAC0
|
|
||||||
.space 0x4
|
|
||||||
|
|
||||||
gUnknown_203AAC4: @ 203AAC4
|
|
||||||
.space 0x2
|
|
||||||
|
|
||||||
gUnknown_203AAC6: @ 203AAC6
|
|
||||||
.space 0xE
|
|
||||||
|
|
||||||
.include "src/intro.o"
|
.include "src/intro.o"
|
||||||
|
|
||||||
.align 2
|
.align 2
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ static int getline(char ** lineptr, size_t * n, FILE * stream) {
|
|||||||
static void getIncbinsFromFile(hunk_t ** hunks, size_t * num, size_t * maxnum, const char * fname, char ** strbuf, size_t * buffersize) {
|
static void getIncbinsFromFile(hunk_t ** hunks, size_t * num, size_t * maxnum, const char * fname, char ** strbuf, size_t * buffersize) {
|
||||||
// Recursively find incbinned segments and encode them as hunks.
|
// Recursively find incbinned segments and encode them as hunks.
|
||||||
FILE * file = fopen(fname, "r");
|
FILE * file = fopen(fname, "r");
|
||||||
if (file == NULL) FATAL_ERROR("unable to open file \"%s\" for reading\n", fname);
|
if (file == NULL) return;
|
||||||
hunk_t * data = *hunks;
|
hunk_t * data = *hunks;
|
||||||
size_t nhunks = *num;
|
size_t nhunks = *num;
|
||||||
size_t maxnhunks = *maxnum;
|
size_t maxnhunks = *maxnum;
|
||||||
|
|||||||
Reference in New Issue
Block a user