started program flow with objection handler

This commit is contained in:
David Skoland 2017-01-31 19:02:31 +01:00
parent 295ea74b7c
commit ab4de962e0
4 changed files with 25 additions and 4 deletions

View File

@ -86,7 +86,7 @@ void AOCharMovie::combo_resize(int w, int h)
void AOCharMovie::frame_change(int n_frame)
{
if (n_frame == (m_movie->frameCount() - 1))
if (n_frame == (m_movie->frameCount() - 1) && play_once)
{
//we need this or else the last frame wont show
delay(m_movie->nextFrameDelay());

View File

@ -3,6 +3,7 @@
#include <QMovie>
#include <QLabel>
#include <QTimer>
class AOApplication;
@ -26,7 +27,10 @@ public:
private:
AOApplication *ao_app;
bool play_once = true;
QMovie *m_movie;
QTimer *m_timer;
QString m_char = "null";
QString m_pre;

View File

@ -19,8 +19,8 @@ void AOMovie::play(QString p_gif)
{
m_movie->stop();
QString gif_path = ao_app->get_theme_path() + p_gif;
QString default_path = ao_app->get_default_theme_path() + p_gif;
QString gif_path = ao_app->get_theme_path() + p_gif + ".gif";
QString default_path = ao_app->get_default_theme_path() + p_gif + ".gif";
if (file_exists(gif_path))
m_movie->setFileName(gif_path);

View File

@ -606,9 +606,26 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
ui_ic_chatlog->verticalScrollBar()->setValue(ui_ic_chatlog->verticalScrollBar()->minimum());
}
int objection_mod = p_contents->at(OBJECTION_MOD);
switch (objection_mod)
{
case 1:
ui_vp_objection->play("holdit");
break;
case 2:
ui_vp_objection->play("objection");
break;
case 3:
ui_vp_objection->play("takethat");
break;
//AO2 only
case 4:
//T0D0: add custom.gif here
default:
//T0D0: continue program flow
//T0D0: play objection gif->preanimation if there is any
}
//D3BUG START