Skip to content

Commit

Permalink
please say this fixed qolmod incompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dabewodactowluwu@gmail.com authored and dabewodactowluwu@gmail.com committed Apr 1, 2024
1 parent e795fed commit c31844c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 84 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ project(gay-wave-trail VERSION 1.0.0)

add_library(${PROJECT_NAME} SHARED
src/main.cpp
# Add your cpp files here
)

if (NOT DEFINED ENV{GEODE_SDK})
Expand Down
11 changes: 2 additions & 9 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "2.0.0-beta.22",
"geode": "2.0.0-beta.23",
"gd": {
"win": "2.204",
"mac": "2.200",
Expand Down Expand Up @@ -40,12 +40,5 @@
"description": "The larger the number, the better"
}
},
"repository": "https://github.com/TheBearodactyl/gay-wave-trail",
"incompatibilities": [
{
"id": "TheSillyDoggo.Cheats",
"importance": "breaking",
"version": "*"
}
]
"repository": "https://github.com/TheBearodactyl/gay-wave-trail"
}
30 changes: 0 additions & 30 deletions src/Utils.hpp

This file was deleted.

77 changes: 33 additions & 44 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,55 +1,44 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include <Geode/cocos/include/ccTypes.h>
#include <Geode/loader/Mod.hpp>
#include <Geode/modify/CCMotionStreak.hpp>

using namespace geode::prelude;

// thanks to shadowforce78
void HSVtoRGB(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV)
{
void HSVtoRGBbutDifferentIGuess(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV) {
float fC = fV * fS; // Chroma
float fHPrime = fmod(fH / 60.0, 6);
float fX = fC * (1 - fabs(fmod(fHPrime, 2) - 1));
float fM = fV - fC;

if (0 <= fHPrime && fHPrime < 1)
{
if (0 <= fHPrime && fHPrime < 1) {
fR = fC;
fG = fX;
fB = 0;
}
else if (1 <= fHPrime && fHPrime < 2)
{
} else if (1 <= fHPrime && fHPrime < 2) {
fR = fX;
fG = fC;
fB = 0;
}
else if (2 <= fHPrime && fHPrime < 3)
{
} else if (2 <= fHPrime && fHPrime < 3) {
fR = 0;
fG = fC;
fB = fX;
}
else if (3 <= fHPrime && fHPrime < 4)
{
} else if (3 <= fHPrime && fHPrime < 4) {
fR = 0;
fG = fX;
fB = fC;
}
else if (4 <= fHPrime && fHPrime < 5)
{
} else if (4 <= fHPrime && fHPrime < 5) {
fR = fX;
fG = 0;
fB = fC;
}
else if (5 <= fHPrime && fHPrime < 6)
{
} else if (5 <= fHPrime && fHPrime < 6) {
fR = fC;
fG = 0;
fB = fX;
}
else
{
} else {
fR = 0;
fG = 0;
fB = 0;
Expand All @@ -62,16 +51,16 @@ void HSVtoRGB(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV)

// thanks to shadowforce78
float g = 0;
cocos2d::_ccColor3B getRainbow(float offset, float saturation)
{

cocos2d::_ccColor3B getRainbow(float offset, float saturation) {
float R;
float G;
float B;

float hue = fmod(g + offset, 360);
float sat = saturation / 100.0;
float vc = 1;
HSVtoRGB(R, G, B, hue, sat, vc);
HSVtoRGBbutDifferentIGuess(R, G, B, hue, sat, vc);

cocos2d::_ccColor3B out;
out.r = R * 255;
Expand All @@ -90,30 +79,30 @@ class $modify(PlayerObject) {
class $modify(PlayLayer) {
void postUpdate(float p0) {
float speed = Mod::get()->getSettingValue<double>("speed");
float saturation = Mod::get() -> getSettingValue<double>("saturation");
float saturation = Mod::get() -> getSettingValue<double>("saturation");

if (g >= 360) {
g = 0;
} else {
g += speed / 10;
}

auto rainbowColor = getRainbow(0, saturation);
auto rainbowColor2 = getRainbow(180, saturation);
auto rainbowColor3 = getRainbow(90, saturation);
bool enable = Mod::get()->getSettingValue<bool>("enable");

if (enable == true) {
if (m_player1->m_waveTrail) {
m_player1->m_waveTrail->setColor(rainbowColor);
g = 0;
} else {
g += speed / 10;
}

if (m_player2->m_waveTrail) {
m_player2->m_waveTrail->setColor(rainbowColor2);
auto rainbowColor = getRainbow(0, saturation);
auto rainbowColor2 = getRainbow(180, saturation);
auto rainbowColor3 = getRainbow(90, saturation);

bool enable = Mod::get()->getSettingValue<bool>("enable");

if (enable == true) {
if (m_player1->m_waveTrail) {
m_player1->m_waveTrail->setColor(rainbowColor);
}

if (m_player2->m_waveTrail) {
m_player2->m_waveTrail->setColor(rainbowColor2);
}
}
}

PlayLayer::postUpdate(p0);

PlayLayer::postUpdate(p0);
}
};

0 comments on commit c31844c

Please sign in to comment.