From 73782055237ee8948b26935348e8ca2b8a71a95a Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 10 Sep 2019 21:57:06 +0300 Subject: Expand .apng and .webp support for get_image_suffix Add get_image_suffix for all .gif's so that all animated pieces can be .webp or .apng instead Expand on .webp .apng support and clean up the code somewhat --- src/aocharmovie.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/aocharmovie.cpp') diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp index 5748723..eacf853 100644 --- a/src/aocharmovie.cpp +++ b/src/aocharmovie.cpp @@ -19,16 +19,13 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) { - QString original_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".gif"); + QString original_path = ao_app->get_image_suffix(ao_app->get_character_path(p_char, emote_prefix + p_emote)); QString alt_path = ao_app->get_character_path(p_char, p_emote + ".png"); - QString apng_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".apng"); - QString placeholder_path = ao_app->get_theme_path("placeholder.gif"); - QString placeholder_default_path = ao_app->get_default_theme_path("placeholder.gif"); + QString placeholder_path = ao_app->get_image_suffix(ao_app->get_theme_path("placeholder")); + QString placeholder_default_path = ao_app->get_image_suffix(ao_app->get_default_theme_path("placeholder")); QString gif_path; - if (file_exists(apng_path)) - gif_path = apng_path; - else if (file_exists(original_path)) + if (file_exists(original_path)) gif_path = original_path; else if (file_exists(alt_path)) gif_path = alt_path; -- cgit