Add game components 269-290; CommandMenu AutoFocus

Press start, title screen, save slots, options menu, game over with
CONTINUE, credits roll, ending card, loading tips, letterbox, mission
brief, achievements, result screen, crafting grid, loot popup,
treasure chest, gacha reel, interact prompt, turn order, battle log,
target selector, ATB gauge and stamina bar. Cued effects count runs,
so each cue change plays once and reports once. CommandMenu takes
AutoFocus when enabled. HealthBar, ManaBar and CountUp keep exact
colors, ticks and counts for the largest ints.
This commit is contained in:
ZacharyZhang-NY committed 2026-10-12 02:48:20 -04:00
1 parent f48075230f
commit 86a6901333
38 files changed
+2663 -8

No files matched your search

+32
View File
@@ -1,6 +1,8 @@
package feedback_test
import (
"math"
"strconv"
"testing"
"time"
@@ -30,6 +32,36 @@ func TestCountUpStepsOrJumps(t *testing.T) {
}
}
func TestCountUpReachesAHugeValue(t *testing.T) {
clk := newClock()
v := 0
tt := view(600, 100, clk, false, func(c *ui.Context) {
feedback.CountUp(c, v, feedback.CountUpOptions{Slot: pixel.Ink})
pixel.Text(c, strconv.Itoa(math.MaxInt64), pixel.TextOptions{})
})
v = math.MaxInt64
wait(tt, clk, 0)
wait(tt, clk, time.Second)
// The count ends on the same digits as plain text.
img := tt.Image()
if !equal(slots(t, img, ui.Rect{W: 600, H: 32}), slots(t, img, ui.Rect{Y: 32, W: 600, H: 32})) {
t.Fatal("the count ended on other digits")
}
// From -1, halfway is 4611686018427387903, across the sign.
half := -1
tt = view(600, 100, clk, false, func(c *ui.Context) {
feedback.CountUp(c, half, feedback.CountUpOptions{Slot: pixel.Ink})
pixel.Text(c, "4611686018427387903", pixel.TextOptions{})
})
half = math.MaxInt64
wait(tt, clk, 0)
wait(tt, clk, 4*time.Second/15+time.Millisecond)
img = tt.Image()
if !equal(slots(t, img, ui.Rect{W: 600, H: 32}), slots(t, img, ui.Rect{Y: 32, W: 600, H: 32})) {
t.Fatal("halfway the count drew other digits")
}
}
func TestPulseStopsUnderReduceMotion(t *testing.T) {
for _, reduce := range []bool{false, true} {
clk := newClock()