Skip to content

Commit ac7d525

Browse files
committed
update docs for gui "s" scripts
and turn gui/stockpiles into a gui script instead of a commandline interface
1 parent 7559732 commit ac7d525

5 files changed

Lines changed: 72 additions & 52 deletions

File tree

docs/gui/settings-manager.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
21
gui/settings-manager
32
====================
43

54
.. dfhack-tool::
6-
:summary: todo.
5+
:summary: Dynamically adjust global DF settings.
76
:tags: dfhack
87

8+
This tool is an in-game editor for settings defined in
9+
:file:`data/init/init.txt` and :file:`data/init/d_init.txt`. Changes are written
10+
back to the init files so they will be loaded the next time you start DF. For
11+
settings that can be dynamically adjusted, such as the population cap, the
12+
active value used by the game is updated immediately.
13+
14+
Usage
15+
-----
16+
17+
::
918

10-
An in-game manager for settings defined in ``init.txt`` and ``d_init.txt``.
19+
gui/settings-manager

docs/gui/siege-engine.rst

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1-
21
gui/siege-engine
32
================
43

54
.. dfhack-tool::
6-
:summary: todo.
5+
:summary: Extend the functionality and usability of siege engines.
76
:tags: fort gameplay buildings
87

8+
This tool is an in-game interface for `siege-engine`, which allows you to link
9+
siege engines to stockpiles, restrict operation to certain dwarves, fire a
10+
greater variety of ammo, and aim in 3 dimensions.
911

10-
Activate an in-game interface for `siege-engine`, after selecting
11-
a siege engine in :kbd:`q` mode.
12+
Run the UI after selecting a siege engine in :kbd:`q` mode.
1213

13-
.. image:: /docs/images/siege-engine.png
14+
The main UI mode displays the current target, selected ammo item type, linked
15+
stockpiles and the allowed operator skill range. The map tile color is changed
16+
to signify if it can be hit by the selected engine: green for fully reachable,
17+
blue for out of range, red for blocked, yellow for partially blocked.
1418

15-
The main mode displays the current target, selected ammo item
16-
type, linked stockpiles and the allowed operator skill range. The
17-
map tile color is changed to signify if it can be hit by the
18-
selected engine: green for fully reachable, blue for out of
19-
range, red for blocked, yellow for partially blocked.
20-
21-
Pressing :kbd:`r` changes into the target selection mode, which
22-
works by highlighting two points with :kbd:`Enter` like all
23-
designations. When a target area is set, the engine projectiles
24-
are aimed at that area, or units within it (this doesn't actually
25-
change the original aiming code, instead the projectile
19+
Pressing :kbd:`r` changes into the target selection mode, which works by
20+
highlighting two points with :kbd:`Enter` like all designations. When a target
21+
area is set, the engine projectiles are aimed at that area, or units within it
22+
(this doesn't actually change the original aiming code, instead the projectile
2623
trajectory parameters are rewritten as soon as it appears).
2724

28-
After setting the target in this way for one engine, you can
29-
'paste' the same area into others just by pressing :kbd:`p` in
30-
the main page of this script. The area to paste is kept until you
31-
quit DF, or select another area manually.
25+
After setting the target in this way for one engine, you can 'paste' the same
26+
area into others just by pressing :kbd:`p` in the main page of the UI. The area
27+
to paste is kept until you quit DF, or until you select another area manually.
28+
29+
Pressing :kbd:`t` switches to a mode for selecting a stockpile to take ammo
30+
from.
31+
32+
Exiting from the siege engine UI via :kbd:`Esc` reverts the view to the state
33+
prior to starting the script. :kbd:`Shift`:kbd:`Esc` retains the current
34+
viewport, and also exits from the :kbd:`q` mode to the main map.
3235

33-
Pressing :kbd:`t` switches to a mode for selecting a stockpile to
34-
take ammo from.
36+
Usage
37+
-----
3538

36-
Exiting from the siege engine script via :kbd:`Esc` reverts the
37-
view to the state prior to starting the script.
38-
:kbd:`Shift`:kbd:`Esc` retains the current viewport, and also
39-
exits from the :kbd:`q` mode to main menu.
39+
::
40+
41+
gui/siege-engine
42+
43+
Screenshot
44+
----------
45+
46+
.. image:: /docs/images/siege-engine.png

docs/gui/stamper.rst

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
21
gui/stamper
32
===========
43

54
.. dfhack-tool::
6-
:summary: todo.
5+
:summary: Copy, paste, and transform dig designations.
76
:tags: fort design map
87

8+
This tool allows you to copy and paste blocks of dig designations. You can also
9+
transform what you have copied by shifting it, reflecting it, rotating it,
10+
and/or inverting it. Designations can also be used as brushes to erase other
11+
designations and cancel constructions.
12+
13+
Usage
14+
-----
15+
16+
::
917

10-
allows manipulation of designations by transforms such as translations, reflections, rotations, and inversion.
11-
designations can also be used as brushes to erase other designations and cancel constructions.
18+
gui/stamper

docs/gui/stockpiles.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
21
gui/stockpiles
32
==============
43

54
.. dfhack-tool::
6-
:summary: todo.
5+
:summary: Import and export stockpile settings.
76
:tags: fort design stockpiles
87

8+
With a stockpile selected in :kbd:`q` mode, you can use this tool to load
9+
stockpile settings from a file or save them to a file for later loading, in
10+
this fort or any other.
11+
12+
Saved stockpile configs are stored in the :file:`stocksettings` subfolder in
13+
the DF folder.
914

10-
An in-game interface for `stocksettings`, to
11-
load and save stockpile settings from the :kbd:`q` menu.
15+
See `stockpiles` for a commandline interface.
1216

13-
Usage:
17+
Usage
18+
-----
1419

15-
:gui/stockpiles -save: to save the current stockpile
16-
:gui/stockpiles -load: to load settings into the current stockpile
17-
:gui/stockpiles -dir <path>: set the default directory to save settings into
18-
:gui/stockpiles -help: to see this message
20+
::
1921

20-
Don't forget to ``enable stockpiles`` and create the ``stocksettings`` directory in
21-
the DF folder before trying to use the GUI.
22+
gui/stockpiles

gui/stockpiles.lua

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ the DF folder before trying to use the GUI.
1919
]====]
2020
local stock = require 'plugins.stockpiles'
2121

22-
function check_enabled()
23-
return stock.isEnabled()
24-
end
25-
2622
function world_guard()
2723
if not dfhack.isMapLoaded() then
2824
qerror("World is not loaded")
@@ -57,9 +53,7 @@ function usage()
5753
print("")
5854
end
5955

60-
if not check_enabled() then
61-
qerror("Stockpiles plugin not enabled. Enable it with: enable stockpiles")
62-
elseif args.load then
56+
if args.load then
6357
if not guard() then return end
6458
stock.load_settings()
6559
elseif args.save then
@@ -70,5 +64,7 @@ elseif args.dir then
7064
if not world_guard() then return end
7165
stock.set_path(args.dir)
7266
else
73-
usage()
67+
if not guard() then return end
68+
local sp = dfhack.gui.getSelectedBuilding(true)
69+
stock.manage_settings(sp)
7470
end

0 commit comments

Comments
 (0)