mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix parenting issue, add more dialogue verbose logs
This commit is contained in:
parent
41eb8438eb
commit
a81f1e986a
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user