Merge pull request #316 from AttorneyOnline/messagebox
add BB packet for a MessageBox popup
This commit is contained in:
commit
d308fc83de
@ -133,7 +133,7 @@ void Courtroom::char_clicked(int n_char)
|
|||||||
qDebug() << "char_ini_path" << char_ini_path;
|
qDebug() << "char_ini_path" << char_ini_path;
|
||||||
|
|
||||||
if (!file_exists(char_ini_path)) {
|
if (!file_exists(char_ini_path)) {
|
||||||
call_notice("Could not find " + char_ini_path);
|
call_error("Could not find " + char_ini_path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
#include "debug_functions.h"
|
#include "debug_functions.h"
|
||||||
|
|
||||||
@ -24,6 +26,10 @@ void call_notice(QString p_message)
|
|||||||
msgBox->setWindowTitle(
|
msgBox->setWindowTitle(
|
||||||
QCoreApplication::translate("debug_functions", "Notice"));
|
QCoreApplication::translate("debug_functions", "Notice"));
|
||||||
|
|
||||||
// msgBox->setWindowModality(Qt::NonModal);
|
msgBox->setStandardButtons(QMessageBox::NoButton);
|
||||||
msgBox->exec();
|
|
||||||
|
QTimer::singleShot(3000, msgBox, std::bind(&QMessageBox::setStandardButtons,msgBox,QMessageBox::Ok));
|
||||||
|
|
||||||
|
msgBox->exec();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -535,6 +535,11 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
|
|||||||
if (courtroom_constructed && f_contents.size() > 0)
|
if (courtroom_constructed && f_contents.size() > 0)
|
||||||
w_courtroom->set_mute(false, f_contents.at(0).toInt());
|
w_courtroom->set_mute(false, f_contents.at(0).toInt());
|
||||||
}
|
}
|
||||||
|
else if (header == "BB") {
|
||||||
|
if (courtroom_constructed && f_contents.size() >= 1) {
|
||||||
|
call_notice(f_contents.at(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (header == "KK") {
|
else if (header == "KK") {
|
||||||
if (courtroom_constructed && f_contents.size() >= 1) {
|
if (courtroom_constructed && f_contents.size() >= 1) {
|
||||||
call_notice(tr("You have been kicked from the server.\nReason: %1")
|
call_notice(tr("You have been kicked from the server.\nReason: %1")
|
||||||
|
Loading…
Reference in New Issue
Block a user