From de6d325334756e72a9d8706f64c34b7b687523e9 Mon Sep 17 00:00:00 2001 From: argoneus Date: Tue, 31 Jul 2018 18:03:41 +0200 Subject: [PATCH 1/6] 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 bc0b0ad07..ec5a07c82 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 2cc099ce2..728502b4d 100644 --- a/courtroom.h +++ b/courtroom.h @@ -43,6 +43,7 @@ #include #include #include +#include class AOApplication; From 83d30e6920d0584d316d4ff12766ab9fe159b01d Mon Sep 17 00:00:00 2001 From: argoneus Date: Tue, 31 Jul 2018 18:08:02 +0200 Subject: [PATCH 2/6] fixed memory leak --- courtroom.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/courtroom.cpp b/courtroom.cpp index ec5a07c82..d62569951 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2022,8 +2022,10 @@ void Courtroom::on_call_mod_clicked() box->setLabelText("Enter a reason:"); auto code = box->exec(); - if (code != QDialog::Accepted) + if (code != QDialog::Accepted) { + delete box; return; + } auto text = box->textValue(); if (text.isEmpty()) From 01e933f6bb3fda5ac86beff0be2a4f8ff21064e0 Mon Sep 17 00:00:00 2001 From: argoneus Date: Fri, 3 Aug 2018 12:01:50 +0200 Subject: [PATCH 3/6] added modcall_reason as a FL feature --- aoapplication.h | 1 + courtroom.cpp | 34 +++++++++++++++++++--------------- packet_distribution.cpp | 2 ++ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/aoapplication.h b/aoapplication.h index f69a0ea80..0f14a0c1e 100644 --- a/aoapplication.h +++ b/aoapplication.h @@ -56,6 +56,7 @@ class AOApplication : public QApplication bool improved_loading_enabled = false; bool desk_mod_enabled = false; bool evidence_enabled = false; + bool modcall_reason_enabled = false; ///////////////loading info/////////////////// diff --git a/courtroom.cpp b/courtroom.cpp index d62569951..880d124d5 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2018,27 +2018,31 @@ void Courtroom::on_spectator_clicked() void Courtroom::on_call_mod_clicked() { - auto box = new QInputDialog(); - box->setLabelText("Enter a reason:"); - auto code = box->exec(); + 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; + } - if (code != QDialog::Accepted) { - delete box; - return; - } + auto text = box->textValue(); + if (text.isEmpty()) + text = "N/A"; - auto text = box->textValue(); - if (text.isEmpty()) - text = "N/A"; + delete box; - QStringList mod_reason; - mod_reason.append(text); + QStringList mod_reason; + mod_reason.append(text); - ao_app->send_server_packet(new AOPacket("ZZ", mod_reason)); + ao_app->send_server_packet(new AOPacket("ZZ", mod_reason)); + } else { + ao_app->send_server_packet(new AOPacket("ZZ")); + } ui_ic_chat_message->setFocus(); - - delete box; } void Courtroom::on_pre_clicked() diff --git a/packet_distribution.cpp b/packet_distribution.cpp index 429951855..6f29b2e21 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") { From 64f0e254cc03d4afcda7cbe5c9ace81852a3a792 Mon Sep 17 00:00:00 2001 From: argoneus Date: Fri, 3 Aug 2018 13:27:12 +0200 Subject: [PATCH 4/6] bumped version to 2.5.0 --- aoapplication.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aoapplication.h b/aoapplication.h index 0f14a0c1e..b432a735e 100644 --- a/aoapplication.h +++ b/aoapplication.h @@ -225,8 +225,8 @@ class AOApplication : public QApplication 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"; From c6251362adbee37f27e0f9ade3cc2b9a3b09e7e9 Mon Sep 17 00:00:00 2001 From: argoneus Date: Fri, 3 Aug 2018 14:58:44 +0200 Subject: [PATCH 5/6] changed Attorney Online 2 to Attorney Online Vidya --- lobby.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lobby.cpp b/lobby.cpp index c0dbf0c33..9761cc030 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); From 806a022a93882eeebed734e2b2941de3b6f5a021 Mon Sep 17 00:00:00 2001 From: argoneus Date: Fri, 3 Aug 2018 15:23:13 +0200 Subject: [PATCH 6/6] added #% for consistency --- courtroom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/courtroom.cpp b/courtroom.cpp index 880d124d5..f6935ba1e 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2039,7 +2039,7 @@ void Courtroom::on_call_mod_clicked() ao_app->send_server_packet(new AOPacket("ZZ", mod_reason)); } else { - ao_app->send_server_packet(new AOPacket("ZZ")); + ao_app->send_server_packet(new AOPacket("ZZ#%")); } ui_ic_chat_message->setFocus();