ui

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const GameOverASCII = `` /* 1212-byte string literal not displayed */

Arte ASCII para Game Over

View Source
const GhostASCIILarge = `` /* 1391-byte string literal not displayed */

Arte ASCII del fantasma - versión grande

View Source
const GhostASCIISmall = `` /* 365-byte string literal not displayed */

Arte ASCII del fantasma - versión pequeña

View Source
const GhostSubtitleLarge = `` /* 673-byte string literal not displayed */

Subtítulo GHOST grande

View Source
const GhostSubtitleMedium = `` /* 133-byte string literal not displayed */

Subtítulo GHOST mediano

View Source
const GhostSubtitleSmall = `GHOST`

Subtítulo pequeño

View Source
const LogoASCII = `` /* 2075-byte string literal not displayed */

ASCII Art para el título del juego

View Source
const LogoSmall = `` /* 275-byte string literal not displayed */

Logo pequeño para el header

View Source
const TitleASCIILarge = `` /* 1248-byte string literal not displayed */

Título grande

View Source
const TitleASCIIMedium = `` /* 252-byte string literal not displayed */

Título mediano

View Source
const TitleASCIISmall = `FILESYSTEM`

Título pequeño

View Source
const VictoryASCII = `` /* 1426-byte string literal not displayed */

Arte ASCII para Victoria

Variables

View Source
var (
	// Retro-futuristic border characters
	BorderNeon = lipgloss.Border{
		Top:         "═",
		Bottom:      "═",
		Left:        "║",
		Right:       "║",
		TopLeft:     "╔",
		TopRight:    "╗",
		BottomLeft:  "╚",
		BottomRight: "╝",
	}

	BorderHacker = lipgloss.Border{
		Top:         "▀",
		Bottom:      "▄",
		Left:        "█",
		Right:       "█",
		TopLeft:     "█",
		TopRight:    "█",
		BottomLeft:  "█",
		BottomRight: "█",
	}

	BorderCyber = lipgloss.Border{
		Top:         "─",
		Bottom:      "─",
		Left:        "│",
		Right:       "│",
		TopLeft:     "┌",
		TopRight:    "┐",
		BottomLeft:  "└",
		BottomRight: "┘",
	}

	BorderGlitch = lipgloss.Border{
		Top:         "░",
		Bottom:      "░",
		Left:        "▒",
		Right:       "▒",
		TopLeft:     "▓",
		TopRight:    "▓",
		BottomLeft:  "▓",
		BottomRight: "▓",
	}
)

CyberBorder characters for different styles

View Source
var (
	// Colores principales - Gama de Rojos
	ColorRedBright  = lipgloss.Color("#FF0000") // Rojo brillante
	ColorRedNeon    = lipgloss.Color("#FF1744") // Rojo neón
	ColorRedHot     = lipgloss.Color("#FF3333") // Rojo caliente
	ColorRedMedium  = lipgloss.Color("#CC0000") // Rojo medio
	ColorRedDark    = lipgloss.Color("#990000") // Rojo oscuro
	ColorRedDeep    = lipgloss.Color("#660000") // Rojo profundo
	ColorRedBlood   = lipgloss.Color("#8B0000") // Rojo sangre
	ColorRedMaroon  = lipgloss.Color("#4A0000") // Marrón rojizo
	ColorRedDim     = lipgloss.Color("#AA3333") // Rojo tenue
	ColorRedVeryDim = lipgloss.Color("#553333") // Rojo muy tenue
	ColorDarkBg     = lipgloss.Color("#0A0000") // Fondo casi negro con tinte rojo
	ColorDarkGray   = lipgloss.Color("#1A0A0A") // Gris oscuro rojizo
	ColorMidGray    = lipgloss.Color("#2D1515") // Gris medio rojizo
	ColorLightGray  = lipgloss.Color("#5A3030") // Gris claro rojizo
	ColorWhite      = lipgloss.Color("#FFCCCC") // Blanco rosado

	// Aliases para compatibilidad
	ColorNeonGreen  = ColorRedBright // Reemplaza verde por rojo brillante
	ColorNeonPink   = ColorRedNeon   // Reemplaza rosa por rojo neón
	ColorNeonCyan   = ColorRedMedium // Reemplaza cyan por rojo medio
	ColorNeonPurple = ColorRedDark   // Reemplaza púrpura por rojo oscuro
	ColorNeonYellow = ColorRedHot    // Reemplaza amarillo por rojo caliente
	ColorNeonOrange = ColorRedDeep   // Reemplaza naranja por rojo profundo

	// Estilos base
	StyleBase = lipgloss.NewStyle().
				Background(ColorDarkBg)

	// Estilo del prompt (rojo brillante)
	StylePrompt = lipgloss.NewStyle().
				Foreground(ColorRedBright).
				Bold(true)

	// Estilo para texto de sistema
	StyleSystem = lipgloss.NewStyle().
				Foreground(ColorRedMedium)

	// Estilo para advertencias
	StyleWarning = lipgloss.NewStyle().
					Foreground(ColorRedHot).
					Bold(true)

	// Estilo para errores/peligro
	StyleDanger = lipgloss.NewStyle().
				Foreground(ColorRedNeon).
				Bold(true).
				Blink(true)

	// Estilo para éxito
	StyleSuccess = lipgloss.NewStyle().
					Foreground(ColorRedBright).
					Bold(true)

	// Estilo para directorios
	StyleDirectory = lipgloss.NewStyle().
					Foreground(ColorRedMedium).
					Bold(true)

	// Estilo para archivos ejecutables
	StyleExecutable = lipgloss.NewStyle().
					Foreground(ColorRedBright)

	// Estilo para archivos ocultos
	StyleHidden = lipgloss.NewStyle().
				Foreground(ColorLightGray).
				Italic(true)

	// Estilo para el título
	StyleTitle = lipgloss.NewStyle().
				Foreground(ColorRedNeon).
				Bold(true).
				Padding(0, 1).
				Border(lipgloss.DoubleBorder()).
				BorderForeground(ColorRedMedium)

	// Estilo para paneles
	StylePanel = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(ColorRedBright).
				Padding(0, 1)

	// Estilo para panel de alerta
	StyleAlertPanel = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(ColorRedNeon).
					Padding(0, 1)

	// Estilo para panel de información
	StyleInfoPanel = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(ColorRedMedium).
					Padding(0, 1)

	// Estilo para el header
	StyleHeader = lipgloss.NewStyle().
				Foreground(ColorRedMedium).
				Bold(true).
				Padding(0, 1)

	// Estilo para el footer/status bar
	StyleStatusBar = lipgloss.NewStyle().
					Foreground(ColorWhite).
					Background(ColorMidGray).
					Padding(0, 1)

	// Estilo para texto resaltado
	StyleHighlight = lipgloss.NewStyle().
					Foreground(ColorRedNeon).
					Bold(true)

	// Estilo para el output de comandos
	StyleOutput = lipgloss.NewStyle().
				Foreground(ColorWhite)

	// Estilo para el cursor/input
	StyleInput = lipgloss.NewStyle().
				Foreground(ColorRedBright)

	// Estilo para proceso hostil
	StyleHostile = lipgloss.NewStyle().
					Foreground(ColorRedNeon).
					Bold(true)

	// Estilo para proceso neutral
	StyleNeutral = lipgloss.NewStyle().
					Foreground(ColorLightGray)

	// Estilo para mensaje del sistema
	StyleMessage = lipgloss.NewStyle().
					Foreground(ColorRedHot).
					Italic(true)

	// Estilo para sugerencias de autocompletado
	StyleSuggestion = lipgloss.NewStyle().
					Foreground(ColorRedDark).
					Italic(true)

	// Estilo para sugerencia seleccionada
	StyleSuggestionSelected = lipgloss.NewStyle().
							Foreground(ColorRedBright).
							Background(ColorMidGray).
							Bold(true)

	// Estilo para texto gris oscuro (datos encriptados, etc.)
	StyleDarkGray = lipgloss.NewStyle().
					Foreground(ColorLightGray)
)

Paleta de colores Roja Monocromática - Estilo Hacker

Functions

func AlertMeter

func AlertMeter(level int, width int) string

AlertMeter crea un medidor de alerta con colores dinámicos

func AnimatedCursor added in v1.4.0

func AnimatedCursor(frame int) string

AnimatedCursor devuelve un cursor animado estilo retro

func BlinkText

func BlinkText(text string, frame int) string

BlinkText hace que el texto parpadee

func BootSequence added in v1.4.0

func BootSequence(frame int, width int) (string, bool)

BootSequence genera la secuencia de arranque retro-futurista

func BoxWithTitle

func BoxWithTitle(content, title string, color lipgloss.Color, width int) string

BoxWithTitle crea una caja con título

func CRTEffect added in v1.4.0

func CRTEffect(text string, frame int, intensity int) string

CRTEffect aplica efecto de monitor CRT con scanlines sutiles

func CircuitLine added in v1.4.0

func CircuitLine(width int, frame int) string

CircuitLine genera una línea decorativa estilo circuito

func ConnectionStatus added in v1.4.0

func ConnectionStatus(connected bool, frame int) string

ConnectionStatus genera indicador de conexión animado

func CyberCursor added in v1.4.0

func CyberCursor(frame int) string

CyberCursor devuelve un cursor cyberpunk

func CyberHeader added in v1.4.0

func CyberHeader(levelNum int, levelName string, alertLevel int, privilege string, frame int, width int) string

CyberHeader genera un header estilo cyberpunk animado

func CyberProgressBar added in v1.4.0

func CyberProgressBar(current, maximum, width int, label string, color lipgloss.Color, frame int) string

CyberProgressBar crea una barra de progreso estilo cyberpunk

func CyberTerminalFrame added in v1.4.0

func CyberTerminalFrame(content string, title string, frame int, width, height int) string

CyberTerminalFrame crea un marco de terminal estilo cyberpunk

func DataRain added in v1.4.0

func DataRain(width, height, frame int) string

DataRain genera efecto de lluvia de datos estilo cyberpunk

func DirectoryTree

func DirectoryTree(currentPath string, tree map[string][]string, maxDepth int) string

DirectoryTree genera un árbol de directorios visual

func ExfiltrationAnimation

func ExfiltrationAnimation(frame int, levelNum int, nextLevelName string) string

ExfiltrationAnimation genera la animación de exfiltración al completar nivel

func GetAlertStyle

func GetAlertStyle(level int) lipgloss.Style

Estilos para diferentes niveles de alerta (gama de rojos)

func GlitchEffect

func GlitchEffect(text string, intensity int) string

GlitchEffect aplica un efecto glitch al texto

func HackingAnimation

func HackingAnimation(frame int) string

HackingAnimation genera una animación de "hackeo"

func HexDecor added in v1.4.0

func HexDecor(frame int) string

HexDecor genera decoración hexagonal estilo cyberpunk

func InfiltrationAnimation

func InfiltrationAnimation(frame int, levelNum int, levelName string) string

InfiltrationAnimation genera la animación de infiltración al inicio de nivel

func IntrusionWarning

func IntrusionWarning(frame int) string

IntrusionWarning genera una advertencia de intrusión animada

func MatrixRain

func MatrixRain(width, height, frame int) string

MatrixRain genera un efecto de lluvia estilo Matrix

func NeonBorder

func NeonBorder(content string, color lipgloss.Color, title string) string

Crear borde con estilo neón

func NeonBox added in v1.4.0

func NeonBox(content, title string, frame int, color lipgloss.Color, width int) string

NeonBox crea una caja con efecto de borde neón animado

func NeonText added in v1.4.0

func NeonText(text string, frame int, color lipgloss.Color) string

NeonText crea texto con efecto de neón pulsante

func NetworkActivity added in v1.4.0

func NetworkActivity(frame int, width int) string

NetworkActivity muestra actividad de red simulada

func ProcessTable

func ProcessTable(processes []ProcessInfo) string

ProcessTable genera una tabla de procesos estilizada

func ProgressBar

func ProgressBar(current, max, width int, color lipgloss.Color) string

ProgressBar crea una barra de progreso estilizada

func RenderMenu

func RenderMenu(state *MenuState, width, height int, musicSettings *MusicSettings) string

RenderMenu renderiza el menú principal con estética cyberpunk 2077

func RenderSettings added in v1.3.0

func RenderSettings(state *MenuState, width, height int, musicSettings *MusicSettings) string

RenderSettings renderiza el menú de configuración

func ScanLineEffect

func ScanLineEffect(text string, frame int) string

ScanLineEffect añade un efecto de líneas de escaneo

func SectionDivider added in v1.4.0

func SectionDivider(title string, width int, frame int) string

SectionDivider crea un divisor de sección estilizado

func StaticNoise added in v1.4.0

func StaticNoise(width, height int, density float64) string

StaticNoise genera ruido estático para efecto de interferencia

func SystemMessage

func SystemMessage(msg string, msgType string) string

SystemMessage formatea un mensaje del sistema

func TeletypeEffect

func TeletypeEffect(text string, currentFrame int, charsPerFrame int) string

TeletypeEffect simula el efecto de máquina de escribir (devuelve el texto progresivo)

func ThreatIndicator added in v1.4.0

func ThreatIndicator(count int, frame int) string

ThreatIndicator muestra el indicador de amenazas activas

func TypewriterEffect added in v1.4.0

func TypewriterEffect(text string, frame int, speed int) (string, bool)

TypewriterEffect simula escritura de máquina de escribir mejorada

Types

type AnimationState

type AnimationState int

AnimationState representa el estado de animación actual

const (
	AnimationNone AnimationState = iota
	AnimationInfiltration
	AnimationExfiltration
)

type ColorScheme added in v1.3.0

type ColorScheme struct {
	Bright  lipgloss.Color
	Neon    lipgloss.Color
	Hot     lipgloss.Color
	Medium  lipgloss.Color
	Dark    lipgloss.Color
	Deep    lipgloss.Color
	Blood   lipgloss.Color
	Maroon  lipgloss.Color
	Dim     lipgloss.Color
	VeryDim lipgloss.Color
}

ColorScheme define una paleta de colores

type GameScreen

type GameScreen int

GameScreen representa la pantalla actual del juego

const (
	ScreenMenu GameScreen = iota
	ScreenGame
	ScreenGameOver
	ScreenVictory
)
type MenuOption int

MenuOption representa una opción del menú

const (
	MenuNewGame MenuOption = iota
	MenuContinue
	MenuSelectLevel
	MenuSettings
	MenuQuit
)
type MenuState struct {
	// contains filtered or unexported fields
}

MenuState maneja el estado del menú

func NewMenuState

func NewMenuState(maxLevel int) *MenuState

NewMenuState crea un nuevo estado de menú

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model representa el estado de la interfaz del juego

func NewModel

func NewModel(game *entity.Game, vfs *filesystem.VirtualFS, cmdHandler *commands.CommandHandler, levelManager *levels.LevelManager) Model

NewModel crea un nuevo modelo de la UI

func (Model) Init

func (m Model) Init() tea.Cmd

Init inicializa el modelo

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update maneja los eventos

func (Model) View

func (m Model) View() string

View renderiza la interfaz

type MusicSettings added in v1.5.0

type MusicSettings struct {
	Mode          int      // 0=Off, 1=Random, 2=Sequential, 3=Single
	Volume        int      // 0-100
	SelectedTrack int      // Índice de la canción seleccionada
	Tracks        []string // Lista de canciones disponibles
	CurrentTrack  string   // Nombre de la canción actual
}

MusicSettings contiene la configuración de música para el renderizado

type ProcessInfo

type ProcessInfo struct {
	PID       int
	Name      string
	CPU       float64
	Status    string
	IsHostile bool
}

ProcessInfo representa información de un proceso para mostrar

type SettingsOption added in v1.3.0

type SettingsOption int

SettingsOption representa una opción de configuración

const (
	SettingDifficulty SettingsOption = iota
	SettingAnimSpeed
	SettingShowHints
	SettingSoundFX
	SettingColorScheme
	SettingMusicMode
	SettingMusicTrack
	SettingMusicVolume
	SettingBack
)

type TickMsg

type TickMsg time.Time

TickMsg es un mensaje para actualizar el juego cada frame

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL