Skip to content

Commit 8e8b0ea

Browse files
committed
Merge remote-tracking branch 'origin/master' into cj/mr-button/pr
2 parents df96afc + b5178d6 commit 8e8b0ea

File tree

7 files changed

+30
-23
lines changed

7 files changed

+30
-23
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
args: ['--fix=lf']
2121
- id: trailing-whitespace
2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.31.2
23+
rev: 0.32.1
2424
hooks:
2525
- id: check-github-workflows
2626
- repo: https://github.com/Lucas-C/pre-commit-hooks

changelog.txt

+10-2
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,24 @@ Template for new versions:
3131

3232
## New Features
3333

34+
## Fixes
35+
36+
## Misc Improvements
37+
38+
## Removed
39+
40+
# 51.11-r1
41+
3442
## Fixes
3543
- `list-agreements`: fix date math when determining petition age
3644
- `gui/petitions`: fix date math when determining petition age
45+
- `gui/rename`: fix commandline processing when manually specifying target ids
46+
- `gui/sandbox`: restore metal equipment options when spawning units
3747

3848
## Misc Improvements
3949
- `fix/loyaltycascade`: now also breaks up brawls and other intra-fort conflicts that *look* like loyalty cascades
4050
- `makeown`: remove selected unit from any current conflicts so they don't just start attacking other citizens when you make them a citizen of your fort
4151

42-
## Removed
43-
4452
# 51.09-r1
4553

4654
## New Features

fix/ownership.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ local zone_vecs = {
3333
local function relink_zones()
3434
for _,zones in ipairs(zone_vecs) do
3535
for _,zone in ipairs(zones) do
36-
local unit = zone.assigned_unit
36+
local unit = dfhack.buildings.getOwner(zone)
3737
if not unit then goto continue end
3838
if not utils.linear_index(unit.owned_buildings, zone.id, 'id') then
3939
print(('fix/ownership: Restoring %s ownership link for %s'):format(

gui/notes.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ function main()
361361
qerror('notes requires a fortress map to be loaded')
362362
end
363363

364-
view = view and view:raise() or NotesScreen{
365-
}:show()
364+
view = view and view:raise() or NotesScreen{}:show()
366365
end
367366

368367
if not dfhack_flags.module then

gui/rename.lua

+7-7
Original file line numberDiff line numberDiff line change
@@ -1022,14 +1022,14 @@ local function main(args)
10221022
show_selector=true,
10231023
}
10241024
local positionals = argparse.processArgsGetopt(args, {
1025-
{ 'a', 'artifact', handler=function(optarg) opts.item_id = argparse.nonnegativeInt(optarg, 'artifact') end },
1026-
{ 'e', 'entity', handler=function(optarg) opts.entity_id = argparse.nonnegativeInt(optarg, 'entity') end },
1027-
{ 'f', 'histfig', handler=function(optarg) opts.histfig_id = argparse.nonnegativeInt(optarg, 'histfig') end },
1025+
{ 'a', 'artifact', hasArg=true, handler=function(optarg) opts.item_id = argparse.nonnegativeInt(optarg, 'artifact') end },
1026+
{ 'e', 'entity', hasArg=true, handler=function(optarg) opts.entity_id = argparse.nonnegativeInt(optarg, 'entity') end },
1027+
{ 'f', 'histfig', hasArg=true, handler=function(optarg) opts.histfig_id = argparse.nonnegativeInt(optarg, 'histfig') end },
10281028
{ 'h', 'help', handler = function() opts.help = true end },
1029-
{ 'l', 'location', handler=function(optarg) opts.location_id = argparse.nonnegativeInt(optarg, 'location') end },
1030-
{ 'q', 'squad', handler=function(optarg) opts.squad_id = argparse.nonnegativeInt(optarg, 'squad') end },
1031-
{ 's', 'site', handler=function(optarg) opts.site_id = argparse.nonnegativeInt(optarg, 'site') end },
1032-
{ 'u', 'unit', handler=function(optarg) opts.unit_id = argparse.nonnegativeInt(optarg, 'unit') end },
1029+
{ 'l', 'location', hasArg=true, handler=function(optarg) opts.location_id = argparse.nonnegativeInt(optarg, 'location') end },
1030+
{ 'q', 'squad', hasArg=true, handler=function(optarg) opts.squad_id = argparse.nonnegativeInt(optarg, 'squad') end },
1031+
{ 's', 'site', hasArg=true, handler=function(optarg) opts.site_id = argparse.nonnegativeInt(optarg, 'site') end },
1032+
{ 'u', 'unit', hasArg=true, handler=function(optarg) opts.unit_id = argparse.nonnegativeInt(optarg, 'unit') end },
10331033
{ 'w', 'world', handler=function() opts.world = true end },
10341034
{ '', 'no-target-selector', handler=function() opts.show_selector = false end },
10351035
})

gui/sandbox.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ local function init_arena()
458458
-- for i in ipairs(df.builtin_mats) do
459459
-- do_insert(MAT_TABLE.builtin[i], i, -1)
460460
-- end
461-
for i, mat in ipairs(RAWS.inorganics) do
461+
for i, mat in ipairs(RAWS.inorganics.all) do
462462
do_insert(mat.material, 0, i)
463463
-- stop at the first "special" metal. we don't need more than that
464464
if mat.flags.DEEP_SPECIAL then break end

test/gui/notes.lua

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ end
3939
local function arrange_gui_notes(options)
4040
options = options or {}
4141

42+
-- running tests removes all overlays because of IN_TEST reloading.
43+
-- rescan so we can load the gui/notes widget for these tests
44+
overlay.rescan()
45+
4246
arrange_notes(options.notes)
4347

4448
gui_notes.main()
4549

46-
local gui_notes = gui_notes.view
47-
gui_notes.enable_selector_blink = false
50+
local view = gui_notes.view
51+
view.enable_selector_blink = false
4852

49-
gui_notes:updateLayout()
50-
gui_notes:onRender()
51-
52-
-- for some reasons running tests remove all overlays,
53-
-- but there are need for gui/notes tests
54-
overlay.rescan()
53+
view:updateLayout()
54+
view:onRender()
5555

56-
return gui_notes, gui_notes.subviews.notes_window
56+
return view, view.subviews.notes_window
5757
end
5858

5959
local function cleanup(gui_notes)

0 commit comments

Comments
 (0)