diff --git a/Overlays/Watch.cs b/Overlays/Watch.cs index 4544ada..ba731d9 100644 --- a/Overlays/Watch.cs +++ b/Overlays/Watch.cs @@ -20,7 +20,7 @@ public class Watch : BaseOverlay, IInteractable private float _flBrightness = 1f; internal LeftRight Hand; - internal Vector3 Vec3RelToHand = new(-0.05f, -0.05f, 0.15f); + internal Vector3 Vec3RelToHand; internal Vector3 Vec3InsideUnit = Vector3.Right; public bool Hidden; @@ -33,6 +33,12 @@ public Watch(BaseOverlay keyboard) : base("Watch") throw new InvalidOperationException("Can't have more than one Watch!"); _instance = this; + var relative_pos = Config.Instance.WatchPosition ?? new[] { -0.05f, -0.05f, 0.15f }; + if (relative_pos.Length != 3) + throw new InvalidOperationException("watch_position must be an array of 3 floats!"); + + Vec3RelToHand = new Vector3(relative_pos[0], relative_pos[1], relative_pos[2]); + Hand = Config.Instance.WatchHand; if (Config.Instance.WatchHand == LeftRight.Right) { diff --git a/Resources/config.yaml b/Resources/config.yaml index ea299b8..c11bd36 100644 --- a/Resources/config.yaml +++ b/Resources/config.yaml @@ -110,6 +110,9 @@ primary_hand: Right ## "Left" or "Right" watch_hand: Left +## Position of the watch relative to controller pose. Y is inverted for right. +#watch_position: [ -0.05, -0.05, 0.15 ] + # The color of the pointer can be set 2 ways: # - modifier bindings ("ClickModifierRight" and "ClickModifierMiddle") # - hand orientation @@ -132,7 +135,6 @@ middle_click_orientation: false ## Aims to help with double clicking. click_freeze_time: 0.3 - ## Pointer & keyboard colors #primary_color: '#006080' #shift_color: '#B03000' diff --git a/Types/Config.cs b/Types/Config.cs index 9f4544f..3a68e76 100644 --- a/Types/Config.cs +++ b/Types/Config.cs @@ -130,6 +130,8 @@ public static bool Load() public bool FallbackCursors; + public float[]? WatchPosition; + public Dictionary ExportInputs; public Dictionary? OverrideEnv;