1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 07:33:40 +08:00

UXAssist: Work in progress

This commit is contained in:
2023-10-10 02:38:24 +08:00
parent 41f2103c11
commit 6caa183cfa
26 changed files with 1477 additions and 1800 deletions

View File

@@ -28,89 +28,27 @@ public class UXAssist : BaseUnityPlugin
private void Awake()
{
Hotkey = Config.Bind("General", "Shortcut", KeyboardShortcut.Deserialize("BackQuote + LeftAlt"), "Shortcut to open config window");
/*
DevShortcuts.Enabled = Config.Bind("General", "DevShortcuts", false, "Enable DevMode shortcuts");
AbnormalDisabler.Enabled = Config.Bind("General", "DisableAbnormalChecks", false,
"disable all abnormal checks");
TechPatch.Enabled = Config.Bind("General", "UnlockTech", false,
"Unlock clicked tech by holding key-modifilers(Shift/Alt/Ctrl)");
FactoryPatch.ImmediateEnabled = Config.Bind("Build", "ImmediateBuild", false,
"Build immediately");
FactoryPatch.ArchitectModeEnabled = Config.Bind("Build", "Architect", false,
"Architect Mode");
FactoryPatch.UnlimitInteractiveEnabled = Config.Bind("Build", "UnlimitInteractive", false,
FactoryPatch.UnlimitInteractiveEnabled = Config.Bind("Factory", "UnlimitInteractive", false,
"Unlimit interactive range");
FactoryPatch.RemoveSomeConditionEnabled = Config.Bind("Build", "RemoveSomeBuildConditionCheck", false,
FactoryPatch.RemoveSomeConditionEnabled = Config.Bind("Factory", "RemoveSomeBuildConditionCheck", false,
"Remove part of build condition checks that does not affect game logic");
FactoryPatch.NoConditionEnabled = Config.Bind("Build", "BuildWithoutCondition", false,
"Build without condition");
FactoryPatch.NoCollisionEnabled = Config.Bind("Build", "NoCollision", false,
"No collision");
FactoryPatch.BeltSignalGeneratorEnabled = Config.Bind("Build", "BeltSignalGenerator", false,
"Belt signal generator");
FactoryPatch.BeltSignalNumberAltFormat = Config.Bind("Build", "BeltSignalNumberFormat", false,
"Belt signal number format alternative format (AAAA=generation speed in minutes, B=proliferate points, C=stack count):\n AAAABC by default\n BCAAAA as alternative");
FactoryPatch.BeltSignalCountRecipeEnabled = Config.Bind("Build", "BeltSignalCountRecipe", false,
"Belt signal count all raws and intermediates in statistics");
FactoryPatch.NightLightEnabled = Config.Bind("Build", "NightLight", false,
FactoryPatch.NightLightEnabled = Config.Bind("Factory", "NightLight", false,
"Night light");
FactoryPatch.RemovePowerSpaceLimitEnabled = Config.Bind("Build", "RemovePowerDistanceLimit", false,
"Remove distance limit for wind turbines and geothermals");
FactoryPatch.BoostWindPowerEnabled = Config.Bind("Build", "BoostWindPower", false,
"Boost wind power");
FactoryPatch.BoostSolarPowerEnabled = Config.Bind("Build", "BoostSolarPower", false,
"Boost solar power");
FactoryPatch.BoostFuelPowerEnabled = Config.Bind("Build", "BoostFuelPower", false,
"Boost fuel power");
FactoryPatch.BoostGeothermalPowerEnabled = Config.Bind("Build", "BoostGeothermalPower", false,
"Boost geothermal power");
PlanetFunctions.PlayerActionsInGlobeViewEnabled = Config.Bind("Planet", "PlayerActionsInGlobeView", false,
PlanetPatch.PlayerActionsInGlobeViewEnabled = Config.Bind("Planet", "PlayerActionsInGlobeView", false,
"Enable player actions in globe view");
ResourcePatch.InfiniteResourceEnabled = Config.Bind("Planet", "AlwaysInfiniteResource", false,
"always infinite natural resource");
ResourcePatch.FastMiningEnabled = Config.Bind("Planet", "FastMining", false,
"super-fast mining speed");
WaterPumperPatch.Enabled = Config.Bind("Planet", "WaterPumpAnywhere", false,
"Can pump water anywhere (while water type is not None)");
TerraformPatch.Enabled = Config.Bind("Planet", "TerraformAnyway", false,
"Can do terraform without enough sands");
FactoryPatch.RemoveBuildRangeLimitEnabled = Config.Bind("Factory", "RemoveBuildRangeLimit", false,
"Remove limit for build range and maximum count of drag building belts/buildings\nNote: this does not affect range limit for mecha drones' action");
FactoryPatch.LargerAreaForUpgradeAndDismantleEnabled = Config.Bind("Factory", "LargerAreaForUpgradeAndDismantle", false,
"Increase maximum area size for upgrade and dismantle to 31x31 (from 11x11)");
FactoryPatch.LargerAreaForTerraformEnabled = Config.Bind("Factory", "LargerAreaForTerraform", false,
"Increase maximum area size for terraform to 30x30 (from 10x10)\nNote: this may impact game performance while using large area");
PlayerPatch.EnhancedMechaForgeCountControlEnabled = Config.Bind("Player", "EnhancedMechaForgeCountControl", false,
"Enhanced count control for hand-make, increases maximum of count to 1000, and you can hold Ctrl/Shift/Alt to change the count rapidly");
DysonSpherePatch.StopEjectOnNodeCompleteEnabled = Config.Bind("DysonSphere", "StopEjectOnNodeComplete", false,
"Stop ejectors when available nodes are all filled up");
DysonSpherePatch.OnlyConstructNodesEnabled = Config.Bind("DysonSphere", "OnlyConstructNodes", false,
"Construct only nodes but frames");
DysonSpherePatch.SkipBulletEnabled = Config.Bind("DysonSphere", "SkipBullet", false,
"Skip bullet");
DysonSpherePatch.SkipAbsorbEnabled = Config.Bind("DysonSphere", "SkipAbsorb", false,
"Skip absorption");
DysonSpherePatch.QuickAbsorbEnabled = Config.Bind("DysonSphere", "QuickAbsorb", false,
"Quick absorb");
DysonSpherePatch.EjectAnywayEnabled = Config.Bind("DysonSphere", "EjectAnyway", false,
"Eject anyway");
DysonSpherePatch.OverclockEjectorEnabled = Config.Bind("DysonSphere", "OverclockEjector", false,
"Overclock ejector");
DysonSpherePatch.OverclockSiloEnabled = Config.Bind("DysonSphere", "OverclockSilo", false,
"Overclock silo");
BirthPlanetPatch.SitiVeinsOnBirthPlanet = Config.Bind("Birth", "SiTiVeinsOnBirthPlanet", false,
"Silicon/Titanium on birth planet");
BirthPlanetPatch.FireIceOnBirthPlanet = Config.Bind("Birth", "FireIceOnBirthPlanet", false,
"Fire ice on birth planet");
BirthPlanetPatch.KimberliteOnBirthPlanet = Config.Bind("Birth", "KimberliteOnBirthPlanet", false,
"Kimberlite on birth planet");
BirthPlanetPatch.FractalOnBirthPlanet = Config.Bind("Birth", "FractalOnBirthPlanet", false,
"Fractal silicon on birth planet");
BirthPlanetPatch.OrganicOnBirthPlanet = Config.Bind("Birth", "OrganicOnBirthPlanet", false,
"Organic crystal on birth planet");
BirthPlanetPatch.OpticalOnBirthPlanet = Config.Bind("Birth", "OpticalOnBirthPlanet", false,
"Optical grating crystal on birth planet");
BirthPlanetPatch.SpiniformOnBirthPlanet = Config.Bind("Birth", "SpiniformOnBirthPlanet", false,
"Spiniform stalagmite crystal on birth planet");
BirthPlanetPatch.UnipolarOnBirthPlanet = Config.Bind("Birth", "UnipolarOnBirthPlanet", false,
"Unipolar magnet on birth planet");
BirthPlanetPatch.FlatBirthPlanet = Config.Bind("Birth", "FlatBirthPlanet", false,
"Birth planet is solid flat (no water at all)");
BirthPlanetPatch.HighLuminosityBirthStar = Config.Bind("Birth", "HighLuminosityBirthStar", false,
"Birth star has high luminosity");
*/
I18N.Init();
I18N.Add("UXAssist Config", "UXAssist Config", "UX助手设置");
I18N.Apply();
@@ -120,34 +58,19 @@ public class UXAssist : BaseUnityPlugin
_patch ??= Harmony.CreateAndPatchAll(typeof(UXAssist));
UIConfigWindow.Init();
/*
DevShortcuts.Init();
AbnormalDisabler.Init();
TechPatch.Init();
FactoryPatch.Init();
PlanetFunctions.Init();
ResourcePatch.Init();
WaterPumperPatch.Init();
TerraformPatch.Init();
PlanetPatch.Init();
PlayerPatch.Init();
DysonSpherePatch.Init();
BirthPlanetPatch.Init();
*/
}
private void OnDestroy()
{
/*
BirthPlanetPatch.Uninit();
DysonSpherePatch.Uninit();
TerraformPatch.Uninit();
WaterPumperPatch.Uninit();
ResourcePatch.Uninit();
PlanetFunctions.Uninit();
PlayerPatch.Uninit();
PlanetPatch.Uninit();
FactoryPatch.Uninit();
TechPatch.Uninit();
AbnormalDisabler.Uninit();
DevShortcuts.Uninit();
*/
_patch?.UnpatchSelf();
_patch = null;
_windowPatch?.UnpatchSelf();
@@ -159,12 +82,12 @@ public class UXAssist : BaseUnityPlugin
if (VFInput.inputing) return;
if (Hotkey.Value.IsDown()) ToggleConfigWindow();
}
/*
private void LateUpdate()
{
FactoryPatch.NightLight.LateUpdate();
}
*/
[HarmonyPostfix, HarmonyPatch(typeof(UIRoot), nameof(UIRoot.OpenMainMenuUI))]
public static void UIRoot_OpenMainMenuUI_Postfix()
{