aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorargoneus <argoneuscze@gmail.com>2018-08-03 12:01:50 +0200
committerargoneus <argoneuscze@gmail.com>2018-08-03 12:01:50 +0200
commit01e933f6bb3fda5ac86beff0be2a4f8ff21064e0 (patch)
tree1c2b7cae3735857950a02c3c1608e429c7f85576
parent83d30e6920d0584d316d4ff12766ab9fe159b01d (diff)
added modcall_reason as a FL feature
-rw-r--r--aoapplication.h1
-rw-r--r--courtroom.cpp34
-rw-r--r--packet_distribution.cpp2
3 files changed, 22 insertions, 15 deletions
diff --git a/aoapplication.h b/aoapplication.h
index f69a0ea..0f14a0c 100644
--- a/aoapplication.h
+++ b/aoapplication.h
@@ -56,6 +56,7 @@ public:
bool improved_loading_enabled = false;
bool desk_mod_enabled = false;
bool evidence_enabled = false;
+ bool modcall_reason_enabled = false;
///////////////loading info///////////////////
diff --git a/courtroom.cpp b/courtroom.cpp
index d625699..880d124 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -2018,27 +2018,31 @@ void Courtroom::on_spectator_clicked()
void Courtroom::on_call_mod_clicked()
{
- auto box = new QInputDialog();
- box->setLabelText("Enter a reason:");
- auto code = box->exec();
+ if (ao_app->modcall_reason_enabled) {
+ auto box = new QInputDialog();
+ box->setLabelText("Enter a reason:");
+ auto code = box->exec();
+
+ if (code != QDialog::Accepted) {
+ delete box;
+ return;
+ }
- if (code != QDialog::Accepted) {
- delete box;
- return;
- }
+ auto text = box->textValue();
+ if (text.isEmpty())
+ text = "N/A";
- auto text = box->textValue();
- if (text.isEmpty())
- text = "N/A";
+ delete box;
- QStringList mod_reason;
- mod_reason.append(text);
+ QStringList mod_reason;
+ mod_reason.append(text);
- ao_app->send_server_packet(new AOPacket("ZZ", mod_reason));
+ ao_app->send_server_packet(new AOPacket("ZZ", mod_reason));
+ } else {
+ ao_app->send_server_packet(new AOPacket("ZZ"));
+ }
ui_ic_chat_message->setFocus();
-
- delete box;
}
void Courtroom::on_pre_clicked()
diff --git a/packet_distribution.cpp b/packet_distribution.cpp
index 4299518..6f29b2e 100644
--- a/packet_distribution.cpp
+++ b/packet_distribution.cpp
@@ -195,6 +195,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
desk_mod_enabled = true;
if (f_packet.contains("evidence",Qt::CaseInsensitive))
evidence_enabled = true;
+ if (f_packet.contains("modcall_reason",Qt::CaseInsensitive))
+ modcall_reason_enabled = true;
}
else if (header == "PN")
{