mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 20:53:28 +08:00
update for new game update
This commit is contained in:
@@ -22,9 +22,9 @@ public class LogisticHub : BaseUnityPlugin
|
|||||||
"Energy consumption for each ore vein group(in 0.5W)");
|
"Energy consumption for each ore vein group(in 0.5W)");
|
||||||
Module.Miner.OilEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForOil", 3600000L,
|
Module.Miner.OilEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForOil", 3600000L,
|
||||||
"Energy consumption for each oil seep(in 0.5W)");
|
"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)");
|
"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)");
|
"Water mining speed (count per second)");
|
||||||
Module.Miner.MiningScale = Config.Bind("Miner", "MiningScale", 0,
|
Module.Miner.MiningScale = Config.Bind("Miner", "MiningScale", 0,
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -16,8 +16,17 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BepInEx.Core" Version="5.*" />
|
<PackageReference Include="BepInEx.Core" Version="5.*" />
|
||||||
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
|
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
|
||||||
|
<PackageReference Include="UnityEngine.Modules" Version="2022.3.53" IncludeAssets="compile" />
|
||||||
<!-- <PackageReference Include="DysonSphereProgram.GameLibs" Version="0.10.32.*-r.*" /> -->
|
<!-- <PackageReference Include="DysonSphereProgram.GameLibs" Version="0.10.32.*-r.*" /> -->
|
||||||
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Assembly-CSharp">
|
||||||
|
<HintPath>..\AssemblyFromGame\Assembly-CSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.UI">
|
||||||
|
<HintPath>..\AssemblyFromGame\UnityEngine.UI.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using HarmonyLib;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
using Random = UnityEngine.Random;
|
using Random = UnityEngine.Random;
|
||||||
|
using GameLogicProc = UXAssist.Common.GameLogic;
|
||||||
|
|
||||||
namespace LogisticHub.Module;
|
namespace LogisticHub.Module;
|
||||||
|
|
||||||
@@ -62,12 +63,12 @@ public class Miner : PatchImpl<Miner>
|
|||||||
|
|
||||||
protected override void OnEnable()
|
protected override void OnEnable()
|
||||||
{
|
{
|
||||||
GameLogic.OnGameBegin += OnGameBegin;
|
GameLogicProc.OnGameBegin += OnGameBegin;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisable()
|
protected override void OnDisable()
|
||||||
{
|
{
|
||||||
GameLogic.OnGameBegin -= OnGameBegin;
|
GameLogicProc.OnGameBegin -= OnGameBegin;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void OnGameBegin()
|
private static void OnGameBegin()
|
||||||
@@ -124,14 +125,14 @@ public class Miner : PatchImpl<Miner>
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(GameData), "GameTick")]
|
[HarmonyPatch(typeof(GameLogic), nameof(GameLogic.OnFactoryFrameBegin))]
|
||||||
private static void GameData_GameTick_Prefix()
|
private static void GameLogic_OnFactoryFrameBegin_Prefix()
|
||||||
{
|
{
|
||||||
var main = GameMain.instance;
|
var main = GameMain.instance;
|
||||||
if (main.isMenuDemo) return;
|
if (main.isMenuDemo) return;
|
||||||
if (_miningSpeedScaleLong <= 0) return;
|
if (_miningSpeedScaleLong <= 0) return;
|
||||||
|
|
||||||
PerformanceMonitor.BeginSample(ECpuWorkEntry.Miner);
|
DeepProfiler.BeginSample(DPEntry.Miner);
|
||||||
if (main.timei % 60 != 0) return;
|
if (main.timei % 60 != 0) return;
|
||||||
_frame += _miningFrames;
|
_frame += _miningFrames;
|
||||||
var frameCounter = Mathf.FloorToInt(_frame / 1200000f);
|
var frameCounter = Mathf.FloorToInt(_frame / 1200000f);
|
||||||
@@ -229,7 +230,7 @@ public class Miner : PatchImpl<Miner>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PerformanceMonitor.EndSample(ECpuWorkEntry.Miner);
|
DeepProfiler.EndSample(DPEntry.Miner);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UXAssist.Common;
|
using UXAssist.Common;
|
||||||
|
using GameLogicProc = UXAssist.Common.GameLogic;
|
||||||
|
|
||||||
namespace LogisticHub.Module;
|
namespace LogisticHub.Module;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ public class StationManager : PatchImpl<StationManager>
|
|||||||
|
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
GameLogic.OnGameBegin += () =>
|
GameLogicProc.OnGameBegin += () =>
|
||||||
{
|
{
|
||||||
_stations = null;
|
_stations = null;
|
||||||
var data = GameMain.data;
|
var data = GameMain.data;
|
||||||
|
|||||||
Reference in New Issue
Block a user