Skip to content

Commit c4ba771

Browse files
authored
Merge pull request #1610 from magnus-ISU/remove-confirms-with-vanilla-equivalents
Remove `Really disband squad` and `Really change recenter location`
2 parents c19c2de + 36b7fa7 commit c4ba771

2 files changed

Lines changed: 1 addition & 59 deletions

File tree

‎changelog.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Template for new versions:
4040
- `caravan`: the ``Trade`` overlay will use the trader's appraisal skill instead of the broker's to round/obfuscate the value of items
4141

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

4445
# 53.15-r2
4546

‎internal/confirm/specs.lua‎

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ function ConfirmSpec:init()
5454
end
5555

5656
local mi = df.global.game.main_interface
57-
local plotinfo = df.global.plotinfo
5857

5958
local function trade_goods_any_selected(which)
6059
local any_selected = false
@@ -238,16 +237,6 @@ ConfirmSpec{
238237
end,
239238
}
240239

241-
ConfirmSpec{
242-
id='squad-disband',
243-
title='Disband squad',
244-
message='Are you sure you want to disband this squad?',
245-
intercept_keys='_MOUSE_L',
246-
context='dwarfmode/Squads',
247-
predicate=function() return mi.current_hover == df.main_hover_instruction.SQUAD_DISBAND end,
248-
pausable=true,
249-
}
250-
251240
ConfirmSpec{
252241
id='uniform-delete',
253242
title='Delete uniform',
@@ -345,54 +334,6 @@ ConfirmSpec{
345334
on_propagate=clear_uniform_record,
346335
}
347336

348-
local hotkey_reset_action = 'reset'
349-
local num_hotkeys = 16
350-
ConfirmSpec{
351-
id='hotkey-reset',
352-
title='Reassign or clear zoom hotkeys',
353-
message=function() return ('Are you sure you want to %s this zoom hotkey?'):format(hotkey_reset_action) end,
354-
intercept_keys='_MOUSE_L',
355-
intercept_frame={r=32, t=11, w=12, b=9},
356-
context='dwarfmode/Hotkey',
357-
predicate=function(_, mouse_offset)
358-
local _, sh = dfhack.screen.getWindowSize()
359-
local num_sections = (sh - 20) // 3
360-
local selected_section = mouse_offset.y // 3
361-
-- if this isn't a button section, exit early
362-
if selected_section % 2 ~= 0 then return false end
363-
-- if this hotkey isn't set, then all actions are ok
364-
local selected_offset = selected_section // 2
365-
local selected_idx = selected_offset + mi.hotkey.scroll_position
366-
local max_visible_buttons = num_sections // 2
367-
if selected_offset >= max_visible_buttons or
368-
selected_idx >= num_hotkeys or
369-
plotinfo.main.hotkeys[selected_idx].cmd == df.hotkey_type.None
370-
then
371-
return false
372-
end
373-
-- adjust detection area depending on presence of scrollbar
374-
if max_visible_buttons < num_hotkeys then
375-
if mouse_offset.x > 7 then
376-
return false
377-
elseif mouse_offset.x <= 3 then
378-
hotkey_reset_action = 'reassign'
379-
else
380-
hotkey_reset_action = 'clear'
381-
end
382-
elseif max_visible_buttons >= num_hotkeys then
383-
if mouse_offset.x <= 1 then
384-
return false
385-
elseif mouse_offset.x <= 5 then
386-
hotkey_reset_action = 'reassign'
387-
else
388-
hotkey_reset_action = 'clear'
389-
end
390-
end
391-
return true
392-
end,
393-
pausable=true,
394-
}
395-
396337
local selected_convict_name = 'this creature'
397338
ConfirmSpec{
398339
id='convict',

0 commit comments

Comments
 (0)