generated from DREDGE-Mods/WinchModTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The Pale Reach should all work properly now with this update - Cutscenes in The Pale Reach DLC now actually play out - Fix infected fish particle orientation - Hide laser pointers when hiding UI - Show "UNBOUND" in tutorial popups if an input is missing - Fix snow position on Pale Reach title screen - Removed the "disable distance particles" option because it was buggy - Fixed message entries disappearing when changing tabs - Fixed held message positions
- Loading branch information
Showing
15 changed files
with
290 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace DredgeVR.Helpers; | ||
|
||
public class DebugCommands : MonoBehaviour | ||
{ | ||
private List<(KeyCode, Action)> commands = new() | ||
{ | ||
(KeyCode.Keypad1, TryInfect) | ||
}; | ||
|
||
public void Update() | ||
{ | ||
foreach (var (key, action) in commands) | ||
{ | ||
if (Input.GetKeyDown(key)) | ||
{ | ||
NotificationHelper.ShowNotificationWithColour(NotificationType.NONE, $"Invoked debug action {action.Method.Name}", DredgeColorTypeEnum.POSITIVE); | ||
try | ||
{ | ||
action.Invoke(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
NotificationHelper.ShowNotificationWithColour(NotificationType.NONE, $"Failed {ex}", DredgeColorTypeEnum.NEGATIVE); | ||
} | ||
} | ||
} | ||
} | ||
|
||
private static void TryInfect() | ||
{ | ||
GameManager.Instance.GridManager.InfectRandomItemInInventory(); | ||
} | ||
} |
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,22 @@ | ||
// Taken from Cosmic Horror Fishing Buddies | ||
namespace DredgeVR.Helpers | ||
{ | ||
internal static class NotificationHelper | ||
{ | ||
public static void ShowNotificationWithColour(NotificationType notificationType, string text, DredgeColorTypeEnum colour) | ||
{ | ||
ShowNotificationWithColour(notificationType, text, GameManager.Instance.LanguageManager.GetColorCode(colour)); | ||
} | ||
|
||
public static void ShowNotificationWithColour(NotificationType notificationType, string text, string colourCode) | ||
{ | ||
ShowNotification(notificationType, $"<color=#{colourCode}>{text}</color>"); | ||
} | ||
|
||
public static void ShowNotification(NotificationType notificationType, string text) | ||
{ | ||
GameEvents.Instance.TriggerNotification(notificationType, text); | ||
DredgeVRLogger.Info($"Wrote notification: {text}"); | ||
} | ||
} | ||
} |
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,97 @@ | ||
using Cinemachine; | ||
using Cinemachine.Utility; | ||
using DredgeVR.VRUI; | ||
using HarmonyLib; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using UnityEngine; | ||
|
||
namespace DredgeVR.VRCamera.Patches; | ||
|
||
[HarmonyPatch(typeof(TriggerableTimeline))] | ||
public static class TriggerableTimelinePatches | ||
{ | ||
private static bool _playing; | ||
private static CinemachineVirtualCamera _camera; | ||
private static CinemachineVirtualCamera[] _cameras; | ||
|
||
[HarmonyPostfix] | ||
[HarmonyPatch(nameof(TriggerableTimeline.Play))] | ||
public static void TriggerableTimeline_Play(TriggerableTimeline __instance) | ||
{ | ||
_playing = true; | ||
_camera = null; | ||
_cameras = __instance.GetComponentsInChildren<CinemachineVirtualCamera>(true); | ||
|
||
VRCameraManager.Instance.StartCoroutine(TriggerableTimelineLogic(__instance)); | ||
} | ||
|
||
[HarmonyPostfix] | ||
[HarmonyPatch(nameof(TriggerableTimeline.OnTimelineComplete))] | ||
public static void TriggerableTimeline_OnTimelineComplete(TriggerableTimeline __instance) | ||
{ | ||
_playing = false; | ||
} | ||
|
||
private static IEnumerator TriggerableTimelineLogic(TriggerableTimeline __instance) | ||
{ | ||
VRUIManager.HideHeldUI(); | ||
VRCameraManager.Instance.InCutscene = true; | ||
|
||
while (_playing) | ||
{ | ||
var prevCamera = _camera; | ||
|
||
if (_camera == null || !_camera.gameObject.activeInHierarchy) | ||
{ | ||
// Try to update the camera to an active one | ||
_camera = _cameras.FirstOrDefault(x => x.gameObject.activeInHierarchy); | ||
if (prevCamera != _camera) | ||
{ | ||
if (_camera != null) | ||
{ | ||
// When the camera changes we fade out the screen first | ||
yield return ShowLoadingScreen(true); | ||
|
||
// Camera exists, move to it | ||
VRCameraManager.AnchorTransform.transform.position = _camera.transform.position; | ||
VRCameraManager.AnchorTransform.transform.LookAt(_camera.transform.position + _camera.transform.forward.ProjectOntoPlane(Vector3.up)); | ||
|
||
yield return ShowLoadingScreen(false); | ||
} | ||
} | ||
} | ||
|
||
yield return new WaitForSeconds(0.1f); | ||
} | ||
|
||
yield return ShowLoadingScreen(true); | ||
|
||
VRCameraManager.Instance.InCutscene = false; | ||
|
||
VRCameraManager.Instance.ResetAnchorToBoat(); | ||
|
||
yield return ShowLoadingScreen(false); | ||
|
||
VRUIManager.ShowHeldUI(); | ||
} | ||
|
||
private static bool _showingLoadingScreen; | ||
private static YieldInstruction ShowLoadingScreen(bool show) | ||
{ | ||
if (show != _showingLoadingScreen) | ||
{ | ||
_showingLoadingScreen = show; | ||
GameManager.Instance.Loader.loadingScreen.Fade(show, true); | ||
return new WaitForSeconds(1f); | ||
} | ||
else | ||
{ | ||
return new WaitForEndOfFrame(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.