Nine things a domain kept having to invent
ci/woodpecker/push/woodpecker Pipeline was successful

Every change here started life as a workaround in a game and is really
the same finding: a fact about an entity had nowhere to live, so the
domain built machinery around the gap.

  Character.Label / Character.Voice — a tape is a character that speaks
  into the log, not a second spelling of Say. VoiceOf and CharacterLabel
  read them; Say obeys them.

  Game.Do — a real action queue, in order, so a widget can start an
  action. queueAction no longer drops what arrives while the runner is
  busy; it queues it.

  Widget.When + Gated + WidgetVisible — a widget declares when it is on
  screen. Nothing ticks, draws or blocks a click while its condition is
  false, so a HUD is hidden for a cutscene without a wrapper per widget.

  TopBar.NoteVar — the title was already discovered; the note beside it
  no longer needs a domain widget to push it in.

  Game.UseWithFail — the pair nobody authored is content, and belongs to
  the domain, exactly like ExitLook and ExitTake.

  Game.Player / Game.Walkboxes — a scene that names no cast and no floor
  means "the usual", instead of a defaults pass rewriting every scene.

  Game.WindowScale — Run's 4× is now a default, not a decision.

  SceneNav — the dev widget every game was writing.

  Colour text: DrawText paints in the colour it is handed, and GlyphW/H,
  TextWidth, WrapText and ClipText are the library's, not each game's.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 22:57:16 +02:00
co-authored by Claude Opus 5
parent 2429ada090
commit 92fc36bdf5
22 changed files with 499 additions and 113 deletions
+8 -3
View File
@@ -16,6 +16,7 @@ import (
// Both can coexist if you really want.
type RadialVerbs struct {
Name string
When Condition
Trigger MouseButton
Radius float64
@@ -42,8 +43,9 @@ type RadialVerbs struct {
pendingHotspot *Hotspot // remembered hotspot when HotspotOnly opens the coin
}
func (r *RadialVerbs) GetName() string { return r.Name }
func (r *RadialVerbs) Layer() Layer { return LayerMenu }
func (r *RadialVerbs) GetName() string { return r.Name }
func (r *RadialVerbs) VisibleWhen() Condition { return r.When }
func (r *RadialVerbs) Layer() Layer { return LayerMenu }
func (r *RadialVerbs) Tick(ctx *UICtx) {
g := ctx.Game
@@ -146,6 +148,9 @@ func (r *RadialVerbs) blockedAt(ctx *UICtx, p Point) bool {
continue
}
w := ctx.Game.WidgetManager.MustGet(name)
if !WidgetVisible(ctx.Game.makeCtx(), w) {
continue
}
// DialogBox advertises its bounds via clickBlocker even when no
// dialog is open, so the verb-coin would refuse to pop up over
// scenery that happens to sit under the dialog rect. Skip the
@@ -248,7 +253,7 @@ func (r *RadialVerbs) Draw(dst *ebiten.Image, ctx *UICtx) {
ly := r.center.Y + math.Sin(a)*labelDist
label := r.labelFor(g, name)
tw := textWidth(label)
tw := TextWidth(label)
col := th.VerbButtonText
isSelected := name == selected
isHover := i == hover