Skip to content

Commit

Permalink
android? you ok, buddy?
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 bba065a commit 8c21807
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ void Utils::playlistModeNewSong() {
fmod->m_backgroundMusicChannel->stop();
SongManager::get().pickRandomSong();
geode::log::info("is it over?");
if (SongManager::get().getCalledOnce()) fmod->playMusic(SongManager::get().getCurrentSong(), true, 1.0f, 1);
else {
if (SongManager::get().getCalledOnce()) {
geode::log::info("playing song as normal");
fmod->playMusic(SongManager::get().getCurrentSong(), true, 1.0f, 1);
} else {
std::string lastSong = geode::Mod::get()->getSavedValue<std::string>("lastMenuLoop");
fmod->playMusic(lastSong, true, 1.0f, 1);
geode::log::info("playing song from saved value: {}", lastSong);
SongManager::get().setCalledOnce(true);
SongManager::get().setCurrentSong(lastSong);
fmod->playMusic(lastSong, true, 1.0f, 1);
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ void populateVector(bool customSongs) {
std::string lastMenuLoop = Mod::get()->getSavedValue<std::string>("lastMenuLoop");
bool saveSongOnGameClose = Utils::getBool("saveSongOnGameClose");
bool loopExists = std::filesystem::exists(lastMenuLoop);
log::debug("\n=== 'REMEMBER LAST MENU LOOP' DEBUG INFO ===\nlast menu loop: {}\n'saveSongOnGameClose' setting: {}\nloopExists: {}", lastMenuLoop, saveSongOnGameClose, loopExists);
log::info("\n=== 'REMEMBER LAST MENU LOOP' DEBUG INFO ===\nlast menu loop: {}\n'saveSongOnGameClose' setting: {}\nloopExists: {}", lastMenuLoop, saveSongOnGameClose, loopExists);
if (!lastMenuLoop.empty() && Utils::isSupportedExtension(lastMenuLoop) && loopExists && saveSongOnGameClose) {
songManager.setCurrentSongToSavedSong();
} else songManager.pickRandomSong();
} else {
songManager.pickRandomSong();
}

if (!std::filesystem::exists(configDir / R"(store_your_disabled_menuloops_here)")) {
std::filesystem::create_directory(configDir / R"(store_your_disabled_menuloops_here)");
Expand Down

0 comments on commit 8c21807

Please sign in to comment.