Skip to content

Commit

Permalink
sometimes all i think about is you
Browse files Browse the repository at this point in the history
Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <[email protected]>
  • Loading branch information
RayDeeUx committed Sep 4, 2024
1 parent 9ba2846 commit bba065a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/SongManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("lastMenuLoop");
}
Expand Down
1 change: 1 addition & 0 deletions src/SongManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SongManager {
void pickRandomSong();
bool isOriginalMenuLoop();
std::string getCurrentSong();
void setCurrentSong(std::string);
void setCurrentSongToSavedSong();
void update(float);
bool getCalledOnce();
Expand Down
4 changes: 3 additions & 1 deletion src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>("lastMenuLoop"), true, 1.0f, 1);
std::string lastSong = geode::Mod::get()->getSavedValue<std::string>("lastMenuLoop");
fmod->playMusic(lastSong, true, 1.0f, 1);
SongManager::get().setCalledOnce(true);
SongManager::get().setCurrentSong(lastSong);
}
}

Expand Down

0 comments on commit bba065a

Please sign in to comment.