From 5ab50c843174b714e7aca807d9aeec1b70f21679 Mon Sep 17 00:00:00 2001 From: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> Date: Tue, 6 Oct 2020 12:43:50 +0200 Subject: [PATCH 1/4] add BB packet for a MessageBox popup --- src/packet_distribution.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index e4e5d5c..ee56cdb 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -691,6 +691,11 @@ void AOApplication::server_packet_received(AOPacket *p_packet) if (courtroom_constructed && f_contents.size() > 0) 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") { if (courtroom_constructed && f_contents.size() >= 1) { call_notice(tr("You have been kicked from the server.\nReason: %1") From 04ed1a1812139b0cbef5599a6acd8ee9c3155c2f Mon Sep 17 00:00:00 2001 From: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> Date: Mon, 4 Jan 2021 16:44:14 +0100 Subject: [PATCH 2/4] add 3 second timer before OK shows up --- src/debug_functions.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/debug_functions.cpp b/src/debug_functions.cpp index b832164..f96d6b0 100644 --- a/src/debug_functions.cpp +++ b/src/debug_functions.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "debug_functions.h" @@ -24,6 +25,10 @@ void call_notice(QString p_message) msgBox->setWindowTitle( QCoreApplication::translate("debug_functions", "Notice")); - // msgBox->setWindowModality(Qt::NonModal); - msgBox->exec(); + msgBox->setStandardButtons(QMessageBox::NoButton); + + QTimer::singleShot(3000, msgBox, std::bind(&QMessageBox::setStandardButtons,msgBox,QMessageBox::Ok)); + + msgBox->exec(); + } From 714f54b9dccf1efbdd524e17b2dd4f4deefc8a01 Mon Sep 17 00:00:00 2001 From: stonedDiscord <10584181+stonedDiscord@users.noreply.github.com> Date: Mon, 4 Jan 2021 18:05:03 +0100 Subject: [PATCH 3/4] CI needs an extra include for bind --- src/debug_functions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/debug_functions.cpp b/src/debug_functions.cpp index f96d6b0..477eec7 100644 --- a/src/debug_functions.cpp +++ b/src/debug_functions.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "debug_functions.h" From c4b739292a217bb6a844d3ef4e89b656ab3f2d4b Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Wed, 6 Jan 2021 11:43:31 -0600 Subject: [PATCH 4/4] Use call_error() for character load error message --- src/charselect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charselect.cpp b/src/charselect.cpp index 8e0aab5..7356089 100644 --- a/src/charselect.cpp +++ b/src/charselect.cpp @@ -131,7 +131,7 @@ void Courtroom::char_clicked(int n_char) qDebug() << "char_ini_path" << 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; } }