aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-07-29 15:48:11 +0200
committerCerapter <cerap@protonmail.com>2018-07-29 15:48:11 +0200
commit95d521de9eb64fb355be2db88bf7b47c368193b8 (patch)
tree3464343ee3603eccbc1e2829507b86aa5c937b61
parent0561ae7fd6458a310d29e5cde4dfa30877365fcb (diff)
Modified the centering behaviour.
Now only the two beginning tildes get removed. This is so that people can do location and time announcements.
-rw-r--r--courtroom.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/courtroom.cpp b/courtroom.cpp
index ec1393b..8f8bc37 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -1260,12 +1260,10 @@ void Courtroom::append_ic_text(QString p_text, QString p_name)
// Don't forget, the p_text part actually everything after the name!
// Hence why we check for ': ~~'.
- // If the user decided to put a space after the two tildes, remove that
- // in one go.
- p_text.remove("~~ ");
-
- // Remove all remaining ~~s.
- p_text.remove("~~");
+ // Let's remove those two tildes, then.
+ // : _ ~ ~
+ // 0 1 2 3
+ p_text.remove(2,2);
}
// Get rid of the inline-colouring.
@@ -1543,6 +1541,13 @@ void Courtroom::chat_tick()
// Stops blips from playing when we have a formatting option.
bool formatting_char = false;
+ // If previously, we have detected that the message is centered, now
+ // is the time to remove those two tildes at the start.
+ if (message_is_centered)
+ {
+ f_message.remove(0,2);
+ }
+
if (tick_pos >= f_message.size())
{
text_state = 2;