Documentation
¶
Overview ¶
Package ui is the Bubble Tea front end: one root model, one screen at a time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func New ¶
func New(lessons []content.Lesson, prog *progress.Progress, savePath, version string, checkUpdate func() string) Model
New builds the root model. version is the current build (shown on the title screen); checkUpdate is run once off the render path to learn whether a newer release exists — it returns the newer version string or "" (pass nil to disable the check entirely, e.g. for dev builds or in tests).
type Palette ¶
func (Palette) PrimaryStyle ¶
PrimaryStyle is a lipgloss style foregrounded with the palette's primary color.
type Skin ¶ added in v1.1.0
type Skin interface {
Logo(lines []string) string // title wordmark
RoomHeader(h roomHeader) string // act banner + title/boss + story/taunt + timer
Body(act int, s string) string // objective / free body text
CursorCell(act int, s string) string // one cursor / selection cell
FrameBuffer(act int, lines []string) string // wrap the buffer body (indent / border / gutter)
HUD(act int, segs []segment) string // the room status bar
}
Skin owns a theme's structural chrome. Renderers assemble semantic content — an act, a set of buffer lines, a list of HUD segments — and hand it to the active skin, which decides how that content is drawn: plain text, background chips, reverse-video, dither banners, bordered boxes, and so on.
Color-only themes need no bespoke structure, so they all fall back to classicSkin (the game's original look) and vary only through the palette that applyTheme installs. A theme registers a Skin only when it restyles layout.
type Theme ¶ added in v1.1.0
type Theme struct {
Name string
Acts map[int]Palette
Dim lipgloss.Color
Success lipgloss.Color
Danger lipgloss.Color
}
Theme re-skins the UI's colors: a per-act palette plus the base role colors. It changes colors only — screen structure (borders, HUD layout, glyphs) is fixed, so themes are cheap and every renderer inherits them for free.