## Bug fixes
- Made the `alignmentTargetBody` field on warp pads actually work
- Fixed `removeComponents` breaking object parenting
This commit is contained in:
Nick 2023-03-26 13:59:26 -04:00 committed by GitHub
commit a31e1d0499
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 14 deletions

View File

@ -12,7 +12,7 @@ on:
branches: [main]
paths:
- docs/**
- NewHorizons/Schemas/*.xsd
- NewHorizons/Schemas/*
env:
URL_PREFIX: '/'

View File

@ -35,13 +35,6 @@ jobs:
with:
artifact_name: NewHorizons-Schemas-Release
secrets: inherit
Update_Docs:
name: 'Update Docs'
needs: Build
if: ${{ needs.Build.outputs.schemas_changed == 'true' && github.ref == 'refs/heads/main' }} # Same thing with docs
uses: './.github/workflows/docs_build.yml'
with:
schemas_artifact: NewHorizons-Schemas-Debug
Update_Release:
name: 'Create/Update Release Asset'
needs: Build

View File

@ -170,6 +170,8 @@ namespace NewHorizons.Builder.Props
if (detail.removeComponents)
{
NHLogger.LogVerbose($"Removing all components from [{prop.name}]");
// Just swap all the children to a new game object
var newDetailGO = new GameObject(prop.name);
newDetailGO.transform.position = prop.transform.position;
@ -185,7 +187,8 @@ namespace NewHorizons.Builder.Props
{
child.parent = newDetailGO.transform;
}
GameObject.Destroy(prop);
// Have to destroy it right away, else parented props might get attached to the old one
GameObject.DestroyImmediate(prop);
prop = newDetailGO;
}

View File

@ -16,9 +16,15 @@ namespace NewHorizons.Builder.Props
// Returns the character dialogue tree and remote dialogue trigger, if applicable.
public static (CharacterDialogueTree, RemoteDialogueTrigger) Make(GameObject go, Sector sector, DialogueInfo info, IModBehaviour mod)
{
NHLogger.LogVerbose($"[DIALOGUE] Created a new character dialogue [{info.rename}] on [{info.parentPath}]");
// In stock I think they disable dialogue stuff with conditions
// Here we just don't make it at all
if (info.blockAfterPersistentCondition != null && PlayerData.GetPersistentCondition(info.blockAfterPersistentCondition)) return (null, null);
if (!string.IsNullOrEmpty(info.blockAfterPersistentCondition) && PlayerData.GetPersistentCondition(info.blockAfterPersistentCondition))
{
NHLogger.LogVerbose($"[DIALOGUE] Persistent condition [{info.blockAfterPersistentCondition}] was met for [{info.rename}], aborting");
return (null, null);
}
var dialogue = MakeConversationZone(go, sector, info, mod.ModHelper);

View File

@ -106,11 +106,15 @@ namespace NewHorizons.Builder.Props
{
try
{
DialogueBuilder.Make(go, sector, dialogueInfo, mod);
var (dialogue, trigger) = DialogueBuilder.Make(go, sector, dialogueInfo, mod);
if (dialogue == null)
{
NHLogger.LogVerbose($"[DIALOGUE] Failed to create dialogue [{dialogueInfo.xmlFile}]");
}
}
catch (Exception ex)
{
NHLogger.LogError($"Couldn't make dialogue [{dialogueInfo.xmlFile}] for [{go.name}]:\n{ex}");
NHLogger.LogError($"[DIALOGUE] Couldn't make dialogue [{dialogueInfo.xmlFile}] for [{go.name}]:\n{ex}");
}
}
}

View File

@ -2,6 +2,7 @@ using NewHorizons.Builder.Props.TranslatorText;
using NewHorizons.External.Modules.Props;
using NewHorizons.External.Modules.WarpPad;
using NewHorizons.Utility;
using NewHorizons.Utility.OuterWilds;
using NewHorizons.Utility.OWML;
using OWML.Utils;
using UnityEngine;
@ -94,7 +95,26 @@ namespace NewHorizons.Builder.Props
receiver._frequency = GetFrequency(info.frequency);
receiver._alignmentTarget = planetGO?.transform;
if (string.IsNullOrEmpty(info.alignmentTargetBody))
{
receiver._alignmentTarget = planetGO?.transform;
}
else
{
Delay.FireOnNextUpdate(() =>
{
var targetAO = AstroObjectLocator.GetAstroObject(info.alignmentTargetBody);
if (targetAO != null)
{
receiver._alignmentTarget = targetAO.transform;
}
else
{
NHLogger.LogError($"Could not find target body [{info.alignmentTargetBody}] for warp receiver.");
receiver._alignmentTarget = null;
}
});
}
receiverObject.SetActive(true);

View File

@ -4,7 +4,7 @@
"author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book",
"name": "New Horizons",
"uniqueName": "xen.NewHorizons",
"version": "1.10.0",
"version": "1.10.1",
"owmlVersion": "2.9.0",
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],