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/text_file_functions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/text_file_functions.cpp') diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 39754f39..4ceb29a3 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 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/text_file_functions.cpp') diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 39754f39..d2ed20ab 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 ecb0ee42a3a399c092eafdf2ac60faaad4bf119f Mon Sep 17 00:00:00 2001 From: scatterflower Date: Sun, 16 Aug 2020 21:59:44 -0500 Subject: clang format --- src/text_file_functions.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/text_file_functions.cpp') diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 45dd34f6..33a18d54 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -435,7 +435,8 @@ 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/" + get_chat(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,7 +450,8 @@ 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/" + get_chat(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); @@ -909,8 +911,8 @@ QString AOApplication::get_effect_sound(QString fx_name, QString p_char) } } - if(fx_name == "realization"){ - f_result = get_custom_realization(p_char); + if (fx_name == "realization") { + f_result = get_custom_realization(p_char); } return f_result; @@ -1056,7 +1058,7 @@ QString AOApplication::get_casing_can_host_cases() } bool AOApplication::get_auto_logging_enabled() { - QString result = - configini->value("automatic_logging_enabled", "true").value(); - return result.startsWith("true"); + QString result = + configini->value("automatic_logging_enabled", "true").value(); + return result.startsWith("true"); } -- cgit From cef0ebc6eb2ac549a5475bee332be35ab7f565fc Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 19 Aug 2020 19:16:41 +0300 Subject: IC log rewrite (#259) * Rewrite the IC Log code to drastically reduce code duplication and have both downward and upward mode in the same function Regenerate the IC Log in set_widgets() function, making sure the maximum_blocks is accounted for and clearing the log to prepare for different log mode (upwards/downwards) if it's different from previous Add placeholder text telling the user the direction in which the log will go Remove useless first_message_sent global boolean, a remnant from a w e a k e r c o d e r m a n * Add log_colors boolean to reduce color I/O happening in append_ic_text (optimization meme) Clear the IC log when log_colors setting changes and reload theme is pressed Fix https://github.com/AttorneyOnline/AO2-Client/issues/221 * Add configurable margin between IC log entries Add configurable newline/singleline log mode Options in settings for these * Add optional timestamps * Un-hardcode "played music" from the chatlogpiece and introduce the "action" argument so that "presented evidence" is fully supported now Translate "has presented evidence" Regenerate IC chatlog instead of clearing it, properly updating every element with the new configurations * Go away *temp, code duplication making me shid and cry rn Why is this not done in append_ic_text, or why isn't there a dedicated ic logging func aAAAaaaaAAAaa Fix presenting evidence not being properly logged Fix timestamp being UTC instead of local time (local time will not be as confusing) * okok it was a joke a big ol bamboozle you got gnomed haha rick rolled beaned stickbugged I did NOT copy paste code, no, I actually intended to fix copy pasted code all along. log_ic_text was always planned. (Fix copypasted code for ic_chatlog_history and consolidate it into a single log_ic_text func) --- src/text_file_functions.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/text_file_functions.cpp') diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp index 33a18d54..8247fd86 100644 --- a/src/text_file_functions.cpp +++ b/src/text_file_functions.cpp @@ -53,6 +53,26 @@ bool AOApplication::get_log_goes_downwards() return result.startsWith("true"); } +bool AOApplication::get_log_newline() +{ + QString result = + configini->value("log_newline", "false").value(); + return result.startsWith("true"); +} + +int AOApplication::get_log_margin() +{ + int result = configini->value("log_margin", 0).toInt(); + return result; +} + +bool AOApplication::get_log_timestamp() +{ + QString result = + configini->value("log_timestamp", "false").value(); + return result.startsWith("true"); +} + bool AOApplication::get_showname_enabled_by_default() { QString result = -- cgit