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,
|
priority = 1,
|
||||||
dialogue = dialogue,
|
dialogue = dialogue,
|
||||||
prereqConditionType = RemoteDialogueTrigger.MultiConditionType.AND,
|
prereqConditionType = RemoteDialogueTrigger.MultiConditionType.AND,
|
||||||
prereqConditions = info.remoteTriggerPrereqConditions ?? new string[]{ },
|
// Base game never uses more than one condition anyone so we'll keep it simple
|
||||||
onTriggerEnterConditions = info.remoteTriggerOnEnterConditions ?? new string[]{ }
|
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];
|
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;
|
public float remoteTriggerRadius;
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public string[] remoteTriggerPrereqConditions;
|
public string remoteTriggerPrereqCondition;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If setting up a remote trigger volume, but I have no idea what this does at all
|
|
||||||
/// </summary>
|
|
||||||
public string[] remoteTriggerOnEnterConditions;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Relative path to the xml file defining the dialogue.
|
/// Relative path to the xml file defining the dialogue.
|
||||||
|
|||||||
@ -13,19 +13,26 @@ namespace NewHorizons.Patches
|
|||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(HUDMarker), nameof(HUDMarker.Awake))]
|
[HarmonyPatch(typeof(HUDMarker), nameof(HUDMarker.Awake))]
|
||||||
public static void OnTriggerEnter(RemoteDialogueTrigger __instance)
|
public static void OnTriggerEnter(RemoteDialogueTrigger __instance)
|
||||||
|
{
|
||||||
|
if (__instance._inRemoteDialogue && __instance._activeRemoteDialogue != null)
|
||||||
{
|
{
|
||||||
_wasLastDialogueInactive = __instance._activeRemoteDialogue.gameObject.activeInHierarchy;
|
_wasLastDialogueInactive = __instance._activeRemoteDialogue.gameObject.activeInHierarchy;
|
||||||
__instance._activeRemoteDialogue.gameObject.SetActive(true);
|
__instance._activeRemoteDialogue.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(HUDMarker), nameof(HUDMarker.Awake))]
|
[HarmonyPatch(typeof(HUDMarker), nameof(HUDMarker.Awake))]
|
||||||
public static void OnEndConversation(RemoteDialogueTrigger __instance)
|
public static void OnEndConversation(RemoteDialogueTrigger __instance)
|
||||||
|
{
|
||||||
|
if (__instance._inRemoteDialogue && __instance._activeRemoteDialogue != null)
|
||||||
{
|
{
|
||||||
if (_wasLastDialogueInactive)
|
if (_wasLastDialogueInactive)
|
||||||
{
|
{
|
||||||
__instance._activeRemoteDialogue.gameObject.SetActive(false);
|
__instance._activeRemoteDialogue.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_wasLastDialogueInactive = false;
|
_wasLastDialogueInactive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user