diff --git a/mod.json b/mod.json index bb868c3..af2ce88 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "3.2.0", + "geode": "3.4.0", "gd": { "win": "2.206", "android": "2.206", @@ -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)", diff --git a/src/main.cpp b/src/main.cpp index 98f5918..ba6a3d1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,8 +6,10 @@ #include #include #include +#include #include +#include "Geode/cocos/misc_nodes/CCMotionStreak.h" #include "Geode/loader/ModEvent.hpp" #include "Geode/modify/Modify.hpp" #include "settings/section.hpp" @@ -148,6 +150,54 @@ struct MyPlayLayer : Modify { } }; +/* persist wave trail */ +struct MyMotionStreak : Modify { + struct Fields { + int update = 3; + }; + + virtual void update(float delta) { + if (Mod::get()->getSettingValue("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("editor-trail")) { + m_drawStreak = true; + } + + HardStreak::updateStroke(p0); + } +}; + +class $modify(PlayerObject) { + void placeStreakPoint() { + if (LevelEditorLayer::get() && m_isDart && Mod::get()->getSettingValue("editor-trail")) { + m_waveTrail->addPoint(this->getPosition()); + } else { + PlayerObject::placeStreakPoint(); + } + } + + virtual void update(float dt) { + PlayerObject::update(dt); + + if (LevelEditorLayer::get() && Mod::get()->getSettingValue("editor-trail")) { + m_waveTrail->m_currentPoint = this->getPosition(); + } + } +}; + $on_mod(Loaded) { Mod::get()->addCustomSetting("gaydient-section", "none"); Mod::get()->addCustomSetting("chaos-section", "none");