Skip to content

Commit

Permalink
Scanner: group roboports by their network name
Browse files Browse the repository at this point in the history
  • Loading branch information
ahicks92 committed Oct 19, 2024
1 parent 76b1f90 commit a8c7bd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions scripts/scanner/backends/single-entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,14 @@ mod.LogisticsWithFluid = decl("fa.scanner.backends.LogisticsWithFluid", {
return cat2(ent.name, fluid_name)
end,
})

-- Roboports are categorized by network name.
mod.Roboport = decl("fa.scanner.backends.Roboport", {
category_callback = functionize(SC.CATEGORIES.LOGISTICS),

---@param ent LuaEntity
subcategory_callback = function(ent)
return cat2(ent.name, ent.backer_name)
end,
})
return mod
4 changes: 2 additions & 2 deletions scripts/scanner/surface-scanner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ local BACKEND_LUT = {
["rail-signal"] = SEB.TrainsSimple,
["reactor"] = SEB.Logistics,
["resource"] = ResourcePatchesBackend.ResourcePatchesBackend,
["roboport"] = SEB.Logistics,
["roboport"] = SEB.Roboport,
["rocket-silo-rocket-shadow"] = SEB.Other,
["rocket-silo-rocket"] = SEB.Other,
["rocket-silo"] = SEB.Production,
Expand Down Expand Up @@ -200,7 +200,7 @@ end
local surface_state = GlobalManager.declare_global_module(
"scanner",
new_empty_surface,
{ root_field = "surfaces", ephemeral_state_version = 3 }
{ root_field = "surfaces", ephemeral_state_version = 4 }
)

-- Given a backend setup and an array of entities, dispatch the entities to the
Expand Down

0 comments on commit a8c7bd9

Please sign in to comment.