1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2026-06-18 05:11:18 +08:00

donet format

This commit is contained in:
2025-09-21 15:38:03 +08:00
parent 5f37b8b6d6
commit a25f74443d
32 changed files with 170 additions and 155 deletions
+21 -14
View File
@@ -323,10 +323,10 @@ public static class DysonSphereFunctions
num += num2; num += num2;
} }
var radius = Math.Round(polygon[0].magnitude * 10.0) / 10.0; var radius = Math.Round(polygon[0].magnitude * 10.0) / 10.0;
for (int j = 0; j < polygon.Length; j++) for (int j = 0; j < polygon.Length; j++)
{ {
polygon[j] = polygon[j].normalized * radius; polygon[j] = polygon[j].normalized * radius;
} }
var center = (sum / num).normalized * radius; var center = (sum / num).normalized * radius;
float num3 = 0f; float num3 = 0f;
for (int k = 0; k < 3; k++) for (int k = 0; k < 3; k++)
@@ -459,10 +459,10 @@ public static class DysonSphereFunctions
num += num2; num += num2;
} }
shell.radius = Math.Round(shell.polygon[0].magnitude * 10.0) / 10.0; shell.radius = Math.Round(shell.polygon[0].magnitude * 10.0) / 10.0;
for (int j = 0; j < shell.polygon.Count; j++) for (int j = 0; j < shell.polygon.Count; j++)
{ {
shell.polygon[j] = shell.polygon[j].normalized * shell.radius; shell.polygon[j] = shell.polygon[j].normalized * shell.radius;
} }
var normalized = (sum / num).normalized; var normalized = (sum / num).normalized;
shell.center = normalized * shell.radius; shell.center = normalized * shell.radius;
float num3 = 0f; float num3 = 0f;
@@ -1191,19 +1191,25 @@ public static class DysonSphereFunctions
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++)
{ {
var layer = dysonSphere.layersIdBased[i]; var layer = dysonSphere.layersIdBased[i];
if (layer != null) { if (layer != null)
{
continue; continue;
} }
var radius = dysonSphere.maxOrbitRadius; var radius = dysonSphere.maxOrbitRadius;
for (; radius > 4000; radius -= 10) { for (; radius > 4000; radius -= 10)
if (dysonSphere.CheckLayerRadius(radius) == 0) { {
if (dysonSphere.CheckLayerRadius(radius) == 0)
{
break; break;
} }
} }
PrecalculatedTriangle triangle; PrecalculatedTriangle triangle;
try { try
{
triangle = PrecalculatedTriangles.First(t => t.MaxOrbitRadius > radius); triangle = PrecalculatedTriangles.First(t => t.MaxOrbitRadius > radius);
} catch (InvalidOperationException) { }
catch (InvalidOperationException)
{
UIMessageBox.Show("CheatEnabler".Translate(), string.Format("No precalculated triangle found for radius {0}.".Translate(), radius), "确定".Translate(), UIMessageBox.ERROR, null); UIMessageBox.Show("CheatEnabler".Translate(), string.Format("No precalculated triangle found for radius {0}.".Translate(), radius), "确定".Translate(), UIMessageBox.ERROR, null);
return; return;
} }
@@ -1389,7 +1395,8 @@ public static class DysonSphereFunctions
{ {
var lastGridScale = 0; var lastGridScale = 0;
var radiusList = new List<int>(); var radiusList = new List<int>();
for (var r = 4000; r <= 250000; r++) { for (var r = 4000; r <= 250000; r++)
{
var gridScale = (int)(Math.Pow(r / 4000.0, 0.75) + 0.5); var gridScale = (int)(Math.Pow(r / 4000.0, 0.75) + 0.5);
gridScale = (gridScale < 1) ? 1 : gridScale; gridScale = (gridScale < 1) ? 1 : gridScale;
if (gridScale == lastGridScale) continue; if (gridScale == lastGridScale) continue;
+2 -2
View File
@@ -30,7 +30,7 @@ public static class CombatPatch
MechaInvincible.Enable(false); MechaInvincible.Enable(false);
} }
private class MechaInvincible: PatchImpl<MechaInvincible> private class MechaInvincible : PatchImpl<MechaInvincible>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(Player), nameof(Player.invincible), MethodType.Getter)] [HarmonyPatch(typeof(Player), nameof(Player.invincible), MethodType.Getter)]
@@ -65,7 +65,7 @@ public static class CombatPatch
} }
} }
private class BuildingsInvincible: PatchImpl<BuildingsInvincible> private class BuildingsInvincible : PatchImpl<BuildingsInvincible>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByLocalCaster))] [HarmonyPatch(typeof(SkillSystem), nameof(SkillSystem.DamageGroundObjectByLocalCaster))]
+1 -1
View File
@@ -187,7 +187,7 @@ public static class GamePatch
} }
} }
public class UnlockTech: PatchImpl<UnlockTech> public class UnlockTech : PatchImpl<UnlockTech>
{ {
private static void UnlockTechRecursive(GameHistoryData history, [NotNull] TechProto techProto, int maxLevel = 10000) private static void UnlockTechRecursive(GameHistoryData history, [NotNull] TechProto techProto, int maxLevel = 10000)
{ {
+2 -2
View File
@@ -29,7 +29,7 @@ public static class PlanetPatch
TerraformAnyway.Enable(false); TerraformAnyway.Enable(false);
} }
private class WaterPumperPatch: PatchImpl<WaterPumperPatch> private class WaterPumperPatch : PatchImpl<WaterPumperPatch>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CheckBuildConditions))] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), nameof(BuildTool_BlueprintPaste.CheckBuildConditions))]
@@ -51,7 +51,7 @@ public static class PlanetPatch
} }
} }
private class TerraformAnyway: PatchImpl<TerraformAnyway> private class TerraformAnyway : PatchImpl<TerraformAnyway>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.ReformAction))] [HarmonyPatch(typeof(BuildTool_Reform), nameof(BuildTool_Reform.ReformAction))]
+3 -3
View File
@@ -33,7 +33,7 @@ public static class PlayerPatch
WarpWithoutSpaceWarpers.Enable(false); WarpWithoutSpaceWarpers.Enable(false);
} }
private class InstantHandCraft: PatchImpl<InstantHandCraft> private class InstantHandCraft : PatchImpl<InstantHandCraft>
{ {
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(ForgeTask), MethodType.Constructor, typeof(int), typeof(int))] [HarmonyPatch(typeof(ForgeTask), MethodType.Constructor, typeof(int), typeof(int))]
@@ -43,7 +43,7 @@ public static class PlayerPatch
} }
} }
private class InstantTeleport: PatchImpl<InstantTeleport> private class InstantTeleport : PatchImpl<InstantTeleport>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(UIGlobemap), nameof(UIGlobemap._OnUpdate))] [HarmonyPatch(typeof(UIGlobemap), nameof(UIGlobemap._OnUpdate))]
@@ -66,7 +66,7 @@ public static class PlayerPatch
} }
} }
private class WarpWithoutSpaceWarpers: PatchImpl<WarpWithoutSpaceWarpers> private class WarpWithoutSpaceWarpers : PatchImpl<WarpWithoutSpaceWarpers>
{ {
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(Mecha), nameof(Mecha.HasWarper))] [HarmonyPatch(typeof(Mecha), nameof(Mecha.HasWarper))]
+2 -2
View File
@@ -29,7 +29,7 @@ public static class ResourcePatch
FastMining.Enable(false); FastMining.Enable(false);
} }
private class InfiniteResource: PatchImpl<InfiniteResource> private class InfiniteResource : PatchImpl<InfiniteResource>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.GameTick), typeof(long), typeof(bool))] [HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.GameTick), typeof(long), typeof(bool))]
@@ -59,7 +59,7 @@ public static class ResourcePatch
} }
} }
private class FastMining: PatchImpl<FastMining> private class FastMining : PatchImpl<FastMining>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(FactorySystem), "GameTick", typeof(long), typeof(bool))] [HarmonyPatch(typeof(FactorySystem), "GameTick", typeof(long), typeof(bool))]
+8 -4
View File
@@ -304,17 +304,20 @@ public static class UIConfigWindow
{ {
y += 72f; y += 72f;
var originalY = y; var originalY = y;
var btn1 = wnd.AddButton(x, y, 300f, tab4, "Generate illegal dyson shell", 16, "button-generate-illegal-dyson-shells", () => { var btn1 = wnd.AddButton(x, y, 300f, tab4, "Generate illegal dyson shell", 16, "button-generate-illegal-dyson-shells", () =>
{
UIMessageBox.Show("Generate illegal dyson shell".Translate(), "WARNING: This operation can be very slow, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null, UIMessageBox.Show("Generate illegal dyson shell".Translate(), "WARNING: This operation can be very slow, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null,
() => { DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutput(); }); () => { DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutput(); });
}); });
y += 36f; y += 36f;
var btn2 = wnd.AddButton(x, y, 300f, tab4, "Keep max production shells and remove others", 16, "button-keep-max-production-shells", () => { var btn2 = wnd.AddButton(x, y, 300f, tab4, "Keep max production shells and remove others", 16, "button-keep-max-production-shells", () =>
{
UIMessageBox.Show("Keep max production shells and remove others".Translate(), "WARNING: This operation is DANGEROUS, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null, UIMessageBox.Show("Keep max production shells and remove others".Translate(), "WARNING: This operation is DANGEROUS, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null,
() => { DysonSphereFunctions.KeepMaxProductionShells(); }); () => { DysonSphereFunctions.KeepMaxProductionShells(); });
}); });
y += 36f; y += 36f;
var btn3 = wnd.AddButton(x, y, 300f, tab4, "Duplicate shells from that with highest production", 16, "button-duplicate-shells-from-the-highest-production", () => { var btn3 = wnd.AddButton(x, y, 300f, tab4, "Duplicate shells from that with highest production", 16, "button-duplicate-shells-from-the-highest-production", () =>
{
UIMessageBox.Show("Duplicate shells from that with highest production".Translate(), "WARNING: This operation can be very slow, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null, UIMessageBox.Show("Duplicate shells from that with highest production".Translate(), "WARNING: This operation can be very slow, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null,
() => { DysonSphereFunctions.DuplicateShellsWithHighestProduction(); }); () => { DysonSphereFunctions.DuplicateShellsWithHighestProduction(); });
}); });
@@ -322,7 +325,8 @@ public static class UIConfigWindow
var slider1 = wnd.AddSlider(x + 20f, y, tab4, DysonSphereFunctions.ShellsCountForFunctions, new ShellsCountMapper()); var slider1 = wnd.AddSlider(x + 20f, y, tab4, DysonSphereFunctions.ShellsCountForFunctions, new ShellsCountMapper());
y = originalY; y = originalY;
var btn4 = wnd.AddButton(x, y, 300f, tab4, "Generate illegal dyson shell quickly", 16, "button-generate-illegal-dyson-shells-quickly", () => { var btn4 = wnd.AddButton(x, y, 300f, tab4, "Generate illegal dyson shell quickly", 16, "button-generate-illegal-dyson-shells-quickly", () =>
{
UIMessageBox.Show("Generate illegal dyson shell".Translate(), "WARNING: This operation can be very slow, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null, UIMessageBox.Show("Generate illegal dyson shell".Translate(), "WARNING: This operation can be very slow, continue?".Translate(), "取消".Translate(), "确定".Translate(), UIMessageBox.WARNING, null,
() => { DysonSphereFunctions.CreateIllegalDysonShellQuickly(DysonSphereFunctions.ShellsCountForFunctions.Value); }); () => { DysonSphereFunctions.CreateIllegalDysonShellQuickly(DysonSphereFunctions.ShellsCountForFunctions.Value); });
}); });
+12 -12
View File
@@ -61,19 +61,19 @@ namespace Dustbin.NebulaSupport
NebulaModAPI.MultiplayerSession.Network.SendPacket(new SyncPlanetData(Dustbin.ExportData(factory))); NebulaModAPI.MultiplayerSession.Network.SendPacket(new SyncPlanetData(Dustbin.ExportData(factory)));
return; return;
case < 0: case < 0:
{ {
var tankPool = factory.factoryStorage.tankPool; var tankPool = factory.factoryStorage.tankPool;
tankPool[-storageId].IsDustbin = packet.Enable; tankPool[-storageId].IsDustbin = packet.Enable;
TankPatch.Reset(); TankPatch.Reset();
return; return;
} }
case > 0: case > 0:
{ {
var storagePool = factory.factoryStorage.storagePool; var storagePool = factory.factoryStorage.storagePool;
storagePool[storageId].IsDustbin = packet.Enable; storagePool[storageId].IsDustbin = packet.Enable;
StoragePatch.Reset(); StoragePatch.Reset();
return; return;
} }
} }
} }
} }
+67 -67
View File
@@ -410,30 +410,30 @@ public static class LabOptPatchFunctions
public static void SetFunctionInternal(ref LabComponent lab, bool researchMode, int recpId, int techId, SignData[] signPool, LabComponent[] labPool) public static void SetFunctionInternal(ref LabComponent lab, bool researchMode, int recpId, int techId, SignData[] signPool, LabComponent[] labPool)
{ {
// LabOptPatch.Logger.LogDebug($"SetFunctionInternal: id={lab.id} root={(int)RootLabIdField.GetValue(lab)} research={researchMode} recp={recpId} tech={techId}"); // LabOptPatch.Logger.LogDebug($"SetFunctionInternal: id={lab.id} root={(int)RootLabIdField.GetValue(lab)} research={researchMode} recp={recpId} tech={techId}");
lab.replicating = false; lab.replicating = false;
lab.time = 0; lab.time = 0;
lab.hashBytes = 0; lab.hashBytes = 0;
lab.extraHashBytes = 0; lab.extraHashBytes = 0;
lab.extraTime = 0; lab.extraTime = 0;
lab.extraSpeed = 0; lab.extraSpeed = 0;
lab.extraPowerRatio = 0; lab.extraPowerRatio = 0;
lab.productive = false; lab.productive = false;
if (researchMode) if (researchMode)
{ {
lab.forceAccMode = false; lab.forceAccMode = false;
lab.researchMode = true; lab.researchMode = true;
lab.recipeId = 0; lab.recipeId = 0;
lab.techId = 0; lab.techId = 0;
lab.timeSpend = 0; lab.timeSpend = 0;
lab.extraTimeSpend = 0; lab.extraTimeSpend = 0;
lab.requires = null; lab.requires = null;
lab.requireCounts = null; lab.requireCounts = null;
lab.served = null; lab.served = null;
lab.incServed = null; lab.incServed = null;
lab.products = null; lab.products = null;
lab.productCounts = null; lab.productCounts = null;
lab.produced = null; lab.produced = null;
lab.productive = true; lab.productive = true;
var rootLabId = lab.pcId; var rootLabId = lab.pcId;
if (rootLabId > 0) if (rootLabId > 0)
{ {
@@ -480,29 +480,29 @@ public static class LabOptPatchFunctions
} }
} }
signPool[lab.entityId].iconId0 = (uint)lab.techId; signPool[lab.entityId].iconId0 = (uint)lab.techId;
signPool[lab.entityId].iconType = lab.techId == 0 ? 0U : 3U; signPool[lab.entityId].iconType = lab.techId == 0 ? 0U : 3U;
return; return;
} }
lab.researchMode = false; lab.researchMode = false;
lab.recipeId = 0; lab.recipeId = 0;
lab.techId = 0; lab.techId = 0;
lab.matrixPoints = null; lab.matrixPoints = null;
lab.matrixServed = null; lab.matrixServed = null;
lab.matrixIncServed = null; lab.matrixIncServed = null;
RecipeProto recipeProto = null; RecipeProto recipeProto = null;
if (recpId > 0) if (recpId > 0)
{ {
recipeProto = LDB.recipes.Select(recpId); recipeProto = LDB.recipes.Select(recpId);
} }
if (recipeProto != null && recipeProto.Type == ERecipeType.Research) if (recipeProto != null && recipeProto.Type == ERecipeType.Research)
{ {
lab.recipeId = recipeProto.ID; lab.recipeId = recipeProto.ID;
lab.speed = 10000; lab.speed = 10000;
lab.speedOverride = lab.speed; lab.speedOverride = lab.speed;
lab.timeSpend = recipeProto.TimeSpend * 10000; lab.timeSpend = recipeProto.TimeSpend * 10000;
lab.extraTimeSpend = recipeProto.TimeSpend * 100000; lab.extraTimeSpend = recipeProto.TimeSpend * 100000;
lab.productive = recipeProto.productive; lab.productive = recipeProto.productive;
lab.forceAccMode &= lab.productive; lab.forceAccMode &= lab.productive;
var rootLabId = lab.pcId; var rootLabId = lab.pcId;
if (rootLabId > 0) if (rootLabId > 0)
{ {
@@ -544,26 +544,26 @@ public static class LabOptPatchFunctions
Array.Clear(lab.produced, 0, lab.produced.Length); Array.Clear(lab.produced, 0, lab.produced.Length);
} }
} }
else else
{ {
lab.forceAccMode = false; lab.forceAccMode = false;
lab.recipeId = 0; lab.recipeId = 0;
lab.speed = 0; lab.speed = 0;
lab.speedOverride = 0; lab.speedOverride = 0;
lab.timeSpend = 0; lab.timeSpend = 0;
lab.extraTimeSpend = 0; lab.extraTimeSpend = 0;
lab.requires = null; lab.requires = null;
lab.requireCounts = null; lab.requireCounts = null;
lab.served = null; lab.served = null;
lab.incServed = null; lab.incServed = null;
lab.needs = null; lab.needs = null;
lab.products = null; lab.products = null;
lab.productCounts = null; lab.productCounts = null;
lab.produced = null; lab.produced = null;
} }
signPool[lab.entityId].iconId0 = (uint)lab.recipeId; signPool[lab.entityId].iconId0 = (uint)lab.recipeId;
signPool[lab.entityId].iconType = lab.recipeId == 0 ? 0U : 2U; signPool[lab.entityId].iconType = lab.recipeId == 0 ? 0U : 2U;
} }
public static int InsertIntoLab(PlanetFactory factory, int labId, int itemId, byte itemCount, byte itemInc, ref byte remainInc, int[] needs) public static int InsertIntoLab(PlanetFactory factory, int labId, int itemId, byte itemCount, byte itemInc, ref byte remainInc, int[] needs)
{ {
+1 -1
View File
@@ -3,7 +3,7 @@ using HarmonyLib;
namespace UXAssist.Common; namespace UXAssist.Common;
public class GameLogic: PatchImpl<GameLogic> public class GameLogic : PatchImpl<GameLogic>
{ {
public static Action OnDataLoaded; public static Action OnDataLoaded;
public static Action OnGameBegin; public static Action OnGameBegin;
+3 -2
View File
@@ -13,7 +13,8 @@ public static class FactoryFunctions
// Clear entity connection // Clear entity connection
var factory = cargoTraffic.factory; var factory = cargoTraffic.factory;
factory.ReadObjectConn(belt.entityId, 0, out var isOutput, out var otherObjId, out var otherSlot); factory.ReadObjectConn(belt.entityId, 0, out var isOutput, out var otherObjId, out var otherSlot);
if (isOutput && factory.entityPool[otherObjId].beltId == belt.outputId) { if (isOutput && factory.entityPool[otherObjId].beltId == belt.outputId)
{
factory.ClearObjectConnDirect(belt.entityId, 0); factory.ClearObjectConnDirect(belt.entityId, 0);
factory.ClearObjectConnDirect(otherObjId, otherSlot); factory.ClearObjectConnDirect(otherObjId, otherSlot);
} }
@@ -194,7 +195,7 @@ public static class FactoryFunctions
bpBuildings.Add(new BPBuildingData { building = building, itemType = itemType, offset = offset }); bpBuildings.Add(new BPBuildingData { building = building, itemType = itemType, offset = offset });
} }
} }
HashSet<BlueprintBuilding> beltsWithInput = [..bpBelts.Select(pair => pair.Value.building.outputObj)]; HashSet<BlueprintBuilding> beltsWithInput = [.. bpBelts.Select(pair => pair.Value.building.outputObj)];
var beltHeads = bpBelts.Where(pair => !beltsWithInput.Contains(pair.Value.building)).ToDictionary(pair => pair.Key, pair => pair.Value); var beltHeads = bpBelts.Where(pair => !beltsWithInput.Contains(pair.Value.building)).ToDictionary(pair => pair.Key, pair => pair.Value);
// Sort belt buildings // Sort belt buildings
List<BlueprintBuilding> sortedBpBelts = []; List<BlueprintBuilding> sortedBpBelts = [];
+2 -1
View File
@@ -173,7 +173,8 @@ public static class PlanetFunctions
{ {
ref var warning = ref warningPool[i]; ref var warning = ref warningPool[i];
if (warning.id != i) continue; if (warning.id != i) continue;
switch (warning.factoryId) { switch (warning.factoryId)
{
case -4: case -4:
if (warning.astroId == planetId) if (warning.astroId == planetId)
warningSystem.RemoveWarningData(i); warningSystem.RemoveWarningData(i);
+3 -3
View File
@@ -9,7 +9,7 @@ using GameLogic = UXAssist.Common.GameLogic;
namespace UXAssist.Patches; namespace UXAssist.Patches;
public class DysonSpherePatch: PatchImpl<DysonSpherePatch> public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
{ {
public static ConfigEntry<bool> StopEjectOnNodeCompleteEnabled; public static ConfigEntry<bool> StopEjectOnNodeCompleteEnabled;
public static ConfigEntry<bool> OnlyConstructNodesEnabled; public static ConfigEntry<bool> OnlyConstructNodesEnabled;
@@ -261,7 +261,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
return matcher.InstructionEnumeration(); return matcher.InstructionEnumeration();
} }
private class StopEjectOnNodeComplete: PatchImpl<StopEjectOnNodeComplete> private class StopEjectOnNodeComplete : PatchImpl<StopEjectOnNodeComplete>
{ {
private static HashSet<int>[] _nodeForAbsorb; private static HashSet<int>[] _nodeForAbsorb;
private static bool _initialized; private static bool _initialized;
@@ -492,7 +492,7 @@ public class DysonSpherePatch: PatchImpl<DysonSpherePatch>
} }
[PatchSetCallbackFlag(PatchCallbackFlag.CallOnDisableAfterUnpatch)] [PatchSetCallbackFlag(PatchCallbackFlag.CallOnDisableAfterUnpatch)]
private class OnlyConstructNodes: PatchImpl<OnlyConstructNodes> private class OnlyConstructNodes : PatchImpl<OnlyConstructNodes>
{ {
protected override void OnEnable() protected override void OnEnable()
{ {
+2 -1
View File
@@ -80,7 +80,8 @@ public class GamePatch : PatchImpl<GamePatch>
I18N.Add("Logical frame rate: {0}x", "[UXA] Logical frame rate: {0}x", "[UXA] 逻辑帧速率: {0}x"); I18N.Add("Logical frame rate: {0}x", "[UXA] Logical frame rate: {0}x", "[UXA] 逻辑帧速率: {0}x");
EnableWindowResizeEnabled.SettingChanged += (_, _) => EnableWindowResize.Enable(EnableWindowResizeEnabled.Value); EnableWindowResizeEnabled.SettingChanged += (_, _) => EnableWindowResize.Enable(EnableWindowResizeEnabled.Value);
LoadLastWindowRectEnabled.SettingChanged += (_, _) => { LoadLastWindowRectEnabled.SettingChanged += (_, _) =>
{
if (LoadLastWindowRectEnabled.Value) if (LoadLastWindowRectEnabled.Value)
{ {
FixLastWindowRect(); FixLastWindowRect();
+2 -1
View File
@@ -298,7 +298,8 @@ public static class LogisticsPatch
new CodeMatch(OpCodes.Ldc_I4_1), new CodeMatch(OpCodes.Ldc_I4_1),
new CodeMatch(OpCodes.Call, AccessTools.PropertyGetter(typeof(GameMain), nameof(GameMain.mainPlayer))) new CodeMatch(OpCodes.Call, AccessTools.PropertyGetter(typeof(GameMain), nameof(GameMain.mainPlayer)))
); );
if (matcher.IsValid) { if (matcher.IsValid)
{
matcher.RemoveInstructions(7).InsertAndAdvance( matcher.RemoveInstructions(7).InsertAndAdvance(
new CodeInstruction(OpCodes.Ldc_I4_0) new CodeInstruction(OpCodes.Ldc_I4_0)
); );
+1 -1
View File
@@ -24,7 +24,7 @@ public static class PlanetPatch
PlayerActionsInGlobeView.Enable(false); PlayerActionsInGlobeView.Enable(false);
} }
public class PlayerActionsInGlobeView: PatchImpl<PlayerActionsInGlobeView> public class PlayerActionsInGlobeView : PatchImpl<PlayerActionsInGlobeView>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(VFInput), nameof(VFInput.UpdateGameStates))] [HarmonyPatch(typeof(VFInput), nameof(VFInput.UpdateGameStates))]
+1 -1
View File
@@ -287,7 +287,7 @@ public static class TechPatch
} }
} }
private class BatchBuyoutTech: PatchImpl<BatchBuyoutTech> private class BatchBuyoutTech : PatchImpl<BatchBuyoutTech>
{ {
[HarmonyTranspiler] [HarmonyTranspiler]
[HarmonyPatch(typeof(UITechNode), nameof(UITechNode.UpdateInfoDynamic))] [HarmonyPatch(typeof(UITechNode), nameof(UITechNode.UpdateInfoDynamic))]
+1 -1
View File
@@ -4,7 +4,7 @@ using Common;
using HarmonyLib; using HarmonyLib;
[PatchGuid(PluginInfo.PLUGIN_GUID)] [PatchGuid(PluginInfo.PLUGIN_GUID)]
public class UIPatch: PatchImpl<UIPatch> public class UIPatch : PatchImpl<UIPatch>
{ {
public static void Start() public static void Start()
{ {
+6 -6
View File
@@ -17,12 +17,12 @@ public class MyCheckButton : MonoBehaviour
private static GameObject _baseObject; private static GameObject _baseObject;
private static Color openMouseOverColor; private static Color openMouseOverColor;
private static Color openPressColor; private static Color openPressColor;
private static Color openNormalColor; private static Color openNormalColor;
private static Color closeMouseOverColor; private static Color closeMouseOverColor;
private static Color closePressColor; private static Color closePressColor;
private static Color closeNormalColor; private static Color closeNormalColor;
public static void InitBaseObject() public static void InitBaseObject()
{ {
+3 -3
View File
@@ -228,7 +228,7 @@ public class MyWindow : ManualBehaviour
return comboBox; return comboBox;
} }
#region Slider #region Slider
public class ValueMapper<T> public class ValueMapper<T>
{ {
public virtual int Min => 1; public virtual int Min => 1;
@@ -402,7 +402,7 @@ public class MyWindow : ManualBehaviour
{ {
return AddSideSlider(x, y, parent, config, new ArrayMapper<T>(valueList), format, width); return AddSideSlider(x, y, parent, config, new ArrayMapper<T>(valueList), format, width);
} }
#endregion #endregion
public InputField AddInputField(float x, float y, RectTransform parent, string text = "", int fontSize = 16, string objName = "input", UnityAction<string> onChanged = null, public InputField AddInputField(float x, float y, RectTransform parent, string text = "", int fontSize = 16, string objName = "input", UnityAction<string> onChanged = null,
UnityAction<string> onEditEnd = null) UnityAction<string> onEditEnd = null)
@@ -593,7 +593,7 @@ public abstract class MyWindowManager
} }
*/ */
public class Patch: PatchImpl<Patch> public class Patch : PatchImpl<Patch>
{ {
protected override void OnEnable() protected override void OnEnable()
{ {
+3 -3
View File
@@ -19,15 +19,15 @@ public class UniverseGenTweaks : BaseUnityPlugin, IModCanSave
MoreSettings.Enabled = Config.Bind("MoreSettings", "Enabled", true, "Enable more settings on Universe Generation"); MoreSettings.Enabled = Config.Bind("MoreSettings", "Enabled", true, "Enable more settings on Universe Generation");
MoreSettings.MaxStarCount = Config.Bind("MoreSettings", "MaxStarCount", 128, MoreSettings.MaxStarCount = Config.Bind("MoreSettings", "MaxStarCount", 128,
new ConfigDescription("(32 ~ 1024)\nMaximum star count for Universe Generation, enable MoreSettings.Enabled to take effect", new ConfigDescription("(32 ~ 1024)\nMaximum star count for Universe Generation, enable MoreSettings.Enabled to take effect",
new AcceptableValueRange<int>(32, 1024), new {})); new AcceptableValueRange<int>(32, 1024), new { }));
EpicDifficulty.Enabled = Config.Bind("EpicDifficulty", "Enabled", true, "Enable Epic difficulty"); EpicDifficulty.Enabled = Config.Bind("EpicDifficulty", "Enabled", true, "Enable Epic difficulty");
EpicDifficulty.ResourceMultiplier = Config.Bind("EpicDifficulty", "ResourceMultiplier", 0.01f, EpicDifficulty.ResourceMultiplier = Config.Bind("EpicDifficulty", "ResourceMultiplier", 0.01f,
new ConfigDescription("Resource multiplier for Epic difficulty", new ConfigDescription("Resource multiplier for Epic difficulty",
new AcceptableValueRange<float>(0.0001f, 0.05f), new {})); new AcceptableValueRange<float>(0.0001f, 0.05f), new { }));
EpicDifficulty.OilMultiplier = Config.Bind("EpicDifficulty", "OilMultiplier", 0.5f, EpicDifficulty.OilMultiplier = Config.Bind("EpicDifficulty", "OilMultiplier", 0.5f,
new ConfigDescription("Oil multiplier for Epic difficulty relative to the Very-Hard difficulty", new ConfigDescription("Oil multiplier for Epic difficulty relative to the Very-Hard difficulty",
new AcceptableValueRange<float>(0.1f, 1f), new {})); new AcceptableValueRange<float>(0.1f, 1f), new { }));
BirthPlanetPatch.SitiVeinsOnBirthPlanet = Config.Bind("Birth", "SiTiVeinsOnBirthPlanet", false, BirthPlanetPatch.SitiVeinsOnBirthPlanet = Config.Bind("Birth", "SiTiVeinsOnBirthPlanet", false,
"Silicon/Titanium on birth planet"); "Silicon/Titanium on birth planet");
+1 -1
View File
@@ -8,7 +8,7 @@ using Random = UnityEngine.Random;
namespace UserCloak; namespace UserCloak;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class UserCloak: BaseUnityPlugin public class UserCloak : BaseUnityPlugin
{ {
private static Harmony _patch; private static Harmony _patch;
private static ConfigEntry<int> _mode; private static ConfigEntry<int> _mode;