Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use new squads focus strings #1317

Merged
merged 1 commit into from
Oct 4, 2024
Merged
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
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