From 7ce1851ee590cf2fc85580d15c648a1610932d20 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Tue, 18 Dec 2018 00:53:23 +0100 Subject: [PATCH] Fixed a bug with the rainbow colour and inline colours. You can now use all the inline commands when your overall text colour is rainbow, like with every other overall text colour. --- courtroom.cpp | 55 ++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/courtroom.cpp b/courtroom.cpp index 2769f77..9f2f7f7 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -2055,33 +2055,6 @@ void Courtroom::chat_tick() if (f_character == " ") ui_vp_message->insertPlainText(" "); - else if (m_chatmessage[TEXT_COLOR].toInt() == RAINBOW) - { - QString html_color; - - switch (rainbow_counter) - { - case 0: - html_color = get_text_color(QString::number(RED)).name(); - break; - case 1: - html_color = get_text_color(QString::number(ORANGE)).name(); - break; - case 2: - html_color = get_text_color(QString::number(YELLOW)).name(); - break; - case 3: - html_color = get_text_color(QString::number(GREEN)).name(); - break; - default: - html_color = get_text_color(QString::number(BLUE)).name(); - rainbow_counter = -1; - } - - ++rainbow_counter; - - ui_vp_message->insertHtml("" + f_character + ""); - } // Escape character. else if (f_character == "\\" and !next_character_is_not_special) @@ -2245,6 +2218,34 @@ void Courtroom::chat_tick() } else { + if (m_chatmessage[TEXT_COLOR].toInt() == RAINBOW) + { + QString html_color; + + switch (rainbow_counter) + { + case 0: + html_color = get_text_color(QString::number(RED)).name(); + break; + case 1: + html_color = get_text_color(QString::number(ORANGE)).name(); + break; + case 2: + html_color = get_text_color(QString::number(YELLOW)).name(); + break; + case 3: + html_color = get_text_color(QString::number(GREEN)).name(); + break; + default: + html_color = get_text_color(QString::number(BLUE)).name(); + rainbow_counter = -1; + } + + ++rainbow_counter; + + ui_vp_message->insertHtml("" + f_character + ""); + } + else ui_vp_message->insertHtml(f_character); }