Switch proxyDetails to use SimplifiedDetailInfo

This commit is contained in:
Noah Pilarski 2025-04-18 05:44:21 -04:00
parent 4c031f9df5
commit 7431c7e0cc
3 changed files with 17 additions and 16 deletions

View File

@ -4,6 +4,7 @@ using NewHorizons.Components;
using NewHorizons.Components.Props;
using NewHorizons.Components.SizeControllers;
using NewHorizons.External;
using NewHorizons.External.Modules.Props;
using NewHorizons.External.Modules.VariableSize;
using NewHorizons.Handlers;
using NewHorizons.Utility;
@ -208,10 +209,9 @@ namespace NewHorizons.Builder.Body
if (body.Config.Props?.proxyDetails != null)
{
foreach (var detailInfo in body.Config.Props.proxyDetails)
foreach (var simplifiedDetailInfo in body.Config.Props.proxyDetails)
{
// Thought about switching these to SimplifiedDetailInfo but we use AlignRadial with these so we can't
DetailBuilder.Make(proxy, null, body.Mod, detailInfo);
DetailBuilder.Make(proxy, null, body.Mod, new DetailInfo(simplifiedDetailInfo));
}
}

View File

@ -51,7 +51,7 @@ namespace NewHorizons.External.Modules
/// <summary>
/// Details which will be shown from 50km away. Meant to be lower resolution.
/// </summary>
public DetailInfo[] proxyDetails;
public SimplifiedDetailInfo[] proxyDetails;
/// <summary>
/// Add rafts to this planet (requires Echoes of the Eye DLC)

View File

@ -50,6 +50,18 @@ namespace NewHorizons.External.Modules.Props
/// Scale each axis of the prop. Overrides `scale`.
/// </summary>
public MVector3 stretch;
/// <summary>
/// Activates this game object when the dialogue condition is met
/// </summary>
public string activationCondition;
/// <summary>
/// Deactivates this game object when the dialogue condition is met
/// </summary>
public string deactivationCondition;
[Obsolete("alignToNormal is deprecated. Use alignRadial instead")] public bool alignToNormal;
}
[JsonObject]
@ -65,6 +77,7 @@ namespace NewHorizons.External.Modules.Props
public DetailInfo(SimplifiedDetailInfo info)
{
keepLoaded = true;
blinkWhenActiveChanged = false;
JsonConvert.PopulateObject(JsonConvert.SerializeObject(info), this);
}
@ -108,16 +121,6 @@ namespace NewHorizons.External.Modules.Props
/// </summary>
public bool ignoreSun;
/// <summary>
/// Activates this game object when the dialogue condition is met
/// </summary>
public string activationCondition;
/// <summary>
/// Deactivates this game object when the dialogue condition is met
/// </summary>
public string deactivationCondition;
/// <summary>
/// Should the player close their eyes while the activation state changes. Only relevant if activationCondition or deactivationCondition are set.
/// </summary>
@ -132,8 +135,6 @@ namespace NewHorizons.External.Modules.Props
/// Should this detail be treated as a socket for an interactible item
/// </summary>
public ItemSocketInfo itemSocket;
[Obsolete("alignToNormal is deprecated. Use alignRadial instead")] public bool alignToNormal;
}
}