version++, also some minor fixes

This commit is contained in:
OmniTroid 2017-02-14 02:58:24 +01:00
parent 6e692849a8
commit f8dfc603b9
4 changed files with 57 additions and 38 deletions

View File

@ -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() == "")

View File

@ -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();

View File

@ -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")
{

View File

@ -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()