Support for DRO's sounds.ini as a fallback if soundlist.ini is not found for the character (#731)

* Support for DRO's sounds.ini as a fallback if soundlist.ini is not found for the character

* readability i guess?

Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>

Co-authored-by: stonedDiscord <Tukz@gmx.de>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
This commit is contained in:
Crystalwarrior 2022-07-07 13:59:50 +03:00 committed by GitHub
parent d458345612
commit 06e8f82c87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4509,6 +4509,12 @@ void Courtroom::set_sfx_dropdown()
sound_list = ao_app->get_list_file( sound_list = ao_app->get_list_file(
ao_app->get_character_path(current_char, "soundlist.ini")); ao_app->get_character_path(current_char, "soundlist.ini"));
// If AO2 sound list is empty, try to find the DRO one.
if (sound_list.isEmpty()) {
sound_list = ao_app->get_list_file(
ao_app->get_character_path(current_char, "sounds.ini"));
}
// Append default sound list after the character sound list. // Append default sound list after the character sound list.
sound_list += ao_app->get_list_file( sound_list += ao_app->get_list_file(
ao_app->get_base_path() + "soundlist.ini"); ao_app->get_base_path() + "soundlist.ini");
@ -4574,6 +4580,10 @@ void Courtroom::on_sfx_play_clicked()
void Courtroom::on_sfx_edit_requested() void Courtroom::on_sfx_edit_requested()
{ {
QString p_path = ao_app->get_real_path(ao_app->get_character_path(current_char, "soundlist.ini")); QString p_path = ao_app->get_real_path(ao_app->get_character_path(current_char, "soundlist.ini"));
if (!file_exists(p_path)) {
p_path = ao_app->get_real_path(ao_app->get_character_path(current_char, "sounds.ini"));
}
if (!file_exists(p_path)) { if (!file_exists(p_path)) {
p_path = ao_app->get_base_path() + "soundlist.ini"; p_path = ao_app->get_base_path() + "soundlist.ini";
} }