@@ -15,43 +15,37 @@ AOMovie::AOMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_parent)
1515 connect (m_movie, SIGNAL (frameChanged (int )), this , SLOT (frame_change (int )));
1616}
1717
18- void AOMovie::play (QString p_gif, QString p_char )
18+ void AOMovie::set_play_once ( bool p_play_once )
1919{
20- play_once = true ;
21-
22- m_movie->stop ();
23-
24- QString default_path = ao_app->get_default_theme_path () + p_gif + " .gif" ;
25- QString gif_path;
26-
27- if (p_gif == " custom" )
28- gif_path = ao_app->get_character_path (p_char) + " custom.gif" ;
29- else
30- gif_path = ao_app->get_theme_path () + p_gif + " .gif" ;
31-
32-
33- if (file_exists (gif_path))
34- m_movie->setFileName (gif_path);
35- else
36- m_movie->setFileName (default_path);
37-
38- this ->show ();
39- m_movie->start ();
20+ play_once = p_play_once;
4021}
4122
42- void AOMovie::play (QString p_gif, bool p_play_once )
23+ void AOMovie::play (QString p_gif, QString p_char )
4324{
44- play_once = p_play_once;
45-
4625 m_movie->stop ();
4726
48- QString default_path = ao_app->get_default_theme_path () + p_gif + " .gif" ;
49- QString gif_path = ao_app->get_theme_path () + p_gif + " .gif" ;
27+ QString gif_path;
5028
51- if (file_exists (gif_path))
52- m_movie->setFileName (gif_path);
29+ QString custom_path = ao_app->get_character_path (p_char) + p_gif + " .gif" ;
30+ QString theme_path = ao_app->get_theme_path () + p_gif + " .gif" ;
31+ QString default_theme_path = ao_app->get_default_theme_path () + p_gif + " .gif" ;
32+ QString placeholder_path = ao_app->get_theme_path () + " placeholder.gif" ;
33+ QString default_placeholder_path = ao_app->get_default_theme_path () + " placeholder.gif" ;
34+
35+ if (file_exists (custom_path))
36+ gif_path = custom_path;
37+ else if (file_exists (theme_path))
38+ gif_path = theme_path;
39+ else if (file_exists (default_theme_path))
40+ gif_path = default_theme_path;
41+ else if (file_exists (placeholder_path))
42+ gif_path = placeholder_path;
43+ else if (file_exists (default_placeholder_path))
44+ gif_path = default_placeholder_path;
5345 else
54- m_movie->setFileName (default_path);
46+ gif_path = " " ;
47+
48+ m_movie->setFileName (gif_path);
5549
5650 this ->show ();
5751 m_movie->start ();
0 commit comments