Beispiel #1
0
 internal static void ConsumeResourcesPrefix(TechType techType, uGUI_IconNotifier.AnimationDone endFunc = null)
 {
     Log.LogDebug($"InventoryPatches.ConsumeResourcesPrefix: techType = {techType.AsString()}");
     if (Main.compatibleBatteries.Contains(techType))
     {
         Log.LogDebug($"InventoryPatches.ConsumeResourcesPrefix: battery TechType is being consumed, caching TechType");
         cachedBatteryType = techType;
     }
 }
Beispiel #2
0
        internal static void ConsumeResourcesPostfix(Inventory __instance, TechType techType, uGUI_IconNotifier.AnimationDone endFunc = null)
        {
#if BELOWZERO
            float lastRemovedBatteryCharge = __instance?.container == null ? -1f : __instance.container.lastRemovedBatteryCharge;
#else
            float lastRemovedBatteryCharge = 0f;
#endif
            if (lastRemovedBatteryCharge > 1f)
            {
                bool bIsChip = chipTechTypes.Contains(techType);
                Log.LogDebug($"InventoryPatches.ConsumeResourcesPostfix: found lastRemovedBatteryCharge of {lastRemovedBatteryCharge} and bIsChip: {bIsChip}");
                if (bIsChip)
                {
                    lastChipCharge = lastRemovedBatteryCharge;
                }
                else
                {
                    cachedBatteryCharge = lastRemovedBatteryCharge;
                }
            }
        }