diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/aooptionsdialog.cpp | 45 | ||||
| -rw-r--r-- | src/courtroom.cpp | 17 | ||||
| -rw-r--r-- | src/text_file_functions.cpp | 16 |
3 files changed, 60 insertions, 18 deletions
diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index 37694e4..ad1042f 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -195,16 +195,28 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_language_combobox); row += 1; - 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_shake_lbl = new QLabel(ui_form_layout_widget); + ui_shake_lbl->setText(tr("Allow Screenshake:")); + ui_shake_lbl->setToolTip(tr("Allows screenshaking. Disable this if you have concerns or issues with photosensitivity and/or seizures.")); - ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_epilepsy_lbl); + ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_shake_lbl); - ui_epilepsy_cb = new QCheckBox(ui_form_layout_widget); - ui_epilepsy_cb->setChecked(ao_app->is_shake_flash_enabled()); + ui_shake_cb = new QCheckBox(ui_form_layout_widget); + ui_shake_cb->setChecked(ao_app->is_shake_enabled()); - ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_epilepsy_cb); + ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_shake_cb); + + row += 1; + ui_effects_lbl = new QLabel(ui_form_layout_widget); + ui_effects_lbl->setText(tr("Allow Effects:")); + ui_effects_lbl->setToolTip(tr("Allows screen effects. Disable this if you have concerns or issues with photosensitivity and/or seizures.")); + + ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_effects_lbl); + + ui_effects_cb = new QCheckBox(ui_form_layout_widget); + ui_effects_cb->setChecked(ao_app->is_effects_enabled()); + + ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_effects_cb); row += 1; ui_framenetwork_lbl = new QLabel(ui_form_layout_widget); @@ -214,10 +226,22 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) : QDi ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_framenetwork_lbl); ui_framenetwork_cb = new QCheckBox(ui_form_layout_widget); - ui_framenetwork_cb->setChecked(ao_app->is_shake_flash_enabled()); + ui_framenetwork_cb->setChecked(ao_app->is_frame_network_enabled()); ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_framenetwork_cb); + row += 1; + ui_colorlog_lbl = new QLabel(ui_form_layout_widget); + ui_colorlog_lbl->setText(tr("Colors in IC Log:")); + ui_colorlog_lbl->setToolTip(tr("Use the markup colors in the server IC chatlog.")); + + ui_gameplay_form->setWidget(row, QFormLayout::LabelRole, ui_colorlog_lbl); + + ui_colorlog_cb = new QCheckBox(ui_form_layout_widget); + ui_colorlog_cb->setChecked(ao_app->is_colorlog_enabled()); + + ui_gameplay_form->setWidget(row, QFormLayout::FieldRole, ui_colorlog_cb); + QScrollArea *scroll = new QScrollArea; scroll->setWidget(ui_form_layout_widget); ui_gameplay_tab->setLayout(new QVBoxLayout); @@ -571,8 +595,11 @@ void AOOptionsDialog::save_pressed() configini->setValue("master", ui_ms_textbox->text()); configini->setValue("discord", ui_discord_cb->isChecked()); configini->setValue("language", ui_language_combobox->currentText().left(2)); - configini->setValue("shakeandflash", ui_epilepsy_cb->isChecked()); + configini->setValue("shake", ui_shake_cb->isChecked()); + configini->setValue("effects", ui_effects_cb->isChecked()); configini->setValue("framenetwork", ui_framenetwork_cb->isChecked()); + configini->setValue("colorlog", ui_colorlog_cb->isChecked()); + QFile* callwordsini = new QFile(ao_app->get_base_path() + "callwords.ini"); diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 937cfc5..283611f 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1889,7 +1889,7 @@ void Courtroom::handle_chatmessage_2() void Courtroom::do_screenshake() { - if(!ao_app->is_shake_flash_enabled()) + if(!ao_app->is_shake_enabled()) return; //This way, the animation is reset in such a way that last played screenshake would return to its "final frame" properly. @@ -1935,7 +1935,7 @@ void Courtroom::do_screenshake() void Courtroom::do_flash() { - if(!ao_app->is_shake_flash_enabled()) + if(!ao_app->is_effects_enabled()) return; QString f_char = m_chatmessage[CHAR_NAME]; @@ -1945,17 +1945,20 @@ void Courtroom::do_flash() void Courtroom::do_effect(QString fx_name, QString fx_sound, QString p_char) { - if(!ao_app->is_shake_flash_enabled()) - return; QString effect = ao_app->get_effect(fx_name, p_char); if (effect == "") return; - ui_vp_effect->set_play_once(false); // The effects themselves dictate whether or not they're looping. Static effects will linger. - ui_vp_effect->play(effect); // It will set_play_once to true if the filepath provided is not designed to loop more than once if (fx_sound != "") sfx_player->play(fx_sound); + + //Only check if effects are disabled after playing the sound if it exists + if(!ao_app->is_effects_enabled()) + return; + + ui_vp_effect->set_play_once(false); // The effects themselves dictate whether or not they're looping. Static effects will linger. + ui_vp_effect->play(effect); // It will set_play_once to true if the filepath provided is not designed to loop more than once } void Courtroom::play_char_sfx(QString sfx_name) @@ -2299,7 +2302,7 @@ void Courtroom::append_ic_text(QString p_text, QString p_name, bool is_songchang const int old_scrollbar_value = ui_ic_chatlog->verticalScrollBar()->value(); if (!is_songchange) - p_text = filter_ic_text(p_text, true, -1, m_chatmessage[TEXT_COLOR].toInt()); + p_text = filter_ic_text(p_text, ao_app->is_colorlog_enabled(), -1, m_chatmessage[TEXT_COLOR].toInt()); if (log_goes_downwards) { diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 2c9d5e9..bb5d7de 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -960,9 +960,15 @@ bool AOApplication::is_discord_enabled() return result.startsWith("true"); } -bool AOApplication::is_shake_flash_enabled() +bool AOApplication::is_shake_enabled() { - QString result = configini->value("shakeandflash", "true").value<QString>(); + QString result = configini->value("shake", "true").value<QString>(); + return result.startsWith("true"); +} + +bool AOApplication::is_effects_enabled() +{ + QString result = configini->value("effects", "true").value<QString>(); return result.startsWith("true"); } @@ -972,6 +978,12 @@ bool AOApplication::is_frame_network_enabled() return result.startsWith("true"); } +bool AOApplication::is_colorlog_enabled() +{ + QString result = configini->value("colorlog", "true").value<QString>(); + return result.startsWith("true"); +} + bool AOApplication::get_casing_enabled() { QString result = configini->value("casing_enabled", "false").value<QString>(); |
