aboutsummaryrefslogtreecommitdiff
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
parent68a3f35fb0a39a57d50c3d3098710c667a166477 (diff)
parent806a022a93882eeebed734e2b2941de3b6f5a021 (diff)
Merge pull request #1 from argoneuscze/modcall_reason
Added support for modcall reasons
-rw-r--r--aoapplication.h5
-rw-r--r--courtroom.cpp24
-rw-r--r--courtroom.h1
-rw-r--r--lobby.cpp2
-rw-r--r--packet_distribution.cpp2
5 files changed, 30 insertions, 4 deletions
diff --git a/aoapplication.h b/aoapplication.h
index f69a0ea..b432a73 100644
--- a/aoapplication.h
+++ b/aoapplication.h
@@ -56,6 +56,7 @@ public:
bool improved_loading_enabled = false;
bool desk_mod_enabled = false;
bool evidence_enabled = false;
+ bool modcall_reason_enabled = false;
///////////////loading info///////////////////
@@ -224,8 +225,8 @@ public:
private:
const int RELEASE = 2;
- const int MAJOR_VERSION = 4;
- const int MINOR_VERSION = 10;
+ const int MAJOR_VERSION = 5;
+ const int MINOR_VERSION = 0;
QString current_theme = "default";
diff --git a/courtroom.cpp b/courtroom.cpp
index bc0b0ad..f6935ba 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();
}
diff --git a/courtroom.h b/courtroom.h
index 2cc099c..728502b 100644
--- a/courtroom.h
+++ b/courtroom.h
@@ -43,6 +43,7 @@
#include <QSignalMapper>
#include <QMap>
#include <QTextBrowser>
+#include <QInputDialog>
class AOApplication;
diff --git a/lobby.cpp b/lobby.cpp
index c0dbf0c..9761cc0 100644
--- a/lobby.cpp
+++ b/lobby.cpp
@@ -12,7 +12,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow()
{
ao_app = p_ao_app;
- this->setWindowTitle("Attorney Online 2");
+ this->setWindowTitle("Attorney Online Vidya (AO2)");
ui_background = new AOImage(this, ao_app);
ui_public_servers = new AOButton(this, ao_app);
diff --git a/packet_distribution.cpp b/packet_distribution.cpp
index 4299518..6f29b2e 100644
--- a/packet_distribution.cpp
+++ b/packet_distribution.cpp
@@ -195,6 +195,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
desk_mod_enabled = true;
if (f_packet.contains("evidence",Qt::CaseInsensitive))
evidence_enabled = true;
+ if (f_packet.contains("modcall_reason",Qt::CaseInsensitive))
+ modcall_reason_enabled = true;
}
else if (header == "PN")
{