added modcall_reason as a FL feature

This commit is contained in:
argoneus 2018-08-03 12:01:50 +02:00
parent 83d30e6920
commit 01e933f6bb
3 changed files with 23 additions and 16 deletions

View File

@ -56,6 +56,7 @@ public:
bool improved_loading_enabled = false; bool improved_loading_enabled = false;
bool desk_mod_enabled = false; bool desk_mod_enabled = false;
bool evidence_enabled = false; bool evidence_enabled = false;
bool modcall_reason_enabled = false;
///////////////loading info/////////////////// ///////////////loading info///////////////////

View File

@ -2018,6 +2018,7 @@ void Courtroom::on_spectator_clicked()
void Courtroom::on_call_mod_clicked() void Courtroom::on_call_mod_clicked()
{ {
if (ao_app->modcall_reason_enabled) {
auto box = new QInputDialog(); auto box = new QInputDialog();
box->setLabelText("Enter a reason:"); box->setLabelText("Enter a reason:");
auto code = box->exec(); auto code = box->exec();
@ -2031,14 +2032,17 @@ void Courtroom::on_call_mod_clicked()
if (text.isEmpty()) if (text.isEmpty())
text = "N/A"; text = "N/A";
delete box;
QStringList mod_reason; QStringList mod_reason;
mod_reason.append(text); 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(); ui_ic_chat_message->setFocus();
delete box;
} }
void Courtroom::on_pre_clicked() void Courtroom::on_pre_clicked()

View File

@ -195,6 +195,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
desk_mod_enabled = true; desk_mod_enabled = true;
if (f_packet.contains("evidence",Qt::CaseInsensitive)) if (f_packet.contains("evidence",Qt::CaseInsensitive))
evidence_enabled = true; evidence_enabled = true;
if (f_packet.contains("modcall_reason",Qt::CaseInsensitive))
modcall_reason_enabled = true;
} }
else if (header == "PN") else if (header == "PN")
{ {