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:
38 files changed
+2663
-8
No files matched your search
+11
-1
@@ -34,7 +34,7 @@ func CountUp(c *ui.Context, value int, o CountUpOptions) *ui.Element {
|
||||
if !k.Reduce() {
|
||||
step = k.Since(c, s.at, 15, 8)
|
||||
}
|
||||
return s.from + (s.to-s.from)*step/8
|
||||
return lerp(s.from, s.to, step)
|
||||
}
|
||||
if value != s.to {
|
||||
s.from, s.to, s.at = shown(), value, k.Now()
|
||||
@@ -45,3 +45,13 @@ func CountUp(c *ui.Context, value int, o CountUpOptions) *ui.Element {
|
||||
k.Canvas(p, r).Text(0, 0, n, o.Slot, sc)
|
||||
})
|
||||
}
|
||||
|
||||
// lerp moves step eighths from a toward b, overflow-free.
|
||||
func lerp(a, b, step int) int {
|
||||
if b >= a {
|
||||
d := uint64(b) - uint64(a)
|
||||
return int(uint64(a) + d/8*uint64(step) + d%8*uint64(step)/8)
|
||||
}
|
||||
d := uint64(a) - uint64(b)
|
||||
return int(uint64(a) - (d/8*uint64(step) + d%8*uint64(step)/8))
|
||||
}
|
||||
Reference in new issue
Block a user