mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-08-05 19:30:21 +08:00
refactor: phase 5 transpiler docs, mod-compat helpers, and build quality gates
This commit is contained in:
@@ -4,6 +4,7 @@ using UnityEngine;
|
||||
using UXAssist.Common;
|
||||
using UXAssist.Common.GameConstants;
|
||||
using UXAssist.Common.ModFeatures;
|
||||
using UXAssist.Common.Utils;
|
||||
using CheatEnabler;
|
||||
|
||||
namespace CheatEnabler.Functions.DysonSphere;
|
||||
@@ -19,8 +20,6 @@ public static class FrameRemovalFunctions
|
||||
|
||||
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThisWillRemoveAllFramesOn0AreYouSure.Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
|
||||
{
|
||||
var totalFrameSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");
|
||||
|
||||
foreach (var dysonSphereLayer in dysonSphere.layersIdBased)
|
||||
{
|
||||
if (dysonSphereLayer == null) continue;
|
||||
@@ -49,7 +48,7 @@ public static class FrameRemovalFunctions
|
||||
dysonSphereLayer.frameCursor = 1;
|
||||
dysonSphereLayer.frameRecycleCursor = 0;
|
||||
dysonSphereLayer.SetFrameCapacity(DysonSphereConstants.DefaultLayerPoolCapacity);
|
||||
totalFrameSpInfo?.SetValue(dysonSphereLayer, 0);
|
||||
DysonSphereReflection.SetTotalFrameSP(dysonSphereLayer, 0);
|
||||
}
|
||||
dysonSphere.CheckAutoNodes();
|
||||
dysonSphere.PickAutoNode();
|
||||
|
||||
@@ -4,6 +4,7 @@ using HarmonyLib;
|
||||
using UnityEngine;
|
||||
using UXAssist.Common;
|
||||
using UXAssist.Common.ModFeatures;
|
||||
using UXAssist.Common.Utils;
|
||||
using CheatEnabler;
|
||||
|
||||
namespace CheatEnabler.Functions.DysonSphere;
|
||||
@@ -19,10 +20,6 @@ public static class ShellCompletionFunctions
|
||||
|
||||
UIMessageBox.Show(Localization.CheatEnabler.Translate(), string.Format(Localization.ThisWillCompleteAllDysonSphereShellsOn0InstantlyAreYouSure.Translate(), star.displayName), Localization.Cancel.Translate(), Localization.OK.Translate(), UIMessageBox.QUESTION, null, () =>
|
||||
{
|
||||
var totalNodeSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalNodeSP");
|
||||
var totalFrameSpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalFrameSP");
|
||||
var totalCpInfo = AccessTools.Field(typeof(DysonSphereLayer), "totalCP");
|
||||
|
||||
var rocketCount = 0L;
|
||||
var solarSailCount = 0L;
|
||||
foreach (var dysonSphereLayer in dysonSphere.layersIdBased)
|
||||
@@ -75,16 +72,16 @@ public static class ShellCompletionFunctions
|
||||
shell.nodecps[nodeIndex] = cpMax;
|
||||
shell.nodecps[shell.nodecps.Length - 1] += diff;
|
||||
solarSailCount += diff;
|
||||
if (totalCpInfo != null)
|
||||
if (DysonSphereReflection.HasTotalCP)
|
||||
{
|
||||
shell.SetMaterialDynamicVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
totalNodeSpInfo?.SetValue(dysonSphereLayer, totalNodeSp);
|
||||
totalFrameSpInfo?.SetValue(dysonSphereLayer, totalFrameSp);
|
||||
totalCpInfo?.SetValue(dysonSphereLayer, totalCp);
|
||||
DysonSphereReflection.SetTotalNodeSP(dysonSphereLayer, totalNodeSp);
|
||||
DysonSphereReflection.SetTotalFrameSP(dysonSphereLayer, totalFrameSp);
|
||||
DysonSphereReflection.SetTotalCP(dysonSphereLayer, totalCp);
|
||||
}
|
||||
dysonSphere.CheckAutoNodes();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user