diff options
| author | Crystalwarrior <Varsash@Gmail.com> | 2022-07-07 13:59:50 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-07 13:59:50 +0300 |
| commit | 06e8f82c878c91c75d93ef440505614bc1868bf8 (patch) | |
| tree | 1a4c5e3c490a33c8cf0398f1b7164ecfaf224a2f | |
| parent | d45834561211bae5525135294f2f5e732ba80854 (diff) | |
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>
| -rw-r--r-- | src/courtroom.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp index fe3517d1..da891168 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -4509,6 +4509,12 @@ void Courtroom::set_sfx_dropdown() sound_list = ao_app->get_list_file( 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. sound_list += ao_app->get_list_file( ao_app->get_base_path() + "soundlist.ini"); @@ -4575,6 +4581,10 @@ void Courtroom::on_sfx_edit_requested() { 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)) { p_path = ao_app->get_base_path() + "soundlist.ini"; } QDesktopServices::openUrl(QUrl::fromLocalFile(p_path)); |
