1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 20:53:28 +08:00

UXAssist and CheatEnabler new release

This commit is contained in:
2024-09-04 20:32:00 +08:00
parent 241c9ee605
commit 96b4d6cfc8
18 changed files with 698 additions and 344 deletions

View File

@@ -1,7 +1,9 @@
## Changlog
* 2.3.25
+ New feature: `Enable warp without space warpers`
+ New feature: `Enable warp without space warpers`
+ New feature: `Wind Turbines do global power coverage`
+ Fix an issue that `Complete Dyson Sphere Shells instantly` does not generate production records for solar sails.
* 2.3.24
+ `Complete Dyson Sphere Shells instantly`: Fix a bug that may cause negative power in some cases
* 2.3.23
@@ -131,6 +133,8 @@
* 2.3.25
+ 新功能:`无需空间翘曲器即可曲速飞行`
+ 新功能:`风力涡轮机供电覆盖全球`
+ 修复了`立即完成戴森壳建造`未生成太阳帆生产记录的问题
* 2.3.24
+ `立即完成戴森壳建造`:修复了在某些情况下可能导致发电为负的问题
* 2.3.23

View File

@@ -44,6 +44,8 @@ public class CheatEnabler : BaseUnityPlugin
"Boost fuel power");
FactoryPatch.BoostGeothermalPowerEnabled = Config.Bind("Build", "BoostGeothermalPower", false,
"Boost geothermal power");
FactoryPatch.WindTurbinesPowerGlobalCoverageEnabled = Config.Bind("Build", "PowerGlobalCoverage", false,
"Global power coverage");
FactoryPatch.GreaterPowerUsageInLogisticsEnabled = Config.Bind("Build", "GreaterPowerUsageInLogistics", false,
"Increase maximum power usage in Logistic Stations and Advanced Mining Machines");
FactoryPatch.ControlPanelRemoteLogisticsEnabled = Config.Bind("Build", "ControlPanelRemoteLogistics", false,

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.cheatenabler</BepInExPluginGuid>
<Description>DSP MOD - CheatEnabler</Description>
<Version>2.3.24</Version>
<Version>2.3.25</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>CheatEnabler</PackageId>

View File

@@ -26,6 +26,7 @@ public static class FactoryPatch
public static ConfigEntry<bool> BoostSolarPowerEnabled;
public static ConfigEntry<bool> BoostFuelPowerEnabled;
public static ConfigEntry<bool> BoostGeothermalPowerEnabled;
public static ConfigEntry<bool> WindTurbinesPowerGlobalCoverageEnabled;
public static ConfigEntry<bool> GreaterPowerUsageInLogisticsEnabled;
public static ConfigEntry<bool> ControlPanelRemoteLogisticsEnabled;
@@ -69,6 +70,7 @@ public static class FactoryPatch
BoostSolarPowerEnabled.SettingChanged += (_, _) => BoostSolarPower.Enable(BoostSolarPowerEnabled.Value);
BoostFuelPowerEnabled.SettingChanged += (_, _) => BoostFuelPower.Enable(BoostFuelPowerEnabled.Value);
BoostGeothermalPowerEnabled.SettingChanged += (_, _) => BoostGeothermalPower.Enable(BoostGeothermalPowerEnabled.Value);
WindTurbinesPowerGlobalCoverageEnabled.SettingChanged += (_, _) => WindTurbinesPowerGlobalCoverage.Enable(WindTurbinesPowerGlobalCoverageEnabled.Value);
GreaterPowerUsageInLogisticsEnabled.SettingChanged += (_, _) => GreaterPowerUsageInLogistics.Enable(GreaterPowerUsageInLogisticsEnabled.Value);
ControlPanelRemoteLogisticsEnabled.SettingChanged += (_, _) => ControlPanelRemoteLogistics.Enable(ControlPanelRemoteLogisticsEnabled.Value);
ImmediateBuild.Enable(ImmediateEnabled.Value);
@@ -85,6 +87,7 @@ public static class FactoryPatch
ControlPanelRemoteLogistics.Enable(ControlPanelRemoteLogisticsEnabled.Value);
_factoryPatch = Harmony.CreateAndPatchAll(typeof(FactoryPatch));
GameLogic.OnGameBegin += GameMain_Begin_Postfix_For_ImmBuild;
GameLogic.OnDataLoaded += () => WindTurbinesPowerGlobalCoverage.Enable(WindTurbinesPowerGlobalCoverageEnabled.Value);
}
public static void Uninit()
@@ -101,6 +104,7 @@ public static class FactoryPatch
BoostSolarPower.Enable(false);
BoostFuelPower.Enable(false);
BoostGeothermalPower.Enable(false);
WindTurbinesPowerGlobalCoverage.Enable(false);
GreaterPowerUsageInLogistics.Enable(false);
ControlPanelRemoteLogistics.Enable(false);
}
@@ -1320,6 +1324,57 @@ public static class FactoryPatch
}
}
private static class WindTurbinesPowerGlobalCoverage
{
private static bool _patched;
private static PrefabDesc _prefabdesc;
private static float _oldCoverRadius;
private static float _oldConnectDistance;
public static void Enable(bool enable)
{
if (enable)
{
if (_patched) return;
_patched = true;
var itemProto = LDB.items.Select(2203);
_oldCoverRadius = itemProto.prefabDesc.powerCoverRadius;
_oldConnectDistance = itemProto.prefabDesc.powerConnectDistance;
itemProto.prefabDesc.powerCoverRadius = 500f;
itemProto.prefabDesc.powerConnectDistance = 500f;
_prefabdesc = itemProto.prefabDesc;
}
else
{
if (!_patched) return;
_patched = false;
_prefabdesc.powerCoverRadius = _oldCoverRadius;
_prefabdesc.powerConnectDistance = _oldConnectDistance;
}
foreach (var factory in GameMain.data.factories)
{
var powerSystem = factory?.powerSystem;
if (powerSystem == null) continue;
for (var i = powerSystem.nodeCursor - 1; i >= 0; i--)
{
ref var node = ref powerSystem.nodePool[i];
if (node.id != i) continue;
ref var entity = ref factory.entityPool[node.entityId];
if (entity.protoId != 2203) continue;
powerSystem.OnNodeRemoving(i);
node.connectDistance = _prefabdesc.powerConnectDistance;
node.coverRadius = _prefabdesc.powerCoverRadius;
powerSystem.OnNodeAdded(i);
}
if (factory.planet.factoryLoaded)
{
factory.planet.factoryModel.RefreshPowerNodes();
}
}
}
}
private static class GreaterPowerUsageInLogistics
{
private static Harmony _patch;

View File

@@ -31,6 +31,7 @@
- Advanced Mining Machines: Increased max mining speed to 1000%
+ Retrieve/Place items from/to remote planets on logistics control panel
+ Remove space limit between wind turbines and solar panels
+ Wind Turbines do global power coverage
+ Boost power generations for kinds of power generators
+ Planet:
+ Infinite Natural Resources
@@ -90,6 +91,7 @@
- 大型采矿机将最大采矿速度提高到1000%
+ 在物流总控面板上可以从非本地行星取放物品
+ 风力发电机和太阳能板无间距限制
+ 风力涡轮机供电覆盖全球
+ 提升各种发电设备发电量
+ 行星:
+ 自然资源采集不消耗

View File

@@ -49,6 +49,7 @@ public static class UIConfigWindow
I18N.Add("Boost solar power", "Boost solar power(x100,000)", "提升太阳能发电(x100,000)");
I18N.Add("Boost fuel power", "Boost fuel power(x50,000)", "提升燃料发电(x50,000)");
I18N.Add("Boost fuel power 2", "(x20,000 for deuteron, x10,000 for antimatter)", "(氘核燃料棒x20,000反物质燃料棒x10,000)");
I18N.Add("Wind Turbines do global power coverage", "Wind Turbines do global power coverage", "风力涡轮机供电覆盖全球");
I18N.Add("Boost geothermal power", "Boost geothermal power(x50,000)", "提升地热发电(x50,000)");
I18N.Add("Increase maximum power usage in Logistic Stations and Advanced Mining Machines", "Increase maximum power usage in Logistic Stations and Advanced Mining Machines", "提升物流塔和大型采矿机的最大功耗");
I18N.Add("Retrieve/Place items from/to remote planets on logistics control panel", "Retrieve/Place items from/to remote planets on logistics control panel", "在物流总控面板上可以从非本地行星取放物品");
@@ -145,6 +146,8 @@ public static class UIConfigWindow
y = 10f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.RemovePowerSpaceLimitEnabled, "Remove power space limit");
y += 36f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.WindTurbinesPowerGlobalCoverageEnabled, "Wind Turbines do global power coverage");
y += 36f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.BoostWindPowerEnabled, "Boost wind power");
y += 36f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.BoostSolarPowerEnabled, "Boost solar power");
@@ -152,9 +155,8 @@ public static class UIConfigWindow
wnd.AddCheckBox(x, y, tab2, FactoryPatch.BoostGeothermalPowerEnabled, "Boost geothermal power");
y += 36f;
wnd.AddCheckBox(x, y, tab2, FactoryPatch.BoostFuelPowerEnabled, "Boost fuel power");
x += 32f;
y += 26f;
wnd.AddText2(x, y, tab2, "Boost fuel power 2", 13);
wnd.AddText2(x + 32f, y, tab2, "Boost fuel power 2", 13);
// Planet Tab
var tab3 = wnd.AddTab(_windowTrans, "Planet");

View File

@@ -1,6 +1,6 @@
{
"name": "CheatEnabler",
"version_number": "2.3.24",
"version_number": "2.3.25",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/CheatEnabler",
"description": "Add various cheat functions while disabling abnormal determinants / 添加一些作弊功能,同时屏蔽异常检测",
"dependencies": [