Initial commit
This commit is contained in:
commit
3f4eb52db8
5 changed files with 487 additions and 0 deletions
45
Plugin.cs
Normal file
45
Plugin.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using BepInEx;
|
||||
using HarmonyLib;
|
||||
using MyBox;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RestockerPaymentFix
|
||||
{
|
||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded! Applying patch...");
|
||||
Harmony harmony = new Harmony("com.orpticon.DisableShelves");
|
||||
harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
public static class RestockerPaymentFixPatch
|
||||
{
|
||||
[HarmonyPatch(typeof(EmployeeManager))]
|
||||
[HarmonyPatch("OverduePayments", MethodType.Getter)]
|
||||
public static class EmployeeManager_OverduePayments_Patch
|
||||
{
|
||||
public static void Postfix(EmployeeManager __instance, List<PlayerPaymentData> __result)
|
||||
{
|
||||
if (__instance.m_RestockersData.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float num = 0f;
|
||||
foreach (int id in __instance.m_RestockersData)
|
||||
{
|
||||
RestockerSO restockerSO = Singleton<IDManager>.Instance.RestockerSO(id);
|
||||
num += restockerSO.DailyWage;
|
||||
}
|
||||
PlayerPaymentData item = new PlayerPaymentData
|
||||
{
|
||||
Amount = num,
|
||||
PaymentType = PlayerPaymentType.STAFF
|
||||
};
|
||||
__result.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue