File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 ()
You can’t perform that action at this time.
0 commit comments