From 31b23851561da1840ef6e438ae4d511cfd8cb485 Mon Sep 17 00:00:00 2001 From: "Nick J. Connors" Date: Sun, 6 Feb 2022 10:47:17 -0500 Subject: [PATCH] Added dialogue block after persistent condition --- NewHorizons/AssetBundle/WarpDriveConfig.json | 3 ++- NewHorizons/Builder/Props/DialogueBuilder.cs | 3 +++ NewHorizons/External/PropModule.cs | 2 +- NewHorizons/Main.cs | 5 +---- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NewHorizons/AssetBundle/WarpDriveConfig.json b/NewHorizons/AssetBundle/WarpDriveConfig.json index eb685c70..cc45a642 100644 --- a/NewHorizons/AssetBundle/WarpDriveConfig.json +++ b/NewHorizons/AssetBundle/WarpDriveConfig.json @@ -8,7 +8,8 @@ "position":{"x": -0.3071011, "y": 2.741472, "z": -4.005298}, "radius":1, "xmlFile":"AssetBundle/WarpDriveDialogue.xml", - "remoteTriggerPosition": {"x": -0.05656214, "y": 0.5362684, "z": 0.5467669} + "remoteTriggerPosition": {"x": -0.05656214, "y": 0.5362684, "z": 0.5467669}, + "blockAfterPersistentCondition" : "KnowsAboutWarpDrive" } ] } diff --git a/NewHorizons/Builder/Props/DialogueBuilder.cs b/NewHorizons/Builder/Props/DialogueBuilder.cs index 3b1a786a..76e5d95d 100644 --- a/NewHorizons/Builder/Props/DialogueBuilder.cs +++ b/NewHorizons/Builder/Props/DialogueBuilder.cs @@ -15,6 +15,9 @@ namespace NewHorizons.Builder.Props { public static void Make(GameObject go, Sector sector, PropModule.DialogueInfo info, IModHelper mod) { + + if (PlayerData._currentGameSave.GetPersistentCondition(info.blockAfterPersistentCondition)) return; + var dialogue = MakeConversationZone(go, sector, info, mod); if (info.remoteTriggerPosition != null) MakeRemoteDialogueTrigger(go, sector, info, dialogue); } diff --git a/NewHorizons/External/PropModule.cs b/NewHorizons/External/PropModule.cs index 02f66142..dfe7455c 100644 --- a/NewHorizons/External/PropModule.cs +++ b/NewHorizons/External/PropModule.cs @@ -66,7 +66,7 @@ namespace NewHorizons.External public float radius = 1f; public string xmlFile; public MVector3 remoteTriggerPosition; - public string persistentCondition; + public string blockAfterPersistentCondition; } } } diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 967b4466..c3ab9039 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -115,10 +115,7 @@ namespace NewHorizons _shipWarpController = GameObject.Find("Ship_Body").AddComponent(); Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => ShipLogBuilder.Init()); - if (!PlayerData._currentGameSave.GetPersistentCondition("KnowsAboutWarpDrive")) - { - LoadBody(LoadConfig(this, "AssetBundle/WarpDriveConfig.json")); - } + LoadBody(LoadConfig(this, "AssetBundle/WarpDriveConfig.json")); } Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => AstroObjectLocator.GetAstroObject("MapSatellite").gameObject.AddComponent());