Skip to content

Commit

Permalink
Change bait itemTypeIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Aug 25, 2024
1 parent 0b60cbd commit 7c88269
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Winch/Patches/API/ItemLoadPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public static void ChangeDredgeCrane(IList<ItemData> items)
}
}

public static void ChangeBaits(IList<ItemData> items)
{
var baits = items.WhereType<ItemData, SpatialItemData>().Where(item => item.id.StartsWith("bait"));
foreach (var bait in baits)
{
bait.itemTypeIcon = TextureUtil.GetSprite("BaitIcon");
}
}

public static void ChangeHarvestables(IList<ItemData> items)
{
var harvestables = items.WhereType<ItemData, HarvestableItemData>();
Expand Down Expand Up @@ -116,6 +125,7 @@ public static void Prefix(ItemManager __instance, AsyncOperationHandle<IList<Ite
if (handle.Result == null || handle.Status != AsyncOperationStatus.Succeeded) return;

ChangeDredgeCrane(handle.Result);
ChangeBaits(handle.Result);
ChangeHarvestables(handle.Result);
ItemUtil.AddModdedItemData(handle.Result);
DredgeEvent.AddressableEvents.ItemsLoaded.Trigger(__instance, handle, true);
Expand Down

0 comments on commit 7c88269

Please sign in to comment.