added modcall_reason as a FL feature
This commit is contained in:
		
							parent
							
								
									83d30e6920
								
							
						
					
					
						commit
						01e933f6bb
					
				@ -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///////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2018,27 +2018,31 @@ void Courtroom::on_spectator_clicked()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void Courtroom::on_call_mod_clicked()
 | 
					void Courtroom::on_call_mod_clicked()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  auto box = new QInputDialog();
 | 
					  if (ao_app->modcall_reason_enabled) {
 | 
				
			||||||
  box->setLabelText("Enter a reason:");
 | 
					    auto box = new QInputDialog();
 | 
				
			||||||
  auto code = box->exec();
 | 
					    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;
 | 
					    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();
 | 
					  ui_ic_chat_message->setFocus();
 | 
				
			||||||
 | 
					 | 
				
			||||||
  delete box;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Courtroom::on_pre_clicked()
 | 
					void Courtroom::on_pre_clicked()
 | 
				
			||||||
 | 
				
			|||||||
@ -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")
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user