diff --git a/changelog.md b/changelog.md index 640905a..4b810c6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # 1.7.5 - Fixed best run not working +- Ported to **2.2074** # 1.7.4 diff --git a/mod.json b/mod.json index ecec451..750e302 100644 --- a/mod.json +++ b/mod.json @@ -2,10 +2,10 @@ "geode": "3.9.0", "version": "v1.7.5", "gd": { - "win": "2.2073", - "android": "2.206", - "mac": "2.207", - "ios": "2.206" + "win": "2.2074", + "android": "2.2074", + "mac": "2.2074", + "ios": "2.2074" }, "early-load": true, "id": "thesillydoggo.qolmod", diff --git a/src/Client/AndroidUI.cpp b/src/Client/AndroidUI.cpp index a7dc74a..f96e681 100644 --- a/src/Client/AndroidUI.cpp +++ b/src/Client/AndroidUI.cpp @@ -168,8 +168,7 @@ bool AndroidUI::setup() versionInfo->setScale(0.55f); versionInfo->setOpacity(125); - checkingSprite = LoadingCircleSprite::create(); - checkingSprite->runAction(CCRepeatForever::create(CCRotateBy::create(1, 360))); + checkingSprite = LoadingCircleSprite::create(1); checkingSprite->setScale(versionInfo->getScaledContentHeight() / checkingSprite->getContentHeight()); versionParent->addChild(versionInfo); diff --git a/src/Client/Types/SetValueModule.cpp b/src/Client/Types/SetValueModule.cpp index a92f4e6..dabf4ac 100644 --- a/src/Client/Types/SetValueModule.cpp +++ b/src/Client/Types/SetValueModule.cpp @@ -59,7 +59,7 @@ void SetValueModule::makeAndroid(CCNode* menu, CCPoint pos) void SetValueModule::onSet(CCObject* sender) { - auto mod = as(as(sender)->getUserData()); + /*auto mod = as(as(sender)->getUserData()); if (LevelEditorLayer::get() && LevelEditorLayer::get()->m_editorUI && (LevelEditorLayer::get()->m_editorUI->m_selectedObject || LevelEditorLayer::get()->m_editorUI->m_selectedObjects->count() > 0)) { @@ -145,7 +145,7 @@ void SetValueModule::onSet(CCObject* sender) } } } - } + }*/ } void SetValueModule::onScaleToggle(CCObject* sender) diff --git a/src/Hacks/Frame Stepper/FrameStepper.cpp b/src/Hacks/Frame Stepper/FrameStepper.cpp index 0963c7c..1ba1348 100644 --- a/src/Hacks/Frame Stepper/FrameStepper.cpp +++ b/src/Hacks/Frame Stepper/FrameStepper.cpp @@ -128,7 +128,7 @@ void SteppedUILayer::onTogglePaused(CCObject*) fields->paused = !fields->paused; if (fields->paused) - FMODAudioEngine::get()->pauseAllMusic(); + FMODAudioEngine::get()->pauseAllMusic(true); else FMODAudioEngine::get()->resumeAllMusic(); } diff --git a/src/Hacks/Patches/EditorExtension.cpp b/src/Hacks/Patches/EditorExtension.cpp index b0bae9d..0d1529c 100644 --- a/src/Hacks/Patches/EditorExtension.cpp +++ b/src/Hacks/Patches/EditorExtension.cpp @@ -9,6 +9,10 @@ using namespace geode::prelude; // first address is found in CCPoint * EditorUI::getLimitedPosition(EditorUI *this,CCPoi nt *__return,CCPoint param_3) // second address is found in void EditorUI::constrainGameLayerPosition(EditorUI *this,fl oat param_2,float param_3) + // todo: port to 2.207 + + static_assert(false, "this fucking sucks btw"); + std::vector patches = {}; #ifdef GEODE_IS_WINDOWS diff --git a/src/Hacks/RandomSeed.cpp b/src/Hacks/RandomSeed.cpp index d899771..c8bf842 100644 --- a/src/Hacks/RandomSeed.cpp +++ b/src/Hacks/RandomSeed.cpp @@ -2,6 +2,7 @@ #include #include #include "../Client/Client.h" +#include "../Utils/OffsetManager.hpp" using namespace geode::prelude; @@ -26,7 +27,7 @@ class $modify (GJBaseGameLayer) seed = x.value(); #ifdef GEODE_IS_WINDOWS - *(int*)((char*)geode::base::get() + 0x6a4e20) = seed; + *(int*)((char*)geode::base::get() + OffsetManager::get()->offsetForRandomSeed()) = seed; #else GameToolbox::fast_srand(seed); #endif @@ -53,7 +54,7 @@ class $modify (PlayLayer) seed = x.value(); #ifdef GEODE_IS_WINDOWS - *(int*)((char*)geode::base::get() + 0x6a4e20) = seed; + *(int*)((char*)geode::base::get() + OffsetManager::get()->offsetForRandomSeed()) = seed; #else GameToolbox::fast_srand(seed); #endif diff --git a/src/Hacks/ScaleTextInput.cpp b/src/Hacks/ScaleTextInput.cpp index 746ef22..10dbd79 100644 --- a/src/Hacks/ScaleTextInput.cpp +++ b/src/Hacks/ScaleTextInput.cpp @@ -27,7 +27,7 @@ class $modify (InputScaleControl, GJScaleControl) auto wrappedValue = unscaleFloat(value, m_lowerBound, m_upperBound); m_sliderXY->setValue(clamp(wrappedValue, 0, 1)); - this->sliderChanged(m_sliderXY->m_touchLogic); + //this->sliderChanged(m_sliderXY->m_touchLogic); if (EditorUI::get()) { @@ -46,7 +46,7 @@ class $modify (InputScaleControl, GJScaleControl) auto wrappedValue = unscaleFloat(value, m_lowerBound, m_upperBound); m_sliderX->setValue(clamp(wrappedValue, 0, 1)); - this->sliderChanged(m_sliderX->m_touchLogic); + //this->sliderChanged(m_sliderX->m_touchLogic); if (EditorUI::get()) { @@ -65,7 +65,7 @@ class $modify (InputScaleControl, GJScaleControl) auto wrappedValue = unscaleFloat(value, m_lowerBound, m_upperBound); m_sliderY->setValue(clamp(wrappedValue, 0, 1)); - this->sliderChanged(m_sliderY->m_touchLogic); + //this->sliderChanged(m_sliderY->m_touchLogic); if (EditorUI::get()) { diff --git a/src/Hacks/SliderLimit.cpp b/src/Hacks/SliderLimit.cpp index b36e204..db30b2a 100644 --- a/src/Hacks/SliderLimit.cpp +++ b/src/Hacks/SliderLimit.cpp @@ -43,7 +43,7 @@ class $modify (GJScaleControl) float value = scaleFloat(m_sliderXY->getThumb()->getValue(), m_lowerBound, m_upperBound); updateLabelXY(value); - this->sliderChanged(m_sliderXY->getThumb()); + // this->sliderChanged(m_sliderXY->getThumb()); if (EditorUI::get()) { diff --git a/src/Hacks/TPSBypass.cpp b/src/Hacks/TPSBypass.cpp index a772e08..42f2924 100644 --- a/src/Hacks/TPSBypass.cpp +++ b/src/Hacks/TPSBypass.cpp @@ -1,6 +1,7 @@ #include #include #include "../Client/Client.h" +#include "../Utils/OffsetManager.hpp" using namespace geode::prelude; @@ -87,34 +88,16 @@ void updateTPSPatches(bool tpsEnabled) if (tpsEnabled) { - #ifdef GEODE_IS_WINDOWS - auto array = geode::toBytes(1.0f / tps); - - //DWORD old_prot; - //VirtualProtect(reinterpret_cast(geode::base::get() + 0x5ec6d0), array.size(), PAGE_EXECUTE_READWRITE, &old_prot); - patches.push_back(createPatchSafe(reinterpret_cast(geode::base::get() + 0x606f98), array)); - //VirtualProtect(reinterpret_cast(geode::base::get() + 0x5ec6d0), array.size(), old_prot, &old_prot); - #endif - - #ifdef GEODE_IS_ANDROID32 - patches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0x46ce38 - 0x10000)), getBytes(1.0f / tps)).unwrap()); - #endif - - #ifdef GEODE_IS_ANDROID64 - patches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + (0x9384b8 - 0x100000)), getBytes(1.0f / tps)).unwrap()); - #endif - - #ifdef GEODE_IS_INTEL_MAC - patches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + 0x823b00), getBytes(1.0f / tps)).unwrap()); - #endif - - #ifdef GEODE_IS_ARM_MAC - - #endif - - #ifdef GEODE_IS_IOS - patches.push_back(Mod::get()->patch(reinterpret_cast(geode::base::get() + 0x642b60), getBytes(1.0f / tps)).unwrap()); - #endif + if (auto offset = OffsetManager::get()->offsetForType(PatchType::PhysicsBypass); offset != 0x80085) + { + #ifdef GEODE_IS_WINDOWS + auto array = geode::toBytes(1.0f / tps); + #else + auto array = geode::toBytes(1.0f / tps); + #endif + + patches.push_back(createPatchSafe(reinterpret_cast(geode::base::get() + offset), array)); + } } } diff --git a/src/Utils/OffsetManager.cpp b/src/Utils/OffsetManager.cpp new file mode 100644 index 0000000..8a316be --- /dev/null +++ b/src/Utils/OffsetManager.cpp @@ -0,0 +1,67 @@ +#include "OffsetManager.hpp" + +OffsetManager* OffsetManager::get() +{ + static OffsetManager* instance = nullptr; + + if (!instance) + instance = new OffsetManager(); + + return instance; +} + +unsigned int OffsetManager::offsetForType(PatchType type) +{ + switch (type) + { + case PatchType::PhysicsBypass: + #if GEODE_COMP_GD_VERSION == 22074 + + GEODE_WINDOWS(return 0x607008); + GEODE_ANDROID32(return - 0x10000); + GEODE_ANDROID64(return - 0x100000); + GEODE_INTEL_MAC(return ); + GEODE_IOS(return ); + + #endif + + #if GEODE_COMP_GD_VERSION == 22073 + + GEODE_WINDOWS(return 0x606f98); + + #endif + + #if GEODE_COMP_GD_VERSION == 22060 + + GEODE_WINDOWS(return 0x5ec6d0); + GEODE_ANDROID32(return 0x46ce38 - 0x10000); + GEODE_ANDROID64(return 0x9384b8 - 0x100000); + GEODE_INTEL_MAC(return 0x823b00); + GEODE_IOS(return 0x642b60); + + #endif + + break; + } + + return 0x80085; +} + +unsigned int OffsetManager::offsetForRandomSeed() +{ + #ifndef GEODE_IS_WINDOWS + return 0x80085; + #endif + + #if GEODE_COMP_GD_VERSION == 22074 + return 0x6a4e20; + #endif + + #if GEODE_COMP_GD_VERSION == 22073 + return 0x6a4e20; + #endif + + #if GEODE_COMP_GD_VERSION == 22060 + return 0x687dd0; + #endif +} \ No newline at end of file diff --git a/src/Utils/OffsetManager.hpp b/src/Utils/OffsetManager.hpp new file mode 100644 index 0000000..119bddd --- /dev/null +++ b/src/Utils/OffsetManager.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include + +using namespace geode::prelude; + +enum class PatchType +{ + PhysicsBypass, +}; + +class OffsetManager +{ + public: + static OffsetManager* get(); + + unsigned int offsetForType(PatchType type); + unsigned int offsetForRandomSeed(); +}; \ No newline at end of file