Skip to content

Commit

Permalink
use new squads focus strings
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Oct 4, 2024
1 parent dd9592c commit 9c99659
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions gui/civ-alert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,17 @@ CivalertOverlay.ATTRS{
frame={w=20, h=5},
}

local function is_squads_panel_open()
return dfhack.gui.matchFocusString('dwarfmode/Squads/Default',
dfhack.gui.getDFViewscreen(true))
end

local function should_show_alert_button()
return can_clear_alarm() or
(df.global.game.main_interface.squads.open and can_sound_alarm())
return can_clear_alarm() or (is_squads_panel_open() and can_sound_alarm())
end

local function should_show_configure_button()
return df.global.game.main_interface.squads.open
and not can_sound_alarm() and not can_clear_alarm()
return is_squads_panel_open() and not can_sound_alarm() and not can_clear_alarm()
end

local function launch_config()
Expand Down
2 changes: 1 addition & 1 deletion internal/confirm/specs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ ConfirmSpec{
-- sticks out the left side so it can move with the panel
-- when the screen is resized too narrow
intercept_frame={r=32, t=19, w=101, b=3},
context='dwarfmode/SquadEquipment/Customizing/Default',
context='dwarfmode/Squads/Equipment/Customizing/Default',
predicate=function(keys, mouse_offset)
if keys._MOUSE_R then
return uniform_has_changes()
Expand Down
2 changes: 1 addition & 1 deletion uniform-unstick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ EquipOverlay.ATTRS{
desc='Adds a link to the equip screen to fix equipment conflicts.',
default_pos={x=7,y=21},
default_enabled=true,
viewscreens='dwarfmode/SquadEquipment/Default',
viewscreens='dwarfmode/Squads/Equipment/Default',
frame={w=MIN_WIDTH, h=1},
}

Expand Down

0 comments on commit 9c99659

Please sign in to comment.