Skip to content

Commit

Permalink
Fix sound in the sound list using the alias of the sound list as the …
Browse files Browse the repository at this point in the history
…sound instead of its actual reference (#708)
  • Loading branch information
Crystalwarrior authored May 21, 2022
1 parent 6d1c8fd commit 1544d5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/courtroom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4517,7 +4517,7 @@ void Courtroom::set_sfx_dropdown()

// Append default sound list after the character sound list.
sound_list += ao_app->get_list_file(
ao_app->get_base_path() + "soundlist.ini");
ao_app->get_base_path() + "soundlist.ini");

QStringList display_sounds;
for (const QString &sound : qAsConst(sound_list)) {
Expand All @@ -4540,10 +4540,10 @@ void Courtroom::set_sfx_dropdown()

void Courtroom::on_sfx_dropdown_changed(int p_index)
{
custom_sfx = "";
ui_ic_chat_message->setFocus();
if (p_index == 0) {
ui_sfx_remove->hide();
custom_sfx = "";
}
}

Expand Down Expand Up @@ -4692,8 +4692,9 @@ QString Courtroom::get_char_sfx()
if (index == 0) { // Default
return ao_app->get_sfx_name(current_char, current_emote);
}
if (index == 1) // Nothing
if (index == 1) { // Nothing
return "1";
}
QString sfx = sound_list[index-2].split("=")[0].trimmed();
if (sfx == "")
return "1";
Expand Down

0 comments on commit 1544d5d

Please sign in to comment.