Skip to content

Commit

Permalink
S Q U A S H
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBearodactyl committed Apr 25, 2024
0 parents commit b5749b3
Show file tree
Hide file tree
Showing 12 changed files with 409 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/multi-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build Geode Mod

on:
workflow_dispatch:
push:
branches:
- "**"

jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: Windows
os: windows-latest

- name: macOS
os: macos-latest

- name: Android32
os: ubuntu-latest
target: Android32

- name: Android64
os: ubuntu-latest
target: Android64

name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v4

- name: Build the mod
uses: geode-sdk/build-geode-mod@main
with:
combine: true
target: ${{ matrix.config.target }}

package:
name: Package builds
runs-on: ubuntu-latest
needs: ['build']

steps:
- uses: geode-sdk/build-geode-mod/combine@main
id: build

- uses: actions/upload-artifact@v4
with:
name: Build Output
path: ${{ steps.build.outputs.build-output }}
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Macos be like
**/.DS_Store

# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# Ignore build folders
**/build
# Ignore platform specific build folders
build-*/

# Workspace files are user-specific
*.sublime-workspace

# ILY vscode
**/.vscode
.idea/

# clangd
.cache/

# Visual Studio
.vs/
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_COMPILER_LAUNCHER "sccache")
set(CMAKE_C_COMPILER_LAUNCHER "sccache")

project(gay-wave-trail VERSION 1.0.0)

file(GLOB_RECURSE SOURCES
src/*.cpp
)

add_library(${PROJECT_NAME} SHARED ${SOURCES}
src/rainbow_trail.hpp
src/rainbow_trail.cpp)

if (NOT DEFINED ENV{GEODE_SDK})
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
else()
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
endif()

add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)

setup_geode_mod(${PROJECT_NAME})
1 change: 1 addition & 0 deletions README.md
4 changes: 4 additions & 0 deletions about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Transform your wave trail into a
# _***R A G I N G H O M O S E X U A L***_

thanks to shadowforce78 for the hsv_to_rgb logic :D
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"geode": "2.0.0-beta.25",
"gd": {
"win": "2.204",
"mac": "2.200",
"android": "2.205"
},
"version": "v1.0.13",
"id": "the_bearodactyl.gay-wave-trail",
"name": "Gay Wave Trail",
"developer": "The Bearodactyl",
"description": "make your wave trail a raging homosexual >:3",
"settings": {
"enable": {
"name": "Enable the G A E",
"type": "bool",
"description": "uwu",
"default": true
},
"speed": {
"name": "Sonic says: you've gotta be fast when\nyou're trying to pick up a femboy twink",
"type": "float",
"default": 10,
"min": 1,
"max": 100,
"control": {
"slider-step": 1
},
"description": "\n\nMy personal record for getting\na date with a buff furry dude\nis 0.8 seconds (real)"
},
"saturation": {
"name": "HOW GAY ARE YOU???????",
"type": "float",
"default": 100,
"min": 0,
"max": 100,
"control": {
"slider-step": 1
},
"description": "You think you're more fruity than me? wrong."
},
"mirror-players": {
"name": "You're fruity? OMG SAME",
"description": "It's like looking in a Bat-Mirror\n- Batman",
"type": "bool",
"default": true
},
"no-reg-trail": {
"name": "Don't be a coward. Be yourself without a disguise :)",
"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"
}
53 changes: 53 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include <Geode/Geode.hpp>
#include <Geode/cocos/include/ccTypes.h>
#include <Geode/loader/Mod.hpp>
#include <Geode/modify/CCMotionStreak.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/modify/PlayerObject.hpp>
#include "rainbow_trail.hpp"

using namespace geode::prelude;

class $modify(PlayerObject) {
void flashPlayer(float p0, float p1, cocos2d::ccColor3B mainColor, cocos2d::ccColor3B secondColor) {}
};

class $modify(PlayLayer) {
void postUpdate(float p0) {
PlayLayer::postUpdate(p0);

float speed = Mod::get()->getSettingValue<double>("speed");
float saturation = Mod::get()->getSettingValue<double>("saturation");
bool mirror_players = Mod::get()->getSettingValue<bool>("mirror-players");

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

_ccColor3B rainbowColor = RainbowTrail::get_rainbow(0, saturation);
_ccColor3B rainbowColor2 = RainbowTrail::get_rainbow(180, saturation);
_ccColor3B rainbowColor3 = RainbowTrail::get_rainbow(90, saturation);
bool enable = Mod::get()->getSettingValue<bool>("enable");
bool noRegularTrail = Mod::get()->getSettingValue<bool>("no-reg-trail");

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

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

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

if (m_player2->m_waveTrail) {
m_player2->m_waveTrail->setColor(!mirror_players ? rainbowColor2 : rainbowColor);
}
}
}
};
38 changes: 38 additions & 0 deletions src/pause_button.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/Modify.hpp>
#include <Geode/modify/PauseLayer.hpp>
#include <Geode/ui/GeodeUI.hpp>

using namespace geode::prelude;

struct GayPauseLayer : Modify<GayPauseLayer, PauseLayer> {
void onGaySettings(CCObject *object) {
geode::openSettingsPopup(Mod::get());
}

void customSetup() {
PauseLayer::customSetup();

auto winSize = CCDirector::sharedDirector()->getWinSize();
auto ccmenu = CCMenu::create();

ccmenu->setPosition(CCPoint{0, 0});
ccmenu->setID("gay-settings-button-menu"_spr);

auto *settingsButtonSprite = CCSprite::create("logo.png"_spr);

settingsButtonSprite->setScale(0.25f);

auto settingsBtn = CCMenuItemSpriteExtra::create(
settingsButtonSprite,
this,
menu_selector(GayPauseLayer::onGaySettings)
);

settingsBtn->setID("gay-settings-button"_spr);
settingsBtn->setPosition(CCPoint{ 40, 40 });
ccmenu->addChild(settingsBtn);

this->addChild(ccmenu);
}
};
72 changes: 72 additions & 0 deletions src/rainbow_trail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#include "rainbow_trail.hpp"

#include <cmath>

void RainbowTrail::hsv_to_rgb(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;

int hue_segment = static_cast<int>(fHPrime);
switch (hue_segment) {
case 0:
fR = fC;
fG = fX;
fB = 0;
break;
case 1:
fR = fX;
fG = fC;
fB = 0;
break;
case 2:
fR = 0;
fG = fC;
fB = fX;
break;
case 3:
fR = 0;
fG = fX;
fB = fC;
break;
case 4:
fR = fX;
fG = 0;
fB = fC;
break;
case 5:
fR = fC;
fG = 0;
fB = fX;
break;
default:
fR = 0;
fG = 0;
fB = 0;
break;
}

fR += fM;
fG += fM;
fB += fM;
}

float RainbowTrail::g = 0;

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

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

cocos2d::_ccColor3B out;
out.r = R * 255;
out.g = G * 255;
out.b = B * 255;
return out;
}
10 changes: 10 additions & 0 deletions src/rainbow_trail.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

#include <Geode/cocos/include/ccTypes.h>

class RainbowTrail {
public:
static void hsv_to_rgb(float &fR, float &fG, float &fB, float &fH, float &fS, float &fV);
static cocos2d::_ccColor3B get_rainbow(float offset, float saturation);
static float g;
};
Loading

0 comments on commit b5749b3

Please sign in to comment.