diff --git a/mod.json b/mod.json index e5d7b20..d9d89b3 100644 --- a/mod.json +++ b/mod.json @@ -50,6 +50,12 @@ "description": "in other words: don't be dream.", "type": "bool", "default": true + }, + "solid-wave-trail": { + "name": "Come out of the closet already,\nstop trying to blend in!", + "description": "\nfood processors are better than blenders anyways", + "type": "bool", + "default": true } }, "repository": "https://gitlab.com/TheBearodactyl/gay-wave-trail.git" diff --git a/src/solid_trail.cpp b/src/solid_trail.cpp new file mode 100644 index 0000000..191d4da --- /dev/null +++ b/src/solid_trail.cpp @@ -0,0 +1,31 @@ +#ifndef GEODE_IS_MACOS + +#include +#include + +using namespace geode::prelude; + +class $modify(CCDrawNode) { + bool drawPolygon(CCPoint *verts, unsigned int cnt, const ccColor4F &fillColor, float borderWidth, const ccColor4F &borderColor) { + bool solid_wave = Mod::get()->getSettingValue("solid-wave-trail"); + + if (typeinfo_cast(this)) { + if (solid_wave) { + if (fillColor.r >= 1.0f && fillColor.g >= 1.0f && fillColor.b >= 1.0f && this->getColor() != ccc3(255, 255, 255)) { + return true; + } + + if (this->getTag() != 1) { + this->setTag(1); + this->setBlendFunc(CCSprite::create()->getBlendFunc()); + } + + this->setZOrder(-1); + } + } + + return CCDrawNode::drawPolygon(verts, cnt, fillColor, borderWidth, borderColor); + } +}; + +#endif