aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aocharmovie.cpp2
-rw-r--r--aocharmovie.h4
-rw-r--r--aomovie.cpp4
-rw-r--r--courtroom.cpp19
4 files changed, 25 insertions, 4 deletions
diff --git a/aocharmovie.cpp b/aocharmovie.cpp
index ff5e64c..9f5f2d7 100644
--- a/aocharmovie.cpp
+++ b/aocharmovie.cpp
@@ -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());
diff --git a/aocharmovie.h b/aocharmovie.h
index 0aff95a..2534b6d 100644
--- a/aocharmovie.h
+++ b/aocharmovie.h
@@ -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;
diff --git a/aomovie.cpp b/aomovie.cpp
index 7d3e1ba..453fb06 100644
--- a/aomovie.cpp
+++ b/aomovie.cpp
@@ -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);
diff --git a/courtroom.cpp b/courtroom.cpp
index 2c941b8..ce616ad 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -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