Skip to content

Commit

Permalink
fix: remove delete btn hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed Dec 28, 2024
1 parent 211c465 commit 22543d2
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/hooks/custom_song_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,23 @@ class $modify(JBSongWidget, CustomSongWidget) {
}
}

void onDelete(CCObject* obj) {
if (!m_fields->nongs) {
CustomSongWidget::onDelete(obj);
return;
}

if (!m_fields->nongs->isDefaultActive()) {
FLAlertLayer::create("Cannot delete",
"Cannot delete song while a NONG is set. "
"Change to default song first.",
"Ok")
->show();
} else {
CustomSongWidget::onDelete(obj);
}
}

void setupJBSW() {
SongInfoObject* obj = m_songInfoObject;
if (obj == nullptr) {
Expand Down Expand Up @@ -228,9 +245,6 @@ class $modify(JBSongWidget, CustomSongWidget) {

m_fields->nongs = nongs;
this->createSongLabels(nongs);
if (!nongs->isDefaultActive() && m_deleteBtn) {
m_deleteBtn->setVisible(false);
}
}

void updateSongInfo() {
Expand Down

0 comments on commit 22543d2

Please sign in to comment.