Overlays: Implement individual pulse

This commit is contained in:
Megamouse 2021-03-09 20:40:14 +01:00
parent cfa2d4aaa8
commit 40f3adc45f
8 changed files with 77 additions and 13 deletions

View file

@ -31,6 +31,8 @@ namespace rsx
void edit_text::move_caret(direction dir)
{
m_reset_caret_pulse = true;
switch (dir)
{
case direction::left:
@ -112,6 +114,7 @@ namespace rsx
}
caret_position += ::narrow<u16>(str.length());
m_reset_caret_pulse = true;
refresh();
}
@ -136,6 +139,7 @@ namespace rsx
}
caret_position--;
m_reset_caret_pulse = true;
refresh();
}
@ -155,6 +159,13 @@ namespace rsx
caret.back_color = fore_color;
caret.pulse_effect_enabled = true;
if (m_reset_caret_pulse)
{
// Reset the pulse slightly below 1 rising on each user interaction
caret.set_sinus_offset(1.6f);
m_reset_caret_pulse = false;
}
compiled.add(caret.get_compiled());
for (auto& cmd : compiled.draw_commands)