Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
blu3berryys authored Jan 2, 2025
2 parents 0b23e14 + 717a587 commit 30c3905
Show file tree
Hide file tree
Showing 187 changed files with 3,861 additions and 3,299 deletions.
6 changes: 4 additions & 2 deletions include/labels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
#include <string_view>
#include <concepts>
#include <Geode/loader/Event.hpp>
#include <matjson.hpp>

namespace eclipse::label {

using null_t = std::monostate;

/// @brief Concept for supported types in the label system (bool, int64_t, double, std::string, RiftNull)
/// @brief Concept for supported types in the label system (bool, int64_t, double, std::string, RiftNull, matjson::Value)
template <typename T>
concept SupportedType = requires(T a) {
std::same_as<T, bool> || std::same_as<T, int64_t> || std::same_as<T, double> || std::same_as<T, std::string> || std::same_as<T, null_t>;
std::same_as<T, bool> || std::same_as<T, int64_t> || std::same_as<T, double> ||
std::same_as<T, std::string> || std::same_as<T, null_t> || std::same_as<T, matjson::Value>;
};

}
Expand Down
5 changes: 3 additions & 2 deletions resources/Languages/en.lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"global.lockcursor.desc": "Locks the cursor to the window when playing.",
"global.noshortnumbers": "No Short Numbers",
"global.noshortnumbers.desc": "Removes any number abbreviations. (Example: 23.4K -> 23400)",
"global.noshortnumbers.separator": "Thousands Separator",
"global.noshortnumbers.thousands": "Thousands Separator",
"global.pitchshift": "Pitch Shift",
"global.pitchshift.desc": "Changes the pitch of the audio.",
"global.autosafemode": "Auto Safe Mode",
Expand Down Expand Up @@ -434,7 +434,8 @@
"player.norespawnflash.desc": "Removes the blinking effect on respawn.",
"player.norobotfire": "No Robot Fire",
"player.norobotfire.desc": "Disables the robot's fire when jumping.",
"player.nospiderdash": "Disables the spider dash trail.",
"player.nospiderdash": "No Spider Dash",
"player.nospiderdash.desc": "Disables the spider dash trail.",
"player.notrail": "No Trail",
"player.notrail.desc": "Force the player trail off.",
"player.alwaystrail": "Always Show Trail",
Expand Down
6 changes: 5 additions & 1 deletion src/custom-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ class CustomButton : public SettingV3 {
void parseButtonCaption(matjson::Value const& json, std::string const& key) {
m_buttonCaption = json[key].asString().unwrap();
}

bool load(matjson::Value const& json) override { return true; }
bool save(matjson::Value& json) const override { return true; }
bool isDefaultValue() const override { return true; }
std::string const& getButtonCaption() const { return m_buttonCaption; }

void reset() override {}

SettingNodeV3* createNode(float width) override;
};

Expand Down Expand Up @@ -72,6 +75,7 @@ class CustomButtonNode : public SettingNodeV3 {
}

void onCommit() override {}

void onResetToDefault() override {}

public:
Expand Down Expand Up @@ -100,4 +104,4 @@ SettingNodeV3* CustomButton::createNode(float width) {
);
}

$execute { (void) Mod::get()->registerCustomSettingType("custom-btn", &CustomButton::parse); }
$execute { (void) Mod::get()->registerCustomSettingType("custom-btn", &CustomButton::parse); }
57 changes: 37 additions & 20 deletions src/hacks/Bot/Bot.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
#include <modules/gui/popup.hpp>
#include <modules/bot/bot.hpp>
#include <modules/config/config.hpp>
#include <modules/gui/gui.hpp>
#include <modules/gui/popup.hpp>
#include <modules/gui/components/button.hpp>
#include <modules/gui/components/filesystem-combo.hpp>
#include <modules/gui/components/radio.hpp>
#include <modules/hack/hack.hpp>
#include <modules/config/config.hpp>
#include <modules/bot/bot.hpp>
#include <modules/keybinds/manager.hpp>
#include <modules/i18n/translations.hpp>

#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include <Geode/modify/CheckpointObject.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include <Geode/modify/PlayLayer.hpp>

using namespace geode::prelude;

namespace eclipse::hacks::Bot {

static bot::Bot s_bot;

void newReplay() {
Popup::prompt(
i18n::get_("bot.new-replay"),
i18n::get_("bot.new-replay.msg"),
[&](bool result, std::string name) {
if(!result)
if (!result)
return;

s_bot.save(Mod::get()->getSaveDir() / "replays" / (name + ".gdr"));
Expand All @@ -41,22 +43,24 @@ namespace eclipse::hacks::Bot {

std::filesystem::path replayPath = config::get<std::filesystem::path>("bot.selectedreplay", "temp");

if(std::filesystem::exists(replayPath)) {
if (std::filesystem::exists(replayPath)) {
return Popup::create(
i18n::get_("common.warning"),
i18n::format("bot.overwrite", replayPath.filename().stem().string()),
i18n::get_("common.yes"),
i18n::get_("common.no"),
[&](bool result) {
if(!result)
if (!result)
return;

auto confirmReplayDirectory = config::get<std::filesystem::path>("bot.selectedreplay", "temp");

s_bot.save(confirmReplayDirectory);
Popup::create(
i18n::get_("bot.saved"),
i18n::format("bot.saved.msg", confirmReplayDirectory.filename().stem().string(), s_bot.getInputCount())
i18n::format(
"bot.saved.msg", confirmReplayDirectory.filename().stem().string(), s_bot.getInputCount()
)
);

config::set("bot.selectedreplay", confirmReplayDirectory);
Expand Down Expand Up @@ -89,14 +93,14 @@ namespace eclipse::hacks::Bot {
void loadReplay() {
std::filesystem::path replayPath = config::get<std::string>("bot.selectedreplay", "");

if(s_bot.getInputCount() > 0) {
if (s_bot.getInputCount() > 0) {
return Popup::create(
i18n::get_("common.warning"),
i18n::get_("bot.overwrite-current"),
i18n::get_("common.yes"),
i18n::get_("common.no"),
[&](bool result) {
if(!result)
if (!result)
return;

std::filesystem::path confirmReplayPath = config::get<std::string>("bot.selectedreplay", "");
Expand All @@ -111,7 +115,7 @@ namespace eclipse::hacks::Bot {

void deleteReplay() {
std::filesystem::path replayPath = config::get<std::string>("bot.selectedreplay", "");
if(!std::filesystem::exists(replayPath)) {
if (!std::filesystem::exists(replayPath)) {
return Popup::create(
i18n::get_("bot.delete-invalid"),
i18n::get_("bot.delete-invalid.msg")
Expand Down Expand Up @@ -140,7 +144,16 @@ namespace eclipse::hacks::Bot {

class Bot : public hack::Hack {
void init() override {
const auto updateBotState = [](int state) { s_bot.setState(static_cast<bot::State>(state)); };
const auto updateBotState = [](int state) {
static bool wasTps = eclipse::config::get<bool>("global.tpsbypass.toggle", true);
if(s_bot.getState() == bot::State::DISABLED)
wasTps = eclipse::config::get<bool>("global.tpsbypass.toggle", true);

s_bot.setState(static_cast<bot::State>(state));

if(state == 0)
eclipse::config::set("global.tpsbypass.toggle", wasTps);
};

config::setIfEmpty("bot.state", 0);
updateBotState(config::get<int>("bot.state", 0));
Expand All @@ -163,6 +176,7 @@ namespace eclipse::hacks::Bot {
// only check if we are in playback mode and there are inputs
return state == 2 && s_bot.getInputCount() != 0;
}

[[nodiscard]] const char* getId() const override { return "Bot"; }
};

Expand All @@ -182,8 +196,12 @@ namespace eclipse::hacks::Bot {
PlayLayer::resetLevel();

static Mod* cbfMod = geode::Loader::get()->getLoadedMod("syzzi.click_between_frames");
if (s_bot.getState() != bot::State::DISABLED && cbfMod)
cbfMod->setSettingValue<bool>("soft-toggle", true);
if (s_bot.getState() != bot::State::DISABLED) {
if(cbfMod)
cbfMod->setSettingValue<bool>("soft-toggle", true);

eclipse::config::set<bool>("global.tpsbypass.toggle", true);
}

if (s_bot.getState() == bot::State::RECORD) {
//gd does this automatically for holding but not releases so we do it manually
Expand Down Expand Up @@ -243,10 +261,9 @@ namespace eclipse::hacks::Bot {
if (s_bot.getState() != bot::State::RECORD)
return;

bool realPlayer1 = !m_levelSettings->m_twoPlayerMode || player1 || !m_gameState.m_isDualMode;
bool realPlayer1 = m_levelSettings->m_twoPlayerMode ? player1 : player1 || !m_gameState.m_isDualMode;

s_bot.recordInput(m_gameState.m_currentProgress, (PlayerButton) button, !realPlayer1, down);
}
};

}
17 changes: 7 additions & 10 deletions src/hacks/Bypass/AllowLowVolume.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
#include <modules/config/config.hpp>
#include <modules/gui/gui.hpp>
#include <modules/gui/components/toggle.hpp>
#include <modules/hack/hack.hpp>
#include <modules/config/config.hpp>

#include <Geode/modify/OptionsLayer.hpp>
#include <Geode/modify/PauseLayer.hpp>

namespace eclipse::hacks::Bypass {

class AllowLowVolume : public hack::Hack {
void init() override {
auto tab = gui::MenuTab::find("tab.bypass");

tab->addToggle("bypass.allowlowvolume")
->handleKeybinds()
->setDescription();
tab->addToggle("bypass.allowlowvolume")->handleKeybinds()->setDescription();
}

[[nodiscard]] const char* getId() const override { return "Allow Low Volume"; }
};

REGISTER_HACK(AllowLowVolume)

#define GET_SLIDER(sender) geode::cast::typeinfo_cast<SliderThumb*>(sender); if (!slider) return
#define GET_SLIDER(sender) geode::cast::typeinfo_cast<SliderThumb*>(sender); if (!slider) return

class $modify(AllowLowVolumeOLHook, OptionsLayer) {
ALL_DELEGATES_AND_SAFE_PRIO("bypass.allowlowvolume")
Expand Down Expand Up @@ -52,13 +49,13 @@ namespace eclipse::hacks::Bypass {
utils::get<FMODAudioEngine>()->setBackgroundMusicVolume(value);
}

// Function is merged with the one in OptionsLayer on Windows
#if !(defined(GEODE_IS_WINDOWS) && GEODE_COMP_GD_VERSION == 22060)
// Function is merged with the one in OptionsLayer on Windows
#if !(defined(GEODE_IS_WINDOWS) && GEODE_COMP_GD_VERSION == 22060)
void sfxSliderChanged(cocos2d::CCObject* sender) {
auto slider = GET_SLIDER(sender);
auto value = slider->getValue();
utils::get<FMODAudioEngine>()->setEffectsVolume(value);
}
#endif
#endif
};
}
15 changes: 6 additions & 9 deletions src/hacks/Bypass/CharacterFilter.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#include <modules/config/config.hpp>
#include <modules/gui/gui.hpp>
#include <modules/gui/components/toggle.hpp>
#include <modules/hack/hack.hpp>
#include <modules/config/config.hpp>

#include <Geode/modify/CCTextInputNode.hpp>
#include <utility>

namespace eclipse::hacks::Bypass {
#include <Geode/modify/CCTextInputNode.hpp>

namespace eclipse::hacks::Bypass {
class CharFilter : public hack::Hack {
void init() override {
auto tab = gui::MenuTab::find("tab.bypass");

tab->addToggle("bypass.charfilter")
->handleKeybinds()
->setDescription();
tab->addToggle("bypass.charfilter")->handleKeybinds()->setDescription();
}

[[nodiscard]] const char* getId() const override { return "Character Filter Bypass"; }
Expand All @@ -32,9 +30,8 @@ namespace eclipse::hacks::Bypass {
"`~[]{}/?.>,<\\|;:'\""
" "
);

CCTextInputNode::updateLabel(std::move(str));
}
};

}
10 changes: 3 additions & 7 deletions src/hacks/Bypass/CharacterLimit.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#include <modules/config/config.hpp>
#include <modules/gui/gui.hpp>
#include <modules/gui/components/toggle.hpp>
#include <modules/hack/hack.hpp>
#include <modules/config/config.hpp>

#include <Geode/modify/CCTextInputNode.hpp>

namespace eclipse::hacks::Bypass {

class CharLimit : public hack::Hack {
void init() override {
auto tab = gui::MenuTab::find("tab.bypass");

tab->addToggle("bypass.charlimit")
->handleKeybinds()
->setDescription();
tab->addToggle("bypass.charlimit")->handleKeybinds()->setDescription();
}

[[nodiscard]] const char* getId() const override { return "Character Limit Bypass"; }
Expand All @@ -28,5 +25,4 @@ namespace eclipse::hacks::Bypass {
CCTextInputNode::updateLabel(str);
}
};

}
10 changes: 3 additions & 7 deletions src/hacks/Bypass/CheckpointLimit.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#include <modules/config/config.hpp>
#include <modules/gui/gui.hpp>
#include <modules/gui/components/toggle.hpp>
#include <modules/hack/hack.hpp>
#include <modules/config/config.hpp>

#include <Geode/modify/PlayLayer.hpp>

namespace eclipse::hacks::Bypass {

class CheckpointLimit : public hack::Hack {
void init() override {
auto tab = gui::MenuTab::find("tab.bypass");

tab->addToggle("bypass.checkpointlimit")
->handleKeybinds()
->setDescription();
tab->addToggle("bypass.checkpointlimit")->handleKeybinds()->setDescription();
}

[[nodiscard]] const char* getId() const override { return "Checkpoint Limit"; }
Expand All @@ -29,5 +26,4 @@ namespace eclipse::hacks::Bypass {
PlayLayer::addToSection(checkpointObject->m_physicalCheckpointObject);
}
};

}
10 changes: 3 additions & 7 deletions src/hacks/Bypass/CommentHistory.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#include <modules/config/config.hpp>
#include <modules/gui/gui.hpp>
#include <modules/gui/components/toggle.hpp>
#include <modules/hack/hack.hpp>
#include <modules/config/config.hpp>

#include <Geode/modify/ProfilePage.hpp>

namespace eclipse::hacks::Bypass {

class CommentHistory : public hack::Hack {
void init() override {
auto tab = gui::MenuTab::find("tab.bypass");

tab->addToggle("bypass.commenthistory")
->handleKeybinds()
->setDescription();
tab->addToggle("bypass.commenthistory")->handleKeybinds()->setDescription();
}

[[nodiscard]] const char* getId() const override { return "Comment History Bypass"; }
Expand All @@ -30,5 +27,4 @@ namespace eclipse::hacks::Bypass {
score->m_commentHistoryStatus = originalCommentHistory;
}
};

}
Loading

0 comments on commit 30c3905

Please sign in to comment.