Skip to content

Commit

Permalink
fix; Crash on editor settings
Browse files Browse the repository at this point in the history
  • Loading branch information
FlafyDev committed May 31, 2024
1 parent e3fa75a commit 707d6a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.1.2
###### 31-05-2024

- <cl>Fixed</c> a crash on Editor settings

## v0.1.1
###### 31-05-2024

Expand Down
15 changes: 9 additions & 6 deletions src/hooks/custom_song_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ struct ANCustomSongWidget : geode::Modify<ANCustomSongWidget, CustomSongWidget>
for (const auto &pair : m_songs) {
songIds.insert(pair.first);
}
songIds.insert(m_songInfoObject->m_songID);
if (m_songInfoObject != nullptr) {
songIds.insert(m_songInfoObject->m_songID);
}
return songIds;
}

void updateSongInfo() {
CustomSongWidget::updateSongInfo();
if (!m_fields->m_showNong) {
m_fields->m_showColored = AutoNongManager::get()->anySongExists(getSongIds());
m_fields->m_showNong = !m_isMusicLibrary && !m_showPlayMusicBtn &&
GameManager::get()->m_levelEditorLayer == nullptr &&
(Mod::get()->getSettingValue<bool>("always-show-auto-nong-btn") ||
m_fields->m_showColored);
bool showAny = !m_isMusicLibrary && !m_showPlayMusicBtn &&
GameManager::get()->m_levelEditorLayer == nullptr;
m_fields->m_showColored = showAny && AutoNongManager::get()->anySongExists(getSongIds());
m_fields->m_showNong =
showAny && (Mod::get()->getSettingValue<bool>("always-show-auto-nong-btn") ||
m_fields->m_showColored);
if (m_fields->m_showNong) {
if (m_fields->m_showColored) {
this->scheduleOnce(schedule_selector(ANCustomSongWidget::showPopup), 0.2);
Expand Down

0 comments on commit 707d6a9

Please sign in to comment.