Skip to content

Commit

Permalink
allow phys bypass even with cbf disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
theyareonit committed Jun 19, 2024
1 parent 5b2429a commit 427be9d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
},
Expand All @@ -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
}
Expand Down
14 changes: 9 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit 427be9d

Please sign in to comment.