From 4076ec59e3979afc8de126af4d676f7918000be3 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 03:19:06 -0600 Subject: [PATCH 01/31] First pass because i started losing my sanity --- libultraship | 2 +- mods/custom_mod_files_go_here.txt | 0 soh/CMakeLists.txt | 12 +- soh/soh/Enhancements/ArrowCycle.cpp | 3 +- .../Enhancements/AssignableTunicsAndBoots.cpp | 8 +- .../Enhancements/Cheats/EasyFrameAdvance.cpp | 2 +- soh/soh/Enhancements/Cheats/EasyISG.cpp | 2 +- soh/soh/Enhancements/Cheats/EasyQPA.cpp | 2 +- soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp | 2 +- .../Enhancements/Cheats/Infinite/Health.cpp | 2 +- .../Enhancements/Cheats/Infinite/Magic.cpp | 2 +- .../Enhancements/Cheats/Infinite/Money.cpp | 2 +- .../Cheats/Infinite/NayrusLove.cpp | 2 +- soh/soh/Enhancements/Cheats/MoonJump.cpp | 2 +- .../Enhancements/Cheats/UnrestrictedItems.cpp | 2 +- .../Enhancements/Difficulty/BonkDamage.cpp | 2 +- .../Enhancements/Difficulty/HyperEnemies.cpp | 5 +- .../Difficulty/PermanentLosses.cpp | 6 +- soh/soh/Enhancements/DisableSandstorm.cpp | 5 +- .../ExtraModes/BounceOffWalls.cpp | 2 +- .../Enhancements/ExtraModes/HurtContainer.cpp | 2 +- .../Enhancements/ExtraModes/MirroredWorld.cpp | 8 +- .../ExtraModes/RandomizedEnemySizes.cpp | 5 +- soh/soh/Enhancements/ExtraModes/RupeeDash.cpp | 2 +- soh/soh/Enhancements/ExtraModes/ShadowTag.cpp | 6 +- soh/soh/Enhancements/ExtraTraps.cpp | 11 +- .../Enhancements/Fixes/BrokenGiantsKnife.cpp | 5 +- soh/soh/Enhancements/Fixes/DirtPathFix.cpp | 10 +- soh/soh/Enhancements/Fixes/HammerHandFix.cpp | 2 +- .../Graphics/AgeDependentEquipment.cpp | 2 +- .../Graphics/Disable2DBackgrounds.cpp | 11 +- .../Graphics/DisableFixedCamera.cpp | 6 +- .../Enhancements/Graphics/ToTMedallions.cpp | 10 +- soh/soh/Enhancements/QoL/Autosave.cpp | 16 +- soh/soh/Enhancements/QoL/DaytimeGS.cpp | 2 +- soh/soh/Enhancements/QoL/PauseWarp.cpp | 4 +- soh/soh/Enhancements/QoL/ResetNaviTimer.cpp | 2 +- soh/soh/Enhancements/RemoteBombchu.cpp | 22 +- soh/soh/Enhancements/ResetGameplayFrames.cpp | 4 +- soh/soh/Enhancements/ResetHotKey.cpp | 2 +- .../Restorations/PauseBufferInputs.cpp | 2 +- .../TimeSavers/FasterPauseMenu.cpp | 4 +- .../TimeSavers/FasterRupeeAccumulator.cpp | 2 +- soh/soh/Enhancements/Warping.cpp | 12 +- soh/soh/Enhancements/audio/AudioHooks.cpp | 6 +- soh/soh/Enhancements/boss-rush/BossRush.cpp | 35 +- soh/soh/Enhancements/controls/Mouse.cpp | 39 +- .../cosmetics/CosmeticsEditor.cpp | 12 +- .../cosmetics/CustomLogoTitle.cpp | 17 +- .../cosmetics/CustomSkeletons.cpp | 10 +- .../Enhancements/cosmetics/NoMasterSword.cpp | 6 +- .../cosmetics/TimeFlowFileSelect.cpp | 2 +- soh/soh/Enhancements/customequipment.cpp | 11 +- soh/soh/Enhancements/debugger/valueViewer.cpp | 3 +- .../game-interactor/EventSystem_List.h | 180 ++++++++ .../game-interactor/GameInteractor.cpp | 115 ++++++ .../game-interactor/GameInteractor.h | 72 ++-- .../game-interactor/GameInteractor_Hooks.cpp | 387 +----------------- .../game-interactor/GameInteractor_Hooks.h | 99 +---- .../randomizer/Messages/EntranceHints.cpp | 10 +- .../randomizer/Messages/MerchantMessages.cpp | 5 +- .../Enhancements/randomizer/RocsFeather.cpp | 2 +- .../Enhancements/randomizer/ShuffleSigns.cpp | 4 +- .../randomizer/ShuffleWonderItems.cpp | 3 +- soh/soh/Enhancements/randomizer/entrance.cpp | 4 +- .../Enhancements/randomizer/fishsanity.cpp | 18 +- .../randomizer/randomizer_entrance.c | 2 +- .../randomizer/randomizer_item_tracker.cpp | 3 +- .../Enhancements/timesaver_hook_handlers.cpp | 198 +++++---- soh/soh/Network/Anchor/HookHandlers.cpp | 123 +++--- .../ObjectExtension/ActorMaximumHealth.cpp | 5 +- soh/soh/stubs.c | 17 +- soh/soh/z_play_otr.cpp | 4 +- soh/soh/z_scene_otr.cpp | 2 +- soh/src/code/audio_load.c | 2 +- soh/src/code/code_800EC960.c | 2 +- soh/src/code/game.c | 4 +- soh/src/code/z_actor.c | 64 +-- soh/src/code/z_inventory.c | 4 +- soh/src/code/z_kaleido_scope_call.c | 2 +- soh/src/code/z_kankyo.c | 2 +- soh/src/code/z_map_exp.c | 2 +- soh/src/code/z_message_PAL.c | 7 +- soh/src/code/z_parameter.c | 12 +- soh/src/code/z_play.c | 18 +- soh/src/code/z_player_lib.c | 2 +- soh/src/code/z_skelanime.c | 2 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 2 +- .../overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c | 2 +- .../actors/ovl_Boss_Ganon/z_boss_ganon.c | 2 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 2 +- .../ovl_Boss_Ganondrof/z_boss_ganondrof.c | 2 +- .../actors/ovl_Boss_Goma/z_boss_goma.c | 2 +- .../overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 2 +- .../overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 2 +- .../overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 2 +- .../overlays/actors/ovl_Boss_Va/z_boss_va.c | 2 +- .../actors/ovl_Door_Gerudo/z_door_gerudo.c | 2 +- .../actors/ovl_Door_Killer/z_door_killer.c | 2 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 2 +- soh/src/overlays/actors/ovl_En_Am/z_en_am.c | 2 +- .../actors/ovl_En_Anubice/z_en_anubice.c | 2 +- soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c | 2 +- soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c | 2 +- .../actors/ovl_En_Bigokuta/z_en_bigokuta.c | 2 +- .../overlays/actors/ovl_En_Bili/z_en_bili.c | 2 +- .../actors/ovl_En_Bubble/z_en_bubble.c | 2 +- soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c | 2 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 2 +- .../overlays/actors/ovl_En_Crow/z_en_crow.c | 2 +- .../overlays/actors/ovl_En_Daiku/z_en_daiku.c | 3 +- .../actors/ovl_En_Dekubaba/z_en_dekubaba.c | 4 +- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 2 +- soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c | 2 +- soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- .../actors/ovl_En_Dodojr/z_en_dodojr.c | 2 +- .../actors/ovl_En_Dodongo/z_en_dodongo.c | 2 +- .../overlays/actors/ovl_En_Door/z_en_door.c | 2 +- .../overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 2 +- soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c | 2 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 2 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 2 +- soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c | 12 +- soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c | 2 +- .../overlays/actors/ovl_En_GeldB/z_en_geldb.c | 2 +- .../overlays/actors/ovl_En_Goma/z_en_goma.c | 4 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c | 4 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 2 +- soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c | 4 +- soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c | 2 +- .../overlays/actors/ovl_En_Okuta/z_en_okuta.c | 2 +- .../overlays/actors/ovl_En_Ossan/z_en_ossan.c | 8 +- .../actors/ovl_En_Peehat/z_en_peehat.c | 6 +- .../actors/ovl_En_Po_Field/z_en_po_field.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 2 +- soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c | 2 +- soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- .../overlays/actors/ovl_En_Reeba/z_en_reeba.c | 4 +- soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c | 2 +- soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c | 2 +- soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 2 +- soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c | 2 +- soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c | 2 +- soh/src/overlays/actors/ovl_En_St/z_en_st.c | 2 +- soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c | 4 +- soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 2 +- .../overlays/actors/ovl_En_Test/z_en_test.c | 6 +- .../overlays/actors/ovl_En_Tite/z_en_tite.c | 2 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 2 +- soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c | 2 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 10 +- .../overlays/actors/ovl_En_Vali/z_en_vali.c | 2 +- soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 2 +- .../actors/ovl_En_Weiyer/z_en_weiyer.c | 2 +- soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 +- .../actors/ovl_En_Yukabyun/z_en_yukabyun.c | 2 +- soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c | 2 +- .../actors/ovl_player_actor/z_player.c | 14 +- .../ovl_file_choose/z_file_choose.c | 16 +- .../ovl_file_choose/z_file_copy_erase.c | 10 +- .../ovl_file_choose/z_file_nameset_NES.c | 8 +- .../ovl_file_choose/z_file_nameset_PAL.c | 12 +- .../overlays/gamestates/ovl_select/z_select.c | 2 +- .../overlays/gamestates/ovl_title/z_title.c | 2 +- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 4 +- 167 files changed, 961 insertions(+), 1030 deletions(-) create mode 100644 mods/custom_mod_files_go_here.txt create mode 100644 soh/soh/Enhancements/game-interactor/EventSystem_List.h diff --git a/libultraship b/libultraship index fdcaf633677..b824a837d4c 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit fdcaf6336776d24a6408d016b0a52243f108f250 +Subproject commit b824a837d4c0978fa17bdd45670d534f7b138443 diff --git a/mods/custom_mod_files_go_here.txt b/mods/custom_mod_files_go_here.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 31955ebf90a..b31c0124b57 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -103,7 +103,7 @@ set(PROJECT_NAME soh) # Sources ################################################################################ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c.in ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c @ONLY) -configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/properties.h.in ${CMAKE_CURRENT_SOURCE_DIR}/properties.h @ONLY) + configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/properties.h.in ${CMAKE_CURRENT_SOURCE_DIR}/properties.h @ONLY) set(Header_Files "resource.h") source_group("headers" FILES ${Header_Files}) @@ -637,7 +637,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") link_libraries(OpusFile::opusfile CONFIG REQUIRED) if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64") set(ADDITIONAL_LIBRARY_DEPENDENCIES - "libultraship;" + "$;" "ZAPDLib;" "glu32;" "SDL2::SDL2;" @@ -657,7 +657,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") ) elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32") set(ADDITIONAL_LIBRARY_DEPENDENCIES - "libultraship;" + "$;" "ZAPDLib;" "glu32;" "SDL2::SDL2;" @@ -674,7 +674,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) set(ADDITIONAL_LIBRARY_DEPENDENCIES - "libultraship;" + "$;" SDL2::SDL2 -lglad Threads::Threads @@ -682,7 +682,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS") find_package(SDL2 REQUIRED) set(ADDITIONAL_LIBRARY_DEPENDENCIES - "libultraship;" + "$;" SDL2::SDL2-static "$<$:-Wl,--wrap=abort>" @@ -699,7 +699,7 @@ else() find_package(Opus REQUIRED) find_package(OpusFile REQUIRED) set(ADDITIONAL_LIBRARY_DEPENDENCIES - "libultraship;" + "$;" "ZAPDLib;" SDL2::SDL2 "Ogg::ogg" diff --git a/soh/soh/Enhancements/ArrowCycle.cpp b/soh/soh/Enhancements/ArrowCycle.cpp index 45d8d3445ed..b45813e99f2 100644 --- a/soh/soh/Enhancements/ArrowCycle.cpp +++ b/soh/soh/Enhancements/ArrowCycle.cpp @@ -1,3 +1,4 @@ +#include "game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ShipInit.hpp" @@ -250,7 +251,7 @@ void ArrowCycleMain() { } void RegisterArrowCycle() { - COND_ID_HOOK(OnActorUpdate, ACTOR_PLAYER, CVAR_ARROW_CYCLE_VALUE, [](void* actor) { ArrowCycleMain(); }); + COND_ID_HOOK(OnActorUpdate, ACTOR_PLAYER, CVAR_ARROW_CYCLE_VALUE, [](IEvent* actor) { ArrowCycleMain(); }); // suppress shield input when R is held while aiming to allow arrow cycling COND_VB_SHOULD(VB_EXECUTE_PLAYER_ACTION_FUNC, CVAR_ARROW_CYCLE_VALUE, { diff --git a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp index 535cd1400bf..21f6d69dfbe 100644 --- a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp +++ b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp @@ -61,7 +61,7 @@ static void UseTunicBoots(Player* player, PlayState* play, Input* input) { } } -static void ClearAssignedTunicsBoots(int32_t unused = 0) { +static void ClearAssignedTunicsBoots(IEvent* event = nullptr) { for (int32_t buttonIndex = 0; buttonIndex < 8; buttonIndex++) { int32_t item = gSaveContext.equips.buttonItems[buttonIndex]; @@ -71,7 +71,11 @@ static void ClearAssignedTunicsBoots(int32_t unused = 0) { } } -static void ClearDeletedAssignedEquipment(int16_t equipmentType, uint16_t equipValue) { +static void ClearDeletedAssignedEquipment(IEvent* ev) { + auto event = reinterpret_cast(ev); + + int16_t equipmentType = event->equipmentType; + uint16_t equipValue = event->equipValue; ItemID itemToRemove = ITEM_NONE; if (equipmentType == EQUIP_TYPE_TUNIC) { diff --git a/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp b/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp index ab7bba3776b..88e1ca00e38 100644 --- a/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp +++ b/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp @@ -16,7 +16,7 @@ static int frameAdvanceTimer = 0; #define PAUSE_STATE_UNPAUSE_CLOSE 19 void RegisterEasyFrameAdvance() { - COND_HOOK(OnGameStateMainStart, CVAR_FRAME_ADVANCE_VALUE, []() { + COND_HOOK(OnGameStateMainStart, CVAR_FRAME_ADVANCE_VALUE, [](IEvent* event) { if (gPlayState == NULL) { return; } diff --git a/soh/soh/Enhancements/Cheats/EasyISG.cpp b/soh/soh/Enhancements/Cheats/EasyISG.cpp index f48788a9d9d..5fc75967946 100644 --- a/soh/soh/Enhancements/Cheats/EasyISG.cpp +++ b/soh/soh/Enhancements/Cheats/EasyISG.cpp @@ -11,7 +11,7 @@ extern PlayState* gPlayState; #define CVAR_EASY_ISG_DEFAULT 0 #define CVAR_EASY_ISG_VALUE CVarGetInteger(CVAR_EASY_ISG_NAME, CVAR_EASY_ISG_DEFAULT) -void OnGameFrameUpdateEasyISG() { +void OnGameFrameUpdateEasyISG(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } diff --git a/soh/soh/Enhancements/Cheats/EasyQPA.cpp b/soh/soh/Enhancements/Cheats/EasyQPA.cpp index 096123cdd0a..dce29d5ee03 100644 --- a/soh/soh/Enhancements/Cheats/EasyQPA.cpp +++ b/soh/soh/Enhancements/Cheats/EasyQPA.cpp @@ -11,7 +11,7 @@ extern PlayState* gPlayState; #define CVAR_EASY_QPA_DEFAULT 0 #define CVAR_EASY_QPA_VALUE CVarGetInteger(CVAR_EASY_QPA_NAME, CVAR_EASY_QPA_DEFAULT) -void OnGameFrameUpdateEasyQPA() { +void OnGameFrameUpdateEasyQPA(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } diff --git a/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp b/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp index c5a0297de61..685cc7fe8aa 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp @@ -14,7 +14,7 @@ extern SaveContext gSaveContext; #define CVAR_INFINITE_AMMO_DEFAULT 0 #define CVAR_INFINITE_AMMO_VALUE CVarGetInteger(CVAR_INFINITE_AMMO_NAME, CVAR_INFINITE_AMMO_DEFAULT) -void OnGameFrameUpdateInfiniteAmmo() { +void OnGameFrameUpdateInfiniteAmmo(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } diff --git a/soh/soh/Enhancements/Cheats/Infinite/Health.cpp b/soh/soh/Enhancements/Cheats/Infinite/Health.cpp index d731059e5ca..8187e4edd71 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Health.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Health.cpp @@ -9,7 +9,7 @@ extern "C" SaveContext gSaveContext; #define CVAR_INFINITE_HEALTH_DEFAULT 0 #define CVAR_INFINITE_HEALTH_VALUE CVarGetInteger(CVAR_INFINITE_HEALTH_NAME, CVAR_INFINITE_HEALTH_DEFAULT) -void OnGameFrameUpdateInfiniteHealth() { +void OnGameFrameUpdateInfiniteHealth(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } diff --git a/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp b/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp index aca55d71490..9722643addc 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp @@ -10,7 +10,7 @@ extern SaveContext gSaveContext; #define CVAR_INFINITE_MAGIC_DEFAULT 0 #define CVAR_INFINITE_MAGIC_VALUE CVarGetInteger(CVAR_INFINITE_MAGIC_NAME, CVAR_INFINITE_MAGIC_DEFAULT) -void OnGameFrameUpdateInfiniteMagic() { +void OnGameFrameUpdateInfiniteMagic(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } diff --git a/soh/soh/Enhancements/Cheats/Infinite/Money.cpp b/soh/soh/Enhancements/Cheats/Infinite/Money.cpp index 38b402d6d27..85a1bf162aa 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Money.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Money.cpp @@ -14,7 +14,7 @@ extern s32 Flags_GetRandomizerInf(RandomizerInf flag); #define CVAR_INFINITE_MONEY_DEFAULT 0 #define CVAR_INFINITE_MONEY_VALUE CVarGetInteger(CVAR_INFINITE_MONEY_NAME, CVAR_INFINITE_MONEY_DEFAULT) -void OnGameFrameUpdateInfiniteMoney() { +void OnGameFrameUpdateInfiniteMoney(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true) || (IS_RANDO && !Flags_GetRandomizerInf(RAND_INF_HAS_WALLET))) { return; } diff --git a/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp b/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp index f3ff5fe043c..77d317192e6 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp @@ -10,7 +10,7 @@ extern "C" SaveContext gSaveContext; #define CVAR_INFINITE_NAYRUS_LOVE_VALUE \ CVarGetInteger(CVAR_INFINITE_NAYRUS_LOVE_NAME, CVAR_INFINITE_NAYRUS_LOVE_DEFAULT) -void OnGameFrameUpdateInfiniteNayrusLove() { +void OnGameFrameUpdateInfiniteNayrusLove(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } diff --git a/soh/soh/Enhancements/Cheats/MoonJump.cpp b/soh/soh/Enhancements/Cheats/MoonJump.cpp index fb13c1c7b1a..d4e314f6000 100644 --- a/soh/soh/Enhancements/Cheats/MoonJump.cpp +++ b/soh/soh/Enhancements/Cheats/MoonJump.cpp @@ -11,7 +11,7 @@ extern PlayState* gPlayState; #define CVAR_MOON_JUMP_DEFAULT 0 #define CVAR_MOON_JUMP_VALUE CVarGetInteger(CVAR_MOON_JUMP_NAME, CVAR_MOON_JUMP_DEFAULT) -void OnPlayerUpdateMoonJump() { +void OnPlayerUpdateMoonJump(IEvent* event) { Player* player = GET_PLAYER(gPlayState); if (player != nullptr && CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) { diff --git a/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp b/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp index d6f92fea812..ab533682e56 100644 --- a/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp +++ b/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp @@ -8,7 +8,7 @@ extern "C" PlayState* gPlayState; #define CVAR_UNRESTRICTED_ITEMS_DEFAULT 0 #define CVAR_UNRESTRICTED_ITEMS_VALUE CVarGetInteger(CVAR_UNRESTRICTED_ITEMS_NAME, CVAR_UNRESTRICTED_ITEMS_DEFAULT) -void OnGameFrameUpdateUnrestrictedItems() { +void OnGameFrameUpdateUnrestrictedItems(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } diff --git a/soh/soh/Enhancements/Difficulty/BonkDamage.cpp b/soh/soh/Enhancements/Difficulty/BonkDamage.cpp index 04618c4a3a3..ef3a537c497 100644 --- a/soh/soh/Enhancements/Difficulty/BonkDamage.cpp +++ b/soh/soh/Enhancements/Difficulty/BonkDamage.cpp @@ -15,7 +15,7 @@ static constexpr BonkDamage CVAR_BONK_DAMAGE_DEFAULT = BONK_DAMAGE_NONE; #define CVAR_BONK_DAMAGE_SET (CVAR_BONK_DAMAGE_VALUE != CVAR_BONK_DAMAGE_DEFAULT) static void RegisterBonkDamage() { - COND_HOOK(OnPlayerBonk, CVAR_BONK_DAMAGE_SET, [] { + COND_HOOK(OnPlayerBonk, CVAR_BONK_DAMAGE_SET, [](IEvent* event) { uint16_t bonkDamage = 0; switch (CVAR_BONK_DAMAGE_VALUE) { case BONK_DAMAGE_NONE: diff --git a/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp b/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp index b2e0c933b2b..027991b3a0e 100644 --- a/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp +++ b/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp @@ -10,11 +10,12 @@ static constexpr int32_t CVAR_HYPER_ENEMIES_DEFAULT = 0; #define CVAR_HYPER_ENEMIES_NAME CVAR_ENHANCEMENT("HyperEnemies") #define CVAR_HYPER_ENEMIES_VALUE CVarGetInteger(CVAR_HYPER_ENEMIES_NAME, CVAR_HYPER_ENEMIES_DEFAULT) -static void MakeHyperEnemies(void* refActor) { +static void MakeHyperEnemies(IEvent* event) { // Run the update function a second time to make enemies and minibosses move and act twice as fast. + OnActorUpdate* ev = reinterpret_cast(event); Player* player = GET_PLAYER(gPlayState); - Actor* actor = static_cast(refActor); + Actor* actor = static_cast(ev->actor); // Some enemies are not in the ACTORCAT_ENEMY category, and some are that aren't really enemies. bool isEnemy = actor->category == ACTORCAT_ENEMY || actor->id == ACTOR_EN_TORCH2; diff --git a/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp b/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp index cab0aa7d439..fe97ed2a60c 100644 --- a/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp +++ b/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp @@ -42,7 +42,7 @@ static void UpdatePermanentHeartLossState() { hasAffectedHealth = false; } -static void UpdateHealthCapacity() { +static void UpdateHealthCapacity(IEvent* event) { // Applies permanent losses of Heart Containers to Link's health. Only applies when a saved game is playing. if (!GameInteractor::IsSaveLoaded()) { return; @@ -55,7 +55,7 @@ static void UpdateHealthCapacity() { } } -static void DeleteFileOnDeath() { +static void DeleteFileOnDeath(IEvent* event) { if (!GameInteractor::IsSaveLoaded() || gPlayState == NULL) { return; } @@ -79,7 +79,7 @@ static void RegisterDeleteFileOnDeath() { } static void RegisterResetAffectedHealthOnLoad() { - COND_HOOK(OnLoadGame, true, [](int16_t) { hasAffectedHealth = false; }); + COND_HOOK(OnLoadGame, true, [](IEvent* event) { hasAffectedHealth = false; }); } static RegisterShipInitFunc initFunc_PermanentHeartLoss(RegisterPermanentHeartLoss, { CVAR_PERM_HEART_LOSS_NAME }); diff --git a/soh/soh/Enhancements/DisableSandstorm.cpp b/soh/soh/Enhancements/DisableSandstorm.cpp index a13fd4fb566..f889c046552 100644 --- a/soh/soh/Enhancements/DisableSandstorm.cpp +++ b/soh/soh/Enhancements/DisableSandstorm.cpp @@ -3,8 +3,9 @@ extern "C" PlayState* gPlayState; -void DisableSandstormAfterTransition(int16_t sceneNum) { - if (sceneNum == SCENE_HAUNTED_WASTELAND) { +void DisableSandstormAfterTransition(IEvent* event) { + const OnTransitionEnd* ev = reinterpret_cast(event); + if (ev->sceneNum == SCENE_HAUNTED_WASTELAND) { gPlayState->envCtx.sandstormState = SANDSTORM_OFF; } } diff --git a/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp b/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp index 8d1643d8d67..6e0bcb45d9d 100644 --- a/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp +++ b/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp @@ -13,7 +13,7 @@ extern PlayState* gPlayState; static RegisterShipInitFunc initFunc( []() { - COND_HOOK(OnPlayerUpdate, CVAR_BOUNCE_OFF_WALLS_VALUE, []() { + COND_HOOK(OnPlayerUpdate, CVAR_BOUNCE_OFF_WALLS_VALUE, [](IEvent* event) { Player* player = GET_PLAYER(gPlayState); if (player->actor.bgCheckFlags & 0x08 && ABS(player->linearVelocity) > 15.0f) { player->yaw = ((player->actor.wallYaw - player->yaw) + player->actor.wallYaw) - 0x8000; diff --git a/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp b/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp index ecf39ef3156..8c49609d8d5 100644 --- a/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp +++ b/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp @@ -30,7 +30,7 @@ static void RegisterHurtContainer() { UpdateHurtContainerModeState(); } - COND_HOOK(OnLoadGame, hurtEnabled != CVAR_HURT_CONTAINER_VALUE, [](int32_t) { UpdateHurtContainerModeState(); }); + COND_HOOK(OnLoadGame, hurtEnabled != CVAR_HURT_CONTAINER_VALUE, [](IEvent* event) { UpdateHurtContainerModeState(); }); COND_VB_SHOULD(VB_HEARTS_INCREASE_WITH_CONTAINERS, CVAR_HURT_CONTAINER_VALUE, { *should = false; diff --git a/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp b/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp index 98d9c2c0d86..4235dca922e 100644 --- a/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp +++ b/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp @@ -54,8 +54,9 @@ static bool MirroredWorld_ShouldApply(int32_t sceneNum) { } } -static void UpdateMirrorModeState(int32_t sceneNum) { - bool nextMirroredWorld = MirroredWorld_ShouldApply(sceneNum); +static void UpdateMirrorModeState(IEvent* event) { + + bool nextMirroredWorld = MirroredWorld_ShouldApply(reinterpret_cast(event)->sceneNum); if (prevMirroredWorld == nextMirroredWorld) { return; @@ -73,7 +74,8 @@ static void UpdateMirrorModeState(int32_t sceneNum) { static void RegisterMirroredWorld() { if (gPlayState != NULL) { - UpdateMirrorModeState(gPlayState->sceneNum); + OnSceneInit ev = { .sceneNum = gPlayState->sceneNum }; + UpdateMirrorModeState(reinterpret_cast(&ev)); } COND_HOOK(OnSceneInit, CVAR_MIRRORED_WORLD_MODE_VALUE, UpdateMirrorModeState); diff --git a/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp b/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp index acb4b94d3b9..f2149fbacca 100644 --- a/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp +++ b/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp @@ -15,9 +15,10 @@ static constexpr int32_t CVAR_ENEMY_SCALE_HEALTH_DEFAULT = 0; #define CVAR_ENEMY_SCALE_HEALTH_NAME CVAR_ENHANCEMENT("EnemySizeScalesHealth") #define CVAR_ENEMY_SCALE_HEALTH_VALUE CVarGetInteger(CVAR_ENEMY_SCALE_HEALTH_NAME, CVAR_ENEMY_SCALE_HEALTH_DEFAULT) -static void RandomizedEnemySizes(void* refActor) { +static void RandomizedEnemySizes(IEvent* event) { // Randomized Enemy Sizes - Actor* actor = static_cast(refActor); + const OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); // Exclude wobbly platforms in Jabu because they need to act like platforms. // Exclude demo effect for Zora sapphire being re-categorized as a "boss". diff --git a/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp b/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp index 2fc224152d6..716d5948722 100644 --- a/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp +++ b/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp @@ -17,7 +17,7 @@ static constexpr int32_t CVAR_RUPEE_DASH_INTERVAL_DEFAULT = 5; #define CVAR_RUPEE_DASH_INTERVAL_TIME \ CVarGetInteger(CVAR_RUPEE_DASH_INTERVAL_NAME, CVAR_RUPEE_DASH_INTERVAL_DEFAULT) * 20 -static void UpdateRupeeDash() { +static void UpdateRupeeDash(IEvent* event) { // Initialize Timer static uint16_t rupeeDashTimer = 0; diff --git a/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp b/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp index 75350a4fd36..48c016bf9b5 100644 --- a/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp +++ b/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp @@ -16,7 +16,7 @@ static constexpr s8 ROOM_GREEN_POE = 16; static constexpr s8 ROOM_BLUE_POE = 13; static constexpr s8 ROOM_RED_POE = 12; -static void OnPlayerUpdateShadowTag() { +static void OnPlayerUpdateShadowTag(IEvent* event) { if (gPlayState->sceneNum == SCENE_FOREST_TEMPLE) { switch (gPlayState->roomCtx.curRoom.num) { case ROOM_GREEN_POE: @@ -43,8 +43,8 @@ static void ResetShadowTagSpawnTimer() { static void RegisterShadowTag() { COND_HOOK(OnPlayerUpdate, CVAR_SHADOW_TAG_VALUE, OnPlayerUpdateShadowTag); - COND_HOOK(OnSceneSpawnActors, true, []() { ResetShadowTagSpawnTimer(); }); - COND_HOOK(OnSceneInit, true, [](int16_t) { ResetShadowTagSpawnTimer(); }); + COND_HOOK(OnSceneSpawnActors, true, [](IEvent* event) { ResetShadowTagSpawnTimer(); }); + COND_HOOK(OnSceneInit, true, [](IEvent* event) { ResetShadowTagSpawnTimer(); }); } static RegisterShipInitFunc initFunc(RegisterShadowTag, { CVAR_SHADOW_TAG_NAME }); diff --git a/soh/soh/Enhancements/ExtraTraps.cpp b/soh/soh/Enhancements/ExtraTraps.cpp index 0be9f2bd31b..0bf46aba905 100644 --- a/soh/soh/Enhancements/ExtraTraps.cpp +++ b/soh/soh/Enhancements/ExtraTraps.cpp @@ -108,7 +108,7 @@ static void RollRandomTrap(uint64_t seed) { } } -static void OnPlayerUpdate() { +static void OnPlayerUpdateImpl(IEvent* event) { Player* player = GET_PLAYER(gPlayState); if (statusTimer == 0) { GameInteractor::State::MovementSpeedMultiplier = 1.0f; @@ -176,7 +176,7 @@ static void OnPlayerUpdate() { } void RegisterExtraTraps() { - COND_HOOK(OnPlayerUpdate, CVAR_EXTRA_TRAPS_VALUE, OnPlayerUpdate); + COND_HOOK(OnPlayerUpdate, CVAR_EXTRA_TRAPS_VALUE, OnPlayerUpdateImpl); COND_VB_SHOULD(VB_SHORT_CIRCUIT_GIVE_ITEM_PROCESS, true, { if (!gSaveContext.ship.pendingIceTrapCount) { @@ -188,7 +188,12 @@ void RegisterExtraTraps() { *should = true; gSaveContext.ship.pendingIceTrapCount--; gSaveContext.ship.stats.count[COUNT_ICE_TRAPS]++; - GameInteractor_ExecuteOnItemReceiveHooks(ItemTable_RetrieveEntry(MOD_RANDOMIZER, RG_ICE_TRAP)); + + // @port: The preprocessor fail if we use the CALL_EVENT macro here + OnItemReceive ev; + ev.itemEntry = ItemTable_RetrieveEntry(MOD_RANDOMIZER, RG_ICE_TRAP); + EventSystemCallEvent(OnItemReceiveID, &ev, __FILE__, __LINE__, FILE_AND_LINE); + if (CVAR_EXTRA_TRAPS_VALUE) { RollRandomTrap(gPlayState->sceneNum + player->getItemEntry.drawItemId); } else { diff --git a/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp b/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp index 1d4a55f5d8e..52677c984c4 100644 --- a/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp +++ b/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp @@ -13,8 +13,9 @@ static constexpr int32_t CVAR_BGS_FIX_DEFAULT = 0; #define CVAR_BGS_FIX_NAME CVAR_ENHANCEMENT("FixBrokenGiantsKnife") #define CVAR_BGS_FIX_VALUE CVarGetInteger(CVAR_BGS_FIX_NAME, CVAR_BGS_FIX_DEFAULT) -static void OnReceiveBrokenGiantsKnife(GetItemEntry itemEntry) { - if (itemEntry.itemId != ITEM_SWORD_BGS) { +static void OnReceiveBrokenGiantsKnife(IEvent* event) { + const OnItemReceive* ev = reinterpret_cast(event); + if (ev->itemEntry.itemId != ITEM_SWORD_BGS) { return; } diff --git a/soh/soh/Enhancements/Fixes/DirtPathFix.cpp b/soh/soh/Enhancements/Fixes/DirtPathFix.cpp index ae49f45bfa7..a4a272cf46b 100644 --- a/soh/soh/Enhancements/Fixes/DirtPathFix.cpp +++ b/soh/soh/Enhancements/Fixes/DirtPathFix.cpp @@ -8,8 +8,9 @@ static constexpr ZFightingFixType CVAR_DIRT_PATH_DEFAULT = ZFIGHT_FIX_DISABLED; #define CVAR_DIRT_PATH_NAME CVAR_ENHANCEMENT("SceneSpecificDirtPathFix") #define CVAR_DIRT_PATH_VALUE CVarGetInteger(CVAR_DIRT_PATH_NAME, CVAR_DIRT_PATH_DEFAULT) -static void DirtPathFix_UpdateZFightingMode(int32_t sceneNum) { - switch (sceneNum) { +static void DirtPathFix_UpdateZFightingMode(IEvent* event) { + OnTransitionEnd* ev = reinterpret_cast(event); + switch (ev->sceneNum) { case SCENE_HYRULE_FIELD: case SCENE_KOKIRI_FOREST: case SCENE_HYRULE_CASTLE: @@ -21,8 +22,9 @@ static void DirtPathFix_UpdateZFightingMode(int32_t sceneNum) { } static void RegisterDirtPathFix() { - if (gPlayState != NULL) { - DirtPathFix_UpdateZFightingMode(gPlayState->sceneNum); + if (gPlayState != nullptr) { + OnTransitionEnd ev = { .sceneNum = gPlayState->sceneNum }; + DirtPathFix_UpdateZFightingMode(reinterpret_cast(&ev)); } COND_HOOK(OnTransitionEnd, CVAR_DIRT_PATH_VALUE, DirtPathFix_UpdateZFightingMode); diff --git a/soh/soh/Enhancements/Fixes/HammerHandFix.cpp b/soh/soh/Enhancements/Fixes/HammerHandFix.cpp index 5ed90e45d9d..0fc8ab5dc62 100644 --- a/soh/soh/Enhancements/Fixes/HammerHandFix.cpp +++ b/soh/soh/Enhancements/Fixes/HammerHandFix.cpp @@ -32,7 +32,7 @@ static void RegisterHammerHandFix() { ResetHammerHand(); } - COND_HOOK(OnSceneInit, CVAR_HAMMER_HAND_VALUE, [](int32_t) { FixHammerHand(); }); + COND_HOOK(OnSceneInit, CVAR_HAMMER_HAND_VALUE, [](IEvent* event) { FixHammerHand(); }); } static RegisterShipInitFunc initFunc(RegisterHammerHandFix, { CVAR_HAMMER_HAND_NAME }); diff --git a/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp b/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp index 7dbe81a5d86..6a647cbb8d3 100644 --- a/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp +++ b/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp @@ -80,7 +80,7 @@ static void RegisterAgeDependentEquipmentHook() { ResetChildHands(); } - COND_HOOK(OnSceneInit, CVAR_AGE_EQUIPMENT_VALUE, [](int32_t) { MakeEquipmentAlwaysVisible(); }); + COND_HOOK(OnSceneInit, CVAR_AGE_EQUIPMENT_VALUE, [](IEvent* event) { MakeEquipmentAlwaysVisible(); }); } static RegisterShipInitFunc initFunc(RegisterAgeDependentEquipmentHook, { CVAR_AGE_EQUIPMENT_NAME }); diff --git a/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp b/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp index 9fbc3375db8..dc2b1f5bfaf 100644 --- a/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp +++ b/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp @@ -87,8 +87,9 @@ std::set skyboxIdControlList = { }; void Register3DPreRenderedScenes() { - COND_HOOK(AfterSceneCommands, CVAR_VALUE, [](int16_t sceneNum) { - if (!skyboxSceneControlList.contains(static_cast(sceneNum))) { + COND_HOOK(AfterSceneCommands, CVAR_VALUE, [](IEvent* event) { + AfterSceneCommands* ev = reinterpret_cast(event); + if (!skyboxSceneControlList.contains(static_cast(ev->sceneNum))) { return; } @@ -98,13 +99,13 @@ void Register3DPreRenderedScenes() { // Replace skybox with normal sky gPlayState->skyboxId = SKYBOX_NORMAL_SKY; // Apply the always cloudy skybox as an adult for Temple of Time and the Market - if (sceneNum == SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS || sceneNum == SCENE_MARKET_RUINS || - sceneNum == SCENE_MARKET_ENTRANCE_RUINS) { + if (ev->sceneNum == SCENE_TEMPLE_OF_TIME_EXTERIOR_RUINS || ev->sceneNum == SCENE_MARKET_RUINS || + ev->sceneNum == SCENE_MARKET_ENTRANCE_RUINS) { gWeatherMode = 3; } }); - COND_HOOK(OnPlayDrawBegin, CVAR_VALUE, []() { + COND_HOOK(OnPlayDrawBegin, CVAR_VALUE, [](IEvent* event) { if (!fogControlList.contains(static_cast(gPlayState->sceneNum))) { return; } diff --git a/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp b/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp index b937a98b10c..e38f437307b 100644 --- a/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp +++ b/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp @@ -90,8 +90,10 @@ static bool IsFixedCameraType(s16 type) { static void RegisterDisableFixedCamera() { const bool disableFixedCamEnabled = CVAR_DISABLE_FIXED_CAMERA_VALUE != 0; - COND_HOOK(OnCameraState, disableFixedCamEnabled, - [](PlayState* play) { DisableFixedCamera_CheckCameraState(play); }); + COND_HOOK(OnCameraState, disableFixedCamEnabled, [](IEvent* event) { + OnCameraState* ev = reinterpret_cast(event); + DisableFixedCamera_CheckCameraState(ev->play); + }); if (!disableFixedCamEnabled) { DisableFixedCamera_RestoreAllCameraData(); diff --git a/soh/soh/Enhancements/Graphics/ToTMedallions.cpp b/soh/soh/Enhancements/Graphics/ToTMedallions.cpp index e3a409196d3..6e9a0114ec7 100644 --- a/soh/soh/Enhancements/Graphics/ToTMedallions.cpp +++ b/soh/soh/Enhancements/Graphics/ToTMedallions.cpp @@ -101,8 +101,9 @@ static void ResetToTMedallions() { endGrayscale.RevertPatch(); } -static void CheckTempleOfTime(int16_t sceneNum) { - if (sceneNum != SCENE_TEMPLE_OF_TIME) { +static void CheckTempleOfTime(IEvent* event) { + OnSceneInit* ev = reinterpret_cast(event); + if (ev->sceneNum != SCENE_TEMPLE_OF_TIME) { return; } PatchToTMedallions(); @@ -115,9 +116,10 @@ static void RegisterToTMedallions() { ResetToTMedallions(); } - COND_HOOK(OnItemReceive, CVAR_TOT_MEDALLION_COLORS_VALUE, [](GetItemEntry) { + COND_HOOK(OnItemReceive, CVAR_TOT_MEDALLION_COLORS_VALUE, [](IEvent* event) { if (gPlayState) { - CheckTempleOfTime(gPlayState->sceneNum); + OnSceneInit ev = { .sceneNum = gPlayState->sceneNum }; + CheckTempleOfTime(reinterpret_cast(&ev)); } }); COND_HOOK(OnSceneInit, CVAR_TOT_MEDALLION_COLORS_VALUE, CheckTempleOfTime); diff --git a/soh/soh/Enhancements/QoL/Autosave.cpp b/soh/soh/Enhancements/QoL/Autosave.cpp index fd595007b04..91c2c2943fa 100644 --- a/soh/soh/Enhancements/QoL/Autosave.cpp +++ b/soh/soh/Enhancements/QoL/Autosave.cpp @@ -39,7 +39,7 @@ static bool Autosave_CanSave() { return true; } -static void Autosave_PerformSave() { +static void Autosave_PerformSave(IEvent* event) { Play_PerformSave(gPlayState); // Send notification @@ -50,7 +50,7 @@ static void Autosave_PerformSave() { } } -static void Autosave_IntervalSave() { +static void Autosave_IntervalSave(IEvent* event) { // Check if the interval has passed in minutes. uint64_t currentTimestamp = GetUnixTimestamp(); if ((currentTimestamp - lastSaveTimestamp) < THREE_MINUTES_IN_UNIX) { @@ -65,21 +65,21 @@ static void Autosave_IntervalSave() { // Reset timestamp, set icon timer to show autosave icon for 5 seconds (100 frames) lastSaveTimestamp = currentTimestamp; - Autosave_PerformSave(); + Autosave_PerformSave(nullptr); } } static void Autosave_SoftResetSave() { if (Autosave_CanSave()) { - Autosave_PerformSave(); + Autosave_PerformSave(nullptr); } } static void RegisterAutosave() { - COND_HOOK(GameInteractor::OnLoadGame, CVAR_AUTOSAVE_VALUE, - [](uint32_t fileNme) { lastSaveTimestamp = GetUnixTimestamp(); }); - COND_HOOK(GameInteractor::OnGameFrameUpdate, CVAR_AUTOSAVE_VALUE, Autosave_IntervalSave); - COND_HOOK(GameInteractor::OnExitGame, CVAR_AUTOSAVE_VALUE, [](int32_t fileNum) { Autosave_SoftResetSave(); }); + COND_HOOK(OnLoadGame, CVAR_AUTOSAVE_VALUE, + [](IEvent* event) { lastSaveTimestamp = GetUnixTimestamp(); }); + COND_HOOK(OnGameFrameUpdate, CVAR_AUTOSAVE_VALUE, Autosave_IntervalSave); + COND_HOOK(OnExitGame, CVAR_AUTOSAVE_VALUE, [](IEvent* event) { Autosave_SoftResetSave(); }); } static RegisterShipInitFunc initFunc(RegisterAutosave, { CVAR_AUTOSAVE_NAME }); diff --git a/soh/soh/Enhancements/QoL/DaytimeGS.cpp b/soh/soh/Enhancements/QoL/DaytimeGS.cpp index b6076ef4060..9e7fd4e5a14 100644 --- a/soh/soh/Enhancements/QoL/DaytimeGS.cpp +++ b/soh/soh/Enhancements/QoL/DaytimeGS.cpp @@ -21,7 +21,7 @@ struct DayTimeGoldSkulltulas { using DayTimeGoldSkulltulasList = std::vector; -static void OnSpawnNighttimeGoldSkulltula() { +static void OnSpawnNighttimeGoldSkulltula(IEvent* event) { // Gold Skulltulas that are not part of the scene actor list during the day // Actor values copied from the night time scene actor list static const DayTimeGoldSkulltulasList dayTimeGoldSkulltulas = { diff --git a/soh/soh/Enhancements/QoL/PauseWarp.cpp b/soh/soh/Enhancements/QoL/PauseWarp.cpp index 572ff671633..cb4d24ff1e7 100644 --- a/soh/soh/Enhancements/QoL/PauseWarp.cpp +++ b/soh/soh/Enhancements/QoL/PauseWarp.cpp @@ -138,12 +138,12 @@ static void PauseWarp_HandleSelection() { } static void RegisterPauseMenuHooks() { - COND_HOOK(OnKaleidoUpdate, CVAR_PAUSE_WARP_VALUE, [] { + COND_HOOK(OnKaleidoUpdate, CVAR_PAUSE_WARP_VALUE, [](IEvent* event) { if (GameInteractor::IsSaveLoaded()) { PauseWarp_HandleSelection(); } }); - COND_HOOK(OnGameFrameUpdate, CVAR_PAUSE_WARP_VALUE, [] { + COND_HOOK(OnGameFrameUpdate, CVAR_PAUSE_WARP_VALUE, [](IEvent* event) { if (GameInteractor::IsSaveLoaded()) { PauseWarp_Execute(); } diff --git a/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp b/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp index b3048be538f..970170a41cb 100644 --- a/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp +++ b/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp @@ -11,7 +11,7 @@ static constexpr int32_t CVAR_RESET_NAVI_DEFAULT = 0; #define CVAR_RESET_NAVI_VALUE CVarGetInteger(CVAR_RESET_NAVI_NAME, CVAR_RESET_NAVI_DEFAULT) static void RegisterResetNaviTimer() { - COND_HOOK(OnSceneInit, CVAR_RESET_NAVI_VALUE, [](int32_t) { gSaveContext.naviTimer = 0; }); + COND_HOOK(OnSceneInit, CVAR_RESET_NAVI_VALUE, [](IEvent* event) { gSaveContext.naviTimer = 0; }); } static RegisterShipInitFunc initFunc(RegisterResetNaviTimer, { CVAR_RESET_NAVI_NAME }); diff --git a/soh/soh/Enhancements/RemoteBombchu.cpp b/soh/soh/Enhancements/RemoteBombchu.cpp index 1813db23d53..2f79460112c 100644 --- a/soh/soh/Enhancements/RemoteBombchu.cpp +++ b/soh/soh/Enhancements/RemoteBombchu.cpp @@ -157,13 +157,15 @@ static void HandleInput(EnBomChu* chu, Input* input, PlayState* play) { } // Track the most recently spawned bombchu -static void OnActorInit(void* refActor) { - sState.activeChu = (EnBomChu*)refActor; +static void OnActorInitImpl(IEvent* event) { + const OnActorInit* ev = reinterpret_cast(event); + sState.activeChu = static_cast(ev->actor); } // Clean up if active bombchu is destroyed -static void OnActorDestroy(void* refActor) { - if (refActor == sState.activeChu) { +static void OnActorDestroyImpl(IEvent* event) { + const OnActorDestroy* ev = reinterpret_cast(event); + if (ev->actor == sState.activeChu) { if (sState.isActive) { StopControl(gPlayState); } @@ -172,8 +174,10 @@ static void OnActorDestroy(void* refActor) { } // Main update logic -static void OnActorUpdate(void* refActor) { - if (refActor != sState.activeChu) +static void OnActorUpdateImpl(IEvent* event) { + const OnActorUpdate* ev = reinterpret_cast(event); + + if (ev->actor != sState.activeChu) return; if (sState.activeChu->actionFunc != EnBomChu_Move) @@ -198,9 +202,9 @@ static void OnActorUpdate(void* refActor) { } void RegisterRemoteBombchu() { - COND_ID_HOOK(OnActorInit, ACTOR_EN_BOM_CHU, CVAR_REMOTE_BOMBCHU_VALUE, OnActorInit); - COND_ID_HOOK(OnActorDestroy, ACTOR_EN_BOM_CHU, CVAR_REMOTE_BOMBCHU_VALUE, OnActorDestroy); - COND_ID_HOOK(OnActorUpdate, ACTOR_EN_BOM_CHU, CVAR_REMOTE_BOMBCHU_VALUE, OnActorUpdate); + COND_ID_HOOK(OnActorInit, ACTOR_EN_BOM_CHU, CVAR_REMOTE_BOMBCHU_VALUE, OnActorInitImpl); + COND_ID_HOOK(OnActorDestroy, ACTOR_EN_BOM_CHU, CVAR_REMOTE_BOMBCHU_VALUE, OnActorDestroyImpl); + COND_ID_HOOK(OnActorUpdate, ACTOR_EN_BOM_CHU, CVAR_REMOTE_BOMBCHU_VALUE, OnActorUpdateImpl); } static RegisterShipInitFunc initFunc(RegisterRemoteBombchu, { CVAR_REMOTE_BOMBCHU_NAME }); diff --git a/soh/soh/Enhancements/ResetGameplayFrames.cpp b/soh/soh/Enhancements/ResetGameplayFrames.cpp index 3b234dbe589..245288fd2d7 100644 --- a/soh/soh/Enhancements/ResetGameplayFrames.cpp +++ b/soh/soh/Enhancements/ResetGameplayFrames.cpp @@ -6,7 +6,7 @@ extern "C" { #include "variables.h" } -void ResetGameplayFramesOnSoftReset() { +void ResetGameplayFramesOnSoftReset(IEvent* event) { PlayState* play = (PlayState*)gGameState; if (gGameState->init == TitleSetup_Init) { @@ -14,7 +14,7 @@ void ResetGameplayFramesOnSoftReset() { } } -void ResetGameplayFramesOnTitleScreenExit() { +void ResetGameplayFramesOnTitleScreenExit(IEvent* event) { PlayState* play = (PlayState*)gGameState; if (gSaveContext.fileNum == 0xFF) { diff --git a/soh/soh/Enhancements/ResetHotKey.cpp b/soh/soh/Enhancements/ResetHotKey.cpp index b57ae4ff2be..c9df8dfd3cd 100644 --- a/soh/soh/Enhancements/ResetHotKey.cpp +++ b/soh/soh/Enhancements/ResetHotKey.cpp @@ -13,7 +13,7 @@ static constexpr int32_t CVAR_RESET_BTN_MASK_DEFAULT = BTN_CUSTOM_MODIFIER2; #define CVAR_RESET_BTN_MASK_NAME "gSettings.ResetBtn" #define CVAR_RESET_BTN_MASK_VALUE CVarGetInteger(CVAR_RESET_BTN_MASK_NAME, CVAR_RESET_BTN_MASK_DEFAULT) -static void OnGameStateMainStartResetHotkey() { +static void OnGameStateMainStartResetHotkey(IEvent* event) { const int32_t packed = CVarGetInteger("gSettings.ResetBtn", BTN_CUSTOM_MODIFIER2); const uint16_t mask = static_cast(packed & 0xFFFF); diff --git a/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp b/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp index 090c46a60e4..6f8f90e3bfa 100644 --- a/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp +++ b/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp @@ -49,7 +49,7 @@ void RegisterPauseBufferInputs() { } }); - COND_HOOK(OnGameStateMainStart, CVAR_BUFFER_VALUE || CVAR_INCLUDE_VALUE, []() { + COND_HOOK(OnGameStateMainStart, CVAR_BUFFER_VALUE || CVAR_INCLUDE_VALUE, [](IEvent* event) { if (gPlayState == NULL) { return; } diff --git a/soh/soh/Enhancements/TimeSavers/FasterPauseMenu.cpp b/soh/soh/Enhancements/TimeSavers/FasterPauseMenu.cpp index d9f23216ded..b010afd8cd3 100644 --- a/soh/soh/Enhancements/TimeSavers/FasterPauseMenu.cpp +++ b/soh/soh/Enhancements/TimeSavers/FasterPauseMenu.cpp @@ -10,7 +10,7 @@ extern void func_808237B4(PlayState* play, Input* input); #define CVAR_FASTER_PAUSE_MENU_NAME CVAR_ENHANCEMENT("FasterPauseMenu") #define CVAR_FASTER_PAUSE_MENU_VALUE CVarGetInteger(CVAR_FASTER_PAUSE_MENU_NAME, 0) -void OnKaleidoUpdateFaster() { +void OnKaleidoUpdateFaster(IEvent* event) { ZREG(46) = 2; // pauseCtx->eye and pauseCtx->unk_1EA multiply by this for animation. Double the default value. WREG(6) = 4; // Numerous kaleido animations divide by this for movement and alpha. Half the default value. @@ -22,7 +22,7 @@ void OnKaleidoUpdateFaster() { } void InitFasterPauseMenu() { - COND_HOOK(GameInteractor::OnKaleidoUpdate, CVAR_FASTER_PAUSE_MENU_VALUE, OnKaleidoUpdateFaster); + COND_HOOK(OnKaleidoUpdate, CVAR_FASTER_PAUSE_MENU_VALUE, OnKaleidoUpdateFaster); // Reset register values on close. These values are only used by z_kaleido_scope_PAL.c COND_VB_SHOULD(VB_KALEIDO_UNPAUSE_CLOSE, CVAR_FASTER_PAUSE_MENU_VALUE, { diff --git a/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp b/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp index 5fcfb0d2681..c85ec8f9a90 100644 --- a/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp +++ b/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp @@ -11,7 +11,7 @@ extern SaveContext gSaveContext; } void RegisterFasterRupeeAccumulator() { - COND_HOOK(OnInterfaceUpdate, CVarGetInteger(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 0), []() { + COND_HOOK(OnInterfaceUpdate, CVarGetInteger(CVAR_ENHANCEMENT("FasterRupeeAccumulator"), 0), [](IEvent* event) { if (gSaveContext.rupeeAccumulator == 0) { return; } diff --git a/soh/soh/Enhancements/Warping.cpp b/soh/soh/Enhancements/Warping.cpp index 0a21a21fc44..48fd0d5f052 100644 --- a/soh/soh/Enhancements/Warping.cpp +++ b/soh/soh/Enhancements/Warping.cpp @@ -76,7 +76,7 @@ void Warp(WarpPoint& warpPoint) { gWeatherMode = 0; gGameState->running = false; SET_NEXT_GAMESTATE(gGameState, Play_Init, PlayState); - GameInteractor_ExecuteOnLoadGame(gSaveContext.fileNum); + CALL_EVENT(OnLoadGame, gSaveContext.fileNum); } else { gPlayState->nextEntranceIndex = warpPoint.entranceId; gPlayState->transitionTrigger = TRANS_TRIGGER_START; @@ -183,8 +183,9 @@ void RegisterWarping() { loadedConfig = true; } - COND_HOOK(OnZTitleUpdate, CVAR_BOOTSEQUENCE_VALUE == BOOTSEQUENCE_DEBUGWARPSCREEN, [](void* gameState) { - TitleContext* titleContext = (TitleContext*)gameState; + COND_HOOK(OnZTitleUpdate, CVAR_BOOTSEQUENCE_VALUE == BOOTSEQUENCE_DEBUGWARPSCREEN, [](IEvent* event) { + OnZTitleUpdate* ev = reinterpret_cast(event); + TitleContext* titleContext = (TitleContext*) ev->gameState; gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = 0xFF; @@ -193,7 +194,8 @@ void RegisterWarping() { SET_NEXT_GAMESTATE(&titleContext->state, Select_Init, SelectContext); }); - COND_HOOK(OnZTitleUpdate, CVAR_BOOTSEQUENCE_VALUE == BOOTSEQUENCE_WARPPOINT, [](void* gameState) { + COND_HOOK(OnZTitleUpdate, CVAR_BOOTSEQUENCE_VALUE == BOOTSEQUENCE_WARPPOINT, [](IEvent* event) { + OnZTitleUpdate* ev = reinterpret_cast(event); for (auto& wp : warpPoints) { if (wp.second.bootToPoint) { Warp(wp.second); @@ -202,7 +204,7 @@ void RegisterWarping() { } // Fallback to Debug Warp Screen if no warp point is set to boot to - TitleContext* titleContext = (TitleContext*)gameState; + TitleContext* titleContext = (TitleContext*)ev->gameState; gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = 0xFF; diff --git a/soh/soh/Enhancements/audio/AudioHooks.cpp b/soh/soh/Enhancements/audio/AudioHooks.cpp index f035eb0d18e..3fddb633843 100644 --- a/soh/soh/Enhancements/audio/AudioHooks.cpp +++ b/soh/soh/Enhancements/audio/AudioHooks.cpp @@ -14,7 +14,11 @@ extern PlayState* gPlayState; #define CVAR_SEQOVERLAY_DEFAULT 0 #define CVAR_SEQOVERLAY_VALUE CVarGetInteger(CVAR_SEQOVERLAY_NAME, CVAR_SEQOVERLAY_DEFAULT) -void NotifySequenceName(int32_t playerIdx, int32_t seqId) { +void NotifySequenceName(IEvent* event) { + const OnSeqPlayerInit* ev = reinterpret_cast(event); + const int32_t playerIdx = ev->playerIdx; + const int32_t seqId = ev->seqId; + // Keep track of the previous sequence/scene so we don't repeat notifications static uint16_t previousSeqId = UINT16_MAX; static int16_t previousSceneNum = INT16_MAX; diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index 170b175cb4a..bb9dfc96273 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -273,7 +273,7 @@ void FileChoose_UpdateBossRushMenu(GameState* gameState) { if (sLastBossRushOptionIndex != fileChooseContext->bossRushIndex || sLastBossRushOptionValue != gSaveContext.ship.quest.data.bossRush.options[fileChooseContext->bossRushIndex]) { - GameInteractor_ExecuteOnUpdateFileBossRushOptionSelection( + CALL_EVENT(OnUpdateFileBossRushOptionSelection, fileChooseContext->bossRushIndex, gSaveContext.ship.quest.data.bossRush.options[fileChooseContext->bossRushIndex]); sLastBossRushOptionIndex = fileChooseContext->bossRushIndex; @@ -739,9 +739,12 @@ static void* sSavePromptNoChoiceTexs[] = { (void*)gPauseNoFRATex, }; -void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { +void BossRush_OnVanillaBehaviorHandler(IEvent* event) { + OnVanillaBehavior* ev = reinterpret_cast(event); + GIVanillaBehavior id = ev->flag; + bool* should = ev->result; va_list args; - va_copy(args, originalArgs); + va_copy(args, ev->originalArgs); switch (id) { // Allow not healing before ganon @@ -893,19 +896,21 @@ void BossRush_OnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li va_end(args); } -void BossRush_OnSceneInitHandler(s16 sceneNum) { +void BossRush_OnSceneInitHandler(IEvent* event) { + OnSceneInit* ev = reinterpret_cast(event); // Unpause the timer when the scene loaded isn't the Chamber of Sages. - if (sceneNum != SCENE_CHAMBER_OF_THE_SAGES) { + if (ev->sceneNum != SCENE_CHAMBER_OF_THE_SAGES) { gSaveContext.ship.quest.data.bossRush.isPaused = false; } } -void BossRush_OnBossDefeatHandler(void* refActor) { +void BossRush_OnBossDefeatHandler(IEvent* event) { BossRush_HandleCompleteBoss(gPlayState); } -void BossRush_OnBlueWarpUpdate(void* actor) { - DoorWarp1* blueWarp = static_cast(actor); +void BossRush_OnBlueWarpUpdate(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + DoorWarp1* blueWarp = static_cast(ev->actor); if (blueWarp->warpTimer > 160) { BossRush_HandleBlueWarp(gPlayState, blueWarp->actor.world.pos.x, blueWarp->actor.world.pos.z); @@ -913,22 +918,24 @@ void BossRush_OnBlueWarpUpdate(void* actor) { } void RegisterBossRush() { - COND_HOOK(OnLoadGame, true, [](int32_t fileNum) { - COND_ID_HOOK(OnActorInit, ACTOR_DEMO_SA, IS_BOSS_RUSH, [](void* actorPtr) { + COND_HOOK(OnLoadGame, true, [](IEvent* event) { + + COND_ID_HOOK(OnActorInit, ACTOR_DEMO_SA, IS_BOSS_RUSH, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); BossRush_SpawnBlueWarps(gPlayState); - Actor_Kill((Actor*)actorPtr); + Actor_Kill((Actor*) ev->actor); GET_PLAYER(gPlayState)->actor.world.rot.y = 27306; GET_PLAYER(gPlayState)->actor.shape.rot.y = 27306; }); // Remove bushes, used in Gohma's arena - COND_ID_HOOK(OnActorInit, ACTOR_EN_KUSA, IS_BOSS_RUSH, [](void* actorPtr) { Actor_Kill((Actor*)actorPtr); }); + COND_ID_HOOK(OnActorInit, ACTOR_EN_KUSA, IS_BOSS_RUSH, [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); // Remove pots, used in Barinade's and Ganondorf's arenas - COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, IS_BOSS_RUSH, [](void* actorPtr) { Actor_Kill((Actor*)actorPtr); }); + COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, IS_BOSS_RUSH, [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); // Remove chests, mainly for the chest in King Dodongo's boss room - COND_ID_HOOK(OnActorInit, ACTOR_EN_BOX, IS_BOSS_RUSH, [](void* actorPtr) { Actor_Kill((Actor*)actorPtr); }); + COND_ID_HOOK(OnActorInit, ACTOR_EN_BOX, IS_BOSS_RUSH, [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); COND_HOOK(OnVanillaBehavior, IS_BOSS_RUSH, BossRush_OnVanillaBehaviorHandler); diff --git a/soh/soh/Enhancements/controls/Mouse.cpp b/soh/soh/Enhancements/controls/Mouse.cpp index 3d560bcc32b..30ca00bdd53 100644 --- a/soh/soh/Enhancements/controls/Mouse.cpp +++ b/soh/soh/Enhancements/controls/Mouse.cpp @@ -3,6 +3,7 @@ #include "z64player.h" #include "global.h" #include +#include #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/ShipInit.hpp" @@ -18,28 +19,27 @@ std::shared_ptr GetWindow() { return OTRGlobals::Instance->context->GetWindow(); } -extern "C" { -void Mouse_UpdatePos() { +extern "C" void Mouse_UpdatePos() { mouseCoord = GetWindow()->GetMousePos(); } -void Mouse_UpdatePosRel() { +extern "C" void Mouse_UpdatePosRel() { mouseCoordRel = GetWindow()->GetMouseDelta(); } -void Mouse_UpdateAll() { +extern "C" void Mouse_UpdateAll() { Mouse_UpdatePos(); Mouse_UpdatePosRel(); } -void Mouse_HandleThirdPerson(f32* newCamX, f32* newCamY) { +extern "C" void Mouse_HandleThirdPerson(f32* newCamX, f32* newCamY) { if (MOUSE_ENABLED) { *newCamX -= mouseCoordRel.x * 40.0f; *newCamY -= mouseCoordRel.y * 40.0f; } } -void Mouse_HandleFirstPerson(Player* player) { +extern"C" void Mouse_HandleFirstPerson(Player* player) { f32 xAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.X"), 1.0f); f32 yAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.Y"), 1.0f); s8 invertXAxisMulti = ((CVarGetInteger(CVAR_SETTING("Controls.InvertAimingXAxis"), 0) && @@ -55,7 +55,7 @@ void Mouse_HandleFirstPerson(Player* player) { } } -void Mouse_RecenterCursor() { +extern "C" void Mouse_RecenterCursor() { u32 width = GetWindow()->GetWidth(); u32 height = GetWindow()->GetHeight(); if (MOUSE_ENABLED) { @@ -63,7 +63,7 @@ void Mouse_RecenterCursor() { } } -void Mouse_HandleShield(f32* sp50, f32* sp54) { +extern "C" void Mouse_HandleShield(f32* sp50, f32* sp54) { if (MOUSE_ENABLED) { s32 width = GetWindow()->GetWidth(); s32 height = GetWindow()->GetHeight(); @@ -82,7 +82,7 @@ static s32 mouseQuickspinX[5] = {}; static s32 mouseQuickspinY[5] = {}; static u8 quickspinCount = 0; -void Mouse_UpdateQuickspinCount() { +extern "C" void Mouse_UpdateQuickspinCount() { if (MOUSE_ENABLED) { quickspinCount = (quickspinCount + 1) % 5; mouseQuickspinX[quickspinCount] = mouseCoord.x; @@ -92,7 +92,7 @@ void Mouse_UpdateQuickspinCount() { } } -bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C) { +extern "C" bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C) { s8 temp1; s8 temp2; s32 i; @@ -129,19 +129,29 @@ bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C) { // Hook handlers void Mouse_RegisterRecenterCursorOnShield() { - COND_HOOK(OnPlayerHoldUpShield, true, Mouse_RecenterCursor); + COND_HOOK(OnPlayerHoldUpShield, true, [](IEvent* event){ + Mouse_RecenterCursor(); + }); } void Mouse_RegisterHandleFirstPerson() { - COND_HOOK(OnPlayerFirstPersonControl, true, Mouse_HandleFirstPerson); + COND_HOOK(OnPlayerFirstPersonControl, true, [](IEvent* event){ + OnPlayerFirstPersonControl* ev = reinterpret_cast(event); + Mouse_HandleFirstPerson(ev->player); + }); } void Mouse_RegisterHandleShield() { - COND_HOOK(OnPlayerShieldControl, true, Mouse_HandleShield); + COND_HOOK(OnPlayerShieldControl, true, [](IEvent* event){ + OnPlayerShieldControl* ev = reinterpret_cast(event); + Mouse_HandleShield(ev->sp50, ev->sp54); + }); } void Mouse_RegisterUpdateQuickspinCount() { - COND_HOOK(OnPlayerProcessStick, true, Mouse_UpdateQuickspinCount); + COND_HOOK(OnPlayerProcessStick, true, [](IEvent* event){ + Mouse_UpdateQuickspinCount(); + }); } void Mouse_RegisterHandleQuickspin() { @@ -153,4 +163,3 @@ static RegisterShipInitFunc registerFirstPerson(Mouse_RegisterHandleFirstPerson, static RegisterShipInitFunc registerQuickspinCount(Mouse_RegisterUpdateQuickspinCount, { CVAR_ENABLE_MOUSE_NAME }); static RegisterShipInitFunc registerQuickspin(Mouse_RegisterHandleQuickspin, { CVAR_ENABLE_MOUSE_NAME }); static RegisterShipInitFunc registerShieldMove(Mouse_RegisterHandleShield, { CVAR_ENABLE_MOUSE_NAME }); -} // extern "C" diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 90f2910cb39..5dd9a52371b 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -531,7 +531,7 @@ int hue = 0; // Runs every frame to update rainbow hue, a potential future optimization is to only run this a once or twice a second // and increase the speed of the rainbow hue rotation. -void CosmeticsUpdateTick() { +void CosmeticsUpdateTick(IEvent* event = nullptr) { int index = 0; float rainbowSpeed = CVarGetFloat(CVAR_COSMETIC("RainbowSpeed"), 0.6f); for (auto& [id, cosmeticOption] : cosmeticOptions) { @@ -2684,23 +2684,23 @@ void CosmeticsEditor_ResetGroup(CosmeticGroup group) { void RegisterCosmeticHooks() { COND_HOOK(OnGenerationCompletion, CVarGetInteger(CVAR_COSMETIC("RandomizeCosmeticsGenModes"), RANDOMIZE_OFF) == RANDOMIZE_ON_RANDO_GEN_ONLY, - []() { CosmeticsEditor_AutoRandomizeAll(); }); + [](IEvent* event) { CosmeticsEditor_AutoRandomizeAll(); }); COND_HOOK(OnLoadGame, CVarGetInteger(CVAR_COSMETIC("RandomizeCosmeticsGenModes"), RANDOMIZE_OFF) == RANDOMIZE_OFF, - [](s32 fileNum) { ApplyOrResetCustomGfxPatches(); }); + [](IEvent* event) { ApplyOrResetCustomGfxPatches(); }); COND_HOOK(OnLoadGame, CVarGetInteger(CVAR_COSMETIC("RandomizeCosmeticsGenModes"), RANDOMIZE_OFF) == RANDOMIZE_ON_FILE_LOAD, - [](s32 fileNum) { CosmeticsEditor_AutoRandomizeAll(); }); + [](IEvent* event) { CosmeticsEditor_AutoRandomizeAll(); }); COND_HOOK(OnLoadGame, CVarGetInteger(CVAR_COSMETIC("RandomizeCosmeticsGenModes"), RANDOMIZE_OFF) == RANDOMIZE_ON_FILE_LOAD_SEEDED, - [](s32 fileNum) { CosmeticsEditor_AutoRandomizeAll(); }); + [](IEvent* event) { CosmeticsEditor_AutoRandomizeAll(); }); COND_HOOK(OnSceneInit, CVarGetInteger(CVAR_COSMETIC("RandomizeCosmeticsGenModes"), RANDOMIZE_OFF) == RANDOMIZE_ON_NEW_SCENE, - [](s16 sceneNum) { CosmeticsEditor_AutoRandomizeAll(); }); + [](IEvent* event) { CosmeticsEditor_AutoRandomizeAll(); }); COND_HOOK(OnGameFrameUpdate, true, CosmeticsUpdateTick); } diff --git a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp index 85549bf7884..61fefda0b62 100644 --- a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp +++ b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp @@ -165,7 +165,7 @@ extern "C" void CustomLogoTitle_Main(TitleContext* titleContext) { } } - GameInteractor_ExecuteOnZTitleUpdate(titleContext); + CALL_EVENT(OnZTitleUpdate); CLOSE_DISPS(titleContext->state.gfxCtx); } @@ -174,14 +174,16 @@ extern "C" void CustomLogoTitle_Main(TitleContext* titleContext) { // Always // -void OnZTitleInitReplaceTitleMainWithCustom(void* gameState) { - TitleContext* titleContext = (TitleContext*)gameState; +void OnZTitleInitReplaceTitleMainWithCustom(IEvent* event) { + OnZTitleInit* ev = reinterpret_cast(event); + TitleContext* titleContext = (TitleContext*) ev->gameState; titleContext->state.main = (GameStateFunc)CustomLogoTitle_Main; } // Allows pressing A to skip the boot logo and go to the next state (opening or file select) -void OnZTitleUpdatePressButtonToSkip(void* gameState) { - TitleContext* titleContext = (TitleContext*)gameState; +void OnZTitleUpdatePressButtonToSkip(IEvent* event) { + OnZTitleUpdate* ev = reinterpret_cast(event); + TitleContext* titleContext = (TitleContext*) ev->gameState; if (CHECK_BTN_ANY(titleContext->state.input->press.button, BTN_A | BTN_B | BTN_START)) { // Force the title state to start fading to black and to last roughly 5 frames based on current fade in/out @@ -201,8 +203,9 @@ static RegisterShipInitFunc registerCustomLogo(RegisterCustomLogoTitle); // Bootsequence // -void OnZTitleUpdateSkipToFileSelect(void* gameState) { - TitleContext* titleContext = (TitleContext*)gameState; +void OnZTitleUpdateSkipToFileSelect(IEvent* event) { + OnZTitleUpdate* ev = reinterpret_cast(event); + TitleContext* titleContext = (TitleContext*)ev->gameState; gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = 0xFF; diff --git a/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp b/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp index 77be9b19ade..84ffbbe8440 100644 --- a/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp +++ b/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp @@ -8,7 +8,7 @@ extern "C" { extern PlayState* gPlayState; } -static void UpdateCustomSkeleton() { +static void UpdateCustomSkeleton(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true) || gPlayState == NULL) { return; } @@ -16,10 +16,14 @@ static void UpdateCustomSkeleton() { SOH::SkeletonPatcher::UpdateCustomSkeletons(); } +static void AlwaysUpdateCustomSkeleton(IEvent* event) { + SOH::SkeletonPatcher::UpdateCustomSkeletons(); +} + static void RegisterCustomSkeletons() { COND_HOOK(OnAssetAltChange, true, UpdateCustomSkeleton); - COND_HOOK(OnLinkSkeletonInit, true, SOH::SkeletonPatcher::UpdateCustomSkeletons); - COND_HOOK(OnLinkEquipmentChange, true, SOH::SkeletonPatcher::UpdateCustomSkeletons); + COND_HOOK(OnLinkSkeletonInit, true, AlwaysUpdateCustomSkeleton); + COND_HOOK(OnLinkEquipmentChange, true, AlwaysUpdateCustomSkeleton); } static RegisterShipInitFunc initFunc(RegisterCustomSkeletons); diff --git a/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp b/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp index be011c675b6..62d94893ee2 100644 --- a/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp +++ b/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp @@ -14,7 +14,7 @@ extern void Player_StartMode_Idle(PlayState*, Player*); extern u8 Randomizer_GetSettingValue(RandomizerSettingKey); } -void UpdateNoMSPatch() { +void UpdateNoMSPatch(IEvent* event) { // Condition for patching bool shouldPatch = (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER && gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS && @@ -103,10 +103,10 @@ void RegisterNoMasterSword() { } }); - COND_HOOK(OnPlayerUpdate, IS_RANDO, [] { + COND_HOOK(OnPlayerUpdate, IS_RANDO, [](IEvent* event) { static uint16_t lastItemOnB = gSaveContext.equips.buttonItems[0]; if (lastItemOnB != gSaveContext.equips.buttonItems[0]) { - UpdateNoMSPatch(); + UpdateNoMSPatch(nullptr); lastItemOnB = gSaveContext.equips.buttonItems[0]; } }); diff --git a/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp b/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp index bd99ca1b11f..e973fa72523 100644 --- a/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp +++ b/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp @@ -9,7 +9,7 @@ static constexpr int32_t CVAR_TIMEFLOWFILESELECT_DEFAULT = 0; #define CVAR_TIMEFLOWFILESELECT_NAME CVAR_ENHANCEMENT("TimeFlowFileSelect") #define CVAR_TIMEFLOWFILESELECT_VALUE CVarGetInteger(CVAR_TIMEFLOWFILESELECT_NAME, CVAR_TIMEFLOWFILESELECT_DEFAULT) -void OnFileChooseMainTimeFlowFileSelect(void* gameState) { +void OnFileChooseMainTimeFlowFileSelect(IEvent* event) { gSaveContext.skyboxTime += 0x10; } diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index b799d4a9958..d8f98acf3e1 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -57,17 +57,18 @@ static const char* GetBrokenLongswordInSheathDL() { { gCustomBrokenLongswordInSheathDL, gCustomBreakableLongswordInSheathDL, gCustomLongswordInSheathDL }); } -static void UpdateCustomEquipmentSetModel(Player* player, u8 ModelGroup) { - (void)ModelGroup; +static void UpdateCustomEquipmentSetModel(IEvent* event) { + OnPlayerSetModels* ev = reinterpret_cast(event); + (void)ev->modelGroup; - if (player == nullptr || gPlayState == nullptr || player != GET_PLAYER(gPlayState) || IsDummyPlayer(player)) { + if (ev->player == nullptr || gPlayState == nullptr || ev->player != GET_PLAYER(gPlayState) || IsDummyPlayer(ev->player)) { return; } RefreshCustomEquipment(); } -static void UpdateCustomEquipment() { +static void UpdateCustomEquipment(IEvent* event) { if (!GameInteractor::IsSaveLoaded() || gPlayState == nullptr || GET_PLAYER(gPlayState) == nullptr || IsDummyPlayer(GET_PLAYER(gPlayState))) { return; @@ -76,7 +77,7 @@ static void UpdateCustomEquipment() { RefreshCustomEquipment(); } -static void RefreshCustomEquipment() { +static void RefreshCustomEquipment(IEvent* event) { if (!GameInteractor::IsSaveLoaded() || gPlayState == nullptr || GET_PLAYER(gPlayState) == nullptr || IsDummyPlayer(GET_PLAYER(gPlayState))) { return; diff --git a/soh/soh/Enhancements/debugger/valueViewer.cpp b/soh/soh/Enhancements/debugger/valueViewer.cpp index 32cd8ddd2fd..08a989eab7c 100644 --- a/soh/soh/Enhancements/debugger/valueViewer.cpp +++ b/soh/soh/Enhancements/debugger/valueViewer.cpp @@ -11,6 +11,7 @@ extern "C" { #include "functions.h" #include "macros.h" #include "soh/cvar_prefixes.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" extern PlayState* gPlayState; @@ -168,7 +169,7 @@ extern "C" void ValueViewer_SetupDraw() { } void RegisterValueViewerHooks() { - COND_HOOK(OnGameFrameUpdate, CVAR_VALUE, []() { ValueViewer_SetupDraw(); }); + COND_HOOK(OnGameFrameUpdate, CVAR_VALUE, [](IEvent* event) { ValueViewer_SetupDraw(); }); } static RegisterShipInitFunc initFunc(RegisterValueViewerHooks, { CVAR_NAME }); diff --git a/soh/soh/Enhancements/game-interactor/EventSystem_List.h b/soh/soh/Enhancements/game-interactor/EventSystem_List.h new file mode 100644 index 00000000000..a2b9af71272 --- /dev/null +++ b/soh/soh/Enhancements/game-interactor/EventSystem_List.h @@ -0,0 +1,180 @@ +#pragma once + +#include +#include "z64.h" +#include "vanilla-behavior/GIVanillaBehavior.h" + +/** + * Hook Table + * + * DEFINE_HOOK arguments: + * - Argument 1: Name of the hook + * - Argument 2: Function type that the hook uses + */ + +DEFINE_EVENT(OnZTitleInit, void* gameState;); + +DEFINE_EVENT(OnZTitleUpdate, void* gameState;); + +DEFINE_EVENT(OnLoadGame, int32_t fileNum;); + +DEFINE_EVENT(OnExitGame, int32_t fileNum;); + +DEFINE_EVENT(OnGameStateMainStart); + +DEFINE_EVENT(OnGameFrameUpdate); + +DEFINE_EVENT(OnCameraState, PlayState* play;); + +DEFINE_EVENT(OnItemReceive, GetItemEntry itemEntry;); + +DEFINE_EVENT(OnEquipmentDelete, int16_t equipmentType; uint16_t equipValue;); + +DEFINE_EVENT(OnSaleEnd, GetItemEntry itemEntry;); + +DEFINE_EVENT(OnTransitionEnd, int16_t sceneNum;); + +DEFINE_EVENT(OnSceneInit, int16_t sceneNum;); + +DEFINE_EVENT(AfterSceneCommands, int16_t sceneNum;); + +DEFINE_EVENT(OnSceneFlagSet, int16_t sceneNum; int16_t flagType; int16_t flag;); + +DEFINE_EVENT(OnSceneFlagUnset, int16_t sceneNum; int16_t flagType; int16_t flag;); + +DEFINE_EVENT(OnFlagSet, int16_t flagType; int16_t flag;); + +DEFINE_EVENT(OnFlagUnset, int16_t flagType; int16_t flag;); + +DEFINE_EVENT(OnSceneSpawnActors); + +DEFINE_EVENT(OnLinkSkeletonInit); + +DEFINE_EVENT(OnLinkEquipmentChange); + +DEFINE_EVENT(OnPlayerUpdate); + +DEFINE_EVENT(OnSetDoAction, uint16_t action;); + +DEFINE_EVENT(OnPlayerSfx, u16 sfxId;); + +DEFINE_EVENT(OnOcarinaSongAction); + +DEFINE_EVENT(OnOcarinaNote, uint8_t note; float modulator; int8_t bend;); + +DEFINE_EVENT(OnCuccoOrChickenHatch); + +DEFINE_EVENT(OnShopSlotChange, uint8_t cursorIndex; int16_t price;); + +DEFINE_EVENT(OnDungeonKeyUsed, uint16_t mapIndex;); + +DEFINE_EVENT(ShouldActorInit, void* actor; bool* result;); + +DEFINE_EVENT(OnActorInit, void* actor;); + +DEFINE_EVENT(OnActorSpawn, void* actor;); + +DEFINE_EVENT(ShouldActorUpdate, void* actor; bool* result;); + +DEFINE_EVENT(OnActorUpdate, void* actor;); + +DEFINE_EVENT(OnActorKill, void* actor;); + +DEFINE_EVENT(OnActorDestroy, void* actor;); + +DEFINE_EVENT(OnEnemyDefeat, void* actor;); + +DEFINE_EVENT(OnBossDefeat, void* actor;); + +DEFINE_EVENT(OnTimestamp, u8 item;); + +DEFINE_EVENT(OnPlayerBonk); + +DEFINE_EVENT(OnPlayerSetModels, Player* player; u8 modelGroup;); + +DEFINE_EVENT(OnPlayerHealthChange, int16_t amount;); + +DEFINE_EVENT(OnPlayerBottleUpdate, int16_t contents;); + +DEFINE_EVENT(OnPlayerHoldUpShield); + +DEFINE_EVENT(OnPlayerFirstPersonControl, Player* player;); + +DEFINE_EVENT(OnPlayerProcessStick); + +DEFINE_EVENT(OnPlayerShieldControl, float* sp50; float* sp54;); + +DEFINE_EVENT(OnPlayDestroy); + +DEFINE_EVENT(OnPlayDrawBegin); + +DEFINE_EVENT(OnPlayDrawEnd); + +DEFINE_EVENT(OnVanillaBehavior, GIVanillaBehavior flag; bool* result; va_list originalArgs;); + +DEFINE_EVENT(OnSaveFile, int32_t fileNum; int32_t sectionID;); + +DEFINE_EVENT(OnLoadFile, int32_t fileNum;); + +DEFINE_EVENT(OnDeleteFile, int32_t fileNum;); + +DEFINE_EVENT(OnDialogMessage); + +DEFINE_EVENT(OnPresentTitleCard); + +DEFINE_EVENT(OnInterfaceUpdate); + +DEFINE_EVENT(OnKaleidoscopeUpdate, int16_t inDungeonScene;); + +DEFINE_EVENT(OnMinimapDrawCompassIcons); + +DEFINE_EVENT(OnPresentFileSelect); + +DEFINE_EVENT(OnUpdateFileSelectSelection, uint16_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileSelectConfirmationSelection, uint16_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileCopySelection, uint16_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileCopyConfirmationSelection, uint16_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileEraseSelection, uint16_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileEraseConfirmationSelection, uint16_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileAudioSelection, uint8_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileTargetSelection, uint8_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileLanguageSelection, uint8_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileQuestSelection, uint8_t questIndex;); + +DEFINE_EVENT(OnUpdateFileBossRushOptionSelection, uint8_t optionIndex; uint8_t optionValue;); + +DEFINE_EVENT(OnUpdateFileRandomizerOptionSelection, uint8_t optionIndex;); + +DEFINE_EVENT(OnUpdateFileNameSelection, int16_t charCode;); + +DEFINE_EVENT(OnFileChooseMain, void* gameState;); + +DEFINE_EVENT(OnGenerationCompletion); + +DEFINE_EVENT(OnSetGameLanguage); + +DEFINE_EVENT(OnAssetAltChange); + +DEFINE_EVENT(OnKaleidoUpdate); + +// Messages +DEFINE_EVENT(OnOpenText, uint16_t* textId; bool* loadFromMessageTable;); + +// Audio +DEFINE_EVENT(OnSeqPlayerInit, int32_t playerIdx; int32_t seqId;); + +// Rando +DEFINE_EVENT(OnRandoSetCheckStatus, RandomizerCheck rc; RandomizerCheckStatus status;); + +DEFINE_EVENT(OnRandoSetIsSkipped, RandomizerCheck rc; bool isSkipped;); + +DEFINE_EVENT(OnRandoEntranceDiscovered, u16 entranceIndex; u8 isReversedEntrance;); \ No newline at end of file diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp index 315500424fe..580498965ac 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp @@ -12,6 +12,9 @@ GameInteractor functions can be called directly. #include "GameInteractor.h" #include +#define INIT_EVENT_IDS +#include "EventSystem_List.h" + extern "C" { #include "variables.h" #include "macros.h" @@ -103,3 +106,115 @@ bool GameInteractor::CanAddOrTakeAmmo(int16_t amount, int16_t item) { return true; } } + +void EventSystem_Register() { + // MARK: - Gameplay + REGISTER_EVENT(OnZTitleInit); + REGISTER_EVENT(OnZTitleUpdate); + REGISTER_EVENT(OnLoadGame); + REGISTER_EVENT(OnExitGame); + REGISTER_EVENT(OnGameStateMainStart); + REGISTER_EVENT(OnGameFrameUpdate); + REGISTER_EVENT(OnCameraState); + REGISTER_EVENT(OnItemReceive); + REGISTER_EVENT(OnEquipmentDelete); + REGISTER_EVENT(OnSaleEnd); + REGISTER_EVENT(OnTransitionEnd); + REGISTER_EVENT(OnSceneInit); + REGISTER_EVENT(AfterSceneCommands); + REGISTER_EVENT(OnSceneFlagSet); + REGISTER_EVENT(OnSceneFlagUnset); + REGISTER_EVENT(OnFlagSet); + REGISTER_EVENT(OnFlagUnset); + REGISTER_EVENT(OnSceneSpawnActors); + REGISTER_EVENT(OnLinkSkeletonInit); + REGISTER_EVENT(OnLinkEquipmentChange); + REGISTER_EVENT(OnPlayerUpdate); + REGISTER_EVENT(OnSetDoAction); + REGISTER_EVENT(OnPlayerSfx); + REGISTER_EVENT(OnOcarinaSongAction); + REGISTER_EVENT(OnOcarinaNote); + REGISTER_EVENT(OnCuccoOrChickenHatch); + REGISTER_EVENT(OnShopSlotChange); + REGISTER_EVENT(OnDungeonKeyUsed); + + // MARK: - Actors & Entities + REGISTER_EVENT(ShouldActorInit); + REGISTER_EVENT(OnActorInit); + REGISTER_EVENT(OnActorSpawn); + REGISTER_EVENT(ShouldActorUpdate); + REGISTER_EVENT(OnActorUpdate); + REGISTER_EVENT(OnActorKill); + REGISTER_EVENT(OnActorDestroy); + REGISTER_EVENT(OnEnemyDefeat); + REGISTER_EVENT(OnBossDefeat); + + // MARK: - Player specifics + REGISTER_EVENT(OnTimestamp); + REGISTER_EVENT(OnPlayerBonk); + REGISTER_EVENT(OnPlayerSetModels); + REGISTER_EVENT(OnPlayerHealthChange); + REGISTER_EVENT(OnPlayerBottleUpdate); + REGISTER_EVENT(OnPlayerHoldUpShield); + REGISTER_EVENT(OnPlayerFirstPersonControl); + REGISTER_EVENT(OnPlayerProcessStick); + REGISTER_EVENT(OnPlayerShieldControl); + + // MARK: - Play State + REGISTER_EVENT(OnPlayDestroy); + REGISTER_EVENT(OnPlayDrawBegin); + REGISTER_EVENT(OnPlayDrawEnd); + + // MARK: - Vanilla Behavior + REGISTER_EVENT(OnVanillaBehavior); + + // MARK: - Save Files + REGISTER_EVENT(OnSaveFile); + REGISTER_EVENT(OnLoadFile); + REGISTER_EVENT(OnDeleteFile); + + // MARK: - Dialog & UI + REGISTER_EVENT(OnDialogMessage); + REGISTER_EVENT(OnPresentTitleCard); + REGISTER_EVENT(OnInterfaceUpdate); + REGISTER_EVENT(OnKaleidoscopeUpdate); + REGISTER_EVENT(OnMinimapDrawCompassIcons); + + // MARK: - Main Menu + REGISTER_EVENT(OnPresentFileSelect); + REGISTER_EVENT(OnUpdateFileSelectSelection); + REGISTER_EVENT(OnUpdateFileSelectConfirmationSelection); + REGISTER_EVENT(OnUpdateFileCopySelection); + REGISTER_EVENT(OnUpdateFileCopyConfirmationSelection); + REGISTER_EVENT(OnUpdateFileEraseSelection); + REGISTER_EVENT(OnUpdateFileEraseConfirmationSelection); + REGISTER_EVENT(OnUpdateFileAudioSelection); + REGISTER_EVENT(OnUpdateFileTargetSelection); + REGISTER_EVENT(OnUpdateFileLanguageSelection); + REGISTER_EVENT(OnUpdateFileQuestSelection); + REGISTER_EVENT(OnUpdateFileBossRushOptionSelection); + REGISTER_EVENT(OnUpdateFileRandomizerOptionSelection); + REGISTER_EVENT(OnUpdateFileNameSelection); + REGISTER_EVENT(OnFileChooseMain); + REGISTER_EVENT(OnGenerationCompletion); + + // MARK: - Game + REGISTER_EVENT(OnSetGameLanguage); + + // MARK: - System + REGISTER_EVENT(OnAssetAltChange); + + // MARK: - Pause Menu + REGISTER_EVENT(OnKaleidoUpdate); + + // MARK: - Messages + REGISTER_EVENT(OnOpenText); + + // MARK: - Audio + REGISTER_EVENT(OnSeqPlayerInit); + + // MARK: - Randomizer + REGISTER_EVENT(OnRandoSetCheckStatus); + REGISTER_EVENT(OnRandoSetIsSkipped); + REGISTER_EVENT(OnRandoEntranceDiscovered); +} \ No newline at end of file diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 20267760bb1..6df4d4630ff 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -4,7 +4,9 @@ #define GameInteractor_h #include "libultraship/libultraship.h" +#include #include "vanilla-behavior/GIVanillaBehavior.h" +#include "EventSystem_List.h" #include typedef enum { @@ -151,42 +153,42 @@ struct HookInfo { #define GET_CURRENT_REGISTERING_INFO(type) (HookRegisteringInfo{}) #endif -#define REGISTER_VB_SHOULD(flag, body) \ - GameInteractor::Instance->RegisterGameHookForID( \ - flag, [](GIVanillaBehavior _, bool* should, va_list _originalArgs) { \ - va_list args; \ - va_copy(args, _originalArgs); \ - body; \ - va_end(args); \ - }) - -#define COND_HOOK(hookType, condition, body) \ - { \ - static HOOK_ID hookId = 0; \ - GameInteractor::Instance->UnregisterGameHook(hookId); \ - hookId = 0; \ - if (condition) { \ - hookId = GameInteractor::Instance->RegisterGameHook(body); \ - } \ +#define REGISTER_VB_SHOULD(flagToCheck, body) \ + REGISTER_LISTENER(OnVanillaBehavior, EVENT_PRIORITY_LOW, [](IEvent* event) { \ + auto* vbEvent = reinterpret_cast(event); \ + if (vbEvent->flag == flagToCheck) { \ + GIVanillaBehavior _ = vbEvent->flag; \ + bool* should = vbEvent->result; \ + va_list args; \ + va_copy(args, vbEvent->originalArgs); \ + body; \ + va_end(args); \ + } \ + }) + +#define COND_HOOK(eventId, condition, body) \ + { \ + static ListenerID listenerId = 0; \ + if (listenerId != 0) { \ + UNREGISTER_LISTENER(eventId, listenerId); \ + listenerId = 0; \ + } \ + if (condition) { \ + listenerId = REGISTER_LISTENER(eventId, EVENT_PRIORITY_LOW, body); \ + } \ } -#define COND_ID_HOOK(hookType, id, condition, body) \ - { \ - static HOOK_ID hookId = 0; \ - GameInteractor::Instance->UnregisterGameHookForID(hookId); \ - hookId = 0; \ - if (condition) { \ - hookId = GameInteractor::Instance->RegisterGameHookForID(id, body); \ - } \ - } -#define COND_VB_SHOULD(id, condition, body) \ - { \ - static HOOK_ID hookId = 0; \ - GameInteractor::Instance->UnregisterGameHookForID(hookId); \ - hookId = 0; \ - if (condition) { \ - hookId = REGISTER_VB_SHOULD(id, body); \ - } \ +#define COND_ID_HOOK(eventId, id, condition, body) \ + { \ + static ListenerID listenerId = 0; \ + if (listenerId != 0) { \ + UNREGISTER_LISTENER(eventId, listenerId); \ + listenerId = 0; \ + } \ + if (condition) { \ + listenerId = REGISTER_VB_SHOULD(id, body); \ + } \ } +#define COND_VB_SHOULD(flag, condition, body) COND_ID_HOOK(OnVanillaBehavior, flag, condition, body) class GameInteractor { public: @@ -582,6 +584,8 @@ class GameInteractor { }; }; +void EventSystem_Register(); + #undef GET_CURRENT_REGISTERING_INFO #endif /* __cplusplus */ diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp index b754e9c949c..4e20979f4e0 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp @@ -1,249 +1,5 @@ #include "GameInteractor_Hooks.h" - -// MARK: - Gameplay - -void GameInteractor_ExecuteOnZTitleInit(void* gameState) { - GameInteractor::Instance->ExecuteHooks(gameState); -} - -void GameInteractor_ExecuteOnZTitleUpdate(void* gameState) { - GameInteractor::Instance->ExecuteHooks(gameState); -} - -void GameInteractor_ExecuteOnLoadGame(int32_t fileNum) { - GameInteractor::Instance->ExecuteHooks(fileNum); -} - -void GameInteractor_ExecuteOnExitGame(int32_t fileNum) { - GameInteractor::Instance->ExecuteHooks(fileNum); -} - -void GameInteractor_ExecuteOnGameStateMainStart() { - // Cleanup all hooks at the start of each frame - GameInteractor::Instance->RemoveAllQueuedHooks(); - - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnGameFrameUpdate() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnCameraState(PlayState* play) { - GameInteractor::Instance->ExecuteHooks(play); -} - -void GameInteractor_ExecuteOnItemReceiveHooks(GetItemEntry itemEntry) { - GameInteractor::Instance->ExecuteHooks(itemEntry); - GameInteractor::Instance->ExecuteHooksForFilter(itemEntry); -} - -void GameInteractor_ExecuteOnEquipmentDelete(int16_t equipmentType, uint16_t equipValue) { - GameInteractor::Instance->ExecuteHooks(equipmentType, equipValue); - GameInteractor::Instance->ExecuteHooksForFilter(equipmentType, equipValue); -} - -void GameInteractor_ExecuteOnSaleEndHooks(GetItemEntry itemEntry) { - GameInteractor::Instance->ExecuteHooks(itemEntry); - GameInteractor::Instance->ExecuteHooksForFilter(itemEntry); -} - -void GameInteractor_ExecuteOnTransitionEndHooks(int16_t sceneNum) { - GameInteractor::Instance->ExecuteHooks(sceneNum); - GameInteractor::Instance->ExecuteHooksForID(sceneNum, sceneNum); - GameInteractor::Instance->ExecuteHooksForFilter(sceneNum); -} - -void GameInteractor_ExecuteOnSceneInit(int16_t sceneNum) { - GameInteractor::Instance->ExecuteHooks(sceneNum); - GameInteractor::Instance->ExecuteHooksForID(sceneNum, sceneNum); - GameInteractor::Instance->ExecuteHooksForFilter(sceneNum); -} - -void GameInteractor_ExecuteAfterSceneCommands(int16_t sceneNum) { - GameInteractor::Instance->ExecuteHooks(sceneNum); - GameInteractor::Instance->ExecuteHooksForID(sceneNum, sceneNum); - GameInteractor::Instance->ExecuteHooksForFilter(sceneNum); -} - -void GameInteractor_ExecuteOnSceneFlagSet(int16_t sceneNum, int16_t flagType, int16_t flag) { - GameInteractor::Instance->ExecuteHooks(sceneNum, flagType, flag); - GameInteractor::Instance->ExecuteHooksForFilter(sceneNum, flagType, flag); -} - -void GameInteractor_ExecuteOnSceneFlagUnset(int16_t sceneNum, int16_t flagType, int16_t flag) { - GameInteractor::Instance->ExecuteHooks(sceneNum, flagType, flag); - GameInteractor::Instance->ExecuteHooksForFilter(sceneNum, flagType, flag); -} - -void GameInteractor_ExecuteOnFlagSet(int16_t flagType, int16_t flag) { - GameInteractor::Instance->ExecuteHooks(flagType, flag); - GameInteractor::Instance->ExecuteHooksForFilter(flagType, flag); -} - -void GameInteractor_ExecuteOnFlagUnset(int16_t flagType, int16_t flag) { - GameInteractor::Instance->ExecuteHooks(flagType, flag); - GameInteractor::Instance->ExecuteHooksForFilter(flagType, flag); -} - -void GameInteractor_ExecuteOnSceneSpawnActors() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnLinkSkeletonInit() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnLinkEquipmentChange() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnPlayerUpdate() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnSetDoAction(uint16_t action) { - GameInteractor::Instance->ExecuteHooks(action); -} - -void GameInteractor_ExecuteOnPlayerSfx(u16 sfxId) { - GameInteractor::Instance->ExecuteHooks(sfxId); -} - -void GameInteractor_ExecuteOnOcarinaSongAction() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnOcarinaNote(uint8_t note, float modulator, int8_t bend) { - GameInteractor::Instance->ExecuteHooks(note, modulator, bend); -} - -void GameInteractor_ExecuteOnCuccoOrChickenHatch() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnShopSlotChangeHooks(uint8_t cursorIndex, int16_t price) { - GameInteractor::Instance->ExecuteHooks(cursorIndex, price); -} - -void GameInteractor_ExecuteOnDungeonKeyUsedHooks(uint16_t mapIndex) { - GameInteractor::Instance->ExecuteHooks(mapIndex); -} - -bool GameInteractor_ShouldActorInit(void* actor) { - bool result = true; - GameInteractor::Instance->ExecuteHooks(actor, &result); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor, &result); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor, &result); - GameInteractor::Instance->ExecuteHooksForFilter(actor, &result); - return result; -} - -void GameInteractor_ExecuteOnActorInit(void* actor) { - GameInteractor::Instance->ExecuteHooks(actor); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor); - GameInteractor::Instance->ExecuteHooksForFilter(actor); -} - -void GameInteractor_ExecuteOnActorSpawn(void* actor) { - GameInteractor::Instance->ExecuteHooks(actor); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor); - GameInteractor::Instance->ExecuteHooksForFilter(actor); -} - -bool GameInteractor_ShouldActorUpdate(void* actor) { - bool result = true; - GameInteractor::Instance->ExecuteHooks(actor, &result); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor, &result); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor, &result); - GameInteractor::Instance->ExecuteHooksForFilter(actor, &result); - return result; -} - -void GameInteractor_ExecuteOnActorUpdate(void* actor) { - GameInteractor::Instance->ExecuteHooks(actor); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor); - GameInteractor::Instance->ExecuteHooksForFilter(actor); -} - -void GameInteractor_ExecuteOnActorKill(void* actor) { - GameInteractor::Instance->ExecuteHooks(actor); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor); - GameInteractor::Instance->ExecuteHooksForFilter(actor); -} - -void GameInteractor_ExecuteOnActorDestroy(void* actor) { - GameInteractor::Instance->ExecuteHooks(actor); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor); - GameInteractor::Instance->ExecuteHooksForFilter(actor); -} - -void GameInteractor_ExecuteOnEnemyDefeat(void* actor) { - GameInteractor::Instance->ExecuteHooks(actor); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor); - GameInteractor::Instance->ExecuteHooksForFilter(actor); -} - -void GameInteractor_ExecuteOnBossDefeat(void* actor) { - GameInteractor::Instance->ExecuteHooks(actor); - GameInteractor::Instance->ExecuteHooksForID(((Actor*)actor)->id, actor); - GameInteractor::Instance->ExecuteHooksForPtr((uintptr_t)actor, actor); - GameInteractor::Instance->ExecuteHooksForFilter(actor); -} - -void GameInteractor_ExecuteOnTimestamp(u8 item) { - GameInteractor::Instance->ExecuteHooks(item); -} - -void GameInteractor_ExecuteOnPlayerBonk() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnPlayerSetModels(Player* player, u8 modelGroup) { - GameInteractor::Instance->ExecuteHooks(player, modelGroup); -} - -void GameInteractor_ExecuteOnPlayerHealthChange(int16_t amount) { - GameInteractor::Instance->ExecuteHooks(amount); -} - -void GameInteractor_ExecuteOnPlayerBottleUpdate(int16_t contents) { - GameInteractor::Instance->ExecuteHooks(contents); -} - -void GameInteractor_ExecuteOnPlayerHoldUpShield() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnPlayerFirstPersonControl(Player* player) { - GameInteractor::Instance->ExecuteHooks(player); -} - -void GameInteractor_ExecuteOnPlayerShieldControl(float* sp50, float* sp54) { - GameInteractor::Instance->ExecuteHooks(sp50, sp54); -} - -void GameInteractor_ExecuteOnPlayerProcessStick() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnPlayDestroy() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnPlayDrawBegin() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnPlayDrawEnd() { - GameInteractor::Instance->ExecuteHooks(); -} +#include "EventSystem_List.h" bool GameInteractor_Should(GIVanillaBehavior flag, u32 result, ...) { // Only the external function can use the Variadic Function syntax @@ -258,145 +14,8 @@ bool GameInteractor_Should(GIVanillaBehavior flag, u32 result, ...) { // Here we downcast back to a bool for our actual hook handlers bool boolResult = static_cast(result); - GameInteractor::Instance->ExecuteHooks(flag, &boolResult, args); - GameInteractor::Instance->ExecuteHooksForID(flag, flag, &boolResult, args); - GameInteractor::Instance->ExecuteHooksForFilter(flag, &boolResult, args); + CALL_EVENT(OnVanillaBehavior, flag, &boolResult, args); va_end(args); return boolResult; -} - -// MARK: - Save Files - -void GameInteractor_ExecuteOnSaveFile(int32_t fileNum, int32_t sectionID) { - GameInteractor::Instance->ExecuteHooks(fileNum, sectionID); -} - -void GameInteractor_ExecuteOnLoadFile(int32_t fileNum) { - GameInteractor::Instance->ExecuteHooks(fileNum); -} - -void GameInteractor_ExecuteOnDeleteFile(int32_t fileNum) { - GameInteractor::Instance->ExecuteHooks(fileNum); -} - -// MARK: - Dialog - -void GameInteractor_ExecuteOnDialogMessage() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnPresentTitleCard() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnInterfaceUpdate() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnKaleidoscopeUpdate(int16_t inDungeonScene) { - GameInteractor::Instance->ExecuteHooks(inDungeonScene); -} - -void GameInteractor_ExecuteOnMinimapDrawCompassIcons() { - GameInteractor::Instance->ExecuteHooks(); -} - -// MARK: - Main Menu - -void GameInteractor_ExecuteOnPresentFileSelect() { - GameInteractor::Instance->ExecuteHooks(); -} - -void GameInteractor_ExecuteOnUpdateFileSelectSelection(uint16_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileSelectConfirmationSelection(uint16_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileCopySelection(uint16_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileCopyConfirmationSelection(uint16_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileEraseSelection(uint16_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileEraseConfirmationSelection(uint16_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileAudioSelection(uint8_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileTargetSelection(uint8_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileLanguageSelection(uint8_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileQuestSelection(uint8_t questIndex) { - GameInteractor::Instance->ExecuteHooks(questIndex); -} - -void GameInteractor_ExecuteOnUpdateFileBossRushOptionSelection(uint8_t optionIndex, uint8_t optionValue) { - GameInteractor::Instance->ExecuteHooks(optionIndex, - optionValue); -} - -void GameInteractor_ExecuteOnUpdateFileRandomizerOptionSelection(uint8_t optionIndex) { - GameInteractor::Instance->ExecuteHooks(optionIndex); -} - -void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode) { - GameInteractor::Instance->ExecuteHooks(charCode); -} - -void GameInteractor_ExecuteOnFileChooseMain(void* gameState) { - GameInteractor::Instance->ExecuteHooks(gameState); -} - -// MARK: - Game - -void GameInteractor_ExecuteOnSetGameLanguage() { - GameInteractor::Instance->ExecuteHooks(); -} - -// MARK: - System - -void GameInteractor_RegisterOnAssetAltChange(void (*fn)(void)) { - GameInteractor::Instance->RegisterGameHook(fn); -} - -// MARK: Pause Menu - -void GameInteractor_ExecuteOnKaleidoUpdate() { - GameInteractor::Instance->ExecuteHooks(); -} - -// MARK: Messages -void GameInteractor_ExecuteOnOpenText(uint16_t* textId, bool* loadFromMessageTable) { - GameInteractor::Instance->ExecuteHooks(textId, loadFromMessageTable); - GameInteractor::Instance->ExecuteHooksForID(*textId, textId, loadFromMessageTable); - GameInteractor::Instance->ExecuteHooksForFilter(textId, loadFromMessageTable); -} - -// Mark: Audio -void GameInteractor_ExecuteOnSeqPlayerInit(int32_t playerIdx, int32_t seqId) { - GameInteractor::Instance->ExecuteHooks(playerIdx, seqId); -} - -// MARK: - Rando -void GameInteractor_ExecuteOnRandoEntranceDiscovered(u16 entranceIndex, u8 isReversedEntrance) { - GameInteractor::Instance->ExecuteHooks(entranceIndex, - isReversedEntrance); -} +} \ No newline at end of file diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h index c93568712bf..5f4cd2d0345 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h @@ -1,111 +1,18 @@ #pragma once +#include #include "vanilla-behavior/GIVanillaBehavior.h" #include "GameInteractor.h" #include +#include #ifdef __cplusplus extern "C" { #endif + // MARK: - Gameplay -void GameInteractor_ExecuteOnZTitleInit(void* gameState); -void GameInteractor_ExecuteOnZTitleUpdate(void* gameState); -void GameInteractor_ExecuteOnLoadGame(int32_t fileNum); -void GameInteractor_ExecuteOnExitGame(int32_t fileNum); -void GameInteractor_ExecuteOnGameStateMainStart(); -void GameInteractor_ExecuteOnGameFrameUpdate(); -void GameInteractor_ExecuteOnCameraState(PlayState* play); -void GameInteractor_ExecuteOnItemReceiveHooks(GetItemEntry itemEntry); -void GameInteractor_ExecuteOnEquipmentDelete(int16_t equipmentType, uint16_t equipValue); -void GameInteractor_ExecuteOnSaleEndHooks(GetItemEntry itemEntry); -void GameInteractor_ExecuteOnTransitionEndHooks(int16_t sceneNum); -void GameInteractor_ExecuteOnSceneInit(int16_t sceneNum); -void GameInteractor_ExecuteAfterSceneCommands(int16_t sceneNum); -void GameInteractor_ExecuteOnSceneFlagSet(int16_t sceneNum, int16_t flagType, int16_t flag); -void GameInteractor_ExecuteOnSceneFlagUnset(int16_t sceneNum, int16_t flagType, int16_t flag); -void GameInteractor_ExecuteOnFlagSet(int16_t flagType, int16_t flag); -void GameInteractor_ExecuteOnFlagUnset(int16_t flagType, int16_t flag); -void GameInteractor_ExecuteOnSceneSpawnActors(); -void GameInteractor_ExecuteOnLinkSkeletonInit(); -void GameInteractor_ExecuteOnLinkEquipmentChange(); -void GameInteractor_ExecuteOnPlayerUpdate(); -void GameInteractor_ExecuteOnSetDoAction(uint16_t action); -void GameInteractor_ExecuteOnPlayerSfx(u16 sfxId); -void GameInteractor_ExecuteOnOcarinaSongAction(); -void GameInteractor_ExecuteOnOcarinaNote(uint8_t note, float modulator, int8_t bend); -void GameInteractor_ExecuteOnCuccoOrChickenHatch(); -bool GameInteractor_ShouldActorInit(void* actor); -void GameInteractor_ExecuteOnActorInit(void* actor); -void GameInteractor_ExecuteOnActorSpawn(void* actor); -bool GameInteractor_ShouldActorUpdate(void* actor); -void GameInteractor_ExecuteOnActorUpdate(void* actor); -void GameInteractor_ExecuteOnActorKill(void* actor); -void GameInteractor_ExecuteOnActorDestroy(void* actor); -void GameInteractor_ExecuteOnEnemyDefeat(void* actor); -void GameInteractor_ExecuteOnBossDefeat(void* actor); -void GameInteractor_ExecuteOnTimestamp(u8 item); -void GameInteractor_ExecuteOnPlayerBonk(); -void GameInteractor_ExecuteOnPlayerSetModels(Player* player, u8 modelGroup); -void GameInteractor_ExecuteOnPlayerHealthChange(int16_t amount); -void GameInteractor_ExecuteOnPlayerBottleUpdate(int16_t contents); -void GameInteractor_ExecuteOnPlayerHoldUpShield(); -void GameInteractor_ExecuteOnPlayerFirstPersonControl(Player* player); -void GameInteractor_ExecuteOnPlayerShieldControl(float* sp50, float* sp54); -void GameInteractor_ExecuteOnPlayerProcessStick(); -void GameInteractor_ExecuteOnShopSlotChangeHooks(uint8_t cursorIndex, int16_t price); -void GameInteractor_ExecuteOnDungeonKeyUsedHooks(uint16_t mapIndex); -void GameInteractor_ExecuteOnPlayDestroy(); -void GameInteractor_ExecuteOnPlayDrawBegin(); -void GameInteractor_ExecuteOnPlayDrawEnd(); bool GameInteractor_Should(GIVanillaBehavior flag, uint32_t result, ...); -// MARK: - Save Files -void GameInteractor_ExecuteOnSaveFile(int32_t fileNum, int32_t sectionID); -void GameInteractor_ExecuteOnLoadFile(int32_t fileNum); -void GameInteractor_ExecuteOnDeleteFile(int32_t fileNum); - -// MARK: - Dialog -void GameInteractor_ExecuteOnDialogMessage(); -void GameInteractor_ExecuteOnPresentTitleCard(); -void GameInteractor_ExecuteOnInterfaceUpdate(); -void GameInteractor_ExecuteOnKaleidoscopeUpdate(int16_t inDungeonScene); -void GameInteractor_ExecuteOnMinimapDrawCompassIcons(); - -// MARK: - Main Menu -void GameInteractor_ExecuteOnPresentFileSelect(); -void GameInteractor_ExecuteOnUpdateFileSelectSelection(uint16_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileSelectConfirmationSelection(uint16_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileCopySelection(uint16_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileCopyConfirmationSelection(uint16_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileEraseSelection(uint16_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileEraseConfirmationSelection(uint16_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileAudioSelection(uint8_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileTargetSelection(uint8_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileLanguageSelection(uint8_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileQuestSelection(uint8_t questIndex); -void GameInteractor_ExecuteOnUpdateFileBossRushOptionSelection(uint8_t optionIndex, uint8_t optionValue); -void GameInteractor_ExecuteOnUpdateFileRandomizerOptionSelection(uint8_t optionIndex); -void GameInteractor_ExecuteOnUpdateFileNameSelection(int16_t charCode); -void GameInteractor_ExecuteOnFileChooseMain(void* gameState); - -// MARK: - Game -void GameInteractor_ExecuteOnSetGameLanguage(); - -// MARK: - System -void GameInteractor_RegisterOnAssetAltChange(void (*fn)(void)); - -// Mark: - Pause Menu -void GameInteractor_ExecuteOnKaleidoUpdate(); - -// MARK: - Messages -void GameInteractor_ExecuteOnOpenText(uint16_t* textId, bool* loadFromMessageTable); - -// Mark: - Audio -void GameInteractor_ExecuteOnSeqPlayerInit(int32_t playerIdx, int32_t seqId); - -// MARK: - Rando -void GameInteractor_ExecuteOnRandoEntranceDiscovered(u16 entranceIndex, u8 isReversedEntrance); - #ifdef __cplusplus } #endif diff --git a/soh/soh/Enhancements/randomizer/Messages/EntranceHints.cpp b/soh/soh/Enhancements/randomizer/Messages/EntranceHints.cpp index f219e410951..9a868cc54dd 100644 --- a/soh/soh/Enhancements/randomizer/Messages/EntranceHints.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/EntranceHints.cpp @@ -1,6 +1,7 @@ #include "soh/Enhancements/randomizer/entrance.h" #include "soh/Enhancements/randomizer/randomizer_entrance_tracker.h" #include +#include "soh/Enhancements/game-interactor/GameInteractor.h" extern "C" { #include @@ -15,10 +16,11 @@ extern PlayState* gPlayState; (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("EntrancesOnSigns"), 0) == 1) // clang-format on -void BuildEntranceHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildEntranceHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); auto ctx = OTRGlobals::Instance->gRandoContext; s16 entrance = -1; - switch (*textId) { + switch (*ev->textId) { case TEXT_WATERFALL: entrance = ENTR_ZORAS_DOMAIN_ENTRANCE; break; @@ -148,7 +150,7 @@ void BuildEntranceHintMessage(uint16_t* textId, bool* loadFromMessageTable) { auto entranceCtx = ctx->GetEntranceShuffler(); for (size_t i = 0; i < ENTRANCE_OVERRIDES_MAX_COUNT; i++) { if (Entrance_EntranceIsNull(&entranceCtx->entranceOverrides[i])) { - *loadFromMessageTable = true; + *ev->loadFromMessageTable = true; return; } if (entranceCtx->entranceOverrides[i].index == entrance) { @@ -159,7 +161,7 @@ void BuildEntranceHintMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.Replace("[[name]]", data->destination); msg.SetTextBoxType(TEXTBOX_TYPE_WOODEN); msg.SetTextBoxPosition(TEXTBOX_POS_BOTTOM); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; msg.AutoFormat(); msg.LoadIntoFont(); return; diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index dae35c0d0be..9245d6d6aff 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -153,7 +153,10 @@ void BuildScrubMessage(uint16_t* textId, bool* loadFromMessageTable) { *loadFromMessageTable = false; } -void BuildShopMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildShopMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); + uint16_t* textId = ev->textId; + bool* loadFromMessageTable = ev->loadFromMessageTable; CustomMessage msg; RandomizerCheck rc; // Shop items each have two message entries, second one offset by NUM_SHOP_ITEMS diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index e90b4d3c141..a2f5a027f90 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -21,7 +21,7 @@ static f32 effectsScale = 1.0f; void RegisterRocsFeather() { bool shouldRegister = IS_RANDO && RAND_GET_OPTION(RSK_ROCS_FEATHER); - COND_HOOK(OnPlayerUpdate, shouldRegister, []() { + COND_HOOK(OnPlayerUpdate, shouldRegister, [](IEvent* event) { Player* player = GET_PLAYER(gPlayState); // Reset Rocs count when touching the ground for 3+ frames diff --git a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp index 6d883228a23..21a626b06ef 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp @@ -2,6 +2,8 @@ #include "soh/ObjectExtension/ObjectExtension.h" #include "item_category_adj.h" #include "particle_cmc.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" + extern "C" { extern PlayState* gPlayState; #include "overlays/actors/ovl_En_Kanban/z_en_kanban.h" @@ -91,7 +93,7 @@ void Sign_RandomizerSpawnCollectible(Actor* actor) { Flags_SetRandomizerInf(signIdentity->randomizerInf); } -void Sign_RoyalTombSpawnCollectible(int16_t flagType, int16_t flag) { +void Sign_RoyalTombSpawnCollectible(IEvent* event) { if (!Flags_GetRandomizerInf(RAND_INF_GY_ROYAL_TOMB_GRAVE) && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { Flags_SetRandomizerInf(RAND_INF_GY_ROYAL_TOMB_GRAVE); diff --git a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp index b0fddc5026e..e2229ca792d 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp @@ -5,6 +5,7 @@ #include "soh/ObjectExtension/ActorListIndex.h" #include "item_category_adj.h" #include "particle_cmc.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" extern "C" { #include "overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.h" @@ -86,7 +87,7 @@ static Vec3f GetStackOffset(RandomizerCheck rc) { return it != sStackedWonderOffsets.end() ? it->second : Vec3f{ 0.0f, 0.0f, 0.0f }; } -void SpawnNTSC10WonderItem() { +void SpawnNTSC10WonderItem(IEvent* event) { if (LINK_IS_ADULT && gPlayState->sceneNum == SCENE_ZORAS_FOUNTAIN) { Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_WONDER_ITEM, -667, 320, 1053, 0, 0, 1, 4799); } else if (LINK_IS_ADULT && gPlayState->sceneNum == SCENE_DEATH_MOUNTAIN_CRATER) { diff --git a/soh/soh/Enhancements/randomizer/entrance.cpp b/soh/soh/Enhancements/randomizer/entrance.cpp index 06a72025695..acdd27cafee 100644 --- a/soh/soh/Enhancements/randomizer/entrance.cpp +++ b/soh/soh/Enhancements/randomizer/entrance.cpp @@ -7,7 +7,7 @@ #include "soh/Enhancements/gameconsole.h" #include "z64camera.h" #include "z64scene.h" - +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include extern "C" { @@ -1759,7 +1759,7 @@ void RegisterEntranceShuffleHooks() { }); COND_HOOK(OnLoadGame, IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_ENTRANCES), - [](int32_t) { backedUpScene = (SceneID)0xFF; }); + [](IEvent* event) { backedUpScene = (SceneID)0xFF; }); } static RegisterShipInitFunc initFunc(RegisterEntranceShuffleHooks, { "IS_RANDO" }); diff --git a/soh/soh/Enhancements/randomizer/fishsanity.cpp b/soh/soh/Enhancements/randomizer/fishsanity.cpp index fd7dffc19af..b16cb904d38 100644 --- a/soh/soh/Enhancements/randomizer/fishsanity.cpp +++ b/soh/soh/Enhancements/randomizer/fishsanity.cpp @@ -5,6 +5,7 @@ #include "variables.h" #include "functions.h" #include "macros.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include extern "C" { @@ -546,15 +547,22 @@ void Fishsanity_CloseGreyscaleColor(PlayState* play) { void RegisterShuffleFish() { bool shouldRegister = IS_RANDO && RAND_GET_OPTION(RSK_FISHSANITY).IsNot(RO_FISHSANITY_OFF); - COND_HOOK(OnSceneInit, shouldRegister, [](int16_t sceneNum) { - if (sceneNum == SCENE_ZORAS_DOMAIN) { + COND_HOOK(OnSceneInit, shouldRegister, [](IEvent* event) { + OnSceneInit* ev = reinterpret_cast(event); + if (ev->sceneNum == SCENE_ZORAS_DOMAIN) { fishGroupCounter = 0; } }); - COND_HOOK(OnActorInit, shouldRegister, Rando::Fishsanity::OnActorInitHandler); - COND_HOOK(OnActorUpdate, shouldRegister, Rando::Fishsanity::OnActorUpdateHandler); - COND_HOOK(OnItemReceive, shouldRegister, [](GetItemEntry itemEntry) { + COND_HOOK(OnActorInit, shouldRegister, [](IEvent* event){ + OnActorInit* ev = reinterpret_cast(event); + Rando::Fishsanity::OnActorInitHandler(ev->actor); + }); + COND_HOOK(OnActorUpdate, shouldRegister, [](IEvent* event){ + OnActorUpdate* ev = reinterpret_cast(event); + Rando::Fishsanity::OnActorUpdateHandler(ev->actor); + }); + COND_HOOK(OnItemReceive, shouldRegister, [](IEvent* event) { if (enableAdvance) { enableAdvance = false; OTRGlobals::Instance->gRandoContext->GetFishsanity()->AdvancePond(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index 0154cd99fe2..b3715f3cba5 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -804,7 +804,7 @@ void Entrance_SetEntranceDiscovered(u16 entranceIndex, u8 isReversedEntrance) { return; } - GameInteractor_ExecuteOnRandoEntranceDiscovered(entranceIndex, isReversedEntrance); + CALL_EVENT(OnRandoEntranceDiscovered, entranceIndex, isReversedEntrance); u16 bitsPerIndex = sizeof(u32) * 8; u32 idx = entranceIndex / bitsPerIndex; diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 0ccc205a6df..94e3280706b 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -17,7 +17,6 @@ #include "soh/SohGui/SohGui.hpp" #include "soh/SohGui/SohMenu.h" #include "soh/SohGui/UIWidgets.hpp" -#include "soh/util.h" extern "C" { #include @@ -2403,7 +2402,7 @@ void RegisterItemTrackerWidgets() { } void RegisterItemTracker() { - COND_HOOK(OnLoadFile, true, [](int32_t fileNum) { shouldUpdateVectors = true; }); + COND_HOOK(OnLoadFile, true, [](IEvent* event) { shouldUpdateVectors = true; }); } static RegisterShipInitFunc registerItemTracker(RegisterItemTracker); diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index fd5ed315b10..ddaf878a8ed 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -3,6 +3,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/randomizer/SeedContext.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" extern "C" { #include "src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.h" @@ -125,11 +126,12 @@ bool ForcedDialogIsDisabled(ForcedDialogMode type) { type) != 0; } -void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { +void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { + OnVanillaBehavior* ev = reinterpret_cast(event); va_list args; - va_copy(args, originalArgs); + va_copy(args, ev->originalArgs); - switch (id) { + switch (ev->flag) { case VB_PLAY_TRANSITION_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO) { // Song of Time @@ -138,7 +140,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li gSaveContext.entranceIndex = ENTR_HYRULE_FIELD_16; gSaveContext.cutsceneIndex = 0; gSaveContext.nextTransitionType = 3; - *should = false; + *ev->result = false; } // Requiem of Spirit @@ -150,7 +152,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (GameInteractor_Should(VB_GIVE_ITEM_SONG, true, ITEM_SONG_REQUIEM)) { Item_Give(gPlayState, ITEM_SONG_REQUIEM); } - *should = false; + *ev->result = false; } u8 meetsBurningKakRequirements = LINK_IS_ADULT && gSaveContext.cutsceneIndex < 0xFFF0 && @@ -166,7 +168,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (GameInteractor_Should(VB_GIVE_ITEM_SONG, true, ITEM_SONG_NOCTURNE)) { Item_Give(gPlayState, ITEM_SONG_NOCTURNE); } - *should = false; + *ev->result = false; } } @@ -182,7 +184,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (GameInteractor_Should(VB_GIVE_ITEM_LIGHT_ARROW, true)) { Item_Give(gPlayState, ITEM_ARROW_LIGHT); } - *should = false; + *ev->result = false; } } @@ -190,14 +192,14 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipTowerEscape"), false) || IS_BOSS_RUSH) { Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO); gSaveContext.entranceIndex = ENTR_GANON_BOSS_0; - *should = false; + *ev->result = false; } } if (gSaveContext.entranceIndex == ENTR_CASTLE_COURTYARD_GUARDS_DAY_0) { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipChildStealth"), false)) { gSaveContext.entranceIndex = ENTR_CASTLE_COURTYARD_ZELDA_0; - *should = false; + *ev->result = false; } } break; @@ -211,7 +213,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li // set) if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), IS_RANDO) && (entranceFlag != EVENTCHKINF_EPONA_OBTAINED) && entranceIndex != ENTR_SPIRIT_TEMPLE_BOSS_ENTRANCE) { - *should = false; + *ev->result = false; // Check for dispulsion of Ganon's Tower barrier switch (entranceIndex) { @@ -243,7 +245,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li case 3150: case 4180: case 4100: - *should = false; + *ev->result = false; RateLimitedSuccessChime(); Message_CloseTextbox(gPlayState); taki = (BgSpot03Taki*)Actor_FindNearby(gPlayState, &GET_PLAYER(gPlayState)->actor, @@ -284,7 +286,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } RateLimitedSuccessChime(); - *should = false; + *ev->result = false; break; } switch (actor->id) { @@ -298,7 +300,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } ObjSwitch* switchActor = (ObjSwitch*)actor; switchActor->cooldownTimer = 0; - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } @@ -317,21 +319,21 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li BgBdanSwitch* switchActor = (BgBdanSwitch*)actor; switchActor->unk_1D8 = 0; switchActor->unk_1DA = 0; - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } case ACTOR_BG_HIDAN_KOUSI: { BgHidanKousi* switchActor = (BgHidanKousi*)actor; BgHidanKousi_SetupAction(switchActor, func_80889C18); - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } case ACTOR_EN_GO2: { EnGo2* biggoron = (EnGo2*)actor; biggoron->isAwake = true; - *should = false; + *ev->result = false; break; } case ACTOR_EN_BOX: { @@ -341,7 +343,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li break; } EnBox* boxActor = (EnBox*)actor; - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } @@ -350,10 +352,10 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li // setup that skips the grate if (actor->params == 6359 && gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE && CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.GlitchAiding"), 0)) { - *should = true; + *ev->result = true; break; } - *should = false; + *ev->result = false; break; } case ACTOR_BG_HIDAN_FWBIG: @@ -361,7 +363,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li case ACTOR_EN_DNT_NOMAL: case ACTOR_EN_DNT_DEMO: case ACTOR_BG_HAKA_ZOU: { - *should = false; + *ev->result = false; break; } case ACTOR_EN_TA: @@ -372,7 +374,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.GlitchAiding"), 0)) { break; } - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } @@ -394,11 +396,11 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li case ACTOR_BG_HAKA_GATE: case ACTOR_EN_KAKASI2: case ACTOR_EN_DNT_JIJI: - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } - if (*should) { + if (*ev->result) { SPDLOG_INFO("VB_PLAY_ONEPOINT_ACTOR_CS ID:{} Cat:{}", actor->id, actor->category); } } @@ -406,19 +408,19 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } case VB_FREEZE_LINK_FOR_FOREST_PILLARS: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), IS_RANDO)) { - *should = false; + *ev->result = false; } break; case VB_SHOW_TITLE_CARD: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.DisableTitleCard"), IS_RANDO)) { - *should = false; + *ev->result = false; } break; case VB_WONDER_TALK: { // We want to show the frog hint if it is on, regardless of cutscene settings if (ForcedDialogIsDisabled(FORCED_DIALOG_SKIP_NPC) && !(gPlayState->sceneNum == SCENE_ZORAS_RIVER && IS_RANDO && RAND_GET_OPTION(RSK_FROGS_HINT))) { - *should = false; + *ev->result = false; } // If it's near a jailed carpenter, skip it along with introduction of Gerudo mini-boss @@ -429,7 +431,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li (EnDaiku*)Actor_FindNearby(gPlayState, &enWonderTalk->actor, ACTOR_EN_DAIKU, ACTORCAT_NPC, 999.0f); if (enDaiku != NULL) { Flags_SetSwitch(gPlayState, enDaiku->startFightSwitchFlag); - *should = false; + *ev->result = false; } } break; @@ -445,13 +447,13 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li Flags_SetSwitch(gPlayState, paramsHighByte & 0x3F); } Actor_Kill(&naviTalk->actor); - *should = false; + *ev->result = false; } break; } case VB_END_GERUDO_MEMBERSHIP_TALK: { if (ForcedDialogIsDisabled(FORCED_DIALOG_SKIP_NPC)) { - *should = true; + *ev->result = true; } break; } @@ -463,7 +465,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li goronLink->isAwake = false; goronLink->actionFunc = EnGo2_CurledUp; Flags_SetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING); - *should = false; + *ev->result = false; } break; } @@ -471,19 +473,19 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), IS_RANDO) && !Flags_GetInfTable(INFTABLE_GREETED_BY_SARIA)) { Flags_SetInfTable(INFTABLE_GREETED_BY_SARIA); - *should = true; + *ev->result = true; } break; case VB_PLAY_SHIEK_BLOCK_MASTER_SWORD_CS: case VB_GIVE_ITEM_LIGHT_ARROW: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - *should = false; + *ev->result = false; } break; case VB_PLAY_NABOORU_CAPTURED_CS: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { Flags_SetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA); - *should = false; + *ev->result = false; } break; case VB_PLAY_PULL_MASTER_SWORD_CS: @@ -498,7 +500,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li Item_Give(gPlayState, ITEM_MEDALLION_LIGHT); } } - *should = false; + *ev->result = false; } break; case VB_PLAY_DISPEL_BARRIER_CS: { @@ -517,12 +519,12 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li gPlayState->nextEntranceIndex = trialEntrances[kekkai->actor.params]; gPlayState->transitionTrigger = TRANS_TRIGGER_START; gPlayState->transitionType = TRANS_TYPE_FADE_BLACK; - *should = false; + *ev->result = false; } break; } case VB_OWL_INTERACTION: { - if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"), IS_RANDO) && *should) { + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipOwlInteractions"), IS_RANDO) && *ev->result) { EnOwl* enOwl = va_arg(args, EnOwl*); s32 owlType = (enOwl->actor.params & 0xFC0) >> 6; @@ -531,7 +533,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } func_80ACA62C(enOwl, gPlayState); - *should = false; + *ev->result = false; } break; } @@ -541,14 +543,14 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li // If the doors are not open yet, prioritize opening them if (!Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) { *textId = 0x3036; - *should = true; + *ev->result = true; } } break; } case VB_PLAY_MWEEP_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), 0)) { - *should = false; + *ev->result = false; Inventory_ReplaceItem(gPlayState, ITEM_LETTER_RUTO, ITEM_BOTTLE); Flags_SetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED); } @@ -559,7 +561,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li case VB_PLAY_DROP_FISH_FOR_JABU_CS: case VB_PLAY_DARUNIAS_JOY_CS: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { - *should = false; + *ev->result = false; } break; case VB_PLAY_ZELDAS_LULLABY_CS: { @@ -617,7 +619,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li demoImUpdateHook = 0; demoImKillHook = 0; }); - *should = false; + *ev->result = false; } break; } @@ -625,20 +627,20 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO) { EnSa* enSa = va_arg(args, EnSa*); enSa->actionFunc = func_80AF6B20; - *should = false; + *ev->result = false; } break; } case VB_DESPAWN_HORSE_RACE_COW: { if (Flags_GetEventChkInf(EVENTCHKINF_WON_COW_IN_MALONS_RACE) && CVarGetInteger(CVAR_ENHANCEMENT("CowOfTime"), 0)) { - *should = false; + *ev->result = false; } break; } case VB_PLAY_DRAIN_WELL_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - *should = false; + *ev->result = false; Flags_SetSwitch(gPlayState, 0x2); Flags_SetEventChkInf(EVENTCHKINF_PLAYED_SONG_OF_STORMS_IN_WINDMILL); Flags_SetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO); @@ -647,7 +649,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } case VB_PLAY_SUNS_SONG_CS: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO) { - *should = false; + *ev->result = false; Flags_SetEventChkInf(EVENTCHKINF_LEARNED_SUNS_SONG); // SoH [Randomizer] TODO: Increment time X amount (find out X) // When time is 0, it's changed to 0x46A7 @@ -656,13 +658,13 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li break; case VB_PLAY_ROYAL_FAMILY_TOMB_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { - *should = false; + *ev->result = false; } break; } case VB_PLAY_ROYAL_FAMILY_TOMB_EXPLODE: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { - *should = Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB); + *ev->result = Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB); } break; } @@ -673,19 +675,19 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li enDaiku->subCamActive = false; EnDaiku_EscapeSuccess(enDaiku, gPlayState); } - *should = false; + *ev->result = false; } break; } case VB_PLAY_GORON_FREE_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - *should = false; + *ev->result = false; } break; } case VB_PLAY_DOOR_OF_TIME_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { - *should = false; + *ev->result = false; Flags_SetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME); Flags_SetEnv(gPlayState, 2); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); @@ -694,7 +696,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } case VB_PLAY_FIRE_ARROW_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { - *should = false; + *ev->result = false; } break; } @@ -705,43 +707,43 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li case VB_PLAY_SONG_OF_STORMS_CS: case VB_PLAY_PRELUDE_OF_LIGHT_CS: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO) { - *should = false; + *ev->result = false; } break; case VB_FREEZE_ON_SKULL_TOKEN: if (CVarGetInteger(CVAR_ENHANCEMENT("SkulltulaFreeze"), 0)) { - *should = false; + *ev->result = false; } break; case VB_BE_VALID_GRAVEDIGGING_SPOT: if (CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), IS_RANDO)) { EnTk* enTk = va_arg(args, EnTk*); enTk->validDigHere = true; - *should = true; + *ev->result = true; } break; case VB_BE_DAMPE_GRAVEDIGGING_GRAND_PRIZE: if (CVarGetInteger(CVAR_ENHANCEMENT("DampeWin"), IS_RANDO)) { EnTk* enTk = va_arg(args, EnTk*); enTk->currentReward = 3; - *should = true; + *ev->result = true; } break; case VB_DAMPE_GRAVEDIGGING_GRAND_PRIZE_BE_HEART_PIECE: if (CVarGetInteger(CVAR_ENHANCEMENT("GravediggingTourFix"), 0) || IS_RANDO) { - *should = !Flags_GetCollectible(gPlayState, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE); + *ev->result = !Flags_GetCollectible(gPlayState, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE); } break; case VB_FIX_SAW_SOFTLOCK: // Animation Count should be no more than 1 to guarantee putaway is complete after giving the saw // As this is vanilla behavior, it only applies with the Fix toggle or Skip Text enabled. - *should = (CVarGetInteger(CVAR_ENHANCEMENT("FixSawSoftlock"), 0) != 0 || + *ev->result = (CVarGetInteger(CVAR_ENHANCEMENT("FixSawSoftlock"), 0) != 0 || CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0) ? gPlayState->animationCtx.animationCount > 1 - : *should; + : *ev->result; break; case VB_BIGGORON_CONSIDER_SWORD_FORGED: - *should = Environment_GetBgsDayCount() >= CVarGetInteger(CVAR_ENHANCEMENT("ForgeTime"), 3); + *ev->result = Environment_GetBgsDayCount() >= CVarGetInteger(CVAR_ENHANCEMENT("ForgeTime"), 3); break; case VB_BE_ELIGIBLE_FOR_GREAT_FAIRY_REWARD: { BgDyYoseizo* bgDyYoseizo = va_arg(args, BgDyYoseizo*); @@ -775,12 +777,12 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li if (flag != RAND_INF_MAX && (IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { - if (IS_RANDO || *should) { + if (IS_RANDO || *ev->result) { Flags_SetRandomizerInf(flag); gSaveContext.healthAccumulator = MAX_HEALTH; Magic_Fill(gPlayState); } - *should = false; + *ev->result = false; } break; @@ -793,13 +795,13 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li // The second argument determines whether the vanilla code should be run anyway. It // should be set to `true` ONLY IF said code calls `Play_ClearCamera`, false otherwise. bool clearCamera = (bool)va_arg(args, int); - *should = clearCamera && enHeishi2->cameraId != MAIN_CAM; + *ev->result = clearCamera && enHeishi2->cameraId != MAIN_CAM; } break; } case VB_PLAY_RAINBOW_BRIDGE_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - *should = false; + *ev->result = false; if (!Flags_GetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT)) { func_800F595C(NA_BGM_BRIDGE_TO_GANONS); // This would have been set 2 frames later, but we're skipping now so the sound doesn't play twice @@ -810,7 +812,7 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } case VB_PHANTOM_GANON_DEATH_SCENE: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.QuickBossDeaths"), IS_RANDO || IS_BOSS_RUSH)) { - *should = false; + *ev->result = false; BossGanondrof* pg = va_arg(args, BossGanondrof*); Player* player = GET_PLAYER(gPlayState); if (pg->work[GND_ACTION_STATE] == DEATH_SPASM) { @@ -852,20 +854,20 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } Actor_Kill(&ik->actor); } - *should = false; + *ev->result = false; } break; } case VB_PLAY_SLOW_CHEST_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("FastChests"), 0)) { - *should = false; + *ev->result = false; } break; } case VB_SKIP_SCARECROWS_SONG: { if (gPlayState->msgCtx.msgMode == MSGMODE_OCARINA_PLAYING && CVarGetInteger(CVAR_ENHANCEMENT("InstantScarecrow"), 0) && gSaveContext.scarecrowSpawnSongSet) { - *should = true; + *ev->result = true; } break; } @@ -888,8 +890,9 @@ static uint32_t bgSpot03UpdateHook = 0; static uint32_t bgSpot03KillHook = 0; static uint32_t enPoSistersUpdateHook = 0; static uint32_t enPoSistersKillHook = 0; -void TimeSaverOnActorInitHandler(void* actorRef) { - Actor* actor = static_cast(actorRef); +void TimeSaverOnActorInitHandler(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); if (actor->id == ACTOR_EN_MA1 && gPlayState->sceneNum == SCENE_LON_LON_RANCH) { enMa1UpdateHook = @@ -1059,7 +1062,7 @@ void TimeSaverOnActorInitHandler(void* actorRef) { if (actor->id == ACTOR_EN_DNT_DEMO && (IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { - EnDntDemo* enDntDemo = static_cast(actorRef); + EnDntDemo* enDntDemo = static_cast(ev->actor); enDntDemo->actionFunc = EnDntDemo_JudgeSkipToReward; } @@ -1116,8 +1119,8 @@ void TimeSaverOnActorInitHandler(void* actorRef) { } } -void TimeSaverOnSceneInitHandler(int16_t sceneNum) { - switch (sceneNum) { +void TimeSaverOnSceneInitHandler(IEvent* event) { + switch (reinterpret_cast(event)->sceneNum) { case SCENE_HYRULE_CASTLE: if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO) && !Flags_GetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE)) { @@ -1211,16 +1214,18 @@ extern void TimeSaverQueueItem(RandomizerGet randoGet) { vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(randoGet).GetGIEntry_Copy(); } -void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { +void TimeSaverOnFlagSetHandler(IEvent* event) { // Do nothing when in a boss rush if (IS_BOSS_RUSH) { return; } + OnFlagSet* ev = reinterpret_cast(event); + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), 0)) { - switch (flagType) { + switch (ev->flagType) { case FLAG_EVENT_CHECK_INF: - switch (flag) { + switch (ev->flag) { case EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE: vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FAIRY_OCARINA).GetGIEntry_Copy(); break; @@ -1251,7 +1256,7 @@ void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { } break; case FLAG_RANDOMIZER_INF: - switch (flag) { + switch (ev->flag) { case RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE: vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_SHADOW_MEDALLION).GetGIEntry_Copy(); break; @@ -1264,9 +1269,9 @@ void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { } if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), 0)) { - switch (flagType) { + switch (ev->flagType) { case FLAG_RANDOMIZER_INF: - switch (flag) { + switch (ev->flag) { case RAND_INF_ZF_GREAT_FAIRY_REWARD: vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_FARORES_WIND).GetGIEntry_Copy(); break; @@ -1288,7 +1293,7 @@ void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { } break; case FLAG_ITEM_GET_INF: - switch (flag) { + switch (ev->flag) { case ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE: { TimeSaverQueueItem(CUR_UPG_VALUE(UPG_STICKS) == 2 ? RG_DEKU_STICK_CAPACITY_30 : RG_DEKU_STICK_CAPACITY_20); @@ -1305,9 +1310,9 @@ void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { } if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), 0)) { - switch (flagType) { + switch (ev->flagType) { case FLAG_EVENT_CHECK_INF: - switch (flag) { + switch (ev->flag) { case EVENTCHKINF_LEARNED_ZELDAS_LULLABY: vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_ZELDAS_LULLABY).GetGIEntry_Copy(); break; @@ -1347,7 +1352,7 @@ void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { } break; case FLAG_RANDOMIZER_INF: - switch (flag) { + switch (ev->flag) { case RAND_INF_LEARNED_EPONA_SONG: vanillaQueuedItemEntry = Rando::StaticData::RetrieveItem(RG_EPONAS_SONG).GetGIEntry_Copy(); break; @@ -1357,7 +1362,7 @@ void TimeSaverOnFlagSetHandler(int16_t flagType, int16_t flag) { } } -void TimeSaverOnPlayerUpdateHandler() { +void TimeSaverOnPlayerUpdateHandler(IEvent* event) { if (vanillaQueuedItemEntry.itemId == ITEM_NONE) return; @@ -1378,13 +1383,14 @@ void TimeSaverOnPlayerUpdateHandler() { } } -void TimeSaverOnItemReceiveHandler(GetItemEntry receivedItemEntry) { +void TimeSaverOnItemReceiveHandler(IEvent* event) { + OnItemReceive* ev = reinterpret_cast(event); if (vanillaQueuedItemEntry.itemId == ITEM_NONE) return; - if (vanillaQueuedItemEntry.modIndex == receivedItemEntry.modIndex && - vanillaQueuedItemEntry.itemId == receivedItemEntry.itemId) { - SPDLOG_INFO("Item received: mod {} item {}", receivedItemEntry.modIndex, receivedItemEntry.itemId); + if (vanillaQueuedItemEntry.modIndex == ev->itemEntry.modIndex && + vanillaQueuedItemEntry.itemId == ev->itemEntry.itemId) { + SPDLOG_INFO("Item received: mod {} item {}", ev->itemEntry.modIndex, ev->itemEntry.itemId); vanillaQueuedItemEntry = GET_ITEM_NONE; } } @@ -1397,11 +1403,21 @@ static void TimeSaverRegisterHooks() { COND_HOOK(OnVanillaBehavior, true, TimeSaverOnVanillaBehaviorHandler); COND_HOOK(OnActorInit, true, TimeSaverOnActorInitHandler); + // @port; Again, having to use the expanded macro because GetItemEntry breaks the preprocessor // item queue for use outside rando, rando has its own queue - COND_HOOK(OnLoadGame, !IS_RANDO, [](int32_t fileNum) { - vanillaQueuedItemEntry = GET_ITEM_NONE; - successChimeCooldown = 0; - }); + { + static ListenerID listenerId = -1; + if (listenerId != -1) { + EventSystemUnregisterListener(OnLoadGameID, listenerId);; + listenerId = -1; + } + if (!IS_RANDO) { + listenerId = REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, [](IEvent* event) { + vanillaQueuedItemEntry = GET_ITEM_NONE; + successChimeCooldown = 0; + }); + } + } COND_HOOK(OnItemReceive, !IS_RANDO, TimeSaverOnItemReceiveHandler); COND_HOOK(OnPlayerUpdate, !IS_RANDO, TimeSaverOnPlayerUpdateHandler); COND_HOOK(OnFlagSet, diff --git a/soh/soh/Network/Anchor/HookHandlers.cpp b/soh/soh/Network/Anchor/HookHandlers.cpp index a43f01dc9e9..f9a2971c4ff 100644 --- a/soh/soh/Network/Anchor/HookHandlers.cpp +++ b/soh/soh/Network/Anchor/HookHandlers.cpp @@ -61,21 +61,24 @@ void Anchor::RegisterHooks() { // #region Hooks that are required for basic Anchor functionality - COND_HOOK(OnSceneSpawnActors, isConnected, [&]() { - SendPacket_UpdateClientState(); + COND_HOOK(OnSceneSpawnActors, isConnected, [](IEvent* event) { + Anchor* anchor = Anchor::Instance; + anchor->SendPacket_UpdateClientState(); - if (IsSaveLoaded()) { - RefreshClientActors(); + if (anchor->IsSaveLoaded()) { + anchor->RefreshClientActors(); } }); - COND_HOOK(OnPresentFileSelect, isConnected, [&]() { SendPacket_UpdateClientState(); }); + COND_HOOK(OnPresentFileSelect, isConnected, [](IEvent* event) { Anchor::Instance->SendPacket_UpdateClientState(); }); - COND_ID_HOOK(ShouldActorInit, ACTOR_PLAYER, isConnected, [&](void* actorRef, bool* should) { - Actor* actor = (Actor*)actorRef; + COND_ID_HOOK(ShouldActorInit, ACTOR_PLAYER, isConnected, [](IEvent* event) { + Anchor* anchor = Anchor::Instance; + ShouldActorInit* ev = reinterpret_cast(event); + Actor* actor = (Actor*)ev->actor; - if (spawningDummyPlayerForClientId != 0) { - SetDummyPlayerClientId(actor, spawningDummyPlayerForClientId); + if (anchor->spawningDummyPlayerForClientId != 0) { + anchor->SetDummyPlayerClientId(actor, anchor->spawningDummyPlayerForClientId); // By the time we get here, the actor was already added to the ACTORCAT_PLAYER list, so we need to move it Actor_ChangeCategory(gPlayState, &gPlayState->actorCtx, actor, ACTORCAT_NPC); @@ -88,77 +91,97 @@ void Anchor::RegisterHooks() { } }); - COND_HOOK(OnPlayerUpdate, isConnected, [&]() { - if (justLoadedSave) { - justLoadedSave = false; - SendPacket_RequestTeamState(); + COND_HOOK(OnPlayerUpdate, isConnected, [](IEvent* event) { + Anchor* anchor = Anchor::Instance; + if (anchor->justLoadedSave) { + anchor->justLoadedSave = false; + anchor->SendPacket_RequestTeamState(); } - if (shouldRefreshActors) { - shouldRefreshActors = false; - RefreshClientActors(); + if (anchor->shouldRefreshActors) { + anchor->shouldRefreshActors = false; + anchor->RefreshClientActors(); } - SendPacket_PlayerUpdate(); + anchor->SendPacket_PlayerUpdate(); }); - COND_HOOK(OnGameFrameUpdate, isConnected, [&]() { ProcessIncomingPacketQueue(); }); + COND_HOOK(OnGameFrameUpdate, isConnected, [](IEvent* event) { Anchor::Instance->ProcessIncomingPacketQueue(); }); - COND_HOOK(OnPlayerSfx, isConnected, [&](u16 sfxId) { SendPacket_PlayerSfx(sfxId); }); - COND_HOOK(OnOcarinaNote, isConnected, - [&](uint8_t note, float modulator, int8_t bend) { SendPacket_OcarinaSfx(note, modulator, bend); }); + COND_HOOK(OnPlayerSfx, isConnected, [](IEvent* event){ + OnPlayerSfx* ev = reinterpret_cast(event); + Anchor::Instance->SendPacket_PlayerSfx(ev->sfxId); + }); + COND_HOOK(OnOcarinaNote, isConnected, [](IEvent* event){ + OnOcarinaNote* ev = reinterpret_cast(event); + Anchor::Instance->SendPacket_OcarinaSfx(ev->note, ev->modulator, ev->bend); + }); - COND_HOOK(OnLoadGame, isConnected, [&](s16 fileNum) { justLoadedSave = true; }); + COND_HOOK(OnLoadGame, isConnected, [](IEvent* event) { Anchor::Instance->justLoadedSave = true; }); - COND_HOOK(OnSaveFile, isConnected, [&](s16 fileNum, int sectionID) { - if (sectionID == 0) { - SendPacket_UpdateTeamState(); + COND_HOOK(OnSaveFile, isConnected, [](IEvent* event) { + OnSaveFile* ev = reinterpret_cast(event); + if (ev->sectionID == 0) { + Anchor::Instance->SendPacket_UpdateTeamState(); } }); - COND_HOOK(OnFlagSet, isConnected, - [&](s16 flagType, s16 flag) { SendPacket_SetFlag(SCENE_ID_MAX, flagType, flag); }); + COND_HOOK(OnFlagSet, isConnected, [](IEvent* event){ + OnFlagSet* ev = reinterpret_cast(event); + Anchor::Instance->SendPacket_SetFlag(SCENE_ID_MAX, ev->flagType, ev->flag); + }); - COND_HOOK(OnFlagUnset, isConnected, - [&](s16 flagType, s16 flag) { SendPacket_UnsetFlag(SCENE_ID_MAX, flagType, flag); }); + COND_HOOK(OnFlagUnset, isConnected, [](IEvent* event) { + OnFlagUnset* ev = reinterpret_cast(event); + Anchor::Instance->SendPacket_UnsetFlag(SCENE_ID_MAX, ev->flagType, ev->flag); + }); - COND_HOOK(OnSceneFlagSet, isConnected, - [&](s16 sceneNum, s16 flagType, s16 flag) { SendPacket_SetFlag(sceneNum, flagType, flag); }); + COND_HOOK(OnSceneFlagSet, isConnected, [](IEvent* event){ + OnSceneFlagSet* ev = reinterpret_cast(event); + Anchor::Instance->SendPacket_SetFlag(ev->sceneNum, ev->flagType, ev->flag); + }); - COND_HOOK(OnSceneFlagUnset, isConnected, - [&](s16 sceneNum, s16 flagType, s16 flag) { SendPacket_UnsetFlag(sceneNum, flagType, flag); }); + COND_HOOK(OnSceneFlagUnset, isConnected, [](IEvent* event) { + OnSceneFlagUnset* ev = reinterpret_cast(event); + Anchor::Instance->SendPacket_UnsetFlag(ev->sceneNum, ev->flagType, ev->flag); + }); - COND_HOOK(OnRandoSetCheckStatus, isConnected, [&](RandomizerCheck rc, RandomizerCheckStatus status) { - if (!isHandlingUpdateTeamState) { - SendPacket_SetCheckStatus(rc); + COND_HOOK(OnRandoSetCheckStatus, isConnected, [](IEvent* event) { + OnRandoSetCheckStatus* ev = reinterpret_cast(event); + if (!Anchor::Instance->isHandlingUpdateTeamState) { + Anchor::Instance->SendPacket_SetCheckStatus(ev->rc); } }); - COND_HOOK(OnRandoSetIsSkipped, isConnected, [&](RandomizerCheck rc, bool isSkipped) { - if (!isHandlingUpdateTeamState) { - SendPacket_SetCheckStatus(rc); + COND_HOOK(OnRandoSetIsSkipped, isConnected, [](IEvent* event) { + OnRandoSetIsSkipped* ev = reinterpret_cast(event); + if (!Anchor::Instance->isHandlingUpdateTeamState) { + Anchor::Instance->SendPacket_SetCheckStatus(ev->rc); } }); - COND_HOOK(OnRandoEntranceDiscovered, isConnected, - [&](u16 entranceIndex, u8 isReversedEntrance) { SendPacket_EntranceDiscovered(entranceIndex); }); + COND_HOOK(OnRandoEntranceDiscovered, isConnected, [](IEvent* event){ + OnRandoEntranceDiscovered* ev = reinterpret_cast(event); + Anchor::Instance->SendPacket_EntranceDiscovered(ev->entranceIndex); + }); - COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, isConnected, [&](void* refActor) { SendPacket_GameComplete(); }); + COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, isConnected, [](IEvent* event) { Anchor::Instance->SendPacket_GameComplete(); }); - COND_HOOK(OnItemReceive, isConnected, [&](GetItemEntry itemEntry) { + COND_HOOK(OnItemReceive, isConnected, [](IEvent* event) { + OnItemReceive* ev = reinterpret_cast(event); // Handle vanilla dungeon items a bit differently - if (itemEntry.modIndex == MOD_NONE && - (itemEntry.itemId >= ITEM_KEY_BOSS && itemEntry.itemId <= ITEM_KEY_SMALL)) { - SendPacket_UpdateDungeonItems(); + if (ev->itemEntry.modIndex == MOD_NONE && + (ev->itemEntry.itemId >= ITEM_KEY_BOSS && ev->itemEntry.itemId <= ITEM_KEY_SMALL)) { + Anchor::Instance->SendPacket_UpdateDungeonItems(); return; } - SendPacket_GiveItem(itemEntry.tableId, itemEntry.getItemId); + Anchor::Instance->SendPacket_GiveItem(ev->itemEntry.tableId, ev->itemEntry.getItemId); }); - COND_HOOK(OnDungeonKeyUsed, isConnected, [&](uint16_t mapIndex) { + COND_HOOK(OnDungeonKeyUsed, isConnected, [](IEvent* event) { // Handle vanilla dungeon items a bit differently - SendPacket_UpdateDungeonItems(); + Anchor::Instance->SendPacket_UpdateDungeonItems(); }); COND_VB_SHOULD(VB_APPLY_TUNIC_COLOR, isConnected, { @@ -410,7 +433,7 @@ void Anchor::RegisterHooks() { Color_RGB8 color; }; - COND_HOOK(OnMinimapDrawCompassIcons, isConnected, [&]() { + COND_HOOK(OnMinimapDrawCompassIcons, isConnected, [](IEvent* event) { if (!CVarGetInteger(CVAR_REMOTE_ANCHOR("ShowOtherPlayersOnMinimap"), 1) || Anchor::Instance->roomState.showLocationsMode == 0) { return; diff --git a/soh/soh/ObjectExtension/ActorMaximumHealth.cpp b/soh/soh/ObjectExtension/ActorMaximumHealth.cpp index a712b02d586..3d28535db1d 100644 --- a/soh/soh/ObjectExtension/ActorMaximumHealth.cpp +++ b/soh/soh/ObjectExtension/ActorMaximumHealth.cpp @@ -18,8 +18,9 @@ void SetActorMaximumHealth(const Actor* actor, u8 maximumHealth) { } static void ActorMaximumHealth_Register() { - COND_HOOK(OnActorInit, true, [](void* ptr) { - Actor* actor = static_cast(ptr); + COND_HOOK(OnActorInit, true, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); if (actor->category == ACTORCAT_ENEMY) { SetActorMaximumHealth(actor, actor->colChkInfo.health); } diff --git a/soh/soh/stubs.c b/soh/soh/stubs.c index 118b36e724f..1f5eb6118d9 100644 --- a/soh/soh/stubs.c +++ b/soh/soh/stubs.c @@ -4,7 +4,7 @@ #include #include "z64.h" #include "OTRGlobals.h" -//#include +// #include u32 osResetType; u32 osTvType = OS_TV_NTSC; @@ -45,9 +45,6 @@ OSPri osGetThreadPri(OSThread* thread) { void osSetThreadPri(OSThread* thread, OSPri pri) { } -void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt) { -} - s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes) { } @@ -105,12 +102,6 @@ void osStopThread(OSThread* thread) { void osDestroyThread(OSThread* thread) { } -void osWritebackDCache(void* vaddr, s32 nbytes) { -} - -void osInvalICache(void* vaddr, s32 nbytes) { -} - s32 osContStartQuery(OSMesgQueue* mq) { } @@ -188,12 +179,6 @@ s32 osAiSetFrequency(u32 freq) { return 32006; } -void osInvalDCache(void* vaddr, s32 nbytes) { -} - -void osWritebackDCacheAll(void) { -} - void Audio_SetBGM(u32 bgmId) { } diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index f997c372843..9dd9d62f806 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -58,7 +58,7 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) { osSyncPrintf("ROOM SIZE=%fK\n", roomSize / 1024.0f); - GameInteractor_ExecuteOnSceneInit(play->sceneNum); + CALL_EVENT(OnSceneInit, play->sceneNum); SPDLOG_INFO("Scene Init - sceneNum: {0:#x}, entranceIndex: {1:#x}", play->sceneNum, gSaveContext.entranceIndex); } @@ -79,7 +79,7 @@ void OTRPlay_InitScene(PlayState* play, s32 spawn) { gSaveContext.worldMapArea = 0; OTRScene_ExecuteCommands(play, (SOH::Scene*)play->sceneSegment); - GameInteractor_ExecuteAfterSceneCommands(play->sceneNum); + CALL_EVENT(AfterSceneCommands, play->sceneNum); Play_InitEnvironment(play, play->skyboxId); /* auto data = static_cast(Ship::Context::GetInstance() ->GetResourceManager() diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index 2ac7b8e3839..e8c08ec4b9e 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -476,7 +476,7 @@ extern "C" s32 OTRfunc_800973FC(PlayState* play, RoomContext* roomCtx) { Player_SetBootData(play, GET_PLAYER(play)); Actor_SpawnTransitionActors(play, &play->actorCtx); - GameInteractor_ExecuteAfterSceneCommands(play->sceneNum); + CALL_EVENT(AfterSceneCommands, play->sceneNum); return 1; } diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index 6f6b4f4a3b1..3a0dbe0ef9e 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -631,7 +631,7 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) { AudioSeq_SkipForwardSequence(seqPlayer); //! @bug missing return (but the return value is not used so it's not UB) - GameInteractor_ExecuteOnSeqPlayerInit(playerIdx, seqId); + CALL_EVENT(OnSeqPlayerInit, (playerIdx, seqId); } u8* AudioLoad_SyncLoadSeq(s32 seqId) { diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 158070800c6..4bc4c532926 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1678,7 +1678,7 @@ void func_800ED458(s32 arg0) { } else if ((sPrevOcarinaNoteVal != 0xFF) && (sCurOcarinaBtnVal == 0xFF)) { Audio_StopSfxById(NA_SE_OC_OCARINA); } - GameInteractor_ExecuteOnOcarinaNote(sCurOcarinaBtnVal, D_80130F24, D_80130F10); + CALL_EVENT(OnOcarinaNote, (sCurOcarinaBtnVal, D_80130F24, D_80130F10); } } diff --git a/soh/src/code/game.c b/soh/src/code/game.c index a31cf647443..21da1d4ad9e 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -265,7 +265,7 @@ void GameState_Update(GameState* gameState) { GameState_SetFrameBuffer(gfxCtx); - GameInteractor_ExecuteOnGameStateMainStart(); + CALL_EVENT(OnGameStateMainStart); gameState->main(gameState); @@ -353,7 +353,7 @@ void GameState_Update(GameState* gameState) { gSaveContext.language = LANGUAGE_ENG; } - GameInteractor_ExecuteOnGameFrameUpdate(); + CALL_EVENT(OnGameFrameUpdate); gameState->frames++; } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 54c33e2cfa9..ae8367d27f2 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -681,7 +681,7 @@ void Flags_SetSwitch(PlayState* play, s32 flag) { } if (previouslyOff) { LUSLOG_INFO("Switch Flag Set - %#x", flag); - GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_SWITCH, flag); + CALL_EVENT(OnSceneFlagSet, play->sceneNum, FLAG_SCENE_SWITCH, flag); } } @@ -697,7 +697,7 @@ void Flags_UnsetSwitch(PlayState* play, s32 flag) { } if (previouslyOn) { LUSLOG_INFO("Switch Flag Unset - %#x", flag); - GameInteractor_ExecuteOnSceneFlagUnset(play->sceneNum, FLAG_SCENE_SWITCH, flag); + CALL_EVENT(OnSceneFlagUnset, play->sceneNum, FLAG_SCENE_SWITCH, flag); } } @@ -749,7 +749,7 @@ void Flags_SetTreasure(PlayState* play, s32 flag) { play->actorCtx.flags.chest |= (1 << flag); if (previouslyOff) { LUSLOG_INFO("Treasure Flag Set - %#x", flag); - GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_TREASURE, flag); + CALL_EVENT(OnSceneFlagSet, play->sceneNum, FLAG_SCENE_TREASURE, flag); } } @@ -768,7 +768,7 @@ void Flags_SetClear(PlayState* play, s32 flag) { play->actorCtx.flags.clear |= (1 << flag); if (previouslyOff) { LUSLOG_INFO("Clear Flag Set - %#x", flag); - GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_CLEAR, flag); + CALL_EVENT(OnSceneFlagSet, play->sceneNum, FLAG_SCENE_CLEAR, flag); } } @@ -780,7 +780,7 @@ void Flags_UnsetClear(PlayState* play, s32 flag) { play->actorCtx.flags.clear &= ~(1 << flag); if (previouslyOn) { LUSLOG_INFO("Clear Flag Unset - %#x", flag); - GameInteractor_ExecuteOnSceneFlagUnset(play->sceneNum, FLAG_SCENE_CLEAR, flag); + CALL_EVENT(OnSceneFlagUnset, play->sceneNum, FLAG_SCENE_CLEAR, flag); } } @@ -830,7 +830,7 @@ void Flags_SetCollectible(PlayState* play, s32 flag) { } if (previouslyOff) { LUSLOG_INFO("Collectible Flag Set - %#x", flag); - GameInteractor_ExecuteOnSceneFlagSet(play->sceneNum, FLAG_SCENE_COLLECTIBLE, flag); + CALL_EVENT(OnSceneFlagSet, play->sceneNum, FLAG_SCENE_COLLECTIBLE, flag); } } @@ -1106,7 +1106,7 @@ void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) { if (DECR(titleCtx->delayTimer) == 0) { if (titleCtx->durationTimer == 80) { - GameInteractor_ExecuteOnPresentTitleCard(); + CALL_EVENT(OnPresentTitleCard(); } if (DECR(titleCtx->durationTimer) == 0) { @@ -1199,7 +1199,7 @@ s32 func_8002D53C(PlayState* play, TitleCardContext* titleCtx) { } void Actor_Kill(Actor* actor) { - GameInteractor_ExecuteOnActorKill(actor); + CALL_EVENT(OnActorKill, actor); actor->draw = NULL; actor->update = NULL; actor->flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; @@ -1254,13 +1254,16 @@ void Actor_Init(Actor* actor, PlayState* play) { actor->floorBgId = BGCHECK_SCENE; ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { + bool result = true; Actor_SetObjectDependency(play, actor); - if (GameInteractor_ShouldActorInit(actor)) { + CALL_EVENT(ShouldActorInit, actor, &result); + + if (result) { actor->init(actor, play); actor->init = NULL; - GameInteractor_ExecuteOnActorInit(actor); + CALL_EVENT(OnActorInit, actor); } else { actor->init = NULL; Actor_Kill(actor); @@ -2251,7 +2254,7 @@ void Player_PlaySfx(Actor* actor, u16 sfxId) { } if (actor->id == ACTOR_PLAYER) { - GameInteractor_ExecuteOnPlayerSfx(sfxId); + CALL_EVENT(OnPlayerSfx, (sfxId); } } @@ -2595,7 +2598,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { // #endregion } play->numSetupActors = 0; - GameInteractor_ExecuteOnSceneSpawnActors(); + CALL_EVENT(OnSceneSpawnActors); } if (actorCtx->unk_02 != 0) { @@ -2632,13 +2635,16 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { if (actor->init != NULL) { if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) { + bool result = true; Actor_SetObjectDependency(play, actor); - if (GameInteractor_ShouldActorInit(actor)) { + CALL_EVENT(ShouldActorInit, actor, &result); + + if (result) { actor->init(actor, play); actor->init = NULL; - GameInteractor_ExecuteOnActorInit(actor); + CALL_EVENT(OnActorInit, actor); } else { actor->init = NULL; Actor_Kill(actor); @@ -2685,9 +2691,11 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { if (actor->colorFilterTimer != 0) { actor->colorFilterTimer--; } - if (GameInteractor_ShouldActorUpdate(actor)) { + bool result = true; + CALL_EVENT(ShouldActorUpdate, actor, &result); + if (result) { actor->update(actor, play); - GameInteractor_ExecuteOnActorUpdate(actor); + CALL_EVENT(OnActorUpdate, actor); } func_8003F8EC(play, &play->colCtx.dyna, actor); } @@ -3406,7 +3414,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 pos Actor_Init(actor, play); gSegments[6] = temp; - GameInteractor_ExecuteOnActorSpawn(actor); + CALL_EVENT(OnActorSpawn, actor); return actor; } @@ -3489,7 +3497,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) { player = GET_PLAYER(play); // Execute before actor memory is freed - GameInteractor_ExecuteOnActorDestroy(actor); + CALL_EVENT(OnActorDestroy, actor); if ((player != NULL) && (actor == player->focusActor)) { Player_ReleaseLockOn(player); @@ -4931,7 +4939,7 @@ void Flags_SetEventChkInf(s32 flag) { gSaveContext.eventChkInf[flag >> 4] |= (1 << (flag & 0xF)); if (previouslyOff) { LUSLOG_INFO("EventChkInf Flag Set - %#x", flag); - GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, flag); + CALL_EVENT(OnFlagSet, FLAG_EVENT_CHECK_INF, flag); } } @@ -4943,7 +4951,7 @@ void Flags_UnsetEventChkInf(s32 flag) { gSaveContext.eventChkInf[flag >> 4] &= ~(1 << (flag & 0xF)); if (previouslyOn) { LUSLOG_INFO("EventChkInf Flag Unset - %#x", flag); - GameInteractor_ExecuteOnFlagUnset(FLAG_EVENT_CHECK_INF, flag); + CALL_EVENT(OnFlagUnset, FLAG_EVENT_CHECK_INF, flag); } } @@ -4962,7 +4970,7 @@ void Flags_SetItemGetInf(s32 flag) { gSaveContext.itemGetInf[flag >> 4] |= (1 << (flag & 0xF)); if (previouslyOff) { LUSLOG_INFO("ItemGetInf Flag Set - %#x", flag); - GameInteractor_ExecuteOnFlagSet(FLAG_ITEM_GET_INF, flag); + CALL_EVENT(OnFlagSet, FLAG_ITEM_GET_INF, flag); } } @@ -4974,7 +4982,7 @@ void Flags_UnsetItemGetInf(s32 flag) { gSaveContext.itemGetInf[flag >> 4] &= ~(1 << (flag & 0xF)); if (previouslyOn) { LUSLOG_INFO("ItemGetInf Flag Unset - %#x", flag); - GameInteractor_ExecuteOnFlagUnset(FLAG_ITEM_GET_INF, flag); + CALL_EVENT(OnFlagUnset, FLAG_ITEM_GET_INF, flag); } } @@ -4993,7 +5001,7 @@ void Flags_SetInfTable(s32 flag) { gSaveContext.infTable[flag >> 4] |= (1 << (flag & 0xF)); if (previouslyOff) { LUSLOG_INFO("InfTable Flag Set - %#x", flag); - GameInteractor_ExecuteOnFlagSet(FLAG_INF_TABLE, flag); + CALL_EVENT(OnFlagSet, FLAG_INF_TABLE, flag); } } @@ -5005,7 +5013,7 @@ void Flags_UnsetInfTable(s32 flag) { gSaveContext.infTable[flag >> 4] &= ~(1 << (flag & 0xF)); if (previouslyOn) { LUSLOG_INFO("InfTable Flag Unset - %#x", flag); - GameInteractor_ExecuteOnFlagUnset(FLAG_INF_TABLE, flag); + CALL_EVENT(OnFlagUnset, FLAG_INF_TABLE, flag); } } @@ -5024,7 +5032,7 @@ void Flags_SetEventInf(s32 flag) { gSaveContext.eventInf[flag >> 4] |= (1 << (flag & 0xF)); if (previouslyOff) { LUSLOG_INFO("EventInf Flag Set - %#x", flag); - GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_INF, flag); + CALL_EVENT(OnFlagSet, FLAG_EVENT_INF, flag); } } @@ -5036,7 +5044,7 @@ void Flags_UnsetEventInf(s32 flag) { gSaveContext.eventInf[flag >> 4] &= ~(1 << (flag & 0xF)); if (previouslyOn) { LUSLOG_INFO("EventInf Flag Unset - %#x", flag); - GameInteractor_ExecuteOnFlagUnset(FLAG_EVENT_INF, flag); + CALL_EVENT(OnFlagUnset, FLAG_EVENT_INF, flag); } } @@ -5073,7 +5081,7 @@ void Flags_SetRandomizerInf(RandomizerInf flag) { if (previouslyOff) { gSaveContext.ship.randomizerInf[flag >> 4] |= (1 << (flag & 0xF)); LUSLOG_INFO("RandomizerInf Flag Set - %#x", flag); - GameInteractor_ExecuteOnFlagSet(FLAG_RANDOMIZER_INF, flag); + CALL_EVENT(OnFlagSet, FLAG_RANDOMIZER_INF, flag); } } @@ -5094,7 +5102,7 @@ void Flags_UnsetRandomizerInf(RandomizerInf flag) { if (previouslyOn) { gSaveContext.ship.randomizerInf[flag >> 4] &= ~(1 << (flag & 0xF)); LUSLOG_INFO("RandomizerInf Flag Unset - %#x", flag); - GameInteractor_ExecuteOnFlagUnset(FLAG_RANDOMIZER_INF, flag); + CALL_EVENT(OnFlagUnset, FLAG_RANDOMIZER_INF, flag); } } diff --git a/soh/src/code/z_inventory.c b/soh/src/code/z_inventory.c index f89f20afb78..b579177c011 100644 --- a/soh/src/code/z_inventory.c +++ b/soh/src/code/z_inventory.c @@ -219,7 +219,7 @@ void Inventory_ChangeEquipment(s16 equipment, u16 value) { gSaveContext.equips.equipment &= gEquipNegMasks[equipment]; gSaveContext.equips.equipment |= value << gEquipShifts[equipment]; - GameInteractor_ExecuteOnLinkEquipmentChange(); + CALL_EVENT(OnLinkEquipmentChange(); } u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { @@ -240,7 +240,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { gSaveContext.equips.equipment |= EQUIP_VALUE_TUNIC_KOKIRI << (EQUIP_TYPE_TUNIC * 4); } - GameInteractor_ExecuteOnEquipmentDelete(equipment, equipValue); + CALL_EVENT(OnEquipmentDelete, equipment, equipValue); if (equipment == EQUIP_TYPE_SWORD) { gSaveContext.equips.buttonItems[0] = ITEM_NONE; diff --git a/soh/src/code/z_kaleido_scope_call.c b/soh/src/code/z_kaleido_scope_call.c index b685fa0aeec..c3ebf7114e8 100644 --- a/soh/src/code/z_kaleido_scope_call.c +++ b/soh/src/code/z_kaleido_scope_call.c @@ -57,7 +57,7 @@ void KaleidoScopeCall_Update(PlayState* play) { KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]; PauseContext* pauseCtx = &play->pauseCtx; - GameInteractor_ExecuteOnKaleidoUpdate(); + CALL_EVENT(OnKaleidoUpdate(); if (!gSaveContext.ship.stats.gameComplete && (!IS_BOSS_RUSH || !gSaveContext.ship.quest.data.bossRush.isPaused)) { gSaveContext.ship.stats.pauseTimer++; diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 91aac96238c..db36d8c5e84 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -2096,7 +2096,7 @@ void func_80075B44(PlayState* play) { Sfx_PlaySfxCentered(NA_SE_EV_CHICKEN_CRY_M); if ((Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) && play->csCtx.state == 0 && !Player_InCsMode(play)) { - GameInteractor_ExecuteOnCuccoOrChickenHatch(); + CALL_EVENT(OnCuccoOrChickenHatch(); Message_StartTextbox(play, 0x3066, NULL); } play->envCtx.unk_E0++; diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 6d8222e5a28..2c578d8ae9f 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -764,7 +764,7 @@ void Minimap_DrawCompassIcons(PlayState* play) { CLOSE_DISPS(play->state.gfxCtx); if (play->interfaceCtx.minimapAlpha >= 0xAA) { - GameInteractor_ExecuteOnMinimapDrawCompassIcons(); + CALL_EVENT(OnMinimapDrawCompassIcons(); } } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index ce09fe27168..1ac0c54404a 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -2722,7 +2722,7 @@ void Message_OpenText(PlayState* play, u16 textId) { s16 textBoxType; bool loadFromMessageTable = true; - GameInteractor_ExecuteOnOpenText(&textId, &loadFromMessageTable); + CALL_EVENT(OnOpenText, (&textId, &loadFromMessageTable); sDisplayNextMessageAsEnglish = false; @@ -3820,7 +3820,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { osSyncPrintf(VT_RST); osSyncPrintf("→ OCARINA_MODE=%d\n", play->msgCtx.ocarinaMode); } - GameInteractor_ExecuteOnOcarinaSongAction(); + CALL_EVENT(OnOcarinaSongAction(); } break; case MSGMODE_DISPLAY_SONG_PLAYED: @@ -4455,7 +4455,8 @@ void Message_Update(PlayState* play) { return; } - GameInteractor_ExecuteOnDialogMessage(); + CALL_EVENT(OnDialogMessage); + ; bool isB_Held = CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 4b782d9540c..cfe31e01a10 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1824,11 +1824,11 @@ void GameplayStats_SetTimestamp(PlayState* play, u8 item) { } gSaveContext.ship.stats.itemTimestamp[item] = time; - GameInteractor_ExecuteOnTimestamp(item); + CALL_EVENT(OnTimestamp, item); } u8 Return_Item_Entry(GetItemEntry itemEntry, u8 returnItem) { - GameInteractor_ExecuteOnItemReceiveHooks(itemEntry); + CALL_EVENT(OnItemReceive, itemEntry); return returnItem; } @@ -2796,7 +2796,7 @@ void Interface_SetDoAction(PlayState* play, u16 action) { PauseContext* pauseCtx = &play->pauseCtx; if (interfaceCtx->unk_1F0 != action) { - GameInteractor_ExecuteOnSetDoAction(action); + CALL_EVENT(OnSetDoAction, (action); interfaceCtx->unk_1F0 = action; interfaceCtx->unk_1EC = 1; interfaceCtx->unk_1F4 = 0.0f; @@ -2926,7 +2926,7 @@ s32 Health_ChangeBy(PlayState* play, s16 healthChange) { // "Life=%d *** %d ******" osSyncPrintf(" ライフ=%d *** %d ******\n", gSaveContext.health, healthLevel); - GameInteractor_ExecuteOnPlayerHealthChange(healthChange); + CALL_EVENT(OnPlayerHealthChange, healthChange); if (gSaveContext.health <= 0) { gSaveContext.health = 0; @@ -6506,7 +6506,7 @@ void Interface_Update(PlayState* play) { Right_HUD_Margin = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.R"), 0); Bottom_HUD_Margin = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.B"), 0); - GameInteractor_ExecuteOnInterfaceUpdate(); + CALL_EVENT(OnInterfaceUpdate(); bool isPal = ResourceMgr_GetGameRegion(0) == GAME_REGION_PAL; @@ -6731,7 +6731,7 @@ void Interface_Update(PlayState* play) { tempSaleMod = MOD_RANDOMIZER; } } - GameInteractor_ExecuteOnSaleEndHooks(ItemTable_RetrieveEntry(tempSaleMod, tempSaleItem)); + CALL_EVENT(OnSaleEnd, ItemTable_RetrieveEntry(tempSaleMod, tempSaleItem)); } } diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index f73d076de42..cb6f1dc45a8 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -201,7 +201,7 @@ void Play_Destroy(GameState* thisx) { PlayState* play = (PlayState*)thisx; Player* player = GET_PLAYER(play); - GameInteractor_ExecuteOnPlayDestroy(); + CALL_EVENT(OnPlayDestroy); play->state.gfxCtx->callback = NULL; play->state.gfxCtx->callbackParam = 0; @@ -394,7 +394,7 @@ void Play_Init(GameState* thisx) { gSaveContext.entranceIndex = 0; play->state.running = false; SET_NEXT_GAMESTATE(&play->state, Opening_Init, OpeningContext); - GameInteractor_ExecuteOnExitGame(gSaveContext.fileNum); + CALL_EVENT(OnExitGame, gSaveContext.fileNum); return; } @@ -518,7 +518,7 @@ void Play_Init(GameState* thisx) { gSaveContext.dogIsLost = true; if (Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) { - GameInteractor_ExecuteOnCuccoOrChickenHatch(); + CALL_EVENT(OnCuccoOrChickenHatch(); Message_StartTextbox(play, 0x3066, NULL); } @@ -956,7 +956,7 @@ void Play_Update(PlayState* play) { } // Transition end for standard transitions - GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum); + CALL_EVENT(OnTransitionEnd, play->sceneNum); } play->transitionTrigger = TRANS_TRIGGER_OFF; @@ -1074,7 +1074,7 @@ void Play_Update(PlayState* play) { play->transitionMode = TRANS_MODE_OFF; // Transition end for sandstorm effect (delayed until effect is finished) - GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum); + CALL_EVENT(OnTransitionEnd, play->sceneNum); } } else { if (play->envCtx.sandstormEnvA == 255) { @@ -1113,7 +1113,7 @@ void Play_Update(PlayState* play) { play->transitionMode = TRANS_MODE_OFF; // Transition end for sandstorm effect (delayed until effect is finished) - GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum); + CALL_EVENT(OnTransitionEnd, play->sceneNum); } } break; @@ -1307,7 +1307,7 @@ void Play_Update(PlayState* play) { skip: PLAY_LOG(3801); - GameInteractor_ExecuteOnCameraState(play); + CALL_EVENT(OnCameraState, play); if (!isPaused || gDbgCamEnabled) { s32 i; @@ -1398,7 +1398,7 @@ void Play_Draw(PlayState* play) { Gfx_SetupFrame(gfxCtx, 0, 0, 0); if ((HREG(80) != 10) || (HREG(82) != 0)) { - GameInteractor_ExecuteOnPlayDrawBegin(); + CALL_EVENT(OnPlayDrawBegin); POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP); POLY_XLU_DISP = Play_SetFog(play, POLY_XLU_DISP); @@ -1651,7 +1651,7 @@ void Play_Draw(PlayState* play) { // Draw Enhancements that need to be placed in the world. This happens before the PostWorldDraw // so that they aren't drawn when the pause menu is up (e.g. collision viewer, actor name tags) - GameInteractor_ExecuteOnPlayDrawEnd(); + CALL_EVENT(OnPlayDrawEnd); Play_Draw_DrawOverlayElements: if ((HREG(80) != 10) || (HREG(89) != 0)) { diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 34750ed2cc7..3680510985c 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -650,7 +650,7 @@ void Player_SetModels(Player* this, s32 modelGroup) { this->waistDLists = &sPlayerDListGroups[gPlayerModelTypes[modelGroup][4]][gSaveContext.linkAge]; Player_SetModelsForHoldingShield(this); - GameInteractor_ExecuteOnPlayerSetModels(this, modelGroup); + CALL_EVENT(OnPlayerSetModels, this, modelGroup); } void Player_SetModelGroup(Player* this, s32 modelGroup) { diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index 3449c2ed91a..3a6ce16a08f 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -1145,7 +1145,7 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade LinkAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f); - GameInteractor_ExecuteOnLinkSkeletonInit(); + CALL_EVENT(OnLinkSkeletonInit(); } /** diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 16391b36f17..98b1df375a3 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -1564,7 +1564,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) { this->cameraAt.x = camera->at.x; this->cameraAt.y = camera->at.y; this->cameraAt.z = camera->at.z; - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); break; case 5: tempSin = Math_SinS(this->actor.shape.rot.y - 0x1388) * 150.0f; diff --git a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 1a00b983b70..f506859ac68 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -898,7 +898,7 @@ void BossFd2_CollisionCheck(BossFd2* this, PlayState* play) { Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); Audio_PlayActorSound2(&this->actor, NA_SE_EN_VALVAISA_DEAD); Enemy_StartFinishingBlow(play, &this->actor); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); } else if (damage) { BossFd2_SetupDamaged(this, play); this->work[FD2_DAMAGE_FLASH_TIMER] = 10; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 4aa8984a2b4..ef1fa28db4a 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -2807,7 +2807,7 @@ void BossGanon_UpdateDamage(BossGanon* this, PlayState* play) { Sfx_PlaySfxAtPos(&sZeroVec, NA_SE_EN_LAST_DAMAGE); Audio_QueueSeqCmd(0x100100FF); this->screenFlashTimer = 4; - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_DAMAGE2); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_CUTBODY); diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index d353927c906..48f90d8b153 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1691,7 +1691,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { if ((ABS(temp_a0_2) < 0x2000) && (sqrtf(SQ(temp_f14) + SQ(temp_f12)) < 70.0f) && (player->meleeWeaponState != 0) && (player->heldItemAction == PLAYER_IA_SWORD_MASTER)) { func_80064520(play, &play->csCtx); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); this->subCamId = Play_CreateSubCamera(play); Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT); Play_ChangeCameraStatus(play, this->subCamId, CAM_STAT_ACTIVE); diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 984da2d915f..7ff38424ca1 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -1226,7 +1226,7 @@ void BossGanondrof_CollisionCheck(BossGanondrof* this, PlayState* play) { if ((s8)this->actor.colChkInfo.health <= 0) { BossGanondrof_SetupDeath(this, play); Enemy_StartFinishingBlow(play, &this->actor); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); return; } } diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 3920cca5e47..926a7c08a05 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -1846,7 +1846,7 @@ void BossGoma_UpdateHit(BossGoma* this, PlayState* play) { } else { BossGoma_SetupDefeated(this, play); Enemy_StartFinishingBlow(play, &this->actor); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); } this->invincibilityFrames = 10; diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index a13eb154774..d9ecf42bc99 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -1802,7 +1802,7 @@ void BossMo_CoreCollisionCheck(BossMo* this, PlayState* play) { if (((sMorphaTent1->csCamera == 0) && (sMorphaTent2 == NULL)) || ((sMorphaTent1->csCamera == 0) && (sMorphaTent2 != NULL) && (sMorphaTent2->csCamera == 0))) { Enemy_StartFinishingBlow(play, &this->actor); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); Audio_QueueSeqCmd(0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0x100FF); this->csState = MO_DEATH_START; sMorphaTent1->drawActor = false; diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index aa68a5866b1..d9d97bf7a4a 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -2574,7 +2574,7 @@ void BossSst_HeadCollisionCheck(BossSst* this, PlayState* play) { if (Actor_ApplyDamage(&this->actor) == 0) { Enemy_StartFinishingBlow(play, &this->actor); BossSst_HeadSetupDeath(this, play); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); } else { BossSst_HeadSetupDamage(this); } diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 416715f395c..7225f8f5d11 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -5275,7 +5275,7 @@ void BossTw_TwinrovaDamage(BossTw* this, PlayState* play, u8 damage) { BossTw_TwinrovaSetupDeathCS(this, play); Enemy_StartFinishingBlow(play, &this->actor); Audio_PlayActorSound2(&this->actor, NA_SE_EN_TWINROBA_YOUNG_DEAD); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); return; } diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index f30f9660407..a17c175c889 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1408,7 +1408,7 @@ void BossVa_BodyPhase4(BossVa* this, PlayState* play) { if (sFightPhase >= PHASE_DEATH) { BossVa_SetupBodyDeath(this, play); Enemy_StartFinishingBlow(play, &this->actor); - GameInteractor_ExecuteOnBossDefeat(&this->actor); + CALL_EVENT(OnBossDefeat, &this->actor); return; } this->actor.speedXZ = -10.0f; diff --git a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 29eccfdd7a3..766b47c99b7 100644 --- a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -104,7 +104,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); - GameInteractor_ExecuteOnDungeonKeyUsedHooks(gSaveContext.mapIndex); + CALL_EVENT(OnDungeonKeyUsed, (gSaveContext.mapIndex); } else { s32 direction = func_80994750(this, play); diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 6f1e4fa712f..591bcf3e941 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -272,7 +272,7 @@ void DoorKiller_Die(DoorKiller* this, PlayState* play) { Flags_SetSwitch(play, switchFlag); } Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } /** diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index a5c3882e37b..07584988117 100644 --- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -391,7 +391,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) { if (this->doorType != SHUTTER_BOSS) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); - GameInteractor_ExecuteOnDungeonKeyUsedHooks(gSaveContext.mapIndex); + CALL_EVENT(OnDungeonKeyUsed, (gSaveContext.mapIndex); } else { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B); } diff --git a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c index e9ceea81443..ed2db23a258 100644 --- a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -894,7 +894,7 @@ void EnAm_Update(Actor* thisx, PlayState* play) { dustPosScale += 60.0f; } - GameInteractor_ExecuteOnEnemyDefeat(thisx); + CALL_EVENT(OnEnemyDefeat, thisx); Actor_Kill(&this->dyna.actor); return; diff --git a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 8e00a841558..2f64f178d92 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -316,7 +316,7 @@ void EnAnubice_SetupDie(EnAnubice* this, PlayState* play) { } this->actionFunc = EnAnubice_Die; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnAnubice_Die(EnAnubice* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 1eae09bbc2b..2c9d547016a 100644 --- a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -456,7 +456,7 @@ void EnBa_Update(Actor* thisx, PlayState* play) { this->actor.colChkInfo.health--; if (this->actor.colChkInfo.health == 0) { func_809B75A0(this, play); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } else { func_809B7174(this); } diff --git a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 5ae4305187b..41feb07ef8a 100644 --- a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -469,7 +469,7 @@ void EnBb_SetupDeath(EnBb* this, PlayState* play) { this->action = BB_KILL; EnBb_SetupAction(this, EnBb_Death); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnBb_Death(EnBb* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 368bf865b25..9aa6d0afb19 100644 --- a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -652,7 +652,7 @@ void func_809BE26C(EnBigokuta* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 50, NA_SE_EN_OCTAROCK_BUBLE); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xB0); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } } diff --git a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c index d8ba3877386..31a2e9022cb 100644 --- a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -236,7 +236,7 @@ void EnBili_SetupDie(EnBili* this) { this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actionFunc = EnBili_Die; this->actor.speedXZ = 0.0f; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } /** diff --git a/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 6717b9788f8..542645d1512 100644 --- a/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -373,7 +373,7 @@ void EnBubble_Pop(EnBubble* this, PlayState* play) { if (EnBubble_Explosion(this, play) >= 0) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 60, NA_SE_EN_AWA_BREAK); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c index e268b222e4f..67f44aa4892 100644 --- a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -579,7 +579,7 @@ void func_809D00F4(EnBw* this) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_BUBLEWALK_DEAD); EnBw_SetupAction(this, func_809D014C); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void func_809D014C(EnBw* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index 25369fdd98d..b3cc17cce3d 100644 --- a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -376,7 +376,7 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { if ((s8)this->actor.colChkInfo.health <= 0) { this->state = CLEAR_TAG_STATE_CRASHING; this->actor.velocity.y = 0.0f; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); goto state_crashing; } } diff --git a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 1d2e0d156ee..4701d51d078 100644 --- a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -194,7 +194,7 @@ void EnCrow_SetupDamaged(EnCrow* this, PlayState* play) { void EnCrow_SetupDie(EnCrow* this) { this->actor.colorFilterTimer = 0; this->actionFunc = EnCrow_Die; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnCrow_SetupTurnAway(EnCrow* this) { diff --git a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 73133dcec8c..a7d86e67714 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -407,8 +407,7 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |= EVENTCHKINF_CARPENTERS_FREE_MASK(this->actor.params & 3); - GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, - (EVENTCHKINF_CARPENTERS_FREE_INDEX << 4) + (this->actor.params & 3)); + CALL_EVENT(OnFlagSet, FLAG_EVENT_CHECK_INF, (EVENTCHKINF_CARPENTERS_FREE_INDEX << 4) + (this->actor.params & 3)); this->actor.gravity = -1.0f; this->escapeSubCamTimer = sEscapeSubCamParams[this->actor.params & 3].maxFramesActive; diff --git a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index b84103a4a0b..ba9e7687e0a 100644 --- a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -411,7 +411,7 @@ void EnDekubaba_SetupPrunedSomersault(EnDekubaba* this) { this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED; this->actionFunc = EnDekubaba_PrunedSomersault; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnDekubaba_SetupShrinkDie(EnDekubaba* this) { @@ -420,7 +420,7 @@ void EnDekubaba_SetupShrinkDie(EnDekubaba* this) { this->collider.base.acFlags &= ~AC_ON; this->actionFunc = EnDekubaba_ShrinkDie; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnDekubaba_SetupStunnedVertical(EnDekubaba* this) { diff --git a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 0c7584c0061..a7dc2cccd3a 100644 --- a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -237,7 +237,7 @@ void EnDekunuts_SetupDie(EnDekunuts* this) { this->actionFunc = EnDekunuts_Die; this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DEAD); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnDekunuts_Wait(EnDekunuts* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c index f3d9d779e20..01e7a7537c3 100644 --- a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -445,7 +445,7 @@ void EnDh_SetupDeath(EnDh* this) { this->actor.params = ENDH_DEATH; Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_DEAD); EnDh_SetupAction(this, EnDh_Death); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnDh_Death(EnDh* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 89044687e0a..7555d631133 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -466,7 +466,7 @@ void EnDns_PostBurrow(EnDns* this, PlayState* play) { } } Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 67fd6776800..562ae75db2c 100644 --- a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -187,7 +187,7 @@ void func_809F6A20(EnDodojr* this) { this->counter = 3; this->actor.velocity.y = 10.0f; } - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void func_809F6AC4(EnDodojr* this) { diff --git a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index df30c191b11..2710e6d574c 100644 --- a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -669,7 +669,7 @@ void EnDodongo_SetupDeath(EnDodongo* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.speedXZ = 0.0f; EnDodongo_SetupAction(this, EnDodongo_Death); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnDodongo_Death(EnDodongo* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index 26835509464..c7af77c6b80 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -209,7 +209,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { Flags_SetSwitch(play, this->actor.params & 0x3F); } Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK); - GameInteractor_ExecuteOnDungeonKeyUsedHooks(gSaveContext.mapIndex); + CALL_EVENT(OnDungeonKeyUsed, (gSaveContext.mapIndex); } } else if (!Player_InCsMode(play)) { if (fabsf(playerPosRelToDoor.y) < 20.0f && fabsf(playerPosRelToDoor.x) < 20.0f && diff --git a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 77f6c74c28a..4205553a49b 100644 --- a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -614,7 +614,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) { Enemy_StartFinishingBlow(play, &this->actor); Audio_PlayActorSound2(&this->actor, NA_SE_EN_EIER_DEAD); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } // If underground, one hit kill diff --git a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c index c20ef6e1816..218e3156dd8 100644 --- a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -651,7 +651,7 @@ void EnFd_WaitForCore(EnFd* this, PlayState* play) { } else if (this->actor.params & FLG_COREDEAD) { this->actor.params = 0; this->spinTimer = 30; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index cda0fb18ad8..de41e35caca 100644 --- a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -228,7 +228,7 @@ void EnFirefly_SetupDie(EnFirefly* this) { this->actor.speedXZ = 0.0f; this->actionFunc = EnFirefly_Die; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnFirefly_SetupRebound(EnFirefly* this) { diff --git a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index caea853340b..e0146cbe494 100644 --- a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -443,7 +443,7 @@ void EnFloormas_Die(EnFloormas* this, PlayState* play) { // Die Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x90); EnFloormas_SetupSmShrink(this, play); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 1d676f0a481..2fd4395dc77 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -975,8 +975,8 @@ void EnFr_SetReward(EnFr* this, PlayState* play) { if ((songIndex >= FROG_ZL) && (songIndex <= FROG_SOT)) { if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) { gSaveContext.eventChkInf[13] |= sSongIndex[songIndex]; - GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, - (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); + CALL_EVENT(OnFlagSet, FLAG_EVENT_CHECK_INF, + (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); this->reward = GI_RUPEE_PURPLE; } else { this->reward = GI_RUPEE_BLUE; @@ -984,8 +984,8 @@ void EnFr_SetReward(EnFr* this, PlayState* play) { } else if (songIndex == FROG_STORMS) { if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) { gSaveContext.eventChkInf[13] |= sSongIndex[songIndex]; - GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, - (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); + CALL_EVENT(OnFlagSet, FLAG_EVENT_CHECK_INF, + (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); this->reward = GI_HEART_PIECE; } else { this->reward = GI_RUPEE_BLUE; @@ -993,8 +993,8 @@ void EnFr_SetReward(EnFr* this, PlayState* play) { } else if (songIndex == FROG_CHOIR_SONG) { if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) { gSaveContext.eventChkInf[13] |= sSongIndex[songIndex]; - GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, - (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); + CALL_EVENT(OnFlagSet, FLAG_EVENT_CHECK_INF, + (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); this->reward = GI_HEART_PIECE; } else { this->reward = GI_RUPEE_PURPLE; diff --git a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c index ccc367fc5bd..324b48bfc51 100644 --- a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -366,7 +366,7 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) { vec.z = this->actor.world.pos.z; EnFz_Damaged(this, play, &vec, 30, 10.0f); EnFz_SetupDespawn(this, play); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } } else { diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index f1b68528bf9..2896522fea1 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1327,7 +1327,7 @@ void EnGeldB_SetupDefeated(EnGeldB* this) { this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; Audio_PlayActorSound2(&this->actor, NA_SE_EN_GERUDOFT_DEAD); EnGeldB_SetupAction(this, EnGeldB_Defeated); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnGeldB_Defeated(EnGeldB* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c index fa95087bf71..88defb79bf6 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -402,7 +402,7 @@ void EnGoma_SetupDead(EnGoma* this) { Animation_GetLastFrame(&gObjectGolDeadTwitchingAnim), ANIMMODE_LOOP, -2.0f); this->actionFunc = EnGoma_Dead; this->actionTimer = 3; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnGoma_Dead(EnGoma* this, PlayState* play) { @@ -674,7 +674,7 @@ void EnGoma_UpdateHit(EnGoma* this, PlayState* play) { EnGoma_SpawnHatchDebris(this, play); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } } diff --git a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 938395ba4cf..77e5266c53d 100644 --- a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -433,7 +433,7 @@ void EnHintnuts_Leave(EnHintnuts* this, PlayState* play) { Actor_ChangeCategory(play, &play->actorCtx, this->actor.child, ACTORCAT_PROP); } Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 425a80a36f3..fbeed649736 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -648,7 +648,7 @@ void func_80A7598C(EnIk* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_IRONNACK_DEAD); Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_CUTBODY); EnIk_SetupAction(this, func_80A75A38); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void func_80A75A38(EnIk* this, PlayState* play) { @@ -1442,7 +1442,7 @@ void func_80A781CC(Actor* thisx, PlayState* play) { } Flags_SetEventChkInf(EVENTCHKINF_FINISHED_NABOORU_BATTLE); func_80A7735C(this, play); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 0b1e6de23ed..af5e0527884 100644 --- a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -184,7 +184,7 @@ void EnKarebaba_SetupDying(EnKarebaba* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEKU_JR_DEAD); this->actor.flags |= ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED; this->actionFunc = EnKarebaba_Dying; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 78f75dabd5a..b5344df3900 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -1446,14 +1446,14 @@ void EnMb_CheckColliding(EnMb* this, PlayState* play) { if (this->actor.params == ENMB_TYPE_CLUB) { if (this->actor.colChkInfo.health == 0) { EnMb_SetupClubDead(this); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } else if (this->state != ENMB_STATE_CLUB_KNEELING) { EnMb_SetupClubDamaged(this); } } else { if (this->actor.colChkInfo.health == 0) { EnMb_SetupSpearDead(this); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } else { EnMb_SetupSpearDamaged(this); } diff --git a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 1684e63bd59..4a054dc3c0b 100644 --- a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -448,7 +448,7 @@ void EnNy_SetupDie(EnNy* this, PlayState* play) { } Audio_PlayActorSound2(&this->actor, NA_SE_EN_NYU_DEAD); this->actionFunc = EnNy_Die; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 8f0c7302c14..a53ba667816 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -259,7 +259,7 @@ void EnOkuta_SetupDie(EnOkuta* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gOctorokDieAnim, -3.0f); this->timer = 0; this->actionFunc = EnOkuta_Die; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnOkuta_SetupFreeze(EnOkuta* this) { diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index f6077d2d0ee..795d69cda24 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1007,7 +1007,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); - GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, + CALL_EVENT(OnShopSlotChange, (this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } else if ((this->stickAccumX > 0) || (dpad && CHECK_BTN_ALL(input->press.button, dRight))) { @@ -1018,7 +1018,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); - GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, + CALL_EVENT(OnShopSlotChange, (this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } @@ -1285,7 +1285,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, PlayState* play, Player* playe } EnOssan_CursorUpDown(this, play); if (this->cursorIndex != prevIndex) { - GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, + CALL_EVENT(OnShopSlotChange, (this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); @@ -1358,7 +1358,7 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, PlayState* play, Player* play } EnOssan_CursorUpDown(this, play); if (this->cursorIndex != prevIndex) { - GameInteractor_ExecuteOnShopSlotChangeHooks(this->cursorIndex, + CALL_EVENT(OnShopSlotChange, (this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); diff --git a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index 0957398887b..f69d9a01439 100644 --- a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -595,7 +595,7 @@ void EnPeehat_Larva_StateSeekPlayer(EnPeehat* this, PlayState* play) { } Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x20); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } } @@ -764,7 +764,7 @@ void EnPeehat_StateAttackRecoil(EnPeehat* this, PlayState* play) { EffectSsDeadDb_Spawn(play, &pos, &zeroVec, &zeroVec, 40, 7, 255, 255, 255, 255, 255, 0, 0, 1, 9, 1); } Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } else { EnPeehat_Ground_SetStateSeekPlayer(this); // Is PEAHAT_TYPE_GROUNDED @@ -881,7 +881,7 @@ void EnPeehat_StateExplode(EnPeehat* this, PlayState* play) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index a493fa94550..b40a3440781 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -580,7 +580,7 @@ void EnPoField_Death(EnPoField* this, PlayState* play) { 0, 0, 255, 1, 9, 1); if (this->actionTimer == 1) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_EXTINCT); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } else if (this->actionTimer == 28) { EnPoField_SetupSoulIdle(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index a58041ef02c..4e6bbf609e3 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -1174,7 +1174,7 @@ void func_80ADC10C(EnPoSisters* this, PlayState* play) { } else { Enemy_StartFinishingBlow(play, &this->actor); Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_SISTER_DEAD); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } func_80AD95D8(this); } diff --git a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 2a447d01573..50e9171da5b 100644 --- a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -639,7 +639,7 @@ void func_80ADF15C(EnPoh* this, PlayState* play) { 255, 1, 9, 1); if (this->unk_198 == 1) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_EXTINCT); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } else if (this->unk_198 == 28) { EnPoh_SetupDeath(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c index a64dddbd4db..68bf151d9a0 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -661,7 +661,7 @@ void func_80AE3C20(EnRd* this) { this->actor.speedXZ = 0.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_REDEAD_DEAD); EnRd_SetupAction(this, func_80AE3C98); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void func_80AE3C98(EnRd* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 746265b453a..5c604b50cfe 100644 --- a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -445,7 +445,7 @@ void func_80AE5A9C(EnReeba* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIVA_DEAD); Enemy_StartFinishingBlow(play, &this->actor); this->actionfunc = func_80AE5C38; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } @@ -500,7 +500,7 @@ void func_80AE5C38(EnReeba* this, PlayState* play) { } Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } } diff --git a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 8c8f3db5e50..57f7535c02d 100644 --- a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -385,7 +385,7 @@ void EnRr_SetupDeath(EnRr* this) { this->actionFunc = EnRr_Death; Audio_PlayActorSound2(&this->actor, NA_SE_EN_LIKE_DEAD); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnRr_SetupStunned(EnRr* this) { diff --git a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 04a3ff4ae64..59e51894d5b 100644 --- a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -457,7 +457,7 @@ void EnSb_Update(Actor* thisx, PlayState* play) { } else { Item_DropCollectible(play, &this->actor.world.pos, 8); } - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); Actor_Kill(&this->actor); } } else { diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index b6a871ba5fe..c525b4ea25d 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -141,7 +141,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { player->actor.freezeTimer = 10; } else { SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF); - GameInteractor_ExecuteOnFlagSet(FLAG_GS_TOKEN, this->actor.params); + CALL_EVENT(OnFlagSet, FLAG_GS_TOKEN, this->actor.params); Actor_Kill(&this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c index e8dcebae7ff..1d8dc2df682 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -420,7 +420,7 @@ void func_80AFD7B4(EnSkb* this, PlayState* play) { this->breakFlags |= 4; EffectSsDeadSound_SpawnStationary(play, &this->actor.projectedPos, NA_SE_EN_STALKID_DEAD, 1, 1, 0x28); EnSkb_SetupAction(this, func_80AFD880); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void func_80AFD880(EnSkb* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index a00e7ee7e18..c88b8dd85af 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -742,7 +742,7 @@ void EnSkj_SariasSongKidIdle(EnSkj* this, PlayState* play) { void EnSkj_SetupDie(EnSkj* this) { EnSkj_ChangeAnim(this, SKJ_ANIM_DIE); EnSkj_SetupAction(this, SKJ_ACTION_WAIT_FOR_DEATH_ANIM); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnSkj_WaitForDeathAnim(EnSkj* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_St/z_en_st.c b/soh/src/overlays/actors/ovl_En_St/z_en_st.c index 99f4617bb9a..5969f4fb58a 100644 --- a/soh/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/soh/src/overlays/actors/ovl_En_St/z_en_st.c @@ -469,7 +469,7 @@ s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) { this->deathTimer = 20; this->actor.gravity = -1.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DEAD); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); if (flags & 0x1F820) { // arrow, fire arrow, ice arrow, light arrow, diff --git a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 7ec402360ce..026099e5708 100644 --- a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -279,8 +279,8 @@ void EnSth_GiveReward(EnSth* this, PlayState* play) { EnSth_SetupAction(this, EnSth_RewardObtainedTalk); gSaveContext.eventChkInf[EVENTCHKINF_SKULLTULA_REWARD_INDEX] |= this->eventFlag; if (this->eventFlag != 0) { - GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, (EVENTCHKINF_SKULLTULA_REWARD_INDEX << 4) + - sEventFlagsShift[this->actor.params]); + CALL_EVENT(OnFlagSet, FLAG_EVENT_CHECK_INF, + (EVENTCHKINF_SKULLTULA_REWARD_INDEX << 4) + sEventFlagsShift[this->actor.params]); } } else if (GameInteractor_Should(VB_GIVE_ITEM_FROM_SKULLTULA_REWARD, true, this)) { EnSth_GivePlayerItem(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index c5c8e6167fa..f5890b08c28 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -361,7 +361,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { this->actionFunc = func_80B0DB00; } - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALWALL_DEAD); return true; diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c index 0bcf45a8b54..a76bb98b5ed 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -1530,7 +1530,7 @@ void func_80862E6C(EnTest* this, PlayState* play) { } Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } } @@ -1639,7 +1639,7 @@ void func_808633E8(EnTest* this, PlayState* play) { } Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } } @@ -1730,7 +1730,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) { if ((floorProperty == 5) || (floorProperty == 0xC) || func_80041D4C(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 9) { Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); return; } } diff --git a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c index a7574e17919..5fd77b1c4f7 100644 --- a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -771,7 +771,7 @@ void EnTite_FallApart(EnTite* this, PlayState* play) { } else { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0x40); } - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); Actor_Kill(&this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index ceca597df8b..4ad80ee5bb2 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -564,7 +564,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { case ENTORCH2_DEATH: if (sAlpha - 13 <= 0) { sAlpha = 0; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); Actor_Kill(&this->actor); return; } diff --git a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c index e1b795cea44..1fa6885fad2 100644 --- a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -291,7 +291,7 @@ void EnTp_SetupDie(EnTp* this) { } this->actionIndex = TAILPASARAN_ACTION_DIE; EnTp_SetupAction(this, EnTp_Die); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } /** diff --git a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index c4aabb956b1..80b34c91ad4 100644 --- a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -175,7 +175,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_BOMB_DROP_WATER); EnTuboTrap_DropCollectible(this, play); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); return; } @@ -186,7 +186,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); return; } @@ -197,7 +197,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); return; } @@ -209,7 +209,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &player2->actor.world.pos, 40, NA_SE_PL_BODY_HIT); EnTuboTrap_DropCollectible(this, play); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); return; } } @@ -219,7 +219,7 @@ void EnTuboTrap_HandleImpact(EnTuboTrap* this, PlayState* play) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_POT_BROKEN); EnTuboTrap_DropCollectible(this, play); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); return; } } diff --git a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c index dc7a307de57..7c9c1199c07 100644 --- a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -260,7 +260,7 @@ void EnVali_SetupDivideAndDie(EnVali* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->actor.draw = NULL; this->actionFunc = EnVali_DivideAndDie; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnVali_SetupStunned(EnVali* this) { diff --git a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c index fcf4bc63127..c776e1b2704 100644 --- a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -370,7 +370,7 @@ void EnVm_SetupDie(EnVm* this) { this->actor.speedXZ = Rand_ZeroOne() + 1.0f; this->actor.world.rot.y = Rand_CenteredFloat(65535.0f); EnVm_SetupAction(this, EnVm_Die); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnVm_Die(EnVm* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 77cedb32638..d57d0364bde 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -260,7 +260,7 @@ void EnWallmas_SetupDie(EnWallmas* this, PlayState* play) { Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xC0); this->actionFunc = EnWallmas_Die; - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnWallmas_SetupTakePlayer(EnWallmas* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index bcbeedff1f8..8d3d3deaf54 100644 --- a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -577,7 +577,7 @@ void func_80B3368C(EnWeiyer* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_EIER_DEAD); this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; func_80B32724(this); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } else { func_80B325A0(this); } diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 48f17149e84..9d2e24d9a49 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -1200,7 +1200,7 @@ void EnWf_SetupDie(EnWf* this) { this->actionTimer = this->skelAnime.animLength; Audio_PlayActorSound2(&this->actor, NA_SE_EN_WOLFOS_DEAD); EnWf_SetupAction(this, EnWf_Die); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnWf_Die(EnWf* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 34bab2f2f9f..720f733861c 100644 --- a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -112,7 +112,7 @@ void EnYukabyun_Break(EnYukabyun* this, PlayState* play) { EffectSsHahen_SpawnBurst(play, &this->actor.world.pos, 8.0f, 0, 1300, 300, 15, OBJECT_YUKABYUN, 10, gFloorTileEnemyFragmentDL); Actor_Kill(&this->actor); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnYukabyun_Update(Actor* thisx, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 99d9fba48a6..a61a55c3eb7 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -1926,7 +1926,7 @@ void EnZf_SetupDie(EnZf* this) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DEAD); EnZf_SetupAction(this, EnZf_Die); - GameInteractor_ExecuteOnEnemyDefeat(&this->actor); + CALL_EVENT(OnEnemyDefeat, &this->actor); } void EnZf_Die(EnZf* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 5cc309728ee..a99cb4927e8 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -2079,7 +2079,7 @@ void Player_ProcessControlStick(PlayState* play, Player* this) { direction = (u16)((s16)(sControlStickWorldYaw - this->actor.shape.rot.y) + 0x2000) >> 14; } - GameInteractor_ExecuteOnPlayerProcessStick(); + CALL_EVENT(OnPlayerProcessStick); this->controlStickSpinAngles[this->controlStickDataIndex] = spinAngle; this->controlStickDirections[this->controlStickDataIndex] = direction; @@ -6481,7 +6481,7 @@ s32 Player_ActionHandler_11(Player* this, PlayState* play) { Player_DetachHeldActor(play, this); if (Player_SetupAction(play, this, Player_Action_80843188, 0)) { - GameInteractor_ExecuteOnPlayerHoldUpShield(); + CALL_EVENT(OnPlayerHoldUpShield); this->stateFlags1 |= PLAYER_STATE1_SHIELDING; @@ -9296,7 +9296,7 @@ void Player_Action_80843188(Player* this, PlayState* play) { sp50 = sControlInput->rel.stick_x * (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? 120 : -120) * (CVarGetInteger(CVAR_SETTING("Controls.InvertShieldAimingXAxis"), 0) ? -1 : 1); sp4E = this->actor.shape.rot.y - Camera_GetInputDirYaw(GET_ACTIVE_CAM(play)); - GameInteractor_ExecuteOnPlayerShieldControl(&sp50, &sp54); + CALL_EVENT(OnPlayerShieldControl, &sp50, &sp54); sp40 = Math_CosS(sp4E); sp4C = (Math_SinS(sp4E) * sp50) + (sp54 * sp40); @@ -9845,7 +9845,7 @@ void Player_Action_Roll(Player* this, PlayState* play) { this->av2.bonked = 1; gSaveContext.ship.stats.count[COUNT_BONKS]++; - GameInteractor_ExecuteOnPlayerBonk(); + CALL_EVENT(OnPlayerBonk); return; } @@ -12389,7 +12389,7 @@ void Player_Update(Actor* thisx, PlayState* play) { // func_8002F974(&player->actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); } - GameInteractor_ExecuteOnPlayerUpdate(); + CALL_EVENT(OnPlayerUpdate(); } typedef struct BunnyEarKinematics { @@ -12651,7 +12651,7 @@ s16 func_8084ABD8(PlayState* play, Player* this, s32 arg2, s16 arg3) { f32 xAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.X"), 1.0f); f32 yAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.Y"), 1.0f); - GameInteractor_ExecuteOnPlayerFirstPersonControl(this); + CALL_EVENT(OnPlayerFirstPersonControl, this); if (!func_8002DD78(this) && !func_808334B4(this) && (arg2 == 0)) { // First person without weapon // Y Axis @@ -14581,7 +14581,7 @@ void Player_Action_SwingBottle(Player* this, PlayState* play) { Message_StartTextbox(play, sBottleCatchInfo[this->av1.bottleCatchType - 1].textId, &this->actor); } Audio_PlayFanfare(NA_BGM_ITEM_GET | 0x900); - GameInteractor_ExecuteOnPlayerBottleUpdate((sBottleCatchInfo[this->av1.bottleCatchType - 1].itemId)); + CALL_EVENT(OnPlayerBottleUpdate, (sBottleCatchInfo[this->av1.bottleCatchType - 1].itemId)); this->av2.startedTextbox = true; } else if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { this->av1.bottleCatchType = BOTTLE_CATCH_NONE; diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 964ba69c232..de1ec6a153a 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -260,7 +260,7 @@ void FileChoose_FinishFadeIn(GameState* thisx) { this->controlsAlpha = 255; this->windowAlpha = 200; this->configMode = CM_MAIN_MENU; - GameInteractor_ExecuteOnPresentFileSelect(); + CALL_EVENT(OnPresentFileSelect(); } } @@ -523,7 +523,7 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { } if (sLastFileChooseButtonIndex != this->buttonIndex) { - GameInteractor_ExecuteOnUpdateFileSelectSelection(this->buttonIndex); + CALL_EVENT(OnUpdateFileSelectSelection, (this->buttonIndex); sLastFileChooseButtonIndex = this->buttonIndex; } } @@ -595,7 +595,7 @@ void FileChoose_StartQuestMenu(GameState* thisx) { this->logoAlpha = 255; this->configMode = CM_QUEST_MENU; - GameInteractor_ExecuteOnUpdateFileQuestSelection(this->questType[this->buttonIndex]); + CALL_EVENT(OnUpdateFileQuestSelection, (this->questType[this->buttonIndex]); } } @@ -665,7 +665,7 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - GameInteractor_ExecuteOnUpdateFileQuestSelection(this->questType[this->buttonIndex]); + CALL_EVENT(OnUpdateFileQuestSelection, (this->questType[this->buttonIndex]); } if (CHECK_BTN_ALL(input->press.button, BTN_A)) { @@ -762,7 +762,7 @@ void FileChoose_UpdateRandomizerMenu(GameState* thisx) { } } - GameInteractor_ExecuteOnUpdateFileRandomizerOptionSelection(this->randomizerIndex); + CALL_EVENT(OnUpdateFileRandomizerOptionSelection, (this->randomizerIndex); Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -2400,7 +2400,7 @@ void FileChoose_ConfirmFile(GameState* thisx) { } if (sLastFileChooseButtonIndex != this->confirmButtonIndex) { - GameInteractor_ExecuteOnUpdateFileSelectConfirmationSelection(this->confirmButtonIndex); + CALL_EVENT(OnUpdateFileSelectConfirmationSelection, (this->confirmButtonIndex); sLastFileChooseButtonIndex = this->confirmButtonIndex; } } @@ -2573,7 +2573,7 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.naviTimer = 0; - GameInteractor_ExecuteOnLoadGame(gSaveContext.fileNum); + CALL_EVENT(OnLoadGame, gSaveContext.fileNum); } static void (*gSelectModeUpdateFuncs[])(GameState*) = { @@ -2720,7 +2720,7 @@ void FileChoose_Main(GameState* thisx) { Color_RGB8 helpTextColor = { 100, 255, 255 }; - GameInteractor_ExecuteOnFileChooseMain(thisx); + CALL_EVENT(OnFileChooseMain, (thisx); if (CVarGetInteger(CVAR_COSMETIC("Title.FileChoose.Changed"), 0)) { Color_RGB8 backgroundColor = diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index fe8c33fa1e1..812be465419 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -120,7 +120,7 @@ void FileChoose_SelectCopySource(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - GameInteractor_ExecuteOnUpdateFileCopySelection(this->buttonIndex); + CALL_EVENT(OnUpdateFileCopySelection, (this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -252,7 +252,7 @@ void FileChoose_SelectCopyDest(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - GameInteractor_ExecuteOnUpdateFileCopySelection(this->buttonIndex); + CALL_EVENT(OnUpdateFileCopySelection, (this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -406,7 +406,7 @@ void FileChoose_CopyConfirm(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - GameInteractor_ExecuteOnUpdateFileCopyConfirmationSelection(this->buttonIndex); + CALL_EVENT(OnUpdateFileCopyConfirmationSelection, (this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -764,7 +764,7 @@ void FileChoose_EraseSelect(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - GameInteractor_ExecuteOnUpdateFileEraseSelection(this->buttonIndex); + CALL_EVENT(OnUpdateFileEraseSelection, (this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -881,7 +881,7 @@ void FileChoose_EraseConfirm(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - GameInteractor_ExecuteOnUpdateFileEraseConfirmationSelection(this->buttonIndex); + CALL_EVENT(OnUpdateFileEraseConfirmationSelection, (this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c index 6d1e1d57560..4e2e16a3a36 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c @@ -952,13 +952,13 @@ void FileChoose_UpdateKeyboardCursorNES(GameState* thisx) { if (sLastKbdX != this->kbdX) { // NTSC TODO: Figure out japanese TTS - // GameInteractor_ExecuteOnUpdateFileNameSelection(0xF0 + this->kbdX); + // CALL_EVENT(OnUpdateFileNameSelection, (0xF0 + this->kbdX); sLastKbdX = this->kbdX; sLastCharIndex = -1; } } else if (sLastCharIndex != this->charIndex && this->charIndex < 65) { // NTSC TODO: Figure out japanese TTS - // GameInteractor_ExecuteOnUpdateFileNameSelection(D_808123F0[this->charIndex]); + // CALL_EVENT(OnUpdateFileNameSelection, (D_808123F0[this->charIndex]); sLastCharIndex = this->charIndex; sLastKbdX = -1; } @@ -1064,14 +1064,14 @@ void FileChoose_UpdateOptionsMenuNES(GameState* thisx) { if (sSelectedSetting == FS_SETTING_AUDIO) { if (sLastOptionButtonIndex != gSaveContext.audioSetting) { - GameInteractor_ExecuteOnUpdateFileAudioSelection(gSaveContext.audioSetting); + CALL_EVENT(OnUpdateFileAudioSelection, (gSaveContext.audioSetting); sLastOptionButtonIndex = gSaveContext.audioSetting; } } else if (sSelectedSetting == FS_SETTING_TARGET) { // offset to detect switching between modes u8 optionOffset = gSaveContext.zTargetSetting + FS_AUDIO_SURROUND + FS_SETTING_TARGET; if (sLastOptionButtonIndex != optionOffset) { - GameInteractor_ExecuteOnUpdateFileTargetSelection(gSaveContext.zTargetSetting); + CALL_EVENT(OnUpdateFileTargetSelection, (gSaveContext.zTargetSetting); sLastOptionButtonIndex = optionOffset; } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index d82ec38448f..75e68be38e7 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -651,12 +651,12 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { this->kbdButton = this->kbdX; if (sLastKbdX != this->kbdX) { - GameInteractor_ExecuteOnUpdateFileNameSelection(0xF0 + this->kbdX); + CALL_EVENT(OnUpdateFileNameSelection, (0xF0 + this->kbdX); sLastKbdX = this->kbdX; sLastCharIndex = -1; } } else if (sLastCharIndex != this->charIndex && this->charIndex < 65) { - GameInteractor_ExecuteOnUpdateFileNameSelection(D_808123F0[this->charIndex]); + CALL_EVENT(OnUpdateFileNameSelection, (D_808123F0[this->charIndex]); sLastCharIndex = this->charIndex; sLastKbdX = -1; } @@ -772,7 +772,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { // Persist the new language so it is not overridden on the next frame if (languageChanged) { CVarSetInteger(CVAR_SETTING("Languages"), gSaveContext.language); - GameInteractor_ExecuteOnSetGameLanguage(); + CALL_EVENT(OnSetGameLanguage(); } // NTSC and GC only has two rows and can just flip the setting bit @@ -814,21 +814,21 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { if (sSelectedSetting == FS_SETTING_AUDIO) { if (sLastOptionButtonIndex != gSaveContext.audioSetting) { - GameInteractor_ExecuteOnUpdateFileAudioSelection(gSaveContext.audioSetting); + CALL_EVENT(OnUpdateFileAudioSelection, (gSaveContext.audioSetting); sLastOptionButtonIndex = gSaveContext.audioSetting; } } else if (sSelectedSetting == FS_SETTING_TARGET) { // offset to detect switching between modes u8 optionOffset = gSaveContext.zTargetSetting + FS_AUDIO_SURROUND + FS_SETTING_TARGET; if (sLastOptionButtonIndex != optionOffset) { - GameInteractor_ExecuteOnUpdateFileTargetSelection(gSaveContext.zTargetSetting); + CALL_EVENT(OnUpdateFileTargetSelection, (gSaveContext.zTargetSetting); sLastOptionButtonIndex = optionOffset; } } else { // offset to detect switching between modes u8 optionOffset = gSaveContext.language + FS_AUDIO_SURROUND + FS_TARGET_HOLD + FS_SETTING_LANGUAGE; if (sLastOptionButtonIndex != optionOffset) { - GameInteractor_ExecuteOnUpdateFileLanguageSelection(gSaveContext.language); + CALL_EVENT(OnUpdateFileLanguageSelection, (gSaveContext.language); sLastOptionButtonIndex = optionOffset; } } diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 2be2df5f4f5..581eabac782 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -33,7 +33,7 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) { gSaveContext.magic = 0; gSaveContext.magicCapacity = 0; gSaveContext.magicLevel = gSaveContext.magic; - GameInteractor_ExecuteOnLoadGame(gSaveContext.fileNum); + CALL_EVENT(OnLoadGame, gSaveContext.fileNum); } for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index c701d117cec..6e8af2c2d92 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -169,5 +169,5 @@ void Title_Init(GameState* thisx) { this->addAlpha = -3; this->visibleDuration = 0x3C; - GameInteractor_ExecuteOnZTitleInit(this); + CALL_EVENT(OnZTitleInit, this); } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index b47f06fb203..1638230ab13 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -4794,7 +4794,7 @@ void KaleidoScope_Update(PlayState* play) { } else { play->state.running = 0; SET_NEXT_GAMESTATE(&play->state, Opening_Init, OpeningContext); - GameInteractor_ExecuteOnExitGame(gSaveContext.fileNum); + CALL_EVENT(OnExitGame, gSaveContext.fileNum); } } } @@ -4879,5 +4879,5 @@ void KaleidoScope_Update(PlayState* play) { break; } - GameInteractor_ExecuteOnKaleidoscopeUpdate(sInDungeonScene); + CALL_EVENT(OnKaleidoscopeUpdate, (sInDungeonScene); } From 67917b8d9470d2a2ca89650c8ab9fe743bf63c60 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 13:45:38 -0600 Subject: [PATCH 02/31] Ported even more things --- libultraship | 2 +- soh/soh/Enhancements/BlueFireArrows.cpp | 10 +- soh/soh/Enhancements/Cheats/GSTargetable.cpp | 15 ++- .../ExtraModes/EnemyRandomizer.cpp | 10 +- .../Enhancements/ExtraModes/HurtContainer.cpp | 3 +- soh/soh/Enhancements/Fixes/FloorSwitches.cpp | 5 +- .../Enhancements/Fixes/GoronCityDoorFix.cpp | 2 +- .../GameplayStats/BossDefeatTimestamps.cpp | 4 +- .../GameplayStats/EnemyDefeatCounts.cpp | 4 +- soh/soh/Enhancements/QoL/Autosave.cpp | 3 +- soh/soh/Enhancements/RebottleBlueFire.cpp | 5 +- .../Enhancements/RemoveSpinAttackDarkness.cpp | 5 +- .../Enhancements/TimeSavers/DampeAllNight.cpp | 5 +- .../TimeSavers/FasterHeavyBlockLift.cpp | 2 +- .../Story/SkipToGivingZeldasLetter.cpp | 5 +- .../MoveJabuJabuElevator.cpp | 5 +- soh/soh/Enhancements/Warping.cpp | 2 +- soh/soh/Enhancements/boss-rush/BossRush.cpp | 17 +-- soh/soh/Enhancements/controls/Mouse.cpp | 14 +-- .../cosmetics/CustomLogoTitle.cpp | 4 +- soh/soh/Enhancements/customequipment.cpp | 3 +- soh/soh/Enhancements/debugger/actorViewer.cpp | 5 +- .../game-interactor/GameInteractor.h | 38 ++++--- .../Enhancements/randomizer/fishsanity.cpp | 4 +- .../Enhancements/timesaver_hook_handlers.cpp | 9 +- soh/soh/Network/Anchor/HookHandlers.cpp | 16 +-- soh/soh/Network/Sail/Sail.cpp | 104 ++++++++++-------- 27 files changed, 168 insertions(+), 133 deletions(-) diff --git a/libultraship b/libultraship index b824a837d4c..775be8eeb85 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit b824a837d4c0978fa17bdd45670d534f7b138443 +Subproject commit 775be8eeb8550f339a44b43a84ff2d7730a041f1 diff --git a/soh/soh/Enhancements/BlueFireArrows.cpp b/soh/soh/Enhancements/BlueFireArrows.cpp index 985767853a8..e623cf6af63 100644 --- a/soh/soh/Enhancements/BlueFireArrows.cpp +++ b/soh/soh/Enhancements/BlueFireArrows.cpp @@ -9,13 +9,15 @@ extern "C" { extern PlayState* gPlayState; } -static void UpdateBlueFireCollidersBgBreakwall(void* actorPtr) { - BgBreakwall* thisx = (BgBreakwall*)actorPtr; +static void UpdateBlueFireCollidersBgBreakwall(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + BgBreakwall* thisx = (BgBreakwall*) ev->actor; thisx->collider.info.bumper.dmgFlags |= DMG_ARROW_ICE; } -static void UpdateBlueFireCollidersBgIceShelter(void* actorPtr) { - BgIceShelter* thisx = (BgIceShelter*)actorPtr; +static void UpdateBlueFireCollidersBgIceShelter(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + BgIceShelter* thisx = (BgIceShelter*) ev->actor; thisx->cylinder1.base.acFlags |= AC_TYPE_PLAYER; thisx->cylinder1.info.bumper.dmgFlags |= DMG_ARROW_ICE; thisx->cylinder2.base.acFlags |= AC_TYPE_PLAYER; diff --git a/soh/soh/Enhancements/Cheats/GSTargetable.cpp b/soh/soh/Enhancements/Cheats/GSTargetable.cpp index 60911a06eac..89386b7d1a1 100644 --- a/soh/soh/Enhancements/Cheats/GSTargetable.cpp +++ b/soh/soh/Enhancements/Cheats/GSTargetable.cpp @@ -15,8 +15,9 @@ static constexpr int32_t CVAR_GSTARGETABLE_DEFAULT = 0; #define CVAR_GSTARGETABLE_NAME CVAR_CHEAT("GSTargetable") #define CVAR_GSTARGETABLE_VALUE CVarGetInteger(CVAR_GSTARGETABLE_NAME, CVAR_GSTARGETABLE_DEFAULT) -static void OnActorInitGSTargetable(void* refActor) { - EnSw* enSw = reinterpret_cast(refActor); +static void OnActorInitGSTargetable(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnSw* enSw = reinterpret_cast(ev->actor); if (enSw->actor.naviEnemyId == 0x20) { // Enable Targeting this Gold Skulltula, if visible by default @@ -31,8 +32,9 @@ static void OnActorInitGSTargetable(void* refActor) { } } -static void OnEnemyDefeatGSTargetable(void* refActor) { - EnSw* enSw = reinterpret_cast(refActor); +static void OnEnemyDefeatGSTargetable(IEvent* event) { + OnEnemyDefeat* ev = reinterpret_cast(event); + EnSw* enSw = reinterpret_cast(ev->actor); if (enSw->actor.naviEnemyId == 0x20) { // Disable Targeting immediately when the Gold Skulltula is defeated (like regular Skullwalltulas) @@ -40,8 +42,9 @@ static void OnEnemyDefeatGSTargetable(void* refActor) { } } -static void OnActorUpdateGSTargetable(void* refActor) { - EnSw* enSw = reinterpret_cast(refActor); +static void OnActorUpdateGSTargetable(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + EnSw* enSw = reinterpret_cast(ev->actor); // Handle Night GS Spawning/Despawning if ((enSw->actor.naviEnemyId == 0x20) && (((enSw->actor.params & 0xE000) >> 0xD) == 2) && diff --git a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp index d2579e1279c..05249f7d478 100644 --- a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp +++ b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp @@ -495,15 +495,17 @@ uint8_t GetRandomizedEnemy(PlayState* play, int16_t* actorId, s16* posX, s16* po return 1; } -void FixClubMoblinScale(void* ptr) { - Actor* actor = (Actor*)ptr; +void FixClubMoblinScale(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = (Actor*) ev->actor; if (actor->params == -1) { Actor_SetScale(actor, 0.014f); } } -static void OnGerudoFighterDefeat(void* refActor) { - EnGeldB* enGeldB = reinterpret_cast(refActor); +static void OnGerudoFighterDefeat(IEvent* event) { + OnEnemyDefeat* ev = reinterpret_cast(event); + EnGeldB* enGeldB = reinterpret_cast(ev->actor); if (enGeldB->keyFlag == 0) { Item_DropCollectibleRandom(gPlayState, &enGeldB->actor, &enGeldB->actor.world.pos, 0xC0); diff --git a/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp b/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp index 8c49609d8d5..07a467fac2d 100644 --- a/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp +++ b/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp @@ -30,7 +30,8 @@ static void RegisterHurtContainer() { UpdateHurtContainerModeState(); } - COND_HOOK(OnLoadGame, hurtEnabled != CVAR_HURT_CONTAINER_VALUE, [](IEvent* event) { UpdateHurtContainerModeState(); }); + COND_HOOK(OnLoadGame, hurtEnabled != CVAR_HURT_CONTAINER_VALUE, + [](IEvent* event) { UpdateHurtContainerModeState(); }); COND_VB_SHOULD(VB_HEARTS_INCREASE_WITH_CONTAINERS, CVAR_HURT_CONTAINER_VALUE, { *should = false; diff --git a/soh/soh/Enhancements/Fixes/FloorSwitches.cpp b/soh/soh/Enhancements/Fixes/FloorSwitches.cpp index 8c05c5c675a..4f061b63de1 100644 --- a/soh/soh/Enhancements/Fixes/FloorSwitches.cpp +++ b/soh/soh/Enhancements/Fixes/FloorSwitches.cpp @@ -10,8 +10,9 @@ static constexpr int32_t CVAR_FLOOR_SWITCHES_DEFAULT = 0; #define CVAR_FLOOR_SWITCHES_NAME CVAR_ENHANCEMENT("FixFloorSwitches") #define CVAR_FLOOR_SWITCHES_VALUE CVarGetInteger(CVAR_FLOOR_SWITCHES_NAME, CVAR_FLOOR_SWITCHES_DEFAULT) -static void OnInitFloorSwitches(void* refActor) { - ObjSwitch* switchActor = reinterpret_cast(refActor); +static void OnInitFloorSwitches(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + ObjSwitch* switchActor = reinterpret_cast(ev->actor); s32 type = (switchActor->dyna.actor.params & 7); if (switchActor->dyna.actor.params == 0x1200 || switchActor->dyna.actor.params == 0x3A00) { diff --git a/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp b/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp index 3e10a74e7a9..f06d6e1c3be 100644 --- a/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp +++ b/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp @@ -12,7 +12,7 @@ static constexpr int32_t CVAR_GC_DOOR_FIX_DEFAULT = 0; #define CVAR_GC_DOOR_FIX_NAME CVAR_ENHANCEMENT("GCDoorsAfterFireFix") #define CVAR_GC_DOOR_FIX_VALUE CVarGetInteger(CVAR_GC_DOOR_FIX_NAME, CVAR_GC_DOOR_FIX_DEFAULT) -static void OnInitGCDoor(void* refActor) { +static void OnInitGCDoor(IEvent* event) { // In the off chance that Fire Temple is completed before stopping Goron Link and getting // Goron Tunic / opening the city doors, open them the next time Link goes to Goron City. if (GameInteractor_Should(VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED, CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) && diff --git a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp index 1cb05814b5b..91fcf276719 100644 --- a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp +++ b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp @@ -5,7 +5,7 @@ extern "C" SaveContext gSaveContext; #define BOSS_DEFEAT_TIMESTAMP(actorID, timestamp) \ COND_ID_HOOK(OnBossDefeat, actorID, true, \ - [](void* refActor) { gSaveContext.ship.stats.itemTimestamp[timestamp] = GAMEPLAYSTAT_TOTAL_TIME; }); + [](IEvent* event) { gSaveContext.ship.stats.itemTimestamp[timestamp] = GAMEPLAYSTAT_TOTAL_TIME; }); static void RegisterBossDefeatTimestamps() { BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_GOMA, TIMESTAMP_DEFEAT_GOHMA); @@ -17,7 +17,7 @@ static void RegisterBossDefeatTimestamps() { BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_SST, TIMESTAMP_DEFEAT_BONGO_BONGO); BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_TW, TIMESTAMP_DEFEAT_TWINROVA); BOSS_DEFEAT_TIMESTAMP(ACTOR_BOSS_GANON, TIMESTAMP_DEFEAT_GANONDORF); - COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, true, [](void* refActor) { + COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, true, [](IEvent* event) { gSaveContext.ship.stats.itemTimestamp[TIMESTAMP_DEFEAT_GANON] = GAMEPLAYSTAT_TOTAL_TIME; gSaveContext.ship.stats.gameComplete = true; }); diff --git a/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp b/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp index 0174cc74da3..fabd3e9f1f6 100644 --- a/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp +++ b/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp @@ -23,10 +23,10 @@ static void IncrementEnemyDefeatCount(GameplayStatCount countType) { } #define ENEMY_DEFEAT_COUNT(actorID, func) \ - COND_ID_HOOK(OnEnemyDefeat, actorID, true, [](void* refActor) { func(static_cast(refActor)); }); + COND_ID_HOOK(OnEnemyDefeat, actorID, true, [](IEvent* ev) { func(static_cast(reinterpret_cast(ev)->actor)); }); #define ENEMY_DEFEAT_COUNT_UNIQUE(actorID, countType) \ - COND_ID_HOOK(OnEnemyDefeat, actorID, true, [](void*) { IncrementEnemyDefeatCount(countType); }); + COND_ID_HOOK(OnEnemyDefeat, actorID, true, [](IEvent* ev) { IncrementEnemyDefeatCount(countType); }); static void EnemyDefeatCounts_EnBb(Actor* actor) { GameplayStatCount countType; diff --git a/soh/soh/Enhancements/QoL/Autosave.cpp b/soh/soh/Enhancements/QoL/Autosave.cpp index 91c2c2943fa..320a7657008 100644 --- a/soh/soh/Enhancements/QoL/Autosave.cpp +++ b/soh/soh/Enhancements/QoL/Autosave.cpp @@ -76,8 +76,7 @@ static void Autosave_SoftResetSave() { } static void RegisterAutosave() { - COND_HOOK(OnLoadGame, CVAR_AUTOSAVE_VALUE, - [](IEvent* event) { lastSaveTimestamp = GetUnixTimestamp(); }); + COND_HOOK(OnLoadGame, CVAR_AUTOSAVE_VALUE, [](IEvent* event) { lastSaveTimestamp = GetUnixTimestamp(); }); COND_HOOK(OnGameFrameUpdate, CVAR_AUTOSAVE_VALUE, Autosave_IntervalSave); COND_HOOK(OnExitGame, CVAR_AUTOSAVE_VALUE, [](IEvent* event) { Autosave_SoftResetSave(); }); } diff --git a/soh/soh/Enhancements/RebottleBlueFire.cpp b/soh/soh/Enhancements/RebottleBlueFire.cpp index 8ca11e4e62f..1d0062ef116 100644 --- a/soh/soh/Enhancements/RebottleBlueFire.cpp +++ b/soh/soh/Enhancements/RebottleBlueFire.cpp @@ -9,8 +9,9 @@ u32 EnIceHono_InBottleRange(EnIceHono* thisx, PlayState* play); extern PlayState* gPlayState; -void OnEnIceHonoUpdate(void* actor) { - EnIceHono* thisx = (EnIceHono*)actor; +void OnEnIceHonoUpdate(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnIceHono* thisx = (EnIceHono*)ev->actor; if (thisx->actionFunc != EnIceHono_CapturableFlame && EnIceHono_InBottleRange(thisx, gPlayState)) { // GI_MAX in this case allows the player to catch the actor in a bottle Actor_OfferGetItem(&thisx->actor, gPlayState, GI_MAX, 60.0f, 100.0f); diff --git a/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp b/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp index 6349a7818ef..4b0acb685a2 100644 --- a/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp +++ b/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp @@ -26,8 +26,9 @@ void Custom_EnMThunder_Update(Actor* thisx, PlayState* play) { (s32)(blueRadius * 800.0f)); } -void OnEnMThunderInitReplaceUpdateWithCustom(void* thunder) { - EnMThunder* enMThunder = (EnMThunder*)thunder; +void OnEnMThunderInitReplaceUpdateWithCustom(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnMThunder* enMThunder = (EnMThunder*)ev->actor; enMThunder->actor.update = Custom_EnMThunder_Update; } diff --git a/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp b/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp index 683e7fbca1a..f8eb1128558 100644 --- a/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp +++ b/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp @@ -19,8 +19,9 @@ static bool DampeIsResting() { return LINK_IS_ADULT || gPlayState->sceneNum != SCENE_GRAVEYARD; } -static void OpenDampeHutDoor(void* refActor) { - EnDoor* enDoor = static_cast(refActor); +static void OpenDampeHutDoor(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnDoor* enDoor = static_cast(ev->actor); s16* params = &enDoor->actor.params; if (*params == DAMPE_HUT_DOOR_CLOSED && !DampeIsResting()) { diff --git a/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp b/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp index 80dc47463ff..2bbf6134d90 100644 --- a/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp +++ b/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp @@ -47,7 +47,7 @@ void RegisterFasterHeavyBlockLift() { }); COND_ID_HOOK(OnActorKill, ACTOR_BG_HEAVY_BLOCK, CVAR_BLOCKLIFT_VALUE || CVAR_SKIP_CUTSCENE_VALUE, - [](void* actor) { Quake_Init(); }); + [](IEvent* event) { Quake_Init(); }); COND_VB_SHOULD(VB_MOVE_THROWN_ACTOR, CVAR_BLOCKLIFT_VALUE, { Actor* heldActor = va_arg(args, Actor*); diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp index 1acd6dabed7..4fde6d6e299 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp @@ -31,8 +31,9 @@ void EnZl4_SkipToGivingZeldasLetter(EnZl4* enZl4, PlayState* play) { } } -void SkipToGivingZeldasLetter_OnActorInit(void* actorPtr) { - EnZl4* enZl4 = static_cast(actorPtr); +void SkipToGivingZeldasLetter_OnActorInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnZl4* enZl4 = static_cast(ev->actor); if (enZl4->actionFunc != EnZl4_Cutscene || enZl4->csState != 0) return; diff --git a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp index 34e2fdf6143..1cbf31076ac 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp @@ -5,9 +5,10 @@ extern "C" { #include "src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h" } -void BdanInit(void* actorRef) { +void BdanInit(IEvent* event) { Player* player = GET_PLAYER(gPlayState); - BgBdanObjects* bgBdanObjects = static_cast(actorRef); + OnActorInit* ev = reinterpret_cast(event); + BgBdanObjects* bgBdanObjects = static_cast(ev->actor); if (bgBdanObjects->dyna.actor.params == 1) { if (player->actor.world.pos.y < -500.0f) { diff --git a/soh/soh/Enhancements/Warping.cpp b/soh/soh/Enhancements/Warping.cpp index 48fd0d5f052..bcba716112a 100644 --- a/soh/soh/Enhancements/Warping.cpp +++ b/soh/soh/Enhancements/Warping.cpp @@ -185,7 +185,7 @@ void RegisterWarping() { COND_HOOK(OnZTitleUpdate, CVAR_BOOTSEQUENCE_VALUE == BOOTSEQUENCE_DEBUGWARPSCREEN, [](IEvent* event) { OnZTitleUpdate* ev = reinterpret_cast(event); - TitleContext* titleContext = (TitleContext*) ev->gameState; + TitleContext* titleContext = (TitleContext*)ev->gameState; gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = 0xFF; diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index bb9dfc96273..6ddee250744 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -273,9 +273,8 @@ void FileChoose_UpdateBossRushMenu(GameState* gameState) { if (sLastBossRushOptionIndex != fileChooseContext->bossRushIndex || sLastBossRushOptionValue != gSaveContext.ship.quest.data.bossRush.options[fileChooseContext->bossRushIndex]) { - CALL_EVENT(OnUpdateFileBossRushOptionSelection, - fileChooseContext->bossRushIndex, - gSaveContext.ship.quest.data.bossRush.options[fileChooseContext->bossRushIndex]); + CALL_EVENT(OnUpdateFileBossRushOptionSelection, fileChooseContext->bossRushIndex, + gSaveContext.ship.quest.data.bossRush.options[fileChooseContext->bossRushIndex]); sLastBossRushOptionIndex = fileChooseContext->bossRushIndex; sLastBossRushOptionValue = gSaveContext.ship.quest.data.bossRush.options[fileChooseContext->bossRushIndex]; } @@ -919,23 +918,25 @@ void BossRush_OnBlueWarpUpdate(IEvent* event) { void RegisterBossRush() { COND_HOOK(OnLoadGame, true, [](IEvent* event) { - COND_ID_HOOK(OnActorInit, ACTOR_DEMO_SA, IS_BOSS_RUSH, [](IEvent* event) { OnActorInit* ev = reinterpret_cast(event); BossRush_SpawnBlueWarps(gPlayState); - Actor_Kill((Actor*) ev->actor); + Actor_Kill((Actor*)ev->actor); GET_PLAYER(gPlayState)->actor.world.rot.y = 27306; GET_PLAYER(gPlayState)->actor.shape.rot.y = 27306; }); // Remove bushes, used in Gohma's arena - COND_ID_HOOK(OnActorInit, ACTOR_EN_KUSA, IS_BOSS_RUSH, [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); + COND_ID_HOOK(OnActorInit, ACTOR_EN_KUSA, IS_BOSS_RUSH, + [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); // Remove pots, used in Barinade's and Ganondorf's arenas - COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, IS_BOSS_RUSH, [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); + COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, IS_BOSS_RUSH, + [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); // Remove chests, mainly for the chest in King Dodongo's boss room - COND_ID_HOOK(OnActorInit, ACTOR_EN_BOX, IS_BOSS_RUSH, [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); + COND_ID_HOOK(OnActorInit, ACTOR_EN_BOX, IS_BOSS_RUSH, + [](IEvent* event) { Actor_Kill((Actor*)reinterpret_cast(event)->actor); }); COND_HOOK(OnVanillaBehavior, IS_BOSS_RUSH, BossRush_OnVanillaBehaviorHandler); diff --git a/soh/soh/Enhancements/controls/Mouse.cpp b/soh/soh/Enhancements/controls/Mouse.cpp index 30ca00bdd53..6df3c815e12 100644 --- a/soh/soh/Enhancements/controls/Mouse.cpp +++ b/soh/soh/Enhancements/controls/Mouse.cpp @@ -39,7 +39,7 @@ extern "C" void Mouse_HandleThirdPerson(f32* newCamX, f32* newCamY) { } } -extern"C" void Mouse_HandleFirstPerson(Player* player) { +extern "C" void Mouse_HandleFirstPerson(Player* player) { f32 xAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.X"), 1.0f); f32 yAxisMulti = CVarGetFloat(CVAR_SETTING("FirstPersonCameraSensitivity.Y"), 1.0f); s8 invertXAxisMulti = ((CVarGetInteger(CVAR_SETTING("Controls.InvertAimingXAxis"), 0) && @@ -129,29 +129,25 @@ extern "C" bool Mouse_HandleQuickspin(bool* should, s8* iter2, s8* sp3C) { // Hook handlers void Mouse_RegisterRecenterCursorOnShield() { - COND_HOOK(OnPlayerHoldUpShield, true, [](IEvent* event){ - Mouse_RecenterCursor(); - }); + COND_HOOK(OnPlayerHoldUpShield, true, [](IEvent* event) { Mouse_RecenterCursor(); }); } void Mouse_RegisterHandleFirstPerson() { - COND_HOOK(OnPlayerFirstPersonControl, true, [](IEvent* event){ + COND_HOOK(OnPlayerFirstPersonControl, true, [](IEvent* event) { OnPlayerFirstPersonControl* ev = reinterpret_cast(event); Mouse_HandleFirstPerson(ev->player); }); } void Mouse_RegisterHandleShield() { - COND_HOOK(OnPlayerShieldControl, true, [](IEvent* event){ + COND_HOOK(OnPlayerShieldControl, true, [](IEvent* event) { OnPlayerShieldControl* ev = reinterpret_cast(event); Mouse_HandleShield(ev->sp50, ev->sp54); }); } void Mouse_RegisterUpdateQuickspinCount() { - COND_HOOK(OnPlayerProcessStick, true, [](IEvent* event){ - Mouse_UpdateQuickspinCount(); - }); + COND_HOOK(OnPlayerProcessStick, true, [](IEvent* event) { Mouse_UpdateQuickspinCount(); }); } void Mouse_RegisterHandleQuickspin() { diff --git a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp index 61fefda0b62..22676959345 100644 --- a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp +++ b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp @@ -176,14 +176,14 @@ extern "C" void CustomLogoTitle_Main(TitleContext* titleContext) { void OnZTitleInitReplaceTitleMainWithCustom(IEvent* event) { OnZTitleInit* ev = reinterpret_cast(event); - TitleContext* titleContext = (TitleContext*) ev->gameState; + TitleContext* titleContext = (TitleContext*)ev->gameState; titleContext->state.main = (GameStateFunc)CustomLogoTitle_Main; } // Allows pressing A to skip the boot logo and go to the next state (opening or file select) void OnZTitleUpdatePressButtonToSkip(IEvent* event) { OnZTitleUpdate* ev = reinterpret_cast(event); - TitleContext* titleContext = (TitleContext*) ev->gameState; + TitleContext* titleContext = (TitleContext*)ev->gameState; if (CHECK_BTN_ANY(titleContext->state.input->press.button, BTN_A | BTN_B | BTN_START)) { // Force the title state to start fading to black and to last roughly 5 frames based on current fade in/out diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index d8f98acf3e1..0f4b39cbe65 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -61,7 +61,8 @@ static void UpdateCustomEquipmentSetModel(IEvent* event) { OnPlayerSetModels* ev = reinterpret_cast(event); (void)ev->modelGroup; - if (ev->player == nullptr || gPlayState == nullptr || ev->player != GET_PLAYER(gPlayState) || IsDummyPlayer(ev->player)) { + if (ev->player == nullptr || gPlayState == nullptr || ev->player != GET_PLAYER(gPlayState) || + IsDummyPlayer(ev->player)) { return; } diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index a47a404ad1d..2517c475a65 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -1224,8 +1224,9 @@ void ActorViewerWindow::InitElement() { } void ActorViewer_RegisterNameTagHooks() { - COND_HOOK(OnActorInit, CVAR_ACTOR_NAME_TAGS_ENABLED, - [](void* actor) { ActorViewer_AddTagForActor(static_cast(actor)); }); + COND_HOOK(OnActorInit, CVAR_ACTOR_NAME_TAGS_ENABLED, [](IEvent* event) { + ActorViewer_AddTagForActor(static_cast(reinterpret_cast(event)->actor)); + }); } static RegisterShipInitFunc initFunc(ActorViewer_RegisterNameTagHooks, { CVAR_ACTOR_NAME_TAGS_ENABLED_NAME }); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 6df4d4630ff..e7d892db9da 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -168,27 +168,37 @@ struct HookInfo { #define COND_HOOK(eventId, condition, body) \ { \ - static ListenerID listenerId = 0; \ - if (listenerId != 0) { \ + static ListenerID listenerId = -1; \ + if (listenerId != -1) { \ UNREGISTER_LISTENER(eventId, listenerId); \ - listenerId = 0; \ + listenerId = -1; \ } \ if (condition) { \ listenerId = REGISTER_LISTENER(eventId, EVENT_PRIORITY_LOW, body); \ } \ } -#define COND_ID_HOOK(eventId, id, condition, body) \ - { \ - static ListenerID listenerId = 0; \ - if (listenerId != 0) { \ - UNREGISTER_LISTENER(eventId, listenerId); \ - listenerId = 0; \ - } \ - if (condition) { \ - listenerId = REGISTER_VB_SHOULD(id, body); \ - } \ +#define COND_ID_HOOK(eventId, id, condition, body) \ + { \ + static ListenerID listenerId = -1; \ + if (listenerId != -1) { \ + UNREGISTER_LISTENER(eventId, listenerId); \ + listenerId = -1; \ + } \ + if (condition) { \ + listenerId = REGISTER_LISTENER(eventId, EVENT_PRIORITY_LOW, body); \ + } \ + } +#define COND_VB_SHOULD(id, condition, body) \ + { \ + static ListenerID listenerId = -1; \ + if (listenerId != -1) { \ + UNREGISTER_LISTENER(OnVanillaBehavior, listenerId); \ + listenerId = -1; \ + } \ + if (condition) { \ + listenerId = REGISTER_VB_SHOULD(id, body); \ + } \ } -#define COND_VB_SHOULD(flag, condition, body) COND_ID_HOOK(OnVanillaBehavior, flag, condition, body) class GameInteractor { public: diff --git a/soh/soh/Enhancements/randomizer/fishsanity.cpp b/soh/soh/Enhancements/randomizer/fishsanity.cpp index b16cb904d38..bcaf08fef3c 100644 --- a/soh/soh/Enhancements/randomizer/fishsanity.cpp +++ b/soh/soh/Enhancements/randomizer/fishsanity.cpp @@ -554,11 +554,11 @@ void RegisterShuffleFish() { } }); - COND_HOOK(OnActorInit, shouldRegister, [](IEvent* event){ + COND_HOOK(OnActorInit, shouldRegister, [](IEvent* event) { OnActorInit* ev = reinterpret_cast(event); Rando::Fishsanity::OnActorInitHandler(ev->actor); }); - COND_HOOK(OnActorUpdate, shouldRegister, [](IEvent* event){ + COND_HOOK(OnActorUpdate, shouldRegister, [](IEvent* event) { OnActorUpdate* ev = reinterpret_cast(event); Rando::Fishsanity::OnActorUpdateHandler(ev->actor); }); diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index ddaf878a8ed..bcfcf28e3c9 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -738,9 +738,9 @@ void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { // Animation Count should be no more than 1 to guarantee putaway is complete after giving the saw // As this is vanilla behavior, it only applies with the Fix toggle or Skip Text enabled. *ev->result = (CVarGetInteger(CVAR_ENHANCEMENT("FixSawSoftlock"), 0) != 0 || - CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0) - ? gPlayState->animationCtx.animationCount > 1 - : *ev->result; + CVarGetInteger(CVAR_ENHANCEMENT("SkipText"), 0) != 0) + ? gPlayState->animationCtx.animationCount > 1 + : *ev->result; break; case VB_BIGGORON_CONSIDER_SWORD_FORGED: *ev->result = Environment_GetBgsDayCount() >= CVarGetInteger(CVAR_ENHANCEMENT("ForgeTime"), 3); @@ -1408,7 +1408,8 @@ static void TimeSaverRegisterHooks() { { static ListenerID listenerId = -1; if (listenerId != -1) { - EventSystemUnregisterListener(OnLoadGameID, listenerId);; + EventSystemUnregisterListener(OnLoadGameID, listenerId); + ; listenerId = -1; } if (!IS_RANDO) { diff --git a/soh/soh/Network/Anchor/HookHandlers.cpp b/soh/soh/Network/Anchor/HookHandlers.cpp index f9a2971c4ff..ccd5aa2b5c6 100644 --- a/soh/soh/Network/Anchor/HookHandlers.cpp +++ b/soh/soh/Network/Anchor/HookHandlers.cpp @@ -70,7 +70,8 @@ void Anchor::RegisterHooks() { } }); - COND_HOOK(OnPresentFileSelect, isConnected, [](IEvent* event) { Anchor::Instance->SendPacket_UpdateClientState(); }); + COND_HOOK(OnPresentFileSelect, isConnected, + [](IEvent* event) { Anchor::Instance->SendPacket_UpdateClientState(); }); COND_ID_HOOK(ShouldActorInit, ACTOR_PLAYER, isConnected, [](IEvent* event) { Anchor* anchor = Anchor::Instance; @@ -108,11 +109,11 @@ void Anchor::RegisterHooks() { COND_HOOK(OnGameFrameUpdate, isConnected, [](IEvent* event) { Anchor::Instance->ProcessIncomingPacketQueue(); }); - COND_HOOK(OnPlayerSfx, isConnected, [](IEvent* event){ + COND_HOOK(OnPlayerSfx, isConnected, [](IEvent* event) { OnPlayerSfx* ev = reinterpret_cast(event); Anchor::Instance->SendPacket_PlayerSfx(ev->sfxId); }); - COND_HOOK(OnOcarinaNote, isConnected, [](IEvent* event){ + COND_HOOK(OnOcarinaNote, isConnected, [](IEvent* event) { OnOcarinaNote* ev = reinterpret_cast(event); Anchor::Instance->SendPacket_OcarinaSfx(ev->note, ev->modulator, ev->bend); }); @@ -126,7 +127,7 @@ void Anchor::RegisterHooks() { } }); - COND_HOOK(OnFlagSet, isConnected, [](IEvent* event){ + COND_HOOK(OnFlagSet, isConnected, [](IEvent* event) { OnFlagSet* ev = reinterpret_cast(event); Anchor::Instance->SendPacket_SetFlag(SCENE_ID_MAX, ev->flagType, ev->flag); }); @@ -136,7 +137,7 @@ void Anchor::RegisterHooks() { Anchor::Instance->SendPacket_UnsetFlag(SCENE_ID_MAX, ev->flagType, ev->flag); }); - COND_HOOK(OnSceneFlagSet, isConnected, [](IEvent* event){ + COND_HOOK(OnSceneFlagSet, isConnected, [](IEvent* event) { OnSceneFlagSet* ev = reinterpret_cast(event); Anchor::Instance->SendPacket_SetFlag(ev->sceneNum, ev->flagType, ev->flag); }); @@ -160,12 +161,13 @@ void Anchor::RegisterHooks() { } }); - COND_HOOK(OnRandoEntranceDiscovered, isConnected, [](IEvent* event){ + COND_HOOK(OnRandoEntranceDiscovered, isConnected, [](IEvent* event) { OnRandoEntranceDiscovered* ev = reinterpret_cast(event); Anchor::Instance->SendPacket_EntranceDiscovered(ev->entranceIndex); }); - COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, isConnected, [](IEvent* event) { Anchor::Instance->SendPacket_GameComplete(); }); + COND_ID_HOOK(OnBossDefeat, ACTOR_BOSS_GANON2, isConnected, + [](IEvent* event) { Anchor::Instance->SendPacket_GameComplete(); }); COND_HOOK(OnItemReceive, isConnected, [](IEvent* event) { OnItemReceive* ev = reinterpret_cast(event); diff --git a/soh/soh/Network/Sail/Sail.cpp b/soh/soh/Network/Sail/Sail.cpp index ddaf059c589..5e7ff9c9b3f 100644 --- a/soh/soh/Network/Sail/Sail.cpp +++ b/soh/soh/Network/Sail/Sail.cpp @@ -334,63 +334,68 @@ GameInteractionEffectBase* Sail::EffectFromJson(nlohmann::json payload) { } void Sail::RegisterHooks() { - COND_HOOK(OnTransitionEnd, isConnected, [&](int32_t sceneNum) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnTransitionEnd, isConnected, [](IEvent* event) { + OnTransitionEnd* transition = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnTransitionEnd"; - payload["hook"]["sceneNum"] = sceneNum; + payload["hook"]["sceneNum"] = transition->sceneNum; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnLoadGame, isConnected, [&](int32_t fileNum) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnLoadGame, isConnected, [](IEvent* event) { + OnLoadGame* load = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnLoadGame"; - payload["hook"]["fileNum"] = fileNum; + payload["hook"]["fileNum"] = load->fileNum; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnExitGame, isConnected, [&](int32_t fileNum) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnExitGame, isConnected, [](IEvent* event) { + OnExitGame* game = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnExitGame"; - payload["hook"]["fileNum"] = fileNum; + payload["hook"]["fileNum"] = game->fileNum; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnItemReceive, isConnected, [&](GetItemEntry itemEntry) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnItemReceive, isConnected, [](IEvent* event) { + OnItemReceive* item = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnItemReceive"; - payload["hook"]["tableId"] = itemEntry.tableId; - payload["hook"]["getItemId"] = itemEntry.getItemId; + payload["hook"]["tableId"] = item->itemEntry.tableId; + payload["hook"]["getItemId"] = item->itemEntry.getItemId; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnEnemyDefeat, isConnected, [&](void* refActor) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnEnemyDefeat, isConnected, [](IEvent* event) { + OnEnemyDefeat* ev = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; - Actor* actor = (Actor*)refActor; + Actor* actor = (Actor*)ev->actor; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; @@ -398,14 +403,15 @@ void Sail::RegisterHooks() { payload["hook"]["actorId"] = actor->id; payload["hook"]["params"] = actor->params; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnActorInit, isConnected, [&](void* refActor) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnActorInit, isConnected, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; - Actor* actor = (Actor*)refActor; + Actor* actor = (Actor*)ev->actor; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; @@ -413,60 +419,64 @@ void Sail::RegisterHooks() { payload["hook"]["actorId"] = actor->id; payload["hook"]["params"] = actor->params; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnFlagSet, isConnected, [&](int16_t flagType, int16_t flag) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnFlagSet, isConnected, [](IEvent* event) { + OnFlagSet* ev = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnFlagSet"; - payload["hook"]["flagType"] = flagType; - payload["hook"]["flag"] = flag; + payload["hook"]["flagType"] = ev->flagType; + payload["hook"]["flag"] = ev->flag; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnFlagUnset, isConnected, [&](int16_t flagType, int16_t flag) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnFlagUnset, isConnected, [](IEvent* event) { + OnFlagUnset* ev = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnFlagUnset"; - payload["hook"]["flagType"] = flagType; - payload["hook"]["flag"] = flag; + payload["hook"]["flagType"] = ev->flagType; + payload["hook"]["flag"] = ev->flag; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnSceneFlagSet, isConnected, [&](int16_t sceneNum, int16_t flagType, int16_t flag) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnSceneFlagSet, isConnected, [](IEvent* event) { + OnSceneFlagSet* ev = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnSceneFlagSet"; - payload["hook"]["flagType"] = flagType; - payload["hook"]["flag"] = flag; - payload["hook"]["sceneNum"] = sceneNum; + payload["hook"]["flagType"] = ev->flagType; + payload["hook"]["flag"] = ev->flag; + payload["hook"]["sceneNum"] = ev->sceneNum; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); - COND_HOOK(OnSceneFlagUnset, isConnected, [&](int16_t sceneNum, int16_t flagType, int16_t flag) { - if (!isConnected || !GameInteractor::IsSaveLoaded()) + COND_HOOK(OnSceneFlagUnset, isConnected, [](IEvent* event) { + OnSceneFlagUnset* ev = reinterpret_cast(event); + if (!Sail::Instance->isConnected || !GameInteractor::IsSaveLoaded()) return; nlohmann::json payload; payload["id"] = std::rand(); payload["type"] = "hook"; payload["hook"]["type"] = "OnSceneFlagUnset"; - payload["hook"]["flagType"] = flagType; - payload["hook"]["flag"] = flag; - payload["hook"]["sceneNum"] = sceneNum; + payload["hook"]["flagType"] = ev->flagType; + payload["hook"]["flag"] = ev->flag; + payload["hook"]["sceneNum"] = ev->sceneNum; - SendJsonToRemote(payload); + Sail::Instance->SendJsonToRemote(payload); }); } From 1d4fa1cb1cf9288e96f199fe1c295a993c4cbce2 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 15:12:15 -0600 Subject: [PATCH 03/31] Next batch of migrations --- soh/soh/Enhancements/InjectItemCounts.cpp | 15 +- .../Items/BetterBombchuShopping.cpp | 10 +- soh/soh/Enhancements/NoSkulltulaFreeze.cpp | 7 +- soh/soh/Enhancements/QoL/OpenAllHours.cpp | 5 +- soh/soh/Enhancements/SunlightArrows.cpp | 15 +- .../Enhancements/TimeSavers/MarketSneak.cpp | 5 +- .../TimeSavers/QuitFishingAtDoor.cpp | 5 +- .../SkipCutscene/Story/SkipBlueWarp.cpp | 5 +- .../Story/SkipZeldaFleeingCastle.cpp | 7 +- .../SkipChildRutoInteractions.cpp | 5 +- .../TimeSavers/SkipTimerDelay.cpp | 15 +- soh/soh/Enhancements/randomizer/BigPoes.cpp | 5 +- .../randomizer/LockOverworldDoors.cpp | 5 +- .../randomizer/MedallionLockedTrials.cpp | 5 +- .../randomizer/Messages/Goron.cpp | 5 +- .../randomizer/Messages/GossipStoneHints.cpp | 5 +- .../randomizer/Messages/ItemMessages.cpp | 20 ++- .../randomizer/Messages/MerchantMessages.cpp | 46 ++--- .../randomizer/Messages/Miscellaneous.cpp | 19 +- .../Enhancements/randomizer/Messages/Navi.cpp | 5 +- .../randomizer/Messages/Rupees.cpp | 7 +- .../randomizer/Messages/StaticHints.cpp | 162 ++++++++++-------- .../randomizer/ShuffleBeehives.cpp | 12 +- .../Enhancements/randomizer/ShuffleBeggar.cpp | 15 +- .../Enhancements/randomizer/ShuffleCrates.cpp | 14 +- .../Enhancements/randomizer/ShuffleGrass.cpp | 7 +- .../Enhancements/randomizer/ShufflePots.cpp | 7 +- .../Enhancements/randomizer/ShuffleSigns.cpp | 33 ++-- .../Enhancements/randomizer/ShuffleTrees.cpp | 7 +- .../randomizer/ShuffleWonderItems.cpp | 7 +- soh/soh/Network/Anchor/HookHandlers.cpp | 122 +++++++------ 31 files changed, 352 insertions(+), 250 deletions(-) diff --git a/soh/soh/Enhancements/InjectItemCounts.cpp b/soh/soh/Enhancements/InjectItemCounts.cpp index 8b33a9b648b..ab0689bb34b 100644 --- a/soh/soh/Enhancements/InjectItemCounts.cpp +++ b/soh/soh/Enhancements/InjectItemCounts.cpp @@ -4,7 +4,8 @@ extern "C" { #include "variables.h" } -void BuildSkulltulaMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildSkulltulaMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("You got a %rGold Skulltula Token%w!&You've collected %r[[gsCount]]%w tokens&in total!", "Ein %rGoldenes Skulltula-Symbol%w!&Du hast nun insgesamt %r[[gsCount]]&%wGoldene " @@ -28,10 +29,11 @@ void BuildSkulltulaMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.Replace("[[gsCount]]", std::to_string(gsCount)); msg.AutoFormat(ITEM_SKULL_TOKEN); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildHeartContainerMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildHeartContainerMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage( "You got a %rHeart Container%w!&You've collected %r[[heartContainerCount]]%w containers&in total!", "Ein %rHerzcontainer%w!&Du hast nun insgesamt %r[[heartContainerCount]]%w&Herzcontainer gesammelt!", @@ -39,10 +41,11 @@ void BuildHeartContainerMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.Replace("[[heartContainerCount]]", std::to_string(gSaveContext.ship.stats.heartContainers + 1)); msg.AutoFormat(ITEM_HEART_CONTAINER); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildHeartPieceMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildHeartPieceMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("You got a %rHeart Piece%w!&You've collected %r[[heartPieceCount]]%w pieces&in total!", "Ein %rHerzteil%w!&Du hast nun insgesamt %r[[heartPieceCount]]%w&Herzteile gesammelt!", @@ -51,7 +54,7 @@ void BuildHeartPieceMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.Replace("[[heartPieceCount]]", std::to_string(gSaveContext.ship.stats.heartPieces + 1)); msg.AutoFormat(ITEM_HEART_PIECE); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void InjectSkulltulaCounts_Register() { diff --git a/soh/soh/Enhancements/Items/BetterBombchuShopping.cpp b/soh/soh/Enhancements/Items/BetterBombchuShopping.cpp index 90989ed2462..cb2bc65d8a7 100644 --- a/soh/soh/Enhancements/Items/BetterBombchuShopping.cpp +++ b/soh/soh/Enhancements/Items/BetterBombchuShopping.cpp @@ -6,7 +6,8 @@ extern "C" { // RANDOTODO: Port the rest of the behavior associated with this option here. -void BuildShopDescMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildShopDescMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("\x08%rBombchu 10 pieces 99 Rupees&%wThis looks like a toy mouse, but&it's actually a " "self-propelled time&bomb!\x09\x0A", @@ -16,16 +17,17 @@ void BuildShopDescMessage(uint16_t* textId, bool* loadFromMessageTable) { "&destructrice!!!\x09\x0A"); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildShopPromptMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildShopPromptMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("\010Bombchu 10 pieces 99 Rupees\x09&&\x1B%gBuy&Don't buy%w", "\010Krabbelmine 10 Stück 99 Rubine\x09&&\x1B%gKaufen!&Nicht kaufen!%w", "\010Missiles 10 unités 99 Rubis\x09&&\x1B%gAcheter&Ne pas acheter%w"); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void BetterBombchuShopping_Register() { diff --git a/soh/soh/Enhancements/NoSkulltulaFreeze.cpp b/soh/soh/Enhancements/NoSkulltulaFreeze.cpp index abefde2b56c..946c04e2111 100644 --- a/soh/soh/Enhancements/NoSkulltulaFreeze.cpp +++ b/soh/soh/Enhancements/NoSkulltulaFreeze.cpp @@ -4,12 +4,13 @@ extern "C" { #include "variables.h" } -void AutoDismissSkulltulaMessage(uint16_t* textId, bool* loadFromMessageTable) { +void AutoDismissSkulltulaMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_TOKENS)) { - *loadFromMessageTable = true; + *ev->loadFromMessageTable = true; return; } - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; CustomMessage msg = CustomMessage::LoadVanillaMessageTableEntry(TEXT_GS_FREEZE); msg.Replace(CustomMessage::MESSAGE_END(), "\x0E\x3C"); msg += CustomMessage::MESSAGE_END(); diff --git a/soh/soh/Enhancements/QoL/OpenAllHours.cpp b/soh/soh/Enhancements/QoL/OpenAllHours.cpp index b46db53c374..bbc2ee19986 100644 --- a/soh/soh/Enhancements/QoL/OpenAllHours.cpp +++ b/soh/soh/Enhancements/QoL/OpenAllHours.cpp @@ -23,8 +23,9 @@ static constexpr int32_t DOOR_NIGHT_KAK_BAZAAR = 6801; static constexpr int32_t DOOR_NIGHT_KAK_POTION_SHOP = 7822; static constexpr int32_t DOOR_NIGHT_KAK_POTION_SHOP_BACK = 8846; -static void OpenAllHours(void* refActor) { - EnDoor* enDoor = static_cast(refActor); +static void OpenAllHours(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnDoor* enDoor = static_cast(ev->actor); s16* params = &enDoor->actor.params; switch (*params) { diff --git a/soh/soh/Enhancements/SunlightArrows.cpp b/soh/soh/Enhancements/SunlightArrows.cpp index 73e894c2454..905c9bfd95d 100644 --- a/soh/soh/Enhancements/SunlightArrows.cpp +++ b/soh/soh/Enhancements/SunlightArrows.cpp @@ -43,14 +43,16 @@ void RegisterSunlightArrowsHooks() { bool shouldRegister = CVarGetInteger(CVAR_ENHANCEMENT("SunlightArrows"), 0) || (IS_RANDO && RAND_GET_OPTION(RSK_SUNLIGHT_ARROWS)); - COND_ID_HOOK(OnActorInit, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](void* actor) { - auto* thisx = (ObjLightswitch*)actor; + COND_ID_HOOK(OnActorInit, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + auto* thisx = (ObjLightswitch*)ev->actor; Collider_SetJntSph(gPlayState, &thisx->collider, &thisx->actor, &sColliderLightArrowInit, thisx->colliderItems); Collider_UpdateSpheres(0, &thisx->collider); }); - COND_ID_HOOK(OnActorDestroy, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](void* actor) { - auto* thisx = (ObjLightswitch*)actor; + COND_ID_HOOK(OnActorDestroy, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](IEvent* event) { + OnActorDestroy* ev = reinterpret_cast(event); + auto* thisx = (ObjLightswitch*)ev->actor; auto sunData = ObjectExtension::GetInstance().Get(&thisx->actor); if (sunData != nullptr && sunData->activatedByLightArrow) { @@ -80,8 +82,9 @@ void RegisterSunlightArrowsHooks() { } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](void* actorPtr, bool* result) { - ObjLightswitch* thisx = (ObjLightswitch*)actorPtr; + COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + ObjLightswitch* thisx = (ObjLightswitch*)ev->actor; if ((thisx->collider.base.acFlags & AC_HIT) && thisx->collider.base.ac != nullptr) { auto sunData = ObjectExtension::GetInstance().Get(&thisx->actor); if (sunData == nullptr) { diff --git a/soh/soh/Enhancements/TimeSavers/MarketSneak.cpp b/soh/soh/Enhancements/TimeSavers/MarketSneak.cpp index a8b190bf119..09bc4ff802e 100644 --- a/soh/soh/Enhancements/TimeSavers/MarketSneak.cpp +++ b/soh/soh/Enhancements/TimeSavers/MarketSneak.cpp @@ -7,7 +7,8 @@ extern PlayState* gPlayState; // RANDOTODO: Port the rest of the behavior for this enhancement here. -void BuildNightGuardMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildNightGuardMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); // Other guards should not have their text overridden if (gPlayState->sceneNum != SCENE_MARKET_ENTRANCE_NIGHT) { return; @@ -18,7 +19,7 @@ void BuildNightGuardMessage(uint16_t* textId, bool* loadFromMessageTable) { "Tu as l'air de t'ennuyer. Tu veux aller faire un tour?\x1B%gOui&Non%w"); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void MarketSneak_Register() { diff --git a/soh/soh/Enhancements/TimeSavers/QuitFishingAtDoor.cpp b/soh/soh/Enhancements/TimeSavers/QuitFishingAtDoor.cpp index 3d408a05662..f5124c98949 100644 --- a/soh/soh/Enhancements/TimeSavers/QuitFishingAtDoor.cpp +++ b/soh/soh/Enhancements/TimeSavers/QuitFishingAtDoor.cpp @@ -6,9 +6,10 @@ extern "C" { // TODO: Port the rest of the behavior for this enhancement here. -void BuildQuitFishingMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildQuitFishingMessage(IEvent* event) { // TODO: See about loading the vanilla message and manipulating that instead of // a brand new one. Might not be worth it. + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage( "Hey! Hey!&You can't take the rod out of here!&I'm serious!^Do you want to quit?\x1B%gYes&No%w", "Hey! Hey!&Du kannst die Angel doch nicht&einfach mitnehmen!&Ganz im Ernst!^Möchtest Du " @@ -16,7 +17,7 @@ void BuildQuitFishingMessage(uint16_t* textId, bool* loadFromMessageTable) { "Holà! Holà!&Les cannes ne sortent pas d'ici!&Je suis sérieux!^Voulez-vous arrêter?\x1B%gOui&Non%w"); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void QuitFishingAtDoor_Register() { diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index 0ade592d64b..4a8ab95d83b 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -35,8 +35,9 @@ void EnKo_MoveWhenReady(EnKo* enKo, PlayState* play) { } } -void SkipBlueWarp_OnActorUpdate(void* actorPtr) { - EnKo* enKo = static_cast(actorPtr); +void SkipBlueWarp_OnActorUpdate(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + EnKo* enKo = static_cast(ev->actor); if ((enKo->actor.params & 0xFF) == ENKO_TYPE_CHILD_3 && enKo->actionFunc == func_80A995CC) { enKo->actionFunc = EnKo_MoveWhenReady; diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp index ae82ff9f0f3..77022689638 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp @@ -30,13 +30,14 @@ void SkipZeldaFleeingCastle_OnActorUpdate(void* actorPtr) { } } -void SkipZeldaFleeingCastle_OnActorInit(void* actorPtr) { - Actor* actor = static_cast(actorPtr); +void SkipZeldaFleeingCastle_OnActorInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); if (actor->params == 3) { framesSinceSpawn = 0; itemOcarinaUpdateHook = GameInteractor::Instance->RegisterGameHookForPtr( - (uintptr_t)actorPtr, SkipZeldaFleeingCastle_OnActorUpdate); + (uintptr_t)ev->actor, SkipZeldaFleeingCastle_OnActorUpdate); sceneInitHook = GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { GameInteractor::Instance->UnregisterGameHookForPtr(itemOcarinaUpdateHook); GameInteractor::Instance->UnregisterGameHook(sceneInitHook); diff --git a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp index 417c31afb59..eedf56b1765 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp @@ -9,12 +9,13 @@ extern "C" { Actor* func_80AEB124(PlayState* play); } -void Ru1Init(void* actorRef) { +void Ru1Init(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); if (IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_SPEAK) && !Flags_GetRandomizerInf(RAND_INF_CAN_SPEAK_ZORA)) { return; } - EnRu1* enRu1 = static_cast(actorRef); + EnRu1* enRu1 = static_cast(ev->actor); if (enRu1->action == 22) { enRu1->action = 27; diff --git a/soh/soh/Enhancements/TimeSavers/SkipTimerDelay.cpp b/soh/soh/Enhancements/TimeSavers/SkipTimerDelay.cpp index 733d420fd2a..37fe903d9bf 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipTimerDelay.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipTimerDelay.cpp @@ -13,26 +13,29 @@ extern PlayState* gPlayState; static void RegisterSkipTimerDelay() { // Skip Water Temple gate delay - COND_ID_HOOK(OnActorUpdate, ACTOR_BG_SPOT06_OBJECTS, SKIP_MISC_INTERACTIONS_VALUE, [](void* actor) { - auto spot06 = static_cast(actor); + COND_ID_HOOK(OnActorUpdate, ACTOR_BG_SPOT06_OBJECTS, SKIP_MISC_INTERACTIONS_VALUE, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + auto spot06 = static_cast(ev->actor); if (spot06->dyna.actor.params == 0) { spot06->timer = 0; } }); // Skip Spirit Sun on Floor activation delay - COND_ID_HOOK(OnActorUpdate, ACTOR_BG_JYA_BOMBCHUIWA, SKIP_MISC_INTERACTIONS_VALUE, [](void* actor) { - auto jya = static_cast(actor); + COND_ID_HOOK(OnActorUpdate, ACTOR_BG_JYA_BOMBCHUIWA, SKIP_MISC_INTERACTIONS_VALUE, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + auto jya = static_cast(ev->actor); if (!(jya->drawFlags & 4) && jya->timer > 0 && jya->timer < 9) { jya->timer = 9; } }); // Skip Spirit Sun on Floor & Sun on Block activation delay - COND_ID_HOOK(OnActorUpdate, ACTOR_OBJ_LIGHTSWITCH, SKIP_MISC_INTERACTIONS_VALUE, [](void* actor) { + COND_ID_HOOK(OnActorUpdate, ACTOR_OBJ_LIGHTSWITCH, SKIP_MISC_INTERACTIONS_VALUE, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); if (gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE && (gPlayState->roomCtx.curRoom.num == 4 || gPlayState->roomCtx.curRoom.num == 8)) { - auto sun = static_cast(actor); + auto sun = static_cast(ev->actor); sun->toggleDelay = 0; } }); diff --git a/soh/soh/Enhancements/randomizer/BigPoes.cpp b/soh/soh/Enhancements/randomizer/BigPoes.cpp index e83b1967559..3933915b071 100644 --- a/soh/soh/Enhancements/randomizer/BigPoes.cpp +++ b/soh/soh/Enhancements/randomizer/BigPoes.cpp @@ -7,10 +7,11 @@ extern "C" { extern PlayState* gPlayState; } -void BuildBigPoeCollectedMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildBigPoeCollectedMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("You have #" + CustomMessage::POINTS("\x01") + "# points.", { QM_RED }); msg.AutoFormat(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; msg.LoadIntoFont(); } diff --git a/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp b/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp index fe934456c48..d81b7c0f480 100644 --- a/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp +++ b/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp @@ -63,8 +63,9 @@ std::map lookupTable = { // clang-format on }; -static void OnDoorInit(void* actorRef) { - EnDoor* enDoor = static_cast(actorRef); +static void OnDoorInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnDoor* enDoor = static_cast(ev->actor); enDoor->randomizerInf = RAND_INF_MAX; auto it = lookupTable.find({ gPlayState->sceneNum, enDoor->actor.params }); diff --git a/soh/soh/Enhancements/randomizer/MedallionLockedTrials.cpp b/soh/soh/Enhancements/randomizer/MedallionLockedTrials.cpp index 1c769d9e9ce..3ca3f0eb751 100644 --- a/soh/soh/Enhancements/randomizer/MedallionLockedTrials.cpp +++ b/soh/soh/Enhancements/randomizer/MedallionLockedTrials.cpp @@ -8,9 +8,10 @@ void DoorShutter_SetupAction(DoorShutter*, DoorShutterActionFunc); void DoorShutter_SetupType(DoorShutter*, PlayState*); } -static void OnDoorInit(void* actorRef) { +static void OnDoorInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); if (gPlayState->sceneNum == SCENE_INSIDE_GANONS_CASTLE) { - DoorShutter* door = static_cast(actorRef); + DoorShutter* door = static_cast(ev->actor); bool barred = false; switch (door->dyna.actor.params) { case 8255: diff --git a/soh/soh/Enhancements/randomizer/Messages/Goron.cpp b/soh/soh/Enhancements/randomizer/Messages/Goron.cpp index 9515890c08d..dffd3b9c2eb 100644 --- a/soh/soh/Enhancements/randomizer/Messages/Goron.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/Goron.cpp @@ -82,13 +82,14 @@ static CustomMessage FireTempleGoronMessages[] = { }, }; -void BuildGoronMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildGoronMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = ShipUtils::RandomElement(FireTempleGoronMessages); msg.Replace("[[days]]", std::to_string(gSaveContext.totalDays)); msg.Replace("[[a_btn]]", std::to_string(gSaveContext.ship.stats.count[COUNT_BUTTON_PRESSES_A])); msg.Format(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void RegisterGoronMessages() { diff --git a/soh/soh/Enhancements/randomizer/Messages/GossipStoneHints.cpp b/soh/soh/Enhancements/randomizer/Messages/GossipStoneHints.cpp index 7e2a2e193a2..95c57b34d32 100644 --- a/soh/soh/Enhancements/randomizer/Messages/GossipStoneHints.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/GossipStoneHints.cpp @@ -11,7 +11,8 @@ extern PlayState* gPlayState; #include } -void BuildHintStoneMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildHintStoneMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if ((RAND_GET_OPTION(RSK_GOSSIP_STONE_HINTS).Is(RO_GOSSIP_STONES_NEED_TRUTH) && Player_GetMask(gPlayState) == PLAYER_MASK_TRUTH) || (RAND_GET_OPTION(RSK_GOSSIP_STONE_HINTS).Is(RO_GOSSIP_STONES_NEED_STONE) && @@ -48,7 +49,7 @@ void BuildHintStoneMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.Replace(" kaufen ", ""); msg.Replace(" kaufen", ""); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void RegisterGossipStoneHints() { diff --git a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp index cd1ae016927..bc1493b30d7 100644 --- a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp @@ -141,7 +141,8 @@ void DrawCustomItemIcon(Gfx** p) { *p = gfx; } -void BuildItemMessage(u16* textId, bool* loadFromMessageTable) { +void BuildItemMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); Player* player = GET_PLAYER(gPlayState); CustomMessage msg; @@ -152,11 +153,12 @@ void BuildItemMessage(u16* textId, bool* loadFromMessageTable) { } else { BuildCustomItemMessage(player, msg); } - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; msg.LoadIntoFont(); } -void BuildMapMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildMapMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); GetItemEntry itemEntry = GET_PLAYER(gPlayState)->getItemEntry; auto ctx = OTRGlobals::Instance->gRandoContext; CustomMessage msg = @@ -207,12 +209,13 @@ void BuildMapMessage(uint16_t* textId, bool* loadFromMessageTable) { } else { msg.Replace("[[typeHint]]", Rando::StaticData::hintTextTable[RHT_DUNGEON_ORDINARY].GetHintMessage()); } - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; msg.AutoFormat(ITEM_DUNGEON_MAP); msg.LoadIntoFont(); } -void BuildBossKeyMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildBossKeyMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); Player* player = GET_PLAYER(gPlayState); if (player->getItemEntry.getItemId == RG_GANONS_CASTLE_BOSS_KEY && !DUNGEON_ITEMS_CAN_BE_OUTSIDE_DUNGEON(RSK_GANONS_BOSS_KEY)) { @@ -224,11 +227,12 @@ void BuildBossKeyMessage(uint16_t* textId, bool* loadFromMessageTable) { } CustomMessage msg; BuildCustomItemMessage(player, msg); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; msg.LoadIntoFont(); } -void BuildSmallKeyMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildSmallKeyMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); Player* player = GET_PLAYER(gPlayState); if (player->getItemEntry.getItemId == RG_GERUDO_FORTRESS_SMALL_KEY && OTRGlobals::Instance->gRandoContext->GetOption(RSK_GERUDO_KEYS).Is(RO_GERUDO_KEYS_VANILLA)) { @@ -240,7 +244,7 @@ void BuildSmallKeyMessage(uint16_t* textId, bool* loadFromMessageTable) { } CustomMessage msg; BuildCustomItemMessage(player, msg); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; msg.LoadIntoFont(); } diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index 9245d6d6aff..fb97c87c35c 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -42,9 +42,10 @@ void BuildMerchantMessage(CustomMessage& msg, RandomizerCheck rc, bool mysteriou msg.InsertNames({ itemName, CustomMessage(std::to_string(price)) }); } -void BuildBeanGuyMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildBeanGuyMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; - if (*textId == TEXT_BEAN_SALESMAN_BUY_FOR_100) { + if (*ev->textId == TEXT_BEAN_SALESMAN_BUY_FOR_100) { msg = CustomMessage( "I never thought I'd say this, but I'm selling the last %rMagic Bean%w.^%y99 Rupees%w, no " "less.\x1B%gYes&No%w", @@ -52,7 +53,7 @@ void BuildBeanGuyMessage(uint16_t* textId, bool* loadFromMessageTable) { "Rubine%w.\x1B%gJa&Nein%w", "Je te vends mon dernier %rHaricot&magique%w pour %y99 Rubis%w.\x1B%gAcheter&Ne pas acheter%w"); msg.AutoFormat(); - } else if (*textId == TEXT_BEAN_SALESMAN_BUY_FOR_10) { + } else if (*ev->textId == TEXT_BEAN_SALESMAN_BUY_FOR_10) { msg = CustomMessage("Want to buy [[color]][[1]]%w for %y[[2]] Rupees%w?\x1B%gYes&No%w", "Möchten Sie [[color]][[1]]%w für %y[[2]] Rubin%w kaufen?\x1B%gJa&Nein%w", "Voulez-vous acheter [[color]][[1]]%w pour %y[[2]] Rubis%w?\x1B%gOui&Non%w"); @@ -62,10 +63,11 @@ void BuildBeanGuyMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.AutoFormat(); } msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildMedigoronMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildMedigoronMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("Want to buy [[color]][[1]]%w for %y[[2]] Rupees%w?\x1B%gYes&No%w", "Möchten Sie [[color]][[1]]%w für %y[[2]] Rubin%w kaufen?\x1B%gJa&Nein%w", "Voulez-vous acheter [[color]][[1]]%w pour %y[[2]] Rubis%w?\x1B%gOui&Non%w"); @@ -74,10 +76,11 @@ void BuildMedigoronMessage(uint16_t* textId, bool* loadFromMessageTable) { CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildGrannyMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildGrannyMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!Flags_GetRandomizerInf(RAND_INF_MERCHANTS_GRANNYS_SHOP) && (RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE) || INV_CONTENT(ITEM_CLAIM_CHECK) == ITEM_CLAIM_CHECK)) { CustomMessage msg = CustomMessage("Want to buy [[color]][[1]]%w for %y[[2]] Rupees%w?\x1B%gYes&No%w", @@ -88,13 +91,14 @@ void BuildGrannyMessage(uint16_t* textId, bool* loadFromMessageTable) { CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } } -void BuildCarpetGuyMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildCarpetGuyMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; - if (*textId == TEXT_CARPET_SALESMAN_ARMS_DEALER) { + if (*ev->textId == TEXT_CARPET_SALESMAN_ARMS_DEALER) { msg = CustomMessage("Finally! Now I can go back to being an %rarms dealer%w!", /*german*/ "Endlich! Schon bald kann ich wieder %rKrabbelminen-Händler%w sein!", /*french*/ "Squalala! Je vais enfin pouvoir %rprendre des vacances%w!"); @@ -108,19 +112,21 @@ void BuildCarpetGuyMessage(uint16_t* textId, bool* loadFromMessageTable) { } msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildCarpetGuyFailToBuyMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildCarpetGuyFailToBuyMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("I'm sorry I can't sell you these fine specimens, they need an %rexperienced owner%w.^" "Come back when you have had %gBombchus%w of your own."); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildScrubMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildScrubMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); EnDns* enDns = reinterpret_cast(GET_PLAYER(gPlayState)->talkActor); RandomizerCheck rc = ObjectExtension::GetInstance().Get(enDns)->identity.randomizerCheck; uint16_t price = RAND_GET_ITEM(rc)->GetPrice(); @@ -150,7 +156,7 @@ void BuildScrubMessage(uint16_t* textId, bool* loadFromMessageTable) { CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void BuildShopMessage(IEvent* event) { @@ -162,16 +168,16 @@ void BuildShopMessage(IEvent* event) { // Shop items each have two message entries, second one offset by NUM_SHOP_ITEMS // textId: TEXT_SHOP_ITEM_RANDOM + (randomizerInf - RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1) // textId: TEXT_SHOP_ITEM_RANDOM + ((randomizerInf - RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1) + NUM_SHOP_ITEMS) - if (*textId >= TEXT_SHOP_ITEM_RANDOM && *textId < TEXT_SHOP_ITEM_RANDOM_CONFIRM) { + if (*ev->textId >= TEXT_SHOP_ITEM_RANDOM && *ev->textId < TEXT_SHOP_ITEM_RANDOM_CONFIRM) { rc = OTRGlobals::Instance->gRandomizer->GetCheckFromRandomizerInf( - static_cast((*textId - TEXT_SHOP_ITEM_RANDOM) + RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1)); + static_cast((*ev->textId - TEXT_SHOP_ITEM_RANDOM) + RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1)); msg = CustomMessage("\x08[[color]][[1]]%w %y[[2]]_Rupees%w&Special deal! %rONE LEFT%w!\x0A\x02", "\x08[[color]][[1]]%w %y[[2]]_Rubine%w&Sonderangebot! %rNUR NOCH EINES VERFÜGBAR%w!\x0A\x02", "\x08[[color]][[1]]%w %y[[2]]_Rubis%w&Offre spéciale! %rDERNIER EN STOCK%w!\x0A\x02"); - } else if (*textId >= TEXT_SHOP_ITEM_RANDOM_CONFIRM && *textId <= TEXT_SHOP_ITEM_RANDOM_CONFIRM_END) { + } else if (*ev->textId >= TEXT_SHOP_ITEM_RANDOM_CONFIRM && *ev->textId <= TEXT_SHOP_ITEM_RANDOM_CONFIRM_END) { rc = OTRGlobals::Instance->gRandomizer->GetCheckFromRandomizerInf( - static_cast((*textId - TEXT_SHOP_ITEM_RANDOM_CONFIRM) + RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1)); + static_cast((*ev->textId - TEXT_SHOP_ITEM_RANDOM_CONFIRM) + RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1)); msg = CustomMessage("\x08[[color]][[1]]%w %y[[2]]_Rupees%w\x09\x1B%gBuy&Don't buy%w\x09\x02", "\x08[[color]][[1]]%w %y[[2]]_Rubine%w\x09\x1B%gKaufen&Nicht kaufen%w\x09\x02", "\x08[[color]][[1]]%w %y[[2]]_Rubis%w\x09\x1B%gAcheter&Ne pas acheter%w\x09\x02"); @@ -181,7 +187,7 @@ void BuildShopMessage(IEvent* event) { BuildMerchantMessage(msg, rc, CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0)); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void RegisterMerchantMessages() { diff --git a/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp b/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp index 1393c00c8ee..1bd8f1f6e05 100644 --- a/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/Miscellaneous.cpp @@ -12,35 +12,38 @@ extern "C" { extern PlayState* gPlayState; } -void BuildWaterSwitchMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildWaterSwitchMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; - if (*textId == TEXT_LAKE_HYLIA_WATER_SWITCH_NAVI) { + if (*ev->textId == TEXT_LAKE_HYLIA_WATER_SWITCH_NAVI) { msg = CustomMessage("%cThis switch is rustier than you think.^%cSomething must be wrong with the pipe system " "in the %bWater Temple%c.", "%cDieser Schalter scheint rostiger zu sein als er aussieht.^%cEtwas muss mit dem " "Leitungssystem im %bWassertempel%c nicht stimmen.", "%cCet interrupteur est très rouillé.^%cIl doit y avoir un problème avec la tuyauterie du " "%bTemple de l'Eau%c."); - } else if (*textId == TEXT_LAKE_HYLIA_WATER_SWITCH_SIGN) { + } else if (*ev->textId == TEXT_LAKE_HYLIA_WATER_SWITCH_SIGN) { msg = CustomMessage("Water level control system.&Keep away!", "Wasserstand Kontrollsystem&Finger weg!", "Système de contrôle du niveau&d'eau.&Ne pas toucher!"); } msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildShootingGalleryNoBowMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildShootingGalleryNoBowMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("Come back when you have your own bow and you'll get a %rdifferent prize%w!", "Komm wieder sobald Du Deinen eigenen Bogen hast, um einen %rspeziellen Preis%w zu erhalten!", "J'aurai %rune autre récompense%w pour toi lorsque tu auras ton propre arc."); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildFixedMallonAtCastleMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildFixedMallonAtCastleMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (gPlayState->sceneNum == SCENE_HYRULE_CASTLE) { CustomMessage msg = CustomMessage( "Looks like my dad already went back to the %rranch%w. You should come visit sometime!", @@ -48,7 +51,7 @@ void BuildFixedMallonAtCastleMessage(uint16_t* textId, bool* loadFromMessageTabl "On dirait que père est déjà rentré au %rranch%w. Tu devrais nous rendre visite à l'occasion!"); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } } diff --git a/soh/soh/Enhancements/randomizer/Messages/Navi.cpp b/soh/soh/Enhancements/randomizer/Messages/Navi.cpp index e03f16d306d..bcbd638ab1b 100644 --- a/soh/soh/Enhancements/randomizer/Messages/Navi.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/Navi.cpp @@ -111,11 +111,12 @@ static CustomMessage NaviMessages[] = { "Ils&sont efficaces contre tes ennemis!" } }; -void BuildNaviMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildNaviMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = ShipUtils::RandomElement(NaviMessages); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void RegisterNaviMessages() { diff --git a/soh/soh/Enhancements/randomizer/Messages/Rupees.cpp b/soh/soh/Enhancements/randomizer/Messages/Rupees.cpp index 712f15d56ee..018b2422ce2 100644 --- a/soh/soh/Enhancements/randomizer/Messages/Rupees.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/Rupees.cpp @@ -328,7 +328,8 @@ static const char* frenchRupeeNames[] = { "Pièces", "Plastyks", "Pokédollars", "Pokémon", "Radis", "Rubis", "Zennies", }; -void BuildRupeeMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildRupeeMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("You found [[color]][[amount]] [[rupee]]%w!", "Du hast [[color]][[amount]] [[rupee]]%w gefunden!", "Vous obtenez [[color]][[amount]] [[rupee]]%w!"); @@ -337,7 +338,7 @@ void BuildRupeeMessage(uint16_t* textId, bool* loadFromMessageTable) { CustomMessage rupee = CustomMessage(ShipUtils::RandomElement(englishRupeeNames), ShipUtils::RandomElement(germanRupeeNames), ShipUtils::RandomElement(frenchRupeeNames)); - switch (*textId) { + switch (*ev->textId) { case TEXT_BLUE_RUPEE: color = "%b"; amount = "5"; @@ -363,7 +364,7 @@ void BuildRupeeMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.Replace("[[rupee]]", rupee); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void RegisterRandomRupeeNames() { diff --git a/soh/soh/Enhancements/randomizer/Messages/StaticHints.cpp b/soh/soh/Enhancements/randomizer/Messages/StaticHints.cpp index 6f163c58d7b..2ef7e92da11 100644 --- a/soh/soh/Enhancements/randomizer/Messages/StaticHints.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/StaticHints.cpp @@ -23,7 +23,8 @@ extern PlayState* gPlayState; RAND_GET_OPTION(RSK_KAK_30_SKULLS_HINT) || RAND_GET_OPTION(RSK_KAK_40_SKULLS_HINT) || \ RAND_GET_OPTION(RSK_KAK_50_SKULLS_HINT) -void BuildGanondorfHint(uint16_t* textId, bool* loadFromMessageTable) { +void BuildGanondorfHint(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; if (RAND_GET_OPTION(RSK_SHUFFLE_MASTER_SWORD) && !CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER)) { if (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) { @@ -39,10 +40,11 @@ void BuildGanondorfHint(uint16_t* textId, bool* loadFromMessageTable) { } } msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildSheikMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildSheikMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; switch (gPlayState->sceneNum) { case SCENE_TEMPLE_OF_TIME: @@ -92,22 +94,25 @@ void BuildSheikMessage(uint16_t* textId, bool* loadFromMessageTable) { } msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildChildAltarMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildChildAltarMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_ALTAR_CHILD)->GetHintMessage(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildAdultAltarMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildAdultAltarMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_ALTAR_ADULT)->GetHintMessage(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildSkulltulaPeopleMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildSkulltulaPeopleMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); uint8_t count = 0; RandomizerCheck rc = RC_UNKNOWN_CHECK; int16_t actorParams = GET_PLAYER(gPlayState)->talkActor->params; @@ -143,10 +148,11 @@ void BuildSkulltulaPeopleMessage(uint16_t* textId, bool* loadFromMessageTable) { msg.InsertNames({ item.GetName() }); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void Build100SkullsHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void Build100SkullsHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = CustomMessage("Yeaaarrgh! I'm cursed!!^Please save me by destroying %y100 Spiders of the " "Curse%w and I will give you my [[color]][[1]]%w!", /*german*/ @@ -163,20 +169,22 @@ void Build100SkullsHintMessage(uint16_t* textId, bool* loadFromMessageTable) { .GetName() }); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildDampesDiaryMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildDampesDiaryMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_DAMPES_DIARY)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildGregHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildGregHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (gPlayState->sceneNum == SCENE_TREASURE_BOX_SHOP) { CustomMessage msg = RAND_GET_HINT(RH_GREG_RUPEE)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } } @@ -188,85 +196,94 @@ void BuildMysteriousWarpMessage() { msg.LoadIntoFont(); } -void BuildMinuetWarpMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildMinuetWarpMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!RAND_GET_OPTION(RSK_WARP_SONG_HINTS)) { BuildMysteriousWarpMessage(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; return; } CustomMessage msg = RAND_GET_HINT(RH_MINUET_WARP_LOC)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildBoleroWarpMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildBoleroWarpMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!RAND_GET_OPTION(RSK_WARP_SONG_HINTS)) { BuildMysteriousWarpMessage(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; return; } CustomMessage msg = RAND_GET_HINT(RH_BOLERO_WARP_LOC)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildSerenadeWarpMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildSerenadeWarpMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!RAND_GET_OPTION(RSK_WARP_SONG_HINTS)) { BuildMysteriousWarpMessage(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; return; } CustomMessage msg = RAND_GET_HINT(RH_SERENADE_WARP_LOC)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildRequiemWarpMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildRequiemWarpMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!RAND_GET_OPTION(RSK_WARP_SONG_HINTS)) { BuildMysteriousWarpMessage(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; return; } CustomMessage msg = RAND_GET_HINT(RH_REQUIEM_WARP_LOC)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildNocturneWarpMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildNocturneWarpMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!RAND_GET_OPTION(RSK_WARP_SONG_HINTS)) { BuildMysteriousWarpMessage(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; return; } CustomMessage msg = RAND_GET_HINT(RH_NOCTURNE_WARP_LOC)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildPreludeWarpMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildPreludeWarpMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!RAND_GET_OPTION(RSK_WARP_SONG_HINTS)) { BuildMysteriousWarpMessage(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; return; } CustomMessage msg = RAND_GET_HINT(RH_PRELUDE_WARP_LOC)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildFrogsHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildFrogsHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_FROGS_HINT)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildLoachHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildLoachHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_LOACH_HINT)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildFishingPoleHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildFishingPoleHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (Flags_GetRandomizerInf(RAND_INF_FISHING_POLE_FOUND)) { return; } @@ -278,7 +295,7 @@ void BuildFishingPoleHintMessage(uint16_t* textId, bool* loadFromMessageTable) { if (RAND_GET_OPTION(RSK_FISHING_POLE_HINT)) { msg = msg + RAND_GET_HINT(RH_FISHING_POLE)->GetHintMessage(); } - if (*textId == TEXT_FISHING_POND_START_MET) { + if (*ev->textId == TEXT_FISHING_POND_START_MET) { msg = CustomMessage("Hey, mister! I remember you!&It's been a long time!^", "Hallo, mein Herr! Ich erinnere mich an Sie!&Lang ist's her!", "Hé, monsieur! Je me souviens de toi!&Ça fait longtemps!") + @@ -286,54 +303,60 @@ void BuildFishingPoleHintMessage(uint16_t* textId, bool* loadFromMessageTable) { } msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildSariaMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildSariaMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; - if (*textId == TEXT_SARIA_SFM) { + if (*ev->textId == TEXT_SARIA_SFM) { msg = RAND_GET_HINT(RH_SARIA_HINT)->GetHintMessage(MF_AUTO_FORMAT, 0); } else { msg = RAND_GET_HINT(RH_SARIA_HINT)->GetHintMessage(MF_AUTO_FORMAT, 1); } msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildMidoMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildMidoMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_MIDO_HINT)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildBiggoronHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildBiggoronHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_BIGGORON_HINT)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildBigPoesHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildBigPoesHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_BIG_POES_HINT)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildChickensHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildChickensHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_CHICKENS_HINT)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildMalonHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildMalonHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; int id; - if (*textId == TEXT_MALON_EVERYONE_TURNING_EVIL || *textId == TEXT_MALON_I_SING_THIS_SONG) { + if (*ev->textId == TEXT_MALON_EVERYONE_TURNING_EVIL || *ev->textId == TEXT_MALON_I_SING_THIS_SONG) { id = 0; - } else if (*textId == TEXT_MALON_HOW_IS_EPONA_DOING) { + } else if (*ev->textId == TEXT_MALON_HOW_IS_EPONA_DOING) { id = 1; - } else if (*textId == TEXT_MALON_OBSTICLE_COURSE) { + } else if (*ev->textId == TEXT_MALON_OBSTICLE_COURSE) { id = 2; - } else if (*textId == TEXT_MALON_INGO_MUST_HAVE_BEEN_TEMPTED) { + } else if (*ev->textId == TEXT_MALON_INGO_MUST_HAVE_BEEN_TEMPTED) { id = 3; } else { assert(!"This should not be reachable"); @@ -341,19 +364,20 @@ void BuildMalonHintMessage(uint16_t* textId, bool* loadFromMessageTable) { } msg = RAND_GET_HINT(RH_MALON_HINT)->GetHintMessage(MF_AUTO_FORMAT, id); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildHorsebackArcheryMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildHorsebackArcheryMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg; int id; - if (*textId == TEXT_GF_HBA_SIGN) { + if (*ev->textId == TEXT_GF_HBA_SIGN) { id = 0; - } else if (*textId == TEXT_HBA_NOT_ON_HORSE) { + } else if (*ev->textId == TEXT_HBA_NOT_ON_HORSE) { id = 1; - } else if (*textId == TEXT_HBA_INITIAL_EXPLAINATION) { + } else if (*ev->textId == TEXT_HBA_INITIAL_EXPLAINATION) { id = 2; - } else if (*textId == TEXT_HBA_ALREADY_HAVE_1000) { + } else if (*ev->textId == TEXT_HBA_ALREADY_HAVE_1000) { id = 3; } else { assert(!"This should not be reachable"); @@ -361,16 +385,18 @@ void BuildHorsebackArcheryMessage(uint16_t* textId, bool* loadFromMessageTable) } msg = RAND_GET_HINT(RH_HBA_HINT)->GetHintMessage(MF_AUTO_FORMAT, id); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildMaskShopSignMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildMaskShopSignMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); CustomMessage msg = RAND_GET_HINT(RH_MASK_SHOP_HINT)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildBossKeyHintMessage(uint16_t* textId, bool* loadFromMessageTable) { +void BuildBossKeyHintMessage(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); RandomizerHint rh = RH_NONE; switch (gPlayState->sceneNum) { case SCENE_FOREST_TEMPLE: @@ -397,7 +423,7 @@ void BuildBossKeyHintMessage(uint16_t* textId, bool* loadFromMessageTable) { if (rh != RH_NONE) { CustomMessage msg = RAND_GET_HINT(rh)->GetHintMessage(MF_AUTO_FORMAT); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } } diff --git a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp index 4f50d5acbc5..f6ac8fc0794 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleBeehives.cpp @@ -74,17 +74,19 @@ void ObjComb_RandomizerWait(ObjComb* objComb, PlayState* play) { } } -void ObjComb_RandomizerInit(void* actor) { - ObjComb* objComb = static_cast(actor); +void ObjComb_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + ObjComb* objComb = static_cast(ev->actor); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); auto beehiveIdentity = OTRGlobals::Instance->gRandomizer->IdentifyBeehive( gPlayState->sceneNum, (s16)objComb->actor.world.pos.x, respawnData); - ObjectExtension::GetInstance().Set(actor, std::move(beehiveIdentity)); + ObjectExtension::GetInstance().Set(ev->actor, std::move(beehiveIdentity)); objComb->actionFunc = (ObjCombActionFunc)ObjComb_RandomizerWait; } -void ObjComb_RandomizerUpdate(void* actor) { - ObjComb* combActor = reinterpret_cast(actor); +void ObjComb_RandomizerUpdate(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + ObjComb* combActor = reinterpret_cast(ev->actor); PlayState* play = gPlayState; combActor->unk_1B2 += 0x2EE0; combActor->actionFunc(combActor, play); diff --git a/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp b/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp index f1f48fbcffa..3a0291dd8c9 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleBeggar.cpp @@ -23,7 +23,8 @@ uint8_t EnHy_RandomizerHoldsItem(int32_t textId) { return true; } -void BuildEnHyMessage_BlueFire(uint16_t* textId, bool* loadFromMessageTable) { +void BuildEnHyMessage_BlueFire(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!EnHy_RandomizerHoldsItem(TEXT_BEGGAR_BUY_BLUE_FIRE)) { return; } @@ -37,10 +38,11 @@ void BuildEnHyMessage_BlueFire(uint16_t* textId, bool* loadFromMessageTable) { "articles spéciaux %btous les 7 ans environ%w..."); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildEnHyMessage_Fish(uint16_t* textId, bool* loadFromMessageTable) { +void BuildEnHyMessage_Fish(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!EnHy_RandomizerHoldsItem(TEXT_BEGGAR_BUY_FISH)) { return; } @@ -53,10 +55,11 @@ void BuildEnHyMessage_Fish(uint16_t* textId, bool* loadFromMessageTable) { "articles spéciaux %btous les 7 ans environ%w..."); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } -void BuildEnHyMessage_Bug(uint16_t* textId, bool* loadFromMessageTable) { +void BuildEnHyMessage_Bug(IEvent* event) { + OnOpenText* ev = reinterpret_cast(event); if (!EnHy_RandomizerHoldsItem(TEXT_BEGGAR_BUY_BUGS)) { return; } @@ -71,7 +74,7 @@ void BuildEnHyMessage_Bug(uint16_t* textId, bool* loadFromMessageTable) { "articles spéciaux %btous les 7 ans environ%w..."); msg.AutoFormat(); msg.LoadIntoFont(); - *loadFromMessageTable = false; + *ev->loadFromMessageTable = false; } void RegisterShuffleBeggar() { diff --git a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp index a1216ce010a..a54f35e248c 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp @@ -185,8 +185,9 @@ void ObjKibako_RandomizerSpawnCollectible(ObjKibako* smallCrateActor, PlayState* item00->actor.world.rot.y = static_cast(Rand_CenteredFloat(65536.0f)); } -void ObjKibako2_RandomizerInit(void* actorRef) { - Actor* actor = static_cast(actorRef); +void ObjKibako2_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); auto logicSetting = RAND_GET_OPTION(RSK_LOGIC_RULES); // don't shuffle two OOB crates in GF and don't shuffle child GV/GF crates when not in no logic @@ -208,20 +209,21 @@ void ObjKibako2_RandomizerInit(void* actorRef) { (s16)actor->world.pos.z == -90)))) return; - ObjKibako2* crateActor = static_cast(actorRef); + ObjKibako2* crateActor = static_cast(ev->actor); auto crateIdentity = OTRGlobals::Instance->gRandomizer->IdentifyCrate(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); ObjectExtension::GetInstance().Set(actor, std::move(crateIdentity)); } -void ObjKibako_RandomizerInit(void* actorRef) { - Actor* actor = static_cast(actorRef); +void ObjKibako_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); if (actor->id != ACTOR_OBJ_KIBAKO) return; - ObjKibako* smallCrateActor = static_cast(actorRef); + ObjKibako* smallCrateActor = static_cast(ev->actor); auto crateIdentity = OTRGlobals::Instance->gRandomizer->IdentifySmallCrate( gPlayState->sceneNum, (s16)actor->home.pos.x, (s16)actor->home.pos.z); diff --git a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp index 14053bff556..ef14d40a046 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp @@ -114,13 +114,14 @@ void EnKusa_RandomizerSpawnCollectible(EnKusa* grassActor, PlayState* play) { item00->actor.world.rot.y = static_cast(Rand_CenteredFloat(65536.0f)); } -void EnKusa_RandomizerInit(void* actorRef) { - Actor* actor = static_cast(actorRef); +void EnKusa_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); if (actor->id != ACTOR_EN_KUSA) return; - EnKusa* grassActor = static_cast(actorRef); + EnKusa* grassActor = static_cast(ev->actor); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); auto grassIdentity = OTRGlobals::Instance->gRandomizer->IdentifyGrass( diff --git a/soh/soh/Enhancements/randomizer/ShufflePots.cpp b/soh/soh/Enhancements/randomizer/ShufflePots.cpp index 3dd2c43837c..a66fc39286b 100644 --- a/soh/soh/Enhancements/randomizer/ShufflePots.cpp +++ b/soh/soh/Enhancements/randomizer/ShufflePots.cpp @@ -102,9 +102,10 @@ void ObjTsubo_RandomizerSpawnCollectible(ObjTsubo* potActor, PlayState* play) { void RegisterShufflePots() { bool shouldRegister = IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_POTS); - COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, shouldRegister, [](void* actorRef) { - Actor* actor = static_cast(actorRef); - ObjTsubo* potActor = static_cast(actorRef); + COND_ID_HOOK(OnActorInit, ACTOR_OBJ_TSUBO, shouldRegister, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); + ObjTsubo* potActor = static_cast(ev->actor); auto potIdentity = OTRGlobals::Instance->gRandomizer->IdentifyPot(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); diff --git a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp index 21a626b06ef..3c9595af88a 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp @@ -48,9 +48,10 @@ static void Sign_RandomizerDraw(Actor* actor, Color_RGBA8* primColor, Color_RGBA EffectSsKiraKira_SpawnFocused(gPlayState, &pos, &velocity, &accel, primColor, envColor, 2000, 100); } -void Sign_RandomizerDrawSetup(void* actor) { +void Sign_RandomizerDrawSetup(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); GetItemCategory getItemCategory; - Actor* signActor = (Actor*)actor; + Actor* signActor = (Actor*) ev->actor; // If not a randomized item or too far, don't draw if (!Sign_RandomizerHoldsItem(signActor, gPlayState) || signActor->xzDistToPlayer > 1000.0f) { @@ -103,36 +104,40 @@ void Sign_RoyalTombSpawnCollectible(IEvent* event) { void RegisterShuffleSigns() { bool shouldRegister = IS_RANDO && Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_SIGNS).Get(); - COND_ID_HOOK(OnActorInit, ACTOR_EN_KANBAN, shouldRegister, [](void* actorRef) { - Actor* actor = static_cast(actorRef); - EnKanban* signActor = static_cast(actorRef); + COND_ID_HOOK(OnActorInit, ACTOR_EN_KANBAN, shouldRegister, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); + EnKanban* signActor = static_cast(ev->actor); auto signIdentity = OTRGlobals::Instance->gRandomizer->IdentifySign( gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z, actor->id); ObjectExtension::GetInstance().Set(actor, std::move(signIdentity)); }); - COND_ID_HOOK(OnActorInit, ACTOR_EN_A_OBJ, shouldRegister, [](void* actorRef) { - Actor* actor = static_cast(actorRef); - EnAObj* signActor = static_cast(actorRef); + COND_ID_HOOK(OnActorInit, ACTOR_EN_A_OBJ, shouldRegister, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); + EnAObj* signActor = static_cast(ev->actor); auto signIdentity = OTRGlobals::Instance->gRandomizer->IdentifySign( gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z, actor->id); ObjectExtension::GetInstance().Set(actor, std::move(signIdentity)); }); - COND_ID_HOOK(OnActorInit, ACTOR_EN_WONDER_TALK, shouldRegister, [](void* actorRef) { - Actor* actor = static_cast(actorRef); - EnWonderTalk* signActor = static_cast(actorRef); + COND_ID_HOOK(OnActorInit, ACTOR_EN_WONDER_TALK, shouldRegister, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); + EnWonderTalk* signActor = static_cast(ev->actor); auto signIdentity = OTRGlobals::Instance->gRandomizer->IdentifySign( gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z, actor->id); ObjectExtension::GetInstance().Set(actor, std::move(signIdentity)); }); - COND_ID_HOOK(OnActorInit, ACTOR_EN_WONDER_TALK2, shouldRegister, [](void* actorRef) { - Actor* actor = static_cast(actorRef); - EnWonderTalk2* signActor = static_cast(actorRef); + COND_ID_HOOK(OnActorInit, ACTOR_EN_WONDER_TALK2, shouldRegister, [](IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); + EnWonderTalk2* signActor = static_cast(ev->actor); auto signIdentity = OTRGlobals::Instance->gRandomizer->IdentifySign( gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z, actor->id); diff --git a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp index da99a2dd660..c04363964e5 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleTrees.cpp @@ -124,8 +124,9 @@ void EnWood02_RandomizerSpawnCollectible(EnWood02* treeActor, PlayState* play) { treeIdentity->randomizerCheck = RC_UNKNOWN_CHECK; } -void EnWood02_RandomizerInit(void* actorRef) { - EnWood02* treeActor = static_cast(actorRef); +void EnWood02_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + EnWood02* treeActor = static_cast(ev->actor); if ((treeActor->actor.params <= WOOD_TREE_KAKARIKO_ADULT && Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_TREES).Get()) || (treeActor->actor.params > WOOD_TREE_KAKARIKO_ADULT && @@ -134,7 +135,7 @@ void EnWood02_RandomizerInit(void* actorRef) { auto treeIdentity = OTRGlobals::Instance->gRandomizer->IdentifyTree( gPlayState->sceneNum, (s16)treeActor->actor.world.pos.x, (s16)treeActor->actor.world.pos.z); if (treeIdentity.randomizerInf != RAND_INF_MAX && treeIdentity.randomizerCheck != RC_UNKNOWN_CHECK) { - ObjectExtension::GetInstance().Set(actorRef, std::move(treeIdentity)); + ObjectExtension::GetInstance().Set(ev->actor, std::move(treeIdentity)); } } } diff --git a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp index e2229ca792d..028daf0dd41 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp @@ -166,9 +166,10 @@ static void EnWonderItem_RandomizerDraw(EnWonderItem* wonderActor, Color_RGBA8* } } -void EnWonderItem_RandomizerDrawSetup(void* refActor) { +void EnWonderItem_RandomizerDrawSetup(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); GetItemCategory getItemCategory; - EnWonderItem* wonderActor = static_cast(refActor); + EnWonderItem* wonderActor = static_cast(ev->actor); // If not a randomized item or too far, don't draw. // If item is unshuffled or collected, kill wonder actor if switch flag is set. @@ -190,7 +191,7 @@ void EnWonderItem_RandomizerDrawSetup(void* refActor) { Color_RGBA8 secColor; Color_RGBA8 envColor; - const auto wonderIdentity = ObjectExtension::GetInstance().Get(refActor); + const auto wonderIdentity = ObjectExtension::GetInstance().Get(ev->actor); if (wonderIdentity == nullptr) { return; } diff --git a/soh/soh/Network/Anchor/HookHandlers.cpp b/soh/soh/Network/Anchor/HookHandlers.cpp index ccd5aa2b5c6..9fdcdb89128 100644 --- a/soh/soh/Network/Anchor/HookHandlers.cpp +++ b/soh/soh/Network/Anchor/HookHandlers.cpp @@ -215,56 +215,63 @@ void Anchor::RegisterHooks() { // #region Hooks that are purely to sync actor states across the clients, not super essential - COND_ID_HOOK(OnActorUpdate, ACTOR_EN_ITEM00, isConnected, [&](void* refActor) { - EnItem00* actor = static_cast(refActor); + COND_ID_HOOK(OnActorUpdate, ACTOR_EN_ITEM00, isConnected, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + EnItem00* actor = static_cast(ev->actor); if (Flags_GetCollectible(gPlayState, actor->collectibleFlag)) { Actor_Kill(&actor->actor); } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_BOMBWALL, isConnected, [&](void* refActor, bool* should) { - BgBombwall* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_BOMBWALL, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgBombwall* actor = static_cast(ev->actor); if (actor->actionFunc == func_8086ED70 && Flags_GetSwitch(gPlayState, actor->dyna.actor.params & 0x3F)) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_BREAKWALL, isConnected, [&](void* refActor, bool* should) { - BgBreakwall* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_BREAKWALL, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgBreakwall* actor = static_cast(ev->actor); if (actor->actionFunc == BgBreakwall_Wait && Flags_GetSwitch(gPlayState, actor->dyna.actor.params & 0x3F)) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_HAKA_ZOU, isConnected, [&](void* refActor, bool* should) { - BgHakaZou* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_HAKA_ZOU, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgHakaZou* actor = static_cast(ev->actor); if (actor->actionFunc == func_80883000 && Flags_GetSwitch(gPlayState, actor->switchFlag)) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_HIDAN_HAMSTEP, isConnected, [&](void* refActor, bool* should) { - BgHidanHamstep* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_HIDAN_HAMSTEP, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgHidanHamstep* actor = static_cast(ev->actor); if (actor->actionFunc == func_808887C4 && Flags_GetSwitch(gPlayState, (actor->dyna.actor.params >> 8) & 0xFF)) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_HIDAN_HROCK, isConnected, [&](void* refActor, bool* should) { - BgHidanHrock* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_HIDAN_HROCK, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgHidanHrock* actor = static_cast(ev->actor); if (actor->actionFunc == func_808896B8 && Flags_GetSwitch(gPlayState, actor->unk_16A)) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_ICE_SHELTER, isConnected, [&](void* refActor, bool* should) { - BgIceShelter* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_ICE_SHELTER, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgIceShelter* actor = static_cast(ev->actor); if (actor->actionFunc == BgIceShelter_Idle && Flags_GetSwitch(gPlayState, actor->dyna.actor.params & 0x3F)) { BgIceShelter_SetupMelt(actor); @@ -272,8 +279,9 @@ void Anchor::RegisterHooks() { } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_JYA_BOMBCHUIWA, isConnected, [&](void* refActor, bool* should) { - BgJyaBombchuiwa* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_JYA_BOMBCHUIWA, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgJyaBombchuiwa* actor = static_cast(ev->actor); if (actor->actionFunc == BgJyaBombchuiwa_WaitForExplosion && Flags_GetSwitch(gPlayState, actor->actor.params & 0x3F)) { @@ -281,16 +289,18 @@ void Anchor::RegisterHooks() { } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_JYA_BOMBIWA, isConnected, [&](void* refActor, bool* should) { - BgJyaBombiwa* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_JYA_BOMBIWA, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgJyaBombiwa* actor = static_cast(ev->actor); if (Flags_GetSwitch(gPlayState, actor->dyna.actor.params & 0x3F)) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_MIZU_BWALL, isConnected, [&](void* refActor, bool* should) { - BgMizuBwall* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_MIZU_BWALL, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgMizuBwall* actor = static_cast(ev->actor); if (actor->actionFunc == BgMizuBwall_Idle && Flags_GetSwitch(gPlayState, ((u16)actor->dyna.actor.params >> 8) & 0x3F)) { @@ -298,44 +308,49 @@ void Anchor::RegisterHooks() { } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_SPOT08_BAKUDANKABE, isConnected, [&](void* refActor, bool* should) { - BgSpot08Bakudankabe* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_SPOT08_BAKUDANKABE, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgSpot08Bakudankabe* actor = static_cast(ev->actor); if (Flags_GetSwitch(gPlayState, (actor->dyna.actor.params & 0x3F))) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_SPOT11_BAKUDANKABE, isConnected, [&](void* refActor, bool* should) { - BgSpot11Bakudankabe* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_SPOT11_BAKUDANKABE, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgSpot11Bakudankabe* actor = static_cast(ev->actor); if (Flags_GetSwitch(gPlayState, (actor->dyna.actor.params & 0x3F))) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_SPOT17_BAKUDANKABE, isConnected, [&](void* refActor, bool* should) { - BgSpot17Bakudankabe* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_SPOT17_BAKUDANKABE, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgSpot17Bakudankabe* actor = static_cast(ev->actor); if (Flags_GetSwitch(gPlayState, (actor->dyna.actor.params & 0x3F))) { func_808B6BC0(actor, gPlayState); SoundSource_PlaySfxAtFixedWorldPos(gPlayState, &actor->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&actor->dyna.actor); - *should = false; + *ev->result = false; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_YDAN_MARUTA, isConnected, [&](void* refActor, bool* should) { - BgYdanMaruta* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_YDAN_MARUTA, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgYdanMaruta* actor = static_cast(ev->actor); if (actor->actionFunc == func_808BF078 && Flags_GetSwitch(gPlayState, actor->switchFlag)) { actor->collider.base.acFlags |= AC_HIT; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_YDAN_SP, isConnected, [&](void* refActor, bool* should) { - BgYdanSp* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_BG_YDAN_SP, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + BgYdanSp* actor = static_cast(ev->actor); if ((actor->actionFunc == BgYdanSp_FloorWebIdle || actor->actionFunc == BgYdanSp_WallWebIdle) && Flags_GetSwitch(gPlayState, actor->isDestroyedSwitchFlag)) { @@ -343,68 +358,75 @@ void Anchor::RegisterHooks() { } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_DOOR_SHUTTER, isConnected, [&](void* refActor, bool* should) { - DoorShutter* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_DOOR_SHUTTER, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + DoorShutter* actor = static_cast(ev->actor); if (Flags_GetSwitch(gPlayState, actor->dyna.actor.params & 0x3F)) { DECR(actor->unlockTimer); } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_EN_DOOR, isConnected, [&](void* refActor, bool* should) { - EnDoor* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_EN_DOOR, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + EnDoor* actor = static_cast(ev->actor); if (actor->actionFunc == EnDoor_Idle && Flags_GetSwitch(gPlayState, actor->actor.params & 0x3F)) { DECR(actor->lockTimer); } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_EN_SI, isConnected, [&](void* refActor, bool* should) { - EnSi* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_EN_SI, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + EnSi* actor = static_cast(ev->actor); if (GET_GS_FLAGS((actor->actor.params & 0x1F00) >> 8) & (actor->actor.params & 0xFF)) { Actor_Kill(&actor->actor); - *should = false; + *ev->result = false; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_EN_SW, isConnected, [&](void* refActor, bool* should) { - EnSw* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_EN_SW, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + EnSw* actor = static_cast(ev->actor); if (GET_GS_FLAGS((actor->actor.params & 0x1F00) >> 8) & (actor->actor.params & 0xFF)) { Actor_Kill(&actor->actor); - *should = false; + *ev->result = false; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_ITEM_B_HEART, isConnected, [&](void* refActor, bool* should) { - ItemBHeart* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_ITEM_B_HEART, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + ItemBHeart* actor = static_cast(ev->actor); if (Flags_GetCollectible(gPlayState, 0x1F)) { Actor_Kill(&actor->actor); - *should = false; + *ev->result = false; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_BOMBIWA, isConnected, [&](void* refActor, bool* should) { - ObjBombiwa* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_BOMBIWA, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + ObjBombiwa* actor = static_cast(ev->actor); if (Flags_GetSwitch(gPlayState, actor->actor.params & 0x3F)) { ObjBombiwa_Break(actor, gPlayState); SoundSource_PlaySfxAtFixedWorldPos(gPlayState, &actor->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); Actor_Kill(&actor->actor); - *should = false; + *ev->result = false; } }); - COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_HAMISHI, isConnected, [&](void* refActor, bool* should) { - ObjHamishi* actor = static_cast(refActor); + COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_HAMISHI, isConnected, [](IEvent* event) { + ShouldActorUpdate* ev = reinterpret_cast(event); + ObjHamishi* actor = static_cast(ev->actor); if (Flags_GetSwitch(gPlayState, actor->actor.params & 0x3F)) { ObjHamishi_Break(actor, gPlayState); SoundSource_PlaySfxAtFixedWorldPos(gPlayState, &actor->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&actor->actor); - *should = false; + *ev->result = false; } }); From 4b64e6e463127f12ba17009b283b2d10f7c465ba Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 15:23:31 -0600 Subject: [PATCH 04/31] Final batch of migrating stuff --- soh/src/code/audio_load.c | 2 +- soh/src/code/code_800EC960.c | 2 +- soh/src/code/z_actor.c | 4 ++-- soh/src/code/z_inventory.c | 2 +- soh/src/code/z_kaleido_scope_call.c | 2 +- soh/src/code/z_kankyo.c | 2 +- soh/src/code/z_map_exp.c | 2 +- soh/src/code/z_message_PAL.c | 4 ++-- soh/src/code/z_parameter.c | 4 ++-- soh/src/code/z_play.c | 2 +- soh/src/code/z_skelanime.c | 2 +- .../actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 6 +++--- .../actors/ovl_Door_Gerudo/z_door_gerudo.c | 2 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 2 +- soh/src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 8 ++++---- .../overlays/actors/ovl_player_actor/z_player.c | 2 +- .../gamestates/ovl_file_choose/z_file_choose.c | 14 +++++++------- .../gamestates/ovl_file_choose/z_file_copy_erase.c | 10 +++++----- .../ovl_file_choose/z_file_nameset_NES.c | 4 ++-- .../ovl_file_choose/z_file_nameset_PAL.c | 12 ++++++------ .../misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c | 6 +++--- 22 files changed, 48 insertions(+), 48 deletions(-) diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index 3a0dbe0ef9e..f538d860677 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -631,7 +631,7 @@ s32 AudioLoad_SyncInitSeqPlayerInternal(s32 playerIdx, s32 seqId, s32 arg2) { AudioSeq_SkipForwardSequence(seqPlayer); //! @bug missing return (but the return value is not used so it's not UB) - CALL_EVENT(OnSeqPlayerInit, (playerIdx, seqId); + CALL_EVENT(OnSeqPlayerInit, playerIdx, seqId); } u8* AudioLoad_SyncLoadSeq(s32 seqId) { diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 4bc4c532926..61e96476c82 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1678,7 +1678,7 @@ void func_800ED458(s32 arg0) { } else if ((sPrevOcarinaNoteVal != 0xFF) && (sCurOcarinaBtnVal == 0xFF)) { Audio_StopSfxById(NA_SE_OC_OCARINA); } - CALL_EVENT(OnOcarinaNote, (sCurOcarinaBtnVal, D_80130F24, D_80130F10); + CALL_EVENT(OnOcarinaNote, sCurOcarinaBtnVal, D_80130F24, D_80130F10); } } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index ae8367d27f2..e71269590fa 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1106,7 +1106,7 @@ void TitleCard_Update(PlayState* play, TitleCardContext* titleCtx) { if (DECR(titleCtx->delayTimer) == 0) { if (titleCtx->durationTimer == 80) { - CALL_EVENT(OnPresentTitleCard(); + CALL_EVENT(OnPresentTitleCard); } if (DECR(titleCtx->durationTimer) == 0) { @@ -2254,7 +2254,7 @@ void Player_PlaySfx(Actor* actor, u16 sfxId) { } if (actor->id == ACTOR_PLAYER) { - CALL_EVENT(OnPlayerSfx, (sfxId); + CALL_EVENT(OnPlayerSfx, sfxId); } } diff --git a/soh/src/code/z_inventory.c b/soh/src/code/z_inventory.c index b579177c011..c568c16be88 100644 --- a/soh/src/code/z_inventory.c +++ b/soh/src/code/z_inventory.c @@ -219,7 +219,7 @@ void Inventory_ChangeEquipment(s16 equipment, u16 value) { gSaveContext.equips.equipment &= gEquipNegMasks[equipment]; gSaveContext.equips.equipment |= value << gEquipShifts[equipment]; - CALL_EVENT(OnLinkEquipmentChange(); + CALL_EVENT(OnLinkEquipmentChange); } u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { diff --git a/soh/src/code/z_kaleido_scope_call.c b/soh/src/code/z_kaleido_scope_call.c index c3ebf7114e8..403fcd1cde0 100644 --- a/soh/src/code/z_kaleido_scope_call.c +++ b/soh/src/code/z_kaleido_scope_call.c @@ -57,7 +57,7 @@ void KaleidoScopeCall_Update(PlayState* play) { KaleidoMgrOverlay* kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]; PauseContext* pauseCtx = &play->pauseCtx; - CALL_EVENT(OnKaleidoUpdate(); + CALL_EVENT(OnKaleidoUpdate); if (!gSaveContext.ship.stats.gameComplete && (!IS_BOSS_RUSH || !gSaveContext.ship.quest.data.bossRush.isPaused)) { gSaveContext.ship.stats.pauseTimer++; diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index db36d8c5e84..f16c7b5676d 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -2096,7 +2096,7 @@ void func_80075B44(PlayState* play) { Sfx_PlaySfxCentered(NA_SE_EV_CHICKEN_CRY_M); if ((Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) && play->csCtx.state == 0 && !Player_InCsMode(play)) { - CALL_EVENT(OnCuccoOrChickenHatch(); + CALL_EVENT(OnCuccoOrChickenHatch); Message_StartTextbox(play, 0x3066, NULL); } play->envCtx.unk_E0++; diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 2c578d8ae9f..389817f7073 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -764,7 +764,7 @@ void Minimap_DrawCompassIcons(PlayState* play) { CLOSE_DISPS(play->state.gfxCtx); if (play->interfaceCtx.minimapAlpha >= 0xAA) { - CALL_EVENT(OnMinimapDrawCompassIcons(); + CALL_EVENT(OnMinimapDrawCompassIcons); } } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 1ac0c54404a..a5e3dd797ed 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -2722,7 +2722,7 @@ void Message_OpenText(PlayState* play, u16 textId) { s16 textBoxType; bool loadFromMessageTable = true; - CALL_EVENT(OnOpenText, (&textId, &loadFromMessageTable); + CALL_EVENT(OnOpenText, &textId, &loadFromMessageTable); sDisplayNextMessageAsEnglish = false; @@ -3820,7 +3820,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { osSyncPrintf(VT_RST); osSyncPrintf("→ OCARINA_MODE=%d\n", play->msgCtx.ocarinaMode); } - CALL_EVENT(OnOcarinaSongAction(); + CALL_EVENT(OnOcarinaSongAction); } break; case MSGMODE_DISPLAY_SONG_PLAYED: diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index cfe31e01a10..25255c12156 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2796,7 +2796,7 @@ void Interface_SetDoAction(PlayState* play, u16 action) { PauseContext* pauseCtx = &play->pauseCtx; if (interfaceCtx->unk_1F0 != action) { - CALL_EVENT(OnSetDoAction, (action); + CALL_EVENT(OnSetDoAction, action); interfaceCtx->unk_1F0 = action; interfaceCtx->unk_1EC = 1; interfaceCtx->unk_1F4 = 0.0f; @@ -6506,7 +6506,7 @@ void Interface_Update(PlayState* play) { Right_HUD_Margin = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.R"), 0); Bottom_HUD_Margin = CVarGetInteger(CVAR_COSMETIC("HUD.Margin.B"), 0); - CALL_EVENT(OnInterfaceUpdate(); + CALL_EVENT(OnInterfaceUpdate); bool isPal = ResourceMgr_GetGameRegion(0) == GAME_REGION_PAL; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index cb6f1dc45a8..ef41ee49ff9 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -518,7 +518,7 @@ void Play_Init(GameState* thisx) { gSaveContext.dogIsLost = true; if (Inventory_ReplaceItem(play, ITEM_WEIRD_EGG, ITEM_CHICKEN) || Inventory_HatchPocketCucco(play)) { - CALL_EVENT(OnCuccoOrChickenHatch(); + CALL_EVENT(OnCuccoOrChickenHatch); Message_StartTextbox(play, 0x3066, NULL); } diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index 3a6ce16a08f..eff5bb21b76 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -1145,7 +1145,7 @@ void SkelAnime_InitLink(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade LinkAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f); - CALL_EVENT(OnLinkSkeletonInit(); + CALL_EVENT(OnLinkSkeletonInit); } /** diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 98b1df375a3..81e97deebef 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -84,7 +84,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 8200.0f, ICHAIN_STOP), }; -void BossDodongo_RegisterBlendedLavaTextureUpdate() { +void BossDodongo_RegisterBlendedLavaTextureUpdate(IEvent* event) { // Not in scene so there is nothing to do if (gPlayState == NULL || gPlayState->sceneNum != SCENE_DODONGOS_CAVERN_BOSS) { return; @@ -391,11 +391,11 @@ void BossDodongo_Init(Actor* thisx, PlayState* play) { Gfx_TextureCacheDelete(sMaskTex16x32); Gfx_TextureCacheDelete(sMaskTex32x16); - BossDodongo_RegisterBlendedLavaTextureUpdate(); + BossDodongo_RegisterBlendedLavaTextureUpdate(NULL); // Register alt listener to update the blended lava for the replacement texture based on alt path if (!hasRegisteredBlendedHook) { - GameInteractor_RegisterOnAssetAltChange(BossDodongo_RegisterBlendedLavaTextureUpdate); + REGISTER_LISTENER(OnAssetAltChange, EVENT_PRIORITY_LOW, BossDodongo_RegisterBlendedLavaTextureUpdate); hasRegisteredBlendedHook = 1; } // #endregion diff --git a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 766b47c99b7..09558365354 100644 --- a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -104,7 +104,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); - CALL_EVENT(OnDungeonKeyUsed, (gSaveContext.mapIndex); + CALL_EVENT(OnDungeonKeyUsed, gSaveContext.mapIndex); } else { s32 direction = func_80994750(this, play); diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 07584988117..0faaa6743eb 100644 --- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -391,7 +391,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) { if (this->doorType != SHUTTER_BOSS) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); - CALL_EVENT(OnDungeonKeyUsed, (gSaveContext.mapIndex); + CALL_EVENT(OnDungeonKeyUsed, gSaveContext.mapIndex); } else { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B); } diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index c7af77c6b80..e1144b96af5 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -209,7 +209,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { Flags_SetSwitch(play, this->actor.params & 0x3F); } Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK); - CALL_EVENT(OnDungeonKeyUsed, (gSaveContext.mapIndex); + CALL_EVENT(OnDungeonKeyUsed, gSaveContext.mapIndex); } } else if (!Player_InCsMode(play)) { if (fabsf(playerPosRelToDoor.y) < 20.0f && fabsf(playerPosRelToDoor.x) < 20.0f && diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 795d69cda24..227b095f6db 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1007,7 +1007,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); - CALL_EVENT(OnShopSlotChange, (this->cursorIndex, + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } else if ((this->stickAccumX > 0) || (dpad && CHECK_BTN_ALL(input->press.button, dRight))) { @@ -1018,7 +1018,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); - CALL_EVENT(OnShopSlotChange, (this->cursorIndex, + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } @@ -1285,7 +1285,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, PlayState* play, Player* playe } EnOssan_CursorUpDown(this, play); if (this->cursorIndex != prevIndex) { - CALL_EVENT(OnShopSlotChange, (this->cursorIndex, + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); @@ -1358,7 +1358,7 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, PlayState* play, Player* play } EnOssan_CursorUpDown(this, play); if (this->cursorIndex != prevIndex) { - CALL_EVENT(OnShopSlotChange, (this->cursorIndex, + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index a99cb4927e8..d69a0c773d9 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -12389,7 +12389,7 @@ void Player_Update(Actor* thisx, PlayState* play) { // func_8002F974(&player->actor, NA_SE_EV_WIND_TRAP - SFX_FLAG); } - CALL_EVENT(OnPlayerUpdate(); + CALL_EVENT(OnPlayerUpdate); } typedef struct BunnyEarKinematics { diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index de1ec6a153a..8dd5605cb51 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -260,7 +260,7 @@ void FileChoose_FinishFadeIn(GameState* thisx) { this->controlsAlpha = 255; this->windowAlpha = 200; this->configMode = CM_MAIN_MENU; - CALL_EVENT(OnPresentFileSelect(); + CALL_EVENT(OnPresentFileSelect); } } @@ -523,7 +523,7 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { } if (sLastFileChooseButtonIndex != this->buttonIndex) { - CALL_EVENT(OnUpdateFileSelectSelection, (this->buttonIndex); + CALL_EVENT(OnUpdateFileSelectSelection, this->buttonIndex); sLastFileChooseButtonIndex = this->buttonIndex; } } @@ -595,7 +595,7 @@ void FileChoose_StartQuestMenu(GameState* thisx) { this->logoAlpha = 255; this->configMode = CM_QUEST_MENU; - CALL_EVENT(OnUpdateFileQuestSelection, (this->questType[this->buttonIndex]); + CALL_EVENT(OnUpdateFileQuestSelection, this->questType[this->buttonIndex]); } } @@ -665,7 +665,7 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - CALL_EVENT(OnUpdateFileQuestSelection, (this->questType[this->buttonIndex]); + CALL_EVENT(OnUpdateFileQuestSelection, this->questType[this->buttonIndex]); } if (CHECK_BTN_ALL(input->press.button, BTN_A)) { @@ -762,7 +762,7 @@ void FileChoose_UpdateRandomizerMenu(GameState* thisx) { } } - CALL_EVENT(OnUpdateFileRandomizerOptionSelection, (this->randomizerIndex); + CALL_EVENT(OnUpdateFileRandomizerOptionSelection, this->randomizerIndex); Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -2400,7 +2400,7 @@ void FileChoose_ConfirmFile(GameState* thisx) { } if (sLastFileChooseButtonIndex != this->confirmButtonIndex) { - CALL_EVENT(OnUpdateFileSelectConfirmationSelection, (this->confirmButtonIndex); + CALL_EVENT(OnUpdateFileSelectConfirmationSelection, this->confirmButtonIndex); sLastFileChooseButtonIndex = this->confirmButtonIndex; } } @@ -2720,7 +2720,7 @@ void FileChoose_Main(GameState* thisx) { Color_RGB8 helpTextColor = { 100, 255, 255 }; - CALL_EVENT(OnFileChooseMain, (thisx); + CALL_EVENT(OnFileChooseMain, thisx); if (CVarGetInteger(CVAR_COSMETIC("Title.FileChoose.Changed"), 0)) { Color_RGB8 backgroundColor = diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 812be465419..9d09cd8009b 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -120,7 +120,7 @@ void FileChoose_SelectCopySource(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - CALL_EVENT(OnUpdateFileCopySelection, (this->buttonIndex); + CALL_EVENT(OnUpdateFileCopySelection, this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -252,7 +252,7 @@ void FileChoose_SelectCopyDest(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - CALL_EVENT(OnUpdateFileCopySelection, (this->buttonIndex); + CALL_EVENT(OnUpdateFileCopySelection, this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -406,7 +406,7 @@ void FileChoose_CopyConfirm(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - CALL_EVENT(OnUpdateFileCopyConfirmationSelection, (this->buttonIndex); + CALL_EVENT(OnUpdateFileCopyConfirmationSelection, this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -764,7 +764,7 @@ void FileChoose_EraseSelect(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - CALL_EVENT(OnUpdateFileEraseSelection, (this->buttonIndex); + CALL_EVENT(OnUpdateFileEraseSelection, this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } @@ -881,7 +881,7 @@ void FileChoose_EraseConfirm(GameState* thisx) { } if (sLastCopyEraseButtonIndex != this->buttonIndex) { - CALL_EVENT(OnUpdateFileEraseConfirmationSelection, (this->buttonIndex); + CALL_EVENT(OnUpdateFileEraseConfirmationSelection, this->buttonIndex); sLastCopyEraseButtonIndex = this->buttonIndex; } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c index 4e2e16a3a36..f28bf9a5a22 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c @@ -1064,14 +1064,14 @@ void FileChoose_UpdateOptionsMenuNES(GameState* thisx) { if (sSelectedSetting == FS_SETTING_AUDIO) { if (sLastOptionButtonIndex != gSaveContext.audioSetting) { - CALL_EVENT(OnUpdateFileAudioSelection, (gSaveContext.audioSetting); + CALL_EVENT(OnUpdateFileAudioSelection, gSaveContext.audioSetting); sLastOptionButtonIndex = gSaveContext.audioSetting; } } else if (sSelectedSetting == FS_SETTING_TARGET) { // offset to detect switching between modes u8 optionOffset = gSaveContext.zTargetSetting + FS_AUDIO_SURROUND + FS_SETTING_TARGET; if (sLastOptionButtonIndex != optionOffset) { - CALL_EVENT(OnUpdateFileTargetSelection, (gSaveContext.zTargetSetting); + CALL_EVENT(OnUpdateFileTargetSelection, gSaveContext.zTargetSetting); sLastOptionButtonIndex = optionOffset; } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 75e68be38e7..d8b1e189e14 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -651,12 +651,12 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { this->kbdButton = this->kbdX; if (sLastKbdX != this->kbdX) { - CALL_EVENT(OnUpdateFileNameSelection, (0xF0 + this->kbdX); + CALL_EVENT(OnUpdateFileNameSelection, 0xF0 + this->kbdX); sLastKbdX = this->kbdX; sLastCharIndex = -1; } } else if (sLastCharIndex != this->charIndex && this->charIndex < 65) { - CALL_EVENT(OnUpdateFileNameSelection, (D_808123F0[this->charIndex]); + CALL_EVENT(OnUpdateFileNameSelection, D_808123F0[this->charIndex]); sLastCharIndex = this->charIndex; sLastKbdX = -1; } @@ -772,7 +772,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { // Persist the new language so it is not overridden on the next frame if (languageChanged) { CVarSetInteger(CVAR_SETTING("Languages"), gSaveContext.language); - CALL_EVENT(OnSetGameLanguage(); + CALL_EVENT(OnSetGameLanguage); } // NTSC and GC only has two rows and can just flip the setting bit @@ -814,21 +814,21 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { if (sSelectedSetting == FS_SETTING_AUDIO) { if (sLastOptionButtonIndex != gSaveContext.audioSetting) { - CALL_EVENT(OnUpdateFileAudioSelection, (gSaveContext.audioSetting); + CALL_EVENT(OnUpdateFileAudioSelection, gSaveContext.audioSetting); sLastOptionButtonIndex = gSaveContext.audioSetting; } } else if (sSelectedSetting == FS_SETTING_TARGET) { // offset to detect switching between modes u8 optionOffset = gSaveContext.zTargetSetting + FS_AUDIO_SURROUND + FS_SETTING_TARGET; if (sLastOptionButtonIndex != optionOffset) { - CALL_EVENT(OnUpdateFileTargetSelection, (gSaveContext.zTargetSetting); + CALL_EVENT(OnUpdateFileTargetSelection, gSaveContext.zTargetSetting); sLastOptionButtonIndex = optionOffset; } } else { // offset to detect switching between modes u8 optionOffset = gSaveContext.language + FS_AUDIO_SURROUND + FS_TARGET_HOLD + FS_SETTING_LANGUAGE; if (sLastOptionButtonIndex != optionOffset) { - CALL_EVENT(OnUpdateFileLanguageSelection, (gSaveContext.language); + CALL_EVENT(OnUpdateFileLanguageSelection, gSaveContext.language); sLastOptionButtonIndex = optionOffset; } } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 1638230ab13..e64cf7cd01e 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -3760,7 +3760,7 @@ void KaleidoScope_LoadDungeonMap(PlayState* play) { static uint8_t registeredDungeonMapTextureHook = false; -void KaleidoScope_RegisterUpdatedDungeonMapTexture() { +void KaleidoScope_RegisterUpdatedDungeonMapTexture(IEvent* event) { if (gPlayState == NULL) { return; } @@ -3823,7 +3823,7 @@ void KaleidoScope_UpdateDungeonMap(PlayState* play) { // Register alt listener to update the blended dungeon map textures on alt toggle if (!registeredDungeonMapTextureHook) { registeredDungeonMapTextureHook = true; - GameInteractor_RegisterOnAssetAltChange(KaleidoScope_RegisterUpdatedDungeonMapTexture); + REGISTER_LISTENER(OnAssetAltChange, EVENT_PRIORITY_LOW, KaleidoScope_RegisterUpdatedDungeonMapTexture); } } @@ -4879,5 +4879,5 @@ void KaleidoScope_Update(PlayState* play) { break; } - CALL_EVENT(OnKaleidoscopeUpdate, (sInDungeonScene); + CALL_EVENT(OnKaleidoscopeUpdate, sInDungeonScene); } From 4aeb51674085c660d55c57f20aa92885d6200e11 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 15:27:19 -0600 Subject: [PATCH 05/31] Fixed EventIds not getting linked correctly --- soh/soh/Enhancements/customequipment.cpp | 2 +- soh/soh/Enhancements/game-interactor/GameInteractor.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index 0f4b39cbe65..d505e3d7e32 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -18,7 +18,7 @@ extern PlayState* gPlayState; void DummyPlayer_Update(Actor* actor, PlayState* play); static void UpdatePatchCustomEquipmentDlists(); -static void RefreshCustomEquipment(); +static void RefreshCustomEquipment(IEvent* event = nullptr); static u8 GetEquippedSwordItem(); static bool IsDummyPlayer(const Player* player); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp index 580498965ac..27a7179f43d 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp @@ -9,12 +9,10 @@ If these checks need to happen wherever GameInteractor functions are needed, the GameInteractor functions can be called directly. */ +#define INIT_EVENT_IDS #include "GameInteractor.h" #include -#define INIT_EVENT_IDS -#include "EventSystem_List.h" - extern "C" { #include "variables.h" #include "macros.h" From fa9c1bc07d9b307ad2007057e65f0ed27563714a Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 17:42:14 -0600 Subject: [PATCH 06/31] Fully migrated last things to the Event System --- soh/soh/Enhancements/Cheats/FreezeTime.cpp | 12 +- .../Story/SkipZeldaFleeingCastle.cpp | 35 +- soh/soh/Enhancements/Warping.cpp | 4 +- soh/soh/Enhancements/audio/AudioEditor.cpp | 7 +- .../cosmetics/CosmeticsEditor.cpp | 4 +- .../cosmetics/CustomLogoTitle.cpp | 2 +- soh/soh/Enhancements/debugconsole.cpp | 2 +- soh/soh/Enhancements/debugger/actorViewer.cpp | 30 +- soh/soh/Enhancements/debugger/colViewer.cpp | 4 +- .../Enhancements/debugger/hookDebugger.cpp | 141 ---- soh/soh/Enhancements/debugger/hookDebugger.h | 15 - .../game-interactor/GameInteractor.h | 305 ------- soh/soh/Enhancements/kaleido.cpp | 5 +- soh/soh/Enhancements/kaleido.h | 1 - soh/soh/Enhancements/mods.cpp | 24 +- soh/soh/Enhancements/nametag.cpp | 29 +- .../Enhancements/randomizer/hook_handlers.cpp | 539 ++++++------ .../Enhancements/randomizer/item_location.cpp | 4 +- .../Enhancements/randomizer/randomizer.cpp | 2 +- .../randomizer/randomizer_check_tracker.cpp | 81 +- .../randomizer_entrance_tracker.cpp | 8 +- .../randomizer/randomizer_item_tracker.cpp | 4 +- .../Enhancements/timesaver_hook_handlers.cpp | 287 +++---- .../Enhancements/timesplits/TimeSplits.cpp | 27 +- soh/soh/Enhancements/tts/tts.cpp | 785 +++++++++--------- soh/soh/Network/Anchor/Packets/TeleportTo.cpp | 4 +- soh/soh/OTRGlobals.cpp | 6 +- soh/soh/SaveManager.cpp | 9 +- soh/soh/SohGui/SohGui.cpp | 9 +- soh/soh/SohGui/SohGui.hpp | 4 +- soh/soh/SohGui/SohMenuDevTools.cpp | 10 +- 31 files changed, 996 insertions(+), 1403 deletions(-) delete mode 100644 soh/soh/Enhancements/debugger/hookDebugger.cpp delete mode 100644 soh/soh/Enhancements/debugger/hookDebugger.h diff --git a/soh/soh/Enhancements/Cheats/FreezeTime.cpp b/soh/soh/Enhancements/Cheats/FreezeTime.cpp index a3028d7dab7..8a9bff7eb04 100644 --- a/soh/soh/Enhancements/Cheats/FreezeTime.cpp +++ b/soh/soh/Enhancements/Cheats/FreezeTime.cpp @@ -13,7 +13,7 @@ extern "C" SaveContext gSaveContext; #define CVAR_PREV_TIME_DEFAULT -1 #define CVAR_PREV_TIME_VALUE CVarGetInteger(CVAR_PREV_TIME_NAME, CVAR_PREV_TIME_DEFAULT) -void OnGameFrameUpdateFreezeTime() { +void OnGameFrameUpdateFreezeTime(IEvent* event) { if (!GameInteractor::IsSaveLoaded(true)) { return; } @@ -26,12 +26,12 @@ void OnGameFrameUpdateFreezeTime() { } void RegisterFreezeTime() { - static HOOK_ID hookId = 0; - GameInteractor::Instance->UnregisterGameHook(hookId); - hookId = 0; + static ListenerID listenerId = -1; + if (listenerId == -1) { + UNREGISTER_LISTENER(OnGameFrameUpdate, listenerId); + } if (CVAR_FREEZE_TIME_VALUE) { - hookId = - GameInteractor::Instance->RegisterGameHook(OnGameFrameUpdateFreezeTime); + listenerId = REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, OnGameFrameUpdateFreezeTime); } else { CVarClear(CVAR_PREV_TIME_NAME); } diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp index 77022689638..e8cf9c002a1 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp @@ -13,20 +13,26 @@ extern SaveContext gSaveContext; * To make it more obvious what happened, we'll play the sound of the Ocarina dropping into the water. */ static int framesSinceSpawn = 0; -static HOOK_ID itemOcarinaUpdateHook = 0; -static HOOK_ID sceneInitHook = 0; +static ListenerID itemOcarinaUpdateHook = -1; +static ListenerID sceneInitHook = -1; -void SkipZeldaFleeingCastle_OnActorUpdate(void* actorPtr) { - Actor* actor = static_cast(actorPtr); +void SkipZeldaFleeingCastle_OnActorUpdate(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); + + if (actor->params != 3) { + return; + } framesSinceSpawn++; if (framesSinceSpawn > 20) { Audio_PlayActorSound2(actor, NA_SE_EV_BOMB_DROP_WATER); - GameInteractor::Instance->UnregisterGameHookForPtr(itemOcarinaUpdateHook); - GameInteractor::Instance->UnregisterGameHook(sceneInitHook); - itemOcarinaUpdateHook = 0; - sceneInitHook = 0; + UNREGISTER_LISTENER(OnActorUpdate, itemOcarinaUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, sceneInitHook); + + itemOcarinaUpdateHook = -1; + sceneInitHook = -1; } } @@ -36,13 +42,12 @@ void SkipZeldaFleeingCastle_OnActorInit(IEvent* event) { if (actor->params == 3) { framesSinceSpawn = 0; - itemOcarinaUpdateHook = GameInteractor::Instance->RegisterGameHookForPtr( - (uintptr_t)ev->actor, SkipZeldaFleeingCastle_OnActorUpdate); - sceneInitHook = GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { - GameInteractor::Instance->UnregisterGameHookForPtr(itemOcarinaUpdateHook); - GameInteractor::Instance->UnregisterGameHook(sceneInitHook); - itemOcarinaUpdateHook = 0; - sceneInitHook = 0; + itemOcarinaUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, SkipZeldaFleeingCastle_OnActorUpdate); + sceneInitHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, itemOcarinaUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, sceneInitHook); + itemOcarinaUpdateHook = -1; + sceneInitHook = -1; }); } } diff --git a/soh/soh/Enhancements/Warping.cpp b/soh/soh/Enhancements/Warping.cpp index bcba716112a..61f495bc398 100644 --- a/soh/soh/Enhancements/Warping.cpp +++ b/soh/soh/Enhancements/Warping.cpp @@ -89,10 +89,10 @@ void Warp(WarpPoint& warpPoint) { gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = 0xDFF; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK_FAST; gSaveContext.respawnFlag = 1; - static HOOK_ID hookId = 0; + static ListenerID hookId = -1; hookId = REGISTER_VB_SHOULD(VB_INFLICT_VOID_DAMAGE, { *should = false; - GameInteractor::Instance->UnregisterGameHookForID(hookId); + UNREGISTER_LISTENER(OnVanillaBehavior, hookId); }); } diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index e82f85ee14f..2f9c1e3e294 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -498,7 +498,7 @@ void DrawTypeChip(SeqType type, std::string sequenceName) { } void AudioEditorRegisterOnSceneInitHook() { - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event){ if (gSaveContext.gameMode != GAMEMODE_END_CREDITS && CVarGetInteger(CVAR_AUDIO("RandomizeAudioGenModes"), 0) == RANDOMIZE_ON_NEW_SCENE) { @@ -508,16 +508,15 @@ void AudioEditorRegisterOnSceneInitHook() { } void AudioEditorRegisterOnGenerationCompletionHook() { - GameInteractor::Instance->RegisterGameHook([]() { + REGISTER_LISTENER(OnGenerationCompletion, EVENT_PRIORITY_LOW, [](IEvent* event){ if (CVarGetInteger(CVAR_AUDIO("RandomizeAudioGenModes"), 0) == RANDOMIZE_ON_RANDO_GEN_ONLY) { - AudioEditor_AutoRandomizeAll(); } }); } void AudioEditorRegisterOnLoadGameHook() { - GameInteractor::Instance->RegisterGameHook([](int32_t fileNum) { + REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, [](IEvent* event) { if (CVarGetInteger(CVAR_AUDIO("RandomizeAudioGenModes"), 0) == RANDOMIZE_ON_FILE_LOAD || CVarGetInteger(CVAR_AUDIO("RandomizeAudioGenModes"), 0) == RANDOMIZE_ON_FILE_LOAD_SEEDED) { diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 5dd9a52371b..3c187a0f56c 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -2602,7 +2602,9 @@ void CosmeticsEditorWindow::DrawElement() { } void RegisterOnGameFrameUpdateHook() { - GameInteractor::Instance->RegisterGameHook([]() { CosmeticsUpdateTick(); }); + REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + CosmeticsUpdateTick(); + }) } void CosmeticsEditorWindow::InitElement() { diff --git a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp index 22676959345..d693fa6565e 100644 --- a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp +++ b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp @@ -165,7 +165,7 @@ extern "C" void CustomLogoTitle_Main(TitleContext* titleContext) { } } - CALL_EVENT(OnZTitleUpdate); + CALL_EVENT(OnZTitleUpdate, titleContext); CLOSE_DISPS(titleContext->state.gfxCtx); } diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 7fecad83ac2..10846232f78 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -220,7 +220,7 @@ static bool ResetHandler(std::shared_ptr Console, std::vectorrunning = false; - GameInteractor::Instance->ExecuteHooks(gSaveContext.fileNum); + CALL_EVENT(OnExitGame, gSaveContext.fileNum); return 0; } diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index 2517c475a65..25ff42081c4 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -1194,32 +1194,34 @@ void ActorViewerWindow::DrawElement() { } void ActorViewerWindow::InitElement() { - GameInteractor::Instance->RegisterGameHook([this](void* refActor) { - Actor* actor = static_cast(refActor); + REGISTER_LISTENER(OnActorSpawn, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorSpawn* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); // Reload actor list if the new actor belongs to the selected category - if (category == actor->category) { - PopulateActorDropdown(actor->category, list); + if (SohGui::mActorViewerWindow->category == actor->category) { + PopulateActorDropdown(actor->category, SohGui::mActorViewerWindow->list); } }); - GameInteractor::Instance->RegisterGameHook([this](void* refActor) { - Actor* actor = static_cast(refActor); + REGISTER_LISTENER(OnActorDestroy, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorDestroy* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); // If the actor belongs to the selected category, we need to manually remove it, as it has not been removed from // the global actor array yet - if (category == actor->category) { - list.erase(std::remove(list.begin(), list.end(), actor), list.end()); + if (SohGui::mActorViewerWindow->category == actor->category) { + SohGui::mActorViewerWindow->list.erase(std::remove(SohGui::mActorViewerWindow->list.begin(), SohGui::mActorViewerWindow->list.end(), actor), SohGui::mActorViewerWindow->list.end()); } - if (display == actor) { - display = nullptr; + if (SohGui::mActorViewerWindow->display == actor) { + SohGui::mActorViewerWindow->display = nullptr; } }); - GameInteractor::Instance->RegisterGameHook([this](int16_t sceneNum) { - display = nullptr; - category = ACTORCAT_SWITCH; - list.clear(); + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + SohGui::mActorViewerWindow->display = nullptr; + SohGui::mActorViewerWindow->category = ACTORCAT_SWITCH; + SohGui::mActorViewerWindow->list.clear(); }); } diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index 1c6993e0d0d..2874db3e85e 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -806,5 +806,7 @@ void ColViewerWindow::InitElement() { CreateCylinderData(); CreateSphereData(); - GameInteractor::Instance->RegisterGameHook(DrawColViewer); + REGISTER_LISTENER(OnPlayDrawEnd, EVENT_PRIORITY_LOW, [](IEvent* event){ + DrawColViewer(); + }); } diff --git a/soh/soh/Enhancements/debugger/hookDebugger.cpp b/soh/soh/Enhancements/debugger/hookDebugger.cpp deleted file mode 100644 index 709bbb1d42c..00000000000 --- a/soh/soh/Enhancements/debugger/hookDebugger.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "hookDebugger.h" -#include "soh/SohGui/SohGui.hpp" -#include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/SohGui/UIWidgets.hpp" -#include "soh/OTRGlobals.h" -#include -#include - -static std::map*> hookData; - -static bool hookOptCollapseAll; // A bool that will collapse all hook group once -static bool hookOptExpandAll; // A bool that will expand all hook group once - -const ImVec4 grey = ImVec4(0.75, 0.75, 0.75, 1); -const ImVec4 yellow = ImVec4(1, 1, 0, 1); -const ImVec4 red = ImVec4(1, 0, 0, 1); - -void DrawHookRegisteringInfos(const char* hookName) { - size_t numHooks = (*hookData[hookName]).size(); - - if (numHooks == 0) { - ImGui::TextColored(grey, "No hooks found"); - return; - } - - ImGui::Text("Total Registered: %d", numHooks); - - if (ImGui::BeginTable(("Table##" + std::string(hookName)).c_str(), 4, - ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable | - ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit)) { - ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_WidthFixed); - ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_WidthFixed); - ImGui::TableSetupColumn("Registration Info", ImGuiTableColumnFlags_WidthStretch); - ImGui::TableSetupColumn("# Calls", ImGuiTableColumnFlags_WidthFixed); - ImGui::TableHeadersRow(); - for (auto& [id, hookInfo] : (*hookData[hookName])) { - ImGui::TableNextRow(); - - ImGui::TableNextColumn(); - ImGui::Text("%d", id); - - ImGui::TableNextColumn(); - switch (hookInfo.registering.type) { - case HOOK_TYPE_NORMAL: - ImGui::Text("Normal"); - break; - case HOOK_TYPE_ID: - ImGui::Text("ID"); - break; - case HOOK_TYPE_PTR: - ImGui::Text("Ptr"); - break; - case HOOK_TYPE_FILTER: - ImGui::Text("Filter"); - break; - default: - ImGui::TextColored(red, "[UNKNOWN]"); - break; - } - - ImGui::TableNextColumn(); - if (hookInfo.registering.valid) { - // Replace the space after the return type of the parent function with a non-breaking space - std::string parentFunction = std::string(hookInfo.registering.function); - size_t pos = parentFunction.find_first_of(" "); - if (pos != std::string::npos) { - parentFunction.replace(pos, 1, "\u00A0"); - } - // Non breaking space to keep the arrow with the parent function - ImGui::TextWrapped("%s(%d:%d) <-\u00A0%s", hookInfo.registering.file, hookInfo.registering.line, - hookInfo.registering.column, parentFunction.c_str()); - } else { - ImGui::TextColored(yellow, "[Unavailable]"); - } - - ImGui::TableNextColumn(); - ImGui::Text("%d", hookInfo.calls); - } - ImGui::EndTable(); - } -} - -void HookDebuggerWindow::DrawElement() { - bool collapseLogic = false; - bool doingCollapseOrExpand = hookOptExpandAll || hookOptCollapseAll; - - ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0)); -#ifndef __cpp_lib_source_location - ImGui::TextColored(yellow, "Some features of the Hook Debugger are unavailable because SoH was compiled " - "without \"\" support " - "(\"__cpp_lib_source_location\" not defined in \"\")."); -#endif - - if (UIWidgets::Button("Expand All", UIWidgets::ButtonOptions().Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline))) { - hookOptCollapseAll = false; - hookOptExpandAll = true; - } - ImGui::SameLine(); - if (UIWidgets::Button("Collapse All", - UIWidgets::ButtonOptions().Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline))) { - hookOptExpandAll = false; - hookOptCollapseAll = true; - } - - ImGui::PushFont(OTRGlobals::Instance->fontMonoLarger); - - for (auto& [hookName, _] : hookData) { - if (doingCollapseOrExpand) { - if (hookOptExpandAll) { - collapseLogic = true; - } else if (hookOptCollapseAll) { - collapseLogic = false; - } - ImGui::SetNextItemOpen(collapseLogic, ImGuiCond_Always); - } - - if (ImGui::TreeNode(hookName)) { - DrawHookRegisteringInfos(hookName); - ImGui::TreePop(); - } - } - - ImGui::PopFont(); - ImGui::EndDisabled(); - - if (doingCollapseOrExpand) { - hookOptExpandAll = false; - hookOptCollapseAll = false; - } -} - -void HookDebuggerWindow::InitElement() { - hookOptExpandAll = false; - hookOptCollapseAll = false; - -#define DEFINE_HOOK(name, _) hookData.insert({ #name, GameInteractor::Instance->GetHookData() }); - -#include "../game-interactor/GameInteractor_HookTable.h" - -#undef DEFINE_HOOK -} diff --git a/soh/soh/Enhancements/debugger/hookDebugger.h b/soh/soh/Enhancements/debugger/hookDebugger.h deleted file mode 100644 index c1f439f302f..00000000000 --- a/soh/soh/Enhancements/debugger/hookDebugger.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef hookDebugger_h -#define hookDebugger_h - -#include - -class HookDebuggerWindow final : public Ship::GuiWindow { - public: - using GuiWindow::GuiWindow; - - void InitElement() override; - void DrawElement() override; - void UpdateElement() override{}; -}; - -#endif // hookDebugger_h diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index e7d892db9da..b164b46bc2b 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -109,8 +109,6 @@ void GameInteractor_SetTriforceHuntCreditsWarpActive(uint8_t state); #include "GameInteractionEffect.h" -typedef uint32_t HOOK_ID; - enum HookType { HOOK_TYPE_NORMAL, HOOK_TYPE_ID, @@ -236,309 +234,6 @@ class GameInteractor { static GameInteractionEffectQueryResult ApplyEffect(GameInteractionEffectBase& effect); static GameInteractionEffectQueryResult RemoveEffect(RemovableGameInteractionEffect& effect); - // Game Hooks - // - // Hooks should be idempotent and execution order is not guaranteed. - // If two operations must happen in a specific order, they should be placed in the same hook. - HOOK_ID nextHookId = 1; - - template struct RegisteredGameHooks { - inline static std::unordered_map functions; - inline static std::unordered_map> functionsForID; - inline static std::unordered_map> functionsForPtr; - inline static std::unordered_map> functionsForFilter; - - // Used for the hook debugger - inline static std::map hookData; - }; - - template struct HooksToUnregister { - inline static std::vector hooks; - inline static std::vector hooksForID; - inline static std::vector hooksForPtr; - inline static std::vector hooksForFilter; - }; - - template std::map* GetHookData() { - return &RegisteredGameHooks::hookData; - } - - // General Hooks - template -#ifdef __cpp_lib_source_location - HOOK_ID RegisterGameHook(typename H::fn h, const std::source_location location = std::source_location::current()) { -#else - HOOK_ID RegisterGameHook(typename H::fn h) { -#endif - if (this->nextHookId == 0 || this->nextHookId >= UINT32_MAX) - this->nextHookId = 1; - while (RegisteredGameHooks::functions.find(this->nextHookId) != RegisteredGameHooks::functions.end()) { - this->nextHookId++; - } - - RegisteredGameHooks::functions[this->nextHookId] = h; - RegisteredGameHooks::hookData[this->nextHookId] = - HookInfo{ 0, GET_CURRENT_REGISTERING_INFO(HOOK_TYPE_NORMAL) }; - return this->nextHookId++; - } - - template void UnregisterGameHook(HOOK_ID hookId) { - if (hookId == 0) - return; - HooksToUnregister::hooks.push_back(hookId); - } - - template void ExecuteHooks(Args&&... args) { - // Remove pending hooks for this type - for (auto& hookId : HooksToUnregister::hooks) { - RegisteredGameHooks::functions.erase(hookId); - RegisteredGameHooks::hookData.erase(hookId); - } - HooksToUnregister::hooks.clear(); - // Execute hooks - for (auto& hook : RegisteredGameHooks::functions) { - hook.second(std::forward(args)...); - RegisteredGameHooks::hookData[hook.first].calls += 1; - } - } - - // ID based Hooks - template -#ifdef __cpp_lib_source_location - HOOK_ID RegisterGameHookForID(int32_t id, typename H::fn h, - std::source_location location = std::source_location::current()) { -#else - HOOK_ID RegisterGameHookForID(int32_t id, typename H::fn h) { -#endif - if (this->nextHookId == 0 || this->nextHookId >= UINT32_MAX) - this->nextHookId = 1; - while (RegisteredGameHooks::functionsForID[id].find(this->nextHookId) != - RegisteredGameHooks::functionsForID[id].end()) { - this->nextHookId++; - } - - RegisteredGameHooks::functionsForID[id][this->nextHookId] = h; - RegisteredGameHooks::hookData[this->nextHookId] = HookInfo{ 0, GET_CURRENT_REGISTERING_INFO(HOOK_TYPE_ID) }; - return this->nextHookId++; - } - - template void UnregisterGameHookForID(HOOK_ID hookId) { - if (hookId == 0) - return; - HooksToUnregister::hooksForID.push_back(hookId); - } - - template void ExecuteHooksForID(int32_t id, Args&&... args) { - // Remove pending hooks for this type - for (auto hookIdIt = HooksToUnregister::hooksForID.begin(); - hookIdIt != HooksToUnregister::hooksForID.end();) { - bool remove = false; - - if (RegisteredGameHooks::functionsForID[id].size() == 0) { - break; - } - - for (auto it = RegisteredGameHooks::functionsForID[id].begin(); - it != RegisteredGameHooks::functionsForID[id].end();) { - if (it->first == *hookIdIt) { - it = RegisteredGameHooks::functionsForID[id].erase(it); - RegisteredGameHooks::hookData.erase(*hookIdIt); - remove = true; - break; - } else { - ++it; - } - } - - if (remove) { - hookIdIt = HooksToUnregister::hooksForID.erase(hookIdIt); - } else { - ++hookIdIt; - } - } - // Execute hooks - for (auto& hook : RegisteredGameHooks::functionsForID[id]) { - hook.second(std::forward(args)...); - RegisteredGameHooks::hookData[hook.first].calls += 1; - } - } - - // PTR based Hooks - template -#ifdef __cpp_lib_source_location - HOOK_ID RegisterGameHookForPtr(uintptr_t ptr, typename H::fn h, - const std::source_location location = std::source_location::current()) { -#else - HOOK_ID RegisterGameHookForPtr(uintptr_t ptr, typename H::fn h) { -#endif - if (this->nextHookId == 0 || this->nextHookId >= UINT32_MAX) - this->nextHookId = 1; - while (RegisteredGameHooks::functionsForPtr[ptr].find(this->nextHookId) != - RegisteredGameHooks::functionsForPtr[ptr].end()) { - this->nextHookId++; - } - - RegisteredGameHooks::functionsForPtr[ptr][this->nextHookId] = h; - RegisteredGameHooks::hookData[this->nextHookId] = HookInfo{ 0, GET_CURRENT_REGISTERING_INFO(HOOK_TYPE_PTR) }; - return this->nextHookId++; - } - - template void UnregisterGameHookForPtr(HOOK_ID hookId) { - if (hookId == 0) - return; - HooksToUnregister::hooksForPtr.push_back(hookId); - } - - template void ExecuteHooksForPtr(uintptr_t ptr, Args&&... args) { - // Remove pending hooks for this type - for (auto hookIdIt = HooksToUnregister::hooksForPtr.begin(); - hookIdIt != HooksToUnregister::hooksForPtr.end();) { - bool remove = false; - - if (RegisteredGameHooks::functionsForPtr[ptr].size() == 0) { - break; - } - - for (auto it = RegisteredGameHooks::functionsForPtr[ptr].begin(); - it != RegisteredGameHooks::functionsForPtr[ptr].end();) { - if (it->first == *hookIdIt) { - it = RegisteredGameHooks::functionsForPtr[ptr].erase(it); - RegisteredGameHooks::hookData.erase(*hookIdIt); - remove = true; - break; - } else { - ++it; - } - } - - if (remove) { - hookIdIt = HooksToUnregister::hooksForPtr.erase(hookIdIt); - } else { - ++hookIdIt; - } - } - // Execute hooks - for (auto& hook : RegisteredGameHooks::functionsForPtr[ptr]) { - hook.second(std::forward(args)...); - RegisteredGameHooks::hookData[hook.first].calls += 1; - } - } - - // Filter based Hooks - template -#ifdef __cpp_lib_source_location - HOOK_ID RegisterGameHookForFilter(typename H::filter f, typename H::fn h, - const std::source_location location = std::source_location::current()) { -#else - HOOK_ID RegisterGameHookForFilter(typename H::filter f, typename H::fn h) { -#endif - if (this->nextHookId == 0 || this->nextHookId >= UINT32_MAX) - this->nextHookId = 1; - while (RegisteredGameHooks::functionsForFilter.find(this->nextHookId) != - RegisteredGameHooks::functionsForFilter.end()) { - this->nextHookId++; - } - - RegisteredGameHooks::functionsForFilter[this->nextHookId] = std::make_pair(f, h); - RegisteredGameHooks::hookData[this->nextHookId] = - HookInfo{ 0, GET_CURRENT_REGISTERING_INFO(HOOK_TYPE_FILTER) }; - return this->nextHookId++; - } - - template void UnregisterGameHookForFilter(HOOK_ID hookId) { - if (hookId == 0) - return; - HooksToUnregister::hooksForFilter.push_back(hookId); - } - - template void ExecuteHooksForFilter(Args&&... args) { - // Remove pending hooks for this type - for (auto& hookId : HooksToUnregister::hooksForFilter) { - RegisteredGameHooks::functionsForFilter.erase(hookId); - RegisteredGameHooks::hookData.erase(hookId); - } - HooksToUnregister::hooksForFilter.clear(); - // Execute hooks - for (auto& hook : RegisteredGameHooks::functionsForFilter) { - if (hook.second.first(std::forward(args)...)) { - hook.second.second(std::forward(args)...); - RegisteredGameHooks::hookData[hook.first].calls += 1; - } - } - } - - template void ProcessUnregisteredHooks() { - // Normal - for (auto& hookId : HooksToUnregister::hooks) { - RegisteredGameHooks::functions.erase(hookId); - RegisteredGameHooks::hookData.erase(hookId); - } - HooksToUnregister::hooks.clear(); - - // ID - for (auto& hookId : HooksToUnregister::hooksForID) { - for (auto& idGroup : RegisteredGameHooks::functionsForID) { - for (auto it = idGroup.second.begin(); it != idGroup.second.end();) { - if (it->first == hookId) { - it = idGroup.second.erase(it); - RegisteredGameHooks::hookData.erase(hookId); - } else { - ++it; - } - } - } - } - HooksToUnregister::hooksForID.clear(); - - // Ptr - for (auto& hookId : HooksToUnregister::hooksForPtr) { - for (auto& ptrGroup : RegisteredGameHooks::functionsForPtr) { - for (auto it = ptrGroup.second.begin(); it != ptrGroup.second.end();) { - if (it->first == hookId) { - it = ptrGroup.second.erase(it); - RegisteredGameHooks::hookData.erase(hookId); - } else { - ++it; - } - } - } - } - HooksToUnregister::hooksForPtr.clear(); - - // Filter - for (auto& hookId : HooksToUnregister::hooksForFilter) { - RegisteredGameHooks::functionsForFilter.erase(hookId); - RegisteredGameHooks::hookData.erase(hookId); - } - HooksToUnregister::hooksForFilter.clear(); - } - - void RemoveAllQueuedHooks() { -#define DEFINE_HOOK(name, _) ProcessUnregisteredHooks(); - -#include "GameInteractor_HookTable.h" - -#undef DEFINE_HOOK - } - - class HookFilter { - public: - static auto ActorNotPlayer(Actor* actor) { - return actor->id != ACTOR_PLAYER; - } - // For use with Should hooks - static auto SActorNotPlayer(Actor* actor, bool* result) { - return actor->id != ACTOR_PLAYER; - } - static auto ActorMatchIdAndParams(int16_t id, int16_t params) { - return [id, params](Actor* actor) { return actor->id == id && actor->params == params; }; - } - // For use with Should hooks - static auto SActorMatchIdAndParams(int16_t id, int16_t params) { - return [id, params](Actor* actor, bool* result) { return actor->id == id && actor->params == params; }; - } - }; - #define DEFINE_HOOK(name, args) \ struct name { \ typedef std::function fn; \ diff --git a/soh/soh/Enhancements/kaleido.cpp b/soh/soh/Enhancements/kaleido.cpp index 68e78032a2c..668de4c3bba 100644 --- a/soh/soh/Enhancements/kaleido.cpp +++ b/soh/soh/Enhancements/kaleido.cpp @@ -367,7 +367,7 @@ extern "C" void RandoKaleido_DrawMiscCollectibles(PlayState* play) { OTRGlobals::Instance->gRandoContext->GetKaleido()->Draw(play); } -extern "C" void RandoKaleido_UpdateMiscCollectibles(int16_t inDungeonScene) { +extern "C" void RandoKaleido_UpdateMiscCollectibles(IEvent* event) { PauseContext* pauseCtx = &gPlayState->pauseCtx; if (pauseCtx->randoQuestMode && pauseCtx->pageIndex == PAUSE_QUEST) { OTRGlobals::Instance->gRandoContext->GetKaleido()->Update(gPlayState); @@ -602,8 +602,7 @@ void KaleidoEntryOcarinaButtons::Draw(PlayState* play, std::vector* mEntryD } // namespace Rando static void RandoKaleido_RegisterHooks() { - GameInteractor::Instance->RegisterGameHook( - RandoKaleido_UpdateMiscCollectibles); + REGISTER_LISTENER(OnKaleidoscopeUpdate, EVENT_PRIORITY_LOW, Rando::RandoKaleido_UpdateMiscCollectibles); } static RegisterShipInitFunc initFunc(RandoKaleido_RegisterHooks); diff --git a/soh/soh/Enhancements/kaleido.h b/soh/soh/Enhancements/kaleido.h index 922a1dac319..fcfd42b1802 100644 --- a/soh/soh/Enhancements/kaleido.h +++ b/soh/soh/Enhancements/kaleido.h @@ -172,7 +172,6 @@ class Kaleido { extern "C" { #endif void RandoKaleido_DrawMiscCollectibles(PlayState* play); -void RandoKaleido_UpdateMiscCollectibles(int16_t inDungeonScene); #ifdef __cplusplus } #endif diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 6d7ecf3b745..e2e1f00e0b1 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -58,16 +58,16 @@ void SwitchAge() { Entrance_SetEntranceDiscovered(ENTR_LINKS_HOUSE_CHILD_SPAWN, false); } - static HOOK_ID hookId = 0; + static ListenerID hookId = -1; hookId = REGISTER_VB_SHOULD(VB_INFLICT_VOID_DAMAGE, { *should = false; - GameInteractor::Instance->UnregisterGameHookForID(hookId); + UNREGISTER_LISTENER(OnVanillaBehavior, hookId); }); } /// Switches Link's age and respawns him at the last entrance he entered. void RegisterOcarinaTimeTravel() { - GameInteractor::Instance->RegisterGameHook([]() { + REGISTER_LISTENER(OnOcarinaSongAction, EVENT_PRIORITY_LOW, [](IEvent* event) { if (!GameInteractor::IsSaveLoaded(true) || !CVarGetInteger(CVAR_ENHANCEMENT("TimeTravel"), 0)) { return; } @@ -117,19 +117,19 @@ bool IsHyperBossesActive() { } void UpdateHyperBossesState() { - static uint32_t actorUpdateHookId = 0; - if (actorUpdateHookId != 0) { - GameInteractor::Instance->UnregisterGameHook(actorUpdateHookId); - actorUpdateHookId = 0; + static ListenerID actorUpdateHookId = -1; + if (actorUpdateHookId != -1) { + UNREGISTER_LISTENER(OnActorUpdate, actorUpdateHookId); + actorUpdateHookId = -1; } if (IsHyperBossesActive()) { - actorUpdateHookId = - GameInteractor::Instance->RegisterGameHook([](void* refActor) { + actorUpdateHookId = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { // Run the update function a second time to make bosses move and act twice as fast. + OnActorUpdate* ev = reinterpret_cast(event); Player* player = GET_PLAYER(gPlayState); - Actor* actor = static_cast(refActor); + Actor* actor = static_cast(ev->actor); uint8_t isBossActor = actor->id == ACTOR_BOSS_GOMA || // Gohma actor->id == ACTOR_BOSS_DODONGO || // King Dodongo @@ -169,8 +169,8 @@ void UpdateHyperBossesState() { void RegisterHyperBosses() { UpdateHyperBossesState(); - GameInteractor::Instance->RegisterGameHook( - [](int16_t fileNum) { UpdateHyperBossesState(); }); + REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, + [](IEvent* event) { UpdateHyperBossesState(); }); } void InitMods() { diff --git a/soh/soh/Enhancements/nametag.cpp b/soh/soh/Enhancements/nametag.cpp index 1989b355282..8e9da24b7c5 100644 --- a/soh/soh/Enhancements/nametag.cpp +++ b/soh/soh/Enhancements/nametag.cpp @@ -315,10 +315,10 @@ void RemoveAllNameTags() { } void NameTag_RegisterHooks() { - static HOOK_ID gameStatUpdateHookID = 0; - static HOOK_ID drawHookID = 0; - static HOOK_ID playDestroyHookID = 0; - static HOOK_ID actorDestroyHookID = 0; + static ListenerID gameStatUpdateHookID = -1; + static ListenerID drawHookID = -1; + static ListenerID playDestroyHookID = -1; + static ListenerID actorDestroyHookID = -1; static bool sRegisteredHooks = false; // Hooks already (un)registered based on nametags @@ -326,10 +326,10 @@ void NameTag_RegisterHooks() { return; } - GameInteractor::Instance->UnregisterGameHook(gameStatUpdateHookID); - GameInteractor::Instance->UnregisterGameHook(drawHookID); - GameInteractor::Instance->UnregisterGameHook(playDestroyHookID); - GameInteractor::Instance->UnregisterGameHook(actorDestroyHookID); + UNREGISTER_LISTENER(OnGameFrameUpdate, gameStatUpdateHookID); + UNREGISTER_LISTENER(OnPlayDrawEnd, drawHookID); + UNREGISTER_LISTENER(OnPlayDestroy, playDestroyHookID); + UNREGISTER_LISTENER(OnActorDestroy, actorDestroyHookID); gameStatUpdateHookID = 0; drawHookID = 0; playDestroyHookID = 0; @@ -343,16 +343,17 @@ void NameTag_RegisterHooks() { sRegisteredHooks = true; // Reorder tags every frame to mimic depth rendering - gameStatUpdateHookID = - GameInteractor::Instance->RegisterGameHook(UpdateNameTags); + gameStatUpdateHookID = REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { UpdateNameTags(); }); // Render name tags at the end of the Play World drawing - drawHookID = GameInteractor::Instance->RegisterGameHook(DrawNameTags); + drawHookID = REGISTER_LISTENER(OnPlayDrawEnd, EVENT_PRIORITY_LOW, [](IEvent* event) { DrawNameTags(); }); // Remove all name tags on play state destroy as all actors are removed anyways - playDestroyHookID = GameInteractor::Instance->RegisterGameHook(RemoveAllNameTags); + playDestroyHookID = REGISTER_LISTENER(OnPlayDestroy, EVENT_PRIORITY_LOW, [](IEvent* event) { RemoveAllNameTags(); }); // Remove all name tags for actor on destroy - actorDestroyHookID = GameInteractor::Instance->RegisterGameHook( - [](void* actor) { NameTag_RemoveAllForActor((Actor*)actor); }); + actorDestroyHookID = REGISTER_LISTENER(OnActorDestroy, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorDestroy* ev = reinterpret_cast(event); + NameTag_RemoveAllForActor((Actor*) ev->actor); + }); } diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 55d19843200..7a10a7ab89f 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -228,10 +228,11 @@ static std::queue randomizerQueuedChecks; static RandomizerCheck randomizerQueuedCheck = RC_UNKNOWN_CHECK; static GetItemEntry randomizerQueuedItemEntry = GET_ITEM_NONE; -void RandomizerOnFlagSetHandler(int16_t flagType, int16_t flag) { +void RandomizerOnFlagSetHandler(IEvent* event) { + OnFlagSet* ev = reinterpret_cast(event); // Consume adult trade items - if (RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE) && flagType == FLAG_RANDOMIZER_INF) { - switch (flag) { + if (RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE) && ev->flagType == FLAG_RANDOMIZER_INF) { + switch (ev->flag) { case RAND_INF_ADULT_TRADES_DMT_TRADE_BROKEN_SWORD: Flags_UnsetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_SWORD_BROKEN); Inventory_ReplaceItem(gPlayState, ITEM_SWORD_BROKEN, Randomizer_GetNextAdultTradeItem()); @@ -243,26 +244,26 @@ void RandomizerOnFlagSetHandler(int16_t flagType, int16_t flag) { } } - if (flagType == FLAG_EVENT_CHECK_INF && flag == EVENTCHKINF_TALON_WOKEN_IN_CASTLE) { + if (ev->flagType == FLAG_EVENT_CHECK_INF && ev->flag == EVENTCHKINF_TALON_WOKEN_IN_CASTLE) { // remove chicken as this is the only use for it Flags_UnsetRandomizerInf(RAND_INF_CHILD_TRADES_HAS_CHICKEN); } - if (flagType == FLAG_EVENT_CHECK_INF && flag == EVENTCHKINF_OBTAINED_ZELDAS_LETTER) { + if (ev->flagType == FLAG_EVENT_CHECK_INF && ev->flag == EVENTCHKINF_OBTAINED_ZELDAS_LETTER) { Flags_SetRandomizerInf(RAND_INF_ZELDAS_LETTER); } - if (flagType == FLAG_EVENT_CHECK_INF && flag == EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) { + if (ev->flagType == FLAG_EVENT_CHECK_INF && ev->flag == EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) { if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG)) { Flags_SetRandomizerInf(RAND_INF_TALON_SENT_MALON_HOME); } } - RandomizerCheck rc = GetRandomizerCheckFromFlag(flagType, flag); + RandomizerCheck rc = GetRandomizerCheckFromFlag(ev->flagType, ev->flag); if (rc == RC_UNKNOWN_CHECK) return; - if (flagType == FLAG_GS_TOKEN && + if (ev->flagType == FLAG_GS_TOKEN && Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_TOKENS).Is(RO_TOKENSANITY_OFF)) { Rando::Context::GetInstance()->GetItemLocation(rc)->SetCheckStatus(RCSHOW_COLLECTED); return; @@ -277,64 +278,65 @@ void RandomizerOnFlagSetHandler(int16_t flagType, int16_t flag) { randomizerQueuedChecks.push(rc); } -void RandomizerOnSceneFlagSetHandler(int16_t sceneNum, int16_t flagType, int16_t flag) { - if (flagType == FLAG_SCENE_SWITCH) { - auto dungeonInfo = Rando::Context::GetInstance()->GetDungeons()->GetDungeonFromScene(sceneNum); +void RandomizerOnSceneFlagSetHandler(IEvent* event) { + OnSceneFlagSet* ev = reinterpret_cast(event); + if (ev->flagType == FLAG_SCENE_SWITCH) { + auto dungeonInfo = Rando::Context::GetInstance()->GetDungeons()->GetDungeonFromScene(ev->sceneNum); bool isVanilla = dungeonInfo == nullptr || dungeonInfo->IsVanilla(); - switch (sceneNum) { + switch (ev->sceneNum) { case SCENE_GERUDOS_FORTRESS: if (RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES).IsNot(RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) && - flag == 0x3A) { + ev->flag == 0x3A) { Flags_SetRandomizerInf(RAND_INF_GF_GTG_GATE_PERMANENTLY_OPEN); } break; case SCENE_DEKU_TREE: - if (!isVanilla && flag == 0x27) { + if (!isVanilla && ev->flag == 0x27) { Flags_SetRandomizerInf(RAND_INF_DEKU_TREE_MQ_TORCH_SWITCH); } break; case SCENE_DODONGOS_CAVERN: - if (!isVanilla && flag == 0x25) { + if (!isVanilla && ev->flag == 0x25) { Flags_SetRandomizerInf(RAND_INF_DODONGOS_CAVERN_MQ_SILVER_RUPEES); } break; case SCENE_JABU_JABU: - if (isVanilla && flag == 0x3b) { + if (isVanilla && ev->flag == 0x3b) { Flags_SetRandomizerInf(RAND_INF_JABU_JABUS_BELLY_FIRST_SWITCH); } break; case SCENE_FOREST_TEMPLE: - if (flag == 0x26) { + if (ev->flag == 0x26) { Flags_SetRandomizerInf(RAND_INF_FOREST_DRAINED_WELL); - } else if (flag == 0x25) { + } else if (ev->flag == 0x25) { Flags_SetRandomizerInf(RAND_INF_FOREST_LOBBY_EYES); if (!isVanilla) { Flags_SetSwitch(gPlayState, 0x2a); } - } else if (!isVanilla && flag == 0x2a) { + } else if (!isVanilla && ev->flag == 0x2a) { Flags_SetRandomizerInf(RAND_INF_FOREST_LOBBY_EYES); Flags_SetSwitch(gPlayState, 0x25); - } else if (!isVanilla && flag == 0x21) { + } else if (!isVanilla && ev->flag == 0x21) { Flags_SetRandomizerInf(RAND_INF_FOREST_MQ_COURTYARD_WEB_BURNT); } break; case SCENE_FIRE_TEMPLE: - if (!isVanilla && flag == 0x28) { + if (!isVanilla && ev->flag == 0x28) { Flags_SetRandomizerInf(RAND_INF_FIRE_MQ_LOBBY_TORCHES); } break; case SCENE_SPIRIT_TEMPLE: - if (isVanilla && flag == 0x23) { + if (isVanilla && ev->flag == 0x23) { Flags_SetRandomizerInf(RAND_INF_SPIRIT_SUN_ON_FLOOR_ON); - } else if (!isVanilla && flag == 0x37) { + } else if (!isVanilla && ev->flag == 0x37) { Flags_SetRandomizerInf(RAND_INF_SPIRIT_MQ_LOBBY_SILVER_RUPEES); } break; } } - RandomizerCheck rc = GetRandomizerCheckFromSceneFlag(sceneNum, flagType, flag); + RandomizerCheck rc = GetRandomizerCheckFromSceneFlag(ev->sceneNum, ev->flagType, ev->flag); if (rc == RC_UNKNOWN_CHECK) return; @@ -428,14 +430,15 @@ void RandomizerOnPlayerUpdateForItemQueueHandler() { } } -void RandomizerOnItemReceiveHandler(GetItemEntry receivedItemEntry) { +void RandomizerOnItemReceiveHandler(IEvent* event) { + OnItemReceive* ev = reinterpret_cast(event); if (randomizerQueuedCheck == RC_UNKNOWN_CHECK) return; auto loc = Rando::Context::GetInstance()->GetItemLocation(randomizerQueuedCheck); - if (randomizerQueuedItemEntry.modIndex == receivedItemEntry.modIndex && - randomizerQueuedItemEntry.itemId == receivedItemEntry.itemId) { - SPDLOG_INFO("Item received mod {} item {} from RC {}", receivedItemEntry.modIndex, receivedItemEntry.itemId, + if (randomizerQueuedItemEntry.modIndex == ev->itemEntry.modIndex && + randomizerQueuedItemEntry.itemId == ev->itemEntry.itemId) { + SPDLOG_INFO("Item received mod {} item {} from RC {}", ev->itemEntry.modIndex, ev->itemEntry.itemId, static_cast(randomizerQueuedCheck)); loc->SetCheckStatus(RCSHOW_COLLECTED); CheckTracker::SpoilAreaFromCheck(randomizerQueuedCheck); @@ -446,9 +449,9 @@ void RandomizerOnItemReceiveHandler(GetItemEntry receivedItemEntry) { randomizerQueuedItemEntry = GET_ITEM_NONE; } - if (receivedItemEntry.modIndex == MOD_NONE && - (receivedItemEntry.itemId == ITEM_HEART_PIECE || receivedItemEntry.itemId == ITEM_HEART_PIECE_2 || - receivedItemEntry.itemId == ITEM_HEART_CONTAINER)) { + if (ev->itemEntry.modIndex == MOD_NONE && + (ev->itemEntry.itemId == ITEM_HEART_PIECE || ev->itemEntry.itemId == ITEM_HEART_PIECE_2 || + ev->itemEntry.itemId == ITEM_HEART_CONTAINER)) { gSaveContext.healthAccumulator = MAX_HEALTH; // Refill 20 hearts if ((s32)(gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000) { gSaveContext.inventory.questItems ^= 0x40000000; @@ -459,8 +462,8 @@ void RandomizerOnItemReceiveHandler(GetItemEntry receivedItemEntry) { if (loc->GetRandomizerCheck() == RC_SPIRIT_TEMPLE_SILVER_GAUNTLETS_CHEST && !CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - static uint32_t updateHook; - updateHook = GameInteractor::Instance->RegisterGameHook([]() { + static ListenerID updateHook; + updateHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent *event) { Player* player = GET_PLAYER(gPlayState); if (player == NULL || Player_InBlockingCsMode(gPlayState, player) || player->stateFlags1 & PLAYER_STATE1_IN_ITEM_CS || player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM || @@ -474,7 +477,7 @@ void RandomizerOnItemReceiveHandler(GetItemEntry receivedItemEntry) { gPlayState->transitionType = TRANS_TYPE_SANDSTORM_END; GET_PLAYER(gPlayState)->stateFlags1 &= ~PLAYER_STATE1_IN_CUTSCENE; Player_TryCsAction(gPlayState, NULL, 8); - GameInteractor::Instance->UnregisterGameHook(updateHook); + UNREGISTER_LISTENER(OnPlayerUpdate, updateHook); }); } } @@ -853,11 +856,12 @@ void RandomizerOnDialogMessageHandler() { extern "C" void func_80A5475C(EnHeishi2* CastleGuard, PlayState* play); -void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_list originalArgs) { +void RandomizerOnVanillaBehaviorHandler(IEvent* event) { + OnVanillaBehavior* ev = reinterpret_cast(event); va_list args; - va_copy(args, originalArgs); + va_copy(args, ev->originalArgs); - switch (id) { + switch (ev->flag) { case VB_CLIMB: if (RAND_GET_OPTION(RSK_SHUFFLE_CLIMB) && !Flags_GetRandomizerInf(RAND_INF_CAN_CLIMB)) { s32* x = va_arg(args, s32*); @@ -870,14 +874,14 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; case VB_CRAWL: - *should = *should && Flags_GetRandomizerInf(RAND_INF_CAN_CRAWL); + *ev->result = *ev->result && Flags_GetRandomizerInf(RAND_INF_CAN_CRAWL); break; case VB_ALLOW_ENTRANCE_CS_FOR_EITHER_AGE: { s32 entranceIndex = va_arg(args, s32); // Allow Nabooru fight cutscene to play for child in rando if (entranceIndex == ENTR_SPIRIT_TEMPLE_BOSS_ENTRANCE) { - *should = true; + *ev->result = true; } break; } @@ -885,7 +889,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l // We force fast chests if SkipGetItemAnimation is enabled because the camera in the CS looks pretty wonky // otherwise if (CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_JUNK)) { - *should = false; + *ev->result = false; } break; } @@ -903,92 +907,92 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Player* player = GET_PLAYER(gPlayState); Player_SetupWaitForPutAway(gPlayState, player, func_8083A434_override); - *should = false; + *ev->result = false; break; } case VB_SPAWN_FIRE_ARROW: - *should = !Flags_GetTreasure(gPlayState, 0x1F); + *ev->result = !Flags_GetTreasure(gPlayState, 0x1F); break; case VB_PLAY_NABOORU_CAPTURED_CS: // This behavior is replicated for randomizer in RandomizerOnItemReceiveHandler - *should = false; + *ev->result = false; break; case VB_SHIEK_PREPARE_TO_GIVE_SERENADE_OF_WATER: { - *should = + *ev->result = !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER) && !Flags_GetTreasure(gPlayState, 0x2); break; } case VB_BE_ELIGIBLE_FOR_SERENADE_OF_WATER: - *should = + *ev->result = !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER) && Flags_GetTreasure(gPlayState, 0x2); break; case VB_BE_ELIGIBLE_FOR_PRELUDE_OF_LIGHT: - *should = + *ev->result = !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST); break; case VB_MIDO_SPAWN: if (RAND_GET_OPTION(RSK_FOREST).IsNot(RO_CLOSED_FOREST_OFF) && !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) { - *should = true; + *ev->result = true; } break; case VB_MOVE_MIDO_IN_KOKIRI_FOREST: if (RAND_GET_OPTION(RSK_FOREST).Is(RO_CLOSED_FOREST_OFF) && gSaveContext.cutsceneIndex == 0) { - *should = true; + *ev->result = true; } break; case VB_MALON_RETURN_FROM_CASTLE: - *should = Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) && + *ev->result = Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) && Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); break; case VB_SEND_MALON_HOME: - *should = Flags_GetRandomizerInf(RAND_INF_TALON_SENT_MALON_HOME); + *ev->result = Flags_GetRandomizerInf(RAND_INF_TALON_SENT_MALON_HOME); break; case VB_MIDO_CONSIDER_DEKU_TREE_DEAD: - *should = Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD); + *ev->result = Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD); break; case VB_OPEN_CHEST: - *should = *should && Flags_GetRandomizerInf(RAND_INF_CAN_OPEN_CHEST); + *ev->result = *ev->result && Flags_GetRandomizerInf(RAND_INF_CAN_OPEN_CHEST); break; case VB_OPEN_KOKIRI_FOREST: - *should = Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD) || + *ev->result = Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD) || RAND_GET_OPTION(RSK_FOREST).IsNot(RO_CLOSED_FOREST_ON); break; case VB_BE_ELIGIBLE_FOR_DARUNIAS_JOY_REWARD: - *should = !Flags_GetRandomizerInf(RAND_INF_DARUNIAS_JOY); + *ev->result = !Flags_GetRandomizerInf(RAND_INF_DARUNIAS_JOY); break; case VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS: - *should = LINK_IS_ADULT && (gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_TEMPLE_OF_TIME) && + *ev->result = LINK_IS_ADULT && (gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_TEMPLE_OF_TIME) && !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && MeetsLACSRequirements(); break; case VB_BE_ELIGIBLE_FOR_NOCTURNE_OF_SHADOW: - *should = !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL) && LINK_IS_ADULT && + *ev->result = !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL) && LINK_IS_ADULT && gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_KAKARIKO_VILLAGE && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && gSaveContext.cutsceneIndex < 0xFFF0; break; case VB_BE_ELIGIBLE_FOR_CHILD_ROLLING_GORON_REWARD: { // Don't require a bomb bag to get prize in rando - *should = true; + *ev->result = true; break; } case VB_BE_ELIGIBLE_FOR_MAGIC_BEANS_PURCHASE: { if (RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS).Is(RO_SHUFFLE_MERCHANTS_BEANS_ONLY) || RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS).Is(RO_SHUFFLE_MERCHANTS_ALL)) { - *should = gSaveContext.rupees >= + *ev->result = gSaveContext.rupees >= OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_ZR_MAGIC_BEAN_SALESMAN)->GetPrice(); } else if (RAND_GET_OPTION(RSK_SKIP_PLANTING_BEANS)) { - *should = gSaveContext.rupees >= 60; + *ev->result = gSaveContext.rupees >= 60; } else if (BEANS_BOUGHT == 9) { - *should = gSaveContext.rupees >= 99; + *ev->result = gSaveContext.rupees >= 99; } break; } case VB_MAGIC_BEAN_SALESMAN_TAKE_MONEY: { if (BEANS_BOUGHT == 9) { Rupees_ChangeBy(-99); - *should = false; + *ev->result = false; } break; } @@ -998,14 +1002,14 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l guard->unk_300 = TEXT_STATE_CHOICE; guard->unk_30E = 1; guard->actionFunc = func_80A5475C; - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_MASTER_SWORD: if (RAND_GET_OPTION(RSK_SHUFFLE_MASTER_SWORD) || RAND_GET_OPTION(RSK_STARTING_MASTER_SWORD)) { - *should = false; + *ev->result = false; } else { - *should = true; + *ev->result = true; Rando::Context::GetInstance()->GetItemLocation(RC_TOT_MASTER_SWORD)->SetCheckStatus(RCSHOW_COLLECTED); CheckTracker::RecalculateAllAreaTotals(); } @@ -1021,7 +1025,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l item00->itemEntry = Rando::Context::GetInstance()->GetFinalGIEntry( rc, true, (GetItemID)Rando::StaticData::GetLocation(rc)->GetVanillaItem()); item00->actor.draw = (ActorFunc)EnItem00_DrawRandomizedItem; - *should = Rando::Context::GetInstance()->GetItemLocation(rc)->HasObtained(); + *ev->result = Rando::Context::GetInstance()->GetItemLocation(rc)->HasObtained(); } } else if (item00->actor.params == ITEM00_SOH_GIVE_ITEM_ENTRY || item00->actor.params == ITEM00_SOH_GIVE_ITEM_ENTRY_GI) { @@ -1040,12 +1044,12 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l rc, true, (GetItemID)Rando::StaticData::GetLocation(rc)->GetVanillaItem()); itemBHeart->actor.draw = (ActorFunc)ItemBHeart_DrawRandomizedItem; itemBHeart->actor.update = (ActorFunc)ItemBHeart_UpdateRandomizedItem; - *should = Rando::Context::GetInstance()->GetItemLocation(rc)->HasObtained(); + *ev->result = Rando::Context::GetInstance()->GetItemLocation(rc)->HasObtained(); } break; } case VB_MALON_ALREADY_TAUGHT_EPONAS_SONG: { - *should = Flags_GetRandomizerInf(RAND_INF_LEARNED_EPONA_SONG); + *ev->result = Flags_GetRandomizerInf(RAND_INF_LEARNED_EPONA_SONG); break; } case VB_KING_ZORA_THANK_CHILD: { @@ -1053,68 +1057,68 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l if (!Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { GET_PLAYER(gPlayState)->exchangeItemId = EXCH_ITEM_LETTER_RUTO; } - *should = Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP); + *ev->result = Flags_GetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP); break; } case VB_BE_ABLE_TO_EXCHANGE_RUTOS_LETTER: { - *should = LINK_IS_CHILD; + *ev->result = LINK_IS_CHILD; break; } case VB_KING_ZORA_BE_MOVED: { - *should = false; + *ev->result = false; switch (RAND_GET_OPTION(RSK_ZORAS_FOUNTAIN).Get()) { case RO_ZF_CLOSED: if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { - *should = true; + *ev->result = true; } break; case RO_ZF_CLOSED_CHILD: if (LINK_IS_ADULT) { - *should = true; + *ev->result = true; } else if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { - *should = true; + *ev->result = true; } break; case RO_ZF_OPEN: - *should = true; + *ev->result = true; break; } break; } case VB_KING_ZORA_TUNIC_CHECK: { if (!Flags_GetRandomizerInf(RAND_INF_KING_ZORA_THAWED)) { - *should = false; + *ev->result = false; } break; } case VB_BIGGORON_CONSIDER_SWORD_COLLECTED: { - *should = Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_DMT_TRADE_CLAIM_CHECK); + *ev->result = Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_DMT_TRADE_CLAIM_CHECK); break; } case VB_BIGGORON_CONSIDER_TRADE_COMPLETE: { // This being true will prevent other biggoron trades, there are already safeguards in place to prevent // claim check from being traded multiple times, so we don't really need the quest to ever be considered // "complete" - *should = false; + *ev->result = false; break; } case VB_PREVENT_STRENGTH: { if (!Flags_GetRandomizerInf(RAND_INF_CAN_GRAB)) { GET_PLAYER(gPlayState)->stateFlags2 &= ~PLAYER_STATE2_MOVING_DYNAPOLY; - *should = true; + *ev->result = true; } break; } case VB_GORONS_CONSIDER_FIRE_TEMPLE_FINISHED: { - *should = Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP); + *ev->result = Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP); break; } case VB_GORONS_CONSIDER_DODONGOS_CAVERN_FINISHED: { - *should = Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP); + *ev->result = Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP); break; } case VB_GORONS_CONSIDER_TUNIC_COLLECTED: { - *should = Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED); + *ev->result = Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED); break; } case VB_GIVE_ITEM_FROM_ITEM_00: { @@ -1126,7 +1130,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Flags_SetCollectible(gPlayState, item00->collectibleFlag); } Actor_Kill(&item00->actor); - *should = false; + *ev->result = false; } else if (item00->actor.params == ITEM00_SOH_GIVE_ITEM_ENTRY) { Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -1201,24 +1205,24 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(0x32); // EnItem00_SetupAction(item00, func_8001E5C8); - // *should = false; + // *ev->result = false; } else if (item00->actor.params == ITEM00_SOH_GIVE_ITEM_ENTRY_GI) { if (!Actor_HasParent(&item00->actor, gPlayState)) { GiveItemEntryFromActorWithFixedRange(&item00->actor, gPlayState, item00->itemEntry); } EnItem00_SetupAction(item00, func_8001E5C8); - *should = false; + *ev->result = false; } break; } case VB_BE_ELIGIBLE_FOR_SARIAS_SONG: { - *should = !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SARIAS_SONG); + *ev->result = !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SARIAS_SONG); break; } case VB_GIVE_ITEM_FROM_DEKU_THEATER: { EnDntJiji* enDntJiji = va_arg(args, EnDntJiji*); enDntJiji->actionFunc = EnDntJiji_GivePrize; - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_FROM_GRANNYS_SHOP: { @@ -1230,24 +1234,24 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Flags_SetRandomizerInf(RAND_INF_MERCHANTS_GRANNYS_SHOP); granny->actor.parent = NULL; granny->actionFunc = EnDs_Talk; - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_FROM_ANJU_AS_CHILD: { Flags_SetItemGetInf(ITEMGETINF_0C); - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_FROM_ANJU_AS_ADULT: { EnNiwLady* enNiwLady = va_arg(args, EnNiwLady*); Flags_SetItemGetInf(ITEMGETINF_2C); enNiwLady->actionFunc = func_80ABA778; - *should = false; + *ev->result = false; break; } case VB_CHECK_RANDO_PRICE_OF_CARPET_SALESMAN: { if (EnJs_RandoCanGetCarpetMerchantItem()) { - *should = + *ev->result = gSaveContext.rupees < OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_WASTELAND_BOMBCHU_SALESMAN)->GetPrice(); } @@ -1264,18 +1268,18 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l enJs->actionFunc = (EnJsActionFunc)func_80A890C0; enJs->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; Flags_SetRandomizerInf(RAND_INF_MERCHANTS_CARPET_SALESMAN); - *should = true; + *ev->result = true; } break; } case VB_GIVE_BOMBCHUS_FROM_CARPET_SALESMAN: { - *should = + *ev->result = RAND_GET_OPTION(RSK_BOMBCHU_BAG).Is(RO_BOMBCHU_BAG_NONE) || INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU; break; } case VB_CHECK_RANDO_PRICE_OF_MEDIGORON: { if (EnGm_RandoCanGetMedigoronItem()) { - *should = gSaveContext.rupees < + *ev->result = gSaveContext.rupees < OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_GC_MEDIGORON)->GetPrice(); } break; @@ -1284,7 +1288,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l case VB_GIVE_ITEM_FROM_MEDIGORON: case VB_BE_ELIGIBLE_FOR_GIANTS_KNIFE_PURCHASE: { if (EnGm_RandoCanGetMedigoronItem()) { - if (id == VB_GIVE_ITEM_FROM_MEDIGORON) { + if (ev->flag == VB_GIVE_ITEM_FROM_MEDIGORON) { EnGm* enGm = va_arg(args, EnGm*); Flags_SetInfTable(INFTABLE_B1); Flags_SetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON); @@ -1292,11 +1296,11 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l enGm->actionFunc = (EnGmActionFunc)func_80A3DC44; Rupees_ChangeBy(OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_GC_MEDIGORON)->GetPrice() * -1); - *should = false; + *ev->result = false; } else { // Resets "Talked to Medigoron" flag in infTable to restore initial conversation state Flags_UnsetInfTable(INFTABLE_B1); - *should = true; + *ev->result = true; } } break; @@ -1311,7 +1315,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l // Only set inf for buying rando check Flags_SetRandomizerInf(RAND_INF_MERCHANTS_MAGIC_BEAN_SALESMAN); enMs->actionFunc = (EnMsActionFunc)EnMs_Wait; - *should = false; + *ev->result = false; } else if (RAND_GET_OPTION(RSK_SKIP_PLANTING_BEANS)) { Rupees_ChangeBy(-60); Item_Give(NULL, ITEM_BEAN); @@ -1332,19 +1336,19 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l func_80B8FE00(bean); } enMs->actionFunc = (EnMsActionFunc)EnMs_Wait; - *should = false; + *ev->result = false; } break; } case VB_DEKU_THEATER_FINISH_GIVING_PRIZE: - *should = true; + *ev->result = true; break; case VB_FROGS_GO_TO_IDLE: { EnFr* enFr = va_arg(args, EnFr*); if ((enFr->songIndex >= FROG_STORMS && enFr->reward == GI_HEART_PIECE) || (enFr->songIndex < FROG_STORMS && enFr->reward == GI_RUPEE_PURPLE)) { - *should = true; + *ev->result = true; } break; } @@ -1356,13 +1360,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Flags_SetItemGetInf(ITEMGETINF_2E); enNiwLady->actionFunc = func_80ABA778; - *should = false; + *ev->result = false; break; } case VB_TRADE_COJIRO: { Flags_UnsetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_COJIRO); Inventory_ReplaceItem(gPlayState, ITEM_COJIRO, Randomizer_GetNextAdultTradeItem()); - *should = false; + *ev->result = false; break; } case VB_TRADE_ODD_MUSHROOM: { @@ -1374,7 +1378,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l granny->actor.textId = 0x504F; granny->actionFunc = (EnDsActionFunc)EnDs_TalkAfterGiveOddPotion; granny->actor.flags &= ~ACTOR_FLAG_TALK; - *should = false; + *ev->result = false; break; } case VB_TRADE_ODD_POTION: { @@ -1383,13 +1387,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Inventory_ReplaceItem(gPlayState, ITEM_ODD_POTION, Randomizer_GetNextAdultTradeItem()); // Trigger the reward now Flags_SetItemGetInf(ITEMGETINF_31); - *should = false; + *ev->result = false; break; } case VB_TRADE_SAW: { Flags_UnsetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_SAW); Inventory_ReplaceItem(gPlayState, ITEM_SAW, Randomizer_GetNextAdultTradeItem()); - *should = false; + *ev->result = false; break; } case VB_ADULT_KING_ZORA_ITEM_GIVE: { @@ -1419,13 +1423,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Flags_SetRandomizerInf(RAND_INF_KING_ZORA_THAWED); } } - *should = false; + *ev->result = false; break; } case VB_TRADE_FROG: { Flags_UnsetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_FROG); Inventory_ReplaceItem(gPlayState, ITEM_FROG, Randomizer_GetNextAdultTradeItem()); - *should = false; + *ev->result = false; break; } case VB_BUSINESS_SCRUB_DESPAWN: { @@ -1435,13 +1439,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l gPlayState->sceneNum, enShopnuts->actor.params, respawnData); if (scrubIdentity.identity.randomizerCheck != RC_UNKNOWN_CHECK) { - *should = Flags_GetRandomizerInf(scrubIdentity.identity.randomizerInf); + *ev->result = Flags_GetRandomizerInf(scrubIdentity.identity.randomizerInf); } break; } case VB_GIVE_ITEM_FROM_BUSINESS_SCRUB: { EnDns* enDns = va_arg(args, EnDns*); - *should = !ObjectExtension::GetInstance().Has(enDns); + *ev->result = !ObjectExtension::GetInstance().Has(enDns); break; } // To explain the logic because Fado and Grog are linked: @@ -1454,11 +1458,11 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l break; } if (Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_COJIRO)) { - *should = false; + *ev->result = false; } else if (Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_ODD_POTION)) { - *should = true; + *ev->result = true; } else { - *should = Flags_GetItemGetInf(ITEMGETINF_30); // Traded odd mushroom + *ev->result = Flags_GetItemGetInf(ITEMGETINF_30); // Traded odd mushroom } break; } @@ -1468,9 +1472,9 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } if (Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_COJIRO)) { - *should = false; + *ev->result = false; } else { - *should = Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_ODD_POTION); + *ev->result = Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_HAS_ODD_POTION); } break; @@ -1478,11 +1482,11 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l case VB_USE_EYEDROP_DIALOGUE: { // Skip eye drop text on rando if Link went in the water, so you can still receive the dive check EnMk* enMk = va_arg(args, EnMk*); - *should &= enMk->swimFlag == 0; + *ev->result &= enMk->swimFlag == 0; break; } case VB_OFFER_BLUE_POTION: { - *should |= RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE).Is(RO_GENERIC_OFF) && + *ev->result |= RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE).Is(RO_GENERIC_OFF) && INV_CONTENT(ITEM_CLAIM_CHECK) == ITEM_CLAIM_CHECK; break; } @@ -1494,7 +1498,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l EnOkarinaTag* enOkarinaTag = va_arg(args, EnOkarinaTag*); if (enOkarinaTag->switchFlag >= 0 && Flags_GetSwitch(gPlayState, enOkarinaTag->switchFlag)) { Flags_UnsetSwitch(gPlayState, enOkarinaTag->switchFlag); - *should = false; + *ev->result = false; } } } @@ -1505,21 +1509,21 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l auto dungeon = OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(SCENE_BOTTOM_OF_THE_WELL); if (dungeon->IsVanilla()) { - *should = false; + *ev->result = false; } } break; } case VB_GRANNY_SAY_INSUFFICIENT_RUPEES: { if (EnDs_RandoCanGetGrannyItem()) { - *should = gSaveContext.rupees < + *ev->result = gSaveContext.rupees < OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_KAK_GRANNYS_SHOP)->GetPrice(); } break; } case VB_GRANNY_TAKE_MONEY: { if (EnDs_RandoCanGetGrannyItem()) { - *should = false; + *ev->result = false; Rupees_ChangeBy(OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_KAK_GRANNYS_SHOP)->GetPrice() * -1); } @@ -1527,7 +1531,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } case VB_NEED_BOTTLE_FOR_GRANNYS_ITEM: { // Allow buying the rando item regardless of having a bottle - *should &= !EnDs_RandoCanGetGrannyItem(); + *ev->result &= !EnDs_RandoCanGetGrannyItem(); break; } case VB_GIVE_ITEM_FROM_SHOOTING_GALLERY: { @@ -1535,16 +1539,16 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l enSyatekiMan->getItemId = GI_RUPEE_PURPLE; if (LINK_IS_ADULT) { // Give purple rupee if we've already obtained the reward OR we don't have a bow - *should = Flags_GetItemGetInf(ITEMGETINF_0E) || CUR_UPG_VALUE(UPG_QUIVER) == 0; + *ev->result = Flags_GetItemGetInf(ITEMGETINF_0E) || CUR_UPG_VALUE(UPG_QUIVER) == 0; } else { // Give purple rupee if we've already obtained the reward - *should = Flags_GetItemGetInf(ITEMGETINF_0D); + *ev->result = Flags_GetItemGetInf(ITEMGETINF_0D); } break; } case VB_BE_ELIGIBLE_FOR_ADULT_SHOOTING_GAME_REWARD: { - *should = CUR_UPG_VALUE(UPG_QUIVER) > 0; - if (!*should) { + *ev->result = CUR_UPG_VALUE(UPG_QUIVER) > 0; + if (!*ev->result) { // In Rando without a quiver, display a message reminding the player to come back with a bow Message_StartTextbox(gPlayState, TEXT_SHOOTING_GALLERY_MAN_COME_BACK_WITH_BOW, NULL); } @@ -1555,7 +1559,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l RAND_GET_OPTION(RSK_DOOR_OF_TIME).IsNot(RO_DOOROFTIME_CLOSED) || (INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_TIME && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)); - *should = eligible; + *ev->result = eligible; break; } case VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY: { @@ -1571,7 +1575,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l enGe1->actionFunc = EnGe1_Wait_Archery; EnGe1_SetAnimationIdle(enGe1); // skip the vanilla gives. - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_FROM_SKULLTULA_REWARD: { @@ -1586,7 +1590,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l // let the player farm if (!RAND_GET_OPTION(RSK_SHUFFLE_100_GS_REWARD) || Flags_GetRandomizerInf(RAND_INF_KAK_100_GOLD_SKULLTULA_REWARD)) { - *should = true; + *ev->result = true; break; } @@ -1598,14 +1602,14 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l // because the flag check will pass next time) enSth->actionFunc = (EnSthActionFunc)EnSth_RewardObtainedTalk; } - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_FROM_OCARINA_MEMORY_GAME: { EnSkj* enSkj = va_arg(args, EnSkj*); Flags_SetItemGetInf(ITEMGETINF_17); enSkj->actionFunc = (EnSkjActionFunc)EnSkj_CleanupOcarinaGame; - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_FROM_LOST_DOG: { @@ -1614,14 +1618,14 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l gSaveContext.dogParams = 0; gSaveContext.dogIsLost = false; enHy->actionFunc = func_80A7127C; - *should = false; + *ev->result = false; break; } case VB_GIVE_ITEM_FROM_BOMBCHU_BOWLING: { EnBomBowlPit* enBomBowlPit = va_arg(args, EnBomBowlPit*); if (enBomBowlPit->prizeIndex == EXITEM_BOMB_BAG_BOWLING || enBomBowlPit->prizeIndex == EXITEM_HEART_PIECE_BOWLING) { - *should = false; + *ev->result = false; } break; } @@ -1629,34 +1633,34 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l if (gPlayState->msgCtx.choiceIndex == 0 && gPlayState->sceneNum == SCENE_GERUDOS_FORTRESS) { EnGe2* enGe2 = va_arg(args, EnGe2*); EnGe2_SetupCapturePlayer(enGe2, gPlayState); - *should = false; + *ev->result = false; } break; case VB_GERUDOS_BE_FRIENDLY: { - *should = CHECK_QUEST_ITEM(QUEST_GERUDO_CARD); + *ev->result = CHECK_QUEST_ITEM(QUEST_GERUDO_CARD); break; } case VB_GTG_GATE_BE_OPEN: { if (Flags_GetRandomizerInf(RAND_INF_GF_GTG_GATE_PERMANENTLY_OPEN)) { - *should = true; + *ev->result = true; } break; } case VB_GIVE_ITEM_GERUDO_MEMBERSHIP_CARD: { Flags_SetRandomizerInf(RAND_INF_TH_ITEM_FROM_LEADER_OF_FORTRESS); - *should = false; + *ev->result = false; break; } case VB_BE_ELIGIBLE_FOR_RAINBOW_BRIDGE: { - *should = MeetsRainbowBridgeRequirements(); + *ev->result = MeetsRainbowBridgeRequirements(); break; } case VB_PLAY_BLUE_WARP_CS: { // We need to override just these two temples because they check medallions instead of flags if (gPlayState->sceneNum == SCENE_SPIRIT_TEMPLE_BOSS) { - *should = !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE); + *ev->result = !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE); } else if (gPlayState->sceneNum == SCENE_SHADOW_TEMPLE_BOSS) { - *should = !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE); + *ev->result = !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE); } break; } @@ -1674,37 +1678,37 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l gPlayState->shootingGalleryStatus < 2) || (item == ITEM_BOMBCHU && Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_BOMBCHUS) && gPlayState->bombchuBowlingStatus < 1)) { - *should = false; + *ev->result = false; } break; } case VB_HAVE_OCARINA_NOTE_A4: { if (!Flags_GetRandomizerInf(RAND_INF_HAS_OCARINA_C_RIGHT)) { - *should = false; + *ev->result = false; } break; } case VB_HAVE_OCARINA_NOTE_B4: { if (!Flags_GetRandomizerInf(RAND_INF_HAS_OCARINA_C_LEFT)) { - *should = false; + *ev->result = false; } break; } case VB_HAVE_OCARINA_NOTE_D4: { if (!Flags_GetRandomizerInf(RAND_INF_HAS_OCARINA_A)) { - *should = false; + *ev->result = false; } break; } case VB_HAVE_OCARINA_NOTE_D5: { if (!Flags_GetRandomizerInf(RAND_INF_HAS_OCARINA_C_UP)) { - *should = false; + *ev->result = false; } break; } case VB_HAVE_OCARINA_NOTE_F4: { if (!Flags_GetRandomizerInf(RAND_INF_HAS_OCARINA_C_DOWN)) { - *should = false; + *ev->result = false; } break; } @@ -1717,44 +1721,44 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } if (ocarinaButtonCount < 2) { - *should = false; + *ev->result = false; break; } if (gPlayState->msgCtx.msgMode == MSGMODE_OCARINA_PLAYING && RAND_GET_OPTION(RSK_SKIP_SCARECROWS_SONG)) { - *should = true; + *ev->result = true; break; } break; } case VB_RENDER_RUPEE_COUNTER: { if (!Flags_GetRandomizerInf(RAND_INF_HAS_WALLET) || Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_MONEY)) { - *should = false; + *ev->result = false; } break; } case VB_BE_ABLE_TO_PLAY_BOMBCHU_BOWLING: { // Only check for bomb bag when bombchus aren't in logic // and only check for bombchus when bombchus are in logic - *should = INV_CONTENT((RAND_GET_OPTION(RSK_BOMBCHU_BAG) ? ITEM_BOMBCHU : ITEM_BOMB)) != ITEM_NONE; + *ev->result = INV_CONTENT((RAND_GET_OPTION(RSK_BOMBCHU_BAG) ? ITEM_BOMBCHU : ITEM_BOMB)) != ITEM_NONE; break; } case VB_SHOULD_CHECK_FOR_FISHING_RECORD: { f32 sFishOnHandLength = *va_arg(args, f32*); - *should = *should || ShouldGiveFishingPrize(sFishOnHandLength); + *ev->result = *ev->result || ShouldGiveFishingPrize(sFishOnHandLength); break; } case VB_SHOULD_SET_FISHING_RECORD: { VBFishingData* fishData = va_arg(args, VBFishingData*); - *should = (s16)fishData->sFishingRecordLength < (s16)fishData->fishWeight; - if (!*should) { + *ev->result = (s16)fishData->sFishingRecordLength < (s16)fishData->fishWeight; + if (!*ev->result) { *fishData->sFishOnHandLength = 0.0f; } break; } case VB_SHOULD_GIVE_VANILLA_FISHING_PRIZE: { VBFishingData* fishData = va_arg(args, VBFishingData*); - *should = !IS_RANDO && ShouldGiveFishingPrize(fishData->fishWeight); + *ev->result = !IS_RANDO && ShouldGiveFishingPrize(fishData->fishWeight); break; } case VB_GIVE_RANDO_FISHING_PRIZE: { @@ -1766,7 +1770,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l RO_FISHSANITY_HYRULE_LOACH) { Flags_SetRandomizerInf(RAND_INF_CAUGHT_LOACH); Message_StartTextbox(gPlayState, TEXT_FISHING_RELEASE_THIS_ONE, NULL); - *should = true; + *ev->result = true; fishData->actor->stateAndTimer = 20; } } else { @@ -1778,7 +1782,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l Flags_SetRandomizerInf(RAND_INF_ADULT_FISHING); HIGH_SCORE(HS_FISHING) |= HS_FISH_PRIZE_ADULT; } - *should = true; + *ev->result = true; *fishData->sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1; fishData->actor->stateAndTimer = 0; } @@ -1792,7 +1796,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l if (!Flags_GetRandomizerInf(RAND_INF_ADULT_FISHING)) { Flags_SetRandomizerInf(RAND_INF_ADULT_FISHING); } - *should = true; + *ev->result = true; fishing->stateAndTimer = 0; } break; @@ -1803,13 +1807,13 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l enMk->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; enMk->actionFunc = EnMk_Wait; enMk->flags |= 1; - *should = false; + *ev->result = false; break; } // We need to override the vanilla behavior here because the player might sequence break and get Ruto kidnapped // before accessing other checks that require Ruto. So if she's kidnapped we allow her to spawn again case VB_RUTO_BE_CONSIDERED_NOT_KIDNAPPED: { - *should = !Flags_GetInfTable(INFTABLE_145) || Flags_GetInfTable(INFTABLE_146); + *ev->result = !Flags_GetInfTable(INFTABLE_145) || Flags_GetInfTable(INFTABLE_146); break; } case VB_SET_VOIDOUT_FROM_SURFACE: { @@ -1826,7 +1830,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l s16 originalEntrance = (s16)va_arg(args, int); // In Entrance rando, if our respawnFlag is set for a grotto return, we don't want the void out to happen - if (*should == true && RAND_GET_OPTION(RSK_SHUFFLE_ENTRANCES)) { + if (*ev->result == true && RAND_GET_OPTION(RSK_SHUFFLE_ENTRANCES)) { // Check for dungeon special entrances that are randomized to a new location if (std::find(entrPersistTempFlags.begin(), entrPersistTempFlags.end(), originalEntrance) != entrPersistTempFlags.end() && @@ -1841,7 +1845,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l // Set the data flag to one to prevent the respawn point from being overridden by dungeon doors. if (gSaveContext.respawnFlag == 2) { gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1; - *should = false; + *ev->result = false; } } } @@ -1849,12 +1853,12 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } case VB_HEALTH_METER_BE_CRITICAL: { if (gSaveContext.health == gSaveContext.healthCapacity) { - *should = false; + *ev->result = false; } break; } case VB_HEISHI2_ACCEPT_ITEM_AS_ZELDAS_LETTER: { - if (*should) { + if (*ev->result) { // remove zelda's letter as this is the only use for it Flags_UnsetRandomizerInf(RAND_INF_CHILD_TRADES_HAS_LETTER_ZELDA); } @@ -1884,10 +1888,10 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l case VB_GIVE_ITEM_SPIRIT_MEDALLION: case VB_GIVE_ITEM_SHADOW_MEDALLION: case VB_CHEST_USE_ICE_EFFECT: - *should = false; + *ev->result = false; break; case VB_GIVE_ITEM_SKULL_TOKEN: - *should = (Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_TOKENS).Is(RO_TOKENSANITY_OFF)); + *ev->result = (Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_TOKENS).Is(RO_TOKENSANITY_OFF)); break; default: break; @@ -1896,11 +1900,12 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l va_end(args); } -void RandomizerOnSceneInitHandler(int16_t sceneNum) { +void RandomizerOnSceneInitHandler(IEvent* event) { + OnSceneInit* ev = reinterpret_cast(event); // Treasure Chest Game // todo: for now we're just unsetting all of them, we will // probably need to do something different when we implement shuffle - if (sceneNum == SCENE_TREASURE_BOX_SHOP) { + if (ev->sceneNum == SCENE_TREASURE_BOX_SHOP) { Flags_UnsetRandomizerInf(RAND_INF_MARKET_TREASURE_CHEST_GAME_ITEM_1); Rando::Context::GetInstance() ->GetItemLocation(RC_MARKET_TREASURE_CHEST_GAME_ITEM_1) @@ -1960,25 +1965,25 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) { } // Handle updated link spawn positions - Entrance_OverrideSpawnScene(sceneNum, gPlayState->curSpawn); + Entrance_OverrideSpawnScene(ev->sceneNum, gPlayState->curSpawn); } // LACS & Prelude checks - static uint32_t updateHook = 0; + static ListenerID updateHook = -1; - if (updateHook) { - GameInteractor::Instance->UnregisterGameHook(updateHook); - updateHook = 0; + if (updateHook != -1) { + UNREGISTER_LISTENER(OnPlayerUpdate, updateHook); + updateHook = -1; } // If we're not in the Temple of Time or we've already learned the Prelude of Light and received LACs, we don't need // to do anything - if (sceneNum != SCENE_TEMPLE_OF_TIME || + if (ev->sceneNum != SCENE_TEMPLE_OF_TIME || (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS))) return; - updateHook = GameInteractor::Instance->RegisterGameHook([]() { + updateHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { if (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && gPlayState->roomCtx.curRoom.num == 0) { Flags_SetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT); @@ -1993,13 +1998,13 @@ void RandomizerOnSceneInitHandler(int16_t sceneNum) { // player leaves the area if (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS)) { - GameInteractor::Instance->UnregisterGameHook(updateHook); - updateHook = 0; + UNREGISTER_LISTENER(OnPlayerUpdate, updateHook); + updateHook = -1; } }); } -void RandomizerAfterSceneCommandsHandler(int16_t sceneNum) { +void RandomizerAfterSceneCommandsHandler(IEvent* event) { // ENTRTODO: Move all entrance rando handling to a dedicated file if (RAND_GET_OPTION(RSK_SHUFFLE_ENTRANCES)) { Entrance_OverrideWeatherState(); @@ -2036,8 +2041,9 @@ void EnDns_RandomizerPurchase(EnDns* enDns) { } } -void RandomizerOnActorInitHandler(void* actorRef) { - Actor* actor = static_cast(actorRef); +void RandomizerOnActorInitHandler(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); if (actor->id == ACTOR_PLAYER) { auto dungeonInfo = Rando::Context::GetInstance()->GetDungeons()->GetDungeonFromScene(gPlayState->sceneNum); @@ -2098,7 +2104,7 @@ void RandomizerOnActorInitHandler(void* actorRef) { RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(actor->id, gPlayState->sceneNum, actor->params); if (rc != RC_UNKNOWN_CHECK) { - EnSi* enSi = static_cast(actorRef); + EnSi* enSi = static_cast(ev->actor); enSi->sohGetItemEntry = Rando::Context::GetInstance()->GetFinalGIEntry( rc, true, (GetItemID)Rando::StaticData::GetLocation(rc)->GetVanillaItem()); actor->draw = (ActorFunc)EnSi_DrawRandomizedItem; @@ -2106,35 +2112,36 @@ void RandomizerOnActorInitHandler(void* actorRef) { } if (actor->id == ACTOR_EN_DNS) { - EnDns* enDns = static_cast(actorRef); + EnDns* enDns = static_cast(ev->actor); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); auto scrubIdentity = OTRGlobals::Instance->gRandomizer->IdentifyScrub(gPlayState->sceneNum, enDns->actor.params, respawnData); if (scrubIdentity.identity.randomizerCheck != RC_UNKNOWN_CHECK) { // DNS uses pointers so we're creating our own entry instead of modifying the original - ObjectExtension::GetInstance().Set(actorRef, std::move(DnsItemEntry{ + ObjectExtension::GetInstance().Set(actor, std::move(DnsItemEntry{ enDns->dnsItemEntry->itemPrice, 1, scrubIdentity.getItemId, EnDns_RandomizerPurchaseableCheck, EnDns_RandomizerPurchase, })); - enDns->dnsItemEntry = ObjectExtension::GetInstance().Get(actorRef); + enDns->dnsItemEntry = ObjectExtension::GetInstance().Get(actor); if (scrubIdentity.itemPrice != -1) { enDns->dnsItemEntry->itemPrice = scrubIdentity.itemPrice; } - ObjectExtension::GetInstance().Set(actorRef, std::move(scrubIdentity)); + ObjectExtension::GetInstance().Set(actor, std::move(scrubIdentity)); enDns->actor.textId = TEXT_SCRUB_RANDOM; - static uint32_t enDnsUpdateHook = 0; - static uint32_t enDnsKillHook = 0; - if (!enDnsUpdateHook) { + static ListenerID enDnsUpdateHook = -1; + static ListenerID enDnsKillHook = -1; + if (enDnsUpdateHook == -1) { enDnsUpdateHook = - GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) { - Actor* innerActor = static_cast(innerActorRef); + REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + Actor* innerActor = static_cast(ev->actor); if (innerActor->id == ACTOR_EN_DNS) { if (ObjectExtension::GetInstance().Has(innerActor)) { innerActor->textId = TEXT_SCRUB_RANDOM; @@ -2142,18 +2149,18 @@ void RandomizerOnActorInitHandler(void* actorRef) { } }); enDnsKillHook = - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { - GameInteractor::Instance->UnregisterGameHook(enDnsUpdateHook); - GameInteractor::Instance->UnregisterGameHook(enDnsKillHook); - enDnsUpdateHook = 0; - enDnsKillHook = 0; + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, enDnsUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enDnsKillHook); + enDnsUpdateHook = -1; + enDnsKillHook = -1; }); } } } if (actor->id == ACTOR_ITEM_ETCETERA) { - ItemEtcetera* itemEtcetera = static_cast(actorRef); + ItemEtcetera* itemEtcetera = static_cast(ev->actor); RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor( itemEtcetera->actor.id, gPlayState->sceneNum, itemEtcetera->actor.params); if (rc != RC_UNKNOWN_CHECK) { @@ -2187,7 +2194,7 @@ void RandomizerOnActorInitHandler(void* actorRef) { } if (actor->id == ACTOR_EN_EX_ITEM) { - EnExItem* enExItem = static_cast(actorRef); + EnExItem* enExItem = static_cast(ev->actor); RandomizerCheck rc = RC_UNKNOWN_CHECK; switch (enExItem->type) { @@ -2216,7 +2223,7 @@ void RandomizerOnActorInitHandler(void* actorRef) { } if (actor->id == ACTOR_EN_GE1) { - EnGe1* enGe1 = static_cast(actorRef); + EnGe1* enGe1 = static_cast(ev->actor); auto ge1Type = enGe1->actor.params & 0xFF; if (ge1Type == GE1_TYPE_TRAINING_GROUND_GUARD && Flags_GetRandomizerInf(RAND_INF_GF_GTG_GATE_PERMANENTLY_OPEN)) { @@ -2230,7 +2237,7 @@ void RandomizerOnActorInitHandler(void* actorRef) { if (actor->id == ACTOR_BG_JYA_BIGMIRROR && Flags_GetRandomizerInf(RAND_INF_SPIRIT_BIG_MIRROR_STATUE_TURNED)) { Flags_SetSwitch(gPlayState, 0x29); // destroy wall - auto jyaBigMirror = static_cast(actorRef); + auto jyaBigMirror = static_cast(ev->actor); jyaBigMirror->puzzleFlags |= BIGMIR_PUZZLE_COBRA1_SOLVED | BIGMIR_PUZZLE_COBRA2_SOLVED | BIGMIR_PUZZLE_BOMBIWA_DESTROYED; jyaBigMirror->cobraInfo[0].rotY = 0x4000; @@ -2252,7 +2259,7 @@ void RandomizerOnActorInitHandler(void* actorRef) { RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES).IsNot(RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) && (RAND_GET_OPTION(RSK_FOREST).Is(RO_CLOSED_FOREST_OFF) || Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD))) { - BgTreemouth* bgTreemouth = static_cast(actorRef); + BgTreemouth* bgTreemouth = static_cast(ev->actor); bgTreemouth->unk_168 = 1.0f; } @@ -2480,8 +2487,9 @@ void RandomizerOnGameFrameUpdateHandler() { extern "C" void func_8099485C(DoorGerudo* gerudoDoor, PlayState* play); -void RandomizerOnActorUpdateHandler(void* refActor) { - Actor* actor = static_cast(refActor); +void RandomizerOnActorUpdateHandler(IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); if (Flags_GetRandomizerInf(RAND_INF_HAS_SKELETON_KEY)) { if (actor->id == ACTOR_EN_DOOR) { @@ -2633,13 +2641,13 @@ void RandomizerOnPlayDestroyHandler() { } } -void RandomizerOnExitGameHandler(int32_t fileNum) { +void RandomizerOnExitGameHandler() { // When going from a rando save to a vanilla save within the same game instance // we need to reset the entrance table back to its vanilla state Entrance_ResetEntranceTable(); } -void RandomizerOnKaleidoscopeUpdateHandler(int16_t inDungeonScene) { +void RandomizerOnKaleidoscopeUpdateHandler() { static uint16_t prevKaleidoState = 0; // In ER, handle overriding the game over respawn entrance and dealing with death warp to from grottos @@ -2691,50 +2699,50 @@ static void RandomizerRegisterHooks() { } }); - GameInteractor::Instance->RegisterGameHook([](int32_t fileNum) { + REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, [](IEvent* event) { ShipInit::Init("IS_RANDO"); randomizerQueuedChecks = std::queue(); randomizerQueuedCheck = RC_UNKNOWN_CHECK; randomizerQueuedItemEntry = GET_ITEM_NONE; - GameInteractor::Instance->UnregisterGameHook(onFlagSetHook); - GameInteractor::Instance->UnregisterGameHook(onSceneFlagSetHook); - GameInteractor::Instance->UnregisterGameHook(onPlayerUpdateForRCQueueHook); - GameInteractor::Instance->UnregisterGameHook(onPlayerUpdateForItemQueueHook); - GameInteractor::Instance->UnregisterGameHook(onItemReceiveHook); - GameInteractor::Instance->UnregisterGameHook(onDialogMessageHook); - GameInteractor::Instance->UnregisterGameHook(onVanillaBehaviorHook); - GameInteractor::Instance->UnregisterGameHook(onSceneInitHook); - GameInteractor::Instance->UnregisterGameHook(afterSceneCommandsHook); - GameInteractor::Instance->UnregisterGameHook(onActorInitHook); - GameInteractor::Instance->UnregisterGameHook(onActorUpdateHook); - GameInteractor::Instance->UnregisterGameHook(onPlayerUpdateHook); - GameInteractor::Instance->UnregisterGameHook(onGameFrameUpdateHook); - GameInteractor::Instance->UnregisterGameHook(onSceneSpawnActorsHook); - GameInteractor::Instance->UnregisterGameHook(onPlayDestroyHook); - GameInteractor::Instance->UnregisterGameHook(onExitGameHook); - GameInteractor::Instance->UnregisterGameHook(onKaleidoUpdateHook); - GameInteractor::Instance->UnregisterGameHook(onCuccoOrChickenHatchHook); - - onFlagSetHook = 0; - onSceneFlagSetHook = 0; - onPlayerUpdateForRCQueueHook = 0; - onPlayerUpdateForItemQueueHook = 0; - onItemReceiveHook = 0; - onDialogMessageHook = 0; - onVanillaBehaviorHook = 0; - onSceneInitHook = 0; - afterSceneCommandsHook = 0; - onActorInitHook = 0; - onActorUpdateHook = 0; - onPlayerUpdateHook = 0; - onGameFrameUpdateHook = 0; - onSceneSpawnActorsHook = 0; - onPlayDestroyHook = 0; - onExitGameHook = 0; - onKaleidoUpdateHook = 0; - onCuccoOrChickenHatchHook = 0; + UNREGISTER_LISTENER(OnFlagSet, onFlagSetHook); + UNREGISTER_LISTENER(OnSceneFlagSet, onSceneFlagSetHook); + UNREGISTER_LISTENER(OnPlayerUpdate, onPlayerUpdateForRCQueueHook); + UNREGISTER_LISTENER(OnPlayerUpdate, onPlayerUpdateForItemQueueHook); + UNREGISTER_LISTENER(OnItemReceive, onItemReceiveHook); + UNREGISTER_LISTENER(OnItemReceive, onDialogMessageHook); + UNREGISTER_LISTENER(OnVanillaBehavior, onVanillaBehaviorHook); + UNREGISTER_LISTENER(OnSceneInit, onSceneInitHook); + UNREGISTER_LISTENER(AfterSceneCommands, afterSceneCommandsHook); + UNREGISTER_LISTENER(OnActorInit, onActorInitHook); + UNREGISTER_LISTENER(OnActorUpdate, onActorUpdateHook); + UNREGISTER_LISTENER(OnPlayerUpdate, onPlayerUpdateHook); + UNREGISTER_LISTENER(OnGameFrameUpdate, onGameFrameUpdateHook); + UNREGISTER_LISTENER(OnSceneSpawnActors, onSceneSpawnActorsHook); + UNREGISTER_LISTENER(OnPlayDestroy, onPlayDestroyHook); + UNREGISTER_LISTENER(OnExitGame, onExitGameHook); + UNREGISTER_LISTENER(OnKaleidoscopeUpdate, onKaleidoUpdateHook); + UNREGISTER_LISTENER(OnCuccoOrChickenHatch, onCuccoOrChickenHatchHook); + + onFlagSetHook = -1; + onSceneFlagSetHook = -1; + onPlayerUpdateForRCQueueHook = -1; + onPlayerUpdateForItemQueueHook = -1; + onItemReceiveHook = -1; + onDialogMessageHook = -1; + onVanillaBehaviorHook = -1; + onSceneInitHook = -1; + afterSceneCommandsHook = -1; + onActorInitHook = -1; + onActorUpdateHook = -1; + onPlayerUpdateHook = -1; + onGameFrameUpdateHook = -1; + onSceneSpawnActorsHook = -1; + onPlayDestroyHook = -1; + onExitGameHook = -1; + onKaleidoUpdateHook = -1; + onCuccoOrChickenHatchHook = -1; if (!IS_RANDO) return; @@ -2749,41 +2757,38 @@ static void RandomizerRegisterHooks() { } onFlagSetHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnFlagSetHandler); + REGISTER_LISTENER(OnFlagSet, EVENT_PRIORITY_LOW, RandomizerOnFlagSetHandler); onSceneFlagSetHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnSceneFlagSetHandler); - onPlayerUpdateForRCQueueHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnPlayerUpdateForRCQueueHandler); - onPlayerUpdateForItemQueueHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnPlayerUpdateForItemQueueHandler); + REGISTER_LISTENER(OnSceneFlagSet, EVENT_PRIORITY_LOW, RandomizerOnSceneFlagSetHandler); + onPlayerUpdateForRCQueueHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnPlayerUpdateForRCQueueHandler(); }); + onPlayerUpdateForItemQueueHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, + [](IEvent* event){ RandomizerOnPlayerUpdateForItemQueueHandler(); }); onItemReceiveHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnItemReceiveHandler); - onDialogMessageHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnDialogMessageHandler); - onVanillaBehaviorHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnVanillaBehaviorHandler); + REGISTER_LISTENER(OnItemReceive, EVENT_PRIORITY_LOW, RandomizerOnItemReceiveHandler); + onDialogMessageHook = REGISTER_LISTENER(OnDialogMessage, EVENT_PRIORITY_LOW, + [](IEvent* event){ RandomizerOnDialogMessageHandler(); }); + onVanillaBehaviorHook = REGISTER_LISTENER(OnVanillaBehavior, EVENT_PRIORITY_LOW, RandomizerOnVanillaBehaviorHandler); onSceneInitHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnSceneInitHandler); - afterSceneCommandsHook = GameInteractor::Instance->RegisterGameHook( - RandomizerAfterSceneCommandsHandler); + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, RandomizerOnSceneInitHandler); + afterSceneCommandsHook = REGISTER_LISTENER(AfterSceneCommands, EVENT_PRIORITY_LOW, RandomizerAfterSceneCommandsHandler); onActorInitHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnActorInitHandler); + REGISTER_LISTENER(OnActorInit, EVENT_PRIORITY_LOW, RandomizerOnActorInitHandler); onActorUpdateHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnActorUpdateHandler); + REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, RandomizerOnActorUpdateHandler); onPlayerUpdateHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnPlayerUpdateHandler); - onGameFrameUpdateHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnGameFrameUpdateHandler); - onSceneSpawnActorsHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnSceneSpawnActorsHandler); + REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnPlayerUpdateHandler(); }); + onGameFrameUpdateHook = REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, + [](IEvent* event){ RandomizerOnGameFrameUpdateHandler(); }); + onSceneSpawnActorsHook = REGISTER_LISTENER(OnSceneSpawnActors, EVENT_PRIORITY_LOW, + [](IEvent* event){ RandomizerOnSceneSpawnActorsHandler(); }); onPlayDestroyHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnPlayDestroyHandler); + REGISTER_LISTENER(OnPlayDestroy, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnPlayDestroyHandler(); }); onExitGameHook = - GameInteractor::Instance->RegisterGameHook(RandomizerOnExitGameHandler); - onKaleidoUpdateHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnKaleidoscopeUpdateHandler); - onCuccoOrChickenHatchHook = GameInteractor::Instance->RegisterGameHook( - RandomizerOnCuccoOrChickenHatch); + REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnExitGameHandler(); }); + onKaleidoUpdateHook = REGISTER_LISTENER(OnKaleidoscopeUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ + RandomizerOnKaleidoscopeUpdateHandler(); }); + onCuccoOrChickenHatchHook = REGISTER_LISTENER(OnCuccoOrChickenHatch, EVENT_PRIORITY_LOW, [](IEvent* event){ + RandomizerOnCuccoOrChickenHatch(); }); if (RAND_GET_OPTION(RSK_FISHSANITY).IsNot(RO_FISHSANITY_OFF)) { OTRGlobals::Instance->gRandoContext->GetFishsanity()->InitializeFromSave(); diff --git a/soh/soh/Enhancements/randomizer/item_location.cpp b/soh/soh/Enhancements/randomizer/item_location.cpp index 01d31ed6d62..bf4b1c486d0 100644 --- a/soh/soh/Enhancements/randomizer/item_location.cpp +++ b/soh/soh/Enhancements/randomizer/item_location.cpp @@ -134,7 +134,7 @@ bool ItemLocation::HasObtained() const { void ItemLocation::SetCheckStatus(RandomizerCheckStatus status_) { status = status_; - GameInteractor::Instance->ExecuteHooks(rc, status); + CALL_EVENT(OnRandoSetCheckStatus, rc, status); } RandomizerCheckStatus ItemLocation::GetCheckStatus() { @@ -143,7 +143,7 @@ RandomizerCheckStatus ItemLocation::GetCheckStatus() { void ItemLocation::SetIsSkipped(bool isSkipped_) { isSkipped = isSkipped_; - GameInteractor::Instance->ExecuteHooks(rc, isSkipped); + CALL_EVENT(OnRandoSetIsSkipped, rc, isSkipped); } bool ItemLocation::GetIsSkipped() { diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 5b2ca35498f..4c57196cb00 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4188,7 +4188,7 @@ void GenerateRandomizerImgui(std::string seed = "") { generated = 1; - GameInteractor::Instance->ExecuteHooks(); + CALL_EVENT(OnGenerationCompletion); } bool GenerateRandomizer(std::string seed /*= ""*/) { diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 83a2a57f48c..42542faf6ba 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -513,7 +513,7 @@ void SetShopSeen(uint32_t sceneNum, bool prices) { } } -void CheckTrackerLoadGame(int32_t fileNum) { +void CheckTrackerLoadGame(IEvent* event) { if (IS_BOSS_RUSH) { return; } @@ -610,14 +610,15 @@ void CheckTrackerLoadGame(int32_t fileNum) { recalculateAvailable = true; } -void CheckTrackerShopSlotChange(uint8_t cursorSlot, int16_t basePrice) { +void CheckTrackerShopSlotChange(IEvent* event) { if (gPlayState->sceneNum == SCENE_HAPPY_MASK_SHOP) { // Happy Mask Shop is not used in rando, so is not tracked return; } - auto slot = startingShopItem.find(gPlayState->sceneNum)->second + cursorSlot; + OnShopSlotChange* ev = reinterpret_cast(event); + auto slot = startingShopItem.find(gPlayState->sceneNum)->second + ev->cursorIndex; if (GetCheckArea() == RCAREA_KAKARIKO_VILLAGE && gPlayState->sceneNum == SCENE_BAZAAR) { - slot = RC_KAK_BAZAAR_ITEM_1 + cursorSlot; + slot = RC_KAK_BAZAAR_ITEM_1 + ev->cursorIndex; } auto status = OTRGlobals::Instance->gRandoContext->GetItemLocation(slot)->GetCheckStatus(); if (status == RCSHOW_SEEN) { @@ -627,14 +628,15 @@ void CheckTrackerShopSlotChange(uint8_t cursorSlot, int16_t basePrice) { } } -void CheckTrackerTransition(uint32_t sceneNum) { +void CheckTrackerTransition(IEvent* event) { if (!GameInteractor::IsSaveLoaded()) { return; } + OnTransitionEnd* ev = reinterpret_cast(event); doAreaScroll = true; previousArea = currentArea; currentArea = GetCheckArea(); - switch (sceneNum) { + switch (ev->sceneNum) { case SCENE_KOKIRI_SHOP: case SCENE_BAZAAR: case SCENE_POTION_SHOP_MARKET: @@ -642,7 +644,7 @@ void CheckTrackerTransition(uint32_t sceneNum) { case SCENE_POTION_SHOP_KAKARIKO: case SCENE_GORON_SHOP: case SCENE_ZORA_SHOP: - SetShopSeen(sceneNum, false); + SetShopSeen(ev->sceneNum, false); break; } if (!IsAreaSpoiled(currentArea) && (RandomizerCheckObjects::AreaIsOverworld(currentArea) || @@ -652,11 +654,13 @@ void CheckTrackerTransition(uint32_t sceneNum) { } } -void CheckTrackerItemReceive(GetItemEntry giEntry) { +void CheckTrackerItemReceive(IEvent* event) { + OnItemReceive* ev = reinterpret_cast(event); if (!GameInteractor::IsSaveLoaded() || std::find(std::begin(skipScenes), std::end(skipScenes), (SceneID)gPlayState->sceneNum) != std::end(skipScenes)) { return; } + GetItemEntry giEntry = ev->itemEntry; auto scene = static_cast(gPlayState->sceneNum); // Vanilla special item checks if (!IS_RANDO) { @@ -733,16 +737,18 @@ void CheckTrackerItemReceive(GetItemEntry giEntry) { } } -void CheckTrackerSceneFlagSet(int16_t sceneNum, int16_t flagType, int32_t flag) { +void CheckTrackerSceneFlagSet(IEvent* event) { if (IS_RANDO) { return; } - if (flagType != FLAG_SCENE_TREASURE && flagType != FLAG_SCENE_COLLECTIBLE) { + OnSceneFlagSet* ev = reinterpret_cast(event); + + if (ev->flagType != FLAG_SCENE_TREASURE && ev->flagType != FLAG_SCENE_COLLECTIBLE) { return; } - if (sceneNum == SCENE_GRAVEYARD && flag == 0x19 && - flagType == FLAG_SCENE_COLLECTIBLE) { // Gravedigging tour special case + if (ev->sceneNum == SCENE_GRAVEYARD && ev->flag == 0x19 && + ev->flagType == FLAG_SCENE_COLLECTIBLE) { // Gravedigging tour special case SetCheckCollected(RC_GRAVEYARD_DAMPE_GRAVEDIGGING_TOUR); return; } @@ -750,30 +756,31 @@ void CheckTrackerSceneFlagSet(int16_t sceneNum, int16_t flagType, int32_t flag) if (!IsVisibleInCheckTracker(loc.GetRandomizerCheck())) { continue; } - SpoilerCollectionCheckType checkMatchType = flagType == FLAG_SCENE_TREASURE + SpoilerCollectionCheckType checkMatchType = ev->flagType == FLAG_SCENE_TREASURE ? SpoilerCollectionCheckType::SPOILER_CHK_CHEST : SpoilerCollectionCheckType::SPOILER_CHK_COLLECTABLE; Rando::SpoilerCollectionCheck scCheck = loc.GetCollectionCheck(); - if (scCheck.scene == sceneNum && scCheck.flag == flag && scCheck.type == checkMatchType) { + if (scCheck.scene == ev->sceneNum && scCheck.flag == ev->flag && scCheck.type == checkMatchType) { SetCheckCollected(loc.GetRandomizerCheck()); return; } } } -void CheckTrackerFlagSet(int16_t flagType, int32_t flag) { +void CheckTrackerFlagSet(IEvent* event) { if (IS_RANDO) { return; } + OnFlagSet* ev = reinterpret_cast(event); SpoilerCollectionCheckType checkMatchType = SpoilerCollectionCheckType::SPOILER_CHK_NONE; - switch (flagType) { + switch (ev->flagType) { case FLAG_GS_TOKEN: checkMatchType = SpoilerCollectionCheckType::SPOILER_CHK_GOLD_SKULLTULA; break; case FLAG_EVENT_CHECK_INF: - if ((flag == EVENTCHKINF_CARPENTERS_FREE(0) || flag == EVENTCHKINF_CARPENTERS_FREE(1) || - flag == EVENTCHKINF_CARPENTERS_FREE(2) || flag == EVENTCHKINF_CARPENTERS_FREE(3)) && + if ((ev->flag == EVENTCHKINF_CARPENTERS_FREE(0) || ev->flag == EVENTCHKINF_CARPENTERS_FREE(1) || + ev->flag == EVENTCHKINF_CARPENTERS_FREE(2) || ev->flag == EVENTCHKINF_CARPENTERS_FREE(3)) && GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) { SetCheckCollected(RC_TH_FREED_CARPENTERS); return; @@ -781,27 +788,27 @@ void CheckTrackerFlagSet(int16_t flagType, int32_t flag) { checkMatchType = SpoilerCollectionCheckType::SPOILER_CHK_EVENT_CHK_INF; break; case FLAG_INF_TABLE: - if (flag == INFTABLE_190) { + if (ev->flag == INFTABLE_190) { SetCheckCollected(RC_GF_HBA_1000_POINTS); return; - } else if (flag == INFTABLE_11E) { + } else if (ev->flag == INFTABLE_11E) { SetCheckCollected(RC_GC_ROLLING_GORON_AS_CHILD); return; - } else if (flag == INFTABLE_GORON_CITY_DOORS_UNLOCKED) { + } else if (ev->flag == INFTABLE_GORON_CITY_DOORS_UNLOCKED) { SetCheckCollected(RC_GC_ROLLING_GORON_AS_ADULT); return; - } else if (flag == INFTABLE_139) { + } else if (ev->flag == INFTABLE_139) { SetCheckCollected(RC_ZD_KING_ZORA_THAWED); return; - } else if (flag == INFTABLE_191) { + } else if (ev->flag == INFTABLE_191) { SetCheckCollected(RC_MARKET_LOST_DOG); return; } if (!IS_RANDO) { - if (flag == INFTABLE_BOUGHT_STICK_UPGRADE) { + if (ev->flag == INFTABLE_BOUGHT_STICK_UPGRADE) { SetCheckCollected(RC_LW_DEKU_SCRUB_NEAR_BRIDGE); return; - } else if (flag == INFTABLE_BOUGHT_NUT_UPGRADE) { + } else if (ev->flag == INFTABLE_BOUGHT_NUT_UPGRADE) { SetCheckCollected(RC_LW_DEKU_SCRUB_GROTTO_FRONT); return; } @@ -809,13 +816,13 @@ void CheckTrackerFlagSet(int16_t flagType, int32_t flag) { break; case FLAG_ITEM_GET_INF: if (!IS_RANDO) { - if (flag == ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE) { + if (ev->flag == ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE) { SetCheckCollected(RC_DEKU_THEATER_SKULL_MASK); return; - } else if (flag == ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE) { + } else if (ev->flag == ITEMGETINF_OBTAINED_NUT_UPGRADE_FROM_STAGE) { SetCheckCollected(RC_DEKU_THEATER_MASK_OF_TRUTH); return; - } else if (flag == ITEMGETINF_DEKU_SCRUB_HEART_PIECE) { + } else if (ev->flag == ITEMGETINF_DEKU_SCRUB_HEART_PIECE) { SetCheckCollected(RC_HF_DEKU_SCRUB_GROTTO); return; } @@ -844,7 +851,7 @@ void CheckTrackerFlagSet(int16_t flagType, int32_t flag) { SpoilerCollectionCheckType scCheckType = scCheck.type; if (checkMatchType == SpoilerCollectionCheckType::SPOILER_CHK_RANDOMIZER_INF && scCheckType == SpoilerCollectionCheckType::SPOILER_CHK_RANDOMIZER_INF) { - if (flag == OTRGlobals::Instance->gRandomizer->GetRandomizerInfFromCheck(loc.GetRandomizerCheck())) { + if (ev->flag == OTRGlobals::Instance->gRandomizer->GetRandomizerInfFromCheck(loc.GetRandomizerCheck())) { SetCheckCollected(loc.GetRandomizerCheck()); return; } @@ -854,7 +861,7 @@ void CheckTrackerFlagSet(int16_t flagType, int32_t flag) { if (checkMatchType == SpoilerCollectionCheckType::SPOILER_CHK_GOLD_SKULLTULA) { checkFlag = loc.GetActorParams(); } - if (checkFlag == flag && scCheck.type == checkMatchType) { + if (checkFlag == ev->flag && scCheck.type == checkMatchType) { SetCheckCollected(loc.GetRandomizerCheck()); return; } @@ -2322,13 +2329,13 @@ void CheckTrackerWindow::InitElement() { SaveManager::Instance->AddInitFunction(InitTrackerData); sectionId = SaveManager::Instance->AddSaveFunction("trackerData", 1, SaveFile, true, SECTION_PARENT_NONE); SaveManager::Instance->AddLoadFunction("trackerData", 1, LoadFile); - GameInteractor::Instance->RegisterGameHook(CheckTrackerLoadGame); - GameInteractor::Instance->RegisterGameHook([](uint32_t fileNum) { Teardown(); }); - GameInteractor::Instance->RegisterGameHook(CheckTrackerItemReceive); - GameInteractor::Instance->RegisterGameHook(CheckTrackerTransition); - GameInteractor::Instance->RegisterGameHook(CheckTrackerShopSlotChange); - GameInteractor::Instance->RegisterGameHook(CheckTrackerSceneFlagSet); - GameInteractor::Instance->RegisterGameHook(CheckTrackerFlagSet); + REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, CheckTrackerLoadGame); + REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, [](IEvent* event) { Teardown(); }); + REGISTER_LISTENER(OnItemReceive, EVENT_PRIORITY_LOW, CheckTrackerItemReceive); + REGISTER_LISTENER(OnTransitionEnd, EVENT_PRIORITY_LOW, CheckTrackerTransition); + REGISTER_LISTENER(OnShopSlotChange, EVENT_PRIORITY_LOW, CheckTrackerShopSlotChange); + REGISTER_LISTENER(OnSceneFlagSet, EVENT_PRIORITY_LOW, CheckTrackerSceneFlagSet); + REGISTER_LISTENER(OnFlagSet, EVENT_PRIORITY_LOW, CheckTrackerFlagSet); } void CheckTrackerWindow::UpdateElement() { diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index 95cb71c2e94..b6d0397c625 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -1074,10 +1074,10 @@ void EntranceTrackerWindow::DrawElement() { void EntranceTrackerWindow::InitElement() { // Setup hooks for loading and clearing the entrance tracker data - GameInteractor::Instance->RegisterGameHook( - [](int32_t fileNum) { InitEntranceTrackingData(); }); - GameInteractor::Instance->RegisterGameHook( - [](int32_t fileNum) { ClearEntranceTrackingData(); }); + REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, + [](IEvent* event) { InitEntranceTrackingData(); }); + REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, + [](IEvent* event) { ClearEntranceTrackingData(); }); } void RegisterCheckTrackerWidgets() { diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index 94e3280706b..3e071437aa1 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -462,7 +462,7 @@ static bool presetLoaded = false; static std::unordered_map presetPos; static std::unordered_map presetSize; -void ItemTrackerOnFrame() { +void ItemTrackerOnFrame(IEvent* event) { if (notesNeedSave && notesIdleFrames <= notesMaxIdleFrames) { notesIdleFrames++; } @@ -2211,7 +2211,7 @@ void ItemTrackerWindow::InitElement() { itemTrackerSectionId = SaveManager::Instance->AddSaveFunction("itemTrackerData", 1, ItemTrackerSaveFile, true, -1); SaveManager::Instance->AddLoadFunction("itemTrackerData", 1, ItemTrackerLoadFile); - GameInteractor::Instance->RegisterGameHook(ItemTrackerOnFrame); + REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, ItemTrackerOnFrame); } void RegisterItemTrackerWidgets() { diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index bcfcf28e3c9..e5a6affb4f0 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -572,53 +572,50 @@ void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { player->stateFlags1 |= PLAYER_STATE1_GETTING_ITEM; func_80986794(demoIm); - static uint32_t demoImUpdateHook = 0; - static uint32_t demoImKillHook = 0; - demoImUpdateHook = GameInteractor::Instance->RegisterGameHook( - [](void* actorRef) mutable { - Actor* actor = static_cast(actorRef); - if (actor->id == ACTOR_DEMO_IM && - (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || - IS_RANDO)) { - DemoIm* demoIm = static_cast(actorRef); + static ListenerID demoImUpdateHook = -1; + static ListenerID demoImKillHook = -1; + demoImUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + Actor* actor = static_cast(ev->actor); + if (actor->id == ACTOR_DEMO_IM && + (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || + IS_RANDO)) { + DemoIm* demoIm = static_cast(ev->actor); + Player* player = GET_PLAYER(gPlayState); + player->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE; + player->stateFlags1 |= PLAYER_STATE1_GETTING_ITEM; + + if (Animation_OnFrame(&demoIm->skelAnime, 25.0f)) { + Audio_PlaySoundGeneral(NA_SE_IT_DEKU, &demoIm->actor.projectedPos, 4, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); + UNREGISTER_LISTENER(OnActorUpdate, demoImUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, demoImKillHook); + demoImUpdateHook = -1; + demoImKillHook = -1; + } else if (Animation_OnFrame(&demoIm->skelAnime, 15.0f)) { Player* player = GET_PLAYER(gPlayState); - player->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE; - player->stateFlags1 |= PLAYER_STATE1_GETTING_ITEM; - - if (Animation_OnFrame(&demoIm->skelAnime, 25.0f)) { - Audio_PlaySoundGeneral(NA_SE_IT_DEKU, &demoIm->actor.projectedPos, 4, - &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); - GameInteractor::Instance->UnregisterGameHook( - demoImUpdateHook); - GameInteractor::Instance->UnregisterGameHook( - demoImKillHook); - demoImUpdateHook = 0; - demoImKillHook = 0; - } else if (Animation_OnFrame(&demoIm->skelAnime, 15.0f)) { - Player* player = GET_PLAYER(gPlayState); - // SOH [Randomizer] In entrance rando have impa bring link back to the front of castle - // grounds - if (IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) { - gPlayState->nextEntranceIndex = ENTR_CASTLE_GROUNDS_SOUTH_EXIT; - } else { - gPlayState->nextEntranceIndex = ENTR_HYRULE_FIELD_17; - } - gSaveContext.dayTime = gSaveContext.skyboxTime = 0x8000; - gPlayState->transitionType = TRANS_TYPE_FADE_WHITE; - gPlayState->transitionTrigger = TRANS_TRIGGER_START; - gSaveContext.nextTransitionType = 2; - Player_SetCsActionWithHaltedActors(gPlayState, &player->actor, 8); + // SOH [Randomizer] In entrance rando have impa bring link back to the front of castle + // grounds + if (IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) { + gPlayState->nextEntranceIndex = ENTR_CASTLE_GROUNDS_SOUTH_EXIT; + } else { + gPlayState->nextEntranceIndex = ENTR_HYRULE_FIELD_17; } + gSaveContext.dayTime = gSaveContext.skyboxTime = 0x8000; + gPlayState->transitionType = TRANS_TYPE_FADE_WHITE; + gPlayState->transitionTrigger = TRANS_TRIGGER_START; + gSaveContext.nextTransitionType = 2; + Player_SetCsActionWithHaltedActors(gPlayState, &player->actor, 8); } - }); - demoImKillHook = GameInteractor::Instance->RegisterGameHook( - [](int16_t sceneNum) mutable { - GameInteractor::Instance->UnregisterGameHook(demoImUpdateHook); - GameInteractor::Instance->UnregisterGameHook(demoImKillHook); - demoImUpdateHook = 0; - demoImKillHook = 0; - }); + } + }); + demoImKillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, demoImUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, demoImKillHook); + demoImUpdateHook = -1; + demoImKillHook = -1; + }); *ev->result = false; } break; @@ -878,108 +875,111 @@ void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { va_end(args); } -static uint32_t enMa1UpdateHook = 0; -static uint32_t enMa1KillHook = 0; -static uint32_t enFuUpdateHook = 0; -static uint32_t enFuKillHook = 0; -static uint32_t enJjUpdateHook = 0; -static uint32_t enJjKillHook = 0; -static uint32_t bgSpot02UpdateHook = 0; -static uint32_t bgSpot02KillHook = 0; -static uint32_t bgSpot03UpdateHook = 0; -static uint32_t bgSpot03KillHook = 0; -static uint32_t enPoSistersUpdateHook = 0; -static uint32_t enPoSistersKillHook = 0; +static ListenerID enMa1UpdateHook = -1; +static ListenerID enMa1KillHook = -1; +static ListenerID enFuUpdateHook = -1; +static ListenerID enFuKillHook = -1; +static ListenerID enJjUpdateHook = -1; +static ListenerID enJjKillHook = -1; +static ListenerID bgSpot02UpdateHook = -1; +static ListenerID bgSpot02KillHook = -1; +static ListenerID bgSpot03UpdateHook = -1; +static ListenerID bgSpot03KillHook = -1; +static ListenerID enPoSistersUpdateHook = -1; +static ListenerID enPoSistersKillHook = -1; void TimeSaverOnActorInitHandler(IEvent* event) { OnActorInit* ev = reinterpret_cast(event); Actor* actor = static_cast(ev->actor); if (actor->id == ACTOR_EN_MA1 && gPlayState->sceneNum == SCENE_LON_LON_RANCH) { enMa1UpdateHook = - GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { + REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; Actor* innerActor = static_cast(innerActorRef); if (innerActor->id == ACTOR_EN_MA1 && (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO)) { EnMa1* enMa1 = static_cast(innerActorRef); if (enMa1->actionFunc == func_80AA106C) { enMa1->actionFunc = EnMa1_EndTeachSong; - GameInteractor::Instance->UnregisterGameHook(enMa1UpdateHook); - GameInteractor::Instance->UnregisterGameHook(enMa1KillHook); - enMa1UpdateHook = 0; - enMa1KillHook = 0; + UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); + enMa1UpdateHook = -1; + enMa1KillHook = -1; // They've already learned the song } else if (enMa1->actionFunc == func_80AA0D88) { - GameInteractor::Instance->UnregisterGameHook(enMa1UpdateHook); - GameInteractor::Instance->UnregisterGameHook(enMa1KillHook); - enMa1UpdateHook = 0; - enMa1KillHook = 0; + UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); + enMa1UpdateHook = -1; + enMa1KillHook = -1; } } }); enMa1KillHook = - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) mutable { - GameInteractor::Instance->UnregisterGameHook(enMa1UpdateHook); - GameInteractor::Instance->UnregisterGameHook(enMa1KillHook); + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); enMa1UpdateHook = 0; enMa1KillHook = 0; }); } if (actor->id == ACTOR_EN_FU) { - enFuUpdateHook = - GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { - Actor* innerActor = static_cast(innerActorRef); - if (innerActor->id == ACTOR_EN_FU && - (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO)) { - EnFu* enFu = static_cast(innerActorRef); - if (enFu->actionFunc == EnFu_TeachSong) { - enFu->actionFunc = EnFu_EndTeachSong; - GameInteractor::Instance->UnregisterGameHook(enFuUpdateHook); - GameInteractor::Instance->UnregisterGameHook(enFuKillHook); - enFuUpdateHook = 0; - enFuKillHook = 0; - } + enFuUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; + Actor* innerActor = static_cast(innerActorRef); + if (innerActor->id == ACTOR_EN_FU && + (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO)) { + EnFu* enFu = static_cast(innerActorRef); + if (enFu->actionFunc == EnFu_TeachSong) { + enFu->actionFunc = EnFu_EndTeachSong; + UNREGISTER_LISTENER(OnActorUpdate, enFuUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enFuKillHook); + enFuUpdateHook = -1; + enFuKillHook = -1; } - }); - enFuKillHook = - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) mutable { - GameInteractor::Instance->UnregisterGameHook(enFuUpdateHook); - GameInteractor::Instance->UnregisterGameHook(enFuKillHook); - enFuUpdateHook = 0; - enFuKillHook = 0; - }); + } + }); + enFuKillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, enFuUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enFuKillHook); + enFuUpdateHook = -1; + enFuKillHook = -1; + }); } if (actor->id == ACTOR_EN_JJ) { - enJjUpdateHook = - GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { - Actor* innerActor = static_cast(innerActorRef); + enJjUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; + Actor* innerActor = static_cast(innerActorRef); - if (innerActor->id != ACTOR_EN_JJ || Flags_GetEventChkInf(EVENTCHKINF_OFFERED_FISH_TO_JABU_JABU)) { - return; - } + if (innerActor->id != ACTOR_EN_JJ || Flags_GetEventChkInf(EVENTCHKINF_OFFERED_FISH_TO_JABU_JABU)) { + return; + } - bool shouldOpen = IS_RANDO ? RAND_GET_OPTION(RSK_JABU_OPEN).Get() - : CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipJabuJabuFish"), 0); - if (!shouldOpen) { - return; - } + bool shouldOpen = IS_RANDO ? RAND_GET_OPTION(RSK_JABU_OPEN).Get() + : CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipJabuJabuFish"), 0); + if (!shouldOpen) { + return; + } - EnJj* enJj = static_cast(innerActorRef); - if (enJj->actionFunc == EnJj_WaitForFish) { - EnJj_SetupAction(enJj, EnJj_WaitToOpenMouth); - GameInteractor::Instance->UnregisterGameHook(enJjUpdateHook); - GameInteractor::Instance->UnregisterGameHook(enJjKillHook); - enJjUpdateHook = 0; - enJjKillHook = 0; - } - }); + EnJj* enJj = static_cast(innerActorRef); + if (enJj->actionFunc == EnJj_WaitForFish) { + EnJj_SetupAction(enJj, EnJj_WaitToOpenMouth); + UNREGISTER_LISTENER(OnActorUpdate, enJjUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enJjKillHook); + enJjUpdateHook = -1; + enJjKillHook = -1; + } + }); enJjKillHook = - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) mutable { - GameInteractor::Instance->UnregisterGameHook(enJjUpdateHook); - GameInteractor::Instance->UnregisterGameHook(enJjKillHook); - enJjUpdateHook = 0; - enJjKillHook = 0; + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, enJjUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enJjKillHook); + enJjUpdateHook = -1; + enJjKillHook = -1; }); } @@ -990,32 +990,36 @@ void TimeSaverOnActorInitHandler(IEvent* event) { if (actor->id == ACTOR_BG_SPOT02_OBJECTS && actor->params == 2) { bgSpot02UpdateHook = - GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { + REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; Actor* innerActor = static_cast(innerActorRef); if (innerActor->id == ACTOR_BG_SPOT02_OBJECTS && innerActor->params == 2 && (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { BgSpot02Objects* bgSpot02 = static_cast(innerActorRef); if (bgSpot02->actionFunc == func_808ACC34) { bgSpot02->actionFunc = func_808AC908; - GameInteractor::Instance->UnregisterGameHook(bgSpot02UpdateHook); - GameInteractor::Instance->UnregisterGameHook(bgSpot02KillHook); - bgSpot02UpdateHook = 0; - bgSpot02KillHook = 0; + UNREGISTER_LISTENER(OnActorUpdate, bgSpot02UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, bgSpot02KillHook); + bgSpot02UpdateHook = -1; + bgSpot02KillHook = -1; } } }); bgSpot02KillHook = - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) mutable { - GameInteractor::Instance->UnregisterGameHook(bgSpot02UpdateHook); - GameInteractor::Instance->UnregisterGameHook(bgSpot02KillHook); - bgSpot02UpdateHook = 0; - bgSpot02KillHook = 0; + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, bgSpot02UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, bgSpot02KillHook); + bgSpot02UpdateHook = -1; + bgSpot02KillHook = -1; }); } if (actor->id == ACTOR_BG_SPOT03_TAKI) { bgSpot03UpdateHook = - GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { + REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; Actor* innerActor = static_cast(innerActorRef); if (innerActor->id != ACTOR_BG_SPOT03_TAKI) { @@ -1045,18 +1049,18 @@ void TimeSaverOnActorInitHandler(IEvent* event) { BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 0); BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 1); - GameInteractor::Instance->UnregisterGameHook(bgSpot03UpdateHook); - GameInteractor::Instance->UnregisterGameHook(bgSpot03KillHook); - bgSpot03UpdateHook = 0; - bgSpot03KillHook = 0; + UNREGISTER_LISTENER(OnActorUpdate, bgSpot03UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, bgSpot03KillHook); + bgSpot03UpdateHook = -1; + bgSpot03KillHook = -1; } }); bgSpot03KillHook = - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) mutable { - GameInteractor::Instance->UnregisterGameHook(bgSpot03UpdateHook); - GameInteractor::Instance->UnregisterGameHook(bgSpot03KillHook); - bgSpot03UpdateHook = 0; - bgSpot03KillHook = 0; + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, bgSpot03UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, bgSpot03KillHook); + bgSpot03UpdateHook = -1; + bgSpot03KillHook = -1; }); } @@ -1081,7 +1085,9 @@ void TimeSaverOnActorInitHandler(IEvent* event) { // Forest Temple purple poe fight speedup if (actor->id == ACTOR_EN_PO_SISTERS && actor->params == 28) { enPoSistersUpdateHook = - GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { + REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; Actor* innerActor = static_cast(innerActorRef); if (innerActor->id == ACTOR_EN_PO_SISTERS && innerActor->params == 28 && (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { @@ -1091,12 +1097,11 @@ void TimeSaverOnActorInitHandler(IEvent* event) { } } }); - enPoSistersKillHook = - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) mutable { - GameInteractor::Instance->UnregisterGameHook(enPoSistersUpdateHook); - GameInteractor::Instance->UnregisterGameHook(enPoSistersKillHook); - enPoSistersUpdateHook = 0; - enPoSistersKillHook = 0; + enPoSistersKillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) mutable { + UNREGISTER_LISTENER(OnActorUpdate, enPoSistersUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enPoSistersKillHook); + enPoSistersUpdateHook = -1; + enPoSistersKillHook = -1; }); } diff --git a/soh/soh/Enhancements/timesplits/TimeSplits.cpp b/soh/soh/Enhancements/timesplits/TimeSplits.cpp index e970b965cfe..8a82d3d7ebd 100644 --- a/soh/soh/Enhancements/timesplits/TimeSplits.cpp +++ b/soh/soh/Enhancements/timesplits/TimeSplits.cpp @@ -983,7 +983,9 @@ void TimeSplitWindow::InitElement() { Color_RGBA8 defaultColour = { 0, 0, 0, 255 }; windowColor = VecFromRGBA8(CVarGetColor(CVAR_ENHANCEMENT("TimeSplits.WindowColor.Value"), defaultColour)); - GameInteractor::Instance->RegisterGameHook([](u8 item) { + REGISTER_LISTENER(OnTimestamp, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnTimestamp* ev = reinterpret_cast(event); + u8 item = ev->item; if (item != ITEM_SKULL_TOKEN) { uint32_t tempType = SPLIT_TYPE_ITEM; for (auto& data : splitList) { @@ -996,8 +998,9 @@ void TimeSplitWindow::InitElement() { } }); - GameInteractor::Instance->RegisterGameHook([](GetItemEntry itemEntry) { - GetItemEntry testItem = itemEntry; + REGISTER_LISTENER(OnItemReceive, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnItemReceive* ev = reinterpret_cast(event); + GetItemEntry itemEntry = ev->itemEntry; if (itemEntry.itemId == ITEM_SKULL_TOKEN || itemEntry.itemId == ITEM_BOTTLE || itemEntry.itemId == ITEM_POE || itemEntry.itemId == ITEM_BIG_POE) { uint32_t tempType = SPLIT_TYPE_ITEM; @@ -1011,21 +1014,25 @@ void TimeSplitWindow::InitElement() { } }); - GameInteractor::Instance->RegisterGameHook( - [](int16_t contents) { TimeSplitsItemSplitEvent(SPLIT_TYPE_UPGRADE, contents); }); + REGISTER_LISTENER(OnPlayerBottleUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ + OnPlayerBottleUpdate* ev = reinterpret_cast(event); + TimeSplitsItemSplitEvent(SPLIT_TYPE_UPGRADE, ev->contents); + }); - GameInteractor::Instance->RegisterGameHook([](void* refActor) { - Actor* bossActor = (Actor*)refActor; + REGISTER_LISTENER(OnBossDefeat, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnBossDefeat* ev = reinterpret_cast(event); + Actor* bossActor = (Actor*) ev->actor; TimeSplitsItemSplitEvent(SPLIT_TYPE_BOSS, bossActor->id); }); - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnSceneInit* ev = reinterpret_cast(event); if (gPlayState->sceneNum != SCENE_KAKARIKO_VILLAGE) { - TimeSplitsItemSplitEvent(SPLIT_TYPE_ENTRANCE, sceneNum); + TimeSplitsItemSplitEvent(SPLIT_TYPE_ENTRANCE, ev->sceneNum); } }); - GameInteractor::Instance->RegisterGameHook([](int16_t amount) { + REGISTER_LISTENER(OnPlayerHealthChange, EVENT_PRIORITY_LOW, [](IEvent* event) { if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE) { Player* player = GET_PLAYER(gPlayState); if (player->fallDistance > 500 && gSaveContext.health <= 0) { diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index fddcb77ce9a..3e81b338107 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -100,16 +100,17 @@ std::string NameForSceneId(int16_t sceneId) { static std::string titleCardText; void RegisterOnSceneInitHook() { - GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnSceneInit* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - titleCardText = NameForSceneId(sceneNum); + titleCardText = NameForSceneId(ev->sceneNum); }); } void RegisterOnPresentTitleCardHook() { - GameInteractor::Instance->RegisterGameHook([]() { + REGISTER_LISTENER(OnPresentTitleCard, EVENT_PRIORITY_LOW, [](IEvent* event) { if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; @@ -120,7 +121,7 @@ void RegisterOnPresentTitleCardHook() { // MARK: - Interface Updates void RegisterOnInterfaceUpdateHook() { - GameInteractor::Instance->RegisterGameHook([]() { + REGISTER_LISTENER(OnInterfaceUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; @@ -179,373 +180,376 @@ void RegisterOnInterfaceUpdateHook() { }); } -void RegisterOnKaleidoscopeUpdateHook() { - GameInteractor::Instance->RegisterGameHook([](int16_t inDungeonScene) { - if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) - return; +void OnKaleidoUpdateImpl(IEvent* event) { + OnKaleidoscopeUpdate* ev = reinterpret_cast(event); + if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) + return; + + static int16_t prevCursorIndex = 0; + static uint16_t prevCursorSpecialPos = 0; + static uint16_t prevCursorPoint[5] = { 0 }; + static int16_t prevPromptChoice = -1; + static int16_t prevSubState = -1; + static int16_t prevState = -1; + + PauseContext* pauseCtx = &gPlayState->pauseCtx; + Input* input = &gPlayState->state.input[0]; + + // Save game prompt + if (pauseCtx->state == 7) { + if (pauseCtx->unk_1EC == 1) { + // prompt + if (prevPromptChoice != pauseCtx->promptChoice) { + auto prompt = + GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); + if (prevPromptChoice == -1) { + auto translation = GetParameritizedText("save_prompt", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), GetLanguageCode()); + } else { + SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); + } - static int16_t prevCursorIndex = 0; - static uint16_t prevCursorSpecialPos = 0; - static uint16_t prevCursorPoint[5] = { 0 }; - static int16_t prevPromptChoice = -1; - static int16_t prevSubState = -1; - static int16_t prevState = -1; + prevPromptChoice = pauseCtx->promptChoice; + } + } else if (pauseCtx->unk_1EC == 4 && prevSubState != 4) { + // Saved + auto translation = GetParameritizedText("game_saved", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } + prevSubState = pauseCtx->unk_1EC; + prevState = pauseCtx->state; + return; + } - PauseContext* pauseCtx = &gPlayState->pauseCtx; - Input* input = &gPlayState->state.input[0]; + // Game over + prompts + if (pauseCtx->state >= 0xC && pauseCtx->state <= 0x10) { + // Reset prompt tracker after state change + if (prevState != pauseCtx->state) { + prevPromptChoice = -1; + } - // Save game prompt - if (pauseCtx->state == 7) { - if (pauseCtx->unk_1EC == 1) { - // prompt + switch (pauseCtx->state) { + // Game over in full alpha + case 0xC: { + // Fire once on state change + if (prevState != pauseCtx->state) { + auto translation = GetParameritizedText("game_over", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } + break; + } + // Prompt for save + case 0xE: { if (prevPromptChoice != pauseCtx->promptChoice) { auto prompt = GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); if (prevPromptChoice == -1) { auto translation = GetParameritizedText("save_prompt", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), GetLanguageCode()); + SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), + GetLanguageCode()); } else { SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); } prevPromptChoice = pauseCtx->promptChoice; } - } else if (pauseCtx->unk_1EC == 4 && prevSubState != 4) { - // Saved - auto translation = GetParameritizedText("game_saved", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } - prevSubState = pauseCtx->unk_1EC; - prevState = pauseCtx->state; - return; - } - - // Game over + prompts - if (pauseCtx->state >= 0xC && pauseCtx->state <= 0x10) { - // Reset prompt tracker after state change - if (prevState != pauseCtx->state) { - prevPromptChoice = -1; - } - - switch (pauseCtx->state) { - // Game over in full alpha - case 0xC: { - // Fire once on state change - if (prevState != pauseCtx->state) { - auto translation = GetParameritizedText("game_over", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } - break; - } - // Prompt for save - case 0xE: { - if (prevPromptChoice != pauseCtx->promptChoice) { - auto prompt = - GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); - if (prevPromptChoice == -1) { - auto translation = GetParameritizedText("save_prompt", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), - GetLanguageCode()); - } else { - SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); - } - - prevPromptChoice = pauseCtx->promptChoice; - } - break; - } - // Game saved - case 0xF: { - // Fire once on state change - if (prevState != pauseCtx->state) { - auto translation = GetParameritizedText("game_saved", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } - break; - } - // Prompt to continue playing - case 0x10: { - if (prevPromptChoice != pauseCtx->promptChoice) { - auto prompt = - GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); - if (prevPromptChoice == -1) { - auto translation = GetParameritizedText("continue_game", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), - GetLanguageCode()); - } else { - SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); - } - - prevPromptChoice = pauseCtx->promptChoice; - } - break; - } + break; } - - prevState = pauseCtx->state; - return; - } - - // Announce page when - // Kaleido pages are rotating and page halfway rotated - // Or Kaleido was just opened - if ((pauseCtx->unk_1E4 == 1 && pauseCtx->unk_1EA == 32) || (pauseCtx->state == 4 && prevState != 4)) { - uint16_t modeNextPageMap[] = { - PAUSE_MAP, PAUSE_EQUIP, PAUSE_QUEST, PAUSE_ITEM, PAUSE_EQUIP, PAUSE_MAP, PAUSE_ITEM, PAUSE_QUEST, - }; - uint16_t nextPage = modeNextPageMap[pauseCtx->mode]; - - switch (nextPage) { - case PAUSE_ITEM: { - auto translation = GetParameritizedText("item_menu", TEXT_BANK_KALEIDO, nullptr); + // Game saved + case 0xF: { + // Fire once on state change + if (prevState != pauseCtx->state) { + auto translation = GetParameritizedText("game_saved", TEXT_BANK_KALEIDO, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; } - case PAUSE_MAP: { - std::string map; - if (inDungeonScene) { - std::string key = std::to_string(gSaveContext.mapIndex); - map = GetParameritizedText(key, TEXT_BANK_SCENES, nullptr); + break; + } + // Prompt to continue playing + case 0x10: { + if (prevPromptChoice != pauseCtx->promptChoice) { + auto prompt = + GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); + if (prevPromptChoice == -1) { + auto translation = GetParameritizedText("continue_game", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), + GetLanguageCode()); } else { - map = GetParameritizedText("overworld", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); } - auto translation = GetParameritizedText("map_menu", TEXT_BANK_KALEIDO, map.c_str()); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - case PAUSE_QUEST: { - auto translation = GetParameritizedText("quest_menu", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - case PAUSE_EQUIP: { - auto translation = GetParameritizedText("equip_menu", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; + + prevPromptChoice = pauseCtx->promptChoice; } + break; } - prevState = pauseCtx->state; - return; } prevState = pauseCtx->state; + return; + } - if (pauseCtx->state != 6) { - // Reset cursor index and values so it is announced when pause is reopened - prevCursorIndex = -1; - prevPromptChoice = -1; - prevSubState = -1; - return; - } + // Announce page when + // Kaleido pages are rotating and page halfway rotated + // Or Kaleido was just opened + if ((pauseCtx->unk_1E4 == 1 && pauseCtx->unk_1EA == 32) || (pauseCtx->state == 4 && prevState != 4)) { + uint16_t modeNextPageMap[] = { + PAUSE_MAP, PAUSE_EQUIP, PAUSE_QUEST, PAUSE_ITEM, PAUSE_EQUIP, PAUSE_MAP, PAUSE_ITEM, PAUSE_QUEST, + }; + uint16_t nextPage = modeNextPageMap[pauseCtx->mode]; - if ((pauseCtx->debugState != 1) && (pauseCtx->debugState != 2)) { - char arg[8]; - if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) { - // Normalize hearts to fractional count similar to z_lifemeter - int curHeartFraction = gSaveContext.health % 16; - int fullHearts = gSaveContext.health / 16; - float fraction = ceilf((float)curHeartFraction / 5) * 0.25; - float health = (float)fullHearts + fraction; - snprintf(arg, sizeof(arg), "%g", health); - auto translation = GetParameritizedText("health", TEXT_BANK_KALEIDO, arg); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } else if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT) && gSaveContext.magicCapacity != 0) { - // Normalize magic to percentage - float magicLevel = ((float)gSaveContext.magic / gSaveContext.magicCapacity) * 100; - snprintf(arg, sizeof(arg), "%.0f%%", magicLevel); - auto translation = GetParameritizedText("magic", TEXT_BANK_KALEIDO, arg); + switch (nextPage) { + case PAUSE_ITEM: { + auto translation = GetParameritizedText("item_menu", TEXT_BANK_KALEIDO, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } else if (CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { - if (gPlayState->sceneNum >= SCENE_FOREST_TEMPLE && gPlayState->sceneNum <= SCENE_INSIDE_GANONS_CASTLE) { - snprintf(arg, sizeof(arg), "%d", - std::max(gSaveContext.inventory.dungeonKeys[gPlayState->sceneNum], (s8)0)); - auto translation = GetParameritizedText("keys", TEXT_BANK_KALEIDO, arg); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; + } + case PAUSE_MAP: { + std::string map; + if (ev->inDungeonScene) { + std::string key = std::to_string(gSaveContext.mapIndex); + map = GetParameritizedText(key, TEXT_BANK_SCENES, nullptr); } else { - snprintf(arg, sizeof(arg), "%d", gSaveContext.rupees); - auto translation = GetParameritizedText("rupees", TEXT_BANK_KALEIDO, arg); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + map = GetParameritizedText("overworld", TEXT_BANK_KALEIDO, nullptr); } - } else if (CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { - // TODO: announce timer? + auto translation = GetParameritizedText("map_menu", TEXT_BANK_KALEIDO, map.c_str()); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; + } + case PAUSE_QUEST: { + auto translation = GetParameritizedText("quest_menu", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; + } + case PAUSE_EQUIP: { + auto translation = GetParameritizedText("equip_menu", TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; } } + prevState = pauseCtx->state; + return; + } - uint16_t cursorIndex = - (pauseCtx->pageIndex == PAUSE_MAP && !inDungeonScene) ? PAUSE_WORLD_MAP : pauseCtx->pageIndex; - if (prevCursorIndex == cursorIndex && prevCursorSpecialPos == pauseCtx->cursorSpecialPos && - prevCursorPoint[cursorIndex] == pauseCtx->cursorPoint[cursorIndex]) { - return; - } + prevState = pauseCtx->state; - prevCursorSpecialPos = pauseCtx->cursorSpecialPos; + if (pauseCtx->state != 6) { + // Reset cursor index and values so it is announced when pause is reopened + prevCursorIndex = -1; + prevPromptChoice = -1; + prevSubState = -1; + return; + } - if (pauseCtx->cursorSpecialPos > 0) { - return; + if ((pauseCtx->debugState != 1) && (pauseCtx->debugState != 2)) { + char arg[8]; + if (CHECK_BTN_ALL(input->press.button, BTN_DUP)) { + // Normalize hearts to fractional count similar to z_lifemeter + int curHeartFraction = gSaveContext.health % 16; + int fullHearts = gSaveContext.health / 16; + float fraction = ceilf((float)curHeartFraction / 5) * 0.25; + float health = (float)fullHearts + fraction; + snprintf(arg, sizeof(arg), "%g", health); + auto translation = GetParameritizedText("health", TEXT_BANK_KALEIDO, arg); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } else if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT) && gSaveContext.magicCapacity != 0) { + // Normalize magic to percentage + float magicLevel = ((float)gSaveContext.magic / gSaveContext.magicCapacity) * 100; + snprintf(arg, sizeof(arg), "%.0f%%", magicLevel); + auto translation = GetParameritizedText("magic", TEXT_BANK_KALEIDO, arg); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } else if (CHECK_BTN_ALL(input->press.button, BTN_DDOWN)) { + if (gPlayState->sceneNum >= SCENE_FOREST_TEMPLE && gPlayState->sceneNum <= SCENE_INSIDE_GANONS_CASTLE) { + snprintf(arg, sizeof(arg), "%d", + std::max(gSaveContext.inventory.dungeonKeys[gPlayState->sceneNum], (s8)0)); + auto translation = GetParameritizedText("keys", TEXT_BANK_KALEIDO, arg); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } else { + snprintf(arg, sizeof(arg), "%d", gSaveContext.rupees); + auto translation = GetParameritizedText("rupees", TEXT_BANK_KALEIDO, arg); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } + } else if (CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)) { + // TODO: announce timer? } + } - std::string buttonNames[] = { - "input_button_c_left", "input_button_c_down", "input_button_c_right", "input_d_pad_up", - "input_d_pad_down", "input_d_pad_left", "input_d_pad_right", - }; - int8_t assignedTo = -1; + uint16_t cursorIndex = + (pauseCtx->pageIndex == PAUSE_MAP && !ev->inDungeonScene) ? PAUSE_WORLD_MAP : pauseCtx->pageIndex; + if (prevCursorIndex == cursorIndex && prevCursorSpecialPos == pauseCtx->cursorSpecialPos && + prevCursorPoint[cursorIndex] == pauseCtx->cursorPoint[cursorIndex]) { + return; + } - switch (pauseCtx->pageIndex) { - case PAUSE_ITEM: { - char arg[8]; // at least big enough where no s8 string will overflow - switch (pauseCtx->cursorItem[PAUSE_ITEM]) { - case ITEM_STICK: - case ITEM_NUT: - case ITEM_BOMB: - case ITEM_BOMBCHU: - case ITEM_SLINGSHOT: - case ITEM_BOW: - case ITEM_BEAN: - snprintf(arg, sizeof(arg), "%d", AMMO(pauseCtx->cursorItem[PAUSE_ITEM])); - break; - default: - arg[0] = '\0'; - } + prevCursorSpecialPos = pauseCtx->cursorSpecialPos; - if (pauseCtx->cursorItem[PAUSE_ITEM] == PAUSE_ITEM_NONE || - pauseCtx->cursorItem[PAUSE_ITEM] == ITEM_NONE) { - prevCursorIndex = -1; - return; - } + if (pauseCtx->cursorSpecialPos > 0) { + return; + } - std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_ITEM]); - std::string itemTranslation = GetParameritizedText(key, TEXT_BANK_KALEIDO, arg); + std::string buttonNames[] = { + "input_button_c_left", "input_button_c_down", "input_button_c_right", "input_d_pad_up", + "input_d_pad_down", "input_d_pad_left", "input_d_pad_right", + }; + int8_t assignedTo = -1; - // Check if item is assigned to a button - for (size_t i = 0; i < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); i++) { - if (gSaveContext.equips.buttonItems[i + 1] == pauseCtx->cursorItem[PAUSE_ITEM]) { - assignedTo = i; - break; - } - } + switch (pauseCtx->pageIndex) { + case PAUSE_ITEM: { + char arg[8]; // at least big enough where no s8 string will overflow + switch (pauseCtx->cursorItem[PAUSE_ITEM]) { + case ITEM_STICK: + case ITEM_NUT: + case ITEM_BOMB: + case ITEM_BOMBCHU: + case ITEM_SLINGSHOT: + case ITEM_BOW: + case ITEM_BEAN: + snprintf(arg, sizeof(arg), "%d", AMMO(pauseCtx->cursorItem[PAUSE_ITEM])); + break; + default: + arg[0] = '\0'; + } - if (assignedTo != -1) { - auto button = GetParameritizedText(buttonNames[assignedTo], TEXT_BANK_MISC, nullptr); - auto translation = GetParameritizedText("assigned_to", TEXT_BANK_KALEIDO, button.c_str()); - SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), - GetLanguageCode()); - } else { - SpeechSynthesizer::Instance->Speak(itemTranslation.c_str(), GetLanguageCode()); + if (pauseCtx->cursorItem[PAUSE_ITEM] == PAUSE_ITEM_NONE || + pauseCtx->cursorItem[PAUSE_ITEM] == ITEM_NONE) { + prevCursorIndex = -1; + return; + } + + std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_ITEM]); + std::string itemTranslation = GetParameritizedText(key, TEXT_BANK_KALEIDO, arg); + + // Check if item is assigned to a button + for (size_t i = 0; i < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); i++) { + if (gSaveContext.equips.buttonItems[i + 1] == pauseCtx->cursorItem[PAUSE_ITEM]) { + assignedTo = i; + break; } - break; } - case PAUSE_MAP: - if (inDungeonScene) { - // Dungeon map items - if (pauseCtx->cursorItem[PAUSE_MAP] != PAUSE_ITEM_NONE) { - std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_MAP]); - auto translation = GetParameritizedText(key, TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } else { - // Dungeon map floor numbers - char arg[8]; - int cursorPoint = pauseCtx->cursorPoint[PAUSE_MAP]; - - // Cursor is on a dungeon floor position - if (cursorPoint >= 3 && cursorPoint < 11) { - int floorID = - gMapData->floorID[gPlayState->interfaceCtx.unk_25A][pauseCtx->dungeonMapSlot - 3]; - // Normalize so F1 == 0, and negative numbers are basement levels - int normalizedFloor = (floorID * -1) + 8; - if (normalizedFloor >= 0) { - snprintf(arg, sizeof(arg), "%d", normalizedFloor + 1); - auto translation = GetParameritizedText("floor", TEXT_BANK_KALEIDO, arg); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } else { - snprintf(arg, sizeof(arg), "%d", normalizedFloor * -1); - auto translation = GetParameritizedText("basement", TEXT_BANK_KALEIDO, arg); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - } - } - } - } else { - std::string key = std::to_string(0x0100 + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]); + + if (assignedTo != -1) { + auto button = GetParameritizedText(buttonNames[assignedTo], TEXT_BANK_MISC, nullptr); + auto translation = GetParameritizedText("assigned_to", TEXT_BANK_KALEIDO, button.c_str()); + SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), + GetLanguageCode()); + } else { + SpeechSynthesizer::Instance->Speak(itemTranslation.c_str(), GetLanguageCode()); + } + break; + } + case PAUSE_MAP: + if (ev->inDungeonScene) { + // Dungeon map items + if (pauseCtx->cursorItem[PAUSE_MAP] != PAUSE_ITEM_NONE) { + std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_MAP]); auto translation = GetParameritizedText(key, TEXT_BANK_KALEIDO, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } else { + // Dungeon map floor numbers + char arg[8]; + int cursorPoint = pauseCtx->cursorPoint[PAUSE_MAP]; + + // Cursor is on a dungeon floor position + if (cursorPoint >= 3 && cursorPoint < 11) { + int floorID = + gMapData->floorID[gPlayState->interfaceCtx.unk_25A][pauseCtx->dungeonMapSlot - 3]; + // Normalize so F1 == 0, and negative numbers are basement levels + int normalizedFloor = (floorID * -1) + 8; + if (normalizedFloor >= 0) { + snprintf(arg, sizeof(arg), "%d", normalizedFloor + 1); + auto translation = GetParameritizedText("floor", TEXT_BANK_KALEIDO, arg); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } else { + snprintf(arg, sizeof(arg), "%d", normalizedFloor * -1); + auto translation = GetParameritizedText("basement", TEXT_BANK_KALEIDO, arg); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } + } } - break; - case PAUSE_QUEST: { - char arg[8]; // at least big enough where no s8 string will overflow - switch (pauseCtx->cursorItem[PAUSE_QUEST]) { - case ITEM_SKULL_TOKEN: - snprintf(arg, sizeof(arg), "%d", gSaveContext.inventory.gsTokens); - break; - case ITEM_HEART_CONTAINER: - snprintf(arg, sizeof(arg), "%d", (gSaveContext.inventory.questItems & 0xF0000000) >> 0x1C); - break; - default: - arg[0] = '\0'; - } + } else { + std::string key = std::to_string(0x0100 + pauseCtx->cursorPoint[PAUSE_WORLD_MAP]); + auto translation = GetParameritizedText(key, TEXT_BANK_KALEIDO, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + } + break; + case PAUSE_QUEST: { + char arg[8]; // at least big enough where no s8 string will overflow + switch (pauseCtx->cursorItem[PAUSE_QUEST]) { + case ITEM_SKULL_TOKEN: + snprintf(arg, sizeof(arg), "%d", gSaveContext.inventory.gsTokens); + break; + case ITEM_HEART_CONTAINER: + snprintf(arg, sizeof(arg), "%d", (gSaveContext.inventory.questItems & 0xF0000000) >> 0x1C); + break; + default: + arg[0] = '\0'; + } - if (pauseCtx->cursorItem[PAUSE_QUEST] == PAUSE_ITEM_NONE) { - prevCursorIndex = -1; - return; - } + if (pauseCtx->cursorItem[PAUSE_QUEST] == PAUSE_ITEM_NONE) { + prevCursorIndex = -1; + return; + } - std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_QUEST]); - auto translation = GetParameritizedText(key, TEXT_BANK_KALEIDO, arg); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; + std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_QUEST]); + auto translation = GetParameritizedText(key, TEXT_BANK_KALEIDO, arg); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; + } + case PAUSE_EQUIP: { + if (pauseCtx->namedItem == PAUSE_ITEM_NONE) { + prevCursorIndex = -1; + return; } - case PAUSE_EQUIP: { - if (pauseCtx->namedItem == PAUSE_ITEM_NONE) { - prevCursorIndex = -1; - return; - } - std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_EQUIP]); - auto itemTranslation = GetParameritizedText(key, TEXT_BANK_KALEIDO, nullptr); - uint8_t checkEquipItem = pauseCtx->namedItem; + std::string key = std::to_string(pauseCtx->cursorItem[PAUSE_EQUIP]); + auto itemTranslation = GetParameritizedText(key, TEXT_BANK_KALEIDO, nullptr); + uint8_t checkEquipItem = pauseCtx->namedItem; - // BGS from kaleido reports as ITEM_HEART_PIECE_2 (122) - // remap BGS and broken knife to be the BGS item for the current equip check - if (checkEquipItem == ITEM_HEART_PIECE_2 || checkEquipItem == ITEM_SWORD_KNIFE) { - checkEquipItem = ITEM_SWORD_BGS; - } + // BGS from kaleido reports as ITEM_HEART_PIECE_2 (122) + // remap BGS and broken knife to be the BGS item for the current equip check + if (checkEquipItem == ITEM_HEART_PIECE_2 || checkEquipItem == ITEM_SWORD_KNIFE) { + checkEquipItem = ITEM_SWORD_BGS; + } - // Check if equipment item is currently equipped or assigned to a button - if (checkEquipItem >= ITEM_SWORD_KOKIRI && checkEquipItem <= ITEM_BOOTS_HOVER) { - uint8_t checkEquipType = (checkEquipItem - ITEM_SWORD_KOKIRI) / 3; - uint8_t checkEquipValue = ((checkEquipItem - ITEM_SWORD_KOKIRI) % 3) + 1; + // Check if equipment item is currently equipped or assigned to a button + if (checkEquipItem >= ITEM_SWORD_KOKIRI && checkEquipItem <= ITEM_BOOTS_HOVER) { + uint8_t checkEquipType = (checkEquipItem - ITEM_SWORD_KOKIRI) / 3; + uint8_t checkEquipValue = ((checkEquipItem - ITEM_SWORD_KOKIRI) % 3) + 1; - if (CUR_EQUIP_VALUE(checkEquipType) == checkEquipValue) { - itemTranslation = GetParameritizedText("equipped", TEXT_BANK_KALEIDO, itemTranslation.c_str()); - } + if (CUR_EQUIP_VALUE(checkEquipType) == checkEquipValue) { + itemTranslation = GetParameritizedText("equipped", TEXT_BANK_KALEIDO, itemTranslation.c_str()); + } - for (size_t i = 0; i < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); i++) { - if (gSaveContext.equips.buttonItems[i + 1] == checkEquipItem) { - assignedTo = i; - break; - } + for (size_t i = 0; i < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); i++) { + if (gSaveContext.equips.buttonItems[i + 1] == checkEquipItem) { + assignedTo = i; + break; } } + } - if (assignedTo != -1) { - auto button = GetParameritizedText(buttonNames[assignedTo], TEXT_BANK_MISC, nullptr); - auto translation = GetParameritizedText("assigned_to", TEXT_BANK_KALEIDO, button.c_str()); - SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), - GetLanguageCode()); - } else { - SpeechSynthesizer::Instance->Speak(itemTranslation.c_str(), GetLanguageCode()); - } - break; + if (assignedTo != -1) { + auto button = GetParameritizedText(buttonNames[assignedTo], TEXT_BANK_MISC, nullptr); + auto translation = GetParameritizedText("assigned_to", TEXT_BANK_KALEIDO, button.c_str()); + SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), + GetLanguageCode()); + } else { + SpeechSynthesizer::Instance->Speak(itemTranslation.c_str(), GetLanguageCode()); } - default: - break; + break; } + default: + break; + } - prevCursorIndex = cursorIndex; - memcpy(prevCursorPoint, pauseCtx->cursorPoint, sizeof(prevCursorPoint)); - }); + prevCursorIndex = cursorIndex; + memcpy(prevCursorPoint, pauseCtx->cursorPoint, sizeof(prevCursorPoint)); +} + +void RegisterOnKaleidoscopeUpdateHook() { + REGISTER_LISTENER(OnKaleidoscopeUpdate, EVENT_PRIORITY_LOW, OnKaleidoUpdateImpl); } void RegisterOnUpdateMainMenuSelection() { - GameInteractor::Instance->RegisterGameHook([]() { + REGISTER_LISTENER(OnPresentFileSelect, EVENT_PRIORITY_LOW, [](IEvent* event) { if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; @@ -553,11 +557,12 @@ void RegisterOnUpdateMainMenuSelection() { SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); }); - GameInteractor::Instance->RegisterGameHook([](uint16_t optionIndex) { + REGISTER_LISTENER(OnUpdateFileSelectSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileSelectSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (optionIndex) { + switch (ev->optionIndex) { case FS_BTN_MAIN_FILE_1: { auto translation = GetParameritizedText("file1", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -593,12 +598,12 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook( - [](uint16_t optionIndex) { + REGISTER_LISTENER(OnUpdateFileSelectConfirmationSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileSelectConfirmationSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (optionIndex) { + switch (ev->optionIndex) { case FS_BTN_CONFIRM_YES: { auto translation = GetParameritizedText("confirm", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -614,11 +619,13 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook([](uint16_t optionIndex) { + REGISTER_LISTENER(OnUpdateFileCopySelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileCopySelection* ev = reinterpret_cast(event); + if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (optionIndex) { + switch (ev->optionIndex) { case FS_BTN_COPY_FILE_1: { auto translation = GetParameritizedText("file1", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -644,32 +651,33 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook( - [](uint16_t optionIndex) { - if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) - return; + REGISTER_LISTENER(OnUpdateFileCopyConfirmationSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileCopySelection* ev = reinterpret_cast(event); + if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) + return; - switch (optionIndex) { - case FS_BTN_CONFIRM_YES: { - auto translation = GetParameritizedText("confirm", TEXT_BANK_FILECHOOSE, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - case FS_BTN_CONFIRM_QUIT: { - auto translation = GetParameritizedText("quit", TEXT_BANK_FILECHOOSE, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - default: - break; + switch (ev->optionIndex) { + case FS_BTN_CONFIRM_YES: { + auto translation = GetParameritizedText("confirm", TEXT_BANK_FILECHOOSE, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; } - }); + case FS_BTN_CONFIRM_QUIT: { + auto translation = GetParameritizedText("quit", TEXT_BANK_FILECHOOSE, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; + } + default: + break; + } + }); - GameInteractor::Instance->RegisterGameHook([](uint16_t optionIndex) { + REGISTER_LISTENER(OnUpdateFileEraseSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileEraseSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (optionIndex) { + switch (ev->optionIndex) { case FS_BTN_ERASE_FILE_1: { auto translation = GetParameritizedText("file1", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -695,32 +703,34 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook( - [](uint16_t optionIndex) { - if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) - return; + REGISTER_LISTENER(OnUpdateFileEraseConfirmationSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileEraseConfirmationSelection* ev = reinterpret_cast(event); - switch (optionIndex) { - case FS_BTN_CONFIRM_YES: { - auto translation = GetParameritizedText("confirm", TEXT_BANK_FILECHOOSE, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - case FS_BTN_CONFIRM_QUIT: { - auto translation = GetParameritizedText("quit", TEXT_BANK_FILECHOOSE, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - default: - break; + if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) + return; + + switch (ev->optionIndex) { + case FS_BTN_CONFIRM_YES: { + auto translation = GetParameritizedText("confirm", TEXT_BANK_FILECHOOSE, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; } - }); + case FS_BTN_CONFIRM_QUIT: { + auto translation = GetParameritizedText("quit", TEXT_BANK_FILECHOOSE, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; + } + default: + break; + } + }); - GameInteractor::Instance->RegisterGameHook([](uint8_t optionIndex) { + REGISTER_LISTENER(OnUpdateFileAudioSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileAudioSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (optionIndex) { + switch (ev->optionIndex) { case FS_AUDIO_STEREO: { auto translation = GetParameritizedText("audio_stereo", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -746,11 +756,12 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook([](uint8_t optionIndex) { + REGISTER_LISTENER(OnUpdateFileTargetSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileTargetSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (optionIndex) { + switch (ev->optionIndex) { case FS_TARGET_SWITCH: { auto translation = GetParameritizedText("target_switch", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -766,11 +777,12 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook([](uint8_t optionIndex) { + REGISTER_LISTENER(OnUpdateFileLanguageSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileLanguageSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (optionIndex) { + switch (ev->optionIndex) { case LANGUAGE_ENG: { auto translation = GetParameritizedText("language_english", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -791,11 +803,12 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook([](uint8_t questIndex) { + REGISTER_LISTENER(OnUpdateFileQuestSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileQuestSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; - switch (questIndex) { + switch (ev->questIndex) { case QUEST_NORMAL: { auto translation = GetParameritizedText("quest_sel_vanilla", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); @@ -821,34 +834,36 @@ void RegisterOnUpdateMainMenuSelection() { } }); - GameInteractor::Instance->RegisterGameHook( - [](uint8_t optionIndex, uint8_t optionValue) { - if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) - return; - uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language; + REGISTER_LISTENER(OnUpdateFileBossRushOptionSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileBossRushOptionSelection* ev = reinterpret_cast(event); + if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) + return; + uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language; - auto optionName = BossRush_GetSettingName(optionIndex, language); - auto optionValueName = BossRush_GetSettingChoiceName(optionIndex, optionValue, language); - auto translation = optionName + std::string(" - ") + optionValueName; - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - }); + auto optionName = BossRush_GetSettingName(ev->optionIndex, language); + auto optionValueName = BossRush_GetSettingChoiceName(ev->optionIndex, ev->optionValue, language); + auto translation = optionName + std::string(" - ") + optionValueName; + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + }); - GameInteractor::Instance->RegisterGameHook( - [](uint8_t optionIndex) { - if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) - return; - uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language; + REGISTER_LISTENER(OnUpdateFileRandomizerOptionSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileRandomizerOptionSelection* ev = reinterpret_cast(event); + if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) + return; + uint8_t language = (gSaveContext.language == LANGUAGE_JPN) ? LANGUAGE_ENG : gSaveContext.language; - auto optionName = SohFileSelect_GetSettingText(optionIndex, language); - SpeechSynthesizer::Instance->Speak(optionName, GetLanguageCode()); - }); + auto optionName = SohFileSelect_GetSettingText(ev->optionIndex, language); + SpeechSynthesizer::Instance->Speak(optionName, GetLanguageCode()); + }); - GameInteractor::Instance->RegisterGameHook([](int16_t charCode) { + REGISTER_LISTENER(OnUpdateFileNameSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnUpdateFileNameSelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; char charVal[2] = {}; std::string translation; + int16_t charCode = ev->charCode; if (charCode < 10) { // Digits charVal[0] = charCode + 0x30; @@ -1025,7 +1040,7 @@ std::string Message_TTS_Decode(uint8_t* sourceBuf, uint16_t startOfset, uint16_t } void RegisterOnDialogMessageHook() { - GameInteractor::Instance->RegisterGameHook([]() { + REGISTER_LISTENER(OnDialogMessage, EVENT_PRIORITY_LOW, [](IEvent* event) { if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; @@ -1144,15 +1159,17 @@ void InitTTSBank() { } void RegisterOnSetGameLanguageHook() { - GameInteractor::Instance->RegisterGameHook([]() { InitTTSBank(); }); + REGISTER_LISTENER(OnSetGameLanguage, EVENT_PRIORITY_LOW, [](IEvent* event) { InitTTSBank(); }); } void RegisterOnSetDoAction() { - GameInteractor::Instance->RegisterGameHook([](uint16_t action) { + REGISTER_LISTENER(OnSetDoAction, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnSetDoAction* ev = reinterpret_cast(event); + if (CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) { uint8_t language = CVarGetInteger(CVAR_SETTING("Languages"), 0); const char* text; - switch (action) { + switch (ev->action) { case DO_ACTION_CHECK: text = language == LANGUAGE_FRA ? "voir" : language == LANGUAGE_GER ? "lesen" : "check"; break; diff --git a/soh/soh/Network/Anchor/Packets/TeleportTo.cpp b/soh/soh/Network/Anchor/Packets/TeleportTo.cpp index c23ce730433..24dbce28cff 100644 --- a/soh/soh/Network/Anchor/Packets/TeleportTo.cpp +++ b/soh/soh/Network/Anchor/Packets/TeleportTo.cpp @@ -51,9 +51,9 @@ void Anchor::HandlePacket_TeleportTo(nlohmann::json payload) { gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = 0xDFF; gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK_FAST; gSaveContext.respawnFlag = 1; - static HOOK_ID hookId = 0; + static ListenerID hookId = 0; hookId = REGISTER_VB_SHOULD(VB_INFLICT_VOID_DAMAGE, { *should = false; - GameInteractor::Instance->UnregisterGameHookForID(hookId); + UNREGISTER_LISTENER(OnVanillaBehavior, hookId); }); } diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index e13dec4d501..54ed362d493 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -101,6 +101,7 @@ #include "soh/resource/type/SkeletonLimb.h" #include "soh/resource/type/Text.h" #include +#include #include #include #include @@ -799,6 +800,7 @@ void OTRGlobals::Initialize() { context->InitGfxDebugger(); context->InitFileDropMgr(); + context->InitEventSystem(); // tell LUS to reserve 3 SoH specific threads (Game, Audio, Save) prevAltAssets = CVarGetInteger(CVAR_SETTING("AltAssets"), 1); @@ -1465,6 +1467,8 @@ extern "C" void InitOTR(int argc, char* argv[]) { OTRGlobals::Instance->RunExtract(argc, argv); OTRGlobals::Instance->Initialize(); + EventSystem_Register(); + CustomMessageManager::Instance = new CustomMessageManager(); ItemTableManager::Instance = new ItemTableManager(); GameInteractor::Instance = new GameInteractor(); @@ -1799,7 +1803,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) { Ship::Context::GetInstance()->GetResourceManager()->SetAltAssetsEnabled(curAltAssets); gfx_texture_cache_clear(); SOH::SkeletonPatcher::UpdateSkeletons(); - GameInteractor::Instance->ExecuteHooks(); + CALL_EVENT(OnAssetAltChange); } // OTRTODO: FIGURE OUT END FRAME POINT diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 89224c0ab57..34dec31750e 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -124,8 +124,7 @@ SaveManager::SaveManager() { AddInitFunction(InitFileImpl); - GameInteractor::Instance->RegisterGameHook( - [this](uint32_t fileNum) { ThreadPoolWait(); }); + REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, [](IEvent* event) { SaveManager::Instance->ThreadPoolWait(); }); smThreadPool = std::make_shared(1); @@ -1202,7 +1201,7 @@ void SaveManager::SaveFileThreaded(int fileNum, SaveContext* saveContext, int se delete saveContext; InitMeta(fileNum); - GameInteractor::Instance->ExecuteHooks(fileNum, sectionID); + CALL_EVENT(OnSaveFile, fileNum, sectionID); SPDLOG_INFO("Save File Finish - fileNum: {}", fileNum); saveMtx.unlock(); } @@ -1306,7 +1305,7 @@ void SaveManager::LoadFile(int fileNum) { break; } InitMeta(fileNum); - GameInteractor::Instance->ExecuteHooks(fileNum); + CALL_EVENT(OnLoadFile, fileNum); } catch (const std::exception& e) { input.close(); std::string newFileName = @@ -2435,7 +2434,7 @@ void SaveManager::DeleteZeldaFile(int fileNum) { fileMetaInfo[fileNum].randoSave = false; fileMetaInfo[fileNum].requiresMasterQuest = false; fileMetaInfo[fileNum].requiresOriginal = false; - GameInteractor::Instance->ExecuteHooks(fileNum); + CALL_EVENT(OnDeleteFile, fileNum); } bool SaveManager::IsRandoFile() { diff --git a/soh/soh/SohGui/SohGui.cpp b/soh/soh/SohGui/SohGui.cpp index 04c47b4b7e6..b3f5b6d409c 100644 --- a/soh/soh/SohGui/SohGui.cpp +++ b/soh/soh/SohGui/SohGui.cpp @@ -74,7 +74,7 @@ std::shared_ptr mCosmeticsEditorWindow; std::shared_ptr mActorViewerWindow; std::shared_ptr mColViewerWindow; std::shared_ptr mSaveEditorWindow; -std::shared_ptr mHookDebuggerWindow; +std::shared_ptr mEventDebuggerWindow; std::shared_ptr mDLViewerWindow; std::shared_ptr mValueViewerWindow; std::shared_ptr mMessageViewerWindow; @@ -152,9 +152,8 @@ void SetupGuiElements() { gui->AddGuiWindow(mColViewerWindow); mSaveEditorWindow = std::make_shared(CVAR_WINDOW("SaveEditor"), "Save Editor", ImVec2(520, 600)); gui->AddGuiWindow(mSaveEditorWindow); - mHookDebuggerWindow = - std::make_shared(CVAR_WINDOW("HookDebugger"), "Hook Debugger", ImVec2(1250, 850)); - gui->AddGuiWindow(mHookDebuggerWindow); + mEventDebuggerWindow = std::make_shared(CVAR_WINDOW("EventDebugger"), "Event Debugger"); + gui->AddGuiWindow(mEventDebuggerWindow); mDLViewerWindow = std::make_shared(CVAR_WINDOW("DisplayListViewer"), "Display List Viewer", ImVec2(520, 600)); gui->AddGuiWindow(mDLViewerWindow); @@ -216,7 +215,7 @@ void Destroy() { mValueViewerWindow = nullptr; mMessageViewerWindow = nullptr; mSaveEditorWindow = nullptr; - mHookDebuggerWindow = nullptr; + mEventDebuggerWindow = nullptr; mColViewerWindow = nullptr; mActorViewerWindow = nullptr; mCosmeticsEditorWindow = nullptr; diff --git a/soh/soh/SohGui/SohGui.hpp b/soh/soh/SohGui/SohGui.hpp index bc2d5fec689..17e106ec92e 100644 --- a/soh/soh/SohGui/SohGui.hpp +++ b/soh/soh/SohGui/SohGui.hpp @@ -16,7 +16,6 @@ #include "soh/Enhancements/debugger/actorViewer.h" #include "soh/Enhancements/debugger/colViewer.h" #include "soh/Enhancements/debugger/debugSaveEditor.h" -#include "soh/Enhancements/debugger/hookDebugger.h" #include "soh/Enhancements/debugger/dlViewer.h" #include "soh/Enhancements/debugger/SohConsoleWindow.h" #include "soh/Enhancements/debugger/SohGfxDebuggerWindow.h" @@ -28,6 +27,7 @@ #include "soh/Enhancements/randomizer/randomizer_item_tracker.h" #include "soh/Enhancements/timesplits/TimeSplits.h" #include "soh/Enhancements/randomizer/Plandomizer.h" +#include #include "SohModals.h" namespace SohGui { @@ -45,6 +45,8 @@ void ShowRandomizerSettingsMenu(); void ShowEscMenu(); UIWidgets::Colors GetMenuThemeColor(); std::shared_ptr GetSohMenu(); + +extern std::shared_ptr mActorViewerWindow; } // namespace SohGui #define THEME_COLOR SohGui::GetMenuThemeColor() diff --git a/soh/soh/SohGui/SohMenuDevTools.cpp b/soh/soh/SohGui/SohMenuDevTools.cpp index c5b88ce8fbc..c2263beaa91 100644 --- a/soh/soh/SohGui/SohMenuDevTools.cpp +++ b/soh/soh/SohGui/SohMenuDevTools.cpp @@ -167,13 +167,13 @@ void SohMenu::AddMenuDevTools() { .Options(WindowButtonOptions().Tooltip("Enables the separate Save Editor Window.")); // Hook Debugger - path.sidebarName = "Hook Debugger"; + path.sidebarName = "Event Debugger"; AddSidebarEntry("Dev Tools", path.sidebarName, 1); - AddWidget(path, "Popout Hook Debugger", WIDGET_WINDOW_BUTTON) - .CVar(CVAR_WINDOW("HookDebugger")) - .WindowName("Hook Debugger") + AddWidget(path, "Popout Event Debugger", WIDGET_WINDOW_BUTTON) + .CVar(CVAR_WINDOW("EventDebugger")) + .WindowName("Event Debugger") .HideInSearch(true) - .Options(WindowButtonOptions().Tooltip("Enables the separate Hook Debugger Window.")); + .Options(WindowButtonOptions().Tooltip("Enables the separate Event Debugger Window.")); // Collision Viewer path.sidebarName = "Collision Viewer"; From 7e7e1e0843ee02f98c5481ff842ced90a36607c2 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 17:47:02 -0600 Subject: [PATCH 07/31] Fixed wrong unregister --- .../Enhancements/randomizer/hook_handlers.cpp | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 7a10a7ab89f..e826b8bdf6d 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2673,24 +2673,24 @@ void RandomizerOnCuccoOrChickenHatch() { } static void RandomizerRegisterHooks() { - static uint32_t onFlagSetHook = 0; - static uint32_t onSceneFlagSetHook = 0; - static uint32_t onPlayerUpdateForRCQueueHook = 0; - static uint32_t onPlayerUpdateForItemQueueHook = 0; - static uint32_t onItemReceiveHook = 0; - static uint32_t onDialogMessageHook = 0; - static uint32_t onVanillaBehaviorHook = 0; - static uint32_t onSceneInitHook = 0; - static uint32_t afterSceneCommandsHook = 0; - static uint32_t onActorInitHook = 0; - static uint32_t onActorUpdateHook = 0; - static uint32_t onPlayerUpdateHook = 0; - static uint32_t onGameFrameUpdateHook = 0; - static uint32_t onSceneSpawnActorsHook = 0; - static uint32_t onPlayDestroyHook = 0; - static uint32_t onExitGameHook = 0; - static uint32_t onKaleidoUpdateHook = 0; - static uint32_t onCuccoOrChickenHatchHook = 0; + static ListenerID onFlagSetHook = -1; + static ListenerID onSceneFlagSetHook = -1; + static ListenerID onPlayerUpdateForRCQueueHook = -1; + static ListenerID onPlayerUpdateForItemQueueHook = -1; + static ListenerID onItemReceiveHook = -1; + static ListenerID onDialogMessageHook = -1; + static ListenerID onVanillaBehaviorHook = -1; + static ListenerID onSceneInitHook = -1; + static ListenerID afterSceneCommandsHook = -1; + static ListenerID onActorInitHook = -1; + static ListenerID onActorUpdateHook = -1; + static ListenerID onPlayerUpdateHook = -1; + static ListenerID onGameFrameUpdateHook = -1; + static ListenerID onSceneSpawnActorsHook = -1; + static ListenerID onPlayDestroyHook = -1; + static ListenerID onExitGameHook = -1; + static ListenerID onKaleidoUpdateHook = -1; + static ListenerID onCuccoOrChickenHatchHook = -1; // register this outside OnLoadGame as VB is invoked before OnLoadGame COND_VB_SHOULD(VB_REVERT_SPOILING_ITEMS, true, { From 7494a57f9279a0d9b8306eca8e18ff53876a919e Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 17:48:20 -0600 Subject: [PATCH 08/31] Clang Format --- soh/soh/Enhancements/BlueFireArrows.cpp | 4 +- .../ExtraModes/EnemyRandomizer.cpp | 2 +- .../GameplayStats/EnemyDefeatCounts.cpp | 5 +- .../Story/SkipZeldaFleeingCastle.cpp | 3 +- soh/soh/Enhancements/audio/AudioEditor.cpp | 4 +- .../cosmetics/CosmeticsEditor.cpp | 4 +- soh/soh/Enhancements/debugger/actorViewer.cpp | 4 +- soh/soh/Enhancements/debugger/colViewer.cpp | 4 +- soh/soh/Enhancements/mods.cpp | 75 +++--- soh/soh/Enhancements/nametag.cpp | 8 +- .../randomizer/Messages/MerchantMessages.cpp | 4 +- .../Enhancements/randomizer/ShuffleSigns.cpp | 2 +- .../Enhancements/randomizer/hook_handlers.cpp | 130 +++++----- .../randomizer_entrance_tracker.cpp | 6 +- .../Enhancements/timesaver_hook_handlers.cpp | 225 +++++++++--------- .../Enhancements/timesplits/TimeSplits.cpp | 4 +- soh/soh/Enhancements/tts/tts.cpp | 55 ++--- .../overlays/actors/ovl_En_Ossan/z_en_ossan.c | 12 +- 18 files changed, 263 insertions(+), 288 deletions(-) diff --git a/soh/soh/Enhancements/BlueFireArrows.cpp b/soh/soh/Enhancements/BlueFireArrows.cpp index e623cf6af63..04b0be96589 100644 --- a/soh/soh/Enhancements/BlueFireArrows.cpp +++ b/soh/soh/Enhancements/BlueFireArrows.cpp @@ -11,13 +11,13 @@ extern PlayState* gPlayState; static void UpdateBlueFireCollidersBgBreakwall(IEvent* event) { OnActorInit* ev = reinterpret_cast(event); - BgBreakwall* thisx = (BgBreakwall*) ev->actor; + BgBreakwall* thisx = (BgBreakwall*)ev->actor; thisx->collider.info.bumper.dmgFlags |= DMG_ARROW_ICE; } static void UpdateBlueFireCollidersBgIceShelter(IEvent* event) { OnActorInit* ev = reinterpret_cast(event); - BgIceShelter* thisx = (BgIceShelter*) ev->actor; + BgIceShelter* thisx = (BgIceShelter*)ev->actor; thisx->cylinder1.base.acFlags |= AC_TYPE_PLAYER; thisx->cylinder1.info.bumper.dmgFlags |= DMG_ARROW_ICE; thisx->cylinder2.base.acFlags |= AC_TYPE_PLAYER; diff --git a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp index 05249f7d478..64f26fbcc5a 100644 --- a/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp +++ b/soh/soh/Enhancements/ExtraModes/EnemyRandomizer.cpp @@ -497,7 +497,7 @@ uint8_t GetRandomizedEnemy(PlayState* play, int16_t* actorId, s16* posX, s16* po void FixClubMoblinScale(IEvent* event) { OnActorInit* ev = reinterpret_cast(event); - Actor* actor = (Actor*) ev->actor; + Actor* actor = (Actor*)ev->actor; if (actor->params == -1) { Actor_SetScale(actor, 0.014f); } diff --git a/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp b/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp index fabd3e9f1f6..33323b28e01 100644 --- a/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp +++ b/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp @@ -22,8 +22,9 @@ static void IncrementEnemyDefeatCount(GameplayStatCount countType) { gSaveContext.ship.stats.count[countType]++; } -#define ENEMY_DEFEAT_COUNT(actorID, func) \ - COND_ID_HOOK(OnEnemyDefeat, actorID, true, [](IEvent* ev) { func(static_cast(reinterpret_cast(ev)->actor)); }); +#define ENEMY_DEFEAT_COUNT(actorID, func) \ + COND_ID_HOOK(OnEnemyDefeat, actorID, true, \ + [](IEvent* ev) { func(static_cast(reinterpret_cast(ev)->actor)); }); #define ENEMY_DEFEAT_COUNT_UNIQUE(actorID, countType) \ COND_ID_HOOK(OnEnemyDefeat, actorID, true, [](IEvent* ev) { IncrementEnemyDefeatCount(countType); }); diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp index e8cf9c002a1..bd0a0863f0b 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp @@ -42,7 +42,8 @@ void SkipZeldaFleeingCastle_OnActorInit(IEvent* event) { if (actor->params == 3) { framesSinceSpawn = 0; - itemOcarinaUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, SkipZeldaFleeingCastle_OnActorUpdate); + itemOcarinaUpdateHook = + REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, SkipZeldaFleeingCastle_OnActorUpdate); sceneInitHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { UNREGISTER_LISTENER(OnActorUpdate, itemOcarinaUpdateHook); UNREGISTER_LISTENER(OnSceneInit, sceneInitHook); diff --git a/soh/soh/Enhancements/audio/AudioEditor.cpp b/soh/soh/Enhancements/audio/AudioEditor.cpp index 2f9c1e3e294..d8aa0cdd4e0 100644 --- a/soh/soh/Enhancements/audio/AudioEditor.cpp +++ b/soh/soh/Enhancements/audio/AudioEditor.cpp @@ -498,7 +498,7 @@ void DrawTypeChip(SeqType type, std::string sequenceName) { } void AudioEditorRegisterOnSceneInitHook() { - REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event){ + REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { if (gSaveContext.gameMode != GAMEMODE_END_CREDITS && CVarGetInteger(CVAR_AUDIO("RandomizeAudioGenModes"), 0) == RANDOMIZE_ON_NEW_SCENE) { @@ -508,7 +508,7 @@ void AudioEditorRegisterOnSceneInitHook() { } void AudioEditorRegisterOnGenerationCompletionHook() { - REGISTER_LISTENER(OnGenerationCompletion, EVENT_PRIORITY_LOW, [](IEvent* event){ + REGISTER_LISTENER(OnGenerationCompletion, EVENT_PRIORITY_LOW, [](IEvent* event) { if (CVarGetInteger(CVAR_AUDIO("RandomizeAudioGenModes"), 0) == RANDOMIZE_ON_RANDO_GEN_ONLY) { AudioEditor_AutoRandomizeAll(); } diff --git a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp index 3c187a0f56c..9cf1e5c60aa 100644 --- a/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp +++ b/soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp @@ -2602,9 +2602,7 @@ void CosmeticsEditorWindow::DrawElement() { } void RegisterOnGameFrameUpdateHook() { - REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { - CosmeticsUpdateTick(); - }) + REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { CosmeticsUpdateTick(); }) } void CosmeticsEditorWindow::InitElement() { diff --git a/soh/soh/Enhancements/debugger/actorViewer.cpp b/soh/soh/Enhancements/debugger/actorViewer.cpp index 25ff42081c4..ca4d3c025b9 100644 --- a/soh/soh/Enhancements/debugger/actorViewer.cpp +++ b/soh/soh/Enhancements/debugger/actorViewer.cpp @@ -1211,7 +1211,9 @@ void ActorViewerWindow::InitElement() { // If the actor belongs to the selected category, we need to manually remove it, as it has not been removed from // the global actor array yet if (SohGui::mActorViewerWindow->category == actor->category) { - SohGui::mActorViewerWindow->list.erase(std::remove(SohGui::mActorViewerWindow->list.begin(), SohGui::mActorViewerWindow->list.end(), actor), SohGui::mActorViewerWindow->list.end()); + SohGui::mActorViewerWindow->list.erase( + std::remove(SohGui::mActorViewerWindow->list.begin(), SohGui::mActorViewerWindow->list.end(), actor), + SohGui::mActorViewerWindow->list.end()); } if (SohGui::mActorViewerWindow->display == actor) { SohGui::mActorViewerWindow->display = nullptr; diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index 2874db3e85e..c68dd8d0aef 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -806,7 +806,5 @@ void ColViewerWindow::InitElement() { CreateCylinderData(); CreateSphereData(); - REGISTER_LISTENER(OnPlayDrawEnd, EVENT_PRIORITY_LOW, [](IEvent* event){ - DrawColViewer(); - }); + REGISTER_LISTENER(OnPlayDrawEnd, EVENT_PRIORITY_LOW, [](IEvent* event) { DrawColViewer(); }); } diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index e2e1f00e0b1..ac35e04312f 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -125,52 +125,51 @@ void UpdateHyperBossesState() { if (IsHyperBossesActive()) { actorUpdateHookId = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { - // Run the update function a second time to make bosses move and act twice as fast. - - OnActorUpdate* ev = reinterpret_cast(event); - Player* player = GET_PLAYER(gPlayState); - Actor* actor = static_cast(ev->actor); - - uint8_t isBossActor = actor->id == ACTOR_BOSS_GOMA || // Gohma - actor->id == ACTOR_BOSS_DODONGO || // King Dodongo - actor->id == ACTOR_EN_BDFIRE || // King Dodongo Fire Breath - actor->id == ACTOR_BOSS_VA || // Barinade - actor->id == ACTOR_BOSS_GANONDROF || // Phantom Ganon - actor->id == ACTOR_EN_FHG_FIRE || // Phantom Ganon/Ganondorf Energy Ball/Thunder - actor->id == ACTOR_EN_FHG || // Phantom Ganon's Horse - actor->id == ACTOR_BOSS_FD || - actor->id == ACTOR_BOSS_FD2 || // Volvagia (grounded/flying) - actor->id == ACTOR_EN_VB_BALL || // Volvagia Rocks - actor->id == ACTOR_BOSS_MO || // Morpha - actor->id == ACTOR_BOSS_SST || // Bongo Bongo - actor->id == ACTOR_BOSS_TW || // Twinrova - actor->id == ACTOR_BOSS_GANON || // Ganondorf - actor->id == ACTOR_BOSS_GANON2; // Ganon - - // Don't apply during cutscenes because it causes weird behaviour and/or crashes on some bosses. - if (IsHyperBossesActive() && isBossActor && !Player_InBlockingCsMode(gPlayState, player)) { - // Barinade needs to be updated in sequence to avoid unintended behaviour. - if (actor->id == ACTOR_BOSS_VA) { - // params -1 is BOSSVA_BODY - if (actor->params == -1) { - Actor* actorList = gPlayState->actorCtx.actorLists[ACTORCAT_BOSS].head; - while (actorList != NULL) { - GameInteractor::RawAction::UpdateActor(actorList); - actorList = actorList->next; - } + // Run the update function a second time to make bosses move and act twice as fast. + + OnActorUpdate* ev = reinterpret_cast(event); + Player* player = GET_PLAYER(gPlayState); + Actor* actor = static_cast(ev->actor); + + uint8_t isBossActor = actor->id == ACTOR_BOSS_GOMA || // Gohma + actor->id == ACTOR_BOSS_DODONGO || // King Dodongo + actor->id == ACTOR_EN_BDFIRE || // King Dodongo Fire Breath + actor->id == ACTOR_BOSS_VA || // Barinade + actor->id == ACTOR_BOSS_GANONDROF || // Phantom Ganon + actor->id == ACTOR_EN_FHG_FIRE || // Phantom Ganon/Ganondorf Energy Ball/Thunder + actor->id == ACTOR_EN_FHG || // Phantom Ganon's Horse + actor->id == ACTOR_BOSS_FD || + actor->id == ACTOR_BOSS_FD2 || // Volvagia (grounded/flying) + actor->id == ACTOR_EN_VB_BALL || // Volvagia Rocks + actor->id == ACTOR_BOSS_MO || // Morpha + actor->id == ACTOR_BOSS_SST || // Bongo Bongo + actor->id == ACTOR_BOSS_TW || // Twinrova + actor->id == ACTOR_BOSS_GANON || // Ganondorf + actor->id == ACTOR_BOSS_GANON2; // Ganon + + // Don't apply during cutscenes because it causes weird behaviour and/or crashes on some bosses. + if (IsHyperBossesActive() && isBossActor && !Player_InBlockingCsMode(gPlayState, player)) { + // Barinade needs to be updated in sequence to avoid unintended behaviour. + if (actor->id == ACTOR_BOSS_VA) { + // params -1 is BOSSVA_BODY + if (actor->params == -1) { + Actor* actorList = gPlayState->actorCtx.actorLists[ACTORCAT_BOSS].head; + while (actorList != NULL) { + GameInteractor::RawAction::UpdateActor(actorList); + actorList = actorList->next; } - } else { - GameInteractor::RawAction::UpdateActor(actor); } + } else { + GameInteractor::RawAction::UpdateActor(actor); } - }); + } + }); } } void RegisterHyperBosses() { UpdateHyperBossesState(); - REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, - [](IEvent* event) { UpdateHyperBossesState(); }); + REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, [](IEvent* event) { UpdateHyperBossesState(); }); } void InitMods() { diff --git a/soh/soh/Enhancements/nametag.cpp b/soh/soh/Enhancements/nametag.cpp index 8e9da24b7c5..ad6794e1c9b 100644 --- a/soh/soh/Enhancements/nametag.cpp +++ b/soh/soh/Enhancements/nametag.cpp @@ -343,17 +343,19 @@ void NameTag_RegisterHooks() { sRegisteredHooks = true; // Reorder tags every frame to mimic depth rendering - gameStatUpdateHookID = REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { UpdateNameTags(); }); + gameStatUpdateHookID = + REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { UpdateNameTags(); }); // Render name tags at the end of the Play World drawing drawHookID = REGISTER_LISTENER(OnPlayDrawEnd, EVENT_PRIORITY_LOW, [](IEvent* event) { DrawNameTags(); }); // Remove all name tags on play state destroy as all actors are removed anyways - playDestroyHookID = REGISTER_LISTENER(OnPlayDestroy, EVENT_PRIORITY_LOW, [](IEvent* event) { RemoveAllNameTags(); }); + playDestroyHookID = + REGISTER_LISTENER(OnPlayDestroy, EVENT_PRIORITY_LOW, [](IEvent* event) { RemoveAllNameTags(); }); // Remove all name tags for actor on destroy actorDestroyHookID = REGISTER_LISTENER(OnActorDestroy, EVENT_PRIORITY_LOW, [](IEvent* event) { OnActorDestroy* ev = reinterpret_cast(event); - NameTag_RemoveAllForActor((Actor*) ev->actor); + NameTag_RemoveAllForActor((Actor*)ev->actor); }); } diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index fb97c87c35c..11db6c80969 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -176,8 +176,8 @@ void BuildShopMessage(IEvent* event) { "\x08[[color]][[1]]%w %y[[2]]_Rubine%w&Sonderangebot! %rNUR NOCH EINES VERFÜGBAR%w!\x0A\x02", "\x08[[color]][[1]]%w %y[[2]]_Rubis%w&Offre spéciale! %rDERNIER EN STOCK%w!\x0A\x02"); } else if (*ev->textId >= TEXT_SHOP_ITEM_RANDOM_CONFIRM && *ev->textId <= TEXT_SHOP_ITEM_RANDOM_CONFIRM_END) { - rc = OTRGlobals::Instance->gRandomizer->GetCheckFromRandomizerInf( - static_cast((*ev->textId - TEXT_SHOP_ITEM_RANDOM_CONFIRM) + RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1)); + rc = OTRGlobals::Instance->gRandomizer->GetCheckFromRandomizerInf(static_cast( + (*ev->textId - TEXT_SHOP_ITEM_RANDOM_CONFIRM) + RAND_INF_SHOP_ITEMS_KF_SHOP_ITEM_1)); msg = CustomMessage("\x08[[color]][[1]]%w %y[[2]]_Rupees%w\x09\x1B%gBuy&Don't buy%w\x09\x02", "\x08[[color]][[1]]%w %y[[2]]_Rubine%w\x09\x1B%gKaufen&Nicht kaufen%w\x09\x02", "\x08[[color]][[1]]%w %y[[2]]_Rubis%w\x09\x1B%gAcheter&Ne pas acheter%w\x09\x02"); diff --git a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp index 3c9595af88a..119becd9c4d 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp @@ -51,7 +51,7 @@ static void Sign_RandomizerDraw(Actor* actor, Color_RGBA8* primColor, Color_RGBA void Sign_RandomizerDrawSetup(IEvent* event) { OnActorUpdate* ev = reinterpret_cast(event); GetItemCategory getItemCategory; - Actor* signActor = (Actor*) ev->actor; + Actor* signActor = (Actor*)ev->actor; // If not a randomized item or too far, don't draw if (!Sign_RandomizerHoldsItem(signActor, gPlayState) || signActor->xzDistToPlayer > 1000.0f) { diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index e826b8bdf6d..19d43125873 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -463,7 +463,7 @@ void RandomizerOnItemReceiveHandler(IEvent* event) { if (loc->GetRandomizerCheck() == RC_SPIRIT_TEMPLE_SILVER_GAUNTLETS_CHEST && !CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { static ListenerID updateHook; - updateHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent *event) { + updateHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { Player* player = GET_PLAYER(gPlayState); if (player == NULL || Player_InBlockingCsMode(gPlayState, player) || player->stateFlags1 & PLAYER_STATE1_IN_ITEM_CS || player->stateFlags1 & PLAYER_STATE1_GETTING_ITEM || @@ -943,7 +943,7 @@ void RandomizerOnVanillaBehaviorHandler(IEvent* event) { break; case VB_MALON_RETURN_FROM_CASTLE: *ev->result = Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) && - Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); + Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_POCKET_EGG); break; case VB_SEND_MALON_HOME: *ev->result = Flags_GetRandomizerInf(RAND_INF_TALON_SENT_MALON_HOME); @@ -956,21 +956,21 @@ void RandomizerOnVanillaBehaviorHandler(IEvent* event) { break; case VB_OPEN_KOKIRI_FOREST: *ev->result = Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD) || - RAND_GET_OPTION(RSK_FOREST).IsNot(RO_CLOSED_FOREST_ON); + RAND_GET_OPTION(RSK_FOREST).IsNot(RO_CLOSED_FOREST_ON); break; case VB_BE_ELIGIBLE_FOR_DARUNIAS_JOY_REWARD: *ev->result = !Flags_GetRandomizerInf(RAND_INF_DARUNIAS_JOY); break; case VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS: *ev->result = LINK_IS_ADULT && (gEntranceTable[gSaveContext.entranceIndex].scene == SCENE_TEMPLE_OF_TIME) && - !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && - MeetsLACSRequirements(); + !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && + MeetsLACSRequirements(); break; case VB_BE_ELIGIBLE_FOR_NOCTURNE_OF_SHADOW: *ev->result = !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL) && LINK_IS_ADULT && - gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_KAKARIKO_VILLAGE && - CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && - CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && gSaveContext.cutsceneIndex < 0xFFF0; + gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_KAKARIKO_VILLAGE && + CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && + CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && gSaveContext.cutsceneIndex < 0xFFF0; break; case VB_BE_ELIGIBLE_FOR_CHILD_ROLLING_GORON_REWARD: { // Don't require a bomb bag to get prize in rando @@ -980,8 +980,9 @@ void RandomizerOnVanillaBehaviorHandler(IEvent* event) { case VB_BE_ELIGIBLE_FOR_MAGIC_BEANS_PURCHASE: { if (RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS).Is(RO_SHUFFLE_MERCHANTS_BEANS_ONLY) || RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS).Is(RO_SHUFFLE_MERCHANTS_ALL)) { - *ev->result = gSaveContext.rupees >= - OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_ZR_MAGIC_BEAN_SALESMAN)->GetPrice(); + *ev->result = + gSaveContext.rupees >= + OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_ZR_MAGIC_BEAN_SALESMAN)->GetPrice(); } else if (RAND_GET_OPTION(RSK_SKIP_PLANTING_BEANS)) { *ev->result = gSaveContext.rupees >= 60; } else if (BEANS_BOUGHT == 9) { @@ -1280,7 +1281,7 @@ void RandomizerOnVanillaBehaviorHandler(IEvent* event) { case VB_CHECK_RANDO_PRICE_OF_MEDIGORON: { if (EnGm_RandoCanGetMedigoronItem()) { *ev->result = gSaveContext.rupees < - OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_GC_MEDIGORON)->GetPrice(); + OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_GC_MEDIGORON)->GetPrice(); } break; } @@ -1487,7 +1488,7 @@ void RandomizerOnVanillaBehaviorHandler(IEvent* event) { } case VB_OFFER_BLUE_POTION: { *ev->result |= RAND_GET_OPTION(RSK_SHUFFLE_ADULT_TRADE).Is(RO_GENERIC_OFF) && - INV_CONTENT(ITEM_CLAIM_CHECK) == ITEM_CLAIM_CHECK; + INV_CONTENT(ITEM_CLAIM_CHECK) == ITEM_CLAIM_CHECK; break; } case VB_OKARINA_TAG_COMPLETE: { @@ -1517,7 +1518,7 @@ void RandomizerOnVanillaBehaviorHandler(IEvent* event) { case VB_GRANNY_SAY_INSUFFICIENT_RUPEES: { if (EnDs_RandoCanGetGrannyItem()) { *ev->result = gSaveContext.rupees < - OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_KAK_GRANNYS_SHOP)->GetPrice(); + OTRGlobals::Instance->gRandoContext->GetItemLocation(RC_KAK_GRANNYS_SHOP)->GetPrice(); } break; } @@ -2120,12 +2121,12 @@ void RandomizerOnActorInitHandler(IEvent* event) { if (scrubIdentity.identity.randomizerCheck != RC_UNKNOWN_CHECK) { // DNS uses pointers so we're creating our own entry instead of modifying the original ObjectExtension::GetInstance().Set(actor, std::move(DnsItemEntry{ - enDns->dnsItemEntry->itemPrice, - 1, - scrubIdentity.getItemId, - EnDns_RandomizerPurchaseableCheck, - EnDns_RandomizerPurchase, - })); + enDns->dnsItemEntry->itemPrice, + 1, + scrubIdentity.getItemId, + EnDns_RandomizerPurchaseableCheck, + EnDns_RandomizerPurchase, + })); enDns->dnsItemEntry = ObjectExtension::GetInstance().Get(actor); if (scrubIdentity.itemPrice != -1) { @@ -2138,23 +2139,21 @@ void RandomizerOnActorInitHandler(IEvent* event) { static ListenerID enDnsUpdateHook = -1; static ListenerID enDnsKillHook = -1; if (enDnsUpdateHook == -1) { - enDnsUpdateHook = - REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { - OnActorUpdate* ev = reinterpret_cast(event); - Actor* innerActor = static_cast(ev->actor); - if (innerActor->id == ACTOR_EN_DNS) { - if (ObjectExtension::GetInstance().Has(innerActor)) { - innerActor->textId = TEXT_SCRUB_RANDOM; - } + enDnsUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + Actor* innerActor = static_cast(ev->actor); + if (innerActor->id == ACTOR_EN_DNS) { + if (ObjectExtension::GetInstance().Has(innerActor)) { + innerActor->textId = TEXT_SCRUB_RANDOM; } - }); - enDnsKillHook = - REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { - UNREGISTER_LISTENER(OnActorUpdate, enDnsUpdateHook); - UNREGISTER_LISTENER(OnSceneInit, enDnsKillHook); - enDnsUpdateHook = -1; - enDnsKillHook = -1; - }); + } + }); + enDnsKillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, enDnsUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enDnsKillHook); + enDnsUpdateHook = -1; + enDnsKillHook = -1; + }); } } } @@ -2756,39 +2755,36 @@ static void RandomizerRegisterHooks() { Entrance_SetSavewarpEntrance(); } - onFlagSetHook = - REGISTER_LISTENER(OnFlagSet, EVENT_PRIORITY_LOW, RandomizerOnFlagSetHandler); - onSceneFlagSetHook = - REGISTER_LISTENER(OnSceneFlagSet, EVENT_PRIORITY_LOW, RandomizerOnSceneFlagSetHandler); - onPlayerUpdateForRCQueueHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnPlayerUpdateForRCQueueHandler(); }); - onPlayerUpdateForItemQueueHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, - [](IEvent* event){ RandomizerOnPlayerUpdateForItemQueueHandler(); }); - onItemReceiveHook = - REGISTER_LISTENER(OnItemReceive, EVENT_PRIORITY_LOW, RandomizerOnItemReceiveHandler); - onDialogMessageHook = REGISTER_LISTENER(OnDialogMessage, EVENT_PRIORITY_LOW, - [](IEvent* event){ RandomizerOnDialogMessageHandler(); }); - onVanillaBehaviorHook = REGISTER_LISTENER(OnVanillaBehavior, EVENT_PRIORITY_LOW, RandomizerOnVanillaBehaviorHandler); - onSceneInitHook = - REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, RandomizerOnSceneInitHandler); - afterSceneCommandsHook = REGISTER_LISTENER(AfterSceneCommands, EVENT_PRIORITY_LOW, RandomizerAfterSceneCommandsHandler); - onActorInitHook = - REGISTER_LISTENER(OnActorInit, EVENT_PRIORITY_LOW, RandomizerOnActorInitHandler); - onActorUpdateHook = - REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, RandomizerOnActorUpdateHandler); - onPlayerUpdateHook = - REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnPlayerUpdateHandler(); }); - onGameFrameUpdateHook = REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, - [](IEvent* event){ RandomizerOnGameFrameUpdateHandler(); }); - onSceneSpawnActorsHook = REGISTER_LISTENER(OnSceneSpawnActors, EVENT_PRIORITY_LOW, - [](IEvent* event){ RandomizerOnSceneSpawnActorsHandler(); }); - onPlayDestroyHook = - REGISTER_LISTENER(OnPlayDestroy, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnPlayDestroyHandler(); }); + onFlagSetHook = REGISTER_LISTENER(OnFlagSet, EVENT_PRIORITY_LOW, RandomizerOnFlagSetHandler); + onSceneFlagSetHook = REGISTER_LISTENER(OnSceneFlagSet, EVENT_PRIORITY_LOW, RandomizerOnSceneFlagSetHandler); + onPlayerUpdateForRCQueueHook = REGISTER_LISTENER( + OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { RandomizerOnPlayerUpdateForRCQueueHandler(); }); + onPlayerUpdateForItemQueueHook = REGISTER_LISTENER( + OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { RandomizerOnPlayerUpdateForItemQueueHandler(); }); + onItemReceiveHook = REGISTER_LISTENER(OnItemReceive, EVENT_PRIORITY_LOW, RandomizerOnItemReceiveHandler); + onDialogMessageHook = REGISTER_LISTENER(OnDialogMessage, EVENT_PRIORITY_LOW, + [](IEvent* event) { RandomizerOnDialogMessageHandler(); }); + onVanillaBehaviorHook = + REGISTER_LISTENER(OnVanillaBehavior, EVENT_PRIORITY_LOW, RandomizerOnVanillaBehaviorHandler); + onSceneInitHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, RandomizerOnSceneInitHandler); + afterSceneCommandsHook = + REGISTER_LISTENER(AfterSceneCommands, EVENT_PRIORITY_LOW, RandomizerAfterSceneCommandsHandler); + onActorInitHook = REGISTER_LISTENER(OnActorInit, EVENT_PRIORITY_LOW, RandomizerOnActorInitHandler); + onActorUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, RandomizerOnActorUpdateHandler); + onPlayerUpdateHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, + [](IEvent* event) { RandomizerOnPlayerUpdateHandler(); }); + onGameFrameUpdateHook = REGISTER_LISTENER(OnGameFrameUpdate, EVENT_PRIORITY_LOW, + [](IEvent* event) { RandomizerOnGameFrameUpdateHandler(); }); + onSceneSpawnActorsHook = REGISTER_LISTENER(OnSceneSpawnActors, EVENT_PRIORITY_LOW, + [](IEvent* event) { RandomizerOnSceneSpawnActorsHandler(); }); + onPlayDestroyHook = REGISTER_LISTENER(OnPlayDestroy, EVENT_PRIORITY_LOW, + [](IEvent* event) { RandomizerOnPlayDestroyHandler(); }); onExitGameHook = - REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, [](IEvent* event){ RandomizerOnExitGameHandler(); }); - onKaleidoUpdateHook = REGISTER_LISTENER(OnKaleidoscopeUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ - RandomizerOnKaleidoscopeUpdateHandler(); }); - onCuccoOrChickenHatchHook = REGISTER_LISTENER(OnCuccoOrChickenHatch, EVENT_PRIORITY_LOW, [](IEvent* event){ - RandomizerOnCuccoOrChickenHatch(); }); + REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, [](IEvent* event) { RandomizerOnExitGameHandler(); }); + onKaleidoUpdateHook = REGISTER_LISTENER(OnKaleidoscopeUpdate, EVENT_PRIORITY_LOW, + [](IEvent* event) { RandomizerOnKaleidoscopeUpdateHandler(); }); + onCuccoOrChickenHatchHook = REGISTER_LISTENER(OnCuccoOrChickenHatch, EVENT_PRIORITY_LOW, + [](IEvent* event) { RandomizerOnCuccoOrChickenHatch(); }); if (RAND_GET_OPTION(RSK_FISHSANITY).IsNot(RO_FISHSANITY_OFF)) { OTRGlobals::Instance->gRandoContext->GetFishsanity()->InitializeFromSave(); diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp index b6d0397c625..02fed964ea9 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance_tracker.cpp @@ -1074,10 +1074,8 @@ void EntranceTrackerWindow::DrawElement() { void EntranceTrackerWindow::InitElement() { // Setup hooks for loading and clearing the entrance tracker data - REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, - [](IEvent* event) { InitEntranceTrackingData(); }); - REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, - [](IEvent* event) { ClearEntranceTrackingData(); }); + REGISTER_LISTENER(OnLoadGame, EVENT_PRIORITY_LOW, [](IEvent* event) { InitEntranceTrackingData(); }); + REGISTER_LISTENER(OnExitGame, EVENT_PRIORITY_LOW, [](IEvent* event) { ClearEntranceTrackingData(); }); } void RegisterCheckTrackerWidgets() { diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index e5a6affb4f0..d6056627c35 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -578,8 +578,7 @@ void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { OnActorUpdate* ev = reinterpret_cast(event); Actor* actor = static_cast(ev->actor); if (actor->id == ACTOR_DEMO_IM && - (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || - IS_RANDO)) { + (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO)) { DemoIm* demoIm = static_cast(ev->actor); Player* player = GET_PLAYER(gPlayState); player->stateFlags1 |= PLAYER_STATE1_IN_CUTSCENE; @@ -892,36 +891,34 @@ void TimeSaverOnActorInitHandler(IEvent* event) { Actor* actor = static_cast(ev->actor); if (actor->id == ACTOR_EN_MA1 && gPlayState->sceneNum == SCENE_LON_LON_RANCH) { - enMa1UpdateHook = - REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { - OnActorUpdate* ev = reinterpret_cast(event); - void* innerActorRef = ev->actor; - Actor* innerActor = static_cast(innerActorRef); - if (innerActor->id == ACTOR_EN_MA1 && - (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO)) { - EnMa1* enMa1 = static_cast(innerActorRef); - if (enMa1->actionFunc == func_80AA106C) { - enMa1->actionFunc = EnMa1_EndTeachSong; - UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); - UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); - enMa1UpdateHook = -1; - enMa1KillHook = -1; - // They've already learned the song - } else if (enMa1->actionFunc == func_80AA0D88) { - UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); - UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); - enMa1UpdateHook = -1; - enMa1KillHook = -1; - } + enMa1UpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; + Actor* innerActor = static_cast(innerActorRef); + if (innerActor->id == ACTOR_EN_MA1 && + (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.LearnSong"), IS_RANDO) || IS_RANDO)) { + EnMa1* enMa1 = static_cast(innerActorRef); + if (enMa1->actionFunc == func_80AA106C) { + enMa1->actionFunc = EnMa1_EndTeachSong; + UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); + enMa1UpdateHook = -1; + enMa1KillHook = -1; + // They've already learned the song + } else if (enMa1->actionFunc == func_80AA0D88) { + UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); + enMa1UpdateHook = -1; + enMa1KillHook = -1; } - }); - enMa1KillHook = - REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { - UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); - UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); - enMa1UpdateHook = 0; - enMa1KillHook = 0; - }); + } + }); + enMa1KillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, enMa1UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enMa1KillHook); + enMa1UpdateHook = 0; + enMa1KillHook = 0; + }); } if (actor->id == ACTOR_EN_FU) { @@ -974,13 +971,12 @@ void TimeSaverOnActorInitHandler(IEvent* event) { enJjKillHook = -1; } }); - enJjKillHook = - REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { - UNREGISTER_LISTENER(OnActorUpdate, enJjUpdateHook); - UNREGISTER_LISTENER(OnSceneInit, enJjKillHook); - enJjUpdateHook = -1; - enJjKillHook = -1; - }); + enJjKillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, enJjUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enJjKillHook); + enJjUpdateHook = -1; + enJjKillHook = -1; + }); } if (actor->id == ACTOR_EN_OWL && gPlayState->sceneNum == SCENE_ZORAS_RIVER && @@ -989,79 +985,75 @@ void TimeSaverOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_BG_SPOT02_OBJECTS && actor->params == 2) { - bgSpot02UpdateHook = - REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { - OnActorUpdate* ev = reinterpret_cast(event); - void* innerActorRef = ev->actor; - Actor* innerActor = static_cast(innerActorRef); - if (innerActor->id == ACTOR_BG_SPOT02_OBJECTS && innerActor->params == 2 && - (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { - BgSpot02Objects* bgSpot02 = static_cast(innerActorRef); - if (bgSpot02->actionFunc == func_808ACC34) { - bgSpot02->actionFunc = func_808AC908; - UNREGISTER_LISTENER(OnActorUpdate, bgSpot02UpdateHook); - UNREGISTER_LISTENER(OnSceneInit, bgSpot02KillHook); - bgSpot02UpdateHook = -1; - bgSpot02KillHook = -1; - } + bgSpot02UpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; + Actor* innerActor = static_cast(innerActorRef); + if (innerActor->id == ACTOR_BG_SPOT02_OBJECTS && innerActor->params == 2 && + (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { + BgSpot02Objects* bgSpot02 = static_cast(innerActorRef); + if (bgSpot02->actionFunc == func_808ACC34) { + bgSpot02->actionFunc = func_808AC908; + UNREGISTER_LISTENER(OnActorUpdate, bgSpot02UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, bgSpot02KillHook); + bgSpot02UpdateHook = -1; + bgSpot02KillHook = -1; } - }); - bgSpot02KillHook = - REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { - UNREGISTER_LISTENER(OnActorUpdate, bgSpot02UpdateHook); - UNREGISTER_LISTENER(OnSceneInit, bgSpot02KillHook); - bgSpot02UpdateHook = -1; - bgSpot02KillHook = -1; - }); + } + }); + bgSpot02KillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, bgSpot02UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, bgSpot02KillHook); + bgSpot02UpdateHook = -1; + bgSpot02KillHook = -1; + }); } if (actor->id == ACTOR_BG_SPOT03_TAKI) { - bgSpot03UpdateHook = - REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { - OnActorUpdate* ev = reinterpret_cast(event); - void* innerActorRef = ev->actor; - Actor* innerActor = static_cast(innerActorRef); - - if (innerActor->id != ACTOR_BG_SPOT03_TAKI) { - return; - } + bgSpot03UpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; + Actor* innerActor = static_cast(innerActorRef); - bool shouldKeepOpen = RAND_GET_OPTION(RSK_SLEEPING_WATERFALL) && IS_RANDO; - if (!shouldKeepOpen) { - int enhancement = CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0); - shouldKeepOpen = - (enhancement == 2 && - ((CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && (INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE)))) || - (enhancement == 1 && Flags_GetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN)); - } + if (innerActor->id != ACTOR_BG_SPOT03_TAKI) { + return; + } - if (!shouldKeepOpen) { - return; - } + bool shouldKeepOpen = RAND_GET_OPTION(RSK_SLEEPING_WATERFALL) && IS_RANDO; + if (!shouldKeepOpen) { + int enhancement = CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SleepingWaterfall"), 0); + shouldKeepOpen = + (enhancement == 2 && + ((CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && (INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE)))) || + (enhancement == 1 && Flags_GetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN)); + } + + if (!shouldKeepOpen) { + return; + } + + BgSpot03Taki* bgSpot03 = static_cast(innerActorRef); + if (bgSpot03->actionFunc == BgSpot03Taki_HandleWaterfallState) { + bgSpot03->actionFunc = BgSpot03Taki_KeepOpen; + bgSpot03->state = WATERFALL_OPENED; + bgSpot03->openingAlpha = 0.0f; + Flags_SetSwitch(gPlayState, bgSpot03->switchFlag); + func_8003EBF8(gPlayState, &gPlayState->colCtx.dyna, bgSpot03->dyna.bgId); + BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 0); + BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 1); - BgSpot03Taki* bgSpot03 = static_cast(innerActorRef); - if (bgSpot03->actionFunc == BgSpot03Taki_HandleWaterfallState) { - bgSpot03->actionFunc = BgSpot03Taki_KeepOpen; - bgSpot03->state = WATERFALL_OPENED; - bgSpot03->openingAlpha = 0.0f; - Flags_SetSwitch(gPlayState, bgSpot03->switchFlag); - func_8003EBF8(gPlayState, &gPlayState->colCtx.dyna, bgSpot03->dyna.bgId); - BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 0); - BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 1); - - UNREGISTER_LISTENER(OnActorUpdate, bgSpot03UpdateHook); - UNREGISTER_LISTENER(OnSceneInit, bgSpot03KillHook); - bgSpot03UpdateHook = -1; - bgSpot03KillHook = -1; - } - }); - bgSpot03KillHook = - REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { UNREGISTER_LISTENER(OnActorUpdate, bgSpot03UpdateHook); UNREGISTER_LISTENER(OnSceneInit, bgSpot03KillHook); bgSpot03UpdateHook = -1; bgSpot03KillHook = -1; - }); + } + }); + bgSpot03KillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) { + UNREGISTER_LISTENER(OnActorUpdate, bgSpot03UpdateHook); + UNREGISTER_LISTENER(OnSceneInit, bgSpot03KillHook); + bgSpot03UpdateHook = -1; + bgSpot03KillHook = -1; + }); } if (actor->id == ACTOR_EN_DNT_DEMO && @@ -1084,25 +1076,24 @@ void TimeSaverOnActorInitHandler(IEvent* event) { // Forest Temple purple poe fight speedup if (actor->id == ACTOR_EN_PO_SISTERS && actor->params == 28) { - enPoSistersUpdateHook = - REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { - OnActorUpdate* ev = reinterpret_cast(event); - void* innerActorRef = ev->actor; - Actor* innerActor = static_cast(innerActorRef); - if (innerActor->id == ACTOR_EN_PO_SISTERS && innerActor->params == 28 && - (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { - EnPoSisters* enPoSisters = static_cast(innerActorRef); - if (enPoSisters->actionFunc == func_80ADB338) { - enPoSisters->unk_19C = 0; - } + enPoSistersUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { + OnActorUpdate* ev = reinterpret_cast(event); + void* innerActorRef = ev->actor; + Actor* innerActor = static_cast(innerActorRef); + if (innerActor->id == ACTOR_EN_PO_SISTERS && innerActor->params == 28 && + (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { + EnPoSisters* enPoSisters = static_cast(innerActorRef); + if (enPoSisters->actionFunc == func_80ADB338) { + enPoSisters->unk_19C = 0; } - }); + } + }); enPoSistersKillHook = REGISTER_LISTENER(OnSceneInit, EVENT_PRIORITY_LOW, [](IEvent* event) mutable { - UNREGISTER_LISTENER(OnActorUpdate, enPoSistersUpdateHook); - UNREGISTER_LISTENER(OnSceneInit, enPoSistersKillHook); - enPoSistersUpdateHook = -1; - enPoSistersKillHook = -1; - }); + UNREGISTER_LISTENER(OnActorUpdate, enPoSistersUpdateHook); + UNREGISTER_LISTENER(OnSceneInit, enPoSistersKillHook); + enPoSistersUpdateHook = -1; + enPoSistersKillHook = -1; + }); } // Fire Temple Darunia cutscene diff --git a/soh/soh/Enhancements/timesplits/TimeSplits.cpp b/soh/soh/Enhancements/timesplits/TimeSplits.cpp index 8a82d3d7ebd..780c202cde0 100644 --- a/soh/soh/Enhancements/timesplits/TimeSplits.cpp +++ b/soh/soh/Enhancements/timesplits/TimeSplits.cpp @@ -1014,14 +1014,14 @@ void TimeSplitWindow::InitElement() { } }); - REGISTER_LISTENER(OnPlayerBottleUpdate, EVENT_PRIORITY_LOW, [](IEvent* event){ + REGISTER_LISTENER(OnPlayerBottleUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { OnPlayerBottleUpdate* ev = reinterpret_cast(event); TimeSplitsItemSplitEvent(SPLIT_TYPE_UPGRADE, ev->contents); }); REGISTER_LISTENER(OnBossDefeat, EVENT_PRIORITY_LOW, [](IEvent* event) { OnBossDefeat* ev = reinterpret_cast(event); - Actor* bossActor = (Actor*) ev->actor; + Actor* bossActor = (Actor*)ev->actor; TimeSplitsItemSplitEvent(SPLIT_TYPE_BOSS, bossActor->id); }); diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index 3e81b338107..de85fe71012 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -200,8 +200,7 @@ void OnKaleidoUpdateImpl(IEvent* event) { if (pauseCtx->unk_1EC == 1) { // prompt if (prevPromptChoice != pauseCtx->promptChoice) { - auto prompt = - GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); + auto prompt = GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); if (prevPromptChoice == -1) { auto translation = GetParameritizedText("save_prompt", TEXT_BANK_KALEIDO, nullptr); SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), GetLanguageCode()); @@ -245,8 +244,7 @@ void OnKaleidoUpdateImpl(IEvent* event) { GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); if (prevPromptChoice == -1) { auto translation = GetParameritizedText("save_prompt", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), - GetLanguageCode()); + SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), GetLanguageCode()); } else { SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); } @@ -271,8 +269,7 @@ void OnKaleidoUpdateImpl(IEvent* event) { GetParameritizedText(pauseCtx->promptChoice == 0 ? "yes" : "no", TEXT_BANK_MISC, nullptr); if (prevPromptChoice == -1) { auto translation = GetParameritizedText("continue_game", TEXT_BANK_KALEIDO, nullptr); - SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), - GetLanguageCode()); + SpeechSynthesizer::Instance->Speak((translation + " - " + prompt).c_str(), GetLanguageCode()); } else { SpeechSynthesizer::Instance->Speak(prompt.c_str(), GetLanguageCode()); } @@ -408,8 +405,7 @@ void OnKaleidoUpdateImpl(IEvent* event) { arg[0] = '\0'; } - if (pauseCtx->cursorItem[PAUSE_ITEM] == PAUSE_ITEM_NONE || - pauseCtx->cursorItem[PAUSE_ITEM] == ITEM_NONE) { + if (pauseCtx->cursorItem[PAUSE_ITEM] == PAUSE_ITEM_NONE || pauseCtx->cursorItem[PAUSE_ITEM] == ITEM_NONE) { prevCursorIndex = -1; return; } @@ -428,8 +424,7 @@ void OnKaleidoUpdateImpl(IEvent* event) { if (assignedTo != -1) { auto button = GetParameritizedText(buttonNames[assignedTo], TEXT_BANK_MISC, nullptr); auto translation = GetParameritizedText("assigned_to", TEXT_BANK_KALEIDO, button.c_str()); - SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), - GetLanguageCode()); + SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), GetLanguageCode()); } else { SpeechSynthesizer::Instance->Speak(itemTranslation.c_str(), GetLanguageCode()); } @@ -449,8 +444,7 @@ void OnKaleidoUpdateImpl(IEvent* event) { // Cursor is on a dungeon floor position if (cursorPoint >= 3 && cursorPoint < 11) { - int floorID = - gMapData->floorID[gPlayState->interfaceCtx.unk_25A][pauseCtx->dungeonMapSlot - 3]; + int floorID = gMapData->floorID[gPlayState->interfaceCtx.unk_25A][pauseCtx->dungeonMapSlot - 3]; // Normalize so F1 == 0, and negative numbers are basement levels int normalizedFloor = (floorID * -1) + 8; if (normalizedFloor >= 0) { @@ -529,8 +523,7 @@ void OnKaleidoUpdateImpl(IEvent* event) { if (assignedTo != -1) { auto button = GetParameritizedText(buttonNames[assignedTo], TEXT_BANK_MISC, nullptr); auto translation = GetParameritizedText("assigned_to", TEXT_BANK_KALEIDO, button.c_str()); - SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), - GetLanguageCode()); + SpeechSynthesizer::Instance->Speak((itemTranslation + " - " + translation).c_str(), GetLanguageCode()); } else { SpeechSynthesizer::Instance->Speak(itemTranslation.c_str(), GetLanguageCode()); } @@ -600,24 +593,24 @@ void RegisterOnUpdateMainMenuSelection() { REGISTER_LISTENER(OnUpdateFileSelectConfirmationSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { OnUpdateFileSelectConfirmationSelection* ev = reinterpret_cast(event); - if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) - return; + if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) + return; - switch (ev->optionIndex) { - case FS_BTN_CONFIRM_YES: { - auto translation = GetParameritizedText("confirm", TEXT_BANK_FILECHOOSE, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - case FS_BTN_CONFIRM_QUIT: { - auto translation = GetParameritizedText("quit", TEXT_BANK_FILECHOOSE, nullptr); - SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); - break; - } - default: - break; + switch (ev->optionIndex) { + case FS_BTN_CONFIRM_YES: { + auto translation = GetParameritizedText("confirm", TEXT_BANK_FILECHOOSE, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; } - }); + case FS_BTN_CONFIRM_QUIT: { + auto translation = GetParameritizedText("quit", TEXT_BANK_FILECHOOSE, nullptr); + SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); + break; + } + default: + break; + } + }); REGISTER_LISTENER(OnUpdateFileCopySelection, EVENT_PRIORITY_LOW, [](IEvent* event) { OnUpdateFileCopySelection* ev = reinterpret_cast(event); @@ -652,7 +645,7 @@ void RegisterOnUpdateMainMenuSelection() { }); REGISTER_LISTENER(OnUpdateFileCopyConfirmationSelection, EVENT_PRIORITY_LOW, [](IEvent* event) { - OnUpdateFileCopySelection* ev = reinterpret_cast(event); + OnUpdateFileCopySelection* ev = reinterpret_cast(event); if (!CVarGetInteger(CVAR_SETTING("A11yTTS"), 0)) return; diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 227b095f6db..d3db280df57 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -1007,8 +1007,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); - CALL_EVENT(OnShopSlotChange, this->cursorIndex, - this->shelfSlots[this->cursorIndex]->basePrice); + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } else if ((this->stickAccumX > 0) || (dpad && CHECK_BTN_ALL(input->press.button, dRight))) { nextIndex = EnOssan_SetCursorIndexFromNeutral(this, 0); @@ -1018,8 +1017,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, PlayState* play, Player* play Interface_SetDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); - CALL_EVENT(OnShopSlotChange, this->cursorIndex, - this->shelfSlots[this->cursorIndex]->basePrice); + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); } } } @@ -1285,8 +1283,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, PlayState* play, Player* playe } EnOssan_CursorUpDown(this, play); if (this->cursorIndex != prevIndex) { - CALL_EVENT(OnShopSlotChange, this->cursorIndex, - this->shelfSlots[this->cursorIndex]->basePrice); + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); } @@ -1358,8 +1355,7 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, PlayState* play, Player* play } EnOssan_CursorUpDown(this, play); if (this->cursorIndex != prevIndex) { - CALL_EVENT(OnShopSlotChange, this->cursorIndex, - this->shelfSlots[this->cursorIndex]->basePrice); + CALL_EVENT(OnShopSlotChange, this->cursorIndex, this->shelfSlots[this->cursorIndex]->basePrice); Message_ContinueTextbox(play, this->shelfSlots[this->cursorIndex]->actor.textId); Sfx_PlaySfxCentered(NA_SE_SY_CURSOR); } From b02f637df1b79492b82d23aefc3bb7e491059f9b Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 20:19:15 -0600 Subject: [PATCH 09/31] Added some missing includes --- .../Enhancements/game-interactor/EventSystem_List.h | 11 ++--------- .../game-interactor/GameInteractor_Hooks.h | 2 -- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/EventSystem_List.h b/soh/soh/Enhancements/game-interactor/EventSystem_List.h index a2b9af71272..5a3f02410a7 100644 --- a/soh/soh/Enhancements/game-interactor/EventSystem_List.h +++ b/soh/soh/Enhancements/game-interactor/EventSystem_List.h @@ -1,17 +1,10 @@ #pragma once -#include #include "z64.h" +#include +#include #include "vanilla-behavior/GIVanillaBehavior.h" -/** - * Hook Table - * - * DEFINE_HOOK arguments: - * - Argument 1: Name of the hook - * - Argument 2: Function type that the hook uses - */ - DEFINE_EVENT(OnZTitleInit, void* gameState;); DEFINE_EVENT(OnZTitleUpdate, void* gameState;); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h index 5f4cd2d0345..e456b2ef26e 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h @@ -1,10 +1,8 @@ #pragma once -#include #include "vanilla-behavior/GIVanillaBehavior.h" #include "GameInteractor.h" #include -#include #ifdef __cplusplus extern "C" { From 86f64e8b3a57a686ac22ac62662f982803e16a37 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 20:59:21 -0600 Subject: [PATCH 10/31] Fixed linux and mac compilation among moving GameInteractor_Should to the main GI file --- soh/soh/Enhancements/boss-rush/BossRush.cpp | 2 +- .../game-interactor/EventSystem_List.h | 2 +- .../game-interactor/GameInteractor.cpp | 19 ++++ .../game-interactor/GameInteractor.h | 13 +-- .../GameInteractor_HookTable.h | 98 ------------------- .../game-interactor/GameInteractor_Hooks.cpp | 21 ---- .../game-interactor/GameInteractor_Hooks.h | 16 --- .../Enhancements/randomizer/hook_handlers.cpp | 2 +- .../Enhancements/timesaver_hook_handlers.cpp | 2 +- 9 files changed, 25 insertions(+), 150 deletions(-) delete mode 100644 soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h delete mode 100644 soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp delete mode 100644 soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index 6ddee250744..140aab977d9 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -743,7 +743,7 @@ void BossRush_OnVanillaBehaviorHandler(IEvent* event) { GIVanillaBehavior id = ev->flag; bool* should = ev->result; va_list args; - va_copy(args, ev->originalArgs); + va_copy(args, *ev->originalArgs); switch (id) { // Allow not healing before ganon diff --git a/soh/soh/Enhancements/game-interactor/EventSystem_List.h b/soh/soh/Enhancements/game-interactor/EventSystem_List.h index 5a3f02410a7..416e33e0c6e 100644 --- a/soh/soh/Enhancements/game-interactor/EventSystem_List.h +++ b/soh/soh/Enhancements/game-interactor/EventSystem_List.h @@ -103,7 +103,7 @@ DEFINE_EVENT(OnPlayDrawBegin); DEFINE_EVENT(OnPlayDrawEnd); -DEFINE_EVENT(OnVanillaBehavior, GIVanillaBehavior flag; bool* result; va_list originalArgs;); +DEFINE_EVENT(OnVanillaBehavior, GIVanillaBehavior flag; bool* result; va_list* originalArgs;); DEFINE_EVENT(OnSaveFile, int32_t fileNum; int32_t sectionID;); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp index 27a7179f43d..ea713767170 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp @@ -105,6 +105,25 @@ bool GameInteractor::CanAddOrTakeAmmo(int16_t amount, int16_t item) { } } +bool GameInteractor_Should(GIVanillaBehavior flag, u32 result, ...) { + // Only the external function can use the Variadic Function syntax + // To pass the va args to the next caller must be done using va_list and reading the args into it + // Because there can be N subscribers registered to each template call, the subscribers will be responsible for + // creating a copy of this va_list to avoid incrementing the original pointer between calls + va_list args; + va_start(args, result); + + // Because of default argument promotion, even though our incoming "result" is just a bool, it needs to be typed as + // an int to be permitted to be used in `va_start`, otherwise it is undefined behavior. + // Here we downcast back to a bool for our actual hook handlers + bool boolResult = static_cast(result); + + CALL_EVENT(OnVanillaBehavior, flag, &boolResult, &args); + + va_end(args); + return boolResult; +} + void EventSystem_Register() { // MARK: - Gameplay REGISTER_EVENT(OnZTitleInit); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index b164b46bc2b..f6e57e2b04a 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -88,6 +88,7 @@ uint8_t GameInteractor_GetSlipperyFloorActive(); uint8_t GameInteractor_SecondCollisionUpdate(); void GameInteractor_SetTriforceHuntPieceGiven(uint8_t state); void GameInteractor_SetTriforceHuntCreditsWarpActive(uint8_t state); +bool GameInteractor_Should(GIVanillaBehavior flag, uint32_t result, ...); #ifdef __cplusplus } #endif @@ -158,7 +159,7 @@ struct HookInfo { GIVanillaBehavior _ = vbEvent->flag; \ bool* should = vbEvent->result; \ va_list args; \ - va_copy(args, vbEvent->originalArgs); \ + va_copy(args, *vbEvent->originalArgs); \ body; \ va_end(args); \ } \ @@ -234,16 +235,6 @@ class GameInteractor { static GameInteractionEffectQueryResult ApplyEffect(GameInteractionEffectBase& effect); static GameInteractionEffectQueryResult RemoveEffect(RemovableGameInteractionEffect& effect); -#define DEFINE_HOOK(name, args) \ - struct name { \ - typedef std::function fn; \ - typedef std::function filter; \ - } - -#include "GameInteractor_HookTable.h" - -#undef DEFINE_HOOK - // Helpers static bool IsSaveLoaded(bool allowDbgSave = false); static bool IsGameplayPaused(); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h b/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h deleted file mode 100644 index 2cceebc4845..00000000000 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Hook Table - * - * DEFINE_HOOK arguments: - * - Argument 1: Name of the hook - * - Argument 2: Function type that the hook uses - */ -DEFINE_HOOK(OnZTitleInit, (void* gameState)); -DEFINE_HOOK(OnZTitleUpdate, (void* gameState)); -DEFINE_HOOK(OnLoadGame, (int32_t fileNum)); -DEFINE_HOOK(OnExitGame, (int32_t fileNum)); -DEFINE_HOOK(OnGameStateMainStart, ()); -DEFINE_HOOK(OnGameFrameUpdate, ()); -DEFINE_HOOK(OnCameraState, (PlayState * play)); -DEFINE_HOOK(OnItemReceive, (GetItemEntry itemEntry)); -DEFINE_HOOK(OnEquipmentDelete, (int16_t equipmentType, uint16_t equipValue)); -DEFINE_HOOK(OnSaleEnd, (GetItemEntry itemEntry)); -DEFINE_HOOK(OnTransitionEnd, (int16_t sceneNum)); -DEFINE_HOOK(OnSceneInit, (int16_t sceneNum)); -DEFINE_HOOK(AfterSceneCommands, (int16_t sceneNum)); -DEFINE_HOOK(OnSceneFlagSet, (int16_t sceneNum, int16_t flagType, int16_t flag)); -DEFINE_HOOK(OnSceneFlagUnset, (int16_t sceneNum, int16_t flagType, int16_t flag)); -DEFINE_HOOK(OnFlagSet, (int16_t flagType, int16_t flag)); -DEFINE_HOOK(OnFlagUnset, (int16_t flagType, int16_t flag)); -DEFINE_HOOK(OnSceneSpawnActors, ()); -DEFINE_HOOK(OnLinkSkeletonInit, ()); -DEFINE_HOOK(OnLinkEquipmentChange, ()); -DEFINE_HOOK(OnPlayerUpdate, ()); -DEFINE_HOOK(OnSetDoAction, (uint16_t action)); -DEFINE_HOOK(OnPlayerSfx, (u16 sfxId)); -DEFINE_HOOK(OnOcarinaSongAction, ()); -DEFINE_HOOK(OnOcarinaNote, (uint8_t note, float modulator, int8_t bend)); -DEFINE_HOOK(OnCuccoOrChickenHatch, ()); -DEFINE_HOOK(OnShopSlotChange, (uint8_t cursorIndex, int16_t price)); -DEFINE_HOOK(OnDungeonKeyUsed, (uint16_t mapIndex)); -DEFINE_HOOK(ShouldActorInit, (void* actor, bool* result)); -DEFINE_HOOK(OnActorInit, (void* actor)); -DEFINE_HOOK(OnActorSpawn, (void* actor)); -DEFINE_HOOK(ShouldActorUpdate, (void* actor, bool* result)); -DEFINE_HOOK(OnActorUpdate, (void* actor)); -DEFINE_HOOK(OnActorKill, (void* actor)); -DEFINE_HOOK(OnActorDestroy, (void* actor)); -DEFINE_HOOK(OnEnemyDefeat, (void* actor)); -DEFINE_HOOK(OnBossDefeat, (void* actor)); -DEFINE_HOOK(OnTimestamp, (u8 item)); -DEFINE_HOOK(OnPlayerBonk, ()); -DEFINE_HOOK(OnPlayerSetModels, (Player * player, u8 modelGroup)); -DEFINE_HOOK(OnPlayerHealthChange, (int16_t amount)); -DEFINE_HOOK(OnPlayerBottleUpdate, (int16_t contents)); -DEFINE_HOOK(OnPlayerHoldUpShield, ()); -DEFINE_HOOK(OnPlayerFirstPersonControl, (Player * player)); -DEFINE_HOOK(OnPlayerProcessStick, ()); -DEFINE_HOOK(OnPlayerShieldControl, (float* sp50, float* sp54)); -DEFINE_HOOK(OnPlayDestroy, ()); -DEFINE_HOOK(OnPlayDrawBegin, ()); -DEFINE_HOOK(OnPlayDrawEnd, ()); -DEFINE_HOOK(OnVanillaBehavior, (GIVanillaBehavior flag, bool* result, va_list originalArgs)); -DEFINE_HOOK(OnSaveFile, (int32_t fileNum, int32_t sectionID)); -DEFINE_HOOK(OnLoadFile, (int32_t fileNum)); -DEFINE_HOOK(OnDeleteFile, (int32_t fileNum)); - -DEFINE_HOOK(OnDialogMessage, ()); -DEFINE_HOOK(OnPresentTitleCard, ()); -DEFINE_HOOK(OnInterfaceUpdate, ()); -DEFINE_HOOK(OnKaleidoscopeUpdate, (int16_t inDungeonScene)); -DEFINE_HOOK(OnMinimapDrawCompassIcons, ()); - -DEFINE_HOOK(OnPresentFileSelect, ()); -DEFINE_HOOK(OnUpdateFileSelectSelection, (uint16_t optionIndex)); -DEFINE_HOOK(OnUpdateFileSelectConfirmationSelection, (uint16_t optionIndex)); -DEFINE_HOOK(OnUpdateFileCopySelection, (uint16_t optionIndex)); -DEFINE_HOOK(OnUpdateFileCopyConfirmationSelection, (uint16_t optionIndex)); -DEFINE_HOOK(OnUpdateFileEraseSelection, (uint16_t optionIndex)); -DEFINE_HOOK(OnUpdateFileEraseConfirmationSelection, (uint16_t optionIndex)); -DEFINE_HOOK(OnUpdateFileAudioSelection, (uint8_t optionIndex)); -DEFINE_HOOK(OnUpdateFileTargetSelection, (uint8_t optionIndex)); -DEFINE_HOOK(OnUpdateFileLanguageSelection, (uint8_t optionIndex)); -DEFINE_HOOK(OnUpdateFileQuestSelection, (uint8_t questIndex)); -DEFINE_HOOK(OnUpdateFileBossRushOptionSelection, (uint8_t optionIndex, uint8_t optionValue)); -DEFINE_HOOK(OnUpdateFileRandomizerOptionSelection, (uint8_t optionIndex)); -DEFINE_HOOK(OnUpdateFileNameSelection, (int16_t charCode)); -DEFINE_HOOK(OnFileChooseMain, (void* gameState)); -DEFINE_HOOK(OnGenerationCompletion, ()); - -DEFINE_HOOK(OnSetGameLanguage, ()); -DEFINE_HOOK(OnAssetAltChange, ()); -DEFINE_HOOK(OnKaleidoUpdate, ()); - -// Messages -DEFINE_HOOK(OnOpenText, (uint16_t * textId, bool* loadFromMessageTable)); - -// Audio -DEFINE_HOOK(OnSeqPlayerInit, (int32_t playerIdx, int32_t seqId)); - -// Rando -DEFINE_HOOK(OnRandoSetCheckStatus, (RandomizerCheck rc, RandomizerCheckStatus status)); -DEFINE_HOOK(OnRandoSetIsSkipped, (RandomizerCheck rc, bool isSkipped)); -DEFINE_HOOK(OnRandoEntranceDiscovered, (u16 entranceIndex, u8 isReversedEntrance)); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp deleted file mode 100644 index 4e20979f4e0..00000000000 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "GameInteractor_Hooks.h" -#include "EventSystem_List.h" - -bool GameInteractor_Should(GIVanillaBehavior flag, u32 result, ...) { - // Only the external function can use the Variadic Function syntax - // To pass the va args to the next caller must be done using va_list and reading the args into it - // Because there can be N subscribers registered to each template call, the subscribers will be responsible for - // creating a copy of this va_list to avoid incrementing the original pointer between calls - va_list args; - va_start(args, result); - - // Because of default argument promotion, even though our incoming "result" is just a bool, it needs to be typed as - // an int to be permitted to be used in `va_start`, otherwise it is undefined behavior. - // Here we downcast back to a bool for our actual hook handlers - bool boolResult = static_cast(result); - - CALL_EVENT(OnVanillaBehavior, flag, &boolResult, args); - - va_end(args); - return boolResult; -} \ No newline at end of file diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h deleted file mode 100644 index e456b2ef26e..00000000000 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include "vanilla-behavior/GIVanillaBehavior.h" -#include "GameInteractor.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// MARK: - Gameplay -bool GameInteractor_Should(GIVanillaBehavior flag, uint32_t result, ...); - -#ifdef __cplusplus -} -#endif diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 19d43125873..0c51569fb63 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -859,7 +859,7 @@ extern "C" void func_80A5475C(EnHeishi2* CastleGuard, PlayState* play); void RandomizerOnVanillaBehaviorHandler(IEvent* event) { OnVanillaBehavior* ev = reinterpret_cast(event); va_list args; - va_copy(args, ev->originalArgs); + va_copy(args, *ev->originalArgs); switch (ev->flag) { case VB_CLIMB: diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index d6056627c35..e96a6ee3954 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -129,7 +129,7 @@ bool ForcedDialogIsDisabled(ForcedDialogMode type) { void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { OnVanillaBehavior* ev = reinterpret_cast(event); va_list args; - va_copy(args, ev->originalArgs); + va_copy(args, *ev->originalArgs); switch (ev->flag) { case VB_PLAY_TRANSITION_CS: { From b73bae1f7edc4dbcdd27432c7c31968e2ac1e9a1 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 21:01:11 -0600 Subject: [PATCH 11/31] Fixed clang format --- soh/soh/Enhancements/game-interactor/EventSystem_List.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/game-interactor/EventSystem_List.h b/soh/soh/Enhancements/game-interactor/EventSystem_List.h index 416e33e0c6e..d3c50a44c0a 100644 --- a/soh/soh/Enhancements/game-interactor/EventSystem_List.h +++ b/soh/soh/Enhancements/game-interactor/EventSystem_List.h @@ -103,7 +103,7 @@ DEFINE_EVENT(OnPlayDrawBegin); DEFINE_EVENT(OnPlayDrawEnd); -DEFINE_EVENT(OnVanillaBehavior, GIVanillaBehavior flag; bool* result; va_list* originalArgs;); +DEFINE_EVENT(OnVanillaBehavior, GIVanillaBehavior flag; bool* result; va_list * originalArgs;); DEFINE_EVENT(OnSaveFile, int32_t fileNum; int32_t sectionID;); From 657d72c6b407e825594d98905388516a82c08084 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 21:14:59 -0600 Subject: [PATCH 12/31] Fixed missing include in favor of regular GameInteractor.h --- soh/soh/Enhancements/ArrowCycle.cpp | 2 +- soh/soh/Enhancements/AssignableTunicsAndBoots.cpp | 2 +- soh/soh/Enhancements/BlueFireArrows.cpp | 2 +- soh/soh/Enhancements/Cheats/DekuStick.cpp | 2 +- soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp | 2 +- soh/soh/Enhancements/Cheats/EasyISG.cpp | 2 +- soh/soh/Enhancements/Cheats/EasyQPA.cpp | 2 +- soh/soh/Enhancements/Cheats/FreezeTime.cpp | 2 +- soh/soh/Enhancements/Cheats/GSTargetable.cpp | 2 +- soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp | 2 +- soh/soh/Enhancements/Cheats/Infinite/Health.cpp | 2 +- soh/soh/Enhancements/Cheats/Infinite/Magic.cpp | 2 +- soh/soh/Enhancements/Cheats/Infinite/Money.cpp | 2 +- soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp | 2 +- soh/soh/Enhancements/Cheats/MoonJump.cpp | 2 +- soh/soh/Enhancements/Cheats/NoKeeseGuayTarget.cpp | 2 +- soh/soh/Enhancements/Cheats/NoRedeadFreeze.cpp | 2 +- soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp | 2 +- soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp | 2 +- soh/soh/Enhancements/Difficulty/BonkDamage.cpp | 2 +- soh/soh/Enhancements/Difficulty/CuccosToReturn.cpp | 2 +- soh/soh/Enhancements/Difficulty/DampeFire.cpp | 2 +- soh/soh/Enhancements/Difficulty/HyperEnemies.cpp | 2 +- soh/soh/Enhancements/Difficulty/PermanentLosses.cpp | 2 +- soh/soh/Enhancements/Difficulty/SwitchTimerMultiplier.cpp | 2 +- soh/soh/Enhancements/Difficulty/TreesDropSticks.cpp | 2 +- soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp | 2 +- soh/soh/Enhancements/ExtraModes/HurtContainer.cpp | 2 +- soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp | 2 +- soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp | 2 +- soh/soh/Enhancements/ExtraModes/RupeeDash.cpp | 2 +- soh/soh/Enhancements/ExtraModes/ShadowTag.cpp | 2 +- soh/soh/Enhancements/ExtraTraps.cpp | 2 +- soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp | 2 +- soh/soh/Enhancements/Fixes/DekuNutUpgradeFix.cpp | 2 +- soh/soh/Enhancements/Fixes/DirtPathFix.cpp | 2 +- soh/soh/Enhancements/Fixes/FixTwoHandedIdleAnim.cpp | 2 +- soh/soh/Enhancements/Fixes/FloorSwitches.cpp | 2 +- soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp | 2 +- soh/soh/Enhancements/Fixes/HammerHandFix.cpp | 2 +- soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp | 2 +- soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp | 2 +- soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp | 2 +- soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp | 2 +- soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp | 2 +- soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp | 2 +- soh/soh/Enhancements/Graphics/ToTMedallions.cpp | 2 +- soh/soh/Enhancements/MaskSelect.cpp | 2 +- soh/soh/Enhancements/QoL/DaytimeGS.cpp | 2 +- soh/soh/Enhancements/QoL/OpenAllHours.cpp | 2 +- soh/soh/Enhancements/QoL/PauseWarp.cpp | 2 +- soh/soh/Enhancements/QoL/ResetNaviTimer.cpp | 2 +- soh/soh/Enhancements/RebottleBlueFire.cpp | 2 +- soh/soh/Enhancements/RemoteBombchu.cpp | 2 +- soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp | 2 +- soh/soh/Enhancements/ResetGameplayFrames.cpp | 2 +- soh/soh/Enhancements/Restorations/BottleAdventure.cpp | 2 +- soh/soh/Enhancements/Restorations/GraveHoleJumps.cpp | 2 +- soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp | 2 +- soh/soh/Enhancements/Restorations/WideShutterDoorRanges.cpp | 2 +- soh/soh/Enhancements/SunlightArrows.cpp | 2 +- soh/soh/Enhancements/TimeSavers/CrawlSpeed.cpp | 2 +- soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp | 2 +- .../Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp | 2 +- .../TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp | 2 +- soh/soh/Enhancements/Warping.cpp | 2 +- soh/soh/Enhancements/audio/EnemyBGMDisable.cpp | 2 +- soh/soh/Enhancements/audio/LeeverEnemyBGM.cpp | 2 +- soh/soh/Enhancements/boss-rush/BossRush.cpp | 2 +- soh/soh/Enhancements/controls/Mouse.cpp | 2 +- .../cosmetics/A11yNoScreenFlashForFinishingBlow.cpp | 2 +- soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp | 2 +- soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp | 2 +- soh/soh/Enhancements/cosmetics/FileSelectMoreInfo.cpp | 2 +- soh/soh/Enhancements/cosmetics/NoMasterSword.cpp | 2 +- soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp | 2 +- soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp | 2 +- soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp | 2 +- soh/soh/Enhancements/randomizer/RocsFeather.cpp | 2 +- soh/soh/Enhancements/randomizer/fishsanity.h | 2 +- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 2 +- soh/soh/Enhancements/randomizer/randomizer_entrance.c | 2 +- soh/soh/Enhancements/timesaver_hook_handlers.cpp | 2 +- soh/soh/z_play_otr.cpp | 2 +- soh/soh/z_scene_otr.cpp | 2 +- soh/src/code/audio_load.c | 2 +- soh/src/code/code_800EC960.c | 2 +- soh/src/code/game.c | 2 +- soh/src/code/z_actor.c | 2 +- soh/src/code/z_demo.c | 2 +- soh/src/code/z_en_item00.c | 2 +- soh/src/code/z_game_over.c | 2 +- soh/src/code/z_horse.c | 2 +- soh/src/code/z_inventory.c | 2 +- soh/src/code/z_kaleido_scope_call.c | 2 +- soh/src/code/z_kankyo.c | 2 +- soh/src/code/z_lifemeter.c | 2 +- soh/src/code/z_map_exp.c | 2 +- soh/src/code/z_message_PAL.c | 2 +- soh/src/code/z_onepointdemo.c | 2 +- soh/src/code/z_parameter.c | 2 +- soh/src/code/z_play.c | 2 +- soh/src/code/z_player_lib.c | 2 +- soh/src/code/z_room.c | 2 +- soh/src/code/z_scene_table.c | 2 +- soh/src/code/z_skelanime.c | 2 +- soh/src/code/z_sram.c | 2 +- soh/src/code/z_vr_box.c | 2 +- soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 2 +- soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 2 +- soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c | 2 +- soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c | 2 +- .../overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 2 +- soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c | 2 +- soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c | 2 +- soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 2 +- soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 2 +- soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 2 +- .../overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 2 +- soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c | 2 +- soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c | 2 +- .../actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c | 2 +- soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 2 +- soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c | 2 +- soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c | 2 +- soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 2 +- .../actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c | 2 +- soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c | 2 +- .../overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 2 +- .../overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c | 2 +- soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 2 +- .../overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 2 +- soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c | 2 +- soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c | 2 +- soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 2 +- soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c | 2 +- soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 2 +- soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c | 2 +- soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c | 2 +- soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 2 +- soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c | 2 +- soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c | 2 +- soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 2 +- soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 2 +- soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 2 +- soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 2 +- soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c | 2 +- soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 2 +- soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c | 2 +- soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c | 2 +- soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c | 2 +- soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c | 2 +- soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c | 2 +- soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c | 2 +- soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 2 +- soh/src/overlays/actors/ovl_En_Am/z_en_am.c | 2 +- soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 +- soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c | 2 +- soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 2 +- soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c | 2 +- soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c | 2 +- soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c | 2 +- soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c | 2 +- soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c | 2 +- soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 2 +- soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c | 2 +- soh/src/overlays/actors/ovl_En_Box/z_en_box.c | 2 +- soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c | 2 +- soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c | 2 +- soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c | 2 +- soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 2 +- soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c | 2 +- soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c | 2 +- soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 2 +- soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c | 2 +- soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c | 2 +- soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c | 2 +- soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c | 2 +- soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c | 2 +- soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c | 2 +- soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c | 2 +- soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c | 2 +- soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c | 2 +- soh/src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c | 2 +- soh/src/overlays/actors/ovl_En_Du/z_en_du.c | 2 +- soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c | 2 +- soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c | 2 +- soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c | 2 +- soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c | 2 +- soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c | 2 +- soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c | 2 +- soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c | 2 +- soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c | 2 +- soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c | 2 +- soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c | 2 +- soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c | 2 +- soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 2 +- soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 2 +- soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 2 +- soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 2 +- soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 2 +- soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c | 2 +- soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 2 +- soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c | 2 +- soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c | 2 +- soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c | 2 +- soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c | 2 +- soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c | 2 +- soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c | 2 +- soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c | 2 +- soh/src/overlays/actors/ovl_En_Js/z_en_js.c | 2 +- soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c | 2 +- soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c | 2 +- soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c | 2 +- soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 2 +- soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c | 2 +- soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c | 2 +- soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c | 2 +- soh/src/overlays/actors/ovl_En_Md/z_en_md.c | 2 +- soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c | 2 +- soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c | 2 +- soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c | 2 +- soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c | 2 +- soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c | 2 +- soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c | 2 +- soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 2 +- soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 2 +- soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c | 2 +- soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c | 2 +- soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c | 2 +- soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c | 2 +- soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c | 2 +- soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c | 2 +- soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c | 2 +- soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c | 2 +- soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c | 2 +- soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 2 +- soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 2 +- soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c | 2 +- soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c | 2 +- soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c | 2 +- soh/src/overlays/actors/ovl_En_Si/z_en_si.c | 2 +- soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c | 2 +- soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c | 2 +- soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c | 2 +- soh/src/overlays/actors/ovl_En_St/z_en_st.c | 2 +- soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c | 2 +- soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c | 2 +- soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c | 2 +- soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c | 2 +- soh/src/overlays/actors/ovl_En_Test/z_en_test.c | 2 +- soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c | 2 +- soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c | 2 +- soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c | 2 +- soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c | 2 +- soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c | 2 +- soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 2 +- soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c | 2 +- soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c | 2 +- soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c | 2 +- soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 +- soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c | 2 +- soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 2 +- soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c | 2 +- soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c | 2 +- soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c | 2 +- soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c | 2 +- soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c | 2 +- soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 2 +- soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c | 2 +- soh/src/overlays/actors/ovl_Fishing/z_fishing.c | 2 +- soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c | 2 +- soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c | 2 +- soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 2 +- soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c | 2 +- soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c | 2 +- soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c | 2 +- soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 2 +- soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c | 2 +- soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 2 +- soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 2 +- soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 2 +- soh/src/overlays/actors/ovl_player_actor/z_player.c | 2 +- soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c | 2 +- soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c | 2 +- .../overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c | 2 +- .../overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c | 2 +- soh/src/overlays/gamestates/ovl_select/z_select.c | 2 +- soh/src/overlays/gamestates/ovl_title/z_title.c | 2 +- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c | 2 +- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c | 2 +- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c | 2 +- soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c | 2 +- 299 files changed, 299 insertions(+), 299 deletions(-) diff --git a/soh/soh/Enhancements/ArrowCycle.cpp b/soh/soh/Enhancements/ArrowCycle.cpp index b45813e99f2..8d264db7d05 100644 --- a/soh/soh/Enhancements/ArrowCycle.cpp +++ b/soh/soh/Enhancements/ArrowCycle.cpp @@ -1,5 +1,5 @@ #include "game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp index 21f6d69dfbe..8ad391ab36f 100644 --- a/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp +++ b/soh/soh/Enhancements/AssignableTunicsAndBoots.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/BlueFireArrows.cpp b/soh/soh/Enhancements/BlueFireArrows.cpp index 04b0be96589..b34d860b7e3 100644 --- a/soh/soh/Enhancements/BlueFireArrows.cpp +++ b/soh/soh/Enhancements/BlueFireArrows.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/Cheats/DekuStick.cpp b/soh/soh/Enhancements/Cheats/DekuStick.cpp index 67987807116..a75985d439a 100644 --- a/soh/soh/Enhancements/Cheats/DekuStick.cpp +++ b/soh/soh/Enhancements/Cheats/DekuStick.cpp @@ -1,6 +1,6 @@ #include #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp b/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp index 88e1ca00e38..9148e7cfdd7 100644 --- a/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp +++ b/soh/soh/Enhancements/Cheats/EasyFrameAdvance.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/EasyISG.cpp b/soh/soh/Enhancements/Cheats/EasyISG.cpp index 5fc75967946..d1caad0800d 100644 --- a/soh/soh/Enhancements/Cheats/EasyISG.cpp +++ b/soh/soh/Enhancements/Cheats/EasyISG.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/EasyQPA.cpp b/soh/soh/Enhancements/Cheats/EasyQPA.cpp index dce29d5ee03..affafb70d1f 100644 --- a/soh/soh/Enhancements/Cheats/EasyQPA.cpp +++ b/soh/soh/Enhancements/Cheats/EasyQPA.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/FreezeTime.cpp b/soh/soh/Enhancements/Cheats/FreezeTime.cpp index 8a9bff7eb04..9bc1fa1da10 100644 --- a/soh/soh/Enhancements/Cheats/FreezeTime.cpp +++ b/soh/soh/Enhancements/Cheats/FreezeTime.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "z64save.h" diff --git a/soh/soh/Enhancements/Cheats/GSTargetable.cpp b/soh/soh/Enhancements/Cheats/GSTargetable.cpp index 89386b7d1a1..9e52a0fc233 100644 --- a/soh/soh/Enhancements/Cheats/GSTargetable.cpp +++ b/soh/soh/Enhancements/Cheats/GSTargetable.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include #include diff --git a/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp b/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp index 685cc7fe8aa..38cb2a09ffa 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ShipInit.hpp" #include "z64save.h" diff --git a/soh/soh/Enhancements/Cheats/Infinite/Health.cpp b/soh/soh/Enhancements/Cheats/Infinite/Health.cpp index 8187e4edd71..8aad7aa7ce2 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Health.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Health.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "z64save.h" diff --git a/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp b/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp index 9722643addc..6e5a92cedb3 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Magic.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/Infinite/Money.cpp b/soh/soh/Enhancements/Cheats/Infinite/Money.cpp index 85a1bf162aa..6ead1755a58 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Money.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Money.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "z64save.h" #include "variables.h" diff --git a/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp b/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp index 77d317192e6..dfec275a781 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/NayrusLove.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "z64save.h" diff --git a/soh/soh/Enhancements/Cheats/MoonJump.cpp b/soh/soh/Enhancements/Cheats/MoonJump.cpp index d4e314f6000..720d6441dbc 100644 --- a/soh/soh/Enhancements/Cheats/MoonJump.cpp +++ b/soh/soh/Enhancements/Cheats/MoonJump.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/NoKeeseGuayTarget.cpp b/soh/soh/Enhancements/Cheats/NoKeeseGuayTarget.cpp index 3616191cada..05ea4b8d51f 100644 --- a/soh/soh/Enhancements/Cheats/NoKeeseGuayTarget.cpp +++ b/soh/soh/Enhancements/Cheats/NoKeeseGuayTarget.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/NoRedeadFreeze.cpp b/soh/soh/Enhancements/Cheats/NoRedeadFreeze.cpp index 7ed2452348b..f5d7c027acd 100644 --- a/soh/soh/Enhancements/Cheats/NoRedeadFreeze.cpp +++ b/soh/soh/Enhancements/Cheats/NoRedeadFreeze.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp b/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp index ab533682e56..8eefe1de91e 100644 --- a/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp +++ b/soh/soh/Enhancements/Cheats/UnrestrictedItems.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" PlayState* gPlayState; diff --git a/soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp b/soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp index 80a6395a578..d9e0cd9ee07 100644 --- a/soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp +++ b/soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #define CVAR_WIN_GORON_POT_NAME CVAR_ENHANCEMENT("GoronPot") diff --git a/soh/soh/Enhancements/Difficulty/BonkDamage.cpp b/soh/soh/Enhancements/Difficulty/BonkDamage.cpp index ef3a537c497..3e2699a52ba 100644 --- a/soh/soh/Enhancements/Difficulty/BonkDamage.cpp +++ b/soh/soh/Enhancements/Difficulty/BonkDamage.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "soh/Enhancements/enhancementTypes.h" diff --git a/soh/soh/Enhancements/Difficulty/CuccosToReturn.cpp b/soh/soh/Enhancements/Difficulty/CuccosToReturn.cpp index f1d5a2349c4..8a258eaa13f 100644 --- a/soh/soh/Enhancements/Difficulty/CuccosToReturn.cpp +++ b/soh/soh/Enhancements/Difficulty/CuccosToReturn.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Difficulty/DampeFire.cpp b/soh/soh/Enhancements/Difficulty/DampeFire.cpp index 13afc88f0c9..461c9ede1df 100644 --- a/soh/soh/Enhancements/Difficulty/DampeFire.cpp +++ b/soh/soh/Enhancements/Difficulty/DampeFire.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "soh/Enhancements/enhancementTypes.h" diff --git a/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp b/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp index 027991b3a0e..79a8d229d04 100644 --- a/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp +++ b/soh/soh/Enhancements/Difficulty/HyperEnemies.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "functions.h" #include "macros.h" diff --git a/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp b/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp index fe97ed2a60c..8a2403ddb60 100644 --- a/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp +++ b/soh/soh/Enhancements/Difficulty/PermanentLosses.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/SaveManager.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/Difficulty/SwitchTimerMultiplier.cpp b/soh/soh/Enhancements/Difficulty/SwitchTimerMultiplier.cpp index 4090c1f9523..2afa549e29d 100644 --- a/soh/soh/Enhancements/Difficulty/SwitchTimerMultiplier.cpp +++ b/soh/soh/Enhancements/Difficulty/SwitchTimerMultiplier.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Difficulty/TreesDropSticks.cpp b/soh/soh/Enhancements/Difficulty/TreesDropSticks.cpp index 9bf8689770a..a726326068b 100644 --- a/soh/soh/Enhancements/Difficulty/TreesDropSticks.cpp +++ b/soh/soh/Enhancements/Difficulty/TreesDropSticks.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp b/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp index 6e0bcb45d9d..65637cf9d30 100644 --- a/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp +++ b/soh/soh/Enhancements/ExtraModes/BounceOffWalls.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp b/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp index 07a467fac2d..ffffd593884 100644 --- a/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp +++ b/soh/soh/Enhancements/ExtraModes/HurtContainer.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp b/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp index 4235dca922e..5768392d188 100644 --- a/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp +++ b/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp @@ -1,5 +1,5 @@ #include "soh/Enhancements/cosmetics/authenticGfxPatches.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/3drando/random.hpp" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/Enhancements/enhancementTypes.h" diff --git a/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp b/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp index f2149fbacca..4bfdedd38aa 100644 --- a/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp +++ b/soh/soh/Enhancements/ExtraModes/RandomizedEnemySizes.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ObjectExtension/ActorMaximumHealth.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp b/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp index 716d5948722..d8346670cd2 100644 --- a/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp +++ b/soh/soh/Enhancements/ExtraModes/RupeeDash.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp b/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp index 48c016bf9b5..48581664fe0 100644 --- a/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp +++ b/soh/soh/Enhancements/ExtraModes/ShadowTag.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "functions.h" diff --git a/soh/soh/Enhancements/ExtraTraps.cpp b/soh/soh/Enhancements/ExtraTraps.cpp index 0bf46aba905..58290bffbe0 100644 --- a/soh/soh/Enhancements/ExtraTraps.cpp +++ b/soh/soh/Enhancements/ExtraTraps.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/Notification/Notification.h" diff --git a/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp b/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp index 52677c984c4..010d582f113 100644 --- a/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp +++ b/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Fixes/DekuNutUpgradeFix.cpp b/soh/soh/Enhancements/Fixes/DekuNutUpgradeFix.cpp index 23e0a1fd634..d9e70fa90b7 100644 --- a/soh/soh/Enhancements/Fixes/DekuNutUpgradeFix.cpp +++ b/soh/soh/Enhancements/Fixes/DekuNutUpgradeFix.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Fixes/DirtPathFix.cpp b/soh/soh/Enhancements/Fixes/DirtPathFix.cpp index a4a272cf46b..fd2a3cfcbff 100644 --- a/soh/soh/Enhancements/Fixes/DirtPathFix.cpp +++ b/soh/soh/Enhancements/Fixes/DirtPathFix.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/Fixes/FixTwoHandedIdleAnim.cpp b/soh/soh/Enhancements/Fixes/FixTwoHandedIdleAnim.cpp index 08bec056460..8bfe509f0d6 100644 --- a/soh/soh/Enhancements/Fixes/FixTwoHandedIdleAnim.cpp +++ b/soh/soh/Enhancements/Fixes/FixTwoHandedIdleAnim.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Fixes/FloorSwitches.cpp b/soh/soh/Enhancements/Fixes/FloorSwitches.cpp index 4f061b63de1..ab638e6a1a2 100644 --- a/soh/soh/Enhancements/Fixes/FloorSwitches.cpp +++ b/soh/soh/Enhancements/Fixes/FloorSwitches.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp b/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp index f06d6e1c3be..118ac7887a5 100644 --- a/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp +++ b/soh/soh/Enhancements/Fixes/GoronCityDoorFix.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Fixes/HammerHandFix.cpp b/soh/soh/Enhancements/Fixes/HammerHandFix.cpp index 0fc8ab5dc62..ec0b400a94a 100644 --- a/soh/soh/Enhancements/Fixes/HammerHandFix.cpp +++ b/soh/soh/Enhancements/Fixes/HammerHandFix.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp index 91fcf276719..b9b53e8ae30 100644 --- a/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp +++ b/soh/soh/Enhancements/GameplayStats/BossDefeatTimestamps.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" SaveContext gSaveContext; diff --git a/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp b/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp index 33323b28e01..f2c72d5d3f6 100644 --- a/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp +++ b/soh/soh/Enhancements/GameplayStats/EnemyDefeatCounts.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp b/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp index 6a647cbb8d3..d8aa6433d36 100644 --- a/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp +++ b/soh/soh/Enhancements/Graphics/AgeDependentEquipment.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp b/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp index dc2b1f5bfaf..000853b3fa0 100644 --- a/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp +++ b/soh/soh/Enhancements/Graphics/Disable2DBackgrounds.cpp @@ -1,6 +1,6 @@ #include #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp b/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp index e38f437307b..c090c73aeb8 100644 --- a/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp +++ b/soh/soh/Enhancements/Graphics/DisableFixedCamera.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include #include diff --git a/soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp b/soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp index c6fcbf9139d..040ed4b83a8 100644 --- a/soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp +++ b/soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Graphics/ToTMedallions.cpp b/soh/soh/Enhancements/Graphics/ToTMedallions.cpp index 6e9a0114ec7..2de4c9a27ba 100644 --- a/soh/soh/Enhancements/Graphics/ToTMedallions.cpp +++ b/soh/soh/Enhancements/Graphics/ToTMedallions.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/MaskSelect.cpp b/soh/soh/Enhancements/MaskSelect.cpp index 2d5d2bbe353..e0e5ecaa8d7 100644 --- a/soh/soh/Enhancements/MaskSelect.cpp +++ b/soh/soh/Enhancements/MaskSelect.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/QoL/DaytimeGS.cpp b/soh/soh/Enhancements/QoL/DaytimeGS.cpp index 9e7fd4e5a14..9a0da2da73f 100644 --- a/soh/soh/Enhancements/QoL/DaytimeGS.cpp +++ b/soh/soh/Enhancements/QoL/DaytimeGS.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/QoL/OpenAllHours.cpp b/soh/soh/Enhancements/QoL/OpenAllHours.cpp index bbc2ee19986..22fe3bba750 100644 --- a/soh/soh/Enhancements/QoL/OpenAllHours.cpp +++ b/soh/soh/Enhancements/QoL/OpenAllHours.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/QoL/PauseWarp.cpp b/soh/soh/Enhancements/QoL/PauseWarp.cpp index cb4d24ff1e7..7e780672a0e 100644 --- a/soh/soh/Enhancements/QoL/PauseWarp.cpp +++ b/soh/soh/Enhancements/QoL/PauseWarp.cpp @@ -1,6 +1,6 @@ #include #include "soh/Enhancements/custom-message/CustomMessageTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp b/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp index 970170a41cb..84d39220443 100644 --- a/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp +++ b/soh/soh/Enhancements/QoL/ResetNaviTimer.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/RebottleBlueFire.cpp b/soh/soh/Enhancements/RebottleBlueFire.cpp index 1d0062ef116..72a752e5076 100644 --- a/soh/soh/Enhancements/RebottleBlueFire.cpp +++ b/soh/soh/Enhancements/RebottleBlueFire.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/RemoteBombchu.cpp b/soh/soh/Enhancements/RemoteBombchu.cpp index 2f79460112c..99fe5931902 100644 --- a/soh/soh/Enhancements/RemoteBombchu.cpp +++ b/soh/soh/Enhancements/RemoteBombchu.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp b/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp index 4b0acb685a2..d13dad8570f 100644 --- a/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp +++ b/soh/soh/Enhancements/RemoveSpinAttackDarkness.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/ResetGameplayFrames.cpp b/soh/soh/Enhancements/ResetGameplayFrames.cpp index 245288fd2d7..368903f31ee 100644 --- a/soh/soh/Enhancements/ResetGameplayFrames.cpp +++ b/soh/soh/Enhancements/ResetGameplayFrames.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Restorations/BottleAdventure.cpp b/soh/soh/Enhancements/Restorations/BottleAdventure.cpp index 22cc74e6799..818b9a06795 100644 --- a/soh/soh/Enhancements/Restorations/BottleAdventure.cpp +++ b/soh/soh/Enhancements/Restorations/BottleAdventure.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Restorations/GraveHoleJumps.cpp b/soh/soh/Enhancements/Restorations/GraveHoleJumps.cpp index 78b1a45ba8a..59c4cb3aec1 100644 --- a/soh/soh/Enhancements/Restorations/GraveHoleJumps.cpp +++ b/soh/soh/Enhancements/Restorations/GraveHoleJumps.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "functions.h" #include "soh/Enhancements/enhancementTypes.h" diff --git a/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp b/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp index 6f8f90e3bfa..16633f25ae4 100644 --- a/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp +++ b/soh/soh/Enhancements/Restorations/PauseBufferInputs.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Restorations/WideShutterDoorRanges.cpp b/soh/soh/Enhancements/Restorations/WideShutterDoorRanges.cpp index 7b55b3c81e1..c888e3103ce 100644 --- a/soh/soh/Enhancements/Restorations/WideShutterDoorRanges.cpp +++ b/soh/soh/Enhancements/Restorations/WideShutterDoorRanges.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/SunlightArrows.cpp b/soh/soh/Enhancements/SunlightArrows.cpp index 905c9bfd95d..7da436afe96 100644 --- a/soh/soh/Enhancements/SunlightArrows.cpp +++ b/soh/soh/Enhancements/SunlightArrows.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/ShipInit.hpp" #include "soh/ObjectExtension/ObjectExtension.h" diff --git a/soh/soh/Enhancements/TimeSavers/CrawlSpeed.cpp b/soh/soh/Enhancements/TimeSavers/CrawlSpeed.cpp index 2b8794978ff..53b134292a8 100644 --- a/soh/soh/Enhancements/TimeSavers/CrawlSpeed.cpp +++ b/soh/soh/Enhancements/TimeSavers/CrawlSpeed.cpp @@ -1,6 +1,6 @@ #include #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "global.h" diff --git a/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp b/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp index f8eb1128558..ca4bdc7b2cc 100644 --- a/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp +++ b/soh/soh/Enhancements/TimeSavers/DampeAllNight.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index 4a8ab95d83b..9b98d7959d8 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -1,5 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp index d743bead94b..065f0d14132 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp @@ -1,5 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Warping.cpp b/soh/soh/Enhancements/Warping.cpp index 61f495bc398..7de19ef1b65 100644 --- a/soh/soh/Enhancements/Warping.cpp +++ b/soh/soh/Enhancements/Warping.cpp @@ -1,6 +1,6 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "functions.h" #include "soh/SohGui/MenuTypes.h" diff --git a/soh/soh/Enhancements/audio/EnemyBGMDisable.cpp b/soh/soh/Enhancements/audio/EnemyBGMDisable.cpp index 27bd9fd8f1e..2856b87f5c8 100644 --- a/soh/soh/Enhancements/audio/EnemyBGMDisable.cpp +++ b/soh/soh/Enhancements/audio/EnemyBGMDisable.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" static constexpr int32_t CVAR_ENEMYBGMDISABLE_DEFAULT = 0; diff --git a/soh/soh/Enhancements/audio/LeeverEnemyBGM.cpp b/soh/soh/Enhancements/audio/LeeverEnemyBGM.cpp index 9d9b5f0739d..0aa705e33b4 100644 --- a/soh/soh/Enhancements/audio/LeeverEnemyBGM.cpp +++ b/soh/soh/Enhancements/audio/LeeverEnemyBGM.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index 140aab977d9..7e96f588d8f 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -1,7 +1,7 @@ #include "BossRush.h" #include "soh/ShipInit.hpp" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh_assets.h" #include "soh/frame_interpolation.h" diff --git a/soh/soh/Enhancements/controls/Mouse.cpp b/soh/soh/Enhancements/controls/Mouse.cpp index 6df3c815e12..2160eec6987 100644 --- a/soh/soh/Enhancements/controls/Mouse.cpp +++ b/soh/soh/Enhancements/controls/Mouse.cpp @@ -4,7 +4,7 @@ #include "global.h" #include #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" static Ship::Coords mouseCoord = {}; diff --git a/soh/soh/Enhancements/cosmetics/A11yNoScreenFlashForFinishingBlow.cpp b/soh/soh/Enhancements/cosmetics/A11yNoScreenFlashForFinishingBlow.cpp index c093594ef9b..be0e2381dda 100644 --- a/soh/soh/Enhancements/cosmetics/A11yNoScreenFlashForFinishingBlow.cpp +++ b/soh/soh/Enhancements/cosmetics/A11yNoScreenFlashForFinishingBlow.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp index d693fa6565e..e55dd140058 100644 --- a/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp +++ b/soh/soh/Enhancements/cosmetics/CustomLogoTitle.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "textures/nintendo_rogo_static/nintendo_rogo_static.h" diff --git a/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp b/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp index 84ffbbe8440..dcbfe837c6e 100644 --- a/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp +++ b/soh/soh/Enhancements/cosmetics/CustomSkeletons.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/resource/type/Skeleton.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/cosmetics/FileSelectMoreInfo.cpp b/soh/soh/Enhancements/cosmetics/FileSelectMoreInfo.cpp index 048a27cf9e7..b5494aeae71 100644 --- a/soh/soh/Enhancements/cosmetics/FileSelectMoreInfo.cpp +++ b/soh/soh/Enhancements/cosmetics/FileSelectMoreInfo.cpp @@ -13,7 +13,7 @@ #include "macros.h" #include "variables.h" #include "src/overlays/gamestates/ovl_file_choose/file_choose.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "assets/textures/title_static/title_static.h" diff --git a/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp b/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp index 62d94893ee2..177c3d8ebe3 100644 --- a/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp +++ b/soh/soh/Enhancements/cosmetics/NoMasterSword.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp b/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp index e973fa72523..dda4ba4fe0d 100644 --- a/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp +++ b/soh/soh/Enhancements/cosmetics/TimeFlowFileSelect.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "z64save.h" diff --git a/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp b/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp index d81b7c0f480..7e2151ac6e4 100644 --- a/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp +++ b/soh/soh/Enhancements/randomizer/LockOverworldDoors.cpp @@ -1,6 +1,6 @@ #include #include "soh/OTRGlobals.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp index bc1493b30d7..b759e89a7c8 100644 --- a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp @@ -6,7 +6,7 @@ */ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/randomizer/Traps.h" #include "soh/Enhancements/randomizer/item.h" diff --git a/soh/soh/Enhancements/randomizer/RocsFeather.cpp b/soh/soh/Enhancements/randomizer/RocsFeather.cpp index a2f5a027f90..db5c83ed209 100644 --- a/soh/soh/Enhancements/randomizer/RocsFeather.cpp +++ b/soh/soh/Enhancements/randomizer/RocsFeather.cpp @@ -1,5 +1,5 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include diff --git a/soh/soh/Enhancements/randomizer/fishsanity.h b/soh/soh/Enhancements/randomizer/fishsanity.h index 3105521bab6..197f2dd80c4 100644 --- a/soh/soh/Enhancements/randomizer/fishsanity.h +++ b/soh/soh/Enhancements/randomizer/fishsanity.h @@ -4,7 +4,7 @@ #include #include "randomizerTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" typedef struct { u8 mode; diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 0c51569fb63..9ab887bab49 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -7,7 +7,7 @@ #include "soh/Enhancements/randomizer/dungeon.h" #include "soh/Enhancements/randomizer/static_data.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/SohGui/ImGuiUtils.h" #include "soh/Notification/Notification.h" #include "soh/SaveManager.h" diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index b3715f3cba5..cce0e532d4c 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -16,7 +16,7 @@ #include "global.h" #include "entrance.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" extern PlayState* gPlayState; diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index e96a6ee3954..966c304ef9c 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -1,6 +1,6 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 9dd9d62f806..0281a1ee8cb 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -2,7 +2,7 @@ #include #include "soh/resource/type/Scene.h" #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "global.h" #include "vt.h" #include diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index e8c08ec4b9e..a2682f47566 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "ResourceManagerHelpers.h" #include #include "soh/resource/type/Scene.h" diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index f538d860677..4c66d18c210 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -8,7 +8,7 @@ #include "soh/Enhancements/audio/AudioCollection.h" #include "soh/Enhancements/audio/AudioEditor.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #ifdef _MSC_VER #define strdup _strdup diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 61e96476c82..09d5138690d 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -4,7 +4,7 @@ #include "soh/OTRGlobals.h" #include "soh/Enhancements/audio/AudioEditor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" // TODO: can these macros be shared between files? code_800F9280 seems to use // versions without any casts... diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 21da1d4ad9e..a959a2a9fcf 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -3,7 +3,7 @@ #include "vt.h" #include "libultraship/bridge.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #include "message_data_static.h" diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index e71269590fa..cb7caa5853b 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -12,7 +12,7 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/nametag.h" #include "soh/ActorDB.h" diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index fda3cd0618c..e8435ebc2bf 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -34,7 +34,7 @@ #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" u16 D_8011E1C0 = 0; u16 D_8011E1C4 = 0; diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index e8e29a19df1..9d0ea401747 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -4,7 +4,7 @@ #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" #include "textures/icon_item_static/icon_item_static.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #define FLAGS 0 diff --git a/soh/src/code/z_game_over.c b/soh/src/code/z_game_over.c index 5b16bbc38f9..7eb5fe87a81 100644 --- a/soh/src/code/z_game_over.c +++ b/soh/src/code/z_game_over.c @@ -1,7 +1,7 @@ #include "global.h" #include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" void GameOver_Init(PlayState* play) { play->gameOverCtx.state = GAMEOVER_INACTIVE; diff --git a/soh/src/code/z_horse.c b/soh/src/code/z_horse.c index 68f9ba9d2d4..33706e04312 100644 --- a/soh/src/code/z_horse.c +++ b/soh/src/code/z_horse.c @@ -2,7 +2,7 @@ #include "vt.h" #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" s32 func_8006CFC0(s32 scene) { s32 validScenes[] = { SCENE_HYRULE_FIELD, SCENE_LAKE_HYLIA, SCENE_GERUDO_VALLEY, SCENE_GERUDOS_FORTRESS, diff --git a/soh/src/code/z_inventory.c b/soh/src/code/z_inventory.c index c568c16be88..6d93e9fbed8 100644 --- a/soh/src/code/z_inventory.c +++ b/soh/src/code/z_inventory.c @@ -1,5 +1,5 @@ #include "global.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "textures/icon_item_static/icon_item_static.h" #include "textures/icon_item_24_static/icon_item_24_static.h" #include "textures/parameter_static/parameter_static.h" diff --git a/soh/src/code/z_kaleido_scope_call.c b/soh/src/code/z_kaleido_scope_call.c index 403fcd1cde0..97909c3ced4 100644 --- a/soh/src/code/z_kaleido_scope_call.c +++ b/soh/src/code/z_kaleido_scope_call.c @@ -1,6 +1,6 @@ #include "global.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" void (*sKaleidoScopeUpdateFunc)(PlayState* play); void (*sKaleidoScopeDrawFunc)(PlayState* play); diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index f16c7b5676d..b723f8cd7f5 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -7,7 +7,7 @@ #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" typedef enum { /* 0 */ LENS_FLARE_CIRCLE0, diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index cd6de967ea0..6941cbaca49 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -3,7 +3,7 @@ #include "soh/frame_interpolation.h" #include "soh/OTRGlobals.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" s16 Top_LM_Margin = 0; s16 Left_LM_Margin = 0; diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 389817f7073..7904dbfcc62 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -7,7 +7,7 @@ #include #include "soh/OTRGlobals.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" MapData* gMapData; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index a5e3dd797ed..83ef8e79551 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -10,7 +10,7 @@ #include "soh/Enhancements/cosmetics/CosmeticsEditor.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/SaveManager.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index c3c2c2e765a..d3720e34109 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -1,7 +1,7 @@ #include "global.h" #include "vt.h" #include "overlays/actors/ovl_En_Sw/z_en_sw.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" static s16 sDisableAttention = false; static s16 sUnused = -1; diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 25255c12156..53e3e13d839 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -16,7 +16,7 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index ef41ee49ff9..94a3bb8718b 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -8,7 +8,7 @@ #include #include #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/SaveManager.h" diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 3680510985c..e3d33c5d2d5 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -7,7 +7,7 @@ #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/draw.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c index 317ee0775a5..7d2d693249d 100644 --- a/soh/src/code/z_room.c +++ b/soh/src/code/z_room.c @@ -4,7 +4,7 @@ #include "global.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #include diff --git a/soh/src/code/z_scene_table.c b/soh/src/code/z_scene_table.c index 090d52fa669..ff8b8e80f2d 100644 --- a/soh/src/code/z_scene_table.c +++ b/soh/src/code/z_scene_table.c @@ -26,7 +26,7 @@ #include "soh/mq_asset_hacks.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" // Entrance Table definition #define DEFINE_ENTRANCE(_0, sceneId, spawn, continueBgm, displayTitleCard, endTransType, startTransType) \ diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index eff5bb21b76..16651dfd3fc 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -4,7 +4,7 @@ #include #include #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define ANIM_INTERP 1 diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 7abc221a4aa..b7481804167 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -3,7 +3,7 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/savefile.h" #include "soh/OTRGlobals.h" #include "soh/SaveManager.h" diff --git a/soh/src/code/z_vr_box.c b/soh/src/code/z_vr_box.c index f03f9dc7f0f..3a97c3b9ab6 100644 --- a/soh/src/code/z_vr_box.c +++ b/soh/src/code/z_vr_box.c @@ -72,7 +72,7 @@ #include "assets/textures/skyboxes/vr_holy1_pal_static.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" u32 D_8012AC90[4] = { 0x00000000, diff --git a/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index d2a5c3b701b..59212e9119a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/soh/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -6,7 +6,7 @@ #include "z_bg_bdan_switch.h" #include "objects/object_bdan_objects/object_bdan_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 988a0b6740d..ef5c4416ef5 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -8,7 +8,7 @@ #include "scenes/dungeons/ddan/ddan_scene.h" #include "objects/object_bwall/object_bwall.h" #include "objects/object_kingdodongo/object_kingdodongo.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index d521ad680ed..2b2c40754d0 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -12,7 +12,7 @@ #include "scenes/indoors/daiyousei_izumi/daiyousei_izumi_scene.h" #include "soh/frame_interpolation.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index 0e004a84d54..2f5f9e8e472 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -7,7 +7,7 @@ #include "z_bg_gjyo_bridge.h" #include "objects/object_gjyo_objects/object_gjyo_objects.h" #include "scenes/dungeons/ganon_tou/ganon_tou_scene.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index 00f61c7fc38..0c6cc889ff6 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -6,7 +6,7 @@ #include "z_bg_gnd_darkmeiro.h" #include "objects/object_demo_kekkai/object_demo_kekkai.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index 732755ed3ca..0d46f2e42a5 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -6,7 +6,7 @@ #include "z_bg_haka.h" #include "objects/object_haka/object_haka.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index d5b24136e10..31411756c64 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -6,7 +6,7 @@ #include "z_bg_haka_huta.h" #include "objects/object_hakach_objects/object_hakach_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index e595b8e6278..2f0964a316a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -7,7 +7,7 @@ #include "z_bg_haka_ship.h" #include "objects/object_haka_objects/object_haka_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 43beaa506ed..67af88a5798 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -7,7 +7,7 @@ #include "z_bg_haka_tubo.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_haka_objects/object_haka_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 8156fdae9f1..52f22cf9e7d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/soh/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -7,7 +7,7 @@ #include "z_bg_heavy_block.h" #include "objects/object_heavy_object/object_heavy_object.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 0c6b7a204ca..5d99b61ad8c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -6,7 +6,7 @@ #include "z_bg_hidan_curtain.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index b4e3ca3c393..46b28396fc1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -6,7 +6,7 @@ #include "z_bg_hidan_dalm.h" #include "objects/object_hidan_objects/object_hidan_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index 9300f035c24..ce6d7c0d4ab 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -8,7 +8,7 @@ #include "z_bg_hidan_fwbig.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_hidan_objects/object_hidan_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 0625c6ab87d..954c329c58b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -8,7 +8,7 @@ #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "objects/object_hidan_objects/object_hidan_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 0ce95602a2b..33abb9124b1 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -1,6 +1,6 @@ #include "z_bg_ice_shelter.h" #include "objects/object_ice_objects/object_ice_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 20851b20062..bea929fbdf8 100644 --- a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -6,7 +6,7 @@ #include "z_bg_menkuri_eye.h" #include "objects/object_menkuri_objects/object_menkuri_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_DRAW_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index 19985b2ce95..f692e261ced 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -1,6 +1,6 @@ #include "z_bg_mizu_shutter.h" #include "objects/object_mizu_objects/object_mizu_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index e71b2513977..57c09b3af96 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -7,7 +7,7 @@ #include "z_bg_mori_bigst.h" #include "objects/object_mori_objects/object_mori_objects.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 692497415e2..b4a4cd9336a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -6,7 +6,7 @@ #include "z_bg_mori_kaitenkabe.h" #include "objects/object_mori_objects/object_mori_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index cf07b4f44f1..52364056d7e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -7,7 +7,7 @@ #include "z_bg_po_event.h" #include "objects/object_po_sisters/object_po_sisters.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 17113859f88..ca44fa4ab97 100644 --- a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -6,7 +6,7 @@ #include "z_bg_relay_objects.h" #include "objects/object_relay_objects/object_relay_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index d649f7d95bf..dd03b6e99ab 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -6,7 +6,7 @@ #include "z_bg_spot02_objects.h" #include "objects/object_spot02_objects/object_spot02_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 5d73c277f72..d0f681938c5 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -6,7 +6,7 @@ #include "z_bg_spot12_saku.h" #include "objects/object_spot12_obj/object_spot12_obj.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index a0134ce331e..02fe5696816 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -1,7 +1,7 @@ #include "z_bg_spot18_basket.h" #include "objects/object_spot18_obj/object_spot18_obj.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index ef2fc3e5905..3927977d63a 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -7,7 +7,7 @@ #include "z_bg_toki_swd.h" #include "objects/object_toki_objects/object_toki_objects.h" #include "soh/OTRGlobals.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 9c7bbb4e0c2..1ed6f041fbd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -7,7 +7,7 @@ #include "z_bg_treemouth.h" #include "objects/object_spot04_objects/object_spot04_objects.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 890b7c14954..3a4b3e2696e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -6,7 +6,7 @@ #include "z_bg_ydan_hasi.h" #include "objects/object_ydan_objects/object_ydan_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 81e97deebef..32efd273828 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -4,7 +4,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "scenes/dungeons/ddan_boss/ddan_boss_room_1.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 4b050ab920f..78f36f8968a 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -15,7 +15,7 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index f506859ac68..9e4dfc15a7b 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -10,7 +10,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "vt.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index ef1fa28db4a..4b63627f9e6 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -12,7 +12,7 @@ #include "soh/frame_interpolation.h" #include "soh/OTRGlobals.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 48f90d8b153..adea169b51a 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -9,7 +9,7 @@ #include "soh/frame_interpolation.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 7ff38424ca1..6ceb5c46633 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -12,7 +12,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/OTRGlobals.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 926a7c08a05..18a05ecd0b6 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -6,7 +6,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index d9ecf42bc99..083a18d8f73 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -13,7 +13,7 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index d9d97bf7a4a..415858ea95a 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -13,7 +13,7 @@ #include "soh/frame_interpolation.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 7225f8f5d11..51bb6e9f443 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -5,7 +5,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index a17c175c889..01fe4b6ccf8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -17,7 +17,7 @@ #include "soh/OTRGlobals.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index 81552aca66d..b3f33772727 100644 --- a/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/soh/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -3,7 +3,7 @@ #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index bbcebd592a9..f2fd4c5f608 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -12,7 +12,7 @@ #include "vt.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 6dd049bccca..4e67590ee76 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -7,7 +7,7 @@ #include "z_demo_kekkai.h" #include "objects/object_demo_kekkai/object_demo_kekkai.h" #include "scenes/dungeons/ganontika/ganontika_scene.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 70e12441cce..e701e95b455 100644 --- a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -8,7 +8,7 @@ #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "objects/object_sa/object_sa.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "vt.h" diff --git a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 09558365354..fe450f1605c 100644 --- a/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/soh/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -6,7 +6,7 @@ #include "z_door_gerudo.h" #include "objects/object_door_gerudo/object_door_gerudo.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 591bcf3e941..dc0440bb1ac 100644 --- a/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/soh/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -10,7 +10,7 @@ #include "objects/object_mizu_objects/object_mizu_objects.h" #include "objects/object_haka_door/object_haka_door.h" #include "objects/object_door_killer/object_door_killer.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 0faaa6743eb..83ab7fd1e39 100644 --- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -23,7 +23,7 @@ #include "objects/object_menkuri_objects/object_menkuri_objects.h" #include "objects/object_demo_kekkai/object_demo_kekkai.h" #include "objects/object_ouke_haka/object_ouke_haka.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index de29331a6d2..20580806c55 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -1,7 +1,7 @@ #include "z_door_warp1.h" #include "objects/object_warp1/object_warp1.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 86dc36a7f5c..8dca48d0eeb 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -7,7 +7,7 @@ #include "z_elf_msg.h" #include "vt.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c index ed2db23a258..228ee1e5e9f 100644 --- a/soh/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/soh/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -7,7 +7,7 @@ #include "z_en_am.h" #include "objects/object_am/object_am.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 740a394b6db..a76b2275201 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -7,7 +7,7 @@ #include "z_en_ani.h" #include "objects/object_ani/object_ani.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 2f64f178d92..32ad75a6a46 100644 --- a/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/soh/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.h" #include "overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index a0c210cb8ca..8265f90517d 100644 --- a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -8,7 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_gi_nuts/object_gi_nuts.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 2c9d547016a..5e0f22d6c6c 100644 --- a/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/soh/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -7,7 +7,7 @@ #include "z_en_ba.h" #include "objects/object_bxa/object_bxa.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 41feb07ef8a..4977d106854 100644 --- a/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/soh/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -7,7 +7,7 @@ #include "z_en_bb.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_Bb/object_Bb.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c index 9aa6d0afb19..acb63264303 100644 --- a/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c +++ b/soh/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c @@ -1,6 +1,6 @@ #include "z_en_bigokuta.h" #include "objects/object_bigokuta/object_bigokuta.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 31a2e9022cb..ba92dc864fd 100644 --- a/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/soh/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -6,7 +6,7 @@ #include "z_en_bili.h" #include "objects/object_bl/object_bl.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c index 81ea10870c8..a617e6f4365 100644 --- a/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c +++ b/soh/src/overlays/actors/ovl_En_Blkobj/z_en_blkobj.c @@ -6,7 +6,7 @@ #include "z_en_blkobj.h" #include "objects/object_blkobj/object_blkobj.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 5597f8a1fca..4c4b661166c 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -6,7 +6,7 @@ #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index 428158c0f82..6bbd4bcb526 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -2,7 +2,7 @@ #include "vt.h" #include "overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h" #include "overlays/actors/ovl_En_Ex_Item/z_en_ex_item.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index c178dab7571..a3192b2fa09 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -4,7 +4,7 @@ #include #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/item_category_adj.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c b/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c index 542645d1512..6644f9ee773 100644 --- a/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c +++ b/soh/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c @@ -1,6 +1,6 @@ #include "z_en_bubble.h" #include "objects/object_bubble/object_bubble.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_ATTENTION_ENABLED diff --git a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c index f7a171bd03d..925f3390d47 100644 --- a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -9,7 +9,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 67f44aa4892..05c6079bca7 100644 --- a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -7,7 +7,7 @@ #include "z_en_bw.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_bw/object_bw.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index b3cc17cce3d..3c80537c522 100644 --- a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -3,7 +3,7 @@ #include #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 5bbf618f520..1f94e375f12 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -7,7 +7,7 @@ #include "z_en_cow.h" #include "objects/object_cow/object_cow.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 4701d51d078..45d91807408 100644 --- a/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/soh/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -1,6 +1,6 @@ #include "z_en_crow.h" #include "objects/object_crow/object_crow.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index a7d86e67714..f535e63566b 100644 --- a/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/soh/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -1,7 +1,7 @@ #include "z_en_daiku.h" #include "overlays/actors/ovl_En_GeldB/z_en_geldb.h" #include "objects/object_daiku/object_daiku.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index ba9e7687e0a..74aa3f10fd3 100644 --- a/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/soh/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -2,7 +2,7 @@ #include "objects/object_dekubaba/object_dekubaba.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index a7dc2cccd3a..c96b76ca596 100644 --- a/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/soh/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -7,7 +7,7 @@ #include "z_en_dekunuts.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "objects/object_dekunuts/object_dekunuts.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 01e7a7537c3..c0e03f3fa15 100644 --- a/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/soh/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -1,6 +1,6 @@ #include "z_en_dh.h" #include "objects/object_dh/object_dh.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index cd1a14f1fa9..61f764246e8 100644 --- a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -9,7 +9,7 @@ #include "objects/object_zo/object_zo.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 7555d631133..2019dc860a6 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -7,7 +7,7 @@ #include "z_en_dns.h" #include "objects/object_shopnuts/object_shopnuts.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index e16a781b7f4..d8edfa0064c 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h" #include "overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index e7224947792..5f052d6790e 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -10,7 +10,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index 4e66ac0bf3b..8db6c16b7ad 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -13,7 +13,7 @@ #include "objects/object_hintnuts/object_hintnuts.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c index 562ae75db2c..f9007d1f5ec 100644 --- a/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c +++ b/soh/src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c @@ -7,7 +7,7 @@ #include "z_en_dodojr.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/object_dodojr/object_dodojr.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index 2710e6d574c..36027e24dc2 100644 --- a/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/soh/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -2,7 +2,7 @@ #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_En_Bombf/z_en_bombf.h" #include "objects/object_dodongo/object_dodongo.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c index e1144b96af5..60f97512347 100644 --- a/soh/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/soh/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -11,7 +11,7 @@ #include "objects/object_mizu_objects/object_mizu_objects.h" #include "objects/object_haka_door/object_haka_door.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index ce6db14d14d..12b905c7f66 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -8,7 +8,7 @@ #include "objects/object_ds/object_ds.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index 76c52380128..1f8e0422b9f 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -1,7 +1,7 @@ #include "z_en_du.h" #include "objects/object_du/object_du.h" #include "scenes/overworld/spot18/spot18_scene.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_DURING_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 4205553a49b..4bdc6b93cb4 100644 --- a/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/soh/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -1,6 +1,6 @@ #include "z_en_eiyer.h" #include "objects/object_ei/object_ei.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 27586062bfa..a8d2a088831 100644 --- a/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/soh/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -7,7 +7,7 @@ #include "z_en_elf.h" #include "objects/gameplay_keep/gameplay_keep.h" #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 577d70d9903..f1af56ece6c 100644 --- a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -1,7 +1,7 @@ #include "z_en_encount1.h" #include "vt.h" #include "overlays/actors/ovl_En_Tite/z_en_tite.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_LOCK_ON_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 7df9ca25ee4..f2275e766e6 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -8,7 +8,7 @@ #include "overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c index 218e3156dd8..0b0c4c92513 100644 --- a/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/soh/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -8,7 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_fw/object_fw.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index de41e35caca..87ce1580712 100644 --- a/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/soh/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -7,7 +7,7 @@ #include "z_en_firefly.h" #include "objects/object_firefly/object_firefly.h" #include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index e0146cbe494..4586797244d 100644 --- a/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/soh/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -6,7 +6,7 @@ #include "z_en_floormas.h" #include "objects/object_wallmaster/object_wallmaster.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER) diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 2fd4395dc77..f066090aae0 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -3,7 +3,7 @@ #include "vt.h" #include "objects/object_fr/object_fr.h" #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index 7ccea3d70bf..da27095b0f7 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -8,7 +8,7 @@ #include "objects/object_fu/object_fu.h" #include "scenes/indoors/hakasitarelay/hakasitarelay_scene.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 324b48bfc51..4d4fb7e0eb1 100644 --- a/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/soh/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -1,7 +1,7 @@ #include "z_en_fz.h" #include "objects/object_fz/object_fz.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ObjectExtension/ActorMaximumHealth.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c index ff4de221191..9475d8760c1 100644 --- a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -8,7 +8,7 @@ #include "objects/object_ps/object_ps.h" #include "soh/frame_interpolation.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 5b610e37961..8fafe201eaf 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -9,7 +9,7 @@ #include "objects/object_ge1/object_ge1.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 739ddf73249..941db912469 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -8,7 +8,7 @@ #include "vt.h" #include "objects/object_gla/object_gla.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 8e2264adee1..e35847b032e 100644 --- a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -7,7 +7,7 @@ #include "z_en_ge3.h" #include "objects/object_geldb/object_geldb.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 2896522fea1..4f20d75adc9 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -7,7 +7,7 @@ #include "z_en_geldb.h" #include "objects/object_geldb/object_geldb.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 9576c7a82fa..f5d94fe5a07 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -7,7 +7,7 @@ #include "z_en_girla.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include diff --git a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 14299415963..4ac88bbfe1c 100644 --- a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -8,7 +8,7 @@ #include "objects/object_oF1d_map/object_oF1d_map.h" #include "objects/object_gm/object_gm.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 6ef04cfe7af..e2a90229d8a 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -4,7 +4,7 @@ #include "objects/object_oF1d_map/object_oF1d_map.h" #include "soh/frame_interpolation.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 88defb79bf6..0bd7b00505f 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -3,7 +3,7 @@ #include "objects/object_gol/object_gol.h" #include "overlays/actors/ovl_Boss_Goma/z_boss_goma.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 50c9e201bf6..074d8a30a46 100644 --- a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -8,7 +8,7 @@ #include "objects/object_gs/object_gs.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_DURING_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 9107ed6b48c..45f32c98027 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -8,7 +8,7 @@ #include "objects/object_sd/object_sd.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 598c27291c9..c754dff9607 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -13,7 +13,7 @@ #include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 77e5266c53d..555b64b290a 100644 --- a/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/soh/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -6,7 +6,7 @@ #include "z_en_hintnuts.h" #include "objects/object_hintnuts/object_hintnuts.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index d9529d66551..243f5ac73f0 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -8,7 +8,7 @@ #include "vt.h" #include "objects/object_hs/object_hs.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 85b0dcba9cb..637c52ee99e 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -15,7 +15,7 @@ #include "objects/object_cob/object_cob.h" #include "objects/object_os_anime/object_os_anime.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index fbeed649736..b2307c18276 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -8,7 +8,7 @@ #include "scenes/dungeons/jyasinboss/jyasinboss_scene.h" #include "objects/object_ik/object_ik.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c index 8abb0b5d10f..0ba4510fecd 100644 --- a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -8,7 +8,7 @@ #include "objects/object_js/object_js.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 366ffdb410f..a6faab3b92b 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -8,7 +8,7 @@ #include "vt.h" #include "objects/object_ka/object_ka.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index af5e0527884..a6c0e325728 100644 --- a/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/soh/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -8,7 +8,7 @@ #include "objects/object_dekubaba/object_dekubaba.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 68b77650975..b003ed09de7 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -11,7 +11,7 @@ #include "objects/object_kw1/object_kw1.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 818c7b4b038..73f95329962 100644 --- a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -10,7 +10,7 @@ #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "objects/object_kusa/object_kusa.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_THROW_ONLY) diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index fa4db4d59cd..2e6e14045b9 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -7,7 +7,7 @@ #include "z_en_kz.h" #include "objects/object_kz/object_kz.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index e28718137a1..bd1819bbc73 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -6,7 +6,7 @@ #include "z_en_ma1.h" #include "objects/object_ma1/object_ma1.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c index b5344df3900..145d8d56b14 100644 --- a/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/soh/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -6,7 +6,7 @@ #include "z_en_mb.h" #include "objects/object_mb/object_mb.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" /* diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index 68b43078e5c..cc5227b0feb 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -8,7 +8,7 @@ #include "objects/object_md/object_md.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 8ab050e526f..42495413d21 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -7,7 +7,7 @@ #include "z_en_mk.h" #include "objects/object_mk/object_mk.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 3c8442ba977..2d9acd8f1be 100644 --- a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -7,7 +7,7 @@ #include "z_en_ms.h" #include "objects/object_ms/object_ms.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c index afdfefeddc1..10b50f1be4f 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -9,7 +9,7 @@ #include "objects/object_nb/object_nb.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 09ac1e057ec..609765d35cc 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -4,7 +4,7 @@ #include "overlays/actors/ovl_En_Niw/z_en_niw.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 4a054dc3c0b..90e56de6f3c 100644 --- a/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/soh/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -1,7 +1,7 @@ #include "z_en_ny.h" #include "objects/object_ny/object_ny.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 00d6577af40..f8c82219b76 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -8,7 +8,7 @@ #include "scenes/misc/hakaana_ouke/hakaana_ouke_scene.h" #include "scenes/overworld/spot02/spot02_scene.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_UPDATE_DURING_OCARINA) diff --git a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index a53ba667816..675cd536b70 100644 --- a/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/soh/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -1,7 +1,7 @@ #include "z_en_okuta.h" #include "objects/object_okuta/object_okuta.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index d3db280df57..cd24ff44d0c 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -15,7 +15,7 @@ #include "objects/object_masterkokirihead/object_masterkokirihead.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #include "soh/OTRGlobals.h" diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index de842a9fffc..5ecbd834750 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -11,7 +11,7 @@ #include "vt.h" #include #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index f69d9a01439..4b6f5439ab6 100644 --- a/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/soh/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -2,7 +2,7 @@ #include "objects/object_peehat/object_peehat.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index b40a3440781..6a10e22a6e3 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -7,7 +7,7 @@ #include "z_en_po_field.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_po_field/object_po_field.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #include diff --git a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index 95332dd7ede..1b70b0deb00 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -9,7 +9,7 @@ #include "objects/object_tk/object_tk.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 4e6bbf609e3..3fcde2cd403 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -8,7 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_po_sisters/object_po_sisters.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c index 50e9171da5b..61980ab086d 100644 --- a/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/soh/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -7,7 +7,7 @@ #include "z_en_poh.h" #include "objects/object_poh/object_poh.h" #include "objects/object_po_composer/object_po_composer.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 68bf151d9a0..cf5ea16af17 100644 --- a/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/soh/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -1,6 +1,6 @@ #include "z_en_rd.h" #include "objects/object_rd/object_rd.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c index 5c604b50cfe..2b0d06d6385 100644 --- a/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c +++ b/soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "vt.h" #include "objects/object_reeba/object_reeba.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c b/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c index ee98b08391b..51e9c42bb2f 100644 --- a/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c +++ b/soh/src/overlays/actors/ovl_En_Rl/z_en_rl.c @@ -7,7 +7,7 @@ #include "z_en_rl.h" #include "vt.h" #include "objects/object_rl/object_rl.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 57f7535c02d..f907c233df1 100644 --- a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -7,7 +7,7 @@ #include "z_en_rr.h" #include "objects/object_rr/object_rr.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index a5dd7441e4f..7ada2d73a18 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -8,7 +8,7 @@ #include "objects/object_ru1/object_ru1.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_CAN_PRESS_SWITCHES) diff --git a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index f9761b29927..a5ab2119a76 100644 --- a/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/soh/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -9,7 +9,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 527768b80a8..c4e1c413cfd 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -5,7 +5,7 @@ #include "scenes/overworld/spot05/spot05_scene.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c index 59e51894d5b..195305c68e5 100644 --- a/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/soh/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -7,7 +7,7 @@ #include "z_en_sb.h" #include "vt.h" #include "objects/object_sb/object_sb.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 35918e7c245..e7298ea7773 100644 --- a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -2,7 +2,7 @@ #include "objects/object_shopnuts/object_shopnuts.h" #include "overlays/actors/ovl_En_Dns/z_en_dns.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index c525b4ea25d..28d85797634 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -6,7 +6,7 @@ #include "z_en_si.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOOKSHOT_PULLS_ACTOR) diff --git a/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index cb302e2496d..c9a06796579 100644 --- a/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -6,7 +6,7 @@ #include "z_en_siofuki.h" #include "objects/object_siofuki/object_siofuki.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 1d8dc2df682..eb7c1423cf9 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -1,7 +1,7 @@ #include "z_en_skb.h" #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "objects/object_skb/object_skb.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index c88b8dd85af..42f1425781a 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -2,7 +2,7 @@ #include "overlays/actors/ovl_En_Skjneedle/z_en_skjneedle.h" #include "objects/object_skj/object_skj.h" #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_St/z_en_st.c b/soh/src/overlays/actors/ovl_En_St/z_en_st.c index 5969f4fb58a..f39a0561928 100644 --- a/soh/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/soh/src/overlays/actors/ovl_En_St/z_en_st.c @@ -6,7 +6,7 @@ #include "z_en_st.h" #include "objects/object_st/object_st.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS \ diff --git a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 026099e5708..f1d950c3578 100644 --- a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -9,7 +9,7 @@ #include "objects/object_ahg/object_ahg.h" #include "objects/object_boj/object_boj.h" #include -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index f5890b08c28..a3f9745eb0c 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -1,6 +1,6 @@ #include "z_en_sw.h" #include "objects/object_st/object_st.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 39667a31978..7824189dece 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -5,7 +5,7 @@ #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index ec826a99527..d00108f6a1b 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -9,7 +9,7 @@ #include "objects/object_ta/object_ta.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c index a76bb98b5ed..97ba0be00e1 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -6,7 +6,7 @@ #include "z_en_test.h" #include "objects/object_sk2/object_sk2.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 5fd77b1c4f7..4bab109e08b 100644 --- a/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/soh/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -9,7 +9,7 @@ #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" #include "vt.h" #include "objects/object_tite/object_tite.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 96ce945e486..e9edab7cb76 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -9,7 +9,7 @@ #include "objects/object_tk/object_tk.h" #include "soh/frame_interpolation.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 4ad80ee5bb2..e971e7825e0 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -6,7 +6,7 @@ #include "z_en_torch2.h" #include "objects/object_torch2/object_torch2.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index efeb3ae3f92..6e1da61c0c9 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -7,7 +7,7 @@ #include "z_en_toryo.h" #include "objects/object_toryo/object_toryo.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 1fa6885fad2..7f0e6ca09e5 100644 --- a/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/soh/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -6,7 +6,7 @@ #include "z_en_tp.h" #include "objects/object_tp/object_tp.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index 80b34c91ad4..60534aad47f 100644 --- a/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/soh/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -8,7 +8,7 @@ #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c index 7c9c1199c07..89ee2056411 100644 --- a/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/soh/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -6,7 +6,7 @@ #include "z_en_vali.h" #include "objects/object_vali/object_vali.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c index c776e1b2704..ab903fb8bde 100644 --- a/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/soh/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -8,7 +8,7 @@ #include "objects/object_vm/object_vm.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index d57d0364bde..826c2bde49f 100644 --- a/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/soh/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -7,7 +7,7 @@ #include "z_en_wallmas.h" #include "objects/object_wallmaster/object_wallmaster.h" #include "objects/gameplay_keep/gameplay_keep.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index 8d3d3deaf54..1273bbbebe5 100644 --- a/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/soh/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -6,7 +6,7 @@ #include "z_en_weiyer.h" #include "objects/object_ei/object_ei.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 9d2e24d9a49..a4687df37ba 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -8,7 +8,7 @@ #include "vt.h" #include "overlays/actors/ovl_En_Encount1/z_en_encount1.h" #include "objects/object_wf/object_wf.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 4003ab624f7..ccb16ab07f3 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/soh/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -6,7 +6,7 @@ #include "z_en_wonder_item.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 33daf269282..adda2b56e93 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -6,7 +6,7 @@ #include "z_en_wonder_talk2.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_LOCK_ON_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index b67356b9b08..77fdafd554b 100644 --- a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -6,7 +6,7 @@ #include "z_en_wood02.h" #include "objects/object_wood02/object_wood02.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index ec6582ecd4c..67f20db26bf 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -14,7 +14,7 @@ #include "scenes/dungeons/ice_doukutu/ice_doukutu_scene.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c index 720f733861c..cb2abe7c819 100644 --- a/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c +++ b/soh/src/overlays/actors/ovl_En_Yukabyun/z_en_yukabyun.c @@ -6,7 +6,7 @@ #include "z_en_yukabyun.h" #include "objects/object_yukabyun/object_yukabyun.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c index a61a55c3eb7..7fba675f5d0 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -6,7 +6,7 @@ #include "z_en_zf.h" #include "objects/object_zf/object_zf.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c index 1c8a531fab9..ea173f9132c 100644 --- a/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c +++ b/soh/src/overlays/actors/ovl_En_Zl2/z_en_zl2.c @@ -10,7 +10,7 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "objects/object_zl2/object_zl2.h" #include "objects/object_zl2_anime1/object_zl2_anime1.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index a672df2663c..bcad936d4cb 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -12,7 +12,7 @@ #include "objects/object_zl2/object_zl2.h" #include "objects/object_zl2_anime2/object_zl2_anime2.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index f4bc603cf1b..a2d983ff8d4 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -8,7 +8,7 @@ #include "objects/object_zl4/object_zl4.h" #include "scenes/indoors/nakaniwa/nakaniwa_scene.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 77e16a147cc..758797fcc17 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -11,7 +11,7 @@ #include "vt.h" #include "soh/frame_interpolation.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED #define WATER_SURFACE_Y(play) play->colCtx.colHeader->waterBoxes->ySurface diff --git a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index bc5ef623977..647adb2e6b5 100644 --- a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -6,7 +6,7 @@ #include "z_item_b_heart.h" #include "objects/object_gi_hearts/object_gi_hearts.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index e5b422cf1f6..62ef62b8507 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -7,7 +7,7 @@ #include "z_item_ocarina.h" #include "scenes/overworld/spot00/spot00_scene.h" #include "soh/OTRGlobals.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 923defcdc52..ad40906d429 100644 --- a/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/soh/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -8,7 +8,7 @@ #include "objects/object_mamenoki/object_mamenoki.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_IGNORE_POINTLIGHTS diff --git a/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c b/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c index b04348304d7..5419e54a9c8 100644 --- a/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c +++ b/soh/src/overlays/actors/ovl_Obj_Dekujr/z_obj_dekujr.c @@ -6,7 +6,7 @@ #include "z_obj_dekujr.h" #include "objects/object_dekujr/object_dekujr.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 0a53b34e775..c52cc033fd3 100644 --- a/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/soh/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -7,7 +7,7 @@ #include "z_obj_kibako.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_CAN_PRESS_SWITCHES) diff --git a/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index ebc574c515d..7055e5d163b 100644 --- a/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/soh/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -7,7 +7,7 @@ #include "z_obj_kibako2.h" #include "objects/object_kibako2/object_kibako2.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 6f99ff87e7e..651121ea95f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -8,7 +8,7 @@ #include "vt.h" #include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h" #include "objects/object_lightswitch/object_lightswitch.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index e7f72f7f6d2..57175e25b9b 100644 --- a/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/soh/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -7,7 +7,7 @@ #include "z_obj_makekinsuta.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 03bca2f3763..a3c5c8731dc 100644 --- a/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/soh/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -7,7 +7,7 @@ #include "z_obj_switch.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 10ae5895a66..b8fedc6a78f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -8,7 +8,7 @@ #include "overlays/actors/ovl_En_Arrow/z_en_arrow.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_syokudai/object_syokudai.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_HOOKSHOT_PULLS_PLAYER) diff --git a/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 643b7bca3d4..92ffbb6ac90 100644 --- a/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -8,7 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "objects/object_tsubo/object_tsubo.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_THROW_ONLY) diff --git a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index c6ca93dfe9a..242c3dc6f1b 100644 --- a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -7,7 +7,7 @@ #include "z_shot_sun.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "scenes/overworld/spot06/spot06_scene.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "vt.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index d69a0c773d9..f4ac9442b1f 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -27,7 +27,7 @@ #include #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" #include "soh/frame_interpolation.h" #include "soh/OTRGlobals.h" diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 8dd5605cb51..392c82dffec 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -17,7 +17,7 @@ #include "soh_assets.h" #include "soh/Enhancements/boss-rush/BossRush.h" #include "soh/Enhancements/FileSelectEnhancements.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #include "z64save.h" #include "soh/SaveManager.h" diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 9d09cd8009b..cb96439be89 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -1,5 +1,5 @@ #include "file_choose.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/SaveManager.h" // when choosing a file to copy or erase, the 6 main menu buttons are placed at these offsets diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c index f28bf9a5a22..0d98ad70453 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_NES.c @@ -2,7 +2,7 @@ #include "textures/title_static/title_static.h" #include "assets/overlays/ovl_File_Choose/ovl_file_choose.h" #include "assets/soh_assets.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/SaveManager.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index d8b1e189e14..3951771f038 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -2,7 +2,7 @@ #include "textures/title_static/title_static.h" #include "assets/overlays/ovl_File_Choose/ovl_file_choose.h" #include "assets/soh_assets.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/SaveManager.h" diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 581eabac782..a8a985cdb18 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -9,7 +9,7 @@ #include "vt.h" #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" #include "soh/OTRGlobals.h" diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 6e8af2c2d92..92862feb7b6 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -12,7 +12,7 @@ #include #include #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include #include "time.h" diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index ade62acc3e7..809685d5be1 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -3,7 +3,7 @@ #include "textures/icon_item_static/icon_item_static.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" extern const char* digitTextures[]; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index f5adb0b44d6..68abb64c052 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -3,7 +3,7 @@ #include "textures/parameter_static/parameter_static.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/enhancementTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" static u8 sChildUpgrades[] = { UPG_BULLET_BAG, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE }; static u8 sAdultUpgrades[] = { UPG_QUIVER, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE }; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 16cfd8742d3..e79b08c8c84 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -7,7 +7,7 @@ #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/OTRGlobals.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" u8 gAmmoItems[] = { ITEM_STICK, ITEM_NUT, ITEM_BOMB, ITEM_BOW, ITEM_NONE, ITEM_NONE, ITEM_SLINGSHOT, ITEM_NONE, diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index e64cf7cd01e..e2a7660b1c0 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -16,7 +16,7 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/SaveManager.h" From 388eddfc9b0b8c6658b129f8bb689f487e87c2e5 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 21:29:41 -0600 Subject: [PATCH 13/31] Fixed last missing file --- soh/soh/Enhancements/audio/AudioHooks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/audio/AudioHooks.cpp b/soh/soh/Enhancements/audio/AudioHooks.cpp index 3fddb633843..39c261f58b9 100644 --- a/soh/soh/Enhancements/audio/AudioHooks.cpp +++ b/soh/soh/Enhancements/audio/AudioHooks.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "AudioCollection.h" #include From 5eba3020a97617551254ceb5b33ce50a84efafd7 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 22:34:03 -0600 Subject: [PATCH 14/31] Bump temporaly ZAPD and OTRExporter --- OTRExporter | 2 +- ZAPDTR | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OTRExporter b/OTRExporter index 32e088e28c8..719c9169cdf 160000 --- a/OTRExporter +++ b/OTRExporter @@ -1 +1 @@ -Subproject commit 32e088e28c8cdd055d4bb8f3f219d33ad37963f3 +Subproject commit 719c9169cdf09624ebf5d3b9a17bce2a38473110 diff --git a/ZAPDTR b/ZAPDTR index ee3397a365c..0c33905f24e 160000 --- a/ZAPDTR +++ b/ZAPDTR @@ -1 +1 @@ -Subproject commit ee3397a365c5f350a60538c88f0643f155944836 +Subproject commit 0c33905f24ecac2e067e160d519ac58eed9562e9 From 32741e537a357321e5d8b0643efda77dd40e35ac Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 6 Apr 2026 23:20:07 -0600 Subject: [PATCH 15/31] Fixed leading space and unused header --- soh/CMakeLists.txt | 2 +- soh/soh/stubs.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index b31c0124b57..03ee6947119 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -103,7 +103,7 @@ set(PROJECT_NAME soh) # Sources ################################################################################ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c.in ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c @ONLY) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/properties.h.in ${CMAKE_CURRENT_SOURCE_DIR}/properties.h @ONLY) +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/properties.h.in ${CMAKE_CURRENT_SOURCE_DIR}/properties.h @ONLY) set(Header_Files "resource.h") source_group("headers" FILES ${Header_Files}) diff --git a/soh/soh/stubs.c b/soh/soh/stubs.c index 1f5eb6118d9..297ddad2017 100644 --- a/soh/soh/stubs.c +++ b/soh/soh/stubs.c @@ -4,7 +4,6 @@ #include #include "z64.h" #include "OTRGlobals.h" -// #include u32 osResetType; u32 osTvType = OS_TV_NTSC; From 8dfc94996856b4a723e43a4763f2f09bec10d952 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Tue, 7 Apr 2026 23:02:42 -0600 Subject: [PATCH 16/31] Removed unnecessary variable declaration --- soh/soh/Enhancements/game-interactor/GameInteractor.h | 1 - 1 file changed, 1 deletion(-) diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index f6e57e2b04a..c2eb6b3cd5e 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -156,7 +156,6 @@ struct HookInfo { REGISTER_LISTENER(OnVanillaBehavior, EVENT_PRIORITY_LOW, [](IEvent* event) { \ auto* vbEvent = reinterpret_cast(event); \ if (vbEvent->flag == flagToCheck) { \ - GIVanillaBehavior _ = vbEvent->flag; \ bool* should = vbEvent->result; \ va_list args; \ va_copy(args, *vbEvent->originalArgs); \ From ac1fac0c7026ad1be36669660b38451ab62fe3b5 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 11 Apr 2026 19:26:03 -0600 Subject: [PATCH 17/31] Fixed some wrong includes --- soh/soh/Enhancements/Difficulty/DivingGameTimer.cpp | 2 +- soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/Difficulty/DivingGameTimer.cpp b/soh/soh/Enhancements/Difficulty/DivingGameTimer.cpp index ff5e717aa4c..bd8afe56348 100644 --- a/soh/soh/Enhancements/Difficulty/DivingGameTimer.cpp +++ b/soh/soh/Enhancements/Difficulty/DivingGameTimer.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c b/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c index efcbe4d4308..ce7ddb05175 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Turara/z_bg_ice_turara.c @@ -6,7 +6,7 @@ #include "z_bg_ice_turara.h" #include "objects/object_ice_objects/object_ice_objects.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 From 68456461f87d419ca8f74e78305916bbb22606de Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 11 Apr 2026 19:27:54 -0600 Subject: [PATCH 18/31] Bump LUS --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 775be8eeb85..98c059de690 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 775be8eeb8550f339a44b43a84ff2d7730a041f1 +Subproject commit 98c059de69070dc21563cb0cb59ec3b0412fe4b9 From 6450bdc7cf6f2c0f3bbc9260fd0c98ab8ffa53f4 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 11 Apr 2026 19:41:05 -0600 Subject: [PATCH 19/31] Fixed compilation issue --- soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp | 12 +++++++----- soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp index ff16fab11c4..21cef77ef6e 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp @@ -93,9 +93,10 @@ void BgIceTurara_RandomizerSpawnCollectible(void* actor) { void RegisterShuffleIcicles() { bool shouldRegister = IS_RANDO && Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_ICICLES).Get(); - COND_ID_HOOK(OnActorInit, ACTOR_BG_ICE_TURARA, shouldRegister, [](void* actorRef) { - Actor* actor = static_cast(actorRef); - BgIceTurara* icicleActor = static_cast(actorRef); + COND_ID_HOOK(OnActorInit, ACTOR_BG_ICE_TURARA, shouldRegister, [](IEvent* event) { + OnActorInit* ev = (OnActorInit*)event; + Actor* actor = static_cast(ev->actor); + BgIceTurara* icicleActor = static_cast(ev->actor); auto icicleIdentity = OTRGlobals::Instance->gRandomizer->IdentifyIcicle( gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); @@ -141,8 +142,9 @@ void RegisterShuffleIcicles() { }); // Remove the drop indicator when the actor is destroyed - COND_ID_HOOK(OnActorDestroy, ACTOR_BG_ICE_TURARA, shouldRegister, - [](void* actor) { ObjectExtension::GetInstance().Remove(actor); }); + COND_ID_HOOK(OnActorDestroy, ACTOR_BG_ICE_TURARA, shouldRegister, [](IEvent* event) { + ObjectExtension::GetInstance().Remove(reinterpret_cast(event)->actor); + }); } void Rando::StaticData::RegisterIcicleLocations() { diff --git a/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp b/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp index 3ce745882db..d0a99fb8b80 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRedIce.cpp @@ -51,9 +51,10 @@ static void BgIceShelter_RandomizerDraw(Actor* actor, Color_RGBA8* primColor, Co EffectSsKiraKira_SpawnFocused(gPlayState, &pos, &velocity, &accel, primColor, envColor, 2000, 100); } -void BgIceShelter_RandomizerDrawSetup(void* actor) { +void BgIceShelter_RandomizerDrawSetup(IEvent* event) { + OnActorUpdate* ev = (OnActorUpdate*)event; GetItemCategory getItemCategory; - Actor* redIceActor = (Actor*)actor; + Actor* redIceActor = (Actor*)ev->actor; // If not a randomized item or too far, don't draw if (!BgIceShelter_RandomizerHoldsItem(redIceActor) || redIceActor->xzDistToPlayer > 1000.0f) { From 38d795b7271af9802af384041b305438e8d5474b Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 12 Apr 2026 05:48:59 -0600 Subject: [PATCH 20/31] Bump LUS --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 98c059de690..30c78f1a399 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 98c059de69070dc21563cb0cb59ec3b0412fe4b9 +Subproject commit 30c78f1a3999bb93d694c98d679a53db81a69556 From f45cce8d40d29a08e733c8095909a30f824cc855 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 30 May 2026 12:40:13 -0600 Subject: [PATCH 21/31] Bump LUS --- libultraship | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libultraship b/libultraship index 30c78f1a399..f30fe0ed1e9 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 30c78f1a3999bb93d694c98d679a53db81a69556 +Subproject commit f30fe0ed1e9a73ee6f47067a56fa22039c397baf From 98446af44f12deb790f761b9b39babc1917e7b5c Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 30 May 2026 13:11:23 -0600 Subject: [PATCH 22/31] Fixed some build errors --- soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp | 2 +- .../Difficulty/HorsebackArchery.cpp | 2 +- .../TimeSavers/SkipWaterGateDelay.cpp | 2 +- .../Enhancements/randomizer/ShuffleRocks.cpp | 24 ++++++++++++------- .../randomizer/randomizer_check_tracker.cpp | 2 +- .../Enhancements/timesaver_hook_handlers.cpp | 4 ++-- .../z_bg_spot06_objects.c | 2 +- .../overlays/actors/ovl_En_Fish/z_en_fish.c | 2 +- .../overlays/actors/ovl_En_Ishi/z_en_ishi.c | 2 +- .../ovl_En_Yabusame_Mark/z_en_yabusame_mark.c | 2 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 2 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 2 +- 12 files changed, 27 insertions(+), 21 deletions(-) diff --git a/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp b/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp index b770ef863a1..704158bd533 100644 --- a/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp +++ b/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Difficulty/HorsebackArchery.cpp b/soh/soh/Enhancements/Difficulty/HorsebackArchery.cpp index f268a5b175f..efb9bbbb789 100644 --- a/soh/soh/Enhancements/Difficulty/HorsebackArchery.cpp +++ b/soh/soh/Enhancements/Difficulty/HorsebackArchery.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/TimeSavers/SkipWaterGateDelay.cpp b/soh/soh/Enhancements/TimeSavers/SkipWaterGateDelay.cpp index 22e7ed305f0..51d0f0b5d4f 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipWaterGateDelay.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipWaterGateDelay.cpp @@ -1,4 +1,4 @@ -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp index 5e73b534068..55cf91afd56 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleRocks.cpp @@ -205,9 +205,11 @@ void Rock_RandomizerSpawnCollectible(Actor* actor, CheckIdentity rockIdentity, P } } -void EnIshi_RandomizerInit(void* actorRef) { - Actor* actor = static_cast(actorRef); - EnIshi* rockActor = static_cast(actorRef); +void EnIshi_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + + Actor* actor = static_cast(ev->actor); + EnIshi* rockActor = static_cast(ev->actor); auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (rockIdentity.randomizerCheck == RC_MAX) { @@ -224,9 +226,11 @@ void EnIshi_RandomizerInit(void* actorRef) { } } -void ObjBombiwa_RandomizerInit(void* actorRef) { - Actor* actor = static_cast(actorRef); - ObjBombiwa* rockActor = static_cast(actorRef); +void ObjBombiwa_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + + Actor* actor = static_cast(ev->actor); + ObjBombiwa* rockActor = static_cast(ev->actor); auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (rockIdentity.randomizerCheck == RC_MAX) { @@ -242,9 +246,11 @@ void ObjBombiwa_RandomizerInit(void* actorRef) { } } -void ObjHamishi_RandomizerInit(void* actorRef) { - Actor* actor = static_cast(actorRef); - ObjHamishi* rockActor = static_cast(actorRef); +void ObjHamishi_RandomizerInit(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + + Actor* actor = static_cast(ev->actor); + ObjHamishi* rockActor = static_cast(ev->actor); auto rockIdentity = OTRGlobals::Instance->gRandomizer->IdentifyRock(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); if (rockIdentity.randomizerCheck == RC_MAX) { diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 847d76f9316..06b81312ab5 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -874,7 +874,7 @@ void CheckTrackerFlagSet(IEvent* event) { } } -void CheckTrackerDialogMessage() { +void CheckTrackerDialogMessage(IEvent* event) { auto identifyCheck = [](RandomizerCheck rc) { auto loc = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc); if (loc->GetCheckStatus() == RCSHOW_UNCHECKED) { diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 8dc0a229f8f..ce29030a4bc 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -338,7 +338,7 @@ void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { if (!(bombchuiwa->drawFlags & 4) && bombchuiwa->timer >= 0 && bombchuiwa->timer < 9) { bombchuiwa->timer = 9; } - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } @@ -393,7 +393,7 @@ void TimeSaverOnVanillaBehaviorHandler(IEvent* event) { case ACTOR_OBJ_LIGHTSWITCH: { ObjLightswitch* lightswitch = (ObjLightswitch*)actor; lightswitch->toggleDelay = 0; - *should = false; + *ev->result = false; RateLimitedSuccessChime(); break; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 7b7030ef477..f020a824b39 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -7,7 +7,7 @@ #include "z_bg_spot06_objects.h" #include "objects/object_spot06_objects/object_spot06_objects.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_HOOKSHOT_PULLS_ACTOR diff --git a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c index 7ee6432b29e..fb4c5a093d7 100644 --- a/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c +++ b/soh/src/overlays/actors/ovl_En_Fish/z_en_fish.c @@ -8,7 +8,7 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 1f4e9adfb17..7377a51469c 100644 --- a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -8,7 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" #include "soh/OTRGlobals.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "vt.h" diff --git a/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 10df16846cd..7b77cd4a503 100644 --- a/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/soh/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -6,7 +6,7 @@ #include "z_en_yabusame_mark.h" #include "vt.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 28549637501..11fdd199a61 100644 --- a/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/soh/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -7,7 +7,7 @@ #include "z_obj_bombiwa.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "objects/object_bombiwa/object_bombiwa.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 26d6ce6eef8..8d7bce972ad 100644 --- a/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/soh/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -6,7 +6,7 @@ #include "z_obj_hamishi.h" #include "objects/gameplay_field_keep/gameplay_field_keep.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 From 8e8d663f2bfc6a8512d86d888fffeb3505698747 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 30 May 2026 13:12:52 -0600 Subject: [PATCH 23/31] Another batch of errors --- soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp | 6 ++++-- soh/soh/Enhancements/randomizer/ShuffleSigns.cpp | 1 - soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp | 1 - soh/soh/Enhancements/randomizer/hook_handlers.cpp | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp b/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp index 704158bd533..9a9a1af8e0f 100644 --- a/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp +++ b/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp @@ -8,8 +8,10 @@ extern "C" { extern s16 D_80A7DEB8; } -static void OnActorInitNoBugsDespawn(void* refActor) { - EnInsect* insect = reinterpret_cast(refActor); +static void OnActorInitNoBugsDespawn(IEvent* event) { + OnActorInit* ev = reinterpret_cast(event); + + EnInsect* insect = reinterpret_cast(ev->actor); if ((insect->actor.params & 2) && insect->soilActor == NULL) { insect->insectFlags &= ~4; diff --git a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp index 16f2855be53..1c1b64e6ada 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleSigns.cpp @@ -47,7 +47,6 @@ static void Sign_RandomizerDraw(Actor* actor, Color_RGBA8* primColor, Color_RGBA void Sign_RandomizerDrawSetup(IEvent* event) { OnActorUpdate* ev = reinterpret_cast(event); - GetItemCategory getItemCategory; Actor* signActor = (Actor*)ev->actor; // If not a randomized item or too far, don't draw diff --git a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp index e17f3ded4f3..6f9d8091bd7 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleWonderItems.cpp @@ -165,7 +165,6 @@ static void EnWonderItem_RandomizerDraw(EnWonderItem* wonderActor, Color_RGBA8* void EnWonderItem_RandomizerDrawSetup(IEvent* event) { OnActorUpdate* ev = reinterpret_cast(event); - GetItemCategory getItemCategory; EnWonderItem* wonderActor = static_cast(ev->actor); // If not a randomized item or too far, don't draw. diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 086cd421de3..619100a011a 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -433,6 +433,8 @@ void RandomizerOnItemReceiveHandler(IEvent* event) { if (randomizerQueuedCheck == RC_UNKNOWN_CHECK) return; + GetItemEntry receivedItemEntry = ev->itemEntry; + auto loc = Rando::Context::GetInstance()->GetItemLocation(randomizerQueuedCheck); if (randomizerQueuedItemEntry.modIndex == ev->itemEntry.modIndex && randomizerQueuedItemEntry.itemId == ev->itemEntry.itemId) { From 1d24a3d08904786449d8f0d1eda195dd7c00ef1f Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 30 May 2026 14:11:55 -0600 Subject: [PATCH 24/31] Redirected ZAPDTR and OTRExporter to develop --- OTRExporter | 2 +- ZAPDTR | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OTRExporter b/OTRExporter index 719c9169cdf..c5465ba0bbd 160000 --- a/OTRExporter +++ b/OTRExporter @@ -1 +1 @@ -Subproject commit 719c9169cdf09624ebf5d3b9a17bce2a38473110 +Subproject commit c5465ba0bbd02d80d6ba6beed15d049ab64f5d6d diff --git a/ZAPDTR b/ZAPDTR index 0c33905f24e..232d0bee32d 160000 --- a/ZAPDTR +++ b/ZAPDTR @@ -1 +1 @@ -Subproject commit 0c33905f24ecac2e067e160d519ac58eed9562e9 +Subproject commit 232d0bee32d34f0a50a906d8515259f909fb5cdc From d047f9050d7cbc66c4f00c9ed305839bd958d4e5 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 30 May 2026 14:13:49 -0600 Subject: [PATCH 25/31] Deleted custom mod files txt --- mods/custom_mod_files_go_here.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 mods/custom_mod_files_go_here.txt diff --git a/mods/custom_mod_files_go_here.txt b/mods/custom_mod_files_go_here.txt deleted file mode 100644 index e69de29bb2d..00000000000 From 2731497df2f69418e2376b82617059b87fd4e9cf Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 30 May 2026 14:17:40 -0600 Subject: [PATCH 26/31] Fixed duplicated GameInteractor.h includes --- .../Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp | 1 - .../TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp | 1 - soh/soh/Enhancements/Warping.cpp | 1 - soh/soh/Enhancements/boss-rush/BossRush.cpp | 1 - soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp | 1 - soh/soh/Enhancements/randomizer/hook_handlers.cpp | 1 - soh/soh/Enhancements/timesaver_hook_handlers.cpp | 2 -- soh/src/code/code_800EC960.c | 1 - soh/src/code/game.c | 1 - soh/src/code/z_actor.c | 1 - soh/src/code/z_game_over.c | 1 - soh/src/code/z_horse.c | 1 - soh/src/code/z_kankyo.c | 1 - soh/src/code/z_message_PAL.c | 1 - soh/src/code/z_parameter.c | 1 - soh/src/code/z_player_lib.c | 1 - soh/src/code/z_sram.c | 1 - soh/src/code/z_vr_box.c | 1 - soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 1 - soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c | 1 - soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c | 1 - soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c | 1 - soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 1 - soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c | 1 - soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c | 1 - soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 1 - soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 1 - soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c | 1 - soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c | 1 - soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c | 1 - soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c | 1 - 31 files changed, 32 deletions(-) diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index 9b98d7959d8..7044a8e62af 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -1,5 +1,4 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp index 065f0d14132..a9d53d9e2e1 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp @@ -1,5 +1,4 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" extern "C" { diff --git a/soh/soh/Enhancements/Warping.cpp b/soh/soh/Enhancements/Warping.cpp index 7de19ef1b65..f596f4586bd 100644 --- a/soh/soh/Enhancements/Warping.cpp +++ b/soh/soh/Enhancements/Warping.cpp @@ -1,6 +1,5 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" #include "functions.h" #include "soh/SohGui/MenuTypes.h" diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index 7e96f588d8f..71bb1ee995f 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -1,7 +1,6 @@ #include "BossRush.h" #include "soh/ShipInit.hpp" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh_assets.h" #include "soh/frame_interpolation.h" diff --git a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp index db1f0a2cb89..dec78bb2d5d 100644 --- a/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/ItemMessages.cpp @@ -6,7 +6,6 @@ */ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/custom-message/CustomMessageTypes.h" #include "soh/Enhancements/randomizer/Traps.h" #include "soh/Enhancements/randomizer/item.h" diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 619100a011a..2c5f40fd09a 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -7,7 +7,6 @@ #include "soh/Enhancements/randomizer/dungeon.h" #include "soh/Enhancements/randomizer/static_data.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/SohGui/ImGuiUtils.h" #include "soh/Notification/Notification.h" #include "soh/SaveManager.h" diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index ce29030a4bc..76e2e62432b 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -1,6 +1,4 @@ #include -#include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/randomizer/SeedContext.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 09d5138690d..c9eccc20f13 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -4,7 +4,6 @@ #include "soh/OTRGlobals.h" #include "soh/Enhancements/audio/AudioEditor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" // TODO: can these macros be shared between files? code_800F9280 seems to use // versions without any casts... diff --git a/soh/src/code/game.c b/soh/src/code/game.c index dc681427433..1d37ce05ffa 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -3,7 +3,6 @@ #include "vt.h" #include "libultraship/bridge.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ResourceManagerHelpers.h" #include "message_data_static.h" diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index fa1f8e9d8d4..ebd77610bb4 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -12,7 +12,6 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/nametag.h" #include "soh/ActorDB.h" diff --git a/soh/src/code/z_game_over.c b/soh/src/code/z_game_over.c index 7eb5fe87a81..d73c88708ff 100644 --- a/soh/src/code/z_game_over.c +++ b/soh/src/code/z_game_over.c @@ -1,7 +1,6 @@ #include "global.h" #include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" void GameOver_Init(PlayState* play) { play->gameOverCtx.state = GAMEOVER_INACTIVE; diff --git a/soh/src/code/z_horse.c b/soh/src/code/z_horse.c index e93a6d13f71..11427e57cd2 100644 --- a/soh/src/code/z_horse.c +++ b/soh/src/code/z_horse.c @@ -2,7 +2,6 @@ #include "vt.h" #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" s32 Horse_CanSpawn(s32 scene) { s32 validScenes[] = { SCENE_HYRULE_FIELD, SCENE_LAKE_HYLIA, SCENE_GERUDO_VALLEY, SCENE_GERUDOS_FORTRESS, diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index b723f8cd7f5..224f9a5a753 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -7,7 +7,6 @@ #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" typedef enum { /* 0 */ LENS_FLARE_CIRCLE0, diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 83ef8e79551..3d2fdb4e200 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -10,7 +10,6 @@ #include "soh/Enhancements/cosmetics/CosmeticsEditor.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/OTRGlobals.h" #include "soh/SaveManager.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 83608267e07..254048e1c9f 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -15,7 +15,6 @@ #include #include -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/randomizer_grotto.h" #include "soh/OTRGlobals.h" diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index e3d33c5d2d5..927315b942a 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -6,7 +6,6 @@ #include "objects/object_triforce_spot/object_triforce_spot.h" #include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/draw.h" #include "soh/ResourceManagerHelpers.h" diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index b7481804167..a9378f40697 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -3,7 +3,6 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/randomizer/savefile.h" #include "soh/OTRGlobals.h" #include "soh/SaveManager.h" diff --git a/soh/src/code/z_vr_box.c b/soh/src/code/z_vr_box.c index 3a97c3b9ab6..9a2eb7aa624 100644 --- a/soh/src/code/z_vr_box.c +++ b/soh/src/code/z_vr_box.c @@ -71,7 +71,6 @@ #include "assets/textures/skyboxes/vr_holy1_static.h" #include "assets/textures/skyboxes/vr_holy1_pal_static.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" u32 D_8012AC90[4] = { diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 57c09b3af96..9f1bc03a9ce 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -7,7 +7,6 @@ #include "z_bg_mori_bigst.h" #include "objects/object_mori_objects/object_mori_objects.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 52364056d7e..ad544a594be 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -7,7 +7,6 @@ #include "z_bg_po_event.h" #include "objects/object_po_sisters/object_po_sisters.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 78f36f8968a..9fa69d23d62 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -15,7 +15,6 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 18a05ecd0b6..a9d86509f21 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -6,7 +6,6 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 083a18d8f73..5102db39327 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -13,7 +13,6 @@ #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 415858ea95a..efa2cbdf4bf 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -13,7 +13,6 @@ #include "soh/frame_interpolation.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 20a9abbd175..b965ec6ceda 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -5,7 +5,6 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #include diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 01fe4b6ccf8..9852fd28f11 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -17,7 +17,6 @@ #include "soh/OTRGlobals.h" #include "soh/frame_interpolation.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 4c4b661166c..1568afda23c 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -6,7 +6,6 @@ #include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index c754dff9607..b8ffbb83971 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/soh/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -13,7 +13,6 @@ #include "overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY) diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index a6faab3b92b..c63f0a8793f 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -8,7 +8,6 @@ #include "vt.h" #include "objects/object_ka/object_ka.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED | \ diff --git a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index 1b70b0deb00..69c4683f676 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -9,7 +9,6 @@ #include "objects/object_tk/object_tk.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \ diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 809685d5be1..6617d5719e0 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -3,7 +3,6 @@ #include "textures/icon_item_static/icon_item_static.h" #include "soh/Enhancements/cosmetics/cosmeticsTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor.h" extern const char* digitTextures[]; From 25b3e0ed45dc979db295890f740b003f42c74670 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 30 May 2026 14:44:37 -0600 Subject: [PATCH 27/31] Addressed first batch of comments --- soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp | 1 - .../Enhancements/ExtraModes/MirroredWorld.cpp | 2 - .../Enhancements/Fixes/BrokenGiantsKnife.cpp | 2 +- .../game-interactor/EventSystem_List.h | 214 ++++++------------ .../game-interactor/GameInteractor.cpp | 84 +++---- 5 files changed, 108 insertions(+), 195 deletions(-) diff --git a/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp b/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp index 9a9a1af8e0f..f48b3a37d33 100644 --- a/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp +++ b/soh/soh/Enhancements/Cheats/NoBugsDespawn.cpp @@ -10,7 +10,6 @@ extern s16 D_80A7DEB8; static void OnActorInitNoBugsDespawn(IEvent* event) { OnActorInit* ev = reinterpret_cast(event); - EnInsect* insect = reinterpret_cast(ev->actor); if ((insect->actor.params & 2) && insect->soilActor == NULL) { diff --git a/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp b/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp index f2fdaac48bc..1e4b3e95b35 100644 --- a/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp +++ b/soh/soh/Enhancements/ExtraModes/MirroredWorld.cpp @@ -58,9 +58,7 @@ static bool MirroredWorld_ShouldApply(int32_t sceneNum) { } static void UpdateMirrorModeState(IEvent* event) { - bool nextMirroredWorld = MirroredWorld_ShouldApply(reinterpret_cast(event)->sceneNum); - if (prevMirroredWorld == nextMirroredWorld) { return; } diff --git a/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp b/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp index 010d582f113..03181c5b51b 100644 --- a/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp +++ b/soh/soh/Enhancements/Fixes/BrokenGiantsKnife.cpp @@ -14,7 +14,7 @@ static constexpr int32_t CVAR_BGS_FIX_DEFAULT = 0; #define CVAR_BGS_FIX_VALUE CVarGetInteger(CVAR_BGS_FIX_NAME, CVAR_BGS_FIX_DEFAULT) static void OnReceiveBrokenGiantsKnife(IEvent* event) { - const OnItemReceive* ev = reinterpret_cast(event); + OnItemReceive* ev = reinterpret_cast(event); if (ev->itemEntry.itemId != ITEM_SWORD_BGS) { return; } diff --git a/soh/soh/Enhancements/game-interactor/EventSystem_List.h b/soh/soh/Enhancements/game-interactor/EventSystem_List.h index d3c50a44c0a..38bf223fbbb 100644 --- a/soh/soh/Enhancements/game-interactor/EventSystem_List.h +++ b/soh/soh/Enhancements/game-interactor/EventSystem_List.h @@ -5,169 +5,85 @@ #include #include "vanilla-behavior/GIVanillaBehavior.h" -DEFINE_EVENT(OnZTitleInit, void* gameState;); - -DEFINE_EVENT(OnZTitleUpdate, void* gameState;); - -DEFINE_EVENT(OnLoadGame, int32_t fileNum;); - -DEFINE_EVENT(OnExitGame, int32_t fileNum;); - -DEFINE_EVENT(OnGameStateMainStart); - -DEFINE_EVENT(OnGameFrameUpdate); - +DEFINE_EVENT(AfterSceneCommands, int16_t sceneNum;); +DEFINE_EVENT(OnActorDestroy, void* actor;); +DEFINE_EVENT(OnActorInit, void* actor;); +DEFINE_EVENT(OnActorKill, void* actor;); +DEFINE_EVENT(OnActorSpawn, void* actor;); +DEFINE_EVENT(OnActorUpdate, void* actor;); +DEFINE_EVENT(OnAssetAltChange); +DEFINE_EVENT(OnBossDefeat, void* actor;); DEFINE_EVENT(OnCameraState, PlayState* play;); - -DEFINE_EVENT(OnItemReceive, GetItemEntry itemEntry;); - +DEFINE_EVENT(OnCuccoOrChickenHatch); +DEFINE_EVENT(OnDeleteFile, int32_t fileNum;); +DEFINE_EVENT(OnDialogMessage); +DEFINE_EVENT(OnDungeonKeyUsed, uint16_t mapIndex;); +DEFINE_EVENT(OnEnemyDefeat, void* actor;); DEFINE_EVENT(OnEquipmentDelete, int16_t equipmentType; uint16_t equipValue;); - -DEFINE_EVENT(OnSaleEnd, GetItemEntry itemEntry;); - -DEFINE_EVENT(OnTransitionEnd, int16_t sceneNum;); - -DEFINE_EVENT(OnSceneInit, int16_t sceneNum;); - -DEFINE_EVENT(AfterSceneCommands, int16_t sceneNum;); - -DEFINE_EVENT(OnSceneFlagSet, int16_t sceneNum; int16_t flagType; int16_t flag;); - -DEFINE_EVENT(OnSceneFlagUnset, int16_t sceneNum; int16_t flagType; int16_t flag;); - +DEFINE_EVENT(OnExitGame, int32_t fileNum;); +DEFINE_EVENT(OnFileChooseMain, void* gameState;); DEFINE_EVENT(OnFlagSet, int16_t flagType; int16_t flag;); - DEFINE_EVENT(OnFlagUnset, int16_t flagType; int16_t flag;); - -DEFINE_EVENT(OnSceneSpawnActors); - -DEFINE_EVENT(OnLinkSkeletonInit); - +DEFINE_EVENT(OnGameFrameUpdate); +DEFINE_EVENT(OnGameStateMainStart); +DEFINE_EVENT(OnGenerationCompletion); +DEFINE_EVENT(OnInterfaceUpdate); +DEFINE_EVENT(OnItemReceive, GetItemEntry itemEntry;); +DEFINE_EVENT(OnKaleidoUpdate); +DEFINE_EVENT(OnKaleidoscopeUpdate, int16_t inDungeonScene;); DEFINE_EVENT(OnLinkEquipmentChange); - -DEFINE_EVENT(OnPlayerUpdate); - -DEFINE_EVENT(OnSetDoAction, uint16_t action;); - -DEFINE_EVENT(OnPlayerSfx, u16 sfxId;); - -DEFINE_EVENT(OnOcarinaSongAction); - +DEFINE_EVENT(OnLinkSkeletonInit); +DEFINE_EVENT(OnLoadFile, int32_t fileNum;); +DEFINE_EVENT(OnLoadGame, int32_t fileNum;); +DEFINE_EVENT(OnMinimapDrawCompassIcons); DEFINE_EVENT(OnOcarinaNote, uint8_t note; float modulator; int8_t bend;); - -DEFINE_EVENT(OnCuccoOrChickenHatch); - -DEFINE_EVENT(OnShopSlotChange, uint8_t cursorIndex; int16_t price;); - -DEFINE_EVENT(OnDungeonKeyUsed, uint16_t mapIndex;); - -DEFINE_EVENT(ShouldActorInit, void* actor; bool* result;); - -DEFINE_EVENT(OnActorInit, void* actor;); - -DEFINE_EVENT(OnActorSpawn, void* actor;); - -DEFINE_EVENT(ShouldActorUpdate, void* actor; bool* result;); - -DEFINE_EVENT(OnActorUpdate, void* actor;); - -DEFINE_EVENT(OnActorKill, void* actor;); - -DEFINE_EVENT(OnActorDestroy, void* actor;); - -DEFINE_EVENT(OnEnemyDefeat, void* actor;); - -DEFINE_EVENT(OnBossDefeat, void* actor;); - -DEFINE_EVENT(OnTimestamp, u8 item;); - +DEFINE_EVENT(OnOcarinaSongAction); +DEFINE_EVENT(OnOpenText, uint16_t* textId; bool* loadFromMessageTable;); +DEFINE_EVENT(OnPlayDestroy); +DEFINE_EVENT(OnPlayDrawBegin); +DEFINE_EVENT(OnPlayDrawEnd); DEFINE_EVENT(OnPlayerBonk); - -DEFINE_EVENT(OnPlayerSetModels, Player* player; u8 modelGroup;); - -DEFINE_EVENT(OnPlayerHealthChange, int16_t amount;); - DEFINE_EVENT(OnPlayerBottleUpdate, int16_t contents;); - -DEFINE_EVENT(OnPlayerHoldUpShield); - DEFINE_EVENT(OnPlayerFirstPersonControl, Player* player;); - +DEFINE_EVENT(OnPlayerHealthChange, int16_t amount;); +DEFINE_EVENT(OnPlayerHoldUpShield); DEFINE_EVENT(OnPlayerProcessStick); - +DEFINE_EVENT(OnPlayerSetModels, Player* player; u8 modelGroup;); +DEFINE_EVENT(OnPlayerSfx, u16 sfxId;); DEFINE_EVENT(OnPlayerShieldControl, float* sp50; float* sp54;); - -DEFINE_EVENT(OnPlayDestroy); - -DEFINE_EVENT(OnPlayDrawBegin); - -DEFINE_EVENT(OnPlayDrawEnd); - -DEFINE_EVENT(OnVanillaBehavior, GIVanillaBehavior flag; bool* result; va_list * originalArgs;); - -DEFINE_EVENT(OnSaveFile, int32_t fileNum; int32_t sectionID;); - -DEFINE_EVENT(OnLoadFile, int32_t fileNum;); - -DEFINE_EVENT(OnDeleteFile, int32_t fileNum;); - -DEFINE_EVENT(OnDialogMessage); - -DEFINE_EVENT(OnPresentTitleCard); - -DEFINE_EVENT(OnInterfaceUpdate); - -DEFINE_EVENT(OnKaleidoscopeUpdate, int16_t inDungeonScene;); - -DEFINE_EVENT(OnMinimapDrawCompassIcons); - +DEFINE_EVENT(OnPlayerUpdate); DEFINE_EVENT(OnPresentFileSelect); - -DEFINE_EVENT(OnUpdateFileSelectSelection, uint16_t optionIndex;); - -DEFINE_EVENT(OnUpdateFileSelectConfirmationSelection, uint16_t optionIndex;); - -DEFINE_EVENT(OnUpdateFileCopySelection, uint16_t optionIndex;); - +DEFINE_EVENT(OnPresentTitleCard); +DEFINE_EVENT(OnRandoEntranceDiscovered, u16 entranceIndex; u8 isReversedEntrance;); +DEFINE_EVENT(OnRandoSetCheckStatus, RandomizerCheck rc; RandomizerCheckStatus status;); +DEFINE_EVENT(OnRandoSetIsSkipped, RandomizerCheck rc; bool isSkipped;); +DEFINE_EVENT(OnSaleEnd, GetItemEntry itemEntry;); +DEFINE_EVENT(OnSaveFile, int32_t fileNum; int32_t sectionID;); +DEFINE_EVENT(OnSceneFlagSet, int16_t sceneNum; int16_t flagType; int16_t flag;); +DEFINE_EVENT(OnSceneFlagUnset, int16_t sceneNum; int16_t flagType; int16_t flag;); +DEFINE_EVENT(OnSceneInit, int16_t sceneNum;); +DEFINE_EVENT(OnSceneSpawnActors); +DEFINE_EVENT(OnSeqPlayerInit, int32_t playerIdx; int32_t seqId;); +DEFINE_EVENT(OnSetDoAction, uint16_t action;); +DEFINE_EVENT(OnSetGameLanguage); +DEFINE_EVENT(OnShopSlotChange, uint8_t cursorIndex; int16_t price;); +DEFINE_EVENT(OnTimestamp, u8 item;); +DEFINE_EVENT(OnTransitionEnd, int16_t sceneNum;); +DEFINE_EVENT(OnUpdateFileAudioSelection, uint8_t optionIndex;); +DEFINE_EVENT(OnUpdateFileBossRushOptionSelection, uint8_t optionIndex; uint8_t optionValue;); DEFINE_EVENT(OnUpdateFileCopyConfirmationSelection, uint16_t optionIndex;); - -DEFINE_EVENT(OnUpdateFileEraseSelection, uint16_t optionIndex;); - +DEFINE_EVENT(OnUpdateFileCopySelection, uint16_t optionIndex;); DEFINE_EVENT(OnUpdateFileEraseConfirmationSelection, uint16_t optionIndex;); - -DEFINE_EVENT(OnUpdateFileAudioSelection, uint8_t optionIndex;); - -DEFINE_EVENT(OnUpdateFileTargetSelection, uint8_t optionIndex;); - +DEFINE_EVENT(OnUpdateFileEraseSelection, uint16_t optionIndex;); DEFINE_EVENT(OnUpdateFileLanguageSelection, uint8_t optionIndex;); - +DEFINE_EVENT(OnUpdateFileNameSelection, int16_t charCode;); DEFINE_EVENT(OnUpdateFileQuestSelection, uint8_t questIndex;); - -DEFINE_EVENT(OnUpdateFileBossRushOptionSelection, uint8_t optionIndex; uint8_t optionValue;); - DEFINE_EVENT(OnUpdateFileRandomizerOptionSelection, uint8_t optionIndex;); - -DEFINE_EVENT(OnUpdateFileNameSelection, int16_t charCode;); - -DEFINE_EVENT(OnFileChooseMain, void* gameState;); - -DEFINE_EVENT(OnGenerationCompletion); - -DEFINE_EVENT(OnSetGameLanguage); - -DEFINE_EVENT(OnAssetAltChange); - -DEFINE_EVENT(OnKaleidoUpdate); - -// Messages -DEFINE_EVENT(OnOpenText, uint16_t* textId; bool* loadFromMessageTable;); - -// Audio -DEFINE_EVENT(OnSeqPlayerInit, int32_t playerIdx; int32_t seqId;); - -// Rando -DEFINE_EVENT(OnRandoSetCheckStatus, RandomizerCheck rc; RandomizerCheckStatus status;); - -DEFINE_EVENT(OnRandoSetIsSkipped, RandomizerCheck rc; bool isSkipped;); - -DEFINE_EVENT(OnRandoEntranceDiscovered, u16 entranceIndex; u8 isReversedEntrance;); \ No newline at end of file +DEFINE_EVENT(OnUpdateFileSelectConfirmationSelection, uint16_t optionIndex;); +DEFINE_EVENT(OnUpdateFileSelectSelection, uint16_t optionIndex;); +DEFINE_EVENT(OnUpdateFileTargetSelection, uint8_t optionIndex;); +DEFINE_EVENT(OnVanillaBehavior, GIVanillaBehavior flag; bool* result; va_list * originalArgs;); +DEFINE_EVENT(OnZTitleInit, void* gameState;); +DEFINE_EVENT(OnZTitleUpdate, void* gameState;); +DEFINE_EVENT(ShouldActorInit, void* actor; bool* result;); +DEFINE_EVENT(ShouldActorUpdate, void* actor; bool* result;); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp index ea713767170..7f99dfcdd59 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp @@ -126,56 +126,56 @@ bool GameInteractor_Should(GIVanillaBehavior flag, u32 result, ...) { void EventSystem_Register() { // MARK: - Gameplay - REGISTER_EVENT(OnZTitleInit); - REGISTER_EVENT(OnZTitleUpdate); - REGISTER_EVENT(OnLoadGame); + REGISTER_EVENT(AfterSceneCommands); + REGISTER_EVENT(OnCameraState); + REGISTER_EVENT(OnCuccoOrChickenHatch); + REGISTER_EVENT(OnDungeonKeyUsed); + REGISTER_EVENT(OnEquipmentDelete); REGISTER_EVENT(OnExitGame); - REGISTER_EVENT(OnGameStateMainStart); + REGISTER_EVENT(OnFlagSet); + REGISTER_EVENT(OnFlagUnset); REGISTER_EVENT(OnGameFrameUpdate); - REGISTER_EVENT(OnCameraState); + REGISTER_EVENT(OnGameStateMainStart); REGISTER_EVENT(OnItemReceive); - REGISTER_EVENT(OnEquipmentDelete); + REGISTER_EVENT(OnLinkEquipmentChange); + REGISTER_EVENT(OnLinkSkeletonInit); + REGISTER_EVENT(OnLoadGame); + REGISTER_EVENT(OnOcarinaNote); + REGISTER_EVENT(OnOcarinaSongAction); + REGISTER_EVENT(OnPlayerSfx); + REGISTER_EVENT(OnPlayerUpdate); REGISTER_EVENT(OnSaleEnd); - REGISTER_EVENT(OnTransitionEnd); - REGISTER_EVENT(OnSceneInit); - REGISTER_EVENT(AfterSceneCommands); REGISTER_EVENT(OnSceneFlagSet); REGISTER_EVENT(OnSceneFlagUnset); - REGISTER_EVENT(OnFlagSet); - REGISTER_EVENT(OnFlagUnset); + REGISTER_EVENT(OnSceneInit); REGISTER_EVENT(OnSceneSpawnActors); - REGISTER_EVENT(OnLinkSkeletonInit); - REGISTER_EVENT(OnLinkEquipmentChange); - REGISTER_EVENT(OnPlayerUpdate); REGISTER_EVENT(OnSetDoAction); - REGISTER_EVENT(OnPlayerSfx); - REGISTER_EVENT(OnOcarinaSongAction); - REGISTER_EVENT(OnOcarinaNote); - REGISTER_EVENT(OnCuccoOrChickenHatch); REGISTER_EVENT(OnShopSlotChange); - REGISTER_EVENT(OnDungeonKeyUsed); + REGISTER_EVENT(OnTransitionEnd); + REGISTER_EVENT(OnZTitleInit); + REGISTER_EVENT(OnZTitleUpdate); // MARK: - Actors & Entities - REGISTER_EVENT(ShouldActorInit); + REGISTER_EVENT(OnActorDestroy); REGISTER_EVENT(OnActorInit); + REGISTER_EVENT(OnActorKill); REGISTER_EVENT(OnActorSpawn); - REGISTER_EVENT(ShouldActorUpdate); REGISTER_EVENT(OnActorUpdate); - REGISTER_EVENT(OnActorKill); - REGISTER_EVENT(OnActorDestroy); - REGISTER_EVENT(OnEnemyDefeat); REGISTER_EVENT(OnBossDefeat); + REGISTER_EVENT(OnEnemyDefeat); + REGISTER_EVENT(ShouldActorInit); + REGISTER_EVENT(ShouldActorUpdate); // MARK: - Player specifics - REGISTER_EVENT(OnTimestamp); REGISTER_EVENT(OnPlayerBonk); - REGISTER_EVENT(OnPlayerSetModels); - REGISTER_EVENT(OnPlayerHealthChange); REGISTER_EVENT(OnPlayerBottleUpdate); - REGISTER_EVENT(OnPlayerHoldUpShield); REGISTER_EVENT(OnPlayerFirstPersonControl); + REGISTER_EVENT(OnPlayerHealthChange); + REGISTER_EVENT(OnPlayerHoldUpShield); REGISTER_EVENT(OnPlayerProcessStick); + REGISTER_EVENT(OnPlayerSetModels); REGISTER_EVENT(OnPlayerShieldControl); + REGISTER_EVENT(OnTimestamp); // MARK: - Play State REGISTER_EVENT(OnPlayDestroy); @@ -186,34 +186,34 @@ void EventSystem_Register() { REGISTER_EVENT(OnVanillaBehavior); // MARK: - Save Files - REGISTER_EVENT(OnSaveFile); - REGISTER_EVENT(OnLoadFile); REGISTER_EVENT(OnDeleteFile); + REGISTER_EVENT(OnLoadFile); + REGISTER_EVENT(OnSaveFile); // MARK: - Dialog & UI REGISTER_EVENT(OnDialogMessage); - REGISTER_EVENT(OnPresentTitleCard); REGISTER_EVENT(OnInterfaceUpdate); REGISTER_EVENT(OnKaleidoscopeUpdate); REGISTER_EVENT(OnMinimapDrawCompassIcons); + REGISTER_EVENT(OnPresentTitleCard); // MARK: - Main Menu + REGISTER_EVENT(OnFileChooseMain); + REGISTER_EVENT(OnGenerationCompletion); REGISTER_EVENT(OnPresentFileSelect); - REGISTER_EVENT(OnUpdateFileSelectSelection); - REGISTER_EVENT(OnUpdateFileSelectConfirmationSelection); - REGISTER_EVENT(OnUpdateFileCopySelection); + REGISTER_EVENT(OnUpdateFileAudioSelection); + REGISTER_EVENT(OnUpdateFileBossRushOptionSelection); REGISTER_EVENT(OnUpdateFileCopyConfirmationSelection); - REGISTER_EVENT(OnUpdateFileEraseSelection); + REGISTER_EVENT(OnUpdateFileCopySelection); REGISTER_EVENT(OnUpdateFileEraseConfirmationSelection); - REGISTER_EVENT(OnUpdateFileAudioSelection); - REGISTER_EVENT(OnUpdateFileTargetSelection); + REGISTER_EVENT(OnUpdateFileEraseSelection); REGISTER_EVENT(OnUpdateFileLanguageSelection); + REGISTER_EVENT(OnUpdateFileNameSelection); REGISTER_EVENT(OnUpdateFileQuestSelection); - REGISTER_EVENT(OnUpdateFileBossRushOptionSelection); REGISTER_EVENT(OnUpdateFileRandomizerOptionSelection); - REGISTER_EVENT(OnUpdateFileNameSelection); - REGISTER_EVENT(OnFileChooseMain); - REGISTER_EVENT(OnGenerationCompletion); + REGISTER_EVENT(OnUpdateFileSelectConfirmationSelection); + REGISTER_EVENT(OnUpdateFileSelectSelection); + REGISTER_EVENT(OnUpdateFileTargetSelection); // MARK: - Game REGISTER_EVENT(OnSetGameLanguage); @@ -231,7 +231,7 @@ void EventSystem_Register() { REGISTER_EVENT(OnSeqPlayerInit); // MARK: - Randomizer + REGISTER_EVENT(OnRandoEntranceDiscovered); REGISTER_EVENT(OnRandoSetCheckStatus); REGISTER_EVENT(OnRandoSetIsSkipped); - REGISTER_EVENT(OnRandoEntranceDiscovered); } \ No newline at end of file From 9c02ba5b333e1adfbadf25dca55973900b1ae9e5 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 31 May 2026 03:22:00 -0600 Subject: [PATCH 28/31] Another batch of changes --- soh/CMakeLists.txt | 10 +++++----- soh/soh/Enhancements/ArrowCycle.cpp | 1 - soh/soh/Enhancements/SunlightArrows.cpp | 4 ++-- .../SkipCutscene/Story/SkipBlueWarp.cpp | 2 +- .../game-interactor/GameInteractor.cpp | 2 +- .../randomizer/Messages/MerchantMessages.cpp | 2 -- .../Enhancements/randomizer/ShuffleCrates.cpp | 2 +- .../Enhancements/randomizer/ShuffleGrass.cpp | 2 +- .../Enhancements/randomizer/ShuffleIcicles.cpp | 2 +- .../Enhancements/randomizer/hook_handlers.cpp | 18 +++++++++--------- 10 files changed, 21 insertions(+), 24 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 03ee6947119..dd126f82015 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -637,7 +637,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") link_libraries(OpusFile::opusfile CONFIG REQUIRED) if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64") set(ADDITIONAL_LIBRARY_DEPENDENCIES - "$;" + "libultraship;" "ZAPDLib;" "glu32;" "SDL2::SDL2;" @@ -657,7 +657,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows") ) elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32") set(ADDITIONAL_LIBRARY_DEPENDENCIES - "$;" + "libultraship;" "ZAPDLib;" "glu32;" "SDL2::SDL2;" @@ -674,7 +674,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) set(ADDITIONAL_LIBRARY_DEPENDENCIES - "$;" + "libultraship;" SDL2::SDL2 -lglad Threads::Threads @@ -682,7 +682,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch") elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS") find_package(SDL2 REQUIRED) set(ADDITIONAL_LIBRARY_DEPENDENCIES - "$;" + "libultraship;" SDL2::SDL2-static "$<$:-Wl,--wrap=abort>" @@ -699,7 +699,7 @@ else() find_package(Opus REQUIRED) find_package(OpusFile REQUIRED) set(ADDITIONAL_LIBRARY_DEPENDENCIES - "$;" + "libultraship;" "ZAPDLib;" SDL2::SDL2 "Ogg::ogg" diff --git a/soh/soh/Enhancements/ArrowCycle.cpp b/soh/soh/Enhancements/ArrowCycle.cpp index a26dbd91206..01490bcf222 100644 --- a/soh/soh/Enhancements/ArrowCycle.cpp +++ b/soh/soh/Enhancements/ArrowCycle.cpp @@ -1,4 +1,3 @@ -#include "game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/ShipInit.hpp" diff --git a/soh/soh/Enhancements/SunlightArrows.cpp b/soh/soh/Enhancements/SunlightArrows.cpp index 7da436afe96..3b1bb380954 100644 --- a/soh/soh/Enhancements/SunlightArrows.cpp +++ b/soh/soh/Enhancements/SunlightArrows.cpp @@ -83,7 +83,7 @@ void RegisterSunlightArrowsHooks() { }); COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](IEvent* event) { - ShouldActorUpdate* ev = reinterpret_cast(event); + /*ShouldActorUpdate* ev = reinterpret_cast(event); ObjLightswitch* thisx = (ObjLightswitch*)ev->actor; if ((thisx->collider.base.acFlags & AC_HIT) && thisx->collider.base.ac != nullptr) { auto sunData = ObjectExtension::GetInstance().Get(&thisx->actor); @@ -93,7 +93,7 @@ void RegisterSunlightArrowsHooks() { } sunData->activatedByLightArrow = thisx->collider.base.ac->id == ACTOR_EN_ARROW; - } + }*/ }); } diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index 7044a8e62af..f4148aceec2 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -39,7 +39,7 @@ void SkipBlueWarp_OnActorUpdate(IEvent* event) { EnKo* enKo = static_cast(ev->actor); if ((enKo->actor.params & 0xFF) == ENKO_TYPE_CHILD_3 && enKo->actionFunc == func_80A995CC) { - enKo->actionFunc = EnKo_MoveWhenReady; + // enKo->actionFunc = EnKo_MoveWhenReady; } } diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp index 7f99dfcdd59..2a78742493f 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.cpp @@ -234,4 +234,4 @@ void EventSystem_Register() { REGISTER_EVENT(OnRandoEntranceDiscovered); REGISTER_EVENT(OnRandoSetCheckStatus); REGISTER_EVENT(OnRandoSetIsSkipped); -} \ No newline at end of file +} diff --git a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp index f97a3e34f28..355d9a4df8e 100644 --- a/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp +++ b/soh/soh/Enhancements/randomizer/Messages/MerchantMessages.cpp @@ -167,8 +167,6 @@ void BuildScrubMessage(IEvent* event) { void BuildShopMessage(IEvent* event) { OnOpenText* ev = reinterpret_cast(event); - uint16_t* textId = ev->textId; - bool* loadFromMessageTable = ev->loadFromMessageTable; CustomMessage msg; RandomizerCheck rc; // Shop items each have two message entries, second one offset by NUM_SHOP_ITEMS diff --git a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp index 75b3734a6d0..407cee07e4e 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp @@ -210,7 +210,7 @@ void ObjKibako2_RandomizerInit(IEvent* event) { (s16)actor->world.pos.z == -90)))) return; - ObjKibako2* crateActor = static_cast(ev->actor); + ObjKibako2* crateActor = static_cast(actor); auto crateIdentity = OTRGlobals::Instance->gRandomizer->IdentifyCrate(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); diff --git a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp index ba11801e20e..e8995589c6e 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp @@ -122,7 +122,7 @@ void EnKusa_RandomizerInit(IEvent* event) { if (actor->id != ACTOR_EN_KUSA) return; - EnKusa* grassActor = static_cast(ev->actor); + EnKusa* grassActor = static_cast(actor); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); auto grassIdentity = OTRGlobals::Instance->gRandomizer->IdentifyGrass( diff --git a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp index 1f162169c0a..3eb0cbac5b8 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleIcicles.cpp @@ -94,7 +94,7 @@ void RegisterShuffleIcicles() { bool shouldRegister = IS_RANDO && Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_ICICLES).Get(); COND_ID_HOOK(OnActorInit, ACTOR_BG_ICE_TURARA, shouldRegister, [](IEvent* event) { - OnActorInit* ev = (OnActorInit*)event; + OnActorInit* ev = reinterpret_cast(event); Actor* actor = static_cast(ev->actor); BgIceTurara* icicleActor = static_cast(ev->actor); diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 2c5f40fd09a..13617ff8dfd 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -509,7 +509,7 @@ void RandomizerOnItemReceiveHandler(IEvent* event) { if (loc->GetRandomizerCheck() == RC_SPIRIT_TEMPLE_SILVER_GAUNTLETS_CHEST && !CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) { - static ListenerID updateHook; + static ListenerID updateHook = -1; updateHook = REGISTER_LISTENER(OnPlayerUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { Player* player = GET_PLAYER(gPlayState); if (player == NULL || Player_InBlockingCsMode(gPlayState, player) || @@ -2152,7 +2152,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(actor->id, gPlayState->sceneNum, actor->params); if (rc != RC_UNKNOWN_CHECK) { - EnSi* enSi = static_cast(ev->actor); + EnSi* enSi = static_cast(actor); enSi->sohGetItemEntry = Rando::Context::GetInstance()->GetFinalGIEntry( rc, true, (GetItemID)Rando::StaticData::GetLocation(rc)->GetVanillaItem()); actor->draw = (ActorFunc)EnSi_DrawRandomizedItem; @@ -2160,7 +2160,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_EN_DNS) { - EnDns* enDns = static_cast(ev->actor); + EnDns* enDns = static_cast(actor); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); auto scrubIdentity = OTRGlobals::Instance->gRandomizer->IdentifyScrub(gPlayState->sceneNum, enDns->actor.params, respawnData); @@ -2188,7 +2188,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { if (enDnsUpdateHook == -1) { enDnsUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { OnActorUpdate* ev = reinterpret_cast(event); - Actor* innerActor = static_cast(ev->actor); + Actor* innerActor = static_cast(actor); if (innerActor->id == ACTOR_EN_DNS) { if (ObjectExtension::GetInstance().Has(innerActor)) { innerActor->textId = TEXT_SCRUB_RANDOM; @@ -2206,7 +2206,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_ITEM_ETCETERA) { - ItemEtcetera* itemEtcetera = static_cast(ev->actor); + ItemEtcetera* itemEtcetera = static_cast(actor); RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor( itemEtcetera->actor.id, gPlayState->sceneNum, itemEtcetera->actor.params); if (rc != RC_UNKNOWN_CHECK) { @@ -2240,7 +2240,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_EN_EX_ITEM) { - EnExItem* enExItem = static_cast(ev->actor); + EnExItem* enExItem = static_cast(actor); RandomizerCheck rc = RC_UNKNOWN_CHECK; switch (enExItem->type) { @@ -2269,7 +2269,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_EN_GE1) { - EnGe1* enGe1 = static_cast(ev->actor); + EnGe1* enGe1 = static_cast(actor); auto ge1Type = enGe1->actor.params & 0xFF; if (ge1Type == GE1_TYPE_TRAINING_GROUND_GUARD && Flags_GetRandomizerInf(RAND_INF_GF_GTG_GATE_PERMANENTLY_OPEN)) { @@ -2283,7 +2283,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { if (actor->id == ACTOR_BG_JYA_BIGMIRROR && Flags_GetRandomizerInf(RAND_INF_SPIRIT_BIG_MIRROR_STATUE_TURNED)) { Flags_SetSwitch(gPlayState, 0x29); // destroy wall - auto jyaBigMirror = static_cast(ev->actor); + auto jyaBigMirror = static_cast(actor); jyaBigMirror->puzzleFlags |= BIGMIR_PUZZLE_COBRA1_SOLVED | BIGMIR_PUZZLE_COBRA2_SOLVED | BIGMIR_PUZZLE_BOMBIWA_DESTROYED; jyaBigMirror->cobraInfo[0].rotY = 0x4000; @@ -2305,7 +2305,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES).IsNot(RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) && (RAND_GET_OPTION(RSK_FOREST).Is(RO_CLOSED_FOREST_OFF) || Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD))) { - BgTreemouth* bgTreemouth = static_cast(ev->actor); + BgTreemouth* bgTreemouth = static_cast(actor); bgTreemouth->unk_168 = 1.0f; } From f048bc4ca585fc8789f5e351176e4d1315d09f87 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 31 May 2026 03:25:04 -0600 Subject: [PATCH 29/31] Reverted accidental changes --- soh/soh/Enhancements/SunlightArrows.cpp | 4 ++-- .../TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/SunlightArrows.cpp b/soh/soh/Enhancements/SunlightArrows.cpp index 3b1bb380954..7da436afe96 100644 --- a/soh/soh/Enhancements/SunlightArrows.cpp +++ b/soh/soh/Enhancements/SunlightArrows.cpp @@ -83,7 +83,7 @@ void RegisterSunlightArrowsHooks() { }); COND_ID_HOOK(ShouldActorUpdate, ACTOR_OBJ_LIGHTSWITCH, shouldRegister, [](IEvent* event) { - /*ShouldActorUpdate* ev = reinterpret_cast(event); + ShouldActorUpdate* ev = reinterpret_cast(event); ObjLightswitch* thisx = (ObjLightswitch*)ev->actor; if ((thisx->collider.base.acFlags & AC_HIT) && thisx->collider.base.ac != nullptr) { auto sunData = ObjectExtension::GetInstance().Get(&thisx->actor); @@ -93,7 +93,7 @@ void RegisterSunlightArrowsHooks() { } sunData->activatedByLightArrow = thisx->collider.base.ac->id == ACTOR_EN_ARROW; - }*/ + } }); } diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index f4148aceec2..7044a8e62af 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -39,7 +39,7 @@ void SkipBlueWarp_OnActorUpdate(IEvent* event) { EnKo* enKo = static_cast(ev->actor); if ((enKo->actor.params & 0xFF) == ENKO_TYPE_CHILD_3 && enKo->actionFunc == func_80A995CC) { - // enKo->actionFunc = EnKo_MoveWhenReady; + enKo->actionFunc = EnKo_MoveWhenReady; } } From 86d41e853297e6a7f2b8b5690830c7f5a27e4be0 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 31 May 2026 12:52:08 -0600 Subject: [PATCH 30/31] Fixed some wrong casts --- soh/soh/Enhancements/randomizer/ShuffleCrates.cpp | 4 ++-- soh/soh/Enhancements/randomizer/ShuffleGrass.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp index 407cee07e4e..582fb6bad85 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleCrates.cpp @@ -210,7 +210,7 @@ void ObjKibako2_RandomizerInit(IEvent* event) { (s16)actor->world.pos.z == -90)))) return; - ObjKibako2* crateActor = static_cast(actor); + ObjKibako2* crateActor = reinterpret_cast(actor); auto crateIdentity = OTRGlobals::Instance->gRandomizer->IdentifyCrate(gPlayState->sceneNum, (s16)actor->world.pos.x, (s16)actor->world.pos.z); @@ -224,7 +224,7 @@ void ObjKibako_RandomizerInit(IEvent* event) { if (actor->id != ACTOR_OBJ_KIBAKO) return; - ObjKibako* smallCrateActor = static_cast(ev->actor); + ObjKibako* smallCrateActor = reinterpret_cast(ev->actor); auto crateIdentity = OTRGlobals::Instance->gRandomizer->IdentifySmallCrate( gPlayState->sceneNum, (s16)actor->home.pos.x, (s16)actor->home.pos.z); diff --git a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp index e8995589c6e..707e8aca1cd 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleGrass.cpp @@ -122,7 +122,7 @@ void EnKusa_RandomizerInit(IEvent* event) { if (actor->id != ACTOR_EN_KUSA) return; - EnKusa* grassActor = static_cast(actor); + EnKusa* grassActor = reinterpret_cast(actor); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); auto grassIdentity = OTRGlobals::Instance->gRandomizer->IdentifyGrass( From 803d630547e0c6c96c4e8c19fdca8d6c7cffc248 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sun, 31 May 2026 17:32:54 -0600 Subject: [PATCH 31/31] Fixed more wrong casts --- .../Enhancements/randomizer/hook_handlers.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 13617ff8dfd..16b590e39bc 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2152,7 +2152,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(actor->id, gPlayState->sceneNum, actor->params); if (rc != RC_UNKNOWN_CHECK) { - EnSi* enSi = static_cast(actor); + EnSi* enSi = reinterpret_cast(actor); enSi->sohGetItemEntry = Rando::Context::GetInstance()->GetFinalGIEntry( rc, true, (GetItemID)Rando::StaticData::GetLocation(rc)->GetVanillaItem()); actor->draw = (ActorFunc)EnSi_DrawRandomizedItem; @@ -2160,7 +2160,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_EN_DNS) { - EnDns* enDns = static_cast(actor); + EnDns* enDns = reinterpret_cast(actor); s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); auto scrubIdentity = OTRGlobals::Instance->gRandomizer->IdentifyScrub(gPlayState->sceneNum, enDns->actor.params, respawnData); @@ -2188,7 +2188,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { if (enDnsUpdateHook == -1) { enDnsUpdateHook = REGISTER_LISTENER(OnActorUpdate, EVENT_PRIORITY_LOW, [](IEvent* event) { OnActorUpdate* ev = reinterpret_cast(event); - Actor* innerActor = static_cast(actor); + Actor* innerActor = static_cast(ev->actor); if (innerActor->id == ACTOR_EN_DNS) { if (ObjectExtension::GetInstance().Has(innerActor)) { innerActor->textId = TEXT_SCRUB_RANDOM; @@ -2206,7 +2206,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_ITEM_ETCETERA) { - ItemEtcetera* itemEtcetera = static_cast(actor); + ItemEtcetera* itemEtcetera = reinterpret_cast(actor); RandomizerCheck rc = OTRGlobals::Instance->gRandomizer->GetCheckFromActor( itemEtcetera->actor.id, gPlayState->sceneNum, itemEtcetera->actor.params); if (rc != RC_UNKNOWN_CHECK) { @@ -2240,7 +2240,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_EN_EX_ITEM) { - EnExItem* enExItem = static_cast(actor); + EnExItem* enExItem = reinterpret_cast(actor); RandomizerCheck rc = RC_UNKNOWN_CHECK; switch (enExItem->type) { @@ -2269,7 +2269,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { } if (actor->id == ACTOR_EN_GE1) { - EnGe1* enGe1 = static_cast(actor); + EnGe1* enGe1 = reinterpret_cast(actor); auto ge1Type = enGe1->actor.params & 0xFF; if (ge1Type == GE1_TYPE_TRAINING_GROUND_GUARD && Flags_GetRandomizerInf(RAND_INF_GF_GTG_GATE_PERMANENTLY_OPEN)) { @@ -2283,7 +2283,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { if (actor->id == ACTOR_BG_JYA_BIGMIRROR && Flags_GetRandomizerInf(RAND_INF_SPIRIT_BIG_MIRROR_STATUE_TURNED)) { Flags_SetSwitch(gPlayState, 0x29); // destroy wall - auto jyaBigMirror = static_cast(actor); + auto jyaBigMirror = reinterpret_cast(actor); jyaBigMirror->puzzleFlags |= BIGMIR_PUZZLE_COBRA1_SOLVED | BIGMIR_PUZZLE_COBRA2_SOLVED | BIGMIR_PUZZLE_BOMBIWA_DESTROYED; jyaBigMirror->cobraInfo[0].rotY = 0x4000; @@ -2305,7 +2305,7 @@ void RandomizerOnActorInitHandler(IEvent* event) { RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES).IsNot(RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) && (RAND_GET_OPTION(RSK_FOREST).Is(RO_CLOSED_FOREST_OFF) || Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD))) { - BgTreemouth* bgTreemouth = static_cast(actor); + BgTreemouth* bgTreemouth = reinterpret_cast(actor); bgTreemouth->unk_168 = 1.0f; }