aboutsummaryrefslogtreecommitdiff
path: root/src/text_file_functions.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-12 15:40:19 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-12 15:40:19 +0300
commit3b415f5a7005fd0b42ba7ccbb9a8836746a72d41 (patch)
tree2b2547988abf6db0fd314ea2cd2f4fb56008b577 /src/text_file_functions.cpp
parent7e2ec58c7eb62077733f354764d0b729fe0e0a93 (diff)
Expand get_image_suffix to fall back on .png last
Reorganize the file_exists checks to be an array iterator instead for much less code duplication and easier ordering of priority Reorganize desk and set_image loading on AOScene class, resolve issues with last_image setting to prevent animations from being restarted when characters talk on the same pos in succession Apply get_image_suffix for seancestand and jurystand searches TODO: At the moment, if you feed a .png shout, it will send the "Done" signal on the first frame (frame 0), not showing you the .png image at all. The shout code should be reorganized to allow static images to be displayed for exactly 720ms - the standard AA objection length. Usage of the timer similarly to the realizationflash.png might be possible.
Diffstat (limited to 'src/text_file_functions.cpp')
-rw-r--r--src/text_file_functions.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 904e212f..afe7a674 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -385,13 +385,13 @@ QString AOApplication::get_sfx_suffix(QString sound_to_check)
QString AOApplication::get_image_suffix(QString path_to_check)
{
- QString webp_check = path_to_check + ".webp";
- QString apng_check = path_to_check + ".apng";
- if (file_exists(webp_check))
- return webp_check;
- if (file_exists(apng_check))
- return apng_check;
- return path_to_check + ".gif";
+ if (file_exists(path_to_check + ".webp"))
+ return path_to_check + ".webp";
+ if (file_exists(path_to_check + ".apng"))
+ return path_to_check + ".apng";
+ if (file_exists(path_to_check + ".gif"))
+ return path_to_check + ".gif";
+ return path_to_check + ".png";
}