Skip to content

Commit

Permalink
add option for solid wave trail
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcryostat committed Apr 24, 2024
1 parent 440ea39 commit 31176a2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
31 changes: 31 additions & 0 deletions src/solid_trail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifndef GEODE_IS_MACOS

#include <Geode/Geode.hpp>
#include <Geode/modify/CCDrawNode.hpp>

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<bool>("solid-wave-trail");

if (typeinfo_cast<HardStreak*>(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

0 comments on commit 31176a2

Please sign in to comment.