Skip to content

Commit

Permalink
and one more thing...
Browse files Browse the repository at this point in the history
  • Loading branch information
RayDeeUx committed Oct 25, 2024
1 parent 25bcc77 commit 870947f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)). <cy>Custom songs and NONGs will not return a song ID. They will fall back to its song name instead.</c> <cy>Button sprite adapted from [hiimjustin000](https://github.com/hiimjustin000) with permission.</c>
Expand Down
21 changes: 21 additions & 0 deletions src/FLAlertLayer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <Geode/modify/FLAlertLayer.hpp>
#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);
}
};
2 changes: 1 addition & 1 deletion src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(fmodResult));
fmod->m_backgroundMusicChannel->stop();
SongManager::get().pickRandomSong();
geode::log::info("is it over?");
Expand Down

0 comments on commit 870947f

Please sign in to comment.