Issue#54 the names in static tiles now ignore anything between square brackets

master
Mohammad Shoaib Khan 2022-10-22 22:19:38 +05:30
parent 34cb47bdaa
commit a9160b4ff6
1 changed files with 16 additions and 2 deletions

View File

@ -45,7 +45,7 @@ namespace stardew_access.Features
foreach (var location in data) foreach (var location in data)
{ {
if (!Game1.currentLocation.Name.ToLower().Equals(location.Key.ToLower())) if (!Game1.currentLocation.name.Value.ToLower().Equals(location.Key.ToLower()))
continue; continue;
if (location.Value != null) if (location.Value != null)
@ -83,7 +83,21 @@ namespace stardew_access.Features
} }
if (isXPresent && isYPresent) if (isXPresent && isYPresent)
return (tile.Key, CATEGORY.FromString(tileType.ToString().ToLower())); {
string key = tile.Key;
if (key.Contains('[') && key.Contains(']'))
{
int i1 = key.IndexOf('[');
int i2 = key.LastIndexOf(']');
if (i1 < i2)
{
key = key.Remove(i1, ++i2 - i1);
}
}
return (key.Trim(), CATEGORY.FromString(tileType.ToString().ToLower()));
}
} }
} }