aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-14 19:38:56 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-14 19:38:56 +0300
commit51c97ad51ce564ab400f5333eaad75b1fb2e5461 (patch)
tree3eebe00721c27cc18a7a6b5a8e21754cecd7e274
parentf225df6f19aa68789ba702fa298db8675741a495 (diff)
Allow [Time] to be blank for pre-anims to not be required to use it
play_talking and play_idle reduced in useless code
-rw-r--r--include/aocharmovie.h2
-rw-r--r--src/aocharmovie.cpp15
-rw-r--r--src/courtroom.cpp3
3 files changed, 4 insertions, 16 deletions
diff --git a/include/aocharmovie.h b/include/aocharmovie.h
index 7ef7da3f..f54f5105 100644
--- a/include/aocharmovie.h
+++ b/include/aocharmovie.h
@@ -36,7 +36,7 @@ private:
QVector<QImage> movie_frames;
QTimer *preanim_timer;
- const int time_mod = 62;
+ const int time_mod = 60;
// These are the X and Y values before they are fixed based on the sprite's width.
int x = 0;
diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp
index 90baa555..ac12f638 100644
--- a/src/aocharmovie.cpp
+++ b/src/aocharmovie.cpp
@@ -75,6 +75,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
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);
}
@@ -86,7 +87,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
double percentage_modifier = 100.0;
- if (real_duration != 0 && duration != 0)
+ if (real_duration != 0 && duration > 0)
{
double modifier = full_duration / static_cast<double>(real_duration);
percentage_modifier = 100 / modifier;
@@ -116,12 +117,6 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
void AOCharMovie::play_talking(QString p_char, QString p_emote)
{
- QString emote_path = ao_app->get_character_path(p_char, "(b)" + p_emote);
-
- m_movie->stop();
- this->clear();
- m_movie->setFileName(emote_path);
-
play_once = false;
m_movie->setSpeed(100);
play(p_char, p_emote, "(b)");
@@ -129,12 +124,6 @@ void AOCharMovie::play_talking(QString p_char, QString p_emote)
void AOCharMovie::play_idle(QString p_char, QString p_emote)
{
- QString emote_path = ao_app->get_character_path(p_char, "(a)" + p_emote);
-
- m_movie->stop();
- this->clear();
- m_movie->setFileName(emote_path);
-
play_once = false;
m_movie->setSpeed(100);
play(p_char, p_emote, "(a)");
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 477f3955..47e3a0e7 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -2049,8 +2049,7 @@ void Courtroom::play_preanim(bool noninterrupting)
sfx_delay_timer->start(sfx_delay);
QString anim_to_find = ao_app->get_image_suffix(ao_app->get_character_path(f_char, f_preanim));
- if (!file_exists(anim_to_find) ||
- preanim_duration < 0)
+ if (!file_exists(anim_to_find))
{
if (noninterrupting)
anim_state = 4;