diff --git a/changelog.md b/changelog.md index 5f9cf3f..ceccb26 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ - Redo the button for blacklisting songs. Base icon shape provided by [FREAKINGDAN](https://github.com/freakingdan). - Reduce confusion when copying song names/IDs while playing songs replaced by Jukebox/Auto Nong. {Reported by CyBlanc} - Fix a bug where some songs downloaded from vanilla GD wouldn't be treated properly in Playlist Mode (potentially related to "No Songs Limit" being enabled). {Reported by ita_player} +- Make the setting description for Playlist Mode a scrollable setting description. {Reported by hiimjustin000} - _Attempt_ to fix a bug where setting the music volume to 0 while on Playlist Mode would re-start a song while failing to end the original playback. {Reported by EmirNoob} # v1.6.0 - Added "Copy Song ID" button (suggested by [Akashnil](https://discord.com/users/1068096599701590056)). Custom songs and NONGs will not return a song ID. They will fall back to its song name instead. Button sprite adapted from [hiimjustin000](https://github.com/hiimjustin000) with permission. diff --git a/src/FLAlertLayer.cpp b/src/FLAlertLayer.cpp new file mode 100644 index 0000000..f3ec5b4 --- /dev/null +++ b/src/FLAlertLayer.cpp @@ -0,0 +1,21 @@ +#include +#include "Utils.hpp" + +#define PREFERRED_HOOK_PRIO (-2123456789) + +using namespace geode::prelude; + +class $modify(MyFLAlertLayer, FLAlertLayer) { + static void onModify(auto & self) + { + (void) self.setHookPriority("FLAlertLayer::init", PREFERRED_HOOK_PRIO); + } + bool init(FLAlertLayerProtocol* delegate, char const* title, gd::string desc, char const* btn1, char const* btn2, float width, bool scroll, float height, float textScale) { + const std::string& titleAsString = title; + const std::string& descAsString = desc; + if (!utils::string::contains(titleAsString, "Playlist Mode") && !utils::string::contains(descAsString, "Playlist Mode") && !utils::string::contains(descAsString, "Original idea by TheKevinner.") && !utils::string::contains(descAsString, "Known issues")) { + return FLAlertLayer::init(delegate, title, desc, btn1, btn2, width, scroll, height, textScale); + } + return FLAlertLayer::init(delegate, title, desc, btn1, btn2, 420.f, true, 320.f, 1.0f); + } +}; \ No newline at end of file diff --git a/src/Utils.cpp b/src/Utils.cpp index ad49cdd..2fb8ad6 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -69,7 +69,7 @@ void Utils::playlistModeNewSong() { auto fmod = FMODAudioEngine::sharedEngine(); float fmodIsCBrained; FMOD_RESULT fmodResult = fmod->m_backgroundMusicChannel->getVolume(&fmodIsCBrained); - if (fmod->m_musicVolume <= 0.0f || fmod->getBackgroundMusicVolume() <= 0.0f || fmodIsCBrained <= 0.0f) return geode::log::info(" --- !!! MISSION ABORT !!! ---\n\none of the following was at or below 0.0f:\nfmod->m_musicVolume: {}\nfmod->getBackgroundMusicVolume(): {}\nfmodIsCBrained: {} (with fmodResult {})", fmod->m_musicVolume, fmod->getBackgroundMusicVolume(), fmodIsCBrained, fmodResult); + if (fmod->m_musicVolume <= 0.0f || fmod->getBackgroundMusicVolume() <= 0.0f || fmodIsCBrained <= 0.0f) return geode::log::info(" --- !!! MISSION ABORT !!! ---\n\none of the following was at or below 0.0f:\nfmod->m_musicVolume: {}\nfmod->getBackgroundMusicVolume(): {}\nfmodIsCBrained: {} (with fmodResult {} as int)", fmod->m_musicVolume, fmod->getBackgroundMusicVolume(), fmodIsCBrained, static_cast(fmodResult)); fmod->m_backgroundMusicChannel->stop(); SongManager::get().pickRandomSong(); geode::log::info("is it over?");