diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2018-11-17 19:57:27 -0600 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2018-11-17 19:57:27 -0600 |
| commit | b385babf77cafda37770ff2593af2a6a37e15260 (patch) | |
| tree | ce201ca20b290625ddfbbb39fb0b111d68ad50f7 /aocharmovie.cpp | |
| parent | 8d61f6007ecfa3e19aa7cce6afb97aa39f143fac (diff) | |
| parent | 027f95deccef0f17759cbb093dc4097caf8184da (diff) | |
Fix case-insensitive paths on Linux (#34)
Closes #9
Diffstat (limited to 'aocharmovie.cpp')
| -rw-r--r-- | aocharmovie.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/aocharmovie.cpp b/aocharmovie.cpp index e9c88bae..57487233 100644 --- a/aocharmovie.cpp +++ b/aocharmovie.cpp @@ -19,11 +19,11 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) { - QString original_path = ao_app->get_character_path(p_char) + emote_prefix + p_emote.toLower() + ".gif"; - QString alt_path = ao_app->get_character_path(p_char) + p_emote.toLower() + ".png"; - QString apng_path = ao_app->get_character_path(p_char) + emote_prefix + p_emote.toLower() + ".apng"; - QString placeholder_path = ao_app->get_theme_path() + "placeholder.gif"; - QString placeholder_default_path = ao_app->get_default_theme_path() + "placeholder.gif"; + QString original_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".gif"); + QString alt_path = ao_app->get_character_path(p_char, p_emote + ".png"); + QString apng_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".apng"); + QString placeholder_path = ao_app->get_theme_path("placeholder.gif"); + QString placeholder_default_path = ao_app->get_default_theme_path("placeholder.gif"); QString gif_path; if (file_exists(apng_path)) @@ -61,7 +61,7 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix) void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) { - QString gif_path = ao_app->get_character_path(p_char) + p_emote.toLower(); + QString gif_path = ao_app->get_character_path(p_char, p_emote); m_movie->stop(); this->clear(); @@ -78,8 +78,11 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) real_duration += m_movie->nextFrameDelay(); m_movie->jumpToFrame(n_frame + 1); } + +#ifdef DEBUG_GIF qDebug() << "full_duration: " << full_duration; qDebug() << "real_duration: " << real_duration; +#endif double percentage_modifier = 100.0; @@ -91,7 +94,10 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) if (percentage_modifier > 100.0) percentage_modifier = 100.0; } + +#ifdef DEBUG_GIF qDebug() << "% mod: " << percentage_modifier; +#endif if (full_duration == 0 || full_duration >= real_duration) { @@ -110,7 +116,7 @@ void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration) void AOCharMovie::play_talking(QString p_char, QString p_emote) { - QString gif_path = ao_app->get_character_path(p_char) + "(b)" + p_emote.toLower(); + QString gif_path = ao_app->get_character_path(p_char, "(b)" + p_emote); m_movie->stop(); this->clear(); @@ -123,7 +129,7 @@ void AOCharMovie::play_talking(QString p_char, QString p_emote) void AOCharMovie::play_idle(QString p_char, QString p_emote) { - QString gif_path = ao_app->get_character_path(p_char) + "(a)" + p_emote.toLower(); + QString gif_path = ao_app->get_character_path(p_char, "(a)" + p_emote); m_movie->stop(); this->clear(); |
