Code updates
This commit is contained in:
parent
6e2d2fac98
commit
eefc098b20
6 changed files with 109 additions and 8 deletions
14
Patches/PriceManager_ChangeCurrentCost_Patch.cs
Normal file
14
Patches/PriceManager_ChangeCurrentCost_Patch.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using HarmonyLib;
|
||||
using System.Linq;
|
||||
|
||||
namespace CurrencyChanger2.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(PriceManager), "ChangeCurrentCost")]
|
||||
public static class PriceManager_ChangeCurrentCost_Patch
|
||||
{
|
||||
public static void Postfix(int productID, PriceManager __instance)
|
||||
{
|
||||
if(PriceChanger.Override.Value) PriceChanger.ConfigEntries[productID].Value = __instance.m_CurrentCosts.FirstOrDefault((Pricing i) => i.ProductID == productID).Price;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue