diff --git a/gui/advfort.lua b/gui/advfort.lua index bd85f97c0e..f9a38c5b6c 100644 --- a/gui/advfort.lua +++ b/gui/advfort.lua @@ -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 diff --git a/internal/quickfort/build.lua b/internal/quickfort/build.lua index 8e827964b2..ce1f013f7b 100644 --- a/internal/quickfort/build.lua +++ b/internal/quickfort/build.lua @@ -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 diff --git a/internal/quickfort/place.lua b/internal/quickfort/place.lua index 3875fe6fdf..c1cd71e396 100644 --- a/internal/quickfort/place.lua +++ b/internal/quickfort/place.lua @@ -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 diff --git a/internal/quickfort/zone.lua b/internal/quickfort/zone.lua index 74db293558..ed11f68404 100644 --- a/internal/quickfort/zone.lua +++ b/internal/quickfort/zone.lua @@ -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 @@ -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}}}}}}, 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}}, @@ -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 @@ -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 diff --git a/trackstop.lua b/trackstop.lua index 8065261624..c1ae132a36 100644 --- a/trackstop.lua +++ b/trackstop.lua @@ -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 @@ -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