Use flea market icon for add offer

This commit is contained in:
Tyfon
2024-08-17 01:11:01 -07:00
parent 28238b8e4d
commit b03f23d128

View File

@@ -71,6 +71,8 @@ public static class AddOfferContextMenuPatches
public class AddOfferNameIconPatch : ModulePatch
{
private static Sprite FleaSprite = null;
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(InteractionButtonsContainer), nameof(InteractionButtonsContainer.Show)).MakeGenericMethod(typeof(EItemInfoButton));
@@ -84,9 +86,10 @@ public static class AddOfferContextMenuPatches
{ AddOfferInfoButton, "ragfair/OFFER ADD" }
};
FleaSprite ??= Resources.FindObjectsOfTypeAll<Sprite>().Single(s => s.name == "icon_flea_market");
icons ??= new Dictionary<EItemInfoButton, Sprite>()
{
{ AddOfferInfoButton, EFTHardSettings.Instance.StaticIcons.GetSmallCurrencySign(ECurrencyType.RUB) }
{ AddOfferInfoButton, FleaSprite }
};
}
}