Skip to content

Commit 19b613f

Browse files
authored
Merge branch 'develop' into adv_cursor
2 parents 71f92c6 + 1ab06ce commit 19b613f

34 files changed

+831
-820
lines changed

.github/workflows/watch-df-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
- name: Compare branch metadata
3232
uses: nick-fields/retry@v3
3333
with:
34-
timeout_minutes: 2
34+
timeout_minutes: 5
35+
retry_wait_seconds: 60
3536
command: |
3637
blob=$(wget 'https://api.steamcmd.net/v1/info/975370?pretty=1' -O- | \
3738
awk '/^ *"branches"/,0' | \
@@ -117,7 +118,8 @@ jobs:
117118
- name: Compare versions
118119
uses: nick-fields/retry@v3
119120
with:
120-
timeout_minutes: 2
121+
timeout_minutes: 5
122+
retry_wait_seconds: 60
121123
command: |
122124
version=$(wget "${{ matrix.url }}" -qO- | tr '"' '\n' | fgrep 'tar.bz2' | head -n1 | sed -r 's/${{ matrix.prefix }}_([0-9]{2})_([0-9]{2})_linux.tar.bz2/\1.\2/')
123125
echo "latest ${{ matrix.channel }} version: $version"

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
args: ['--fix=lf']
2121
- id: trailing-whitespace
2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.30.0
23+
rev: 0.31.1
2424
hooks:
2525
- id: check-github-workflows
2626
- repo: https://github.com/Lucas-C/pre-commit-hooks

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cmake_policy(SET CMP0074 NEW)
77

88
# set up versioning.
99
set(DF_VERSION "51.04")
10-
set(DFHACK_RELEASE "r1")
10+
set(DFHACK_RELEASE "r1.1")
1111
set(DFHACK_PRERELEASE FALSE)
1212

1313
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")

data/init/dfhack.keybindings.init

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ keybinding add Ctrl-T@dwarfmode/ViewSheets/UNIT|dwarfmode/ViewSheets/ITEM|dungeo
4949
# quicksave
5050
keybinding add Ctrl-Alt-S@dwarfmode quicksave
5151

52+
# toggle spectate
53+
keybinding add Ctrl-Shift-S@dwarfmode/Default "spectate toggle"
54+
5255
# designate the whole vein for digging
5356
keybinding add Ctrl-V@dwarfmode digv
5457
keybinding add Ctrl-Shift-V@dwarfmode "digv x"

docs/about/Authors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ thurin thurin
242242
Tim Siegel softmoth
243243
Tim Walberg twalberg
244244
Timothy Collett danaris
245+
Timothy Torres timothymtorres
245246
Timur Kelman TymurGubayev
246247
Tom Jobbins TheBloke
247248
Tom Prince

docs/changelog.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,21 @@ Template for new versions:
5454
## New Tools
5555

5656
## New Features
57+
- `spectate`: can now specify number of seconds (in real time) before switching to follow a new unit unit
58+
- `spectate`: new "cinematic-action" mode that dynamically speeds up perspective switches based on intensity of conflict
59+
- `spectate`: new global keybinding for toggling spectate mode: Ctrl-Shift-S
5760

5861
## Fixes
5962
- `gui/launcher`: ensure commandline is fully visible when searching through history and switching from a very long command to a short command
6063
- `createitem`: output items will now end up at look cursor if active
64+
- `spectate`: don't allow temporarily modified announcement settings to be written to disk when "auto-unpause" mode is enabled
65+
- `changevein`: fix a crash that could occur when attempting to change a vein into itself
6166

6267
## Misc Improvements
68+
- `spectate`: player-set configuration is now stored globally instead of per-fort
6369

6470
## Documentation
71+
- `stonesense-art-guide`: new guide for making sprite art for Stonesense
6572

6673
## API
6774

@@ -70,6 +77,16 @@ Template for new versions:
7077

7178
## Removed
7279

80+
# 51.04-r1.1
81+
82+
## Fixes
83+
- `gui/launcher`: ensure commandline is fully visible when searching through history and switching from a very long command to a short command
84+
- `gui/launcher`: flatten text when pasting multi-line text from the clipboard
85+
- Ctrl-a hotkeys have been changed to something else (Ctrl-n) for tools that also have an editable text field, where Ctrl-a is interpreted as select all text
86+
87+
## API
88+
- ``Core::getUnpausedMs``: new API for getting unpaused ms since load in a fort-mode game
89+
7390
# 51.04-r1
7491

7592
## Misc Improvements

docs/guides/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ These pages are detailed guides covering DFHack tools.
1010
/docs/guides/modding-guide
1111
/docs/guides/quickfort-library-guide
1212
/docs/guides/quickfort-user-guide
13+
/docs/guides/stonesense-art-guide

docs/guides/stonesense-art-guide.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.. _stonesense-art-guide:
2+
3+
Stonesense art creation guide
4+
=============================
5+
6+
Understanding isometric perspective
7+
-----------------------------------
8+
9+
Stonesense uses an isometric perspective, a form of pseudo-3D projection where objects are displayed at an
10+
angle, typically with a 2:1 pixel ratio for diagonal lines. This perspective allows for a detailed and visually
11+
appealing representation of a 3D world using 2D sprites. Unlike traditional top-down views, isometric projection
12+
simulates depth while maintaining a consistent scale without vanishing points.
13+
14+
Understanding sprites
15+
---------------------
16+
17+
Understanding how Stonesense deals with sprites is central to anyone who wishes to modify the content. The
18+
scheme is not very complicated, and this guide will give a short introduction to how they work. With the
19+
exception of floors, which we will discuss later, all sprites are 32x32 pixels and come in groups known
20+
as sprite sheets. All sprites are loaded and rendered in 32-bit full-color PNGs. The image files should have
21+
a transparent background but pure magenta (RGB: 255,0,255) is also treated as transparent.
22+
23+
24+
.. image:: ../images/stonesense-sprite-sample.png
25+
:align: left
26+
27+
Here's an example of a typical Stonesense sprite.
28+
29+
When working with Stonesense sprites, it is important to understand how they fit into the isometric grid.
30+
Each sprite is designed to align with the isometric perspective and must fit within a specific bounding area.
31+
To illustrate this, here is a template for the area that should be used by Stonesense sprites:
32+
33+
.. image:: ../images/stonesense-sprite-template.png
34+
:align: left
35+
36+
The solid area is the floor space taken up by a sprite, while the dotted box indicates the volume above this
37+
area corresponding to one z-level.
38+
39+
The way sprites are loaded is fairly generalized: the name of the sprite sheet, and the index of a sprite within that sheet.
40+
41+
Sprite sheets
42+
-------------
43+
There can be an arbitrary number of sprite sheets for Stonesense, though there are 3 sheets that are
44+
always present as they contain default sprites (see further down). Configuring the XML to use new sheets is
45+
outside the scope of this guide but there may be a guide for such added in the future.
46+
47+
Sprite index
48+
------------
49+
The sprite index, or sheet index, is the zero-indexed offset of a sprite on its sprite sheet.
50+
The index starts with the upper left sprite which has index zero. It then increments to the right. Stonesense
51+
is hardcoded to 20 sprite-wide sheets, this means that anything past 20 "sprite slots" is ignored, though less
52+
than 20 slots is fine. The first sprite on the second row always has index 20 (even if there are fewer sprites per row in the sheet), the next row is 40, and so on. This
53+
boundary is hardcoded and changing the size of the sheet will not affect it.
54+
55+
This image shows how sprites are indexed. Grid added for readability.
56+
57+
.. figure:: ../images/stonesense-indexed-sprites.png
58+
:align: left
59+
60+
61+
Important sprite sheets
62+
-----------------------
63+
`objects.png <https://github.com/DFHack/stonesense/blob/master/resources/objects.png>`_ is the default sheet
64+
for buildings and vegetation. Also used for all hard-coded content, like default plants, the cursor, default
65+
walls and liquid.
66+
67+
`creatures.png <https://github.com/DFHack/stonesense/blob/master/resources/creatures.png>`_ is the default
68+
sprite sheet for creatures. If no file is specified in a creature node, this is the sheet it will use.
69+
70+
`floors.png <https://github.com/DFHack/stonesense/blob/master/resources/floors.png>`_ holds all the Stonesense
71+
floors. Unlike the other sprite sheet, this sheet is hard-coded with sprite dimensions of 32x20 pixels.
10 KB
Loading
694 Bytes
Loading
515 Bytes
Loading
174 KB
Loading

docs/plugins/changelayer.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Usage
2222

2323
When run without options, ``changelayer`` will:
2424

25-
- only affect the geology layer at the current cursor position
26-
- only affect the biome that covers the current cursor position
25+
- only affect the geology layer at the current keyboard cursor position
26+
- only affect the biome that covers the current keyboard cursor position
2727
- not allow changing stone to soil and vice versa
2828

2929
You can use the `probe` command on various tiles around your map to find valid
@@ -34,8 +34,9 @@ Examples
3434

3535
``changelayer GRANITE``
3636
Convert the layer at the cursor position into granite.
37-
``changelayer SILTY_CLAY force``
38-
Convert the layer at the cursor position into clay, even if it's stone.
37+
``changelayer SAND_RED force``
38+
Convert the layer at the cursor position into red sand, even if it's
39+
currently stone.
3940
``changelayer MARBLE all_biomes all_layers``
4041
Convert all layers of all biomes which are not soil into marble.
4142

docs/plugins/spectate.rst

Lines changed: 122 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,147 @@ spectate
22
========
33

44
.. dfhack-tool::
5-
:summary: Automatically follow productive dwarves.
6-
:tags: fort interface
5+
:summary: Automated spectator mode.
6+
:tags: fort inspection interface
7+
8+
This tool is for those who like to watch their dwarves go about their business.
9+
10+
When enabled, `spectate` will lock the camera to following the dwarves
11+
scurrying around your fort. Every once in a while, it will automatically switch
12+
to following a different dwarf. It can also switch to following animals,
13+
hostiles, or visiting units. You can switch to the next target (or a previous
14+
target) immediately with the left/right arrow keys.
15+
16+
`spectate` will disengage and turn itself off when you move the map, just like
17+
the vanilla follow mechanic. It will also disengage immediately if you open the
18+
squads menu for military action.
19+
20+
It can also annotate your dwarves on the map with their name, job, and other
21+
information, either as floating tooltips or in a panel that comes up when you
22+
hover the mouse over a target.
23+
24+
Run `gui/spectate` to configure the plugin's settings.
25+
26+
Settings are saved globally, so your preferences for `spectate` and its
27+
overlays will apply to all forts, not just the currently loaded one. Follow
28+
mode is automatically disabled when you load a fort so you can get your
29+
bearings before re-enabling.
730

831
Usage
932
-----
1033

1134
::
1235

1336
enable spectate
14-
spectate
37+
spectate [status]
38+
spectate toggle
1539
spectate set <setting> <value>
16-
spectate enable|disable <feature>
17-
18-
When enabled, the plugin will lock the camera to following the dwarves
19-
scurrying around your fort. Every once in a while, it will automatically switch
20-
to following a different dwarf, preferring dwarves on z-levels with the highest
21-
job activity.
22-
23-
If you have the ``auto-disengage`` feature disabled, you can switch to a new
24-
dwarf immediately by hitting one of the map movement keys (``wasd`` by
25-
default). To stop following dwarves, bring up `gui/launcher` and run
26-
``disable spectate``.
27-
28-
Changes to settings will be saved with your fort, but if `spectate` is enabled
29-
when you save the fort, it will disenable itself when you load so you can get
30-
your bearings before re-enabling follow mode with ``enable spectate`` again.
40+
spectate overlay <name> enable|disable
3141

3242
Examples
3343
--------
3444

3545
``enable spectate``
36-
Starting following dwarves and observing life in your fort.
46+
Start following dwarves and observing life in your fort.
47+
48+
``spectate toggle``
49+
Toggle the plugin on or off. Intended for use with a keybinding. The
50+
default is Ctrl-Shift-S.
3751

3852
``spectate``
3953
The plugin reports its configured status.
4054

41-
``spectate enable auto-unpause``
42-
Enable the spectate plugin to automatically dismiss pause events caused
43-
by the game. Siege events are one example of such a game event.
55+
``spectate set auto-unpause true``
56+
Configure `spectate` to automatically dismiss popups and pause events, like
57+
siege announcements.
4458

45-
``spectate set tick-threshold 1000``
46-
Set the tick interval between camera changes back to its default value.
59+
``spectate set follow-seconds 30``
60+
Configure `spectate` to switch targets every 30 seconds when in follow mode.
4761

48-
Features
49-
--------
50-
:auto-unpause: Toggle auto-dismissal of game pause events. (default: disabled)
51-
:auto-disengage: Toggle auto-disengagement of plugin through player
52-
intervention while unpaused. (default: disabled)
53-
:animals: Toggle whether to sometimes follow animals. (default: disabled)
54-
:hostiles: Toggle whether to sometimes follow hostiles (eg. undead,
55-
titans, invaders, etc.) (default: disabled)
56-
:visiting: Toggle whether to sometimes follow visiting units (eg.
57-
diplomats)
62+
``spectate overlay follow enable``
63+
Show informative tooltips that follow each unit on the map.
5864

5965
Settings
6066
--------
61-
:tick-threshold: Set the plugin's tick interval for changing the followed
62-
dwarf. (default: 1000)
67+
68+
``auto-disengage`` (default: enabled)
69+
Toggle automatically disabling the plugin when the player moves the map or
70+
opens the squad panel. If this is disabled, you will need to manually
71+
disable the plugin to turn off follow mode.
72+
73+
``auto-unpause`` (default: disabled)
74+
Toggle auto-dismissal of announcements that pause the game, like sieges,
75+
forgotten beasts, etc.
76+
77+
``cinematic-action`` (default: enabled)
78+
Toggle whether to switch targets more rapidly when there is conflict.
79+
80+
``follow-seconds`` (default: 10)
81+
Set the time interval for changing the followed unit. The interval does not
82+
include time that the game is paused.
83+
84+
``include-animals`` (default: disabled)
85+
Toggle whether to sometimes follow fort animals.
86+
87+
``include-hostiles`` (default: disabled)
88+
Toggle whether to sometimes follow hostiles (eg. undead, titans, invaders,
89+
etc.)
90+
91+
``include-visitors`` (default: disabled)
92+
Toggle whether to sometimes follow visiting units, like diplomats.
93+
94+
``include-wildlife`` (default: disabled)
95+
Toggle whether to sometimes follow wildlife.
96+
97+
``prefer-conflict`` (default: enabled)
98+
Toggle whether to prefer following units in active conflict.
99+
100+
``prefer-new-arrivals`` (default: enabled)
101+
Toggle whether to prefer following (non-siege) units that have newly
102+
arrived on the map.
103+
104+
``tooltip-follow-job`` (default: enabled)
105+
If the ``spectate.follow`` overlay is enabled, toggle whether to show the
106+
job of the dwarf in the tooltip.
107+
108+
``tooltip-follow-name`` (default: enabled)
109+
If the ``spectate.follow`` overlay is enabled, toggle whether to show the
110+
name of the dwarf in the tooltip.
111+
112+
``tooltip-follow-stress`` (default: enabled)
113+
If the ``spectate.follow`` overlay is enabled, toggle whether to show the
114+
happiness level (stress) of the dwarf in the tooltip.
115+
116+
``tooltip-hover-job`` (default: enabled)
117+
If the ``spectate.follow`` overlay is enabled, toggle whether to show the
118+
job of the dwarf in the hover panel.
119+
120+
``tooltip-hover-name`` (default: enabled)
121+
If the ``spectate.follow`` overlay is enabled, toggle whether to show the
122+
name of the dwarf in the hover panel.
123+
124+
``tooltip-hover-stress`` (default: enabled)
125+
If the ``spectate.follow`` overlay is enabled, toggle whether to show the
126+
happiness level (stress) of the dwarf in the hover panel.
127+
128+
Overlays
129+
--------
130+
131+
``spectate`` provides two overlays via the `overlay` framework to add
132+
information and functionality to the main map. These overlays can be controlled
133+
via the ``spectate overlay`` command or the ``Overlays`` tab in
134+
`gui/control-panel`.
135+
136+
The information displayed by these overlays can be configured via the
137+
``spectate set`` command or the `gui/spectate` interface.
138+
139+
``spectate.follow``
140+
Show informative tooltips that follow each unit on the map. You can enable
141+
this overlay by running ``spectate overlay follow enable`` or,
142+
equivalently, ``overlay enable spectate.follow``.
143+
144+
``spectate.hover``
145+
Show a popup panel with selected information when your mouse cursor hovers
146+
over a unit. You can enable this overlay by running
147+
``spectate overlay hover enable`` or, equivalently,
148+
``overlay enable spectate.hover``.

0 commit comments

Comments
 (0)