aboutsummaryrefslogtreecommitdiff
path: root/courtroom.cpp
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 /courtroom.cpp
parent83d30e6920d0584d316d4ff12766ab9fe159b01d (diff)
added modcall_reason as a FL feature
Diffstat (limited to 'courtroom.cpp')
-rw-r--r--courtroom.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/courtroom.cpp b/courtroom.cpp
index d6256995..880d124d 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()