Move schema rename childrenToDestroy

This commit is contained in:
Nick 2022-05-17 20:37:06 -04:00
parent 90f84d26af
commit 289bee9436
8 changed files with 16 additions and 7 deletions

View File

@ -9,7 +9,7 @@ namespace NewHorizons.External.Configs
public string Version { get; set; }
public string StarSystem { get; set; } = "SolarSystem";
public bool Destroy { get; set; }
public string[] ChildrenToDestroy { get; set; }
public string[] RemoveChildren { get; set; }
public int BuildPriority { get; set; } = -1;
public bool CanShowOnTitle { get; set; } = true;
public bool IsQuantumState { get; set; }
@ -32,6 +32,10 @@ namespace NewHorizons.External.Configs
public SandModule Sand { get; set; }
public FunnelModule Funnel { get; set; }
// Obsolete
public string[] ChildrenToDestroy { get; set; }
public PlanetConfig()
{
// Always have to have a base module
@ -68,6 +72,11 @@ namespace NewHorizons.External.Configs
{
Base.ShowMinimap = false;
}
if (ChildrenToDestroy != null)
{
RemoveChildren = ChildrenToDestroy;
}
}
}
}

View File

@ -248,9 +248,9 @@ namespace NewHorizons.Handlers
UpdateBodyOrbit(body, go);
}
if (body.Config.ChildrenToDestroy != null && body.Config.ChildrenToDestroy.Length > 0)
if (body.Config.RemoveChildren != null && body.Config.RemoveChildren.Length > 0)
{
foreach (var child in body.Config.ChildrenToDestroy)
foreach (var child in body.Config.RemoveChildren)
{
Main.Instance.ModHelper.Events.Unity.FireInNUpdates(() => GameObject.Find(go.name + "/" + child)?.SetActive(false), 2);
}

View File

@ -182,7 +182,7 @@
"description": "`true` if you want to delete this planet",
"default": false
},
"childrenToDestroy": {
"removeChildren": {
"type": "array",
"description": "A list of paths to child GameObjects to destroy on this planet",
"items": {
@ -262,7 +262,7 @@
"default": false,
"description": "Set this to true if you are replacing the sun with a different body. Only one object in a star system should ever have this set to true."
},
"showMiniMap": {
"showMinimap": {
"type": "boolean",
"default": true,
"description": "Do we show the minimap when walking around this planet?"