Documentation
¶
Index ¶
- Constants
- type Bindings
- type PendingSkill
- type Script
- func (b *Script) Active() bool
- func (b *Script) Close()
- func (b *Script) Fail(callback string, err error)
- func (b *Script) HandleGamepad(ctx client.Context, dt float64) input.GamepadCapture
- func (b *Script) InGame() bool
- func (b *Script) InputFrame(available bool) error
- func (b *Script) KeyPress(code input.KeyCode) error
- func (b *Script) Tick() error
- type World
Constants ¶
View Source
const TickInterval = 150 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bindings ¶
type Bindings struct {
World *World
InputState func(client.Context) (suspended, keyboardAvailable bool)
ControlUI func(client.Context, string) bool
ClearHighlight func()
}
Bindings connects the script to the active mode without owning game state.
type PendingSkill ¶
type Script ¶
type Script struct {
Path string
Context client.Context
NextTick time.Time
Disabled bool
KeyboardAvailable bool
BlockedButtons [input.GamepadButtonCount]bool
// contains filtered or unexported fields
}
The manager owns one script for the active mode. WorldMode borrows it to run gameplay callbacks at the appropriate points in its update.
func (*Script) HandleGamepad ¶
The script claims controls before the renderer's pointer fallback.
func (*Script) InputFrame ¶
type World ¶
type World struct {
Walk func(client.Context, int, int) bool
Stop func(client.Context) bool
Attack func(client.Context, uint32) bool
Skill func(client.Context, uint32, session.Skill, int) bool
Loot func(client.Context, uint32) bool
UseItem func(client.Context, int) bool
UsePendingSkill func(client.Context, uint32) bool
HighlightActor func(client.Context, uint32) bool
SkillTargets func(client.Context, bool, time.Time) []worldstate.Actor
PendingSkill func(client.Context) (PendingSkill, bool)
CanAttack func(client.Context, worldstate.Actor) bool
ActorDead func(uint32) bool
CompanionLife func(client.Context, uint32) (int, int, int, int, bool)
WalkSequence func() uint64
UseShortcut func(client.Context, int) (uint16, bool)
RotateCamera func(client.Context, float64, float64)
ZoomCamera func(client.Context, float64)
CameraYaw func(client.Context) float64
CancelSkill func()
}
World supplies the game operations without exposing WorldMode or Lua state. All callbacks are provided together; a nil World is used during login.
Click to show internal directories.
Click to hide internal directories.