-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Improvements - `Water` module now has `buoyancy` and `density` values. - Add `remoteTriggerPrereqCondition` to only show a remote dialogue trigger once a condition has been met. ## Bug fixes - Heightmap error logging will properly deal with empty strings now. - Stop RemoteDialogueTrigger from softlocking you if you disable its CharacterDialogueTree.
- Loading branch information
Showing
9 changed files
with
96 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using HarmonyLib; | ||
using NewHorizons.Utility; | ||
using System; | ||
|
||
namespace NewHorizons.Patches | ||
{ | ||
/// <summary> | ||
/// Should fix a bug where disabled a CharacterDialogueTree makes its related RemoteDialogueTriggers softlock your game | ||
/// </summary> | ||
[HarmonyPatch] | ||
public static class RemoteDialogueTriggerPatches | ||
{ | ||
private static bool _wasLastDialogueInactive = false; | ||
|
||
[HarmonyPostfix] | ||
[HarmonyPatch(typeof(RemoteDialogueTrigger), nameof(RemoteDialogueTrigger.OnTriggerEnter))] | ||
public static void RemoteDialogueTrigger_OnTriggerEnter(RemoteDialogueTrigger __instance) | ||
{ | ||
if (__instance._inRemoteDialogue && __instance._activeRemoteDialogue?.gameObject != null) | ||
{ | ||
_wasLastDialogueInactive = __instance._activeRemoteDialogue.gameObject.activeInHierarchy; | ||
if (!_wasLastDialogueInactive) | ||
{ | ||
__instance._activeRemoteDialogue.gameObject.SetActive(true); | ||
} | ||
} | ||
} | ||
|
||
[HarmonyPrefix] | ||
[HarmonyPatch(typeof(RemoteDialogueTrigger), nameof(RemoteDialogueTrigger.OnEndConversation))] | ||
public static void RemoteDialogueTrigger_OnEndConversation(RemoteDialogueTrigger __instance) | ||
{ | ||
if (__instance._inRemoteDialogue && __instance._activeRemoteDialogue != null) | ||
{ | ||
if (_wasLastDialogueInactive) | ||
{ | ||
__instance._activeRemoteDialogue.gameObject.SetActive(false); | ||
} | ||
} | ||
|
||
_wasLastDialogueInactive = false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters