fix guidm.enterSidebarMode(DesignateMine)

it would end up in DesignateChopTrees if you happened to be looking at
the surface z-level.
develop
myk002 2022-03-28 16:04:41 -07:00 committed by Myk
parent 078e732a42
commit db5e7d55c1
2 changed files with 8 additions and 0 deletions

@ -64,6 +64,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Lua ## Lua
- Lua wrappers for functions reverse-engineered from ambushing unit code: ``isHidden(unit)``, ``isFortControlled(unit)``, ``getOuterContainerRef(unit)``, ``getOuterContainerRef(item)`` - Lua wrappers for functions reverse-engineered from ambushing unit code: ``isHidden(unit)``, ``isFortControlled(unit)``, ``getOuterContainerRef(unit)``, ``getOuterContainerRef(item)``
- ``dwarfmode.enterSidebarMode()``: passing ``df.ui_sidebar_mode.DesignateMine`` now always results in you entering ``DesignateMine`` mode and not ``DesignateChopTrees``, even when you looking at the surface where the default designation mode is ``DesignateChopTrees``
# 0.47.05-r4 # 0.47.05-r4

@ -52,6 +52,13 @@ function enterSidebarMode(sidebar_mode, max_esc)
if df.global.ui.main.mode == df.ui_sidebar_mode.Default and if df.global.ui.main.mode == df.ui_sidebar_mode.Default and
focus_string == 'dwarfmode/Default' then focus_string == 'dwarfmode/Default' then
if #navkey > 0 then gui.simulateInput(screen, navkey) end if #navkey > 0 then gui.simulateInput(screen, navkey) end
if navkey == 'D_DESIGNATE' then
-- if the z-level happens to be on the surface, the mode will be
-- set to DesignateChopTrees. we need an extra step to get to
-- DesignateMine
gui.simulateInput(dfhack.gui.getCurViewscreen(true),
'DESIGNATE_DIG')
end
return return
end end
gui.simulateInput(screen, 'LEAVESCREEN') gui.simulateInput(screen, 'LEAVESCREEN')