Skip to content

Commit

Permalink
Remove shouldRender, use better focus string
Browse files Browse the repository at this point in the history
  • Loading branch information
robob27 committed Nov 7, 2023
1 parent eba5ea9 commit ac3584b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions trackstop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ TrackStopOverlay = defclass(TrackStopOverlay, overlay.OverlayWidget)
TrackStopOverlay.ATTRS{
default_pos={x=-73, y=29},
default_enabled=true,
viewscreens='dwarfmode/ViewSheets/BUILDING/Trap',
viewscreens='dwarfmode/ViewSheets/BUILDING/Trap/TrackStop',
frame={w=25, h=4},
frame_style=gui.MEDIUM_FRAME,
frame_background=gui.CLEAR_PEN,
Expand Down Expand Up @@ -120,10 +120,6 @@ function TrackStopOverlay:setDumpDirection(direction)
end

function TrackStopOverlay:render(dc)
if not self:shouldRender() then
return
end

local building = dfhack.gui.getSelectedBuilding()
local friction = building.friction
local friction_cycle = self.subviews.friction
Expand All @@ -135,18 +131,6 @@ function TrackStopOverlay:render(dc)
TrackStopOverlay.super.render(self, dc)
end

function TrackStopOverlay:shouldRender()
local building = dfhack.gui.getSelectedBuilding()
return building and building.trap_type == df.trap_type.TrackStop
end

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

function TrackStopOverlay:init()
self:addviews{
widgets.CycleHotkeyLabel{
Expand Down

0 comments on commit ac3584b

Please sign in to comment.