Skip to content

Commit

Permalink
add some features
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBearodactyl committed Aug 10, 2024
1 parent ca70733 commit 4ae2edf
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
14 changes: 13 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "3.2.0",
"geode": "3.4.0",
"gd": {
"win": "2.206",
"android": "2.206",
Expand Down Expand Up @@ -50,6 +50,18 @@
"slider-step": 0.1
}
},
"persist-wave-trail": {
"name": "Keep going...",
"description": "Insted of just \"oh yes\", it's now \"oh yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-\" (makes the wave trail stay after exiting the wave)",
"type": "bool",
"default": true
},
"editor-trail": {
"name": "But can you eetitor deez NUTS",
"description": "(Show the trail in the editor)",
"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)",
Expand Down
50 changes: 50 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#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/section.hpp"
Expand Down Expand Up @@ -148,6 +150,54 @@ struct MyPlayLayer : Modify<MyPlayLayer, PlayLayer> {
}
};

/* persist wave trail */
struct MyMotionStreak : Modify<MyMotionStreak, CCMotionStreak> {
struct Fields {
int update = 3;
};

virtual void update(float delta) {
if (Mod::get()->getSettingValue<bool>("persist-wave-trail")) {
if (m_fields->update != 3) {
m_fields->update++;
return;
} else {
m_fields->update = 0;
CCMotionStreak::update(delta);
}
}
}
};

/* editor trail */
class $modify(HardStreak) {
void updateStroke(float p0) {
if (LevelEditorLayer::get() && Mod::get()->getSettingValue<bool>("editor-trail")) {
m_drawStreak = true;
}

HardStreak::updateStroke(p0);
}
};

class $modify(PlayerObject) {
void placeStreakPoint() {
if (LevelEditorLayer::get() && m_isDart && Mod::get()->getSettingValue<bool>("editor-trail")) {
m_waveTrail->addPoint(this->getPosition());
} else {
PlayerObject::placeStreakPoint();
}
}

virtual void update(float dt) {
PlayerObject::update(dt);

if (LevelEditorLayer::get() && Mod::get()->getSettingValue<bool>("editor-trail")) {
m_waveTrail->m_currentPoint = this->getPosition();
}
}
};

$on_mod(Loaded) {
Mod::get()->addCustomSetting<SettingSectionValue>("gaydient-section", "none");
Mod::get()->addCustomSetting<SettingSectionValue>("chaos-section", "none");
Expand Down

0 comments on commit 4ae2edf

Please sign in to comment.