Skip to content

Commit

Permalink
finally add tags
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBearodactyl committed Nov 5, 2024
1 parent b0e16db commit 968f9c8
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
UseTab: Never
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
#set(GEODE_BINDINGS_REPO_PATH "D:\\Projects\\gay-wave-trail\\bindings\\")
set(GEODE_BINDINGS_REPO_PATH "D:\\Projects\\gay-wave-trail\\bindings\\")

project(gay-wave-trail VERSION 1.0.0)

Expand Down
51 changes: 49 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"android": "2.206",
"mac": "2.206"
},
"version": "v2.0.1",
"version": "v2.0.2",
"id": "the_bearodactyl.gay-wave-trail",
"name": "Gay Wave Trail",
"developer": "The Bearodactyl",
"description": "make your wave (and kayla) a raging homosexual >:3",
"tags": ["offline", "customization", "enhancement"],
"settings": {
"main-section": {
"type": "title",
Expand Down Expand Up @@ -44,6 +45,12 @@
"slider-step": 0.1
}
},
"smooth": {
"name": "Smoooooooooooooth",
"description": "When the trail's in the crib ma: Drop it like it's hot, Drop it like it's hot, Drop it like it's hot",
"type": "bool",
"default": true
},
"wave-trail-size": {
"name": "it even left a trail...",
"description": "that of which you can change the size...\n(sets the wave trail size)",
Expand Down Expand Up @@ -119,7 +126,12 @@
"name": "Colors",
"type": "custom",
"description": "the colors to use for the wave trail",
"default": ["#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF"]
"default": [
"#FFFFFF",
"#FFFFFF",
"#FFFFFF",
"#FFFFFF"
]
},
"chaos-section": {
"name": "The chaos emeralds (CHECK SETTING DESCRIPTIONS)",
Expand Down Expand Up @@ -232,6 +244,41 @@
"control": {
"slider-step": 0.01
}
},
"ambience-section": {
"name": "this ambience bouta put me in an ambulence",
"type": "custom",
"description": "lol",
"scale": 300,
"posX": 160
},
"ambience": {
"name": "Ambien.",
"description": "boutta overdose on the colors :DDDD (enable ambience for the wave trail)",
"type": "bool",
"default": false
},
"channel-begin": {
"name": "the pills",
"description": "the color channel the color finder will start on",
"type": "int",
"default": 1,
"min": 1,
"max": 9999,
"control": {
"slider-step": 1
}
},
"channel-end": {
"name": "the overdose",
"description": "the color channel the color finder will end on",
"type": "int",
"default": 5,
"min": 1,
"max": 9999,
"control": {
"slider-step": 1
}
}
},
"resources": {
Expand Down
60 changes: 46 additions & 14 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Geode/loader/Mod.hpp>
#include <Geode/loader/SettingEvent.hpp>
#include <Geode/modify/CCMotionStreak.hpp>
#include <Geode/modify/GJBaseGameLayer.hpp>
#include <Geode/modify/HardStreak.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/PlayerObject.hpp>
Expand All @@ -21,6 +22,19 @@ using namespace cocos2d;

float phase;

struct AmbientTrail : Modify<AmbientTrail, GJBaseGameLayer> {
std::vector<ccColor3B> get_cccolor3b_from_channel_id(int channel_begin, int channel_end) {
std::vector<ccColor3B> colors;
for (auto i = channel_begin; i < channel_end; i++) {
if (auto action = this->m_effectManager->getColorAction(i)) {
colors.emplace_back(action->m_color);
}
}

return colors;
}
};

struct MyPlayLayer : Modify<MyPlayLayer, PlayLayer> {
void postUpdate(float p0) {
PlayLayer::postUpdate(p0);
Expand All @@ -42,44 +56,61 @@ struct MyPlayLayer : Modify<MyPlayLayer, PlayLayer> {
bool noRegularTrail = Mod::get()->getSettingValue<bool>("no-reg-trail");
bool disable_trail = Mod::get()->getSettingValue<bool>("disable-wave-trail");
bool infinite_trail = Mod::get()->getSettingValue<bool>("infinite-trail");
bool ambient_trail = Mod::get()->getSettingValue<bool>("ambient-trail");
bool smooth_colors = Mod::get()->getSettingValue<bool>("smooth");
int channel_range_begin = Mod::get()->getSettingValue<int64_t>("channel-begin");
int channel_range_end = Mod::get()->getSettingValue<int64_t>("channel-end");


// Use delta time (p0) to make color changes framerate independent
float delta = p0;
if (ColorUtils::owo >= 360) {
ColorUtils::owo = 0;
} else {
ColorUtils::owo += (speed * delta); // Multiply by delta time
ColorUtils::owo += (speed * delta);// Multiply by delta time
}

// Update phase using delta time
phase = fmod(phase + (speed * delta), 360.f);
bool p2 = true;

RainbowTrail traill;
AmbientTrail ambience;

ccColor3B rainbowColor = RainbowTrail::get_rainbow(0, saturation);
ccColor3B rainbowColor2 = RainbowTrail::get_rainbow(180, saturation);
auto gradientColor = traill.get_gradient(phase, 0.0f, false, colors);
auto gradientColor2 = traill.get_gradient(phase + 180.0f, 0.0f, false, colors);
auto gradientColor = traill.get_gradient(phase, 0.0f, smooth_colors, colors);
auto gradientColor2 = traill.get_gradient(phase + 180.0f, 0.0f, smooth_colors, colors);

if (enable && m_player1->m_isDart) {
m_player1->m_regularTrail->setVisible(!noRegularTrail);
if (m_player1->m_waveTrail) {
m_player1->m_waveTrail->setColor(use_gradient ? gradientColor : rainbowColor);
m_player1->m_waveTrail->setVisible(!disable_trail);
m_player1->m_regularTrail->setVisible(! noRegularTrail);
if (m_player1->m_waveTrail) {
if (ambient_trail) {
this->m_player1->m_waveTrail->setColor(traill.get_gradient(phase, 0.0f, true, ambience.get_cccolor3b_from_channel_id(channel_range_begin, channel_range_end)));
} else {
m_player1->m_waveTrail->setColor(use_gradient ? gradientColor : rainbowColor);
m_player1->m_waveTrail->setVisible(! disable_trail);
}
}
}

if (enable && m_player2->m_isDart) {
m_player2->m_regularTrail->setVisible(!noRegularTrail);
if (m_player2->m_waveTrail) {
ccColor3B p2Color = mirror_players
? (use_gradient ? gradientColor : rainbowColor)
: (use_gradient ? gradientColor2 : rainbowColor2);
m_player2->m_waveTrail->setColor(p2Color);
m_player2->m_waveTrail->setVisible(!disable_trail);
m_player2->m_regularTrail->setVisible(! noRegularTrail);
if (m_player2->m_waveTrail) {
if (ambient_trail) {
this->m_player2->m_waveTrail->setColor(traill.get_gradient(phase, 0.0f, true, ambience.get_cccolor3b_from_channel_id(channel_range_begin, channel_range_end)));
} else {
ccColor3B p2Color = mirror_players
? (use_gradient ? gradientColor : rainbowColor)
: (use_gradient ? gradientColor2 : rainbowColor2);
m_player2->m_waveTrail->setColor(p2Color);
m_player2->m_waveTrail->setVisible(! disable_trail);
}
}
}


// Update phase using delta time
}

int get_player_set_color(bool player2) {
Expand Down Expand Up @@ -151,6 +182,7 @@ struct MyPlayerObject : Modify<MyPlayerObject, PlayerObject> {
$on_mod(Loaded) {
Mod::get()->addCustomSetting<SettingSectionValue>("gaydient-section", "none");
Mod::get()->addCustomSetting<SettingSectionValue>("chaos-section", "none");
Mod::get()->addCustomSetting<SettingSectionValue>("ambience-section", "none");
Mod::get()->addCustomSetting<MultiStringSettingValue>("colors-list",
Mod::get()->getSettingDefinition("colors-list")->get<CustomSetting>()->json->get<std::vector<std::string>>("default"));
}

0 comments on commit 968f9c8

Please sign in to comment.