aboutsummaryrefslogtreecommitdiff
path: root/src/aomovie.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-18 04:14:52 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-18 04:14:52 +0300
commit605e15bb8c0ad103fb0f75454d8912ba83ba7a17 (patch)
treef88c83ec4bcfa014050dd83d026519cdd9e1eb90 /src/aomovie.cpp
parente151964785301269500b96ecfd25dbdf227f55f8 (diff)
Implement effects system that reads your folder in theme/effects, or misc/<folder name>/<effects>
Add an effect packet Allow aomovie to be fed a direct path Add some really terrible helper functions that shouldn't exist, sorry.
Diffstat (limited to 'src/aomovie.cpp')
-rw-r--r--src/aomovie.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/aomovie.cpp b/src/aomovie.cpp
index 7f7fb205..fff8014c 100644
--- a/src/aomovie.cpp
+++ b/src/aomovie.cpp
@@ -29,35 +29,41 @@ void AOMovie::play(QString p_image, QString p_char, QString p_custom_theme, int
{
m_movie->stop();
- QString shout_path;
- QList<QString> pathlist;
+ QString shout_path = p_image;
+ if (!file_exists(p_image))
+ {
+ QList<QString> pathlist;
- pathlist = {
+ 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.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_image + "_bubble")));
+ //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.prepend(ao_app->get_image_suffix(ao_app->get_character_path(p_char, p_image + "_bubble")));
- for (QString path : pathlist)
- {
+ for (QString path : pathlist)
+ {
if (file_exists(path))
{
- shout_path = path;
- break;
+ shout_path = path;
+ break;
}
+ }
}
m_movie->setFileName(shout_path);
+ if (m_movie->loopCount() == 0)
+ play_once = true;
+
this->show();
m_movie->start();
if (m_movie->frameCount() == 0 && duration > 0)