diff --git a/stardew-access/Features/ReadTile.cs b/stardew-access/Features/ReadTile.cs index a7a5912..79fa5ad 100644 --- a/stardew-access/Features/ReadTile.cs +++ b/stardew-access/Features/ReadTile.cs @@ -34,15 +34,31 @@ namespace stardew_access.Features } /// - /// Pauses the read tile for the provided time. + /// Pauses the feature for the provided time. /// /// The amount of time we want to pause the execution (in ms).
Default is 2500 (2.5s). - public void pause(int time = 2500) + public void pauseUntil(int time = 2500) { this.shouldPause = true; Task.Delay(time).ContinueWith(_ => { this.shouldPause = false; }); } + /// + /// Pauses the feature + /// + public void pause() + { + this.shouldPause = true; + } + + /// + /// Resumes the feature + /// + public void resume() + { + this.shouldPause = false; + } + public void run(bool manuallyTriggered = false, bool playersPosition = false) { try diff --git a/stardew-access/Features/TileViewer.cs b/stardew-access/Features/TileViewer.cs index 64c56e4..113d74c 100644 --- a/stardew-access/Features/TileViewer.cs +++ b/stardew-access/Features/TileViewer.cs @@ -148,6 +148,7 @@ namespace stardew_access.Features Game1.player.controller = controller; this.isAutoWalking = true; this.finalTile = this.GetViewingTile(); + MainClass.ReadTileFeature.pause(); MainClass.ScreenReader.Say($"Moving to {this.finalTile.X}x {this.finalTile.Y}y", true); } else @@ -165,6 +166,7 @@ namespace stardew_access.Features this.finalTile = Vector2.Zero; this.isAutoWalking = false; Game1.player.controller = null; + MainClass.ReadTileFeature.resume(); if (wasForced) MainClass.ScreenReader.Say("Stopped moving", true); } diff --git a/stardew-access/Features/Warnings.cs b/stardew-access/Features/Warnings.cs index c88d158..dd683d6 100644 --- a/stardew-access/Features/Warnings.cs +++ b/stardew-access/Features/Warnings.cs @@ -32,7 +32,7 @@ namespace stardew_access.Features { MainClass.ScreenReader.Say(toSpeak, true); // Pause the read tile feature to prevent interruption in warning message - MainClass.ReadTileFeature.pause(); + MainClass.ReadTileFeature.pauseUntil(); } prevHour = hours; @@ -50,7 +50,7 @@ namespace stardew_access.Features { MainClass.ScreenReader.Say(toSpeak, true); // Pause the read tile feature to prevent interruption in warning message - MainClass.ReadTileFeature.pause(); + MainClass.ReadTileFeature.pauseUntil(); } prevStamina = stamina; @@ -68,7 +68,7 @@ namespace stardew_access.Features { MainClass.ScreenReader.Say(toSpeak, true); // Pause the read tile feature to prevent interruption in warning message - MainClass.ReadTileFeature.pause(); + MainClass.ReadTileFeature.pauseUntil(); } prevHealth = health;