aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmniTroid <davidskoland@gmail.com>2017-02-14 02:58:24 +0100
committerOmniTroid <davidskoland@gmail.com>2017-02-14 02:58:24 +0100
commitf8dfc603b9e6aace0aca4e5c95f207d41e272013 (patch)
tree099c206dd7c495355c8c466c9ee76aece6a6ffc5
parent6e692849a8d5c7e40af4a3f7031c87330844734c (diff)
version++, also some minor fixes
-rw-r--r--courtroom.cpp13
-rw-r--r--courtroom.h6
-rw-r--r--packet_distribution.cpp71
-rw-r--r--path_functions.cpp5
4 files changed, 57 insertions, 38 deletions
diff --git a/courtroom.cpp b/courtroom.cpp
index 1fef0526..41945fbe 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -46,6 +46,9 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
blip_player = new AOBlipPlayer(this, ao_app);
blip_player->set_volume(0);
+ modcall_player = new AOSfxPlayer(this, ao_app);
+ modcall_player->set_volume(50);
+
ui_background = new AOImage(this, ao_app);
ui_viewport = new QWidget(this);
@@ -57,6 +60,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
ui_vp_chatbox = new AOImage(ui_viewport, ao_app);
ui_vp_showname = new QLabel(ui_vp_chatbox);
ui_vp_message = new QPlainTextEdit(ui_vp_chatbox);
+ ui_vp_message->setFrameStyle(QFrame::NoFrame);
ui_vp_testimony = new AOImage(ui_viewport, ao_app);
ui_vp_realization = new AOImage(this, ao_app);
ui_vp_wtce = new AOMovie(ui_viewport, ao_app);
@@ -401,7 +405,7 @@ void Courtroom::set_widgets()
ui_music_list->setFont(pt_8);
set_size_and_pos(ui_ic_chat_message, "ic_chat_message");
- ui_ic_chat_message->setStyleSheet("background-color: rgba(89, 89, 89, 255);");
+ ui_ic_chat_message->setStyleSheet("background-color: rgba(100, 100, 100, 255);");
ui_muted->resize(ui_ic_chat_message->width(), ui_ic_chat_message->height());
ui_muted->set_image("muted.png");
@@ -1400,6 +1404,13 @@ void Courtroom::set_hp_bar(int p_bar, int p_state)
}
}
+void Courtroom::mod_called(QString p_ip)
+{
+ ui_server_chatlog->appendPlainText(p_ip);
+ if (ui_guard->isChecked())
+ modcall_player->play("sfx-gallery.wav", 50);
+}
+
void Courtroom::on_ooc_return_pressed()
{
if (ui_ooc_chat_message->text() == "" || ui_ooc_chat_name->text() == "")
diff --git a/courtroom.h b/courtroom.h
index d1a77d00..dabbcd79 100644
--- a/courtroom.h
+++ b/courtroom.h
@@ -181,6 +181,8 @@ private:
AOSfxPlayer *sfx_player;
AOBlipPlayer *blip_player;
+ AOSfxPlayer *modcall_player;
+
AOImage *ui_background;
QWidget *ui_viewport;
@@ -242,7 +244,7 @@ private:
QCheckBox *ui_pre;
QCheckBox *ui_flip;
QCheckBox *ui_guard;
-\
+
AOButton *ui_custom_objection;
AOButton *ui_realization;
AOButton *ui_mute;
@@ -289,6 +291,8 @@ public slots:
void show_testimony();
void hide_testimony();
+ void mod_called(QString p_ip);
+
private slots:
void start_chat_ticking();
void play_sfx();
diff --git a/packet_distribution.cpp b/packet_distribution.cpp
index a526acf9..239d0793 100644
--- a/packet_distribution.cpp
+++ b/packet_distribution.cpp
@@ -67,6 +67,41 @@ void AOApplication::ms_packet_received(AOPacket *p_packet)
w_courtroom->append_ms_chatmessage(message_line);
}
}
+ else if (header == "AO2CHECK")
+ {
+ if (f_contents.size() < 1)
+ goto end;
+
+ QStringList version_contents = f_contents.at(0).split(".");
+
+ if (version_contents.size() < 3)
+ goto end;
+
+ int f_release = version_contents.at(0).toInt();
+ int f_major = version_contents.at(1).toInt();
+ int f_minor = version_contents.at(2).toInt();
+
+ //qDebug() << "local version: " << get_version_string();
+ //qDebug() << "remote version: " << QString::number(f_release) << QString::number(f_major) << QString::number(f_minor);
+
+ if (get_release() > f_release)
+ goto end;
+ else if (get_release() == f_release)
+ {
+ if (get_major_version() > f_major)
+ goto end;
+ else if (get_major_version() == f_major)
+ {
+ if (get_minor_version() >= f_minor)
+ goto end;
+ }
+ }
+
+ call_notice("Outdated version! Your version: " + get_version_string()
+ + "\nPlease go to aceattorneyonline.com to update.");
+ destruct_courtroom();
+ destruct_lobby();
+ }
end:
@@ -479,40 +514,10 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
{
call_notice("You are banned on this server.");
}
- else if (header == "AO2CHECK")
+ else if (header == "ZZ")
{
- if (f_contents.size() < 1)
- goto end;
-
- QStringList version_contents = f_contents.at(0).split(".");
-
- if (version_contents.size() < 3)
- goto end;
-
- int f_release = version_contents.at(0).toInt();
- int f_major = version_contents.at(1).toInt();
- int f_minor = version_contents.at(2).toInt();
-
- //qDebug() << "local version: " << get_version_string();
- //qDebug() << "remote version: " << QString::number(f_release) << QString::number(f_major) << QString::number(f_minor);
-
- if (get_release() > f_release)
- goto end;
- else if (get_release() == f_release)
- {
- if (get_major_version() > f_major)
- goto end;
- else if (get_major_version() == f_major)
- {
- if (get_minor_version() >= f_minor)
- goto end;
- }
- }
-
- call_notice("Outdated version! Your version: " + get_version_string()
- + "\nPlease go to aceattorneyonline.com to update.");
- destruct_courtroom();
- destruct_lobby();
+ if (courtroom_constructed && f_contents.size() > 0)
+ w_courtroom->mod_called(f_contents.at(0));
}
else if (header == "checkconnection")
{
diff --git a/path_functions.cpp b/path_functions.cpp
index 5c58e3d1..518da434 100644
--- a/path_functions.cpp
+++ b/path_functions.cpp
@@ -8,14 +8,13 @@
#include <QDebug>
#endif
-QString AOApplication::get_base_path(){
-
+QString AOApplication::get_base_path()
+{
#ifdef OMNI_DEBUG
return "/media/omnitroid/Data/winshare/AO/client/base/";
#else
return (QDir::currentPath() + "/base/");
#endif
-
}
QString AOApplication::get_theme_path()