root

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLuaErrors

func CheckLuaErrors(zones *zone.Manager, s *game.Session) tea.Cmd

CheckLuaErrors checks if there are any lua errors and pushes them to the stack as lua error model.

func Push

func Push(model tea.Model) tea.Cmd

Push pushes a new model on the root stack.

func TooltipClear

func TooltipClear() tea.Cmd

TooltipClear clears all tooltips.

func TooltipCreate

func TooltipCreate(tip Tooltip) tea.Cmd

TooltipCreate creates a new tooltip.

func TooltipDelete

func TooltipDelete(id string) tea.Cmd

TooltipDelete deletes a tooltip.

Types

type Model

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

Model is the root model of the game. It holds the current model stack and the zone manager. The top model of the internal stack is the current model and will be rendered.

func New

func New(zones *zone.Manager, root tea.Model) Model

New creates a new root model.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) PushModel

func (m Model) PushModel(model tea.Model) Model

PushModel pushes a new model on the stack.

func (Model) SetRoot

func (m Model) SetRoot(model tea.Model) Model

SetRoot sets the root (last) model of the stack.

func (Model) Update

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

func (Model) View

func (m Model) View() string

type PushModelMsg

type PushModelMsg tea.Model

type Tooltip

type Tooltip struct {
	ID      string
	Content string
	X       int
	Y       int
}

Tooltip represents a tooltip aka overlay message that should be displayed.

type TooltipClearMsg

type TooltipClearMsg struct{}

type TooltipDeleteMsg

type TooltipDeleteMsg string

type TooltipMsg

type TooltipMsg Tooltip

Jump to

Keyboard shortcuts

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