From 7d476867cbc85ed72cb6d9faa286116e58010c4c Mon Sep 17 00:00:00 2001 From: Cerapter Date: Fri, 27 Jul 2018 23:09:41 +0200 Subject: [PATCH] 'Call mod' button now pops up a dialog. - Allows for cancelling calling a mod if it was a mistake. - Allows for giving a reason for the call, optionally. - **Obviously needs server-side support, too, to work.** --- courtroom.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/courtroom.cpp b/courtroom.cpp index d3e3728..4e1529b 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -13,6 +13,7 @@ #include #include #include +#include Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() { @@ -2337,7 +2338,14 @@ void Courtroom::on_spectator_clicked() void Courtroom::on_call_mod_clicked() { - ao_app->send_server_packet(new AOPacket("ZZ#%")); + bool ok; + QString text = QInputDialog::getText(ui_viewport, "Call a mod", + "Reason for the modcall (optional):", QLineEdit::Normal, + "", &ok); + if (ok) + { + ao_app->send_server_packet(new AOPacket("ZZ#" + text + "#%")); + } ui_ic_chat_message->setFocus(); }