diff --git a/build-now.lua b/build-now.lua index 35ac7a6f6b..ae20db7f4a 100644 --- a/build-now.lua +++ b/build-now.lua @@ -65,7 +65,7 @@ local function get_jobs(opts) -- job_items are not items, they're filters that describe the kinds of -- items that need to be attached. - for _,job_item in ipairs(job.job_items) do + for _,job_item in ipairs(job.job_items.elements) do -- we have to check for quantity != 0 instead of just the existence -- of the job_item since buildingplan leaves 0-quantity job_items in -- place to protect against persistence errors. diff --git a/feature.lua b/feature.lua index 0e14f41627..c94f27ed6a 100644 --- a/feature.lua +++ b/feature.lua @@ -45,8 +45,8 @@ function list_features() if feat:isChasm() then tags = tags .. ' [chasm]' end - if feat:isLayer() then - tags = tags .. ' [layer]' + if feat:isUnderworld() then + tags = tags .. ' [underworld]' end feat:getName(name) print(('Feature #%i is %s: "%s", type %s%s'):format( diff --git a/gui/advfort.lua b/gui/advfort.lua index f9a38c5b6c..5cd621ed6a 100644 --- a/gui/advfort.lua +++ b/gui/advfort.lua @@ -413,15 +413,14 @@ function SetCarveDir(args) local job=args.job local pos=args.pos local from_pos=args.from_pos - local dirs={up=18,down=19,right=20,left=21} if pos.x>from_pos.x then - job.item_category[dirs.right]=true + job.specflag.carve_track_flags.carve_track_east=true elseif pos.xfrom_pos.y then - job.item_category[dirs.down]=true + job.specflag.carve_track_flags.carve_track_south=true elseif pos.y0 then + if settings.gui_item_select and #job.job_items.elements>0 then if settings.quick then --TODO not so nice hack. instead of rewriting logic for job item filling i'm using one in gui dialog... local item_editor=advfort_items.jobitemEditor{ job = job, @@ -925,7 +924,7 @@ function AssignJobItems(args) end else if not settings.build_by_items then - for job_id, trg_job_item in ipairs(job.job_items) do + for job_id, trg_job_item in ipairs(job.job_items.elements) do if item_counts[job_id]>0 then print("Not enough items for this job") return false, "Not enough items for this job" @@ -1001,7 +1000,7 @@ function ContinueJob(unit) --reset suspends... c_job.flags.suspend=false for k,v in pairs(c_job.items) do --try fetching missing items - if v.is_fetching==1 then + if v.flags.is_fetching then unit.path.dest:assign(v.item.pos) return end @@ -1277,7 +1276,7 @@ function setFiltersUp(specific,args) --printall(v) local filter=v filter.new=true - job.job_items:insert("#",filter) + job.job_items.elements:insert("#",filter) end return true end diff --git a/gui/tiletypes.lua b/gui/tiletypes.lua index 69ef3f67fc..299539d3a4 100644 --- a/gui/tiletypes.lua +++ b/gui/tiletypes.lua @@ -658,7 +658,7 @@ function BoxSelection:init() guidm.setCursorPos(guidm.Viewport.get():getCenter()) -- Show cursor - df.global.game.main_interface.main_designation_selected = df.main_designation_type.TOGGLE_ENGRAVING -- Alternative: df.main_designation_type.REMOVE_CONSTRUCTION + df.global.game.main_interface.main_designation_selected = df.main_designation_type.TOGGLE_ENGRAVING if self.screen then self.dimensions_tooltip = widgets.DimensionsTooltip{ diff --git a/gui/workshop-job.lua b/gui/workshop-job.lua index 406c15ebb0..5c368f8ba8 100644 --- a/gui/workshop-job.lua +++ b/gui/workshop-job.lua @@ -175,7 +175,7 @@ function JobDetails:initListChoices() end local choices = {} - for i,iobj in ipairs(self.job.job_items) do + for i,iobj in ipairs(self.job.job_items.elements) do local head = 'Item '..(i+1)..': '..(items[i] or 0)..' of '..iobj.quantity if iobj.min_dimension > 0 then head = head .. '(size '..iobj.min_dimension..')' diff --git a/internal/advfort/advfort_items.lua b/internal/advfort/advfort_items.lua index 2842849e6d..e89cd8e9f1 100644 --- a/internal/advfort/advfort_items.lua +++ b/internal/advfort/advfort_items.lua @@ -35,7 +35,7 @@ function update_slot_text(slot) slot.text=string.format("%02d. Filled(%d/%d):%s",slot.id+1,slot.filled_amount,slot.job_item.quantity,items) end ---items-> table => key-> id of job.job_items, value-> table => key (num), value => item(ref) +--items-> table => key-> id of job.job_items.elements, value-> table => key (num), value => item(ref) function jobitemEditor:init(args) --self.job=args.job if self.job==nil and self.job_items==nil then qerror("This screen must have job target or job_items list") end @@ -156,7 +156,7 @@ function jobitemEditor:fill() local job_item if self.job then - job_item=self.job.job_items[k] + job_item=self.job.job_items.elements[k] else job_item=self.job_items[k] end diff --git a/internal/dwarf-op/dorf_tables.lua b/internal/dwarf-op/dorf_tables.lua index ad89f84cf1..410f897c4e 100644 --- a/internal/dwarf-op/dorf_tables.lua +++ b/internal/dwarf-op/dorf_tables.lua @@ -218,7 +218,7 @@ professions = { --Arts & Crafts & Dwarfism CRAFTSMAN = { skills = {WOODCRAFT=2, STONECRAFT=2, METALCRAFT=2} }, - ENGRAVER = { skills = {DETAILSTONE=5} }, + ENGRAVER = { skills = {ENGRAVE_STONE=5} }, MECHANIC = { skills = {MECHANICS=5} }, --Plants & Animals diff --git a/internal/quickfort/stockflow.lua b/internal/quickfort/stockflow.lua index 52fa743118..1884c1b324 100644 --- a/internal/quickfort/stockflow.lua +++ b/internal/quickfort/stockflow.lua @@ -129,19 +129,19 @@ function collect_reactions() reaction_entry(result, job_types.EncrustWithGems, { mat_type = 0, mat_index = rock_id, - item_category = {finished_goods = true}, + specflag = {encrust_flags={finished_goods=true}}, }, "Encrust Finished Goods With "..rock_name) reaction_entry(result, job_types.EncrustWithGems, { mat_type = 0, mat_index = rock_id, - item_category = {furniture = true}, + specflag = {encrust_flags={furniture=true}}, }, "Encrust Furniture With "..rock_name) reaction_entry(result, job_types.EncrustWithGems, { mat_type = 0, mat_index = rock_id, - item_category = {ammo = true}, + specflag = {encrust_flags={ammo=true}}, }, "Encrust Ammo With "..rock_name) end @@ -172,17 +172,17 @@ function collect_reactions() reaction_entry(result, job_types.EncrustWithGlass, { mat_type = glass_id, - item_category = {finished_goods = true}, + specflag = {encrust_flags={finished_goods=true}}, }, "Encrust Finished Goods With "..glass_name) reaction_entry(result, job_types.EncrustWithGlass, { mat_type = glass_id, - item_category = {furniture = true}, + specflag = {encrust_flags={furniture=true}}, }, "Encrust Furniture With "..glass_name) reaction_entry(result, job_types.EncrustWithGlass, { mat_type = glass_id, - item_category = {ammo = true}, + specflag = {encrust_flags={ammo=true}}, }, "Encrust Ammo With "..glass_name) end end diff --git a/modtools/create-unit.lua b/modtools/create-unit.lua index d861b7ebde..8f5b623caf 100644 --- a/modtools/create-unit.lua +++ b/modtools/create-unit.lua @@ -956,7 +956,6 @@ function enableUnitLabors(unit, default, skilled) labors.HANDLE_VEHICLES = true labors.HAUL_TRADE = true labors.PULL_LEVER = true - labors.REMOVE_CONSTRUCTION = true labors.HAUL_WATER = true labors.BUILD_ROAD = true labors.BUILD_CONSTRUCTION = true diff --git a/sync-windmills.lua b/sync-windmills.lua index cc25703395..36a2d67972 100644 --- a/sync-windmills.lua +++ b/sync-windmills.lua @@ -3,7 +3,7 @@ local argparse = require('argparse') local function process_windmills(rotate_fn, timer_fn) for _, bld in ipairs(df.global.world.buildings.other.WINDMILL) do if bld.is_working ~= 0 then - bld.visual_rotated = rotate_fn() + bld.rotation = rotate_fn() bld.rotate_timer = timer_fn() end end @@ -24,8 +24,8 @@ end process_windmills( (opts.randomize or opts.timing) and - function() return math.random(1, 2) == 1 end or - function() return false end, + function() return math.random(0, 1) end or + function() return 0 end, opts.randomize and not opts.timing and function() return math.random(0, 74) end or function() return 0 end) diff --git a/workorder.lua b/workorder.lua index 34a9419004..ae32bb182a 100644 --- a/workorder.lua +++ b/workorder.lua @@ -76,18 +76,15 @@ local function orders_match(a, b) end end - local subtables = { - "item_category", - "material_category", - } + for key, value in ipairs(a.specflag.encrust_flags) do + if b.specflag.encrust_flags[key] ~= value then + return false + end + end - for _, fieldname in ipairs(subtables) do - local aa = a[fieldname] - local bb = b[fieldname] - for key, value in ipairs(aa) do - if bb[key] ~= value then - return false - end + for key, value in ipairs(a.material_category) do + if b.material_category[key] ~= value then + return false end end @@ -246,7 +243,7 @@ function create_orders(orders, quiet) end if it["item_category"] then - local ok, bad = set_flags_from_list(it["item_category"], order.item_category) + local ok, bad = set_flags_from_list(it["item_category"], order.specflag.encrust_flags) if not ok then qerror ("Invalid item_category value for manager order: " .. bad) end @@ -351,7 +348,7 @@ function create_orders(orders, quiet) break end end - condition.inorganic_bearing = idx + condition.metal_ore = idx or qerror( "Invalid item condition inorganic bearing type for manager order: " .. it2["bearing"] ) end @@ -398,7 +395,7 @@ function create_orders(orders, quiet) end) end end - --order.items = vector + --order.items.elements = vector local amount = it.amount_total if it.__reduce_amount then