From aed3bd4fef99606b8394d8123758f8cc6c9d5152 Mon Sep 17 00:00:00 2001 From: DaXcess Date: Wed, 23 Oct 2024 08:42:28 +0200 Subject: [PATCH 1/6] Add support for V65 --- CHANGELOG.md | 5 +++++ LCVR.csproj | 2 +- Source/Plugin.cs | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0388f042..9b2cdea8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.3.5 + +**Additions**: +- Added support for V65 + # 1.3.4 **Changes**: diff --git a/LCVR.csproj b/LCVR.csproj index 6cb404b6..fcadc35d 100644 --- a/LCVR.csproj +++ b/LCVR.csproj @@ -4,7 +4,7 @@ netstandard2.1 LCVR Collecting Scrap in VR - 1.3.4 + 1.3.5 DaXcess true 12.0 diff --git a/Source/Plugin.cs b/Source/Plugin.cs index 838bf5ce..2fbaa6a6 100644 --- a/Source/Plugin.cs +++ b/Source/Plugin.cs @@ -25,7 +25,7 @@ public class Plugin : BaseUnityPlugin { public const string PLUGIN_GUID = "io.daxcess.lcvr"; public const string PLUGIN_NAME = "LCVR"; - public const string PLUGIN_VERSION = "1.3.4"; + public const string PLUGIN_VERSION = "1.3.5"; #if DEBUG private const string SKIP_CHECKSUM_VAR = $"--lcvr-skip-checksum={PLUGIN_VERSION}-dev"; @@ -37,6 +37,7 @@ public class Plugin : BaseUnityPlugin [ "BFF45683C267F402429049EF7D8095C078D5CD534E5300E56317ACB6056D70FB", // V64 "A6BDE2EB39028B36CB1667DCFB4ED10F688FB3FF72E71491AC25C5CB47A7EF6C", // V64.1 + "2315B7D4B9FFA3972A95685510155C6D939638BE35E5685C0CF636D8640630D3", // V65 ]; public new static Config Config { get; private set; } From 7713a3667e2b70b225cba89f5e709938288abc44 Mon Sep 17 00:00:00 2001 From: DaXcess Date: Thu, 24 Oct 2024 17:31:56 +0200 Subject: [PATCH 2/6] MoreCompany compat fix rev 1 --- LCVR.csproj | 2 +- Source/Compatibility/MoreCompany/Patches.cs | 2 +- Source/Plugin.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LCVR.csproj b/LCVR.csproj index fcadc35d..1a6198e3 100644 --- a/LCVR.csproj +++ b/LCVR.csproj @@ -39,7 +39,7 @@ - + diff --git a/Source/Compatibility/MoreCompany/Patches.cs b/Source/Compatibility/MoreCompany/Patches.cs index 925fd69c..fb6009bf 100644 --- a/Source/Compatibility/MoreCompany/Patches.cs +++ b/Source/Compatibility/MoreCompany/Patches.cs @@ -19,7 +19,7 @@ internal static class MoreCompanyUIPatches [HarmonyPostfix] private static void AfterUpdateCosmetics() { - CosmeticRegistry.cosmeticApplication.spawnedCosmetics.Do(cosmetic => cosmetic.transform.localScale *= 0.5f); + CosmeticRegistry.displayGuyCosmeticApplication.spawnedCosmetics.Do(cosmetic => cosmetic.transform.localScale *= 0.5f); } // Spin dragger patches diff --git a/Source/Plugin.cs b/Source/Plugin.cs index 2fbaa6a6..6d31aec2 100644 --- a/Source/Plugin.cs +++ b/Source/Plugin.cs @@ -37,7 +37,7 @@ public class Plugin : BaseUnityPlugin [ "BFF45683C267F402429049EF7D8095C078D5CD534E5300E56317ACB6056D70FB", // V64 "A6BDE2EB39028B36CB1667DCFB4ED10F688FB3FF72E71491AC25C5CB47A7EF6C", // V64.1 - "2315B7D4B9FFA3972A95685510155C6D939638BE35E5685C0CF636D8640630D3", // V65 + "3682681356E28CDDAD5EADD6E2E492A8E1F04C812873EEF4EDE9CF20CB36550A", // V65 ]; public new static Config Config { get; private set; } From a77b599da7365bb797a9ecff6f13bc6462f95068 Mon Sep 17 00:00:00 2001 From: DaXcess Date: Thu, 24 Oct 2024 17:59:53 +0200 Subject: [PATCH 3/6] MoreCompany compatibility rev 2 - Removed Spin Drag code since it was broken for a while already --- .../MoreCompany/MoreCompanyCompatibility.cs | 14 +++- Source/Compatibility/MoreCompany/Patches.cs | 77 +------------------ Source/Patches/UIPatches.cs | 2 +- Source/UI/VRHUD.cs | 4 + 4 files changed, 20 insertions(+), 77 deletions(-) diff --git a/Source/Compatibility/MoreCompany/MoreCompanyCompatibility.cs b/Source/Compatibility/MoreCompany/MoreCompanyCompatibility.cs index 4514dc91..83506821 100644 --- a/Source/Compatibility/MoreCompany/MoreCompanyCompatibility.cs +++ b/Source/Compatibility/MoreCompany/MoreCompanyCompatibility.cs @@ -4,7 +4,7 @@ namespace LCVR.Compatibility.MoreCompany; internal static class MoreCompanyCompatibility { - public static void SetupMoreCompanyUI() + public static void SetupMoreCompanyUIMainMenu() { var overlay = GameObject.Find("TestOverlay(Clone)"); var menuContainer = GameObject.Find("MenuContainer"); @@ -19,8 +19,16 @@ public static void SetupMoreCompanyUI() canvasUi.transform.localScale = Vector3.one; var activateButton = canvasUi.Find("ActivateButton"); - activateButton.transform.localPosition = new Vector3(activateButton.transform.localPosition.x, activateButton.transform.localPosition.y, 90); + activateButton.transform.localPosition = new Vector3(activateButton.transform.localPosition.x, + activateButton.transform.localPosition.y, 90); overlay.Find("CanvasCam").SetActive(false); } -} + + public static void SetupMoreCompanyUIInGame() + { + var canvasUi = GameObject.Find("Systems/UI/Canvas/GlobalScale"); + + canvasUi.transform.localPosition = new Vector3(0, 0, -90); + } +} \ No newline at end of file diff --git a/Source/Compatibility/MoreCompany/Patches.cs b/Source/Compatibility/MoreCompany/Patches.cs index fb6009bf..b74dc28e 100644 --- a/Source/Compatibility/MoreCompany/Patches.cs +++ b/Source/Compatibility/MoreCompany/Patches.cs @@ -1,10 +1,6 @@ using HarmonyLib; using LCVR.Patches; -using MoreCompany.Behaviors; using MoreCompany.Cosmetics; -using UnityEngine; -using UnityEngine.EventSystems; -using UnityEngine.XR.Interaction.Toolkit; namespace LCVR.Compatibility.MoreCompany; @@ -13,78 +9,13 @@ namespace LCVR.Compatibility.MoreCompany; internal static class MoreCompanyUIPatches { /// - /// Not too sure why this was needed, probably had to do with me moving the UI around in the GameObject hierarchy + /// Yeah... I'm completely lost on this one /// [HarmonyPatch(typeof(CosmeticRegistry), nameof(CosmeticRegistry.UpdateCosmeticsOnDisplayGuy))] [HarmonyPostfix] private static void AfterUpdateCosmetics() { - CosmeticRegistry.displayGuyCosmeticApplication.spawnedCosmetics.Do(cosmetic => cosmetic.transform.localScale *= 0.5f); + CosmeticRegistry.displayGuyCosmeticApplication.spawnedCosmetics.Do(cosmetic => + cosmetic.transform.localScale *= CosmeticRegistry.menuIsInGame ? 2.15f : 0.5f); } - - // Spin dragger patches - private static int pointer = -1; - private static XRRayInteractor leftInteractor; - private static XRRayInteractor rightInteractor; - private static Vector2 lastRayPosition = Vector2.zero; - private static Vector3 rotationalVelocity = Vector3.zero; - - [HarmonyPatch(typeof(SpinDragger), nameof(SpinDragger.Update))] - [HarmonyPrefix] - private static bool UpdateSpinDragger(SpinDragger __instance) - { - if (pointer != -1) - { - var position = Vector2.zero; - - var interactor = (pointer == 1 ? rightInteractor : leftInteractor); - if (interactor.TryGetCurrentUIRaycastResult(out var res)) - position = res.screenPosition; - - var delta = position - lastRayPosition; - rotationalVelocity = new Vector3(0, -delta.x, 0) * __instance.dragSpeed; - lastRayPosition = position; - } - - rotationalVelocity *= __instance.airDrag; - - __instance.target.transform.Rotate(rotationalVelocity * Time.deltaTime * __instance.speed, Space.World); - - return false; - } - - [HarmonyPatch(typeof(SpinDragger), nameof(SpinDragger.OnPointerDown))] - [HarmonyPrefix] - private static bool OnPointerDown(SpinDragger __instance, PointerEventData eventData) - { - __instance.dragSpeed = 10; - - leftInteractor = GameObject.Find("Left Controller").GetComponent(); - rightInteractor = GameObject.Find("Right Controller").GetComponent(); - - pointer = eventData.pointerId; - - if (pointer != 1 && pointer != 2) - { - pointer = -1; - return false; - } - - var interactor = (pointer == 1 ? rightInteractor : leftInteractor); - if (interactor.TryGetCurrentUIRaycastResult(out var res)) - lastRayPosition = res.screenPosition; - else - lastRayPosition = Vector2.zero; - - return false; - } - - [HarmonyPatch(typeof(SpinDragger), nameof(SpinDragger.OnPointerUp))] - [HarmonyPrefix] - private static bool OnPointerUp() - { - pointer = -1; - - return false; - } -} +} \ No newline at end of file diff --git a/Source/Patches/UIPatches.cs b/Source/Patches/UIPatches.cs index ee6662f4..4ac64e33 100644 --- a/Source/Patches/UIPatches.cs +++ b/Source/Patches/UIPatches.cs @@ -59,7 +59,7 @@ private static void OnMainMenuShown(MenuManager __instance) InitMenuScene(canvas); if (Compat.IsLoaded(Compat.MoreCompany)) - Compatibility.MoreCompany.MoreCompanyCompatibility.SetupMoreCompanyUI(); + Compatibility.MoreCompany.MoreCompanyCompatibility.SetupMoreCompanyUIMainMenu(); if (__instance.isInitScene) return; diff --git a/Source/UI/VRHUD.cs b/Source/UI/VRHUD.cs index ca7a43ed..eed2d81a 100644 --- a/Source/UI/VRHUD.cs +++ b/Source/UI/VRHUD.cs @@ -448,6 +448,10 @@ private void Awake() // Set up belt bag UI FindObjectOfType(true).gameObject.AddComponent(); + + // MoreCompany compatibility + if (Compat.IsLoaded(Compat.MoreCompany)) + Compatibility.MoreCompany.MoreCompanyCompatibility.SetupMoreCompanyUIInGame(); } private static void MoveToFront(Component component) From 8366a13fe0aae73f9d14b7343bc9406213b8fc3b Mon Sep 17 00:00:00 2001 From: Daniel <46288749+DaXcess@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:20:49 +0200 Subject: [PATCH 4/6] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b2cdea8..68d5d2a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ **Additions**: - Added support for V65 +**Compatibility**: +- Fixed compatibility with MoreCompany 1.10.2 +- Removed Spin Drag functionality for MoreCompany in LCVR, as it was already broken for a long time + # 1.3.4 **Changes**: From aac3e56cf981e1fd50769dde9d4a067609874251 Mon Sep 17 00:00:00 2001 From: DaXcess Date: Fri, 25 Oct 2024 17:59:22 +0200 Subject: [PATCH 5/6] Patch for V66 support --- CHANGELOG.md | 2 +- Source/Plugin.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68d5d2a3..3f33c8fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # 1.3.5 **Additions**: -- Added support for V65 +- Added support for V66 **Compatibility**: - Fixed compatibility with MoreCompany 1.10.2 diff --git a/Source/Plugin.cs b/Source/Plugin.cs index 6d31aec2..e0cd5c3c 100644 --- a/Source/Plugin.cs +++ b/Source/Plugin.cs @@ -37,7 +37,7 @@ public class Plugin : BaseUnityPlugin [ "BFF45683C267F402429049EF7D8095C078D5CD534E5300E56317ACB6056D70FB", // V64 "A6BDE2EB39028B36CB1667DCFB4ED10F688FB3FF72E71491AC25C5CB47A7EF6C", // V64.1 - "3682681356E28CDDAD5EADD6E2E492A8E1F04C812873EEF4EDE9CF20CB36550A", // V65 + "B0BC7D3392FDAD3BB6515C0769363A51FF3599E67325FAE153948E0B82EB7596", // V66 ]; public new static Config Config { get; private set; } From a3fa0c912a7218010c454d7f556fc3c319190e26 Mon Sep 17 00:00:00 2001 From: DaXcess Date: Fri, 25 Oct 2024 22:50:16 +0200 Subject: [PATCH 6/6] Update gamelib --- LCVR.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LCVR.csproj b/LCVR.csproj index 1a6198e3..f414707f 100644 --- a/LCVR.csproj +++ b/LCVR.csproj @@ -37,7 +37,7 @@ - +