forked from EclipseMenu/EclipseMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'EclipseMenu:main' into main
- Loading branch information
Showing
12 changed files
with
334 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#include <modules/gui/gui.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("Bypass"); | ||
tab->addToggle("Allow Low Volume", "bypass.allowlowvolume") | ||
->handleKeybinds() | ||
->setDescription("Allows setting the volume lower than 3%."); | ||
} | ||
|
||
[[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 | ||
|
||
class $modify(OptionsLayer) { | ||
static void onModify(auto& self) { | ||
SAFE_PRIORITY("OptionsLayer::musicSliderChanged"); | ||
SAFE_PRIORITY("OptionsLayer::sfxSliderChanged"); | ||
} | ||
|
||
void musicSliderChanged(cocos2d::CCObject* sender) { | ||
if (!config::get<bool>("bypass.allowlowvolume", false)) | ||
return OptionsLayer::musicSliderChanged(sender); | ||
|
||
auto slider = GET_SLIDER(sender); | ||
auto value = slider->getValue(); | ||
auto* audioEngine = FMODAudioEngine::get(); | ||
float originalVolume = audioEngine->getBackgroundMusicVolume(); | ||
audioEngine->setBackgroundMusicVolume(value); | ||
if (originalVolume <= 0.f && value > 0.f) | ||
GameManager::get()->playMenuMusic(); | ||
} | ||
|
||
void sfxSliderChanged(cocos2d::CCObject* sender) { | ||
if (!config::get<bool>("bypass.allowlowvolume", false)) | ||
return OptionsLayer::sfxSliderChanged(sender); | ||
|
||
auto slider = GET_SLIDER(sender); | ||
auto value = slider->getValue(); | ||
FMODAudioEngine::get()->setEffectsVolume(value); | ||
} | ||
}; | ||
|
||
class $modify(PauseLayer) { | ||
static void onModify(auto& self) { | ||
SAFE_PRIORITY("PauseLayer::musicSliderChanged"); | ||
SAFE_PRIORITY("PauseLayer::sfxSliderChanged"); | ||
} | ||
|
||
void musicSliderChanged(cocos2d::CCObject* sender) { | ||
if (!config::get<bool>("bypass.allowlowvolume", false)) | ||
return PauseLayer::musicSliderChanged(sender); | ||
|
||
auto slider = GET_SLIDER(sender); | ||
auto value = slider->getValue(); | ||
FMODAudioEngine::get()->setBackgroundMusicVolume(value); | ||
} | ||
|
||
// 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) { | ||
if (!config::get<bool>("bypass.allowlowvolume", false)) | ||
return PauseLayer::sfxSliderChanged(sender); | ||
|
||
auto slider = GET_SLIDER(sender); | ||
auto value = slider->getValue(); | ||
FMODAudioEngine::get()->setEffectsVolume(value); | ||
} | ||
#endif | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <modules/gui/gui.hpp> | ||
#include <modules/hack/hack.hpp> | ||
#include <modules/config/config.hpp> | ||
|
||
#include <Geode/modify/CCTextInputNode.hpp> | ||
|
||
namespace eclipse::hacks::Bypass { | ||
|
||
class CharFilter : public hack::Hack { | ||
void init() override { | ||
auto tab = gui::MenuTab::find("Bypass"); | ||
tab->addToggle("Character Filter Bypass", "bypass.charfilter") | ||
->handleKeybinds() | ||
->setDescription("Allows you to bypass the character filter on any text field"); | ||
} | ||
|
||
[[nodiscard]] const char* getId() const override { return "Character Filter Bypass"; } | ||
}; | ||
|
||
REGISTER_HACK(CharFilter) | ||
|
||
class $modify(CCTextInputNode) { | ||
void updateLabel(gd::string str) { | ||
// im just gonna hope this is all of it | ||
if (config::get<bool>("bypass.charfilter", false)) setAllowedChars("`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,.+_|{}:?/!@#$%^&*()"); | ||
CCTextInputNode::updateLabel(str); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <modules/gui/gui.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("Bypass"); | ||
tab->addToggle("Character Limit Bypass", "bypass.charlimit") | ||
->handleKeybinds() | ||
->setDescription("Allows you to bypass the character limit of any text field"); | ||
} | ||
|
||
[[nodiscard]] const char* getId() const override { return "Character Limit Bypass"; } | ||
}; | ||
|
||
REGISTER_HACK(CharLimit) | ||
|
||
class $modify(CCTextInputNode) { | ||
void updateLabel(gd::string str) { | ||
if (config::get<bool>("bypass.charlimit", false)) setMaxLabelLength(99999); | ||
CCTextInputNode::updateLabel(str); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <modules/gui/gui.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("Bypass"); | ||
tab->addToggle("Checkpoint Limit", "bypass.checkpointlimit") | ||
->handleKeybinds() | ||
->setDescription("Allows you to place more than 50 checkpoints in practice mode."); | ||
} | ||
|
||
[[nodiscard]] const char* getId() const override { return "Checkpoint Limit"; } | ||
}; | ||
|
||
REGISTER_HACK(CheckpointLimit) | ||
|
||
class $modify(PlayLayer) { | ||
static void onModify(auto& self) { | ||
SAFE_PRIORITY("PlayLayer::storeCheckpoint"); | ||
} | ||
|
||
void storeCheckpoint(CheckpointObject* checkpointObject) { | ||
if (!config::get<bool>("bypass.checkpointlimit", false)) | ||
return PlayLayer::storeCheckpoint(checkpointObject); | ||
|
||
// Reimplemented without the checkpoint limit | ||
m_checkpointArray->addObject(checkpointObject); | ||
PlayLayer::addToSection(checkpointObject->m_physicalCheckpointObject); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include <modules/gui/gui.hpp> | ||
#include <modules/hack/hack.hpp> | ||
#include <modules/config/config.hpp> | ||
|
||
#ifdef __APPLE__ | ||
|
||
// silly goofy fix because it errors if it comes after geode includes | ||
#define CommentType CommentTypeDummy | ||
#include <CoreGraphics/CoreGraphics.h> | ||
#include <CoreServices/CoreServices.h> | ||
#undef CommentType | ||
|
||
#endif | ||
|
||
namespace eclipse::hacks::Global { | ||
|
||
class LockCursor : public hack::Hack { | ||
void init() override { | ||
auto tab = gui::MenuTab::find("Global"); | ||
tab->addToggle("Lock Cursor", "global.lockcursor")->handleKeybinds(); | ||
} | ||
|
||
void update() override { | ||
if (!PlayLayer::get()) return; | ||
|
||
#ifdef __APPLE__ | ||
|
||
if (!gui::Engine::get()->isToggled() && config::get<bool>("global.lockcursor") && !PlayLayer::get()->m_hasCompletedLevel && !PlayLayer::get()->m_isPaused) { | ||
CGEventRef ourEvent = CGEventCreate(NULL); | ||
auto point = CGEventGetLocation(ourEvent); | ||
CFRelease(ourEvent); | ||
|
||
CGWarpMouseCursorPosition(point); | ||
} | ||
|
||
#endif | ||
} | ||
|
||
[[nodiscard]] const char* getId() const override { return "Lock Cursor"; } | ||
}; | ||
|
||
REGISTER_HACK(LockCursor) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <modules/gui/gui.hpp> | ||
#include <modules/hack/hack.hpp> | ||
#include <modules/config/config.hpp> | ||
|
||
#include <Geode/modify/PlayLayer.hpp> | ||
|
||
namespace eclipse::hacks::Level { | ||
|
||
class ForcePlatformer : public hack::Hack { | ||
void init() override { | ||
auto tab = gui::MenuTab::find("Level"); | ||
tab->addToggle("Force Platformer", "level.forceplatformer")->handleKeybinds(); | ||
} | ||
|
||
[[nodiscard]] const char* getId() const override { return "Force Platformer"; } | ||
}; | ||
|
||
REGISTER_HACK(ForcePlatformer) | ||
|
||
class $modify(PlayLayer) { | ||
bool init(GJGameLevel* gj, bool p1, bool p2) { | ||
if (!PlayLayer::init(gj, p1, p2)) return false; | ||
if (!config::get<bool>("level.forceplatformer", false)) return true; | ||
|
||
if (m_player1) m_player1->togglePlatformerMode(true); | ||
if (m_player2) m_player2->togglePlatformerMode(true); | ||
|
||
return true; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <modules/gui/gui.hpp> | ||
#include <modules/hack/hack.hpp> | ||
#include <modules/config/config.hpp> | ||
|
||
#include <Geode/modify/GJBaseGameLayer.hpp> | ||
|
||
namespace eclipse::hacks::Level { | ||
|
||
class PlatGamemodes : public hack::Hack { | ||
void init() override { | ||
auto tab = gui::MenuTab::find("Level"); | ||
tab->addToggle("All Modes in Platformer", "level.platgamemodes")->handleKeybinds(); | ||
} | ||
|
||
[[nodiscard]] const char* getId() const override { return "All Modes in Platformer"; } | ||
}; | ||
|
||
REGISTER_HACK(PlatGamemodes) | ||
|
||
class $modify(GJBaseGameLayer) { | ||
void collisionCheckObjects(PlayerObject* player, gd::vector<GameObject*>* gameObjects, int p2, float p3) { | ||
if (!config::get<bool>("level.platgamemodes", false)) | ||
return GJBaseGameLayer::collisionCheckObjects(player, gameObjects, p2, p3); | ||
|
||
bool isPlatformer = m_isPlatformer; | ||
m_isPlatformer = false; | ||
GJBaseGameLayer::collisionCheckObjects(player, gameObjects, p2, p3); | ||
m_isPlatformer = isPlatformer; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <modules/gui/gui.hpp> | ||
#include <modules/hack/hack.hpp> | ||
#include <modules/config/config.hpp> | ||
|
||
#include <Geode/modify/PlayerObject.hpp> | ||
#include <Geode/modify/GJBaseGameLayer.hpp> | ||
|
||
namespace eclipse::hacks::Player { | ||
|
||
class JumpHack : public hack::Hack { | ||
void init() override { | ||
auto tab = gui::MenuTab::find("Player"); | ||
tab->addToggle("Jump Hack", "player.jumphack") | ||
->setDescription("Allows the player to infinitely jump in the air") | ||
->handleKeybinds(); | ||
} | ||
|
||
[[nodiscard]] bool isCheating() override { return config::get<bool>("player.jumphack", false); } | ||
[[nodiscard]] const char* getId() const override { return "Jump Hack"; } | ||
}; | ||
|
||
REGISTER_HACK(JumpHack) | ||
|
||
bool jump = false; | ||
|
||
class $modify(GJBaseGameLayer) { | ||
void update(float dt) { | ||
if (config::get<bool>("player.jumphack", false) && jump) { | ||
if (m_player1) m_player1->m_isOnGround = true; | ||
if (m_player2) m_player2->m_isOnGround = true; | ||
} | ||
GJBaseGameLayer::update(dt); | ||
if (config::get<bool>("player.jumphack", false) && jump) { | ||
if (m_player1) m_player1->m_isOnGround = true; | ||
if (m_player2) m_player2->m_isOnGround = true; | ||
jump = false; | ||
} | ||
} | ||
}; | ||
|
||
class $modify(PlayerObject) { | ||
void pushButton(PlayerButton idk) { | ||
jump = true; | ||
PlayerObject::pushButton(idk); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters