Skip to content

Commit e7ac8f2

Browse files
authored
Merge branch 'develop' into patch-10
2 parents 1d79fd0 + f944852 commit e7ac8f2

27 files changed

+200
-90
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ cmake_policy(SET CMP0048 NEW)
66
cmake_policy(SET CMP0074 NEW)
77

88
# set up versioning.
9-
set(DF_VERSION "51.04")
10-
set(DFHACK_RELEASE "r1.1")
9+
set(DF_VERSION "51.05")
10+
set(DFHACK_RELEASE "r1")
1111
set(DFHACK_PRERELEASE FALSE)
1212

1313
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")

docs/about/Authors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ NotRexButCaesar NotRexButCaesar
158158
Nuno Fernandes UnknowableCoder
159159
nuvu vallode
160160
Omniclasm
161+
Ong Ying Gao ong-yinggao98
161162
oorzkws oorzkws
162163
OwnageIsMagic OwnageIsMagic
163164
palenerd dlmarquis

docs/changelog.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ Template for new versions:
3535
## Documentation
3636

3737
## API
38-
- ``Military::removeFromSquad``: removes unit from any squad assignments
3938

4039
## Lua
41-
- ``dfhack.units.setAutomaticProfessions``: sets unit labors according to current work detail settings
42-
- ``dfhack.military.removeFromSquad``: Lua API for ``Military::removeFromSquad``
4340

4441
## Removed
4542

@@ -57,27 +54,40 @@ Template for new versions:
5754
## New Tools
5855

5956
## New Features
60-
- `spectate`: can now specify number of seconds (in real time) before switching to follow a new unit unit
57+
- `spectate`: can now specify number of seconds (in real time) before switching to follow a new unit
6158
- `spectate`: new "cinematic-action" mode that dynamically speeds up perspective switches based on intensity of conflict
6259
- `spectate`: new global keybinding for toggling spectate mode: Ctrl-Shift-S
60+
- `spectate`: when spectate mode is enabled, left/right arrow will cycle through following next/prevous units
6361

6462
## Fixes
63+
- `createitem`: output items will now end up at look cursor if active
6564
- `spectate`: don't allow temporarily modified announcement settings to be written to disk when "auto-unpause" mode is enabled
6665
- `changevein`: fix a crash that could occur when attempting to change a vein into itself
6766

6867
## Misc Improvements
6968
- `spectate`: player-set configuration is now stored globally instead of per-fort
7069
- `autobutcher`: treat animals on restraints as unavailable for slaughter
70+
- `stockpiles`: add property filters for brewable, millable, and processable (e.g. at a Farmer's workshop) organic materials
7171

7272
## Documentation
73-
- `stonesense-art-guide`: new guide for making sprite art for Stonesense
73+
- `stonesense-art-guide`: guide for making sprite art for Stonesense
7474

7575
## API
76+
- ``Military::removeFromSquad``: removes unit from any squad assignments
77+
- ``Buildings::checkFreeTiles``: now replaces the extents parameter for a building pointer
7678

7779
## Lua
80+
- ``dfhack.units.setAutomaticProfessions``: sets unit labors according to current work detail settings
81+
- ``dfhack.military.removeFromSquad``: Lua API for ``Military::removeFromSquad``
82+
- ``gui.dwarfmode``: adventure mode cursor now supported in ``getCursorPos``, ``setCursorPos``, and ``clearCursorPos`` funcitons
83+
- ``dfhack.buildings.checkFreeTiles``: now replaces the extents parameter for a building pointer
7884

7985
## Removed
8086

87+
# 51.05-r1
88+
89+
## Misc Improvements
90+
- Compatibility with DF 51.05
8191
# 51.04-r1.1
8292

8393
## Fixes

docs/dev/Lua API.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,8 +1991,9 @@ Military module
19911991
Removes a unit from its squad. Unsets the unit's
19921992
military information (i.e., ``unit.military.squad_id`` and
19931993
``unit.military.squad_pos``), the squad's position information (i.e.,
1994-
``squad.positions[squad_pos].occupant``), and modifies the unit's entity links
1995-
to indicate former squad membership or command.
1994+
``squad.positions[squad_pos].occupant``), modifies the unit's entity links
1995+
to indicate former squad membership or command, and creates a corresponding
1996+
world history event.
19961997

19971998
Items module
19981999
------------
@@ -2476,14 +2477,15 @@ General
24762477
using width and height for flexible dimensions.
24772478
Returns *is_flexible, width, height, center_x, center_y*.
24782479

2479-
* ``dfhack.buildings.checkFreeTiles(pos,size[,extents[,change_extents[,allow_occupied[,allow_wall[,allow_flow]]]]])``
2480+
* ``dfhack.buildings.checkFreeTiles(pos,size[,bld[,change_extents[,allow_occupied[,allow_wall[,allow_flow]]]]])``
24802481

2481-
Checks if the rectangle defined by ``pos`` and ``size``, and possibly extents,
2482-
can be used for placing a building. If ``change_extents`` is true, bad tiles
2483-
are removed from extents. If ``allow_occupied``, the occupancy test is skipped.
2484-
Set ``allow_wall`` to true if the building is unhindered by walls (such as an
2485-
activity zone). Set ``allow_flow`` to true if the building can be built even
2486-
if there is deep water or any magma on the tile (such as abstract buildings).
2482+
Checks if the rectangle defined by ``pos`` and ``size``, and possibly the
2483+
extents associated with bld, can be used for placing a building. If
2484+
``change_extents`` is true, bad tiles are removed from extents. If
2485+
``allow_occupied``, the occupancy test is skipped. Set ``allow_wall`` to true
2486+
if the building is unhindered by walls (such as an activity zone). Set
2487+
``allow_flow`` to true if the building can be built even if there is deep
2488+
water or any magma on the tile (such as abstract buildings).
24872489

24882490
* ``dfhack.buildings.countExtentTiles(extents,defval)``
24892491

docs/plugins/stockpiles.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,12 @@ Flags and subcategory prefixes::
378378
paste/
379379
pressed/
380380

381+
Properties::
382+
383+
brewable
384+
millable
385+
processable
386+
381387
Settings files::
382388

383389
preparedmeals

library/include/modules/Buildings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ DFHACK_EXPORT bool getCorrectSize(df::coord2d &size, df::coord2d &center,
111111
* Checks if the tiles are free to be built upon.
112112
*/
113113
DFHACK_EXPORT bool checkFreeTiles(df::coord pos, df::coord2d size,
114-
df::building *bld,
114+
df::building *bld = nullptr,
115115
bool create_ext = false,
116116
bool allow_occupied = false,
117117
bool allow_wall = false,

library/lua/custom-raw-tokens.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ local function getTokenArg1Else(userdata, token)
300300
elseif df.is_instance(df.building_workshopst, userdata) or df.is_instance(df.building_furnacest, userdata) then
301301
rawStruct = df.building_def.find(userdata.custom_type)
302302
elseif df.is_instance(df.interaction_instance, userdata) then
303-
rawStruct = df.global.world.raws.interactions[userdata.interaction_id]
303+
rawStruct = df.global.world.raws.interactions.all[userdata.interaction_id]
304304
else
305305
-- Assume raw struct *is* argument 1
306306
rawStruct = userdata

library/lua/dfhack/workshops.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ local function addReactionJobs(ret,bid,wid,cid)
509509
end
510510
local function scanRawsOres()
511511
local ret={}
512-
for idx,ore in ipairs(df.global.world.raws.inorganics) do
512+
for idx,ore in ipairs(df.global.world.raws.inorganics.all) do
513513
if #ore.metal_ore.mat_index~=0 then
514514
ret[idx]=ore
515515
end

library/lua/gui/dwarfmode.lua

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local utils = require('utils')
77

88
local dscreen = dfhack.screen
99

10+
local a_look = df.global.game.main_interface.adventure.look
1011
local g_cursor = df.global.cursor
1112
local g_sel_rect = df.global.selection_rect
1213
local world_map = df.global.world.map
@@ -38,17 +39,35 @@ end
3839

3940
---@return df.coord|nil
4041
function getCursorPos()
41-
if g_cursor.x >= 0 then
42+
if dfhack.world.isAdventureMode() then
43+
if a_look.open then
44+
return copyall(a_look.cursor)
45+
end
46+
elseif g_cursor.x >= 0 then
4247
return copyall(g_cursor)
4348
end
4449
end
4550

4651
function setCursorPos(cursor)
47-
df.global.cursor = copyall(cursor)
52+
if dfhack.world.isAdventureMode() then
53+
a_look.cursor = copyall(cursor)
54+
else
55+
df.global.cursor = copyall(cursor)
56+
end
4857
end
4958

5059
function clearCursorPos()
51-
df.global.cursor = xyz2pos(nil)
60+
if dfhack.world.isAdventureMode() then
61+
if not a_look.open then
62+
return
63+
end
64+
local u = dfhack.world.getAdventurer()
65+
if u and u.pos:isValid() then
66+
a_look.cursor = copyall(u.pos)
67+
end
68+
else
69+
df.global.cursor = xyz2pos(nil)
70+
end
5271
end
5372

5473
function getSelection()

library/lua/gui/materials.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ end
116116
function MaterialDialog:initInorganicMode()
117117
local choices = {}
118118

119-
for i,mat in ipairs(df.global.world.raws.inorganics) do
119+
for i,mat in ipairs(df.global.world.raws.inorganics.all) do
120120
self:addMaterial(choices, mat.material, 0, i, false, mat)
121121
end
122122

@@ -378,14 +378,14 @@ function ItemTraitsDialog(args)
378378
end
379379
--------------------------------------
380380
local set_ore_ix = {}
381-
for i, raw in ipairs(df.global.world.raws.inorganics) do
381+
for i, raw in ipairs(df.global.world.raws.inorganics.all) do
382382
for _, ix in ipairs(raw.metal_ore.mat_index) do
383383
set_ore_ix[ix] = true
384384
end
385385
end
386386
local ores = {}
387387
for ix in pairs(set_ore_ix) do
388-
local raw = df.global.world.raws.inorganics[ix]
388+
local raw = df.global.world.raws.inorganics.all[ix]
389389
ores[#ores+1] = {mat_index = ix, name = raw.material.state_name.Solid}
390390
end
391391
table.sort(ores, function(a,b) return a.name < b.name end)

0 commit comments

Comments
 (0)