diff options
| author | Cerapter <cerap@protonmail.com> | 2018-12-18 00:53:23 +0100 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-12-18 00:53:23 +0100 |
| commit | 7ce1851ee590cf2fc85580d15c648a1610932d20 (patch) | |
| tree | ea2ae84429d2045c1d0b7b9f02a35ee98b57bb39 /courtroom.cpp | |
| parent | 80af3fb3ffb73eb927c214fff7ef5ce61c463e6a (diff) | |
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.
Diffstat (limited to 'courtroom.cpp')
| -rw-r--r-- | courtroom.cpp | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/courtroom.cpp b/courtroom.cpp index 2769f77d..9f2f7f7d 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("<font color=\"" + html_color + "\">" + f_character + "</font>"); - } // 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("<font color=\"" + html_color + "\">" + f_character + "</font>"); + } + else ui_vp_message->insertHtml(f_character); } |
