aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-15 21:15:40 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-15 21:15:40 +0300
commitba28c244aa7591892abb2699cdc547ec431543a7 (patch)
tree9436e04a913d237a69ebe835fb3c7fe92f5dace8
parent661ec87646fe57a0081d49e428267b0dfe3f0d65 (diff)
Add an opton to enable/disable screenshake + flashing
Fix moderation guard button not doing what it's supposed to (enable/disable modcalls) Fix moderation guard button appearing with failed logins Fix the option to toggle looping sfx not doing anything
-rw-r--r--include/aoapplication.h4
-rw-r--r--include/aooptionsdialog.h5
-rw-r--r--src/courtroom.cpp26
-rw-r--r--src/text_file_functions.cpp6
4 files changed, 32 insertions, 9 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index eb12b0c1..6bc86e6d 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -170,6 +170,10 @@ public:
// from the config.ini.
bool is_discord_enabled();
+ // Returns the value of whether shaking and flashing should be enabled.
+ // from the config.ini.
+ bool is_shake_flash_enabled();
+
// Returns the value of the maximum amount of lines the IC chatlog
// may contain, from config.ini.
int get_max_log_size();
diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h
index 34ae2b77..0deb0a82 100644
--- a/include/aooptionsdialog.h
+++ b/include/aooptionsdialog.h
@@ -64,6 +64,9 @@ private:
QLabel *ui_language_label;
QComboBox *ui_language_combobox;
+ QLabel *ui_epilepsy_lbl;
+ QCheckBox *ui_epilepsy_cb;
+
QWidget *ui_callwords_tab;
QWidget *ui_callwords_widget;
QVBoxLayout *ui_callwords_layout;
@@ -88,6 +91,8 @@ private:
QLabel *ui_bliprate_lbl;
QCheckBox *ui_blank_blips_cb;
QLabel *ui_blank_blips_lbl;
+ QLabel *ui_loopsfx_lbl;
+ QCheckBox *ui_loopsfx_cb;
QLabel *ui_objectmusic_lbl;
QCheckBox *ui_objectmusic_cb;
QDialogButtonBox *ui_settings_buttons;
diff --git a/src/courtroom.cpp b/src/courtroom.cpp
index 2e4fbb21..d7d1ff52 100644
--- a/src/courtroom.cpp
+++ b/src/courtroom.cpp
@@ -1081,6 +1081,11 @@ void Courtroom::append_server_chatmessage(QString p_name, QString p_message, QSt
colour = ao_app->get_color("ooc_default_color", "courtroom_design.ini").name();
if (p_colour == "1")
colour = ao_app->get_color("ooc_server_color", "courtroom_design.ini").name();
+ if(p_message == "Logged in as a moderator.")
+ {
+ ui_guard->show();
+ append_server_chatmessage("CLIENT", "You were granted the Disable Modcalls button.", "1");
+ }
ui_server_chatlog->append_chatmessage(p_name, p_message, colour);
}
@@ -1659,6 +1664,9 @@ void Courtroom::handle_chatmessage_2()
void Courtroom::do_screenshake()
{
+ if(!ao_app->is_shake_flash_enabled())
+ return;
+
//This way, the animation is reset in such a way that last played screenshake would return to its "final frame" properly.
//This properly resets all UI elements without having to bother keeping track of "origin" positions.
//Works great wit the chat text being detached from the chat box!
@@ -1702,13 +1710,17 @@ void Courtroom::do_screenshake()
void Courtroom::do_flash()
{
+ if(!ao_app->is_shake_flash_enabled())
+ return;
+
ui_vp_realization->play("realizationflash", "", "", 60);
}
void Courtroom::play_char_sfx(QString sfx_name)
{
sfx_player->play(ao_app->get_sfx_suffix(sfx_name));
- sfx_player->set_looping(ao_app->get_sfx_looping(current_char, sfx_name)!="0");
+ if(ao_app->get_looping_sfx())
+ sfx_player->set_looping(ao_app->get_sfx_looping(current_char, sfx_name)!="0");
}
void Courtroom::handle_chatmessage_3()
@@ -2451,7 +2463,7 @@ void Courtroom::chat_tick()
// If we had a formatting char, we shouldn't wait so long again, as it won't appear!
if (formatting_char)
{
- chat_tick_timer->start(1);
+ chat_tick_timer->start(0);
}
else
{
@@ -2469,7 +2481,8 @@ void Courtroom::play_sfx()
return;
sfx_player->play(ao_app->get_sfx_suffix(sfx_name));
- sfx_player->set_looping(ao_app->get_sfx_looping(current_char, sfx_name)!="0");
+ if(ao_app->get_looping_sfx())
+ sfx_player->set_looping(ao_app->get_sfx_looping(current_char, sfx_name)!="0");
}
void Courtroom::set_scene()
@@ -2765,7 +2778,7 @@ void Courtroom::toggle_judge_buttons(bool is_on)
void Courtroom::mod_called(QString p_ip)
{
ui_server_chatlog->append(p_ip);
- if (ui_guard->isChecked())
+ if (!ui_guard->isChecked())
{
modcall_player->play(ao_app->get_sfx("mod_call"));
ao_app->alert(this);
@@ -2807,11 +2820,6 @@ void Courtroom::on_ooc_return_pressed()
toggle_judge_buttons(false);
}
}
- else if (ooc_message.startsWith("/login"))
- {
- ui_guard->show();
- append_server_chatmessage("CLIENT", tr("You were granted the Guard button."), "1");
- }
else if (ooc_message.startsWith("/rainbow") && ao_app->yellow_text_enabled && !rainbow_appended)
{
//ui_text_color->addItem("Rainbow");
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 4c0885e1..750df012 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -672,6 +672,12 @@ bool AOApplication::is_discord_enabled()
return result.startsWith("true");
}
+bool AOApplication::is_shake_flash_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>();