Skip to content

Commit 6a369da

Browse files
authored
Merge pull request #1510 from NicksWorld/fix/design-stair-designation
Use stairtype setting when designating a single-layer staircase
2 parents 7e8a4e8 + 6aa6a34 commit 6a369da

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Template for new versions:
3131
## New Features
3232

3333
## Fixes
34+
- `gui/design`: designating a single-level stair construction now properly follows the selected stair type.
35+
- `gui/design`: adjusted conflicting keybinds, diagonal line reverse becoming ``R`` and bottom stair type becoming ``g``.
3436
- `modtools/set-personality`: use correct caste trait ranges; fixes `gui/gm-unit` being unable to correctly randomize traits or set traits to caste average
3537

3638
## Misc Improvements

docs/gui/design.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Shapes
4545
- Spacing can be increased/decreased using 'T'/'t'.
4646
- They can be inverted using 'i'.
4747
- Diagonal
48-
- Direction can be reversed using 'r'.
48+
- Direction can be reversed using 'R'.
4949
- Spacing can be increased/decreased using 'T'/'t'.
5050
- They can be inverted using 'i'.
5151
- Line

gui/design.lua

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ function Design:init()
409409
widgets.CycleHotkeyLabel {
410410
view_id='stairs_bottom_subtype',
411411
frame={t=1, l=0},
412-
key='CUSTOM_SHIFT_B',
412+
key='CUSTOM_G',
413413
label='Bottom Stair Type:',
414414
visible=function()
415415
local bounds = self:get_view_bounds()
@@ -1346,8 +1346,15 @@ function Design:get_designation(point)
13461346
if mode.desig == 'i' then
13471347
local stairs_top_type = self.subviews.stairs_top_subtype:getOptionValue()
13481348
local stairs_bottom_type = self.subviews.stairs_bottom_subtype:getOptionValue()
1349+
local stairs_only_type = self.subviews.stairs_only_subtype:getOptionValue()
13491350
if point.z == 0 then
1350-
return stairs_bottom_type == 'auto' and 'u' or stairs_bottom_type
1351+
if view_bounds.z1 == view_bounds.z2 then
1352+
-- Single layer staircase
1353+
return stairs_only_type
1354+
else
1355+
-- Bottom of multi-level staircase
1356+
return stairs_bottom_type == 'auto' and 'u' or stairs_bottom_type
1357+
end
13511358
elseif view_bounds and point.z == math.abs(view_bounds.z1 - view_bounds.z2) then
13521359
local pos = Point{x=view_bounds.x1, y=view_bounds.y1, z=view_bounds.z1} + point
13531360
local tile_type = dfhack.maps.getTileType(xyz2pos(pos.x, pos.y, pos.z))

internal/design/shapes.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ function Diag:init()
384384
name = "Reverse",
385385
type = "bool",
386386
value = false,
387-
key = "CUSTOM_R",
387+
key = "CUSTOM_SHIFT_R",
388388
},
389389
}
390390
end

0 commit comments

Comments
 (0)