Planet Picker


Pick your individual starting planet.

Tweaks
9 months ago
2.0
3.05K
Environment

g General Mod Compatibility

6 months ago
(updated 6 months ago)

I was able to jury-rig a few modifications to make this automatically add modded planets to the GUI, which seems to work pretty well. There's no github for pull requests as far as I can see, so here's a poor man's diff if you want to import them yourself.
Add the following just about anywhere in control.lua, I put it in PlanetSelect.setup_planets:

if settings.startup["planet-picker-modded-planets"] then
    for n, p in pairs(game.planets) do
      PlanetSelect.add_planet({
        name = n,
        tooltip = n:sub(1,1):upper()..n:sub(2),
        icon = "planet-picker-"..n,
        surface = n,
      })
    end
  end

To data-final-fixes.lua we need to add new sprite prototypes (which encopass the vanilla ones, we can delete all of them except unidentified planet from prototypes.sprite)

if settings.startup["planet-picker-modded-planets"] then
  for n,p in pairs(data.raw["planet"]) do
    data.extend({{
      type = "sprite",
      name = "planet-picker-"..n,
      filename = p.starmap_icon,
      size = p.starmap_icon_size,
      scale = 1.0,
      priority = "high",
    }})
  end
end

You would also need to add the setting and localization for it, and change a few other snippets, but that's the gist of it. I felt the need to make this because starting on Naufulglebunusilo seemed like a critically important thing to be able to do.

New response