mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-02-04 20:22:17 +08:00
Compare commits
3 Commits
ab7154bed6
...
0efb7ba14d
| Author | SHA1 | Date | |
|---|---|---|---|
| 0efb7ba14d | |||
| e1d0eac73d | |||
| 17aca89249 |
@@ -87,6 +87,8 @@ public class CheatEnabler : BaseUnityPlugin
|
|||||||
"Unlock Dyson Sphere max orbit radius");
|
"Unlock Dyson Sphere max orbit radius");
|
||||||
DysonSpherePatch.UnlockMaxOrbitRadiusValue = Config.Bind("DysonSphere", "MaxOrbitRadiusValue", 10_000_000f,
|
DysonSpherePatch.UnlockMaxOrbitRadiusValue = Config.Bind("DysonSphere", "MaxOrbitRadiusValue", 10_000_000f,
|
||||||
"Unlocked Dyson Sphere max orbit radius value");
|
"Unlocked Dyson Sphere max orbit radius value");
|
||||||
|
Functions.DysonSphereFunctions.ShellsCountForFunctions = Config.Bind("DysonSphere", "ShellsCountForFunctions", 2048,
|
||||||
|
"Shells count for various functions");
|
||||||
CombatPatch.MechaInvincibleEnabled = Config.Bind("Battle", "MechaInvincible", false,
|
CombatPatch.MechaInvincibleEnabled = Config.Bind("Battle", "MechaInvincible", false,
|
||||||
"Mecha and Drones/Fleets invincible");
|
"Mecha and Drones/Fleets invincible");
|
||||||
CombatPatch.BuildingsInvincibleEnabled = Config.Bind("Battle", "BuildingsInvincible", false,
|
CombatPatch.BuildingsInvincibleEnabled = Config.Bind("Battle", "BuildingsInvincible", false,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -67,6 +67,7 @@ public static class UIConfigWindow
|
|||||||
I18N.Add("Overclock Ejectors", "Overclock Ejectors (10x)", "高速弹射器(10倍射速)");
|
I18N.Add("Overclock Ejectors", "Overclock Ejectors (10x)", "高速弹射器(10倍射速)");
|
||||||
I18N.Add("Overclock Silos", "Overclock Silos (10x)", "高速发射井(10倍射速)");
|
I18N.Add("Overclock Silos", "Overclock Silos (10x)", "高速发射井(10倍射速)");
|
||||||
I18N.Add("Unlock Dyson Sphere max orbit radius", "Unlock Dyson Sphere max orbit radius", "解锁戴森球最大轨道半径");
|
I18N.Add("Unlock Dyson Sphere max orbit radius", "Unlock Dyson Sphere max orbit radius", "解锁戴森球最大轨道半径");
|
||||||
|
I18N.Add("Generate tricky dyson shells", "Generate tricky dyson shells (Put/Paste nodes first)", "生成仙术戴森壳(请先设置/粘贴节点)");
|
||||||
I18N.Add("Complete Dyson Sphere shells instantly", "Complete Dyson Sphere shells instantly", "立即完成戴森壳建造");
|
I18N.Add("Complete Dyson Sphere shells instantly", "Complete Dyson Sphere shells instantly", "立即完成戴森壳建造");
|
||||||
I18N.Add("Terraform without enough soil piles", "Terraform without enough soil piles", "沙土不够时依然可以整改地形");
|
I18N.Add("Terraform without enough soil piles", "Terraform without enough soil piles", "沙土不够时依然可以整改地形");
|
||||||
I18N.Add("Instant hand-craft", "Instant hand-craft", "快速手动制造");
|
I18N.Add("Instant hand-craft", "Instant hand-craft", "快速手动制造");
|
||||||
@@ -101,6 +102,37 @@ public static class UIConfigWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ShellsCountMapper : MyWindow.RangeValueMapper<int>
|
||||||
|
{
|
||||||
|
public ShellsCountMapper() : base(1, 139)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int ValueToIndex(int value)
|
||||||
|
{
|
||||||
|
return value switch
|
||||||
|
{
|
||||||
|
< 4 => value,
|
||||||
|
< 64 => value / 4 + 3,
|
||||||
|
< 256 => value / 16 + 15,
|
||||||
|
< 4096 => value / 64 + 27,
|
||||||
|
_ => value / 256 + 75,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int IndexToValue(int index)
|
||||||
|
{
|
||||||
|
return index switch
|
||||||
|
{
|
||||||
|
< 4 => index,
|
||||||
|
< 19 => (index - 3) * 4,
|
||||||
|
< 31 => (index - 15) * 16,
|
||||||
|
< 91 => (index - 27) * 64,
|
||||||
|
_ => (index - 75) * 256,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void CreateUI(MyConfigWindow wnd, RectTransform trans)
|
private static void CreateUI(MyConfigWindow wnd, RectTransform trans)
|
||||||
{
|
{
|
||||||
_windowTrans = trans;
|
_windowTrans = trans;
|
||||||
@@ -166,7 +198,6 @@ public static class UIConfigWindow
|
|||||||
FactoryPatch.BeltSignalGeneratorEnabled.SettingChanged += OnBeltSignalChanged;
|
FactoryPatch.BeltSignalGeneratorEnabled.SettingChanged += OnBeltSignalChanged;
|
||||||
wnd.OnFree += () => { FactoryPatch.BeltSignalGeneratorEnabled.SettingChanged -= OnBeltSignalChanged; };
|
wnd.OnFree += () => { FactoryPatch.BeltSignalGeneratorEnabled.SettingChanged -= OnBeltSignalChanged; };
|
||||||
OnBeltSignalChanged(null, null);
|
OnBeltSignalChanged(null, null);
|
||||||
|
|
||||||
void OnBeltSignalChanged(object o, EventArgs e)
|
void OnBeltSignalChanged(object o, EventArgs e)
|
||||||
{
|
{
|
||||||
var on = FactoryPatch.BeltSignalGeneratorEnabled.Value;
|
var on = FactoryPatch.BeltSignalGeneratorEnabled.Value;
|
||||||
@@ -260,12 +291,16 @@ public static class UIConfigWindow
|
|||||||
{
|
{
|
||||||
slider.slider.enabled = DysonSpherePatch.UnlockMaxOrbitRadiusEnabled.Value;
|
slider.slider.enabled = DysonSpherePatch.UnlockMaxOrbitRadiusEnabled.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
x = 300f;
|
x = 300f;
|
||||||
y = 10f;
|
y = 10f;
|
||||||
wnd.AddButton(x, y, 300f, tab4, "Complete Dyson Sphere shells instantly", 16, "button-complete-dyson-sphere-shells-instantly", DysonSphereFunctions.CompleteShellsInstantly);
|
wnd.AddButton(x, y, 300f, tab4, "Complete Dyson Sphere shells instantly", 16, "button-complete-dyson-sphere-shells-instantly", DysonSphereFunctions.CompleteShellsInstantly);
|
||||||
|
y += 36f;
|
||||||
|
wnd.AddButton(x, y, 300f, tab4, "Keep max production shells and remove others", 16, "button-keep-max-production-shells", DysonSphereFunctions.KeepMaxProductionShells);
|
||||||
|
y += 36f;
|
||||||
|
wnd.AddButton(x, y, 300f, tab4, "Duplicate first shell", 16, "button-duplicate-first-shell", DysonSphereFunctions.DuplicateFirstShell);
|
||||||
|
y += 30f;
|
||||||
|
wnd.AddSlider(x + 20f, y, tab4, DysonSphereFunctions.ShellsCountForFunctions, new ShellsCountMapper());
|
||||||
|
|
||||||
var tab5 = wnd.AddTab(_windowTrans, "Mecha/Combat");
|
var tab5 = wnd.AddTab(_windowTrans, "Mecha/Combat");
|
||||||
x = 0f;
|
x = 0f;
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public static class PlanetFunctions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var planetId = planet.id;
|
||||||
var gameScenario = GameMain.gameScenario;
|
var gameScenario = GameMain.gameScenario;
|
||||||
if (gameScenario != null)
|
if (gameScenario != null)
|
||||||
{
|
{
|
||||||
@@ -153,8 +154,8 @@ public static class PlanetFunctions
|
|||||||
{
|
{
|
||||||
if (pgc.id <= 0) continue;
|
if (pgc.id <= 0) continue;
|
||||||
int protoId = factory.entityPool[pgc.entityId].protoId;
|
int protoId = factory.entityPool[pgc.entityId].protoId;
|
||||||
gameScenario.achievementLogic.NotifyBeforeDismantleEntity(planet.id, protoId, pgc.entityId);
|
gameScenario.achievementLogic.NotifyBeforeDismantleEntity(planetId, protoId, pgc.entityId);
|
||||||
gameScenario.NotifyOnDismantleEntity(planet.id, protoId, pgc.entityId);
|
gameScenario.NotifyOnDismantleEntity(planetId, protoId, pgc.entityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,10 +169,22 @@ public static class PlanetFunctions
|
|||||||
var index = factory.index;
|
var index = factory.index;
|
||||||
var warningSystem = GameMain.data.warningSystem;
|
var warningSystem = GameMain.data.warningSystem;
|
||||||
var warningPool = warningSystem.warningPool;
|
var warningPool = warningSystem.warningPool;
|
||||||
for (var i = warningSystem.warningCursor - 1; i > 0; i--)
|
for (var i = warningSystem.warningCursor - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (warningPool[i].id == i && warningPool[i].factoryId == index)
|
ref var warning = ref warningPool[i];
|
||||||
warningSystem.RemoveWarningData(warningPool[i].id);
|
if (warning.id != i) continue;
|
||||||
|
switch (warning.factoryId) {
|
||||||
|
case -4:
|
||||||
|
if (warning.astroId == planetId)
|
||||||
|
warningSystem.RemoveWarningData(i);
|
||||||
|
break;
|
||||||
|
case >= 0:
|
||||||
|
if (warning.factoryId == index)
|
||||||
|
warningSystem.RemoveWarningData(i);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var isCombatMode = factory.gameData.gameDesc.isCombatMode;
|
var isCombatMode = factory.gameData.gameDesc.isCombatMode;
|
||||||
factory.entityCursor = 1;
|
factory.entityCursor = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user