Documentation
¶
Index ¶
- func DOSColorStyle(attr byte) lipgloss.Style
- func DOSFGStyle(colorIdx int) lipgloss.Style
- func DefaultStrings() map[string]string
- func FormatItemNumber(n, total int) string
- func LoadStrings(path string) (map[string]string, error)
- func PlainTextLength(s string) int
- func RenderColorString(s string, maxWidth int) string
- func SaveStrings(path string, strings map[string]string) error
- type Model
- type StringEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DOSColorStyle ¶
DOSColorStyle returns a lipgloss style for a given DOS color attribute byte. The byte encodes fg (lower 4 bits) and bg (upper 4 bits), matching the Pascal TextAttr format: attr = bg*16 + fg.
func DOSFGStyle ¶
DOSFGStyle returns a lipgloss style for a DOS foreground color index (0-15).
func DefaultStrings ¶
DefaultStrings returns the default string values matching the original Pascal FormatStrings() procedure defaults.
func FormatItemNumber ¶
FormatItemNumber formats an item number with consistent width for display.
func LoadStrings ¶
LoadStrings reads strings.json and returns a map of key -> value. If the file doesn't exist, it creates it with defaults from metadata.
func PlainTextLength ¶
PlainTextLength returns the visible character count of a BBS pipe-coded string, stripping all color codes.
func RenderColorString ¶
RenderColorString converts a BBS pipe-coded string into a lipgloss-styled string suitable for TUI display. It parses |XX foreground codes (00-15), |BX background codes (B0-B7), $x/$X dollar-sign color codes, and |CR (converted to space). The maxWidth parameter truncates visible characters (not counting color codes) and adds a "»" overflow indicator.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the BubbleTea model for the string editor TUI.
func New ¶
New creates a new string editor model. shippedDefaults, if non-nil, provides factory default values for F4 restore.
type StringEntry ¶
type StringEntry struct {
Label string // Display name shown in the editor list
Key string // JSON key in strings.json
Description string // Help text shown in the description bar
}
StringEntry defines the metadata for a single editable string. It maps a JSON key to a human-readable label and description, matching the original Pascal STRINGS.PAS "things" array.
func StringEntries ¶
func StringEntries() []StringEntry
StringEntries returns the ordered list of all editable strings. The first 178 entries match the original Pascal STRINGS.EXE ordering. V3-specific strings follow in logical groups.