Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Template for new versions:
- `bodyswap`: fix "invalid argument count" when the target unit has no nemesis record
- `fix/loyaltycascade`: guard against citizens that are not historical figures and emit a warning.
- `gui/siegemanager`: fix nil index if there are no siege engines on the map
- `machine-toggle`/`trackstop`: overlays no longer steal keys while renaming a pressure plate, gear assembly, track stop, or roller

## Misc Improvements
- `caravan`: the ``Bring goods to depot``, ``Trade``, and ``Assign items for display`` overlays now allow searching for items with non-ASCII characters in their description
Expand Down
14 changes: 14 additions & 0 deletions machine-toggle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ local overlay = require('plugins.overlay')

local getBuild = dfhack.gui.getSelectedBuilding

local vs = df.global.game.main_interface.view_sheets

local FLUID_DEPTHS = {}
for i=1,8 do -- 0 to 7
FLUID_DEPTHS[i] = {value=i-1, label=tostring(i-1)}
Expand Down Expand Up @@ -40,6 +42,12 @@ PlateOverlay.ATTRS{
frame_background=gui.CLEAR_PEN,
}

function PlateOverlay:onInput(keys)
if not vs.building_entering_nickname then
return PlateOverlay.super.onInput(self, keys)
end
end

local function clamp(value, low, high)
return math.min(high, math.max(low, value))
end
Expand Down Expand Up @@ -353,6 +361,12 @@ GearOverlay.ATTRS{
frame_background=gui.CLEAR_PEN,
}

function GearOverlay:onInput(keys)
if not vs.building_entering_nickname then
return GearOverlay.super.onInput(self, keys)
end
end

function GearOverlay:render(dc)
self.subviews.gear_toggle:setOption(not getBuild().gear_flags.disengaged)
GearOverlay.super.render(self, dc)
Expand Down
14 changes: 14 additions & 0 deletions trackstop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ local utils = require('utils')

local getBuild = dfhack.gui.getSelectedBuilding

local vs = df.global.game.main_interface.view_sheets

local NORTH = 'North '..string.char(24)
local EAST = 'East '..string.char(26)
local SOUTH = 'South '..string.char(25)
Expand Down Expand Up @@ -63,6 +65,12 @@ TrackStopOverlay.ATTRS{
frame_background=gui.CLEAR_PEN,
}

function TrackStopOverlay:onInput(keys)
if not vs.building_entering_nickname then
return TrackStopOverlay.super.onInput(self, keys)
end
end

function TrackStopOverlay:setFriction(friction)
getBuild().track_stop_info.friction = FRICTION_MAP[friction]
end
Expand Down Expand Up @@ -166,6 +174,12 @@ RollerOverlay.ATTRS{
frame_background=gui.CLEAR_PEN,
}

function RollerOverlay:onInput(keys)
if not vs.building_entering_nickname then
return RollerOverlay.super.onInput(self, keys)
end
end

function RollerOverlay:setDirection(direction)
getBuild().direction = DIRECTION_MAP[direction]
end
Expand Down