diff options
author | JaceCearK1 <JaceCearK1@users.noreply.github.com> | 2017-07-01 21:04:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 21:04:18 +0200 |
commit | 0dd804a99e5455a0eac8ff6ed87d9de16c7380b7 (patch) | |
tree | 7b3567978b63ee6548a7b945e075ea8ba37bef51 /src/hof_pc.c | |
parent | f1344efd2aff92292f58f7323bd9297a38fe9b02 (diff) | |
parent | 8d82578d3a101b06f9d2ced31738021007c4e533 (diff) |
Merge pull request #1 from pret/master
Update fork to match main fork.
Diffstat (limited to 'src/hof_pc.c')
-rw-r--r-- | src/hof_pc.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/hof_pc.c b/src/hof_pc.c new file mode 100644 index 000000000..4646d171c --- /dev/null +++ b/src/hof_pc.c @@ -0,0 +1,42 @@ +#include "global.h" +#include "hall_of_fame.h" +#include "main.h" +#include "palette.h" +#include "rom4.h" +#include "script.h" +#include "script_menu.h" +#include "task.h" + +extern void (*gFieldCallback)(void); +extern void (*gUnknown_0300485C)(void); + +static void ReshowPCMenuAfterHallOfFamePC(void); +static void Task_WaitForPaletteFade(u8); + +void AccessHallOfFamePC(void) +{ + SetMainCallback2(sub_81428CC); + ScriptContext2_Enable(); +} + +void ReturnFromHallOfFamePC(void) +{ + SetMainCallback2(c2_exit_to_overworld_2_switch); + gFieldCallback = ReshowPCMenuAfterHallOfFamePC; +} + +static void ReshowPCMenuAfterHallOfFamePC(void) +{ + ScriptContext2_Enable(); + sub_8053E90(); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0); + TryCreatePCMenu(); + sub_80B5838(); + CreateTask(Task_WaitForPaletteFade, 10); +} + +static void Task_WaitForPaletteFade(u8 taskId) +{ + if (!gPaletteFade.active) + DestroyTask(taskId); +} |