aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCerapter <cerap@protonmail.com>2018-09-20 23:14:32 +0200
committerCerapter <cerap@protonmail.com>2018-09-20 23:14:32 +0200
commitff0f8c268a36129635a8d9f459a9e511b599260f (patch)
tree95a4c785c52d31c2327abaa5d3e6abd40a81f644
parentab49e69067bf0d6f0c9591602f03ed61b21214c7 (diff)
Full stops force the idle anim to play.
-rw-r--r--courtroom.cpp34
-rw-r--r--courtroom.h2
2 files changed, 35 insertions, 1 deletions
diff --git a/courtroom.cpp b/courtroom.cpp
index 418bacdf..48e456f7 100644
--- a/courtroom.cpp
+++ b/courtroom.cpp
@@ -2072,6 +2072,9 @@ void Courtroom::start_chat_ticking()
// let's set it to false.
inline_blue_depth = 0;
+ // And also, reset the fullstop bool.
+ previous_character_is_fullstop = false;
+
// At the start of every new message, we set the text speed to the default.
current_display_speed = 3;
chat_tick_timer->start(message_display_speed[current_display_speed]);
@@ -2225,7 +2228,8 @@ void Courtroom::chat_tick()
// If it isn't, we start talking if we have completely climbed out of inline blues.
if (!entire_message_is_blue)
{
- if (inline_blue_depth == 0 and anim_state != 4)
+ // We should only go back to talking if we're out of inline blues, not during a non. int. pre, and not on the last character.
+ if (inline_blue_depth == 0 and anim_state != 4 and !(tick_pos+1 >= f_message.size()))
{
QString f_char = m_chatmessage[CHAR_NAME];
QString f_emote = m_chatmessage[EMOTE];
@@ -2285,6 +2289,20 @@ void Courtroom::chat_tick()
}
}
+ // Silencing the character during long times of ellipses.
+ else if (f_character == "." and !next_character_is_not_special and !previous_character_is_fullstop)
+ {
+ if (!previous_character_is_fullstop && inline_blue_depth == 0 && !entire_message_is_blue)
+ {
+ QString f_char = m_chatmessage[CHAR_NAME];
+ QString f_emote = m_chatmessage[EMOTE];
+ ui_vp_player_char->play_idle(f_char, f_emote);
+ }
+ previous_character_is_fullstop = true;
+ next_character_is_not_special = true;
+ formatting_char = true;
+ tick_pos--;
+ }
else
{
next_character_is_not_special = false;
@@ -2324,6 +2342,20 @@ void Courtroom::chat_tick()
}
}
+ // Basically only go back to talkin if:
+ // - This character is not a fullstop
+ // - But the previous character was
+ // - And we're out of inline blues
+ // - And the entire messages isn't blue
+ // - And this isn't the last character.
+ if (f_character != "." && previous_character_is_fullstop && inline_blue_depth == 0 && !entire_message_is_blue && tick_pos+1 >= f_message.size())
+ {
+ QString f_char = m_chatmessage[CHAR_NAME];
+ QString f_emote = m_chatmessage[EMOTE];
+ ui_vp_player_char->play_talking(f_char, f_emote);
+ previous_character_is_fullstop = false;
+ }
+
QScrollBar *scroll = ui_vp_message->verticalScrollBar();
scroll->setValue(scroll->maximum());
diff --git a/courtroom.h b/courtroom.h
index 1115e369..4aa4f006 100644
--- a/courtroom.h
+++ b/courtroom.h
@@ -227,6 +227,8 @@ private:
bool next_character_is_not_special = false; // If true, write the
// next character as it is.
+ bool previous_character_is_fullstop = false; // Used for silencing the character during long ellipses.
+
bool message_is_centered = false;
int current_display_speed = 3;