From 955ffac65bbb7cbd5d91e1efcd49df8bfc89dbac Mon Sep 17 00:00:00 2001 From: bradjrenshaw Date: Tue, 10 May 2022 15:22:32 -0400 Subject: [PATCH] Implementation of relative offset lock (keep mouse in position relative to you as yo umove). --- stardew-access/Features/MouseHandler.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/stardew-access/Features/MouseHandler.cs b/stardew-access/Features/MouseHandler.cs index 33af128..f909ab9 100644 --- a/stardew-access/Features/MouseHandler.cs +++ b/stardew-access/Features/MouseHandler.cs @@ -63,7 +63,18 @@ namespace stardew_access.Features public void HandleInput() { - if (MainClass.Config.TileCursorPreciseUpKey.JustPressed()) + if (MainClass.Config.ToggleRelativeCursorLockKey.JustPressed()) + { + this.relativeOffsetLock = !this.relativeOffsetLock; + if (this.relativeOffsetLock) + { + this.relativeOffsetLockPosition = this.PlayerFacingVector + this.ViewingOffset; + } else { + this.relativeOffsetLockPosition = Vector2.Zero; + } + MainClass.ScreenReader.Say("Relative cursor lock " + (this.relativeOffsetLock ? "enabled" : "disabled") + ".", true); + } + else if (MainClass.Config.TileCursorPreciseUpKey.JustPressed()) { this.cursorMoveInput(new Vector2(0, -MainClass.Config.TileCursorPreciseMovementDistance), true); }