Skip to content
Open
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ The library provides automatic functionality to restrict cargo drops on your pla
* `PlanetsLib.technology_icons_moon` — Icon to be used in moon discovery technologies.
* `subgroup=satellites` — A new Factoriopedia row for satellites (below the planets row).

### Other subgroups

* `subgroup=gas-giants` — A Factoriopedia row for gas giants.
* `subgroup=asteroid-belts` — A Factoriopedia row for asteroid belts. If any asteroid belts are defined, the Shattered planet's subgroup will be changed to this.
* `subgroup=dwarf-planets` — A Factoriopedia row for dwarf planets.

### Description templates

Documentation pending.
Expand Down
11 changes: 11 additions & 0 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ for _, planet in pairs(planets) do
end
end

--If any modded asteroid belts exist, the Shattered planet's subcategory will change to "asteroid-belt."
local has_asteroid_belts = false
for _, location in pairs(data.raw["space-location"]) do
if location.subgroup == "asteroid-belts" then
has_asteroid_belts = true
end
end
if has_asteroid_belts then
data.raw["space-location"]["shattered-planet"].subgroup = "asteroid-belts"
end

for _, type in pairs({ "space-location", "planet" }) do
for _, location in pairs(data.raw[type]) do
if
Expand Down
18 changes: 18 additions & 0 deletions prototypes/categories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,22 @@ data:extend({
group = "space",
order = "j-a",
},
{
type = "item-subgroup",
name = "gas-giants",
group = "space",
order = "j-b",
},
{
type = "item-subgroup",
name = "asteroid-belts",
group = "space",
order = "j-c",
},
{
type = "item-subgroup",
name = "dwarf-planets",
group = "space",
order = "j-d",
},
})