Skip to content

Commit

Permalink
2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiLko committed Jan 11, 2025
1 parent 2eed3dd commit 2d64035
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v2.3.3

* Fixed android render inputs length being limited to 3 or 2 idk.
* Fixed macro autosaving on level end even if autosave was not enabled.

# v2.3.2

* Fixed android default render codec.
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.2",
"version": "2.3.3",
"id": "zilko.xdbot",
"name": "xdBot",
"developer": "Zilko",
Expand Down
6 changes: 3 additions & 3 deletions src/hacks/other.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class $modify(EndLevelLayer) {
EndLevelLayer::customSetup();
auto& g = Global::get();

if (g.mod->getSavedValue<bool>("autosave_levelend_enabled"))
if (g.state == state::recording && g.autosaveEnabled && g.mod->getSavedValue<bool>("autosave_levelend_enabled"))
Macro::autoSave(nullptr, g.currentSession);

if (g.mod->getSettingValue<bool>("endscreen_button")) {
Expand All @@ -182,8 +182,8 @@ class $modify(EndLevelLayer) {
CCMenuItemSpriteExtra* btn = CCMenuItemSpriteExtra::create(
sprite,
this,
menu_selector(RecordLayer::openMenu2
));
menu_selector(RecordLayer::openMenu2)
);
btn->setPosition({160, -99});

CCLayer* layer = this->getChildByType<CCLayer>(0);
Expand Down
6 changes: 4 additions & 2 deletions src/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ bool Macro::flipControls() {
}

void Macro::autoSave(GJGameLevel* level, int number) {
if (!level) level = PlayLayer::get() ? PlayLayer::get()->m_level : nullptr;
if (!level) level = PlayLayer::get() != nullptr ? PlayLayer::get()->m_level : nullptr;
if (!level) return;

std::string levelname = level->m_levelName;
std::filesystem::path autoSavesPath = Mod::get()->getSettingValue<std::filesystem::path>("autosaves_folder");
std::filesystem::path path = autoSavesPath / fmt::format("autosave_{}_{}", levelname, number);

std::string username = GJAccountManager::sharedState()->m_username;
if (!std::filesystem::exists(autoSavesPath)) return;

std::string username = GJAccountManager::sharedState() != nullptr ? GJAccountManager::sharedState()->m_username : "";
int result = Macro::save(username, fmt::format("AutoSave {} in level {}", number, levelname), path.string());

if (result != 0)
Expand Down
2 changes: 1 addition & 1 deletion src/macro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const std::vector<float> safeValues = {
1.0f / 5, 1.0f / 4, 1.0f / 3, 1.0f / 2
};

const std::string xdBotVersion = "v2.3.2";
const std::string xdBotVersion = "v2.3.3";

enum state {
none,
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ void Renderer::start() {

#ifdef GEODE_IS_ANDROID
audioMode = AudioMode::Off;
#else
if (usingApi) audioMode = AudioMode::Off;
#endif

if ((SFXVolume == 0.f && musicVolume == 0.f) || audioMode == AudioMode::Off || (audioMode == AudioMode::Song && !std::filesystem::exists(songFile)) || (audioMode == AudioMode::Record && !std::filesystem::exists("fmodoutput.wav"))) {
Expand Down
3 changes: 0 additions & 3 deletions src/ui/record_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,6 @@ bool RecordLayer::setup() {
heightInput->setMouseEnabled(true);
heightInput->setContentSize({ 60, 20 });
heightInput->setTouchEnabled(true);
heightInput->setMaxLabelLength(4);
heightInput->setAllowedChars("0123456789");
heightInput->setString(mod->getSavedValue<std::string>("render_height").c_str());
heightInput->setDelegate(this);
Expand All @@ -811,7 +810,6 @@ bool RecordLayer::setup() {
bitrateInput->setContentSize({ 32, 20 });
bitrateInput->setTouchEnabled(true);
bitrateInput->setAllowedChars("0123456789");
bitrateInput->setMaxLabelLength(3);
bitrateInput->setString(mod->getSavedValue<std::string>("render_bitrate").c_str());
bitrateInput->setDelegate(this);
menu->addChild(bitrateInput);
Expand Down Expand Up @@ -870,7 +868,6 @@ bool RecordLayer::setup() {
fpsInput->setMouseEnabled(true);
fpsInput->setTouchEnabled(true);
fpsInput->setContentSize({ 32, 20 });
fpsInput->setMaxLabelLength(3);
fpsInput->setAllowedChars("0123456789");
fpsInput->setString(mod->getSavedValue<std::string>("render_fps").c_str());
fpsInput->setDelegate(this);
Expand Down

0 comments on commit 2d64035

Please sign in to comment.