aboutsummaryrefslogtreecommitdiff
path: root/src/aomovie.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-13 11:37:06 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-13 11:44:50 +0300
commit9aa88b1d6e84538761a963249d8c8029314e26d7 (patch)
tree3a168e42fb52f26cf9e6c49f81c879c07ee01dd1 /src/aomovie.cpp
parent3b3507df60673079482372b4da08eeabf9317a20 (diff)
Use brace constructors instead of << append operator for path lists
Rename gif_path into emote_path for charmovie.cpp Rename p_gif into p_image for aomovie.cpp
Diffstat (limited to 'src/aomovie.cpp')
-rw-r--r--src/aomovie.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/aomovie.cpp b/src/aomovie.cpp
index 2598bb76..851ae570 100644
--- a/src/aomovie.cpp
+++ b/src/aomovie.cpp
@@ -29,23 +29,27 @@ void AOMovie::start_timer(int delay)
timer->start(delay);
}
-void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme, int duration)
+void AOMovie::play(QString p_image, QString p_char, QString p_custom_theme, int duration)
{
m_movie->stop();
QString shout_path;
QList<QString> pathlist;
- if (p_gif == "custom")
- pathlist << ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif));
+
+ pathlist = {
+ ao_app->get_image_suffix(ao_app->get_base_path() + "misc/" + p_custom_theme + "/" + p_image + "_bubble"), //Misc path
+ ao_app->get_image_suffix(ao_app->get_custom_theme_path(p_custom_theme, p_image)), //Custom theme path
+ ao_app->get_image_suffix(ao_app->get_theme_path(p_image)), //Theme path
+ ao_app->get_image_suffix(ao_app->get_default_theme_path(p_image)), //Default theme path
+ ao_app->get_image_suffix(ao_app->get_theme_path("placeholder")), //Placeholder path
+ ao_app->get_image_suffix( ao_app->get_default_theme_path("placeholder")), //Default placeholder path
+ };
+
+ //Add this at the beginning of the list - order matters.
+ if (p_image == "custom")
+ pathlist.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_image)));
else
- pathlist << ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_gif + "_bubble"));
-
- pathlist << ao_app->get_image_suffix(ao_app->get_base_path() + "misc/" + p_custom_theme + "/" + p_gif + "_bubble") << //Misc path
- ao_app->get_image_suffix(ao_app->get_custom_theme_path(p_custom_theme, p_gif)) << //Custom theme path
- ao_app->get_image_suffix(ao_app->get_theme_path(p_gif)) << //Theme path
- ao_app->get_image_suffix(ao_app->get_default_theme_path(p_gif)) << //Default theme path
- ao_app->get_image_suffix(ao_app->get_theme_path("placeholder")) << //Placeholder path
- ao_app->get_image_suffix( ao_app->get_default_theme_path("placeholder")); //Default placeholder path
+ pathlist.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_image + "_bubble")));
for (QString path : pathlist)
{