feat: Enhance weapon switching logic and add tests for animation pacing and menu behavior

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-23 12:35:31 +01:00
parent 827b8c779e
commit a66ccf52c5
6 changed files with 66 additions and 15 deletions
@@ -2094,7 +2094,7 @@ class AsciiRenderer extends CliRendererBackend<dynamic> {
@override
dynamic finalizeFrame() {
if (engine.difficulty != null) {
if (engine.difficulty != null && !engine.isMenuOpen) {
if (engine.player.damageFlash > 0.0) {
if (_usesTerminalLayout) {
_applyDamageFlashToScene();
@@ -1336,7 +1336,7 @@ class SixelRenderer extends CliRendererBackend<String> {
sb.write('\x1bPq');
sb.write('"1;1;$_outputWidth;$_outputHeight');
final bool gameplayActive = engine.difficulty != null;
final bool gameplayActive = engine.difficulty != null && !engine.isMenuOpen;
final double damageIntensity = gameplayActive
? engine.player.damageFlash
: 0.0;
@@ -1401,7 +1401,7 @@ class SoftwareRenderer extends RendererBackend<FrameBuffer> {
@override
FrameBuffer finalizeFrame() {
if (engine.difficulty != null) {
if (engine.difficulty != null && !engine.isMenuOpen) {
if (engine.player.damageFlash > 0) {
_applyDamageFlash();
} else if (engine.player.bonusFlash > 0) {