aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-18 05:45:02 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-18 05:45:02 +0300
commit2d329cdbd27c19d958275fbf1c6862135c96a395 (patch)
treeb05ec1dfd1a6da88ae668adb931d98c4ba78b442
parent9b0f07d125e423471665be9fa2895621969bacaf (diff)
Bugfixes for the thing and how it orders things
-rw-r--r--include/aoapplication.h2
-rw-r--r--src/text_file_functions.cpp22
2 files changed, 12 insertions, 12 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index 78de2b80..5fb63386 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -300,7 +300,7 @@ public:
int get_text_delay(QString p_char, QString p_emote);
//Get the effects folder referenced by the char.ini, read it and return the list of filenames in a string
- QStringList get_char_effects(QString p_char);
+ QStringList get_theme_effects();
//Get the theme's effects folder, read it and return the list of filenames in a string
QStringList get_effects(QString p_char);
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 261b0ffd..6c34c410 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -817,11 +817,15 @@ int AOApplication::get_text_delay(QString p_char, QString p_emote)
else return f_result.toInt();
}
-QStringList AOApplication::get_char_effects(QString p_char)
+QStringList AOApplication::get_theme_effects()
{
- QString p_effect = read_char_ini(p_char, "effects", "Options");
- QString p_path = get_base_path() + "misc/" + p_effect + "/effects.ini";
+ QString p_path = get_theme_path("effects/effects.ini");
+ QString default_path = get_default_theme_path("effects/effects.ini");
+ if (!file_exists(p_path))
+ {
+ p_path = default_path;
+ }
QStringList lines = read_file(p_path).split("\n");
QStringList effects;
@@ -837,16 +841,12 @@ QStringList AOApplication::get_char_effects(QString p_char)
QStringList AOApplication::get_effects(QString p_char)
{
- QString p_path = get_theme_path("effects/effects.ini");
- QString default_path = get_default_theme_path("effects/effects.ini");
+ QString p_effect = read_char_ini(p_char, "effects", "Options");
+ QString p_path = get_base_path() + "misc/" + p_effect + "/effects.ini";
- if (!file_exists(p_path))
- {
- p_path = default_path;
- }
QStringList lines = read_file(p_path).split("\n");
- QStringList effects = get_char_effects(p_char);
+ QStringList effects = get_theme_effects();
foreach (QString effect, lines)
{
effect = effect.split("=")[0].trimmed();
@@ -861,7 +861,7 @@ QStringList AOApplication::get_effects(QString p_char)
QString AOApplication::get_effect(QString effect, QString p_char)
{
QString p_effect = read_char_ini(p_char, "effects", "Options");
- QString p_path = get_image_suffix(get_base_path() + "misc/" + p_effect + effect);
+ QString p_path = get_image_suffix(get_base_path() + "misc/" + p_effect + "/" + effect);
QString design_ini_path = get_image_suffix(get_theme_path("effects/" + effect));
QString default_path = get_image_suffix(get_default_theme_path("effects/" + effect));