From bba065a4b0f1970d2dbe226b486bd39804c46ee1 Mon Sep 17 00:00:00 2001 From: "Erymanthus[#5074] | (u/)RayDeeUx" <51521765+RayDeeUx@users.noreply.github.com> Date: Wed, 4 Sep 2024 17:56:14 -0400 Subject: [PATCH] sometimes all i think about is you Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com> --- src/SongManager.cpp | 4 ++++ src/SongManager.hpp | 1 + src/Utils.cpp | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SongManager.cpp b/src/SongManager.cpp index b5b807d..163b475 100644 --- a/src/SongManager.cpp +++ b/src/SongManager.cpp @@ -35,6 +35,10 @@ std::string SongManager::getCurrentSong() { return m_currentSong; } +void SongManager::setCurrentSong(std::string song) { + m_currentSong = song; +} + void SongManager::setCurrentSongToSavedSong() { m_currentSong = geode::Mod::get()->getSavedValue("lastMenuLoop"); } diff --git a/src/SongManager.hpp b/src/SongManager.hpp index a5817d9..29343d8 100644 --- a/src/SongManager.hpp +++ b/src/SongManager.hpp @@ -13,6 +13,7 @@ class SongManager { void pickRandomSong(); bool isOriginalMenuLoop(); std::string getCurrentSong(); + void setCurrentSong(std::string); void setCurrentSongToSavedSong(); void update(float); bool getCalledOnce(); diff --git a/src/Utils.cpp b/src/Utils.cpp index 6511dc4..0ed47e7 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -61,8 +61,10 @@ void Utils::playlistModeNewSong() { geode::log::info("is it over?"); if (SongManager::get().getCalledOnce()) fmod->playMusic(SongManager::get().getCurrentSong(), true, 1.0f, 1); else { - fmod->playMusic(geode::Mod::get()->getSavedValue("lastMenuLoop"), true, 1.0f, 1); + std::string lastSong = geode::Mod::get()->getSavedValue("lastMenuLoop"); + fmod->playMusic(lastSong, true, 1.0f, 1); SongManager::get().setCalledOnce(true); + SongManager::get().setCurrentSong(lastSong); } }