aboutsummaryrefslogtreecommitdiff
path: root/courtroom.cpp
diff options
context:
space:
mode:
authorwewlad1 <30403438+wewlad1@users.noreply.github.com>2018-08-06 05:53:53 +0900
committerGitHub <noreply@github.com>2018-08-06 05:53:53 +0900
commita8344ced3f7d412a05a6438e3b7ccdd4f1c3c15b (patch)
treeaff46d67a3ad74fd902939ad377e1d0e36af20f9 /courtroom.cpp
parent68a3f35fb0a39a57d50c3d3098710c667a166477 (diff)
parent806a022a93882eeebed734e2b2941de3b6f5a021 (diff)
Merge pull request #1 from argoneuscze/modcall_reason
Added support for modcall reasons
Diffstat (limited to 'courtroom.cpp')
-rw-r--r--courtroom.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/courtroom.cpp b/courtroom.cpp
index bc0b0ad0..f6935ba1 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -2018,7 +2018,29 @@ void Courtroom::on_spectator_clicked()
void Courtroom::on_call_mod_clicked()
{
- ao_app->send_server_packet(new AOPacket("ZZ#%"));
+ 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;
+ }
+
+ auto text = box->textValue();
+ if (text.isEmpty())
+ text = "N/A";
+
+ delete box;
+
+ QStringList mod_reason;
+ mod_reason.append(text);
+
+ ao_app->send_server_packet(new AOPacket("ZZ", mod_reason));
+ } else {
+ ao_app->send_server_packet(new AOPacket("ZZ#%"));
+ }
ui_ic_chat_message->setFocus();
}