Skip to content

Commit

Permalink
Merge pull request #1317 from myk002/myk_squads_focus
Browse files Browse the repository at this point in the history
use new squads focus strings
  • Loading branch information
myk002 authored Oct 4, 2024
2 parents 457aa24 + 9c99659 commit 7a2ffc5
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 @@ -345,7 +345,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 7a2ffc5

Please sign in to comment.