Skip to content

Commit

Permalink
ninxout loop added ggs :D
Browse files Browse the repository at this point in the history
  • Loading branch information
OmgRod committed Jan 18, 2025
1 parent d7c336e commit c9885fb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
6 changes: 6 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
]
},
"settings": {
"menu-loop": {
"name": "Menu Loop",
"description": "ninxout geode loop",
"type": "bool",
"default": true
},
"color-title": {
"type": "title",
"name": "Color Offset Settings"
Expand Down
5 changes: 3 additions & 2 deletions src/layers/GYSettingSelectLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ bool GYSettingSelectLayer::init() {
[&](CCMenuItemToggler* toggler) {
auto fmod = FMODAudioEngine::sharedEngine();
if (toggler->isOn()) {
fmod->playMusic("menuLoop.mp3", true, 0.f, 1);
Mod::get()->setSettingValue("menu-loop", false);
} else {
fmod->playMusic("ninxout.wav"_spr, true, 0.f, 1);
Mod::get()->setSettingValue("menu-loop", true);
}
fmod->playMusic("menuLoop.mp3", true, 0.5f, 1.0f);
}
);
leftMenu->addChild(geodeLoopToggle);
Expand Down
18 changes: 18 additions & 0 deletions src/modify/FMODAudioEngine.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "Geode/binding/FMODAudioEngine.hpp"
#include <Geode/Geode.hpp>
#include <Geode/modify/FMODAudioEngine.hpp>

using namespace geode::prelude;

class $modify(MyFMODAudioEngine, FMODAudioEngine) {
public:
void playMusic(gd::string name, bool shouldLoop, float fadeInTime, int channel) {
log::debug("Playing music: {}", name);
std::string newName = "ninxout.wav"_spr;
if ((name.find("menuLoop.mp3") != std::string::npos) && Mod::get()->getSettingValue<bool>("menu-loop")) {
name = newName;
log::debug("Changed music to: {}", name);
}
FMODAudioEngine::playMusic(name, shouldLoop, fadeInTime, channel);
}
};

0 comments on commit c9885fb

Please sign in to comment.