Added config option to toggle detecting dropped items \n Fixed bug

master
Mohammad Shoaib Khan 2022-11-07 19:51:35 +05:30
parent dd0d052f64
commit c4ce0a5280
No known key found for this signature in database
GPG Key ID: 3EE32C9DFF520699
2 changed files with 18 additions and 13 deletions

View File

@ -150,6 +150,8 @@ namespace stardew_access.Features
} }
#region Track dropped items #region Track dropped items
if (MainClass.Config.TrackDroppedItems)
{
NetCollection<Debris> droppedItems = Game1.currentLocation.debris; NetCollection<Debris> droppedItems = Game1.currentLocation.debris;
if (droppedItems.Count() > 0) if (droppedItems.Count() > 0)
{ {
@ -159,6 +161,8 @@ namespace stardew_access.Features
int yPos = ((int)item.Chunks[0].position.Value.Y / Game1.tileSize) + 1; int yPos = ((int)item.Chunks[0].position.Value.Y / Game1.tileSize) + 1;
if (xPos != x || yPos != y) continue; if (xPos != x || yPos != y) continue;
if (item.item == null) continue;
string name = item.item.DisplayName; string name = item.item.DisplayName;
int count = item.item.Stack; int count = item.item.Stack;
@ -168,6 +172,7 @@ namespace stardew_access.Features
toReturn = $"{toReturn}, Dropped Item: {count} {name}"; toReturn = $"{toReturn}, Dropped Item: {count} {name}";
} }
} }
}
#endregion #endregion
if (toReturn == "") if (toReturn == "")

View File

@ -79,7 +79,7 @@ namespace stardew_access
public Boolean SnapMouse { get; set; } = true; // Toggles the snap mouse feature public Boolean SnapMouse { get; set; } = true; // Toggles the snap mouse feature
public Boolean Warning { get; set; } = true; // Toggles the warnings feature public Boolean Warning { get; set; } = true; // Toggles the warnings feature
public Boolean TTS { get; set; } = true; // Toggles the screen reader/tts. public Boolean TTS { get; set; } = true; // Toggles the screen reader/tts.
// TODO add command to toggle warning feature public Boolean TrackDroppedItems {get; set;} = true; // Toggles detecting the dropped items.
#endregion #endregion
// TODO Add the exclusion and focus list too // TODO Add the exclusion and focus list too