Skip to content

Commit 714ef87

Browse files
committed
respect current cursor mode in block-borders
1 parent 65e0ff4 commit 714ef87

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

devel/block-borders.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ BlockBordersOverlay = defclass(BlockBordersOverlay, guidm.MenuOverlay)
3030
BlockBordersOverlay.ATTRS{
3131
block_size = 16,
3232
draw_borders = true,
33-
sidebar_mode=df.ui_sidebar_mode.LookAround,
3433
}
3534

3635
function BlockBordersOverlay:onInput(keys)
@@ -104,4 +103,8 @@ if not dfhack.isMapLoaded() then
104103
qerror('This script requires a fortress map to be loaded')
105104
end
106105

107-
BlockBordersOverlay():show()
106+
-- we can work both with a cursor and without one. start in a mode that mirrors
107+
-- the current game state
108+
local is_cursor = not not guidm.getCursorPos()
109+
local sidebar_mode = df.ui_sidebar_mode[is_cursor and 'LookAround' or 'Default']
110+
BlockBordersOverlay{sidebar_mode=sidebar_mode}:show()

0 commit comments

Comments
 (0)