From de6d325334756e72a9d8706f64c34b7b687523e9 Mon Sep 17 00:00:00 2001 From: argoneus Date: Tue, 31 Jul 2018 18:03:41 +0200 Subject: [PATCH] added modcall reason --- courtroom.cpp | 18 +++++++++++++++++- courtroom.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/courtroom.cpp b/courtroom.cpp index bc0b0ad..ec5a07c 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2018,9 +2018,25 @@ void Courtroom::on_spectator_clicked() void Courtroom::on_call_mod_clicked() { - ao_app->send_server_packet(new AOPacket("ZZ#%")); + auto box = new QInputDialog(); + box->setLabelText("Enter a reason:"); + auto code = box->exec(); + + if (code != QDialog::Accepted) + return; + + auto text = box->textValue(); + if (text.isEmpty()) + text = "N/A"; + + QStringList mod_reason; + mod_reason.append(text); + + ao_app->send_server_packet(new AOPacket("ZZ", mod_reason)); ui_ic_chat_message->setFocus(); + + delete box; } void Courtroom::on_pre_clicked() diff --git a/courtroom.h b/courtroom.h index 2cc099c..728502b 100644 --- a/courtroom.h +++ b/courtroom.h @@ -43,6 +43,7 @@ #include #include #include +#include class AOApplication;