aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriamgoofball <iamgoofball@gmail.com>2019-01-20 21:06:21 -0800
committeriamgoofball <iamgoofball@gmail.com>2019-01-20 21:06:21 -0800
commitdebd386a7176327d481470621a7a3a65cd715f2e (patch)
tree9f0ca0aa28783bdc951f22d395c2b45d3a2c994d
parent10436992148e2342e6bd563d1acfb684f225aa30 (diff)
Bugfixes and blip speeds
-rw-r--r--include/courtroom.h2
-rw-r--r--src/aocharmovie.cpp31
-rw-r--r--src/text_file_functions.cpp6
3 files changed, 25 insertions, 14 deletions
diff --git a/include/courtroom.h b/include/courtroom.h
index c76e4a1f..b746c6ac 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -251,7 +251,7 @@ private:
bool message_is_centered = false;
int current_display_speed = 3;
- int message_display_speed[7] = {30, 40, 50, 60, 75, 100, 120};
+ int message_display_speed[7] = {10, 20, 30, 40, 50, 60, 75};
// This is for checking if the character should start talking again
// when an inline blue text ends.
diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp
index a5beefb9..cbf9b79f 100644
--- a/src/aocharmovie.cpp
+++ b/src/aocharmovie.cpp
@@ -13,7 +13,6 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_
preanim_timer->setSingleShot(true);
ticker->setSingleShot(true);
connect(ticker, SIGNAL(timeout()), this, SLOT(movie_ticker()));
- connect(preanim_timer, SIGNAL(timeout()), this, SLOT(timer_done()));
this->setUpdatesEnabled(true);
}
@@ -37,6 +36,7 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
gif_path = placeholder_path;
else
gif_path = placeholder_default_path;
+ last_path = gif_path;
delete m_movie;
m_movie = new QMovie(this);
m_movie->stop();
@@ -145,10 +145,29 @@ void AOCharMovie::sfx_two_network_boogaloo()
void AOCharMovie::movie_ticker()
{
- m_movie->jumpToNextFrame();
+ if(m_movie->currentFrameNumber() == m_movie->frameCount() - 1)
+ {
+ delete m_movie;
+ m_movie = new QMovie(this);
+ m_movie->stop();
+ this->clear();
+ m_movie->setFileName(last_path);
+ m_movie->jumpToFrame(0);
+ if(play_once)
+ {
+ timer_done();
+ }
+ }
+ else
+ {
+ m_movie->jumpToNextFrame();
+ }
this->LoadImageWithStupidMethodForFlipSupport(m_movie->currentImage()); // imagine if QT had sane stuff like "mirror on QMovie" or "resize the image on QT" or "interface with the current QMovie image" or anything else
// ps: fuck private functions/variables as a concept, freedom 2 do dangerous things 5ever
this->play_frame_sfx();
+ qDebug() << "Current frame number: " << m_movie->currentFrameNumber();
+ qDebug() << "Frames Left: " << m_movie->frameCount() - 1;
+ qDebug() << "Frame Delay: " << m_movie->nextFrameDelay();
ticker->start(m_movie->nextFrameDelay());
}
@@ -180,14 +199,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
m_movie->setFileName(gif_path);
m_movie->jumpToFrame(0);
int real_duration = 0;
- for (int n_frame = 0 ; n_frame < m_movie->frameCount() ; ++n_frame)
- {
- qDebug() << "frame " << n_frame << " delay of " << m_movie->nextFrameDelay();
- real_duration += m_movie->nextFrameDelay();
- m_movie->jumpToFrame(n_frame + 1);
- }
play_once = true;
- preanim_timer->start(real_duration);
play(p_char, p_emote, "");
}
@@ -207,7 +219,6 @@ void AOCharMovie::stop()
{
//for all intents and purposes, stopping is the same as hiding. at no point do we want a frozen gif to display
m_movie->stop();
- preanim_timer->stop();
frame_specific_sfx_player->stop();
this->hide();
}
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index e8cfebaa..6bc66d03 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -8,10 +8,10 @@ QString AOApplication::read_theme()
int AOApplication::read_blip_rate()
{
- int result = configini->value("blip_rate", 1).toInt();
+ int result = configini->value("blip_rate", 2).toInt();
- if (result < 1)
- return 1;
+ if (result < 2)
+ return 2;
return result;
}