Modified the centering behaviour.

Now only the two beginning tildes get removed.
This is so that people can do location and time announcements.
This commit is contained in:
Cerapter 2018-07-29 15:48:11 +02:00
parent 0561ae7fd6
commit 95d521de9e

View File

@ -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! // Don't forget, the p_text part actually everything after the name!
// Hence why we check for ': ~~'. // Hence why we check for ': ~~'.
// If the user decided to put a space after the two tildes, remove that // Let's remove those two tildes, then.
// in one go. // : _ ~ ~
p_text.remove("~~ "); // 0 1 2 3
p_text.remove(2,2);
// Remove all remaining ~~s.
p_text.remove("~~");
} }
// Get rid of the inline-colouring. // Get rid of the inline-colouring.
@ -1543,6 +1541,13 @@ void Courtroom::chat_tick()
// Stops blips from playing when we have a formatting option. // Stops blips from playing when we have a formatting option.
bool formatting_char = false; 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()) if (tick_pos >= f_message.size())
{ {
text_state = 2; text_state = 2;