confirm for removing burrows via the repaint menu

develop
Myk Taylor 2023-03-27 16:11:21 -07:00
parent b515b337ea
commit 02b52fcb3d
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
3 changed files with 9 additions and 4 deletions

@ -52,6 +52,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Misc Improvements ## Misc Improvements
- `buildingplan`: filters and global settings are now ignored when manually choosing items for a building - `buildingplan`: filters and global settings are now ignored when manually choosing items for a building
- `confirm`: adds confirmation for removing burrows via the repaint menu
- `stockpiles`: support applying stockpile configurations with fully enabled categories to stockpiles in worlds other than the one where the configuration was exported from - `stockpiles`: support applying stockpile configurations with fully enabled categories to stockpiles in worlds other than the one where the configuration was exported from
- `stockpiles`: support partial application of a saved config based on dynamic filtering - `stockpiles`: support partial application of a saved config based on dynamic filtering
- `stockpiles`: additive and subtractive modes when applying a second stockpile configuration on top of a first - `stockpiles`: additive and subtractive modes when applying a second stockpile configuration on top of a first

@ -5,8 +5,9 @@ confirm
:summary: Adds confirmation dialogs for destructive actions. :summary: Adds confirmation dialogs for destructive actions.
:tags: fort interface :tags: fort interface
Now you can get the chance to avoid accidentally disbanding a squad or deleting a In the base game, it is frightenly easy to destroy hours of work with a single
hauling route in case you hit the key accidentally. misclick. Now you can avoid the consequences of accidentally disbanding a squad
(for example), or deleting a hauling route.
Usage Usage
----- -----

@ -12,10 +12,11 @@ setmetatable(keys, {
-- Mouse keys will be sent as a string instead of interface_key -- Mouse keys will be sent as a string instead of interface_key
local MOUSE_LEFT = "MOUSE_LEFT" local MOUSE_LEFT = "MOUSE_LEFT"
local MOUSE_RIGHT = "MOUSE_RIGHT" local MOUSE_RIGHT = "MOUSE_RIGHT"
--[[ The screen where a confirmation has been triggered --[[ The screen where a confirmation has been triggered
Note that this is *not* necessarily the topmost viewscreen, so do not use Note that this is *not* necessarily the topmost viewscreen, so do not use
gui.getCurViewscreen() or related functions. ]] gui.getCurViewscreen() or related functions. ]]
screen = nil --screen = nil
function if_nil(obj, default) function if_nil(obj, default)
if obj == nil then if obj == nil then
@ -118,7 +119,9 @@ zone_remove.message = "Are you sure you want to remove this zone?"
burrow_remove = defconf('burrow-remove') burrow_remove = defconf('burrow-remove')
function burrow_remove.intercept_key(key) function burrow_remove.intercept_key(key)
return key == MOUSE_LEFT and df.global.game.main_interface.current_hover == 171 return key == MOUSE_LEFT and
(df.global.game.main_interface.current_hover == 171 or
df.global.game.main_interface.current_hover == 168)
end end
burrow_remove.title = "Remove burrow" burrow_remove.title = "Remove burrow"
burrow_remove.message = "Are you sure you want to remove this burrow?" burrow_remove.message = "Are you sure you want to remove this burrow?"