diff --git a/modules/boot/include/boot.h b/modules/boot/include/boot.h index da8dcd96..022e1de1 100644 --- a/modules/boot/include/boot.h +++ b/modules/boot/include/boot.h @@ -27,6 +27,7 @@ void GZ_handleTurbo(); void GZ_renderMenuTitle(); void GZ_renderPlayPause(); +void GZ_endlessNightOnTitle(); extern "C" { void game_loop(); diff --git a/modules/boot/src/gz_flags.cpp b/modules/boot/src/gz_flags.cpp index 65c33369..ecb21890 100644 --- a/modules/boot/src/gz_flags.cpp +++ b/modules/boot/src/gz_flags.cpp @@ -15,7 +15,10 @@ #include "libtp_c/include/JSystem/JUtility/JUTGamePad.h" #include "libtp_c/include/m_Do/m_Re_controller_pad.h" #include "libtp_c/include/f_op/f_op_scene_req.h" +#include "libtp_c/include/f_op/f_op_actor_iter.h" #include "rels/include/defines.h" +#include "libtp_c/include/d/d_procname.h" +#include bool g_framePaused = false; @@ -38,7 +41,7 @@ KEEP_FUNC void GZFlg_addFlag(GZFlag* flag) { KEEP_FUNC GZFlag* GZFlg_removeFlag(GZFlags flag_id) { auto it = g_gzFlags.begin(); - for (;it != g_gzFlags.end(); ++it) { + for (; it != g_gzFlags.end(); ++it) { if ((*it)->id == flag_id) { break; } @@ -124,6 +127,10 @@ void GZ_execute(int phase) { gSaveManager.mPracticeFileOpts.inject_options_after_load(); gSaveManager.mPracticeFileOpts.inject_options_after_load = nullptr; } + void* titleScreen = fopAcM_SearchByName(PROC_TITLE); + if (titleScreen != NULL) { + GZ_endlessNightOnTitle(); + } } // normally oxygen doesn't get set until going to the file select screen @@ -134,7 +141,6 @@ void GZ_execute(int phase) { dComIfGs_setMaxOxygen(600); } } - #define ACTIVE_FLAG_FUNC(name, stngId) \ KEEP_FUNC bool name() { return GZStng_getData(stngId, false); } diff --git a/modules/boot/src/main.cpp b/modules/boot/src/main.cpp index 7cab3945..c3fd7abe 100644 --- a/modules/boot/src/main.cpp +++ b/modules/boot/src/main.cpp @@ -202,6 +202,8 @@ KEEP_FUNC void GZ_renderMenuTitle() { Texture l_framePauseTex; Texture l_framePlayTex; + + KEEP_FUNC void GZ_renderPlayPause() { if (GZStng_getData(STNG_TOOLS_FRAME_ADVANCE, false)) { if (l_framePauseTex.loadCode == TexCode::TEX_UNLOADED) { @@ -222,4 +224,13 @@ KEEP_FUNC void GZ_renderPlayPause() { free_texture(&l_framePlayTex); } } + +} + +KEEP_FUNC void GZ_endlessNightOnTitle() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().mTime = 1.0f; + g_env_light.mDarkDaytime = 1.0f; + g_env_light.field_0x12c3 = 1; + g_env_light.field_0xef4.field_0x4 = 1; + g_env_light.mRainCheck = 250; } \ No newline at end of file diff --git a/modules/boot/src/utils/hook.cpp b/modules/boot/src/utils/hook.cpp index 5779829e..f7f2ee1a 100644 --- a/modules/boot/src/utils/hook.cpp +++ b/modules/boot/src/utils/hook.cpp @@ -197,7 +197,7 @@ int saveInjectHook(void* i_scene) { // Hook to disable save inject flags after dScnPly phase_4 is run int endSaveInjectHook(void* i_scene) { int rt = dScnPly__phase_4Trampoline(i_scene); - + if (SaveManager::s_injectSave || SaveManager::s_injectMemfile) { SaveManager::s_injectSave = false; SaveManager::s_injectMemfile = false; @@ -205,7 +205,6 @@ int endSaveInjectHook(void* i_scene) { return rt; } - void dCcSDrawHook(dCcS* i_this) { GZ_drawCc(i_this); return dCcS__drawTrampoline(i_this); @@ -500,6 +499,7 @@ KEEP_FUNC void applyHooks() { APPLY_HOOK(dScnPly__phase_1, &f_dScnPly__phase_1, saveInjectHook); APPLY_HOOK(dScnPly__phase_4, &f_dScnPly__phase_4, endSaveInjectHook); + APPLY_HOOK(dCcS__draw, &f_dCcS__Draw, dCcSDrawHook); APPLY_HOOK(BeforeOfPaint, &f_dScnPly_BeforeOfPaint, beforeOfPaintHook); APPLY_HOOK(dCcS__MoveAfterCheck, &f_dCcS__MoveAfterCheck, dCcSMoveAfterCheckHook);