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...
This commit is contained in:
Crystalwarrior 2022-07-07 14:00:27 +03:00 committed by GitHub
parent 06e8f82c87
commit 758ea0c516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) 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); QVector<VPath> pathlist;
pathlist += get_sounds_path(p_sfx); // Sounds folder path // 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); QString ret = get_sfx_path(pathlist);
if (ret.isEmpty()) { if (ret.isEmpty()) {
qWarning().nospace() << "could not find sfx " << p_sfx qWarning().nospace() << "could not find sfx " << p_sfx