TableTower/ui/skip_animations.gd
RobinFiredrake 91c19980f7 Skip animations setting; questions animate like pauses; pop-ups fade in
View > Skip animations makes every roll instant (Shift-click still does it
for one roll). A roll with a question now animates up to it and on after
the answer, instead of jumping to the end. Pause and question pop-ups fade
and grow in unless the roll skips animations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 12:25:08 -06:00

20 lines
609 B
GDScript

class_name SkipAnimations
extends RefCounted
## The "Skip animations" setting (View ▾): every roll shows its result at once,
## with no flicker, beads or pop-up motion. Shift-click does the same for one roll.
const SETTING := "skip_animations"
## Used when there is no state store (tests that build a bare Main).
static var _skip_mem := false
static func on(m: Main) -> bool:
return bool(m.state.get_setting(SETTING, false)) if m and m.state else _skip_mem
static func set_on(m: Main, value: bool) -> void:
_skip_mem = value
if m and m.state:
m.state.set_setting(SETTING, value)
m.state.save()