aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorin1tiate <32779090+in1tiate@users.noreply.github.com>2020-10-09 10:22:58 -0500
committerin1tiate <32779090+in1tiate@users.noreply.github.com>2020-10-09 10:22:58 -0500
commitf00801feb678ab1ee5935116694e2c95c254bf97 (patch)
treea2f0d449a205aca5fd0795db4e442baaea560a9c
parent849f91d991bf0e95d579df268e9ab358e09b1ac1 (diff)
add indicator when song is not found
-rw-r--r--src/courtroom.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index e8d32623..afacda09 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1533,9 +1533,8 @@ void Courtroom::on_chat_return_pressed()
return;
ui_ic_chat_message->blockSignals(true);
- QTimer::singleShot(600, this, [=] {
- ui_ic_chat_message->blockSignals(false);
- });
+ QTimer::singleShot(600, this,
+ [=] { ui_ic_chat_message->blockSignals(false); });
// MS#
// deskmod#
// pre-emote#
@@ -3159,8 +3158,12 @@ void Courtroom::handle_song(QStringList *p_contents)
}
music_player->play(f_song, channel, looping, effect_flags);
- if (channel == 0)
- ui_music_name->setText(f_song_clear);
+ if (channel == 0) {
+ if (file_exists(ao_app->get_sfx_suffix(ao_app->get_music_path(f_song))))
+ ui_music_name->setText(f_song_clear);
+ else
+ ui_music_name->setText("[MISSING] " + f_song_clear);
+ }
}
else {
QString str_char = char_list.at(n_char).name;
@@ -3191,8 +3194,12 @@ void Courtroom::handle_song(QStringList *p_contents)
append_ic_text(f_song_clear, str_show, tr("has played a song"));
music_player->play(f_song, channel, looping, effect_flags);
- if (channel == 0)
- ui_music_name->setText(f_song_clear);
+ if (channel == 0) {
+ if (file_exists(ao_app->get_sfx_suffix(ao_app->get_music_path(f_song))))
+ ui_music_name->setText(f_song_clear);
+ else
+ ui_music_name->setText("[MISSING] " + f_song_clear);
+ }
}
}
}