Add option to enable/disable showing body on title screen

This commit is contained in:
Nick 2022-05-04 23:01:18 -04:00
parent 2e7fa09734
commit bdb6fb40ab
4 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,7 @@ namespace NewHorizons.External.Configs
bool Destroy { get; }
string[] ChildrenToDestroy { get; }
int BuildPriority { get; }
bool CanShowOnTitle { get; }
BaseModule Base { get; }
AtmosphereModule Atmosphere { get; }
OrbitModule Orbit { get; }

View File

@ -13,6 +13,7 @@ namespace NewHorizons.External.Configs
public bool Destroy { get; set; }
public string[] ChildrenToDestroy { get; set; }
public int BuildPriority { get; set; } = -1;
public bool CanShowOnTitle { get; set; } = true;
public BaseModule Base { get; set; }
public AtmosphereModule Atmosphere { get; set; }
public OrbitModule Orbit { get; set; }

View File

@ -18,7 +18,7 @@ namespace NewHorizons.Handlers
{
//Try loading one planet why not
//var eligible = BodyDict.Values.ToList().SelectMany(x => x).ToList().Where(b => (b.Config.HeightMap != null || b.Config.Atmosphere?.Cloud != null) && b.Config.Star == null).ToArray();
var eligible = bodies.Where(b => (b.Config.HeightMap != null || b.Config.Atmosphere?.Cloud != null) && b.Config.Star == null).ToArray();
var eligible = bodies.Where(b => (b.Config.HeightMap != null || b.Config.Atmosphere?.Cloud != null) && b.Config.Star == null && b.Config.CanShowOnTitle).ToArray();
var eligibleCount = eligible.Count();
if (eligibleCount == 0) return;

View File

@ -145,6 +145,11 @@
"description": "A list of paths to child GameObjects to destroy on this planet",
"default": []
},
"canShowOnTitle": {
"type": "boolean",
"description": "Should this planet ever be shown on the title screen",
"default": "true"
}
"Base": {
"type": "object",
"additionalProperties": false,