Merge branch 'develop' into myk_readable

develop
Myk 2023-10-09 18:01:15 -07:00 committed by GitHub
commit a7b5bf67eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 8 deletions

@ -60,10 +60,12 @@ Template for new versions:
- `sort`: new search widgets for Info panel tabs, including all "Creatures" subtabs, all "Objects" subtabs, "Tasks", the "Work details" subtab under "Labor", and the "Interrogate" and "Convict" screens under "Justice"
## Fixes
- `zone`: don't show animal assignment link for dungeon cages/restraints
## Misc Improvements
- `overlay`: allow ``overlay_onupdate_max_freq_seconds`` to be dynamically set to 0 for a burst of high-frequency updates
- `orders`: ``recheck`` command now only resets orders that have conditions that can be rechecked
- `sort`: added help button for squad assignment search/filter/sort
- `zone`: animals trained for war or hunting are now labeled as such in animal assignment screens
## Documentation

@ -4,6 +4,7 @@ local info = require('plugins.sort.info')
local gui = require('gui')
local overlay = require('plugins.overlay')
local setbelief = reqscript('modtools/set-belief')
local textures = require('gui.textures')
local utils = require('utils')
local widgets = require('gui.widgets')
@ -631,10 +632,6 @@ SquadAssignmentOverlay.ATTRS{
viewscreens='dwarfmode/UnitSelector/SQUAD_FILL_POSITION',
version='2',
frame={w=38, h=31},
frame_style=gui.FRAME_PANEL,
frame_background=gui.CLEAR_PEN,
autoarrange_subviews=true,
autoarrange_gap=1,
}
-- allow initial spacebar or two successive spacebars to fall through and
@ -661,7 +658,14 @@ function SquadAssignmentOverlay:init()
})
end
self:addviews{
local main_panel = widgets.Panel{
frame={l=0, r=0, t=0, b=0},
frame_style=gui.FRAME_PANEL,
frame_background=gui.CLEAR_PEN,
autoarrange_subviews=true,
autoarrange_gap=1,
}
main_panel:addviews{
widgets.EditField{
view_id='search',
frame={l=0},
@ -940,6 +944,26 @@ function SquadAssignmentOverlay:init()
on_change=function() self:refresh_list() end,
},
}
local button_pen_left = dfhack.pen.parse{fg=COLOR_CYAN,
tile=curry(textures.tp_control_panel, 7) or nil, ch=string.byte('[')}
local button_pen_right = dfhack.pen.parse{fg=COLOR_CYAN,
tile=curry(textures.tp_control_panel, 8) or nil, ch=string.byte(']')}
local help_pen_center = dfhack.pen.parse{
tile=curry(textures.tp_control_panel, 9) or nil, ch=string.byte('?')}
self:addviews{
main_panel,
widgets.Label{
frame={t=0, r=1, w=3},
text={
{tile=button_pen_left},
{tile=help_pen_center},
{tile=button_pen_right},
},
on_click=function() dfhack.run_command('gui/launcher', 'sort ') end,
},
}
end
local function normalize_search_key(search_key)

@ -961,9 +961,13 @@ CageChainOverlay.ATTRS{
local function is_valid_building()
local bld = dfhack.gui.getSelectedBuilding(true)
return bld and bld:getBuildStage() == bld:getMaxBuildStage() and
(bld:getType() == df.building_type.Cage or
bld:getType() == df.building_type.Chain)
if not bld or bld:getBuildStage() ~= bld:getMaxBuildStage() then return false end
local bt = bld:getType()
if bt ~= df.building_type.Cage and bt ~= df.building_type.Chain then return false end
for _,zone in ipairs(bld.relations) do
if zone.type == df.civzone_type.Dungeon then return false end
end
return true
end
local function is_cage_selected()