Files
realworld/inc/widget/widget.manager.go
T
mr.zero c5c0c02c03
ci/woodpecker/push/ebitengine Pipeline was successful
dirs
2026-08-30 23:21:06 +02:00

39 lines
823 B
Go

package widget
import (
inkwell "git.teletypegames.org/engines/inkwell"
"git.teletypegames.org/games/realworld/inc"
"git.teletypegames.org/games/realworld/inc/world"
)
type Widget = inkwell.Widget
var Manager = inkwell.NewManager[Widget]()
const (
ScreenW = 640
ScreenH = 380
LineH = inkwell.GlyphH + 2
Pad = 6
TopBarH = LineH + 2
DividerX = 394
HUDH = Pad + LineH + 4 + invSlot*2 + invGap + Pad
HUDTop = ScreenH - HUDH
statusY = HUDTop + Pad
slotsY = HUDTop + Pad + LineH
slotsH = LineH*2 + Pad*2
invY = slotsY + 4
invSlot = 40
invGap = 4
)
var (
whenPlaying = inkwell.VarEq(inc.VarMode, string(world.ModePlay))
whenCutscene = inkwell.VarEq(inc.VarMode, string(world.ModeCutscene))
whenUnpaused = inkwell.And(whenPlaying, inkwell.Not(inkwell.VarEq(inc.VarNote, inc.NotePaused)))
)