From 12fba87395df16d646d0932185e37e5ef7492e63 Mon Sep 17 00:00:00 2001 From: Erymanthus | RayDeeUx <51521765+RayDeeUx@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:20:15 -0400 Subject: [PATCH] address bugs found by `ita_player` and `cyblancgd` --- src/FMODAudioEngine.cpp | 4 ++-- src/Utils.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/FMODAudioEngine.cpp b/src/FMODAudioEngine.cpp index 3512142..bd0259f 100644 --- a/src/FMODAudioEngine.cpp +++ b/src/FMODAudioEngine.cpp @@ -32,7 +32,7 @@ class $modify(MenuLoopFMODHook, FMODAudioEngine) { return FMODAudioEngine::get()->playMusic(path, desiredShouldLoop, fadeInTime, channel); if (fadeInTime == 0 && gdStringSucks == "shop.mp3") return; if (shouldLoop && fadeInTime == 1.0f) { - if (!isMenuLoop) { + if (!isMenuLoop && !utils::string::contains(gdStringSucks, "/Library/Caches/")) { log::info("non-menu loop found while playlist mode is enabled: {}", gdStringSucks); return FMODAudioEngine::get()->playMusic(path, desiredShouldLoop, fadeInTime, channel); } @@ -44,7 +44,7 @@ class $modify(MenuLoopFMODHook, FMODAudioEngine) { */ log::info("menu loop detected."); desiredShouldLoop = false; - // TODO: maybe ifdef these few lines. it works on macos intel + // T0D0: maybe ifdef these few lines. it works on macos intel if (channel == 0) { log::info("attempted to loop menu music on channel zero! see if on windows or not. aborting early."); return; diff --git a/src/Utils.cpp b/src/Utils.cpp index 4159d50..923e9cc 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -334,7 +334,17 @@ SongInfoObject* Utils::getSongInfoObject() { std::string Utils::getSongName() { const auto songInfo = Utils::getSongInfoObject(); if (!songInfo) return ""; - return songInfo->m_songName; + std::string ret = songInfo->m_songName; + #ifndef __APPLE__ + if (geode::utils::string::contains(ret, "nong")) { + std::string instructions = "open File Explorer and visit AppData/Local/GeometryDash/geode/mods/fleym.nongd/nongs"; + #ifdef GEODE_IS_ANDROID + instructions = "open your file manager [preferably ZArchiver, otherwise you would need to close Geode/Geometry Dash] and visit Android/media/com.geode.launcher/save/geode/mods/fleym.nongd/nongs"; + #endif + return fmt::format("{} (To find this song, {})", ret, instructions); + } + #endif + return ret; } std::string Utils::getSongArtist() {