diff --git a/caravan.lua b/caravan.lua index de8c4e32f9..7c434c3cbb 100644 --- a/caravan.lua +++ b/caravan.lua @@ -20,6 +20,7 @@ OVERLAY_WIDGETS = { tradebanner=trade.TradeBannerOverlay, tradeagreement=tradeagreement.TradeAgreementOverlay, movegoods=movegoods.MoveGoodsOverlay, + movegoods_hider=movegoods.MoveGoodsHiderOverlay, assigntrade=movegoods.AssignTradeOverlay, displayitemselector=pedestal.PedestalOverlay, } diff --git a/changelog.txt b/changelog.txt index 75f1739fd9..d0f1a6bb68 100644 --- a/changelog.txt +++ b/changelog.txt @@ -41,6 +41,7 @@ Template for new versions: ## Misc Improvements - `gui/unit-info-viewer`: now displays a unit's weight, relative to either dwarves, elephants or cats - `gui/unit-info-viewer`: shows a unit's relative size to its race's average. +- `caravan`: optional overlay to hide vanilla bring trade goods to depot button (if you prefer to always use the DFHack version and don't want to accidentally click on the vanilla button). enable ``caravan.movegoods_hider`` in `gui/control-panel` UI Overlays tab to use. ## Removed diff --git a/internal/caravan/movegoods.lua b/internal/caravan/movegoods.lua index 454f3d8627..67c63299bd 100644 --- a/internal/caravan/movegoods.lua +++ b/internal/caravan/movegoods.lua @@ -761,6 +761,23 @@ function MoveGoodsOverlay:init() } end +-- ------------------- +-- MoveGoodsHiderOverlay +-- + +MoveGoodsHiderOverlay = defclass(MoveGoodsHiderOverlay, overlay.OverlayWidget) +MoveGoodsHiderOverlay.ATTRS{ + desc='Hides the vanilla trade goods selection button.', + default_pos={x=-70, y=12}, + viewscreens='dwarfmode/ViewSheets/BUILDING/TradeDepot', + frame={w=27, h=3}, + frame_background=gui.CLEAR_PEN, +} + +function MoveGoodsHiderOverlay:onInput(keys) + return keys._MOUSE_L and self:getMouseFramePos() +end + -- ------------------- -- AssignTradeOverlay --