Skip to content

Commit 374d86e

Browse files
committed
yknow what fuck this
1 parent 5206fc0 commit 374d86e

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

src/GameManager.cpp

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,20 @@
55
using namespace geode::prelude;
66

77
class $modify(MenuLoopGMHook, GameManager) {
8-
static void onModify(auto& self) {
9-
(void) self.setHookPriority("GameManger::getMenuMusicFile", -3999);
10-
(void) self.setHookPriority("GameManger::playMenuMusic", -3999);
11-
(void) self.setHookPriority("GameManger::fadeInMenuMusic", -3999);
12-
}
138
gd::string getMenuMusicFile() {
149
return SongManager::get().getCurrentSong();
1510
}
16-
void playMenuMusic() {
17-
// manual reconstruction
18-
FMODAudioEngine* fmod = FMODAudioEngine::get();
19-
if (VANILLA_GD_MENU_LOOP_DISABLED) return fmod->stopAllMusic(true);
20-
if (!fmod->isMusicPlaying(GameManager::get()->getMenuMusicFile(), 0)) fmod->playMusic(GameManager::get()->getMenuMusicFile(), true, 0, 0);
21-
}
2211
void fadeInMenuMusic() {
2312
// code taken verbatim from colon. i've had two too many toddlers nagging me to add this feature to the mod now so here we are
2413
FMODAudioEngine* fmod = FMODAudioEngine::get();
25-
if (VANILLA_GD_MENU_LOOP_DISABLED) return fmod->stopAllMusic(true);
26-
2714
SongManager& songManager = SongManager::get();
28-
15+
const auto oldTrack = fmod->getActiveMusic(0);
16+
GameManager::fadeInMenuMusic();
2917
// ensure compat with colon
3018
const geode::Mod* colon = songManager.getColonMenuLoopStartTime();
31-
if (colon && colon->getSettingValue<bool>("enable")) return GameManager::fadeInMenuMusic();
32-
33-
// manual function reconstruction
34-
const auto oldTrack = fmod->getActiveMusic(0);
35-
if (!fmod->isMusicPlaying(GameManager::get()->getMenuMusicFile(), 0)) fmod->playMusic(GameManager::get()->getMenuMusicFile(), true, 1, 0);
36-
37-
if (!songManager.getShouldRestoreMenuLoopPoint() || oldTrack == fmod->getActiveMusic(0)) return;
19+
if (colon && colon->getSettingValue<bool>("enable")) return;
20+
if (!songManager.getShouldRestoreMenuLoopPoint()) return;
21+
if (oldTrack == fmod->getActiveMusic(0)) return;
3822
songManager.restoreLastMenuLoopPosition();
3923
songManager.setShouldRestoreMenuLoopPoint(false);
4024
}

0 commit comments

Comments
 (0)