From dfd34601cfd893b2563bd1d9eeaa3e04d107d750 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Wed, 29 Oct 2025 20:54:41 +0800 Subject: [PATCH] update for new game update --- LogisticHub/LogisticHub.cs | 4 ++-- LogisticHub/LogisticHub.csproj | 11 ++++++++++- LogisticHub/Module/Miner.cs | 13 +++++++------ LogisticHub/Module/StationManager.cs | 4 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/LogisticHub/LogisticHub.cs b/LogisticHub/LogisticHub.cs index 6a17b9b..9d1293b 100644 --- a/LogisticHub/LogisticHub.cs +++ b/LogisticHub/LogisticHub.cs @@ -22,9 +22,9 @@ public class LogisticHub : BaseUnityPlugin "Energy consumption for each ore vein group(in 0.5W)"); Module.Miner.OilEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForOil", 3600000L, "Energy consumption for each oil seep(in 0.5W)"); - Module.Miner.WaterEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForWater", 20000000L, + Module.Miner.WaterEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForWater", 2000000L, "Energy consumption for water slot(in kW)"); - Module.Miner.WaterSpeed = Config.Bind("Miner", "WaterMiningSpeed", 100, + Module.Miner.WaterSpeed = Config.Bind("Miner", "WaterMiningSpeed", 10, "Water mining speed (count per second)"); Module.Miner.MiningScale = Config.Bind("Miner", "MiningScale", 0, """ diff --git a/LogisticHub/LogisticHub.csproj b/LogisticHub/LogisticHub.csproj index 293e30e..a1c9a76 100644 --- a/LogisticHub/LogisticHub.csproj +++ b/LogisticHub/LogisticHub.csproj @@ -16,8 +16,17 @@ + - + + + + + ..\AssemblyFromGame\Assembly-CSharp.dll + + + ..\AssemblyFromGame\UnityEngine.UI.dll + diff --git a/LogisticHub/Module/Miner.cs b/LogisticHub/Module/Miner.cs index 9f8d554..c6edcfd 100644 --- a/LogisticHub/Module/Miner.cs +++ b/LogisticHub/Module/Miner.cs @@ -4,6 +4,7 @@ using HarmonyLib; using UnityEngine; using UXAssist.Common; using Random = UnityEngine.Random; +using GameLogicProc = UXAssist.Common.GameLogic; namespace LogisticHub.Module; @@ -62,12 +63,12 @@ public class Miner : PatchImpl protected override void OnEnable() { - GameLogic.OnGameBegin += OnGameBegin; + GameLogicProc.OnGameBegin += OnGameBegin; } protected override void OnDisable() { - GameLogic.OnGameBegin -= OnGameBegin; + GameLogicProc.OnGameBegin -= OnGameBegin; } private static void OnGameBegin() @@ -124,14 +125,14 @@ public class Miner : PatchImpl } [HarmonyPrefix] - [HarmonyPatch(typeof(GameData), "GameTick")] - private static void GameData_GameTick_Prefix() + [HarmonyPatch(typeof(GameLogic), nameof(GameLogic.OnFactoryFrameBegin))] + private static void GameLogic_OnFactoryFrameBegin_Prefix() { var main = GameMain.instance; if (main.isMenuDemo) return; if (_miningSpeedScaleLong <= 0) return; - PerformanceMonitor.BeginSample(ECpuWorkEntry.Miner); + DeepProfiler.BeginSample(DPEntry.Miner); if (main.timei % 60 != 0) return; _frame += _miningFrames; var frameCounter = Mathf.FloorToInt(_frame / 1200000f); @@ -229,7 +230,7 @@ public class Miner : PatchImpl } } - PerformanceMonitor.EndSample(ECpuWorkEntry.Miner); + DeepProfiler.EndSample(DPEntry.Miner); } [HarmonyPostfix] diff --git a/LogisticHub/Module/StationManager.cs b/LogisticHub/Module/StationManager.cs index 21194ac..58f0c5b 100644 --- a/LogisticHub/Module/StationManager.cs +++ b/LogisticHub/Module/StationManager.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; using HarmonyLib; using UXAssist.Common; +using GameLogicProc = UXAssist.Common.GameLogic; namespace LogisticHub.Module; @@ -54,7 +54,7 @@ public class StationManager : PatchImpl public static void Init() { - GameLogic.OnGameBegin += () => + GameLogicProc.OnGameBegin += () => { _stations = null; var data = GameMain.data;