File tree Expand file tree Collapse file tree 3 files changed +51
-5
lines changed
Expand file tree Collapse file tree 3 files changed +51
-5
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ Template for new versions:
5151- `gui/gm-editor`: automatic display of semantic values for language_name fields
5252- `fix/stuck-worship`: reduced console output by default. Added ``--verbose`` and ``--quiet`` options.
5353- `necronomicon`: new ``--world`` option to list all secret-containing items in the entire world
54+ - `gui/design`: new ``gui/design.rightclick`` overlay that prevents right click from closing designation mode when drawing boxes and minecart tracks
5455
5556## Removed
5657- `modtools/force`: merged into `force`
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ gui/design
44
55.. dfhack-tool ::
66 :summary: Design designation utility with shapes.
7- :tags: fort design productivity map
7+ :tags: fort design productivity interface map
88
99This tool provides a point and click interface to make designating shapes
1010and patterns easier. Supports both digging designations and placing constructions.
1919Overlay
2020-------
2121
22- This script provides an overlay that shows the selected dimensions when
23- designating something with vanilla tools, for example when painting a burrow or
24- designating digging. The dimensions show up in a tooltip that follows the mouse
25- cursor.
22+ This tool also provides two overlays that are managed by the `overlay ` framework.
23+
24+ dimensions
25+ ~~~~~~~~~~
26+
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.
30+
31+ rightclick
32+ ~~~~~~~~~~
33+
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.
Original file line number Diff line number Diff line change @@ -120,8 +120,42 @@ function DimensionsOverlay:preUpdateLayout(parent_rect)
120120 self .frame .h = parent_rect .height
121121end
122122
123+ ---
124+ --- RightClickOverlay
125+ ---
126+
127+ RightClickOverlay = defclass (RightClickOverlay , overlay .OverlayWidget )
128+ RightClickOverlay .ATTRS {
129+ desc = ' When drawing boxes, makes right click cancel selection instead of exiting.' ,
130+ default_enabled = true ,
131+ viewscreens = {
132+ ' dwarfmode/Designate' ,
133+ ' dwarfmode/Burrow/Paint' ,
134+ ' dwarfmode/Stockpile/Paint' ,
135+ ' dwarfmode/Zone/Paint' ,
136+ ' dwarfmode/Building/Placement'
137+ },
138+ }
139+
140+ function RightClickOverlay :onInput (keys )
141+ if keys ._MOUSE_R or keys .LEAVESCREEN then
142+ -- building mode
143+ if uibs .selection_pos .x >= 0 then
144+ uibs .selection_pos :clear ()
145+ return true
146+ -- all other modes
147+ elseif selection_rect .start_x >= 0 then
148+ selection_rect .start_x = - 30000
149+ selection_rect .start_y = - 30000
150+ selection_rect .start_z = - 30000
151+ return true
152+ end
153+ end
154+ end
155+
123156OVERLAY_WIDGETS = {
124157 dimensions = DimensionsOverlay ,
158+ rightclick = RightClickOverlay ,
125159}
126160
127161---
You can’t perform that action at this time.
0 commit comments