root

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 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 GettingVisible added in v0.1.8

func GettingVisible() tea.Cmd

GettingVisible is a message that is sent to a model when it is getting visible.

func Push

func Push(model tea.Model) tea.Cmd

Push pushes a new model on the root stack.

func PushAll added in v0.1.8

func PushAll(models ...tea.Model) tea.Cmd

PushAll pushes multiple models on the root stack.

func PushTransitionFunc added in v0.1.8

func PushTransitionFunc(fn func(parent tea.Model) tea.Model) tea.Cmd

PushTransitionFunc pushes a new transition model on the root ui that will be shown between models on the stack.

func RemovePushTransitionFunc added in v0.1.8

func RemovePushTransitionFunc() tea.Cmd

RemovePushTransitionFunc removes the transition model from the root ui.

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 ModelGettingVisibleMsg added in v0.1.8

type ModelGettingVisibleMsg struct{}

type OnVisibleModel added in v0.1.8

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

func NewOnVisibleModel added in v0.1.8

func NewOnVisibleModel(parent tea.Model, fn func(model tea.Model)) OnVisibleModel

func (OnVisibleModel) Init added in v0.1.8

func (m OnVisibleModel) Init() tea.Cmd

func (OnVisibleModel) Update added in v0.1.8

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

func (OnVisibleModel) View added in v0.1.8

func (m OnVisibleModel) View() string

type PushModelMsg

type PushModelMsg []tea.Model

type PushTransitionFuncMsg added in v0.1.8

type PushTransitionFuncMsg func(parent tea.Model) 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