Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/gui/spectate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
gui/spectate
============

.. dfhack-tool::
:summary: Automated spectator mode.
:tags: fort inspection interface

This is an in-game configuration interface for `spectate`, which automatically
sets the camera to follow interesting units.

Usage
-----

::

gui/spectate
31 changes: 31 additions & 0 deletions gui/spectate.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
local gui = require('gui')
local spectate = require('plugins.spectate')
local widgets = require('gui.widgets')

Spectate = defclass(Spectate, widgets.Window)
Spectate.ATTRS {
frame_title='Spectate',
frame={w=50, h=45},
resizable=true,
resize_min={w=50, h=20},
}

function Spectate:init()
self:addviews{
}
end

SpectateScreen = defclass(SpectateScreen, gui.ZScreen)
SpectateScreen.ATTRS {
focus_path='spectate',
}

function SpectateScreen:init()
self:addviews{Spectate{}}
end

function SpectateScreen:onDismiss()
view = nil
end

view = view and view:raise() or SpectateScreen{}:show()