Read tile pauses while auto walking
parent
fcd6c8ecb3
commit
f85192178f
|
@ -34,15 +34,31 @@ namespace stardew_access.Features
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pauses the read tile for the provided time.
|
||||
/// Pauses the feature for the provided time.
|
||||
/// </summary>
|
||||
/// <param name="time">The amount of time we want to pause the execution (in ms).<br/>Default is 2500 (2.5s).</param>
|
||||
public void pause(int time = 2500)
|
||||
public void pauseUntil(int time = 2500)
|
||||
{
|
||||
this.shouldPause = true;
|
||||
Task.Delay(time).ContinueWith(_ => { this.shouldPause = false; });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pauses the feature
|
||||
/// </summary>
|
||||
public void pause()
|
||||
{
|
||||
this.shouldPause = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resumes the feature
|
||||
/// </summary>
|
||||
public void resume()
|
||||
{
|
||||
this.shouldPause = false;
|
||||
}
|
||||
|
||||
public void run(bool manuallyTriggered = false, bool playersPosition = false)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue