mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Get rid of enter conditions, just one prereq, clean up patch
This commit is contained in:
parent
b378d2f715
commit
fb0d9e30f6
@ -80,8 +80,10 @@ namespace NewHorizons.Builder.Props
|
||||
priority = 1,
|
||||
dialogue = dialogue,
|
||||
prereqConditionType = RemoteDialogueTrigger.MultiConditionType.AND,
|
||||
prereqConditions = info.remoteTriggerPrereqConditions ?? new string[]{ },
|
||||
onTriggerEnterConditions = info.remoteTriggerOnEnterConditions ?? new string[]{ }
|
||||
// Base game never uses more than one condition anyone so we'll keep it simple
|
||||
prereqConditions = string.IsNullOrEmpty(info.remoteTriggerPrereqCondition) ? new string[]{ } : new string[] { info.remoteTriggerPrereqCondition },
|
||||
// Just set your enter conditions in XML instead of complicating it with this
|
||||
onTriggerEnterConditions = new string[]{ }
|
||||
}
|
||||
};
|
||||
remoteDialogueTrigger._activatedDialogues = new bool[1];
|
||||
|
||||
9
NewHorizons/External/Modules/PropModule.cs
vendored
9
NewHorizons/External/Modules/PropModule.cs
vendored
@ -509,14 +509,9 @@ namespace NewHorizons.External.Modules
|
||||
public float remoteTriggerRadius;
|
||||
|
||||
/// <summary>
|
||||
/// If setting up a remote trigger volume, these conditions must be met for it to trigger
|
||||
/// If setting up a remote trigger volume, this conditions must be met for it to trigger. Note: This is a dialogue condition, not a persistent condition.
|
||||
/// </summary>
|
||||
public string[] remoteTriggerPrereqConditions;
|
||||
|
||||
/// <summary>
|
||||
/// If setting up a remote trigger volume, but I have no idea what this does at all
|
||||
/// </summary>
|
||||
public string[] remoteTriggerOnEnterConditions;
|
||||
public string remoteTriggerPrereqCondition;
|
||||
|
||||
/// <summary>
|
||||
/// Relative path to the xml file defining the dialogue.
|
||||
|
||||
@ -14,18 +14,25 @@ namespace NewHorizons.Patches
|
||||
[HarmonyPatch(typeof(HUDMarker), nameof(HUDMarker.Awake))]
|
||||
public static void OnTriggerEnter(RemoteDialogueTrigger __instance)
|
||||
{
|
||||
_wasLastDialogueInactive = __instance._activeRemoteDialogue.gameObject.activeInHierarchy;
|
||||
__instance._activeRemoteDialogue.gameObject.SetActive(true);
|
||||
if (__instance._inRemoteDialogue && __instance._activeRemoteDialogue != null)
|
||||
{
|
||||
_wasLastDialogueInactive = __instance._activeRemoteDialogue.gameObject.activeInHierarchy;
|
||||
__instance._activeRemoteDialogue.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(HUDMarker), nameof(HUDMarker.Awake))]
|
||||
public static void OnEndConversation(RemoteDialogueTrigger __instance)
|
||||
{
|
||||
if (_wasLastDialogueInactive)
|
||||
if (__instance._inRemoteDialogue && __instance._activeRemoteDialogue != null)
|
||||
{
|
||||
__instance._activeRemoteDialogue.gameObject.SetActive(false);
|
||||
if (_wasLastDialogueInactive)
|
||||
{
|
||||
__instance._activeRemoteDialogue.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
_wasLastDialogueInactive = false;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user