diff options
| author | Cerapter <cerap@protonmail.com> | 2018-07-27 23:09:41 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-07-27 23:09:41 +0200 |
| commit | 7d476867cbc85ed72cb6d9faa286116e58010c4c (patch) | |
| tree | 17d9a3ca802b72f876318a74b9001ed8717b57b4 | |
| parent | 977a88a2672ff9bd6ebec8b29eb37f7a120c1e1f (diff) | |
'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.**
| -rw-r--r-- | courtroom.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/courtroom.cpp b/courtroom.cpp index d3e3728..4e1529b 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -13,6 +13,7 @@ #include <QBrush> #include <QTextCharFormat> #include <QFont> +#include <QInputDialog> 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(); } |
