Skip to content

Commit

Permalink
RAAAAAHHHHHHH
Browse files Browse the repository at this point in the history
RAAAAAHHHHHHH
  • Loading branch information
TheBearodactyl committed Nov 3, 2024
1 parent 575e149 commit 77878b7
Show file tree
Hide file tree
Showing 15 changed files with 641 additions and 173 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ build-*/

# Visual Studio
.vs/

bindings/
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +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\\")

project(gay-wave-trail VERSION 1.0.0)

Expand All @@ -14,6 +15,9 @@ file(
src/trail_customization/*.cpp
src/settings/*.cpp
src/ui/*.cpp
src/types/*.cpp
src/types/*.hpp
src/*.hpp
)

add_library(${PROJECT_NAME} SHARED ${SOURCES})
Expand Down
48 changes: 14 additions & 34 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "3.8.1",
"geode": "3.4.0",
"gd": {
"win": "2.206",
"android": "2.206",
Expand Down Expand Up @@ -67,12 +67,6 @@
"type": "bool",
"default": false
},
"rainbow-icon": {
"name": "First it was just the trail...",
"description": "NOW THE ICON TOO???\noh my fuckin sex, i\nam so dissapointed.\n(changes the wave icon color)",
"type": "bool",
"default": false
},
"saturation": {
"name": "HOW GAY ARE YOU???",
"type": "float",
Expand Down Expand Up @@ -109,44 +103,30 @@
"default": false
},
"gaydient-section": {
"type": "title",
"name": "Gaydient Settings",
"description": "make kayla gay"
"type": "custom",
"description": "make kayla gay",
"scale": 300,
"posX": 80
},
"use-gradient": {
"name": "Enable the GAYDIENT",
"description": "now with 4 colors! full 256\ncolor rainbow NO MORE\n(enables the usage of\nthe below custom colors\ninstead of a vanilla rainbow)",
"type": "bool",
"default": false
},
"color-one": {
"name": "Wave trail color #1",
"description": "The first color the wave trail will become",
"type": "color",
"default": "#FFFFFF"
},
"color-two": {
"name": "Wave trail color #2",
"description": "The second color the wave trail will become",
"type": "color",
"default": "#FFFFFF"
},
"color-three": {
"name": "Wave trail color #3",
"description": "The third color the wave trail will become",
"type": "color",
"default": "#FFFFFF"
},
"color-four": {
"name": "Wave trail color #4",
"description": "The fourth color the wave trail will become",
"type": "color",
"default": "#FFFFFF"
"colors-list": {
"name": "Colors",
"type": "custom",
"description": "the colors to use for the wave trail",
"default": ["#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF"]
},
"chaos-section": {
"name": "The chaos emeralds (CHECK SETTING DESCRIPTIONS)",
"type": "title",
"description": "make skylar gay"
"type": "custom",
"description": "make skylar gay",
"scale": 300,
"posX": 160
},
"chaos": {
"name": "THE CHAOS EMERALDS",
Expand Down
Binary file added resources/addIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions src/includes.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#pragma once

#include "Geode/loader/Log.hpp"
#include <Geode/Geode.hpp>
#include <Geode/Loader.hpp>
#include <Geode/binding/CCMenuItemSpriteExtra.hpp>
#include <Geode/binding/CCTextInputNode.hpp>
#include <Geode/binding/CustomSongWidget.hpp>
#include <Geode/binding/GameManager.hpp>
#include <Geode/binding/LevelEditorLayer.hpp>
#include <Geode/binding/Slider.hpp>
#include <Geode/binding/SliderThumb.hpp>
#include <Geode/binding/SongInfoObject.hpp>
#include <Geode/loader/Event.hpp>
#include <Geode/loader/Mod.hpp>
#include <Geode/loader/Setting.hpp>
#include <Geode/loader/SettingEvent.hpp>
#include <Geode/loader/SettingNode.hpp>
#include <Geode/modify/CustomSongWidget.hpp>
#include <Geode/modify/EditButtonBar.hpp>
#include <Geode/modify/EditLevelLayer.hpp>
#include <Geode/modify/EditorUI.hpp>
#include <Geode/modify/FMODAudioEngine.hpp>
#include <Geode/modify/GameManager.hpp>
#include <Geode/modify/IDManager.hpp>
#include <Geode/modify/LevelBrowserLayer.hpp>
#include <Geode/modify/LevelInfoLayer.hpp>
#include <Geode/modify/MenuLayer.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include <Geode/ui/BasedButtonSprite.hpp>
#include <Geode/ui/ColorPickPopup.hpp>
#include <Geode/ui/GeodeUI.hpp>
#include <Geode/ui/InputNode.hpp>
#include <Geode/ui/Popup.hpp>
#include <Geode/ui/TextInput.hpp>
#include <Geode/utils/Task.hpp>
#include <Geode/utils/cocos.hpp>
#include <Geode/utils/string.hpp>
#include <Geode/utils/web.hpp>
#include <matjson.hpp>

using namespace geode::prelude;
107 changes: 33 additions & 74 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include <cmath>
#include <Geode/modify/HardStreak.hpp>
#include <cocos2d.h>

#include "Geode/cocos/misc_nodes/CCMotionStreak.h"
#include "Geode/loader/ModEvent.hpp"
#include "Geode/modify/Modify.hpp"
#include "settings/multi_string_setting.hpp"
#include "settings/section.hpp"
#include "trail_customization/rainbow_trail.hpp"
#include "utils/color_utils.hpp"

using namespace geode::prelude;
using namespace cocos2d;
Expand All @@ -27,19 +28,21 @@ struct MyPlayLayer : Modify<MyPlayLayer, PlayLayer> {
float speed = Mod::get()->getSettingValue<double>("speed");
float saturation = Mod::get()->getSettingValue<double>("saturation");

std::vector<std::string> color_strings = Mod::get()->getSettingValue<MultiStringSettingStruct>("colors-list").m_strings;

std::vector<cocos2d::ccColor3B> colors;

for (const auto &color_string: color_strings) {
colors.push_back(ColorUtils::hex_to_rgb(color_string));
}

bool mirror_players = Mod::get()->getSettingValue<bool>("mirror-players");
bool use_gradient = Mod::get()->getSettingValue<bool>("use-gradient");
bool enable = Mod::get()->getSettingValue<bool>("enable");
bool noRegularTrail = Mod::get()->getSettingValue<bool>("no-reg-trail");
bool rainbow_icon = Mod::get()->getSettingValue<bool>("rainbow-icon");
bool disable_trail = Mod::get()->getSettingValue<bool>("disable-wave-trail");
bool infinite_trail = Mod::get()->getSettingValue<bool>("infinite-trail");

auto color1 = Mod::get()->getSettingValue<ccColor3B>("color-one");
auto color2 = Mod::get()->getSettingValue<ccColor3B>("color-two");
auto color3 = Mod::get()->getSettingValue<ccColor3B>("color-three");
auto color4 = Mod::get()->getSettingValue<ccColor3B>("color-four");

if (ColorUtils::owo >= 360) {
ColorUtils::owo = 0;
} else {
Expand All @@ -49,76 +52,30 @@ struct MyPlayLayer : Modify<MyPlayLayer, PlayLayer> {
phase = fmod(phase + speed, 360.f);
bool p2 = true;

_ccColor3B rainbowColor = RainbowTrail::get_rainbow(0, saturation);
_ccColor3B rainbowColor2 = RainbowTrail::get_rainbow(180, saturation);

_ccColor3B gradientColor = RainbowTrail::get_gradient(phase, 0.0f, false, color1, color2, color3, color4);
_ccColor3B gradientColor2 = RainbowTrail::get_gradient(phase, 0.0f, false, color4, color3, color2, color1);
RainbowTrail traill;

if (m_player1->m_isDart && noRegularTrail) {
m_player1->m_regularTrail
->setVisible(false);
}
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);

if (m_player2->m_isDart && noRegularTrail) {
m_player2->m_regularTrail
->setVisible(false);
}

if (enable) {
if (! use_gradient) {
if (m_player1->m_waveTrail) {
m_player1->m_waveTrail
->setColor(rainbowColor);

if (rainbow_icon && m_player1->m_isDart) {
m_player1->setColor(rainbowColor);
}
}

if (m_player2->m_waveTrail) {
m_player2->m_waveTrail
->setColor(! mirror_players
? rainbowColor2
: rainbowColor);

if (rainbow_icon && m_player1->m_isDart) {
m_player2->setColor(rainbowColor2);
}
}
} else {
if (enable && m_player1->m_isDart) {
m_player1->m_regularTrail->setVisible(!noRegularTrail);
if (m_player1->m_waveTrail) {
m_player1->m_waveTrail
->setColor(gradientColor);

if (rainbow_icon && m_player1->m_isDart) {
m_player1->setColor(gradientColor);
} else if (! rainbow_icon) {
reset_colors();
}
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) {
m_player2->m_waveTrail
->setColor(! mirror_players
? gradientColor
: gradientColor2);

if (rainbow_icon && m_player2->m_isDart) {
m_player2->setColor(! mirror_players ? gradientColor : gradientColor2);
} else if (! rainbow_icon) {
reset_colors();
}
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);
}
}

if (disable_trail) {
this->m_player1->m_waveTrail->setVisible(false);
this->m_player2->m_waveTrail->setVisible(false);
} else {
this->m_player1->m_waveTrail->setVisible(true);
this->m_player2->m_waveTrail->setVisible(true);
}
}
}

Expand Down Expand Up @@ -153,14 +110,14 @@ struct MyPlayLayer : Modify<MyPlayLayer, PlayLayer> {
/* persist wave trail */
struct MyMotionStreak : Modify<MyMotionStreak, PlayerObject> {
void fadeOutStreak2(float p0) {
if (!Mod::get()->getSettingValue<bool>("persist-wave-trail")) {
if (! Mod::get()->getSettingValue<bool>("persist-wave-trail")) {
PlayerObject::fadeOutStreak2(p0);
}
}
};

/* editor trail */
class $modify(HardStreak) {
struct MyHardStreak : Modify<MyHardStreak, HardStreak> {
void updateStroke(float p0) {
if (LevelEditorLayer::get() && Mod::get()->getSettingValue<bool>("editor-trail")) {
m_drawStreak = true;
Expand All @@ -170,7 +127,7 @@ class $modify(HardStreak) {
}
};

class $modify(PlayerObject) {
struct MyPlayerObject : Modify<MyPlayerObject, PlayerObject> {
void placeStreakPoint() {
if (LevelEditorLayer::get() && m_isDart && Mod::get()->getSettingValue<bool>("editor-trail")) {
m_waveTrail->addPoint(this->getPosition());
Expand All @@ -191,4 +148,6 @@ class $modify(PlayerObject) {
$on_mod(Loaded) {
Mod::get()->addCustomSetting<SettingSectionValue>("gaydient-section", "none");
Mod::get()->addCustomSetting<SettingSectionValue>("chaos-section", "none");
}
Mod::get()->addCustomSetting<MultiStringSettingValue>("colors-list",
Mod::get()->getSettingDefinition("colors-list")->get<CustomSetting>()->json->get<std::vector<std::string>>("default"));
}
13 changes: 13 additions & 0 deletions src/settings/list_cell.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <Geode/binding/StatsCell.hpp>

#include "list_cell.hpp"

bool JBListCell::init(CCSize const &size) {
m_width = size.width;
m_height = size.height;
this->setContentSize(size);
this->setID("nong-list-cell");
return true;
}

void JBListCell::draw() { reinterpret_cast<StatsCell *>(this)->StatsCell::draw(); }
16 changes: 16 additions & 0 deletions src/settings/list_cell.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include <Geode/binding/FLAlertLayerProtocol.hpp>
#include <Geode/cocos/cocoa/CCGeometry.h>
#include <Geode/cocos/layers_scenes_transitions_nodes/CCLayer.h>

using namespace geode::prelude;

class JBListCell : public CCLayer, public FLAlertLayerProtocol {
protected:
float m_width;
float m_height;

bool init(CCSize const &size);
void draw() override;
};
Loading

0 comments on commit 77878b7

Please sign in to comment.