aboutsummaryrefslogtreecommitdiff
path: root/src/courtroom.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2022-07-26 00:54:11 +0300
committerGitHub <noreply@github.com>2022-07-26 00:54:11 +0300
commitf8c2b1a2f06d2c2f99fa9eaa7b2334524823aac5 (patch)
tree2c1895467a4c9eb681c99ac82d187b15c67f8567 /src/courtroom.cpp
parent0dac3cc2c017e8c785cb00c340ea37e050eb6366 (diff)
Part 2 of #713: merge get_real_suffixed_path into get_real_path (#717)
* Fix get_real_suffixed_path existing, causing the previous PR to not function on suffixed... anything Fix suffixes ignoring a case where a suffixed path is already provided, causing that pre-suffixed filepath to fail to find anything * Fix image paths being used as sound effects and vice versa Better check for sfx and image absolute paths which double-checks the absolute path we got is *actually a valid file format* Co-authored-by: stonedDiscord <Tukz@gmx.de> Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
Diffstat (limited to 'src/courtroom.cpp')
-rw-r--r--src/courtroom.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 1884c7c8..fdb16132 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -4695,22 +4695,9 @@ void Courtroom::set_effects_dropdown()
ui_effects_dropdown->show();
ui_effects_dropdown->addItems(effectslist);
- // ICON-MAKING HELL
- QString p_effect = ao_app->read_char_ini(current_char, "effects", "Options");
- VPath custom_path("misc/" + p_effect + "/icons/");
- VPath theme_path = ao_app->get_theme_path("effects/icons/");
- VPath default_path = ao_app->get_theme_path("effects/icons/", "default");
+ // Make the icons
for (int i = 0; i < ui_effects_dropdown->count(); ++i) {
- VPath entry = VPath(ui_effects_dropdown->itemText(i));
- QString iconpath = ao_app->get_image_suffix(custom_path + entry);
- if (!file_exists(iconpath)) {
- iconpath = ao_app->get_image_suffix(theme_path + entry);
- if (!file_exists(iconpath)) {
- iconpath = ao_app->get_image_suffix(default_path + entry);
- if (!file_exists(iconpath))
- continue;
- }
- }
+ QString iconpath = ao_app->get_effect("icons/" + ui_effects_dropdown->itemText(i), current_char, "");
ui_effects_dropdown->setItemIcon(i, QIcon(iconpath));
}