## Major features
- API now allows you to register a custom builder method. This method
takes the planet game object and the json string of its `extras` module,
allowing you to alter your planet accordingly.

## Improvements
- Can now update the orbits of the HGT. Implements #225
This commit is contained in:
Nick 2023-08-26 18:11:07 -04:00 committed by GitHub
commit db9d47f050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ namespace NewHorizons.Handlers
public static float SolarSystemRadius { get; private set; }
public static float DefaultFurthestOrbit => 30000f;
public static List<Action<GameObject, string>> CustomBuilders;
public static List<Action<GameObject, string>> CustomBuilders = new();
public static void Init(List<NewHorizonsBody> bodies)
{
@ -712,9 +712,9 @@ namespace NewHorizons.Handlers
{
customBuilder.Invoke(go, JsonConvert.SerializeObject(body.Config.extras));
}
catch
catch (Exception e)
{
NHLogger.LogError($"Failed to use custom builder on body {body.Config.name}");
NHLogger.LogError($"Failed to use custom builder on body {body.Config.name} - {e}");
}
}
}