Merge pull request #3115 from myk002/myk_confirm_burrow

[confirm] add check for removing burrows via the repaint menu
develop
Myk 2023-03-28 06:47:27 -07:00 committed by GitHub
commit ab2f3b1373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
- `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 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

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

@ -12,10 +12,11 @@ setmetatable(keys, {
-- Mouse keys will be sent as a string instead of interface_key
local MOUSE_LEFT = "MOUSE_LEFT"
local MOUSE_RIGHT = "MOUSE_RIGHT"
--[[ The screen where a confirmation has been triggered
Note that this is *not* necessarily the topmost viewscreen, so do not use
gui.getCurViewscreen() or related functions. ]]
screen = nil
--screen = nil
function if_nil(obj, default)
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')
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
burrow_remove.title = "Remove burrow"
burrow_remove.message = "Are you sure you want to remove this burrow?"