Skip to content

Commit ca84f9c

Browse files
committed
toggle vanilla dimensions flag on overlay toggle
that is, ensure vanilla tooltip is hidden when ours is enabled
1 parent 557ac57 commit ca84f9c

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Template for new versions:
5050
- `gui/sitemap`: shift click to start following the selected unit or artifact
5151
- `prioritize`: when prioritizing jobs of a specified type, also output how many of those jobs were already prioritized before you ran the command
5252
- `prioritize`: don't include already-prioritized jobs in the output of ``prioritize -j``
53+
- `gui/design`: only display vanilla dimensions tooltip if the DFHack dimensions tooltip is disabled
5354

5455
## Removed
5556

docs/gui/design.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ gui/design
77
:tags: fort design productivity interface map
88

99
This tool provides a point and click interface to make designating shapes
10-
and patterns easier. Supports both digging designations and placing constructions.
10+
and patterns easier. Supports both digging designations and placing
11+
constructions.
1112

1213
Usage
1314
-----
@@ -19,18 +20,23 @@ Usage
1920
Overlay
2021
-------
2122

22-
This tool also provides two overlays that are managed by the `overlay` framework.
23+
This tool also provides two overlays that are managed by the `overlay`
24+
framework.
2325

2426
dimensions
2527
~~~~~~~~~~
2628

27-
The ``gui/design.dimensions`` overlay shows the selected dimensions when designating
28-
with vanilla tools, for example when painting a burrow or designating digging.
29-
The dimensions show up in a tooltip that follows the mouse cursor.
29+
The ``gui/design.dimensions`` overlay shows the selected dimensions when
30+
designating with vanilla tools, for example when painting a burrow or
31+
designating digging. The dimensions show up in a tooltip that follows the mouse
32+
cursor.
33+
34+
When this overlay is enabled, the vanilla dimensions display will be hidden.
35+
When this overlay is disabled, the vanilla dimensions display will be unhidden.
3036

3137
rightclick
3238
~~~~~~~~~~
3339

34-
The ``gui/design.rightclick`` overlay prevents the right mouse button and other keys
35-
bound to "Leave screen" from exiting out of designation mode when drawing a box with
36-
vanilla tools, instead making it cancel the designation first.
40+
The ``gui/design.rightclick`` overlay prevents the right mouse button and other
41+
keys bound to "Leave screen" from exiting out of designation mode when drawing
42+
a box with vanilla tools, instead making it cancel the designation first.

gui/design.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ function DimensionsOverlay:preUpdateLayout(parent_rect)
122122
self.frame.h = parent_rect.height
123123
end
124124

125+
function DimensionsOverlay:overlay_onenable()
126+
df.global.d_init.display.flags.SHOW_RECTANGLE_DIMENSIONS = false
127+
end
128+
129+
function DimensionsOverlay:overlay_ondisable()
130+
df.global.d_init.display.flags.SHOW_RECTANGLE_DIMENSIONS = true
131+
end
132+
125133
---
126134
--- RightClickOverlay
127135
---

0 commit comments

Comments
 (0)