Skip to content
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
4 changes: 2 additions & 2 deletions gui/advfort.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1430,11 +1430,11 @@ function track_stop_configure(bld) --TODO: dedicated widget with nice interface
else
dialog.showListPrompt("Dumping direction", "Choose dumping:",COLOR_WHITE,dump_choices,function ( index,choice)
if choice.x then
bld.use_dump=1 --??
bld.track_flags.use_dump=true
bld.dump_x_shift=choice.x
bld.dump_y_shift=choice.y
else
bld.use_dump=0
bld.track_flags.use_dump=false
end
end)
end
Expand Down
2 changes: 1 addition & 1 deletion internal/quickfort/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ end
local function make_trackstop_entry(direction, friction)
local label, fields, transform = 'No Dump', {friction=friction}, nil
if direction then
fields.use_dump = 1
ensure_key(fields, 'track_flags').use_dump = true
for k,v in pairs(direction) do
local trackstop_data_entry = trackstop_data[k][v]
label = trackstop_data_entry.label
Expand Down
2 changes: 1 addition & 1 deletion internal/quickfort/place.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ local function custom_stockpile(_, keys)
props.wheelbarrows = nil
end
if props.links_only == 'true' then
db_entry.props.use_links_only = 1
ensure_key(db_entry.props, 'stockpile_flag').use_links_only = 1
props.links_only = nil
end
if props.name then
Expand Down
17 changes: 9 additions & 8 deletions internal/quickfort/zone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ end

local function parse_gather_props(zone_data, props)
if props.pick_trees == 'false' then
ensure_keys(zone_data, 'zone_settings', 'gather').pick_trees = false
ensure_keys(zone_data, 'zone_settings', 'gather', 'flags').pick_trees = false
props.pick_trees = nil
end
if props.pick_shrubs == 'false' then
ensure_keys(zone_data, 'zone_settings', 'gather').pick_shrubs = false
ensure_keys(zone_data, 'zone_settings', 'gather', 'flags').pick_shrubs = false
props.pick_shrubs = nil
end
if props.gather_fallen == 'false' then
ensure_keys(zone_data, 'zone_settings', 'gather').gather_fallen = false
ensure_keys(zone_data, 'zone_settings', 'gather', 'flags').gather_fallen = false
props.gather_fallen = nil
end
end
Expand Down Expand Up @@ -105,9 +105,9 @@ local zone_db_raw = {
b={label='Bedroom', default_data={type=df.civzone_type.Bedroom}},
h={label='Dining Hall', default_data={type=df.civzone_type.DiningHall}},
n={label='Pen/Pasture', default_data={type=df.civzone_type.Pen,
assign={zone_settings={pen={unk=1}}}}},
assign={zone_settings={pen={check_occupants=true}}}}},
p={label='Pit/Pond', props_fn=parse_pit_pond_props, default_data={type=df.civzone_type.Pond,
assign={zone_settings={pit_pond=df.building_civzonest.T_zone_settings.T_pit_pond.top_of_pit}}}},
assign={zone_settings={pond={flag={keep_filled=true}}}}}},
Copy link
Member

@quietust quietust May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be setting check_occupants=True and keep_filled=False to make it act as a Pit (as the old "top_of_pit" value did) - as it is right now, this setting will make it act like a Pond instead.

Copy link
Member

@lethosor lethosor May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, pit_pond (now pond.flag) changed from an enum to a bitfield - missed that. So I agree, setting 2 before would correspond to setting check_occupants=true now.

Confirmed it was 2 in 50.13-r2.1:

[lua]# ~df.building_civzonest.T_zone_settings.T_pit_pond.top_of_pit
2

w={label='Water Source', default_data={type=df.civzone_type.WaterSource}},
j={label='Dungeon', default_data={type=df.civzone_type.Dungeon}},
f={label='Fishing', default_data={type=df.civzone_type.FishingArea}},
Expand All @@ -122,12 +122,13 @@ local zone_db_raw = {
T={label='Tomb', props_fn=parse_tomb_props, default_data={type=df.civzone_type.Tomb,
assign={zone_settings={tomb={whole=1}}}}},
g={label='Gather/Pick Fruit', props_fn=parse_gather_props, default_data={type=df.civzone_type.PlantGathering,
assign={zone_settings={gather={pick_trees=true, pick_shrubs=true, gather_fallen=true}}}}},
assign={zone_settings={gather={flags={pick_trees=true, pick_shrubs=true, gather_fallen=true}}}}}},
c={label='Clay', default_data={type=df.civzone_type.ClayCollection}},
}
for _, v in pairs(zone_db_raw) do
utils.assign(v, zone_template)
ensure_key(v.default_data, 'assign').is_active = 8 -- set to active by default
-- set to active by default
ensure_keys(v.default_data, 'assign', 'spec_sub_flag').active = true
end

-- we may want to offer full name aliases for the single letter ones above
Expand Down Expand Up @@ -241,7 +242,7 @@ local function parse_zone_config(c, props)
utils.assign(zone_data, db_entry.default_data)
zone_data.location = parse_location_props(props)
if props.active == 'false' then
zone_data.is_active = 0
ensure_key(zone_data, 'spec_sub_flag').active = false
props.active = nil
end
if props.name then
Expand Down
14 changes: 7 additions & 7 deletions trackstop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ end

function TrackStopOverlay:getDumpDirection()
local building = dfhack.gui.getSelectedBuilding()
local use_dump = building.use_dump
local use_dump = building.track_flags.use_dump
local dump_x_shift = building.dump_x_shift
local dump_y_shift = building.dump_y_shift

if use_dump == 0 then
if not use_dump then
return NONE
else
if dump_x_shift == 0 and dump_y_shift == -1 then
Expand All @@ -98,23 +98,23 @@ function TrackStopOverlay:setDumpDirection(direction)
local building = dfhack.gui.getSelectedBuilding()

if direction == NONE then
building.use_dump = 0
building.track_flags.use_dump = false
building.dump_x_shift = 0
building.dump_y_shift = 0
elseif direction == NORTH then
building.use_dump = 1
building.track_flags.use_dump = true
building.dump_x_shift = 0
building.dump_y_shift = -1
elseif direction == EAST then
building.use_dump = 1
building.track_flags.use_dump = true
building.dump_x_shift = 1
building.dump_y_shift = 0
elseif direction == SOUTH then
building.use_dump = 1
building.track_flags.use_dump = true
building.dump_x_shift = 0
building.dump_y_shift = 1
elseif direction == WEST then
building.use_dump = 1
building.track_flags.use_dump = true
building.dump_x_shift = -1
building.dump_y_shift = 0
end
Expand Down