From 07e1127096d4e47f39facc43ecbf94007c8e08b8 Mon Sep 17 00:00:00 2001 From: windrammer <31085911+likeawindrammer@users.noreply.github.com> Date: Tue, 4 Aug 2020 09:03:40 -0600 Subject: Fix current_display_speed overflow (#232) --- src/courtroom.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 98b6a9c..d727b81 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -2914,6 +2914,12 @@ void Courtroom::chat_tick() next_character_is_not_special = false; } + // Keep the speed at bay. + if (current_display_speed < 0) + current_display_speed = 0; + else if (current_display_speed > 6) + current_display_speed = 6; + if ((message_display_speed[current_display_speed] <= 0 && tick_pos < f_message.size() - 1) || formatting_char) { @@ -2942,12 +2948,6 @@ void Courtroom::chat_tick() ui_vp_message->ensureCursorVisible(); - // Keep the speed at bay. - if (current_display_speed < 0) - current_display_speed = 0; - else if (current_display_speed > 6) - current_display_speed = 6; - // Blip player and real tick pos ticker if (!formatting_char && (f_character != ' ' || blank_blip)) { if (blip_ticker % blip_rate == 0) { -- cgit From 630518020a385391469f0b710a8a59cd2984c2c7 Mon Sep 17 00:00:00 2001 From: windrammer <31085911+likeawindrammer@users.noreply.github.com> Date: Tue, 4 Aug 2020 09:09:27 -0600 Subject: Fix music display disappearing on theme reload (#233) --- src/courtroom.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index d727b81..8223024 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -636,6 +636,7 @@ void Courtroom::set_widgets() } ui_music_display->play("music_display"); + ui_music_display->set_play_once(false); if (is_ao2_bg) { set_size_and_pos(ui_ic_chat_message, "ao2_ic_chat_message"); -- cgit From 0ce60d66a779ee91f85ebc9f92b2fe52c632b868 Mon Sep 17 00:00:00 2001 From: windrammer <31085911+likeawindrammer@users.noreply.github.com> Date: Wed, 5 Aug 2020 08:18:08 -0600 Subject: Fix not using custom chatbox's colors (#228) * Fix not using custom chatbox's colors Moved set_text_color_dropdown() to after current_char is actually updated with the selected char. Otherwise set_text_color_dropdown will try to update the colors with either nothing as character, or with the previously selected character. Use get_chat() so it actually gets the name of the custom chatbox instead of using the same name as the character. Remove the extra "c" since get_chat_color it's already called with this "c" in place. * Fix previous fix crashing the client on DRO servers For some reason the client would work just fine if set_text_color_dropdown() was called only once after updating the character selected by the user. But when joining a DRO server the client would crash just before loading the music. * Improve comment with where crash happens * Fix get_chat_markdown to get the custom chatbox on misc of the char instead of trying to find the character folder on misc * Fix client using the current character colors on other people's messages Also remove the comment explaining the crash if set_text_color_dropdown is removed from set_widgets * Fix loading custom colors loading after the message was added to the log --- src/courtroom.cpp | 14 ++++++++++++-- src/text_file_functions.cpp | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 8223024..a0c7e2c 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -1238,6 +1238,8 @@ void Courtroom::update_character(int p_cid) current_char = f_char; current_side = ao_app->get_char_side(current_char); + set_text_color_dropdown(); + current_emote_page = 0; current_emote = 0; @@ -1879,11 +1881,19 @@ void Courtroom::handle_chatmessage(QStringList *p_contents) ic_chatlog_history.removeFirst(); } - append_ic_text(m_chatmessage[MESSAGE], f_showname, "", m_chatmessage[TEXT_COLOR].toInt()); - QString f_char = m_chatmessage[CHAR_NAME]; QString f_custom_theme = ao_app->get_char_shouts(f_char); + // Load the colors in case it's using a custom chatbox with custom colors. + // Or reload the default ones in case it's not using custom colors + color_rgb_list.clear(); + for (int c = 0; c < max_colors; ++c) { + QColor color = ao_app->get_chat_color("c" + QString::number(c), f_char); + color_rgb_list.append(color); + } + + append_ic_text(m_chatmessage[MESSAGE], f_showname, "", m_chatmessage[TEXT_COLOR].toInt()); + // if an objection is used if (objection_mod <= 4 && objection_mod >= 1) { switch (objection_mod) { diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 39754f3..4ceb29a 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -435,7 +435,7 @@ QString AOApplication::get_tagged_stylesheet(QString target_tag, QString p_file) QString AOApplication::get_chat_markdown(QString p_identifier, QString p_chat) { - QString design_ini_path = get_base_path() + "misc/" + p_chat + "/config.ini"; + QString design_ini_path = get_base_path() + "misc/" + get_chat(p_chat) + "/config.ini"; QString default_path = get_base_path() + "misc/default/config.ini"; QString f_result = read_design_ini(p_identifier, design_ini_path); @@ -449,9 +449,9 @@ QColor AOApplication::get_chat_color(QString p_identifier, QString p_chat) { QColor return_color(255, 255, 255); - QString design_ini_path = get_base_path() + "misc/" + p_chat + "/config.ini"; + QString design_ini_path = get_base_path() + "misc/" + get_chat(p_chat) + "/config.ini"; QString default_path = get_base_path() + "misc/default/config.ini"; - QString f_result = read_design_ini("c" + p_identifier, design_ini_path); + QString f_result = read_design_ini(p_identifier, design_ini_path); if (f_result == "") { f_result = read_design_ini(p_identifier, default_path); -- cgit From 8b44d4ae9599a90579c4fb974fab1704ace8d131 Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sat, 15 Aug 2020 19:40:52 -0500 Subject: Only regenerate the area list once per ARUP packet --- src/packet_distribution.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index b543cfb..fd7453e 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -676,6 +676,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) w_courtroom->arup_modify(arup_type, n_element - 1, f_contents.at(n_element)); } + w_courtroom->list_areas(); } } else if (header == "IL") { -- cgit From 102ca4d64143ecb9401fdb1627ada00194d58dd1 Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sat, 15 Aug 2020 19:47:24 -0500 Subject: Create brushes for area list once --- src/courtroom.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 98b6a9c..54034f8 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -70,6 +70,14 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_background = new AOImage(this, ao_app); + free_brush = *new QBrush(ao_app->get_color("area_free_color", "courtroom_design.ini")); + lfp_brush = *new QBrush(ao_app->get_color("area_lfp_color", "courtroom_design.ini")); + casing_brush = *new QBrush(ao_app->get_color("area_casing_color", "courtroom_design.ini")); + recess_brush = *new QBrush(ao_app->get_color("area_recess_color", "courtroom_design.ini")); + rp_brush = *new QBrush(ao_app->get_color("area_rp_color", "courtroom_design.ini")); + gaming_brush = *new QBrush(ao_app->get_color("area_gaming_color", "courtroom_design.ini")); + locked_brush = *new QBrush(ao_app->get_color("area_locked_color", "courtroom_design.ini")); + ui_viewport = new QWidget(this); ui_vp_background = new AOScene(ui_viewport, ao_app); ui_vp_speedlines = new AOMovie(ui_viewport, ao_app); @@ -1433,15 +1441,6 @@ void Courtroom::list_areas() ui_area_list->clear(); // ui_music_search->setText(""); - QString f_file = "courtroom_design.ini"; - - QBrush free_brush(ao_app->get_color("area_free_color", f_file)); - QBrush lfp_brush(ao_app->get_color("area_lfp_color", f_file)); - QBrush casing_brush(ao_app->get_color("area_casing_color", f_file)); - QBrush recess_brush(ao_app->get_color("area_recess_color", f_file)); - QBrush rp_brush(ao_app->get_color("area_rp_color", f_file)); - QBrush gaming_brush(ao_app->get_color("area_gaming_color", f_file)); - QBrush locked_brush(ao_app->get_color("area_locked_color", f_file)); int n_listed_areas = 0; -- cgit From 002086343a19679b7fb8d8fed8302510456c05c2 Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sun, 16 Aug 2020 04:03:56 -0500 Subject: Check for custom realization sound when using effects list --- src/text_file_functions.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 39754f3..d2ed20a 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -908,6 +908,11 @@ QString AOApplication::get_effect_sound(QString fx_name, QString p_char) f_result = read_design_ini(fx_name, default_path); } } + + if(fx_name == "realization"){ + f_result = get_custom_realization(p_char); + } + return f_result; } -- cgit From cd3ddfe16c423fede1164aa95a36b65caab100e4 Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sun, 16 Aug 2020 07:21:49 -0500 Subject: Update brushes on theme reload --- src/courtroom.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 54034f8..0b0f622 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -70,14 +70,6 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_background = new AOImage(this, ao_app); - free_brush = *new QBrush(ao_app->get_color("area_free_color", "courtroom_design.ini")); - lfp_brush = *new QBrush(ao_app->get_color("area_lfp_color", "courtroom_design.ini")); - casing_brush = *new QBrush(ao_app->get_color("area_casing_color", "courtroom_design.ini")); - recess_brush = *new QBrush(ao_app->get_color("area_recess_color", "courtroom_design.ini")); - rp_brush = *new QBrush(ao_app->get_color("area_rp_color", "courtroom_design.ini")); - gaming_brush = *new QBrush(ao_app->get_color("area_gaming_color", "courtroom_design.ini")); - locked_brush = *new QBrush(ao_app->get_color("area_locked_color", "courtroom_design.ini")); - ui_viewport = new QWidget(this); ui_vp_background = new AOScene(ui_viewport, ao_app); ui_vp_speedlines = new AOMovie(ui_viewport, ao_app); @@ -942,6 +934,14 @@ void Courtroom::set_widgets() ui_spectator->setToolTip(tr("Become a spectator. You won't be able to " "interact with the in-character screen.")); + free_brush = *new QBrush(ao_app->get_color("area_free_color", "courtroom_design.ini")); + lfp_brush = *new QBrush(ao_app->get_color("area_lfp_color", "courtroom_design.ini")); + casing_brush = *new QBrush(ao_app->get_color("area_casing_color", "courtroom_design.ini")); + recess_brush = *new QBrush(ao_app->get_color("area_recess_color", "courtroom_design.ini")); + rp_brush = *new QBrush(ao_app->get_color("area_rp_color", "courtroom_design.ini")); + gaming_brush = *new QBrush(ao_app->get_color("area_gaming_color", "courtroom_design.ini")); + locked_brush = *new QBrush(ao_app->get_color("area_locked_color", "courtroom_design.ini")); + refresh_evidence(); } -- cgit From 42d939614f2ebe30b087405bed49dd7f3ebc172a Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sun, 16 Aug 2020 10:59:06 -0500 Subject: Fix improper bolding behavior due to malformed string literal --- src/courtroom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 98b6a9c..de1273b 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -975,7 +975,7 @@ void Courtroom::set_font(QWidget *widget, QString class_name, } } bool bold = ao_app->get_design_element(p_identifier + "_bold", design_file, p_char) == - 1; // is the font bold or not? + "1"; // is the font bold or not? bool antialias = ao_app->get_design_element(p_identifier + "_sharp", design_file, p_char) != "1"; // is the font anti-aliased or not? -- cgit