From 427be9da5e18cf05b685ab4511d0807d13fe69fd Mon Sep 17 00:00:00 2001 From: syzzi Date: Wed, 19 Jun 2024 06:43:55 +0200 Subject: [PATCH] allow phys bypass even with cbf disabled --- changelog.md | 5 +++++ mod.json | 8 ++++---- src/main.cpp | 14 +++++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index 1307900..9c79b21 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +# v1.1.10 + +* Fix timewarp again +* Allow Physics Bypass even with Disable CBF checked + # v1.1.9 * Fix D-blocks & maybe some other collision issues for non-platformer mode diff --git a/mod.json b/mod.json index 7fb9ed0..c61fc2a 100644 --- a/mod.json +++ b/mod.json @@ -3,7 +3,7 @@ "gd": { "win": "2.206" }, - "version": "v1.1.9", + "version": "v1.1.10", "id": "syzzi.click_between_frames", "name": "Click Between Frames", "developer": "syzzi", @@ -29,8 +29,8 @@ ], "settings": { "soft-toggle": { - "name": "Disable Mod", - "description": "Disable the mod's functionality without needing to restart GD. The mod may still have unintended effects with this checked, so be careful.", + "name": "Disable CBF", + "description": "Disable CBF without needing to restart GD. This option does not disable physics bypass if you have it enabled!", "type": "bool", "default": false }, @@ -48,7 +48,7 @@ }, "actual-delta": { "name": "Physics Bypass", - "description": "Reduces stuttering on some FPS values. \"Disable mod\" must be unchecked. \n\nTHIS WILL ALTER PHYSICS AND MAY BREAK SOME LEVELS! DON'T USE THIS IF YOUR LIST/LEADERBOARD BANS PHYSICS BYPASS!", + "description": "Reduces stuttering on some FPS values. Active even if \"Disable CBF\" is checked. \n\nTHIS WILL ALTER PHYSICS AND MAY BREAK SOME LEVELS! DON'T USE THIS IF YOUR LIST/LEADERBOARD BANS PHYSICS BYPASS!", "type": "bool", "default": false } diff --git a/src/main.cpp b/src/main.cpp index c884779..ed99250 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -381,7 +381,7 @@ class $modify(GJBaseGameLayer) { PlayLayer* pl = PlayLayer::get(); if (pl) { const float timewarp = pl->m_gameState.m_timeWarp; - if (actualDelta && !softToggle) modifiedDelta = CCDirector::sharedDirector()->getActualDeltaTime() * timewarp; + if (actualDelta) modifiedDelta = CCDirector::sharedDirector()->getActualDeltaTime() * timewarp; const int stepCount = std::round(std::max(1.0, ((modifiedDelta * 60.0) / std::min(1.0f, timewarp)) * 4)); // not sure if this is different from (delta * 240) / timewarp @@ -472,11 +472,15 @@ class $modify(EndLevelLayer) { void customSetup() { EndLevelLayer::customSetup(); - if (!softToggle) { - cocos2d::CCSize size = cocos2d::CCDirector::sharedDirector()->getWinSize(); - CCLabelBMFont *indicator = CCLabelBMFont::create("CBF", "bigFont.fnt"); + std::string text; + + if (softToggle && actualDelta) text = "PB"; + else if (actualDelta) text = "CBF+PB"; + else text = "CBF"; - if (actualDelta) indicator->setString("CBF+PB"); + if (!softToggle || actualDelta) { + cocos2d::CCSize size = cocos2d::CCDirector::sharedDirector()->getWinSize(); + CCLabelBMFont *indicator = CCLabelBMFont::create(text.c_str(), "bigFont.fnt"); indicator->setPosition({ size.width, size.height }); indicator->setAnchorPoint({ 1.0f, 1.0f });