aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-05-16 17:32:39 -0500
committerGitHub <noreply@github.com>2021-05-16 17:32:39 -0500
commite3730b5497052392e685539c5f6dbb03482c1ed3 (patch)
tree7cd2b43b77d9246c8b75539ece53d1258e3020f9
parentbea9fc1a0587cfafed43837543f9db30e515632f (diff)
parent167aae750f969cf00f64216ce7839366793c294f (diff)
Merge pull request #552 from AttorneyOnline/fix/effects2
Account for the difference between theme and misc pathing when getting image and sound data for effects
-rw-r--r--src/text_file_functions.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 712a63de..1d36689f 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -868,10 +868,13 @@ QString AOApplication::get_effect(QString effect, QString p_char,
if (p_folder == "")
p_folder = read_char_ini(p_char, "effects", "Options");
- QString p_path = get_image("effects/" + effect, current_theme, get_subtheme(), default_theme, p_folder);
+ QString p_path = get_image("effects/" + effect, current_theme, get_subtheme(), default_theme, "");
+ QString p_misc_path = get_image(effect, current_theme, get_subtheme(), default_theme, p_folder);
- if (!file_exists(p_path))
+ if (!file_exists(p_misc_path) && !file_exists(p_path))
return "";
+ else if (file_exists(p_misc_path))
+ return p_misc_path;
return p_path;
}
@@ -884,7 +887,9 @@ QString AOApplication::get_effect_property(QString fx_name, QString p_char,
else
f_property = fx_name + "_" + p_property;
- QString f_result = get_config_value(f_property, "effects/effects.ini", current_theme, get_subtheme(), default_theme, read_char_ini(p_char, "effects", "Options"));
+ QString f_result = get_config_value(f_property, "effects.ini", current_theme, get_subtheme(), default_theme, read_char_ini(p_char, "effects", "Options"));
+ if (f_result == "")
+ f_result = get_config_value(f_property, "effects/effects.ini", current_theme, get_subtheme(), default_theme, "");
if (fx_name == "realization" && p_property == "sound") {
f_result = get_custom_realization(p_char);
}