|
| 1 | +#include <modules/gui/gui.hpp> |
| 2 | +#include <modules/hack/hack.hpp> |
| 3 | +#include <modules/config/config.hpp> |
| 4 | + |
| 5 | +#include <Geode/Geode.hpp> |
| 6 | +#include <Geode/modify/CCDrawNode.hpp> |
| 7 | + |
| 8 | +using namespace geode::prelude; |
| 9 | + |
| 10 | +namespace eclipse::hacks::Player { |
| 11 | + |
| 12 | + class SolidWaveTrail : public hack::Hack { // Hack name and desciption |
| 13 | + void init() override { |
| 14 | + auto tab = gui::MenuTab::find("Player"); |
| 15 | + tab->addToggle("Solid Wave Trail", "player.solidwavetrail") |
| 16 | + ->setDescription("Makes the player wave trail a solid color") |
| 17 | + ->handleKeybinds(); |
| 18 | + } |
| 19 | + |
| 20 | + [[nodiscard]] const char* getId() const override { return "Solid Wave Trail"; } |
| 21 | + }; |
| 22 | + |
| 23 | + REGISTER_HACK(SolidWaveTrail) |
| 24 | + |
| 25 | + class $modify(SolidWaveTrailCCDNHook, cocos2d::CCDrawNode) { // The actual hack code, and yes it a taken from Prism Menu |
| 26 | + bool drawPolygon(cocos2d::CCPoint *p0, unsigned int p1, const cocos2d::ccColor4F &p2, float p3, const cocos2d::ccColor4F &p4) { |
| 27 | + if (!config::get<bool>("player.solidwavetrail", false)) |
| 28 | + return CCDrawNode::drawPolygon(p0,p1,p2,p3,p4); |
| 29 | + if (p2.r == 1.F && p2.g == 1.F && p2.b == 1.F && p2.a != 1.F) |
| 30 | + return true; |
| 31 | + this->setBlendFunc(CCSprite::create()->getBlendFunc()); |
| 32 | + this->setZOrder(-1); |
| 33 | + return CCDrawNode::drawPolygon(p0,p1,p2,p3,p4); |
| 34 | + } |
| 35 | + }; |
| 36 | + |
| 37 | +} |
0 commit comments