From af1dffa320d879a2d2a27c8506158ef11d587413 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 27 Jul 2023 00:26:19 -0400 Subject: [PATCH] WTF WORK!!!! --- NewHorizons/NewHorizonsApi.cs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/NewHorizons/NewHorizonsApi.cs b/NewHorizons/NewHorizonsApi.cs index d9599453..e395bfa1 100644 --- a/NewHorizons/NewHorizonsApi.cs +++ b/NewHorizons/NewHorizonsApi.cs @@ -8,7 +8,6 @@ using NewHorizons.External.Modules.Props; using NewHorizons.External.Modules.Props.Audio; using NewHorizons.External.Modules.Props.Dialogue; using NewHorizons.External.SerializableData; -using NewHorizons.OtherMods.MenuFramework; using NewHorizons.Utility; using NewHorizons.Utility.OWML; using Newtonsoft.Json; @@ -62,7 +61,7 @@ namespace NewHorizons if (!Main.BodyDict.ContainsKey(body.Config.starSystem)) Main.BodyDict.Add(body.Config.starSystem, new List()); Main.BodyDict[body.Config.starSystem].Add(body); } - catch(Exception ex) + catch (Exception ex) { NHLogger.LogError($"Error in Create API:\n{ex}"); } @@ -143,7 +142,8 @@ namespace NewHorizons public T QueryBody(string bodyName, string jsonPath) { var data = QueryBody(typeof(T), bodyName, jsonPath); - if (data is T result) { + if (data is T result) + { return result; } return default; @@ -152,14 +152,16 @@ namespace NewHorizons public object QuerySystem(Type outType, string jsonPath) { var system = Main.SystemDict[Main.Instance.CurrentStarSystem]; - return system == null - ? null + return system == null + ? null : QueryJson(outType, Path.Combine(system.Mod.ModHelper.Manifest.ModFolderPath, system.RelativePath), jsonPath); } - public T QuerySystem(string jsonPath) { + public T QuerySystem(string jsonPath) + { var data = QuerySystem(typeof(T), jsonPath); - if (data is T result) { + if (data is T result) + { return result; } return default; @@ -169,7 +171,8 @@ namespace NewHorizons float scale, bool alignRadial) { var prefab = SearchUtilities.Find(propToCopyPath); - var detailInfo = new DetailInfo() { + var detailInfo = new DetailInfo() + { position = position, rotation = eulerAngles, scale = scale, @@ -199,8 +202,8 @@ namespace NewHorizons return SignalBuilder.Make(root, null, info, mod).GetComponent(); } - public (CharacterDialogueTree, RemoteDialogueTrigger) SpawnDialogue(IModBehaviour mod, GameObject root, string xmlFile, float radius = 1f, - float range = 1f, string blockAfterPersistentCondition = null, float lookAtRadius = 1f, string pathToAnimController = null, + public (CharacterDialogueTree, RemoteDialogueTrigger) SpawnDialogue(IModBehaviour mod, GameObject root, string xmlFile, float radius = 1f, + float range = 1f, string blockAfterPersistentCondition = null, float lookAtRadius = 1f, string pathToAnimController = null, float remoteTriggerRadius = 0f) { var info = new DialogueInfo()