aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aoapplication.h3
-rw-r--r--aomovie.cpp12
-rw-r--r--aomovie.h2
-rw-r--r--courtroom.cpp26
-rw-r--r--lobby.cpp1
-rw-r--r--packet_distribution.cpp3
-rw-r--r--text_file_functions.cpp11
7 files changed, 43 insertions, 15 deletions
diff --git a/aoapplication.h b/aoapplication.h
index a259ee7..23e31d0 100644
--- a/aoapplication.h
+++ b/aoapplication.h
@@ -55,6 +55,8 @@ public:
//player number, it's hardly used but might be needed for some old servers
int s_pv = 0;
+ QString server_software = "";
+
int char_list_size = 0;
int loaded_chars = 0;
int evidence_list_size = 0;
@@ -113,6 +115,7 @@ public:
QString get_char_side(QString p_char);
QString get_showname(QString p_char);
QString get_chat(QString p_char);
+ QString get_char_shouts(QString p_char);
int get_preanim_duration(QString p_char, QString p_emote);
int get_ao2_preanim_duration(QString p_char, QString p_emote);
int get_text_delay(QString p_char, QString p_emote);
diff --git a/aomovie.cpp b/aomovie.cpp
index 9e1b64e..90c3701 100644
--- a/aomovie.cpp
+++ b/aomovie.cpp
@@ -20,13 +20,19 @@ void AOMovie::set_play_once(bool p_play_once)
play_once = p_play_once;
}
-void AOMovie::play(QString p_gif, QString p_char)
+void AOMovie::play(QString p_gif, QString p_char, QString p_custom_theme)
{
m_movie->stop();
QString gif_path;
- QString custom_path = ao_app->get_character_path(p_char) + p_gif + ".gif";
+ QString custom_path;
+ if (p_gif == "custom")
+ custom_path = ao_app->get_character_path(p_char) + p_gif + ".gif";
+ else
+ custom_path = ao_app->get_character_path(p_char) + p_gif + "_bubble.gif";
+
+ QString custom_theme_path = ao_app->get_base_path() + "themes/" + p_custom_theme + "/" + p_gif + ".gif";
QString theme_path = ao_app->get_theme_path() + p_gif + ".gif";
QString default_theme_path = ao_app->get_default_theme_path() + p_gif + ".gif";
QString placeholder_path = ao_app->get_theme_path() + "placeholder.gif";
@@ -34,6 +40,8 @@ void AOMovie::play(QString p_gif, QString p_char)
if (file_exists(custom_path))
gif_path = custom_path;
+ else if (file_exists(custom_theme_path))
+ gif_path = custom_theme_path;
else if (file_exists(theme_path))
gif_path = theme_path;
else if (file_exists(default_theme_path))
diff --git a/aomovie.h b/aomovie.h
index 4b3eb48..1f278bf 100644
--- a/aomovie.h
+++ b/aomovie.h
@@ -15,7 +15,7 @@ public:
AOMovie(QWidget *p_parent, AOApplication *p_ao_app);
void set_play_once(bool p_play_once);
- void play(QString p_gif, QString p_char = "");
+ void play(QString p_gif, QString p_char = "", QString p_custom_theme = "");
void combo_resize(int w, int h);
void stop();
diff --git a/courtroom.cpp b/courtroom.cpp
index d4290bf..1c5cd6e 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -596,6 +596,8 @@ void Courtroom::done_received()
void Courtroom::set_background(QString p_background)
{
+ testimony_in_progress = false;
+
current_background = p_background;
QString bg_path = get_background_path();
@@ -940,7 +942,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
chatmessage_is_empty = m_chatmessage[MESSAGE] == " " || m_chatmessage[MESSAGE] == "";
- if (m_chatmessage[MESSAGE] == ui_ic_chat_message->text())
+ if (m_chatmessage[MESSAGE] == ui_ic_chat_message->text() && m_chatmessage[CHAR_ID].toInt() == m_cid)
{
ui_ic_chat_message->clear();
objection_state = 0;
@@ -958,6 +960,8 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
previous_ic_message = f_message;
int objection_mod = m_chatmessage[OBJECTION_MOD].toInt();
+ QString f_char = m_chatmessage[CHAR_NAME];
+ QString f_custom_theme = ao_app->get_char_shouts(f_char);
//if an objection is used
if (objection_mod <= 4 && objection_mod >= 1)
@@ -965,21 +969,21 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
switch (objection_mod)
{
case 1:
- ui_vp_objection->play("holdit");
- objection_player->play("holdit.wav", m_chatmessage[CHAR_NAME]);
+ ui_vp_objection->play("holdit", f_char, f_custom_theme);
+ objection_player->play("holdit.wav", f_char);
break;
case 2:
- ui_vp_objection->play("objection");
- objection_player->play("objection.wav", m_chatmessage[CHAR_NAME]);
+ ui_vp_objection->play("objection", f_char, f_custom_theme);
+ objection_player->play("objection.wav", f_char);
break;
case 3:
- ui_vp_objection->play("takethat");
- objection_player->play("takethat.wav", m_chatmessage[CHAR_NAME]);
+ ui_vp_objection->play("takethat", f_char, f_custom_theme);
+ objection_player->play("takethat.wav", f_char);
break;
//case 4 is AO2 only
case 4:
- ui_vp_objection->play("custom", m_chatmessage[CHAR_NAME]);
- objection_player->play("custom.wav", m_chatmessage[CHAR_NAME]);
+ ui_vp_objection->play("custom", f_char, f_custom_theme);
+ objection_player->play("custom.wav", f_char);
break;
default:
qDebug() << "W: Logic error in objection switch statement!";
@@ -1933,6 +1937,10 @@ void Courtroom::check_connection_received()
void Courtroom::connection_timeout()
{
+ //cheap hack because demonsoftware refuses to conform to standards
+ if (ao_app->server_software.startsWith("AODemon"))
+ return;
+
call_notice("Disconnected from server.");
ao_app->construct_lobby();
ao_app->destruct_courtroom();
diff --git a/lobby.cpp b/lobby.cpp
index 55f6e8c..0ded1fb 100644
--- a/lobby.cpp
+++ b/lobby.cpp
@@ -26,6 +26,7 @@ Lobby::Lobby(AOApplication *p_ao_app) : QMainWindow()
ui_player_count = new QLabel(this);
ui_description = new QPlainTextEdit(this);
ui_chatbox = new QTextBrowser(this);
+ ui_chatbox->setOpenExternalLinks(true);
ui_chatname = new QLineEdit(this);
ui_chatname->setPlaceholderText("Name");
ui_chatmessage = new QLineEdit(this);
diff --git a/packet_distribution.cpp b/packet_distribution.cpp
index ed47587..a952b76 100644
--- a/packet_distribution.cpp
+++ b/packet_distribution.cpp
@@ -116,7 +116,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
QString f_packet = p_packet->to_string();
if (header != "checkconnection")
- qDebug() << "R: " << f_packet;
+ qDebug() << "R:" << f_packet;
if (header == "decryptor")
{
@@ -146,6 +146,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
goto end;
s_pv = f_contents.at(0).toInt();
+ server_software = f_contents.at(1);
QString server_software = f_contents.at(1);
diff --git a/text_file_functions.cpp b/text_file_functions.cpp
index 5c7f89e..82e76a8 100644
--- a/text_file_functions.cpp
+++ b/text_file_functions.cpp
@@ -19,7 +19,7 @@ QString AOApplication::read_config(QString searchline)
while(!in.atEnd())
{
- QString f_line = in.readLine();
+ QString f_line = in.readLine().trimmed();
if (!f_line.startsWith(searchline))
continue;
@@ -163,7 +163,7 @@ QString AOApplication::read_design_ini(QString p_identifier, QString p_design_pa
while (!in.atEnd())
{
- QString f_line = in.readLine();
+ QString f_line = in.readLine().trimmed();
if (!f_line.startsWith(p_identifier))
continue;
@@ -362,6 +362,13 @@ QString AOApplication::get_chat(QString p_char)
return f_result.toLower();
}
+QString AOApplication::get_char_shouts(QString p_char)
+{
+ QString f_result = read_char_ini(p_char, "shouts", "[Options]", "[Time]");
+
+ return f_result.toLower();
+}
+
int AOApplication::get_preanim_duration(QString p_char, QString p_emote)
{
QString f_result = read_char_ini(p_char, p_emote, "[Time]", "[Emotions]");