From 0159a7f367a8da19dd7cb849aa3e66955679c19e Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Wed, 26 Feb 2020 21:28:19 +1100 Subject: [PATCH] pause: fix chance time after restart (I think) --- source-code/source/plugins/TLAC/Components/Pause.cpp | 10 ++++++++-- source-code/source/plugins/TLAC/Components/Pause.h | 5 +---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source-code/source/plugins/TLAC/Components/Pause.cpp b/source-code/source/plugins/TLAC/Components/Pause.cpp index a91b2d1..97b5ec1 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.cpp +++ b/source-code/source/plugins/TLAC/Components/Pause.cpp @@ -116,6 +116,12 @@ namespace TLAC::Components } + // put these here because my local VS was being a bitch and compiling the place that uses them wrong when they were inline + // updating VS would probably fix it, but this was quicker + // -somewhatlurker + int* resWidth = (int*)RESOLUTION_WIDTH_ADDRESS; + int* resHeight = (int*)RESOLUTION_HEIGHT_ADDRESS; + void Pause::UpdatePostInput() { if (pause) @@ -227,8 +233,8 @@ namespace TLAC::Components Drawing::Point itemCoords = getMenuItemCoords(curMenuSet, i); Drawing::Point touchCoords = { panelState->XPosition, panelState->YPosition }; - touchCoords.x *= 1280.0f / *(int*)RESOLUTION_WIDTH_ADDRESS; // convert to 720p coords - touchCoords.y *= 720.0f / *(int*)RESOLUTION_HEIGHT_ADDRESS; + touchCoords.x *= 1280.0f / *resWidth; // convert to 720p coords + touchCoords.y *= 720.0f / *resHeight; if (touchCoords.x >= itemCoords.x - menuItemWidth / 2 && touchCoords.x <= itemCoords.x + menuItemWidth / 2 && diff --git a/source-code/source/plugins/TLAC/Components/Pause.h b/source-code/source/plugins/TLAC/Components/Pause.h index 87ee21a..429c233 100644 --- a/source-code/source/plugins/TLAC/Components/Pause.h +++ b/source-code/source/plugins/TLAC/Components/Pause.h @@ -163,10 +163,6 @@ namespace TLAC::Components percentage doesn't fully reset by the looks of it???? rip (actually was hold and slide scores -- fixed by manually clearing them now) - - TODO: - check holds count towards percentage after restart if 5% limit was reached - reset not clear flag in protected mode */ // inject flow overrides to switch cases in FUN_1400fddc0 @@ -188,6 +184,7 @@ namespace TLAC::Components *(int*)0x140D0A9B8 = 0; // hold + multi *(int*)0x140D0A9C0 = 0; // slide *(uint8_t*)0x140D0A50C = 0; // not clear flag + *(char*)0x140D0AA0F = 0; // chance time // revert patches and unpause InjectCode((void*)0x1401038cd, { 0x12 }); InjectCode((void*)0x140103b94, { 0x16 });