Skip to content

Commit

Permalink
2.3.111111111111111111111111111
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiLko committed Jan 17, 2025
1 parent 18a04f9 commit 6707c8b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 17 deletions.
8 changes: 7 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v2.3.11

* Fixed render restore defaults button restoring defaults.
* Fixed clickbot restore defaults button NOT restoring defaults.
* Fixed tps bug? lets find out.

# v2.3.10

* Added restore button for clickbot click settings.
Expand All @@ -10,7 +16,7 @@
# v2.3.9

* Fixed tps bypass bug when at 240 and enabled so that this lucalwise kid can play with tps enabled but at 240tps.
* Made android video args empty by default cus ffmpeg api dies with them i think.
* Made android video args empty by default cus dffmpeg api dies with them i think.

# v2.3.8

Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"win": "2.2074",
"android": "2.2074"
},
"version": "2.3.10",
"version": "2.3.11",
"id": "zilko.xdbot",
"name": "xdBot",
"developer": "Zilko",
Expand Down
2 changes: 1 addition & 1 deletion src/gdr/gdr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cocos2d::CCPoint dataFromString(std::string dataString);

std::vector<std::string> splitByChar(std::string str, char splitChar);

const std::string xdBotVersion = "v2.3.10";
const std::string xdBotVersion = "v2.3.11";

namespace gdr {

Expand Down
14 changes: 7 additions & 7 deletions src/hacks/tps_bypass.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#include "../includes.hpp"
#include <Geode/modify/GJBaseGameLayer.hpp>

float leftOver2 = 0.f;

class $modify(GJBaseGameLayer) {

void update(float dt) {
if (!Global::get().tpsEnabled) return GJBaseGameLayer::update(dt);
auto& g = Global::get();

if (!g.tpsEnabled) return GJBaseGameLayer::update(dt);
if (Global::getTPS() == 240.f) return GJBaseGameLayer::update(dt);
if (!PlayLayer::get()) return GJBaseGameLayer::update(dt);

float newDt = 1.f / Global::getTPS();

if (Global::get().frameStepper) return GJBaseGameLayer::update(newDt);
if (g.frameStepper) return GJBaseGameLayer::update(newDt);

float realDt = dt + leftOver2;
if (realDt > dt) realDt = dt;
float realDt = dt + g.leftOver;
if (realDt > dt && newDt < dt) realDt = dt;

auto startTime = std::chrono::high_resolution_clock::now();
int mult = static_cast<int>(realDt / newDt);
Expand All @@ -28,7 +28,7 @@ class $modify(GJBaseGameLayer) {
}
}

leftOver2 += (dt - newDt * mult);
g.leftOver += (dt - newDt * mult);

}

Expand Down
1 change: 1 addition & 0 deletions src/includes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,5 @@ class Global {
int currentPage = 0;
float currentPitch = 1.f;
uintptr_t latestSeed = 0;
float leftOver = 0.f;
};
18 changes: 11 additions & 7 deletions src/ui/clickbot_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ bool ClickSettingsLayer::setup(std::string button, geode::Popup<>* layer) {
CCMenu* menu = CCMenu::create();
m_mainLayer->addChild(menu);

button = button;
clickbotLayer = layer;
this->button = button;
this->clickbotLayer = layer;

matjson::Value data = Mod::get()->getSavedValue<matjson::Value>(button);
settings = matjson::Serialize<ClickSetting>::from_json(data);
Expand Down Expand Up @@ -375,11 +375,11 @@ bool ClickSettingsLayer::setup(std::string button, geode::Popup<>* layer) {
CCSprite* spriteOn = CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
CCSprite* spriteOff = CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");

CCMenuItemToggler* toggle = CCMenuItemToggler::create(spriteOff, spriteOn, this, menu_selector(ClickSettingsLayer::onDisable));
toggle->setScale(0.7f);
toggle->setPosition(ccp(76, -9));
toggle->toggle(settings.disabled);
menu->addChild(toggle);
disableToggle = CCMenuItemToggler::create(spriteOff, spriteOn, this, menu_selector(ClickSettingsLayer::onDisable));
disableToggle->setScale(0.7f);
disableToggle->setPosition(ccp(76, -9));
disableToggle->toggle(settings.disabled);
menu->addChild(disableToggle);

CCLabelBMFont* lbl = CCLabelBMFont::create("Disable", "bigFont.fnt");
lbl->setPosition(ccp(76, -32));
Expand Down Expand Up @@ -422,6 +422,10 @@ void ClickSettingsLayer::onRestore(CCObject*) {

updatePitch(nullptr);
updateVolume(nullptr);

disableToggle->toggle(false);

settings.disabled = false;

std::filesystem::path path = Mod::get()->getResourcesDir() / fmt::format("default_{}.mp3", button);

Expand Down
2 changes: 2 additions & 0 deletions src/ui/clickbot_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class ClickSettingsLayer : public geode::Popup<std::string, geode::Popup<>*> {
CCLabelBMFont* volumeLabel = nullptr;
CCLabelBMFont* pitchLabel = nullptr;

CCMenuItemToggler* disableToggle = nullptr;

bool setup(std::string button, geode::Popup<>* layer) override;

public:
Expand Down
1 change: 1 addition & 0 deletions src/ui/record_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ void RecordLayer::textChanged(CCTextInputNode* node) {
if (std::string_view(tpsInput->getString()) != "" && value < 999999 && value >= 0.f) {
mod->setSavedValue("macro_tps", value);
Global::get().tps = value;
Global::get().leftOver = 0.f;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/ui/render_settings_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ void RenderSettingsLayer::onDefaults(CCObject*) {

g.mod->setSavedValue("render_args", std::string("-pix_fmt yuv420p"));
g.mod->setSavedValue("render_audio_args", std::string(""));
#ifdef GEODE_IS_WINDOWS
g.mod->setSavedValue("render_video_args", std::string("colorspace=all=bt709:iall=bt470bg:fast=1"));
#else
g.mod->setSavedValue("render_video_args", std::string(""));
#endif
g.mod->setSavedValue("render_record_audio", true);
g.mod->setSavedValue("render_only_song", false);
g.mod->setSavedValue("render_music_volume", 1.0);
Expand Down

0 comments on commit 6707c8b

Please sign in to comment.