aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriamgoofball <iamgoofball@gmail.com>2019-01-21 15:45:51 -0800
committeriamgoofball <iamgoofball@gmail.com>2019-01-21 15:45:51 -0800
commita7a614482e379ad13f8e0ca1e7f3e31c33bb1c21 (patch)
treef3c938a31e9697183ab5fd0c43567f4a1c6a331a /src
parentdebd386a7176327d481470621a7a3a65cd715f2e (diff)
final commit
Diffstat (limited to 'src')
-rw-r--r--src/aocharmovie.cpp15
-rw-r--r--src/aooptionsdialog.cpp12
-rw-r--r--src/courtroom.cpp4
-rw-r--r--src/text_file_functions.cpp13
4 files changed, 37 insertions, 7 deletions
diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp
index cbf9b79f..3d650551 100644
--- a/src/aocharmovie.cpp
+++ b/src/aocharmovie.cpp
@@ -18,6 +18,7 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_
void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
{
+ apng = false;
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, emote_prefix + p_emote + ".png");
QString apng_path = ao_app->get_character_path(p_char, emote_prefix + p_emote + ".apng");
@@ -27,7 +28,10 @@ void AOCharMovie::play(QString p_char, QString p_emote, QString emote_prefix)
current_emote = emote_prefix + p_emote;
current_char = p_char;
if (file_exists(apng_path))
+ {
gif_path = apng_path;
+ apng = true;
+ }
else if (file_exists(original_path))
gif_path = original_path;
else if (file_exists(alt_path))
@@ -145,6 +149,9 @@ void AOCharMovie::sfx_two_network_boogaloo()
void AOCharMovie::movie_ticker()
{
+ if(apng){
+ ticker->start(m_movie->nextFrameDelay());
+ }
if(m_movie->currentFrameNumber() == m_movie->frameCount() - 1)
{
delete m_movie;
@@ -165,10 +172,10 @@ void AOCharMovie::movie_ticker()
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());
+ if(!apng){
+ ticker->start(m_movie->nextFrameDelay());
+ }
+
}
void AOCharMovie::LoadImageWithStupidMethodForFlipSupport(QImage image)
diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp
index 4d0e479a..247a2317 100644
--- a/src/aooptionsdialog.cpp
+++ b/src/aooptionsdialog.cpp
@@ -167,6 +167,17 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi
ui_gameplay_form->setWidget(9, QFormLayout::FieldRole, ui_discord_cb);
+ ui_epilepsy_lbl = new QLabel(ui_form_layout_widget);
+ ui_epilepsy_lbl->setText(tr("Allow Shake/Flash:"));
+ ui_epilepsy_lbl->setToolTip(tr("Allows screenshaking and flashing. Disable this if you have concerns or issues with photosensitivity and/or seizures."));
+
+ ui_gameplay_form->setWidget(10, QFormLayout::LabelRole, ui_epilepsy_lbl);
+
+ ui_epilepsy_cb = new QCheckBox(ui_form_layout_widget);
+ ui_epilepsy_cb->setChecked(ao_app->is_shakeandflash_enabled());
+
+ ui_gameplay_form->setWidget(10, QFormLayout::FieldRole, ui_epilepsy_cb);
+
// Here we start the callwords tab.
ui_callwords_tab = new QWidget();
ui_settings_tabs->addTab(ui_callwords_tab, tr("Callwords"));
@@ -486,6 +497,7 @@ void AOOptionsDialog::save_pressed()
configini->setValue("show_custom_shownames", ui_showname_cb->isChecked());
configini->setValue("master", ui_ms_textbox->text());
configini->setValue("discord", ui_discord_cb->isChecked());
+ configini->setValue("shakeandflash", ui_epilepsy_cb->isChecked());
QFile* callwordsini = new QFile(ao_app->get_base_path() + "callwords.ini");
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index a097444f..537558ff 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1752,6 +1752,8 @@ void Courtroom::handle_chatmessage_2()
void Courtroom::doScreenShake()
{
+ if(!ao_app->is_shakeandflash_enabled())
+ return;
screenshake_group = new QParallelAnimationGroup;
screenshake_animation = new QPropertyAnimation(ui_viewport, "pos", this);
chatbox_screenshake_animation = new QPropertyAnimation(ui_vp_chatbox, "pos", this);
@@ -2197,6 +2199,8 @@ void Courtroom::realization_done()
void Courtroom::doRealization()
{
+ if(!ao_app->is_shakeandflash_enabled())
+ return;
realization_timer->start(60);
ui_vp_realization->show();
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 6bc66d03..68d0a041 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -10,8 +10,8 @@ int AOApplication::read_blip_rate()
{
int result = configini->value("blip_rate", 2).toInt();
- if (result < 2)
- return 2;
+ if (result < 1)
+ return 1;
return result;
}
@@ -632,7 +632,7 @@ bool AOApplication::get_looping_sfx()
bool AOApplication::get_objectmusic()
{
- QString result = configini->value("kill_music_on_object", "true").value<QString>();
+ QString result = configini->value("kill_music_on_object", "false").value<QString>();
return result.startsWith("true");
}
@@ -642,6 +642,13 @@ bool AOApplication::is_discord_enabled()
return result.startsWith("true");
}
+bool AOApplication::is_shakeandflash_enabled()
+{
+ QString result = configini->value("shakeandflash", "true").value<QString>();
+ return result.startsWith("true");
+}
+
+
bool AOApplication::get_casing_enabled()
{
QString result = configini->value("casing_enabled", "false").value<QString>();