Bump manifest version to 1.3.5-beta2. Fix error in json loading and missing static tiles.

master
Katie Durden 2023-04-05 19:17:57 -07:00
parent dacbff92ea
commit 803bc64868
3 changed files with 15 additions and 15 deletions

View File

@ -141,8 +141,8 @@ namespace stardew_access.Features
/// <returns>A dictionary with all the detected tiles along with the name of the object on it and it's category.</returns> /// <returns>A dictionary with all the detected tiles along with the name of the object on it and it's category.</returns>
public Dictionary<Vector2, (string, string)> SearchLocation() public Dictionary<Vector2, (string, string)> SearchLocation()
{ {
var watch = new Stopwatch(); //var watch = new Stopwatch();
watch.Start(); //watch.Start();
var currentLocation = Game1.currentLocation; var currentLocation = Game1.currentLocation;
Dictionary<Vector2, (string, string)> detectedTiles = new(); Dictionary<Vector2, (string, string)> detectedTiles = new();
Vector2 position = Vector2.Zero; Vector2 position = Vector2.Zero;
@ -157,11 +157,11 @@ namespace stardew_access.Features
toSearch.Enqueue(Game1.player.getTileLocation()); toSearch.Enqueue(Game1.player.getTileLocation());
searched.Add(Game1.player.getTileLocation()); searched.Add(Game1.player.getTileLocation());
watch.Stop(); //watch.Stop();
var elapsedMs = watch.ElapsedMilliseconds; //var elapsedMs = watch.ElapsedMilliseconds;
MainClass.DebugLog($"Search init duration: {elapsedMs}"); //MainClass.DebugLog($"Search init duration: {elapsedMs}");
watch.Reset(); //watch.Reset();
watch.Start(); //watch.Start();
while (toSearch.Count > 0) while (toSearch.Count > 0)
{ {
Vector2 item = toSearch.Dequeue(); Vector2 item = toSearch.Dequeue();
@ -185,9 +185,9 @@ namespace stardew_access.Features
} }
} }
} }
watch.Stop(); //watch.Stop();
elapsedMs = watch.ElapsedMilliseconds; //elapsedMs = watch.ElapsedMilliseconds;
MainClass.DebugLog($"Search loop duration: {elapsedMs}; {count} iterations."); //MainClass.DebugLog($"Search loop duration: {elapsedMs}; {count} iterations.");
searched.Clear(); searched.Clear();
return detectedTiles; return detectedTiles;
} }

View File

@ -420,7 +420,7 @@ namespace stardew_access.Features
var (modConditionalLocations, modLocations, vanillaConditionalLocations, vanillaLocations) = SortLocationsByType(json); var (modConditionalLocations, modLocations, vanillaConditionalLocations, vanillaLocations) = SortLocationsByType(json);
// Create a merged dictionary to store all the location dictionaries // Create a merged dictionary to store all the location dictionaries
var mergedDict = new Dictionary<string, Dictionary<(short x, short y), (string name, CATEGORY category)>>(); var mergedDict = new Dictionary<string, Dictionary<(short x, short y), (string name, CATEGORY category)>>(StringComparer.OrdinalIgnoreCase);
// Merge each category-specific dictionary into the merged dictionary. Prioritize conditional locations whose conditions are true and mod locations where the corresponding mod is loaded. Overwrite their default and vanilla versions, respectively. // Merge each category-specific dictionary into the merged dictionary. Prioritize conditional locations whose conditions are true and mod locations where the corresponding mod is loaded. Overwrite their default and vanilla versions, respectively.
MergeDicts(mergedDict, modConditionalLocations); MergeDicts(mergedDict, modConditionalLocations);
@ -436,7 +436,7 @@ namespace stardew_access.Features
/// </summary> /// </summary>
public static void SetupTilesDicts() public static void SetupTilesDicts()
{ {
if (staticTilesData.HasValue) if (staticTilesData.HasValue && staticTilesData.Value.ValueKind != JsonValueKind.Undefined)
{ {
staticTilesDataDict = BuildTilesDict(staticTilesData.Value); staticTilesDataDict = BuildTilesDict(staticTilesData.Value);
} }
@ -445,7 +445,7 @@ namespace stardew_access.Features
staticTilesDataDict = new Dictionary<string, Dictionary<(short x, short y), (string name, CATEGORY category)>>(); staticTilesDataDict = new Dictionary<string, Dictionary<(short x, short y), (string name, CATEGORY category)>>();
} }
if (customTilesData.HasValue) if (customTilesData.HasValue && customTilesData.Value.ValueKind != JsonValueKind.Undefined)
{ {
customTilesDataDict = BuildTilesDict(customTilesData.Value); customTilesDataDict = BuildTilesDict(customTilesData.Value);
} }

View File

@ -1,7 +1,7 @@
{ {
"Name": "Stardew Access", "Name": "Stardew Access",
"Author": "Mohammad Shoaib", "Author": "Mohammad Shoaib",
"Version": "1.3.5-alpha2", "Version": "1.3.5-beta2",
"Description": "An accessibility mod with screen reader support!", "Description": "An accessibility mod with screen reader support!",
"UniqueID": "shoaib.stardewaccess", "UniqueID": "shoaib.stardewaccess",
"EntryDll": "stardew-access.dll", "EntryDll": "stardew-access.dll",