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>
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package inkwell
|
|
|
|
import "image/color"
|
|
|
|
type Character struct {
|
|
Name string
|
|
// Label is what the UI shows instead of Name — a code name, a title,
|
|
// a shout. Empty means the Name is presentable as it stands.
|
|
Label string
|
|
Sprite string // Asset.Name (placeholder if missing)
|
|
Animations map[string]AnimationClip
|
|
Speed float64
|
|
SpeechColor color.Color
|
|
// Voice decides where Say puts this character's lines.
|
|
Voice Voice
|
|
// Start is where the character stands in a scene that lists no actors
|
|
// of its own, and Game.Player names the one placed there.
|
|
Start Point
|
|
// Size hints used when the sprite is a placeholder rectangle.
|
|
W, H float64
|
|
}
|
|
|
|
// Voice is how a character reaches the player: over the scene as a speech
|
|
// bubble, or through the message log alone — a radio, a tape, a narrator
|
|
// that has no body to speak from.
|
|
type Voice int
|
|
|
|
const (
|
|
VoiceBubble Voice = iota // speech bubble over the scene, plus the log
|
|
VoiceLog // the log alone
|
|
)
|
|
|
|
func (c Character) GetName() string { return c.Name }
|
|
|
|
// DisplayName is the Label if there is one, the Name otherwise.
|
|
func (c Character) DisplayName() string {
|
|
if c.Label != "" {
|
|
return c.Label
|
|
}
|
|
return c.Name
|
|
}
|
|
func (c Character) TypeLabel() string { return "character" }
|