Skip to content

Commit

Permalink
fix: narrow collection range (gottyduke#51)
Browse files Browse the repository at this point in the history
* fix: narrowed collection page range
* i18n: update keys
* build: bump version
  • Loading branch information
gottyduke authored Apr 14, 2024
1 parent 15be112 commit c5f48b1
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 21 deletions.
13 changes: 9 additions & 4 deletions Informant/Implementation/Decorator/ShippingBinDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal class ShippingBinDecorator : IDecorator<Item>

private static Texture2D? _shippingBin;
private static HashSet<string>? _collections;
private static HashSet<string>? _shippingCollections;

private readonly IModHelper _modHelper;
private readonly Harmony _harmony;
Expand Down Expand Up @@ -60,9 +61,9 @@ public bool HasDecoration(Item input)
return null;
}

// track all shippables or collection page only
if ((trackingType == ShippingBinTrackingType.All && input is SObject obj && obj.countsForShippedCollection()) ||
(trackingType == ShippingBinTrackingType.Collection && _collections != null && _collections.Contains(itemId))) {
// track all collections or shipping page only
if ((trackingType == ShippingBinTrackingType.All && _collections != null && _collections.Contains(itemId)) ||
(trackingType == ShippingBinTrackingType.Collection && _shippingCollections != null && _shippingCollections.Contains(itemId))) {
return amountStillNeeded;
}

Expand All @@ -71,7 +72,7 @@ public bool HasDecoration(Item input)

private static void GetFlattenedCollections(GameMenu __instance)
{
if (_collections != null || __instance == null) {
if ((_collections != null && _shippingCollections != null) || __instance == null) {
// already acquired
return;
}
Expand All @@ -82,6 +83,10 @@ private static void GetFlattenedCollections(GameMenu __instance)
.SelectMany(page => page)
.Select(item => item.name.Split(' ')[0])
.ToHashSet();
_shippingCollections = collectionsPage.collections[CollectionsPage.organicsTab]
.SelectMany(page => page)
.Select(item => item.name.Split(' ')[0])
.ToHashSet();
}
}

Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "Versand-Dekoration",
"ShippingBinDecorator.Description": "Markiert Gegenstände, die noch nie versandt worden sind",
"ShippingBinDecorator.TrackingType": "Shipping Tracking Type",
"ShippingBinDecorator.TrackingType.All": "All Shippable",
"ShippingBinDecorator.TrackingType.Collection": "Collection Only",
"ShippingBinDecorator.TrackingType.All": "All Collection",
"ShippingBinDecorator.TrackingType.Collection": "Shipping Only",

"AnimalTooltipGenerator": "Animals Tooltip",
"AnimalTooltipGenerator.Description": "Displays additional information for farm animals",
Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "Shipping Decorator",
"ShippingBinDecorator.Description": "Marks items that were not shipped yet",
"ShippingBinDecorator.TrackingType": "Shipping Tracking Type",
"ShippingBinDecorator.TrackingType.All": "All Shippable",
"ShippingBinDecorator.TrackingType.Collection": "Collection Only",
"ShippingBinDecorator.TrackingType.All": "All Collection",
"ShippingBinDecorator.TrackingType.Collection": "Shipping Only",

"AnimalTooltipGenerator": "Animals Tooltip",
"AnimalTooltipGenerator.Description": "Displays additional information for farm animals",
Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "Decorador de Envío",
"ShippingBinDecorator.Description": "Marca los objetos que aún no se han enviado",
"ShippingBinDecorator.TrackingType": "Shipping Tracking Type",
"ShippingBinDecorator.TrackingType.All": "All Shippable",
"ShippingBinDecorator.TrackingType.Collection": "Collection Only",
"ShippingBinDecorator.TrackingType.All": "All Collection",
"ShippingBinDecorator.TrackingType.Collection": "Shipping Only",

"AnimalTooltipGenerator": "Descripción Emergente de Animales",
"AnimalTooltipGenerator.Description": "Muestra información adicional sobre los animales de granja",
Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "Annotation d'expédition",
"ShippingBinDecorator.Description": "Signale les objets qui n'ont pas encore été expédiés",
"ShippingBinDecorator.TrackingType": "Shipping Tracking Type",
"ShippingBinDecorator.TrackingType.All": "All Shippable",
"ShippingBinDecorator.TrackingType.Collection": "Collection Only",
"ShippingBinDecorator.TrackingType.All": "All Collection",
"ShippingBinDecorator.TrackingType.Collection": "Shipping Only",

"AnimalTooltipGenerator": "Animals Tooltip",
"AnimalTooltipGenerator.Description": "Displays additional information for farm animals",
Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "출하 표시",
"ShippingBinDecorator.Description": "출하한적 없는 아이템을 표시합니다",
"ShippingBinDecorator.TrackingType": "Shipping Tracking Type",
"ShippingBinDecorator.TrackingType.All": "All Shippable",
"ShippingBinDecorator.TrackingType.Collection": "Collection Only",
"ShippingBinDecorator.TrackingType.All": "All Collection",
"ShippingBinDecorator.TrackingType.Collection": "Shipping Only",

"AnimalTooltipGenerator": "Animals Tooltip",
"AnimalTooltipGenerator.Description": "Displays additional information for farm animals",
Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "Marcador de Remessas",
"ShippingBinDecorator.Description": "Marca os itens que ainda não foram enviados",
"ShippingBinDecorator.TrackingType": "Shipping Tracking Type",
"ShippingBinDecorator.TrackingType.All": "All Shippable",
"ShippingBinDecorator.TrackingType.Collection": "Collection Only",
"ShippingBinDecorator.TrackingType.All": "All Collection",
"ShippingBinDecorator.TrackingType.Collection": "Shipping Only",

"AnimalTooltipGenerator": "Animals Tooltip",
"AnimalTooltipGenerator.Description": "Displays additional information for farm animals",
Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "Shipping Decorator",
"ShippingBinDecorator.Description": "Marks items that were not shipped yet",
"ShippingBinDecorator.TrackingType": "Shipping Tracking Type",
"ShippingBinDecorator.TrackingType.All": "All Shippable",
"ShippingBinDecorator.TrackingType.Collection": "Collection Only",
"ShippingBinDecorator.TrackingType.All": "All Collection",
"ShippingBinDecorator.TrackingType.Collection": "Shipping Only",

"AnimalTooltipGenerator": "Animals Tooltip",
"AnimalTooltipGenerator.Description": "Displays additional information for farm animals",
Expand Down
4 changes: 2 additions & 2 deletions Informant/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"ShippingBinDecorator": "出货箱",
"ShippingBinDecorator.Description": "标记还未放入过出货箱的物品",
"ShippingBinDecorator.TrackingType": "出货箱: 追踪类型",
"ShippingBinDecorator.TrackingType.All": "所有可出货物品",
"ShippingBinDecorator.TrackingType.Collection": "仅收集品",
"ShippingBinDecorator.TrackingType.All": "所有收集品",
"ShippingBinDecorator.TrackingType.Collection": "仅出货成就物品",

"AnimalTooltipGenerator": "动物",
"AnimalTooltipGenerator.Description": "显示农场动物的额外信息",
Expand Down
2 changes: 1 addition & 1 deletion Informant/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Informant",
"Author": "Slothsoft",
"Version": "1.8.0",
"Version": "1.8.1",
"Description": "Displays additional information on various objects.",
"UniqueID": "Slothsoft.Informant",
"EntryDll": "Informant.dll",
Expand Down

0 comments on commit c5f48b1

Please sign in to comment.