fix(uxassist): exclude protected veins from mining displays

Use productive veins for mining-rate estimates, resource analysis and hover counts without mutating miners or reserves. Keep zero-cost mining productive, including CheatEnabler infinite resources.

Refs #95
This commit is contained in:
soarqin committed 2026-10-11 03:48:04 +08:00
1 parent 47ba29447c
commit 06a8445907
6 files changed
+203 -4

No files matched your search

+3 -2
View File
@@ -35,9 +35,10 @@ public static class ResourcePatch
{
static private readonly float InfiniteResourceRate = 0f;
// Harmony transpiler: Transpiler
// Target: FactorySystem.GameTick, GameLogic._miner_parallel, PlanetTransport.GameTick, UIChartAstroResource.CalculateMaxAmount, UIChartVeinGroup.CalculateMaxAmount, UIControlPanelAdvancedMinerEntry._OnUpdate, UIControlPanelVeinCollectorPanel._OnUpdate, UIMinerWindow._OnUpdate, UIMiningUpgradeLabel.Update, UIVeinCollectorPanel._OnUpdate
// Target: FactorySystem.GameTick, GameLogic._miner_parallel, PlanetTransport.GameTick, FactoryPatch.GetMiningCostRate (UXAssist), UIChartAstroResource.CalculateMaxAmount, UIChartVeinGroup.CalculateMaxAmount, UIControlPanelAdvancedMinerEntry._OnUpdate, UIControlPanelVeinCollectorPanel._OnUpdate, UIMinerWindow._OnUpdate, UIMiningUpgradeLabel.Update, UIVeinCollectorPanel._OnUpdate
// Fallback: None — patch will fail loudly if the target method body changes.
[HarmonyTranspiler]
[HarmonyPatch(typeof(UXAssist.Patches.Factory.FactoryPatch), nameof(UXAssist.Patches.Factory.FactoryPatch.GetMiningCostRate))]
[HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.GameTick), typeof(long), typeof(bool))]
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic._miner_parallel))]
[HarmonyPatch(typeof(PlanetTransport), nameof(PlanetTransport.GameTick))]
@@ -128,4 +129,4 @@ public static class ResourcePatch
return matcher.InstructionEnumeration();
}
}
}
}