diff options
| author | Crystalwarrior <Varsash@Gmail.com> | 2022-07-07 14:00:27 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-07 14:00:27 +0300 |
| commit | 758ea0c516eabe1743cd3af9ff04472eb62e7888 (patch) | |
| tree | daddedc7f080568e8de30e3f91f81fbaa57033c9 /src/path_functions.cpp | |
| parent | 06e8f82c878c91c75d93ef440505614bc1868bf8 (diff) | |
Add support for sounds/ subfolder in themes, misc and char folders (#732)
* Add support for sounds/ subfolder checking for character folder, themes and misc folder, replacing weird behavior where it would prefer an unorganized sound file in any of the above over the sound folder
* Revert "Add support for sounds/ subfolder checking for character folder, themes and misc folder, replacing weird behavior where it would prefer an unorganized sound file in any of the above over the sound folder"
This reverts commit 8dd5c8299676e7cd89644c85db622aa6048b8616.
* Implement a better method that doesn't break anything
That weird behavior I menteioned previously is what shouts rely on...
Diffstat (limited to 'src/path_functions.cpp')
| -rw-r--r-- | src/path_functions.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/path_functions.cpp b/src/path_functions.cpp index 575461f0..a8aae2e2 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -278,8 +278,13 @@ QString AOApplication::get_image(QString p_element, QString p_theme, QString p_s QString AOApplication::get_sfx(QString p_sfx, QString p_misc, QString p_character) { - QVector<VPath> pathlist = get_asset_paths(p_sfx, current_theme, get_subtheme(), default_theme, p_misc, p_character); - pathlist += get_sounds_path(p_sfx); // Sounds folder path + QVector<VPath> pathlist; + // Sounds subfolder is prioritized for organization sake + pathlist += get_asset_paths("sounds/" + p_sfx, current_theme, get_subtheme(), default_theme, p_misc, p_character); + // If sound subfolder not found, search just for SFX + pathlist += get_asset_paths(p_sfx, current_theme, get_subtheme(), default_theme, p_misc, p_character); + // If SFX not found, search base/sounds/general/ folder + pathlist += get_sounds_path(p_sfx); QString ret = get_sfx_path(pathlist); if (ret.isEmpty()) { qWarning().nospace() << "could not find sfx " << p_sfx |
