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 desk_mod_enabled = false;
bool evidence_enabled = false;
bool modcall_reason_enabled = false;
///////////////loading info///////////////////

View File

@ -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;
}
auto text = box->textValue();
if (text.isEmpty())
text = "N/A";
if (code != QDialog::Accepted) {
delete box;
return;
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"));
}
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()

View File

@ -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")
{