diff --git a/plugin/src/main_game_patch.cs b/plugin/src/main_game_patch.cs index a3af2b6..25c95cc 100644 --- a/plugin/src/main_game_patch.cs +++ b/plugin/src/main_game_patch.cs @@ -49,6 +49,7 @@ void Start() new CursorCanvasPatch(), new CompassPatch(), new MapPatch(), + new CraftingQueuePatch(), ]).ToArray(); Plugin.Logger.LogDebug("Hello World!"); diff --git a/plugin/src/patch/main_game/ui/crafting_queue_patch.cs b/plugin/src/patch/main_game/ui/crafting_queue_patch.cs new file mode 100644 index 0000000..74f7b5c --- /dev/null +++ b/plugin/src/patch/main_game/ui/crafting_queue_patch.cs @@ -0,0 +1,33 @@ +using Plugin.Input; +using TechtonicaVR.UI; +using UnityEngine; + +namespace TechtonicaVR.Patches.MainGame.UI; + +class CraftingQueuePatch : GameComponentPatch + +{ + protected override bool Apply(CraftingQueueGrid component) + { + var tlc = component.gameObject.transform.parent; + if (tlc == null) + { + return false; + } + + var trackedCanvas = tlc.gameObject.AddComponent(); + trackedCanvas.hand = SteamVRInputMapper.leftHandObject.transform; + trackedCanvas.showDirection = -Vector3.right; + trackedCanvas.offset = new Vector3(-0.08f, 0.06f, -0.1f); + trackedCanvas.showDistance = 0.3f; + trackedCanvas.noTransform = true; + tlc.localPosition = new Vector3(-17.7141f, 17.7794f, 0f); + tlc.localScale = new Vector3(-0.1f, 0.1f, 0.1f); + for (int i = 0; i < tlc.childCount; i++) + { + tlc.GetChild(i).localPosition = Vector3.zero; + } + + return true; + } +}