client

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package client defines the runtime context shared by game orchestration and UI. It deliberately contains references to subsystems but no gameplay or rendering policy.

Index

Constants

View Source
const TokenOfSiegfriedItemID uint16 = 7621

Variables

This section is empty.

Functions

func AutoReviveAvailable added in v0.10.0

func AutoReviveAvailable(ctx Context) bool

AutoReviveAvailable reports whether the local player can offer the classic Token of Siegfried resurrection action.

func RequestAutoRevive added in v0.10.0

func RequestAutoRevive(ctx Context) error

RequestAutoRevive sends the normal client request. The server remains authoritative over consuming the token and resurrecting the character.

func SendChat added in v0.7.0

func SendChat(ctx Context, input string) error

SendChat sends console-style chat input through the appropriate channel.

func SetSitting added in v0.7.0

func SetSitting(ctx Context, sit bool) error

SetSitting requests a sit or stand action and updates the local player state.

Types

type Context

type Context struct {
	Config            config.Config
	Input             *input.State
	Resources         *res.Manager
	Session           *session.Session
	World             *world.World
	Network           *network.Client
	Audio             *audio.BGM
	Started           time.Time
	ScreenW           int
	ScreenH           int
	Runtime           RuntimeSettings
	RequestQuit       func()
	RequestScreenshot func() (string, error)
	UIApp             UIApp
	UIManager         UIManager
}

func (Context) ScreenSize

func (c Context) ScreenSize() (int, int)

type RuntimeSettings

type RuntimeSettings interface {
	Fullscreen() bool
	SetFullscreen(bool)
	VSync() bool
	SetVSync(bool)
	FPS() bool
	SetFPS(bool)
}

type UIApp

type UIApp interface {
	SetUIRoot(widget.Widget)
	Frame()
	Invalidate()
	Cursor() widget.CursorType
	HoveredWidget() widget.Widget
}

type UIManager

type UIManager interface {
	AddOverlay(widget.Widget)
	RemoveOverlay(widget.Widget)
	Clear()
}

Jump to

Keyboard shortcuts

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