Fixed sapi
parent
d66fd0afb0
commit
4751af8fec
|
@ -158,26 +158,33 @@ namespace stardew_access.Features
|
||||||
#region Track dropped items
|
#region Track dropped items
|
||||||
if (MainClass.Config.TrackDroppedItems)
|
if (MainClass.Config.TrackDroppedItems)
|
||||||
{
|
{
|
||||||
NetCollection<Debris> droppedItems = Game1.currentLocation.debris;
|
try
|
||||||
if (droppedItems.Count() > 0)
|
|
||||||
{
|
{
|
||||||
foreach (var item in droppedItems)
|
NetCollection<Debris> droppedItems = Game1.currentLocation.debris;
|
||||||
|
if (droppedItems.Count() > 0)
|
||||||
{
|
{
|
||||||
int xPos = ((int)item.Chunks[0].position.Value.X / Game1.tileSize) + 1;
|
foreach (var item in droppedItems)
|
||||||
int yPos = ((int)item.Chunks[0].position.Value.Y / Game1.tileSize) + 1;
|
{
|
||||||
if (xPos != x || yPos != y) continue;
|
int xPos = ((int)item.Chunks[0].position.Value.X / Game1.tileSize) + 1;
|
||||||
|
int yPos = ((int)item.Chunks[0].position.Value.Y / Game1.tileSize) + 1;
|
||||||
|
if (xPos != x || yPos != y) continue;
|
||||||
|
|
||||||
if (item.item == null) 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;
|
||||||
|
|
||||||
if (toReturn == "")
|
if (toReturn == "")
|
||||||
return ($"Dropped Item: {count} {name}", CATEGORY.DroppedItems);
|
return ($"Dropped Item: {count} {name}", CATEGORY.DroppedItems);
|
||||||
else
|
else
|
||||||
toReturn = $"{toReturn}, Dropped Item: {count} {name}";
|
toReturn = $"{toReturn}, Dropped Item: {count} {name}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
MainClass.ErrorLog($"An error occured while detecting dropped items:\n{e.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ namespace stardew_access.ScreenReader
|
||||||
public void InitializeScreenReader()
|
public void InitializeScreenReader()
|
||||||
{
|
{
|
||||||
MainClass.InfoLog("Initializing Tolk...");
|
MainClass.InfoLog("Initializing Tolk...");
|
||||||
|
Tolk.TrySAPI(true);
|
||||||
Tolk.Load();
|
Tolk.Load();
|
||||||
|
|
||||||
MainClass.InfoLog("Querying for the active screen reader driver...");
|
MainClass.InfoLog("Querying for the active screen reader driver...");
|
||||||
|
|
Loading…
Reference in New Issue