Merge pull request #1 from argoneuscze/modcall_reason
Added support for modcall reasons
This commit is contained in:
		
						commit
						a8344ced3f
					
				@ -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///////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -224,8 +225,8 @@ public:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
  const int RELEASE = 2;
 | 
					  const int RELEASE = 2;
 | 
				
			||||||
  const int MAJOR_VERSION = 4;
 | 
					  const int MAJOR_VERSION = 5;
 | 
				
			||||||
  const int MINOR_VERSION = 10;
 | 
					  const int MINOR_VERSION = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QString current_theme = "default";
 | 
					  QString current_theme = "default";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -2018,7 +2018,29 @@ 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();
 | 
				
			||||||
 | 
					    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#%"));
 | 
					    ao_app->send_server_packet(new AOPacket("ZZ#%"));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ui_ic_chat_message->setFocus();
 | 
					  ui_ic_chat_message->setFocus();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -43,6 +43,7 @@
 | 
				
			|||||||
#include <QSignalMapper>
 | 
					#include <QSignalMapper>
 | 
				
			||||||
#include <QMap>
 | 
					#include <QMap>
 | 
				
			||||||
#include <QTextBrowser>
 | 
					#include <QTextBrowser>
 | 
				
			||||||
 | 
					#include <QInputDialog>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class AOApplication;
 | 
					class AOApplication;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -12,7 +12,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow()
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  ao_app = p_ao_app;
 | 
					  ao_app = p_ao_app;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  this->setWindowTitle("Attorney Online 2");
 | 
					  this->setWindowTitle("Attorney Online Vidya (AO2)");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ui_background = new AOImage(this, ao_app);
 | 
					  ui_background = new AOImage(this, ao_app);
 | 
				
			||||||
  ui_public_servers = new AOButton(this, ao_app);
 | 
					  ui_public_servers = new AOButton(this, ao_app);
 | 
				
			||||||
 | 
				
			|||||||
@ -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