More accurate/consistent blip rate functionality inspired by https://youtu.be/Min0hkwO43g

This commit is contained in:
Crystalwarrior 2020-09-11 22:17:13 +03:00
parent fe5128280c
commit 8cc067dee4
2 changed files with 16 additions and 4 deletions

View File

@ -311,7 +311,7 @@ private:
int real_tick_pos = 0; int real_tick_pos = 0;
// used to determine how often blips sound // used to determine how often blips sound
int blip_ticker = 0; int blip_ticker = 0;
int blip_rate = 1; int blip_rate = 2;
int rainbow_counter = 0; int rainbow_counter = 0;
bool rainbow_appended = false; bool rainbow_appended = false;
bool blank_blip = false; bool blank_blip = false;

View File

@ -2938,11 +2938,23 @@ void Courtroom::chat_tick()
ui_vp_message->ensureCursorVisible(); ui_vp_message->ensureCursorVisible();
// Blip player and real tick pos ticker // We blip every "blip rate" letters.
if (!formatting_char && (f_character != ' ' || blank_blip)) { // Here's an example with blank_blip being false and blip_rate being 2:
// I am you
// ! ! ! !
// where ! is the blip sound
if (blip_ticker % blip_rate == 0) { if (blip_ticker % blip_rate == 0) {
// ignoring white space unless blank_blip is enabled.
if (!formatting_char && (f_character != ' ' || blank_blip)) {
blip_player->blip_tick(); blip_player->blip_tick();
++blip_ticker;
} }
}
else
{
// Don't fully ignore whitespace still, keep ticking until
// we reached the need to play a blip sound - we also just
// need to wait for a letter to play it on.
++blip_ticker; ++blip_ticker;
} }