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 @@ -40,6 +40,7 @@ Template for new versions:
- `caravan`: the ``Trade`` overlay will use the trader's appraisal skill instead of the broker's to round/obfuscate the value of items

## Removed
- `confirm`: removed the ``squad-disband`` and ``hotkey-reset`` confirmations; the game asks for both itself now ("Really disband?" and "Really overwrite")

# 53.15-r2

Expand Down
59 changes: 0 additions & 59 deletions internal/confirm/specs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function ConfirmSpec:init()
end

local mi = df.global.game.main_interface
local plotinfo = df.global.plotinfo

local function trade_goods_any_selected(which)
local any_selected = false
Expand Down Expand Up @@ -238,16 +237,6 @@ ConfirmSpec{
end,
}

ConfirmSpec{
id='squad-disband',
title='Disband squad',
message='Are you sure you want to disband this squad?',
intercept_keys='_MOUSE_L',
context='dwarfmode/Squads',
predicate=function() return mi.current_hover == df.main_hover_instruction.SQUAD_DISBAND end,
pausable=true,
}

ConfirmSpec{
id='uniform-delete',
title='Delete uniform',
Expand Down Expand Up @@ -345,54 +334,6 @@ ConfirmSpec{
on_propagate=clear_uniform_record,
}

local hotkey_reset_action = 'reset'
local num_hotkeys = 16
ConfirmSpec{
id='hotkey-reset',
title='Reassign or clear zoom hotkeys',
message=function() return ('Are you sure you want to %s this zoom hotkey?'):format(hotkey_reset_action) end,
intercept_keys='_MOUSE_L',
intercept_frame={r=32, t=11, w=12, b=9},
context='dwarfmode/Hotkey',
predicate=function(_, mouse_offset)
local _, sh = dfhack.screen.getWindowSize()
local num_sections = (sh - 20) // 3
local selected_section = mouse_offset.y // 3
-- if this isn't a button section, exit early
if selected_section % 2 ~= 0 then return false end
-- if this hotkey isn't set, then all actions are ok
local selected_offset = selected_section // 2
local selected_idx = selected_offset + mi.hotkey.scroll_position
local max_visible_buttons = num_sections // 2
if selected_offset >= max_visible_buttons or
selected_idx >= num_hotkeys or
plotinfo.main.hotkeys[selected_idx].cmd == df.hotkey_type.None
then
return false
end
-- adjust detection area depending on presence of scrollbar
if max_visible_buttons < num_hotkeys then
if mouse_offset.x > 7 then
return false
elseif mouse_offset.x <= 3 then
hotkey_reset_action = 'reassign'
else
hotkey_reset_action = 'clear'
end
elseif max_visible_buttons >= num_hotkeys then
if mouse_offset.x <= 1 then
return false
elseif mouse_offset.x <= 5 then
hotkey_reset_action = 'reassign'
else
hotkey_reset_action = 'clear'
end
end
return true
end,
pausable=true,
}

local selected_convict_name = 'this creature'
ConfirmSpec{
id='convict',
Expand Down
Loading