Skip to content

Commit 04527c0

Browse files
committed
add stub gui/spectate
1 parent 6a95290 commit 04527c0

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

docs/gui/spectate.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
gui/spectate
2+
============
3+
4+
.. dfhack-tool::
5+
:summary: Automated spectator mode.
6+
:tags: fort inspection interface
7+
8+
This is an in-game configuration interface for `spectate`, which automatically
9+
sets the camera to follow interesting units.
10+
11+
Usage
12+
-----
13+
14+
::
15+
16+
gui/spectate

gui/spectate.lua

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
local gui = require('gui')
2+
local spectate = require('plugins.spectate')
3+
local widgets = require('gui.widgets')
4+
5+
Spectate = defclass(Spectate, widgets.Window)
6+
Spectate.ATTRS {
7+
frame_title='Spectate',
8+
frame={w=50, h=45},
9+
resizable=true,
10+
resize_min={w=50, h=20},
11+
}
12+
13+
function Spectate:init()
14+
self:addviews{
15+
}
16+
end
17+
18+
SpectateScreen = defclass(SpectateScreen, gui.ZScreen)
19+
SpectateScreen.ATTRS {
20+
focus_path='spectate',
21+
}
22+
23+
function SpectateScreen:init()
24+
self:addviews{Spectate{}}
25+
end
26+
27+
function SpectateScreen:onDismiss()
28+
view = nil
29+
end
30+
31+
view = view and view:raise() or SpectateScreen{}:show()

0 commit comments

Comments
 (0)