A widget declares its layer
ci/woodpecker/push/woodpecker Pipeline was successful

Registration order was the only thing deciding what a widget was drawn
over, which forced a domain to keep one ordered list of every widget it
owns — the one shape that cannot be split into a file per widget.

A widget now says where it belongs: Layer, the eight LayerScene..LayerCursor
constants, the optional Layered interface and LayerOf for wrappers. Draw
runs from the bottom layer up, Tick from the top down, and registration
order only breaks ties inside a layer. Every built-in declares its own;
anything that stays quiet sits on LayerHUD, so existing HUDs come out where
they were.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 22:19:17 +02:00
co-authored by Claude Opus 5
parent 53f4df0466
commit 2429ada090
16 changed files with 118 additions and 24 deletions
+1
View File
@@ -28,6 +28,7 @@ type CharacterPanel struct {
}
func (c *CharacterPanel) GetName() string { return c.Name }
func (c *CharacterPanel) Layer() Layer { return LayerHUD }
func (c *CharacterPanel) Tick(ctx *UICtx) {}
func (c *CharacterPanel) Draw(dst *ebiten.Image, ctx *UICtx) {