remove demo game

This commit is contained in:
2026-05-25 21:28:17 +02:00
parent b1ea3447a8
commit 76f910ab36
75 changed files with 115 additions and 815 deletions

54
ui.status.go Normal file
View File

@@ -0,0 +1,54 @@
package pncdsl
import "github.com/hajimehoshi/ebiten/v2"
// StatusLine renders a single line: either the active flash message (set
// by FlashLine) or the hover-hint (verb + target under the cursor).
type StatusLine struct {
Name string
Y int
Align Align
// ScreenWidth, if 0, uses Game.Width.
ScreenWidth int
}
func (s *StatusLine) GetName() string { return s.Name }
func (s *StatusLine) Tick(ctx *UICtx) {
g := ctx.Game
if g.flashTimer > 0 {
g.flashTimer -= ctx.DT
if g.flashTimer <= 0 {
g.flash = ""
}
}
}
func (s *StatusLine) Draw(dst *ebiten.Image, ctx *UICtx) {
g := ctx.Game
th := g.Theme()
w := s.ScreenWidth
if w == 0 {
w = g.Width
}
text := g.flash
col := th.FlashText
if text == "" {
text = g.HoverHint()
col = th.StatusText
}
if text == "" {
return
}
tw := textWidth(text)
var x int
switch s.Align {
case AlignLeft:
x = 2
case AlignRight:
x = w - tw - 2
default:
x = (w - tw) / 2
}
g.DrawText(dst, text, x, s.Y, col)
}