diff --git a/docs/gui/spectate.rst b/docs/gui/spectate.rst new file mode 100644 index 0000000000..e6034cbf80 --- /dev/null +++ b/docs/gui/spectate.rst @@ -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 diff --git a/gui/spectate.lua b/gui/spectate.lua new file mode 100644 index 0000000000..4cea75855d --- /dev/null +++ b/gui/spectate.lua @@ -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()