From f7d6b0168049f465aa931dbdfc423680f7eb73d4 Mon Sep 17 00:00:00 2001 From: nastys <@> Date: Wed, 5 Aug 2020 15:53:42 +0200 Subject: [PATCH] Force PDA/FT look --- source-code/data/plugins/config.ini | 6 ++-- .../source/plugins/Launcher/framework.h | 3 +- .../source/plugins/Patches/dllmain.cpp | 31 +++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/source-code/data/plugins/config.ini b/source-code/data/plugins/config.ini index 3c3b51a..c47843b 100644 --- a/source-code/data/plugins/config.ini +++ b/source-code/data/plugins/config.ini @@ -42,12 +42,14 @@ No_Scrolling_SFX=0 Enhanced_Stage_Manager=0 #Use encore stages or not Enhanced_Stage_Manager_Encore=1 -#Disable hand scaling -No_Hand_Scaling=0 #Change the mouth animations -- 0=default, 1=force PDA, 2=force FT Force_Mouth=0 #Change the expressions -- 0=default, 1=force PDA, 2=force FT Force_Expressions=0 +#Change the look animations -- 0=default, 1=force PDA, 2=force FT +Force_Look=0 +#Disable hand scaling +No_Hand_Scaling=0 #Hide the volume and SE control buttons Hide_Volume=0 #Remove the photo controls during PV playback diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index ba46634..05bc9cb 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -173,9 +173,10 @@ ConfigOptionBase* optionsArray[] = { new BooleanOption(L"Enhanced_Stage_Manager_Encore", PATCHES_SECTION, CONFIG_FILE, L"Encore", L"Enable encore stages.", true, false), new OptionMetaSpacer(8), - new BooleanOption(L"no_hand_scaling", PATCHES_SECTION, CONFIG_FILE, L"No Hand Scaling", L"Disable hand scaling.", false, false), new DropdownOption(L"force_mouth", PATCHES_SECTION, CONFIG_FILE, L"Mouth Type:", L"Change the mouth animations.", 0, std::vector({ L"Default", L"Force PDA", L"Force FT" })), new DropdownOption(L"force_expressions", PATCHES_SECTION, CONFIG_FILE, L"Expression Type:", L"Change the expressions.", 0, std::vector({ L"Default", L"Force PDA", L"Force FT" })), + new DropdownOption(L"force_look", PATCHES_SECTION, CONFIG_FILE, L"Look Type:", L"Change the look animations.", 0, std::vector({ L"Default", L"Force PDA", L"Force FT" })), + new BooleanOption(L"no_hand_scaling", PATCHES_SECTION, CONFIG_FILE, L"No Hand Scaling", L"Disable hand scaling.", false, false), new OptionMetaSpacer(8), new BooleanOption(L"hide_volume", PATCHES_SECTION, CONFIG_FILE, L"Hide Volume Buttons", L"Hide the volume and SE control buttons.", false, false), diff --git a/source-code/source/plugins/Patches/dllmain.cpp b/source-code/source/plugins/Patches/dllmain.cpp index af8f75d..adff4de 100644 --- a/source-code/source/plugins/Patches/dllmain.cpp +++ b/source-code/source/plugins/Patches/dllmain.cpp @@ -229,6 +229,7 @@ void ApplyPatches() { auto nNoHandScaling = GetPrivateProfileIntW(L"patches", L"no_hand_scaling", FALSE, CONFIG_FILE); auto nForceMouth = GetPrivateProfileIntW(L"patches", L"force_mouth", 0, CONFIG_FILE); auto nForceExpressions = GetPrivateProfileIntW(L"patches", L"force_expressions", 0, CONFIG_FILE); + auto nForceLook = GetPrivateProfileIntW(L"patches", L"force_look", 0, CONFIG_FILE); std::string version_string = std::to_string(game_version); version_string.insert(version_string.begin()+1, '.'); @@ -859,6 +860,36 @@ void ApplyPatches() { printf("[Patches] FT expressions forced\n"); } } + // Force look animations + { + if (nForceLook == 1) // PDA + { + printf("[Patches] Forcing PDA look...\n"); + int* look_table = (int*)(0x1409A1D70); + DWORD oldProtect; + VirtualProtect(look_table, 36, PAGE_EXECUTE_READWRITE, &oldProtect); + for (int i = 0; i < 9; i++) + { + look_table[i]++; + } + VirtualProtect(look_table, 36, oldProtect, nullptr); + printf("[Patches] PDA look forced\n"); + } + else if (nForceLook == 2) // FT + { + printf("[Patches] Forcing FT look...\n"); + int* look_table_oldid = (int*)(0x1409A1D9C); + DWORD oldProtect; + VirtualProtect(look_table_oldid, 36, PAGE_EXECUTE_READWRITE, &oldProtect); + for (int i = 0; i < 11; i++) + { + look_table_oldid[i]--; + } + VirtualProtect(look_table_oldid, 36, oldProtect, nullptr); + printf("[Patches] FT look forced\n"); + } + } + }