From ea78916cc43fe67690f2f92d88ac4a8b0e9857d8 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 5 Feb 2021 17:38:30 -0500 Subject: Added little bobbing "next message" arrow --- src/message_system.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/message_system.cpp') diff --git a/src/message_system.cpp b/src/message_system.cpp index 08ef799..0b0d53e 100644 --- a/src/message_system.cpp +++ b/src/message_system.cpp @@ -3,7 +3,7 @@ #include "util.h" const int CHARS_TO_REVEAL = 1; -const int CHARS_PER_BEEP = 10; +const int CHARS_PER_BEEP = 8; void MessageSystem::tick(double dt) { if (barsState_ == BarsState::Opening || barsState_ == BarsState::Closing) { @@ -59,6 +59,27 @@ void MessageSystem::tick(double dt) { linesToShow_.push_back(MessageLine { .text = lines_.front() }); lines_.pop_front(); + } else { + showNextArrow_ = true; + } + } + } + + if (showNextArrow_) { + nextArrowBobTimer_.accumulate(dt); + while (nextArrowBobTimer_.step()) { + if (nextArrowBobDown_) { + nextArrowBobPos_++; + + if (nextArrowBobPos_ >= 4) { + nextArrowBobDown_ = false; + } + } else { + nextArrowBobPos_--; + + if (nextArrowBobPos_ <= 0) { + nextArrowBobDown_ = true; + } } } } @@ -172,6 +193,7 @@ void MessageSystem::advanceText() { } lines_.pop_front(); + showNextArrow_ = false; if (lines_.empty()) { linesToShow_.clear(); -- cgit 1.4.1