Bugfixes for the thing and how it orders things

This commit is contained in:
Crystalwarrior 2019-09-18 05:45:02 +03:00
parent 9b0f07d125
commit 2d329cdbd2
2 changed files with 12 additions and 12 deletions

View File

@ -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);

View File

@ -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));