Decompiled source of UXAssist v1.3.5
UXAssist.dll
Decompiled 5 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using System.Xml; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CommonAPI; using CommonAPI.Systems; using HarmonyLib; using Microsoft.CodeAnalysis; using UXAssist.Common; using UXAssist.Functions; using UXAssist.ModsCompat; using UXAssist.Patches; using UXAssist.UI; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Serialization; using UnityEngine.UI; using crecheng.DSPModSave; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("UXAssist")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("DSP MOD - UXAssist")] [assembly: AssemblyFileVersion("1.3.5.0")] [assembly: AssemblyInformationalVersion("1.3.5+7bd8abe7e635501893e1143f8556f769d53f7179")] [assembly: AssemblyProduct("UXAssist")] [assembly: AssemblyTitle("UXAssist")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.5.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NativeIntegerAttribute : Attribute { public readonly bool[] TransformFlags; public NativeIntegerAttribute() { TransformFlags = new bool[1] { true }; } public NativeIntegerAttribute(bool[] P_0) { TransformFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace UXAssist { public static class UIConfigWindow { private class OcMapper : MyWindow.ValueMapper<int> { public override int Min => 0; public override int Max => 40; public override string FormatValue(string format, int value) { if (value != 0) { return base.FormatValue(format, value); } return Localization.Translate("max"); } } private class AngleMapper : MyWindow.ValueMapper<float> { public override int Min => 0; public override int Max => 20; public override float IndexToValue(int index) { return (float)index - 10f; } public override int ValueToIndex(float value) { return Mathf.RoundToInt(value + 10f); } } private class DistanceMapper : MyWindow.ValueMapper<double> { public override int Min => 1; public override int Max => 40; public override double IndexToValue(int index) { return (double)index * 0.5; } public override int ValueToIndex(double value) { return Mathf.RoundToInt((float)(value * 2.0)); } } private class UpsMapper : MyWindow.ValueMapper<double> { public override int Min => 1; public override int Max => 100; public override double IndexToValue(int index) { return (double)index * 0.1; } public override int ValueToIndex(double value) { return Mathf.RoundToInt((float)(value * 10.0)); } } private class AutoConfigDispenserChargePowerMapper : MyWindow.RangeValueMapper<int> { public AutoConfigDispenserChargePowerMapper() : base(3, 30) { } public override string FormatValue(string format, int value) { StringBuilder stringBuilder = new StringBuilder(" "); StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 300000L, false); stringBuilder.Append('W'); return stringBuilder.ToString().Trim(); } } private class AutoConfigBattleBaseChargePowerMapper : MyWindow.RangeValueMapper<int> { public AutoConfigBattleBaseChargePowerMapper() : base(4, 40) { } public override string FormatValue(string format, int value) { StringBuilder stringBuilder = new StringBuilder(" "); StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 300000L, false); stringBuilder.Append('W'); return stringBuilder.ToString().Trim(); } } private class AutoConfigPLSChargePowerMapper : MyWindow.RangeValueMapper<int> { public AutoConfigPLSChargePowerMapper() : base(2, 20) { } public override string FormatValue(string format, int value) { StringBuilder stringBuilder = new StringBuilder(" "); StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 3000000L, false); stringBuilder.Append('W'); return stringBuilder.ToString().Trim(); } } private class AutoConfigCarrierMinDeliverMapper : MyWindow.RangeValueMapper<int> { public AutoConfigCarrierMinDeliverMapper() : base(0, 10) { } public override string FormatValue(string format, int value) { return ((value == 0) ? 1 : (value * 10)).ToString("0\\%"); } } private class AutoConfigMinPilerValueMapper : MyWindow.RangeValueMapper<int> { public AutoConfigMinPilerValueMapper() : base(0, 4) { } public override string FormatValue(string format, int value) { if (value != 0) { return value.ToString(); } return Localization.Translate("集装使用科技上限").Trim(); } } private class AutoConfigILSChargePowerMapper : MyWindow.RangeValueMapper<int> { public AutoConfigILSChargePowerMapper() : base(2, 20) { } public override string FormatValue(string format, int value) { StringBuilder stringBuilder = new StringBuilder(" "); StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 15000000L, false); stringBuilder.Append('W'); return stringBuilder.ToString().Trim(); } } private class AutoConfigILSMaxTripShipMapper : MyWindow.RangeValueMapper<int> { public AutoConfigILSMaxTripShipMapper() : base(1, 41) { } public override string FormatValue(string format, int value) { if (value > 20) { if (value <= 40) { return (value * 2 - 20).ToString("0LY"); } return "∞"; } return value.ToString("0LY"); } } private class AutoConfigILSWarperDistanceMapper : MyWindow.RangeValueMapper<int> { public AutoConfigILSWarperDistanceMapper() : base(2, 21) { } public override string FormatValue(string format, int value) { if (value <= 16) { if (value > 7) { if (value <= 13) { return ((double)value - 4.0).ToString("0.0AU"); } return (value - 4).ToString("0AU"); } return ((double)value * 0.5 - 0.5).ToString("0.0AU"); } if (value <= 20) { return (value * 2 - 20).ToString("0AU"); } return "60AU"; } } private class AutoConfigVeinCollectorHarvestSpeedMapper : MyWindow.RangeValueMapper<int> { public AutoConfigVeinCollectorHarvestSpeedMapper() : base(0, 20) { } public override string FormatValue(string format, int value) { return (100 + value * 10).ToString("0\\%"); } } [CompilerGenerated] private static class <>O { public static Action<MyConfigWindow, RectTransform> <0>__CreateUI; public static Action <1>__UpdateUI; public static UnityAction <2>__ShowCPUInfo; public static UnityAction <3>__BuildOrbitalCollectors; public static UnityAction <4>__RemoveCargoStackingTechs; public static UnityAction <5>__UnlockAllProtoWithMetadataAndPrompt; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__18_4; public static Response <>9__18_9; public static UnityAction <>9__18_0; public static Response <>9__18_10; public static UnityAction <>9__18_1; public static Response <>9__18_18; public static UnityAction <>9__18_2; public static UnityAction <>9__18_3; internal void <CreateUI>b__18_4() { GamePatch.GameUpsFactor.Value = 1.0; } internal void <CreateUI>b__18_0() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown string text = Localization.Translate("Initialize This Planet"); string text2 = Localization.Translate("Initialize This Planet Confirm"); string text3 = Localization.Translate("取消"); string text4 = Localization.Translate("确定"); object obj = <>9__18_9; if (obj == null) { Response val = delegate { PlanetFunctions.RecreatePlanet(revertReform: true); }; <>9__18_9 = val; obj = (object)val; } UIMessageBox.Show(text, text2, text3, text4, 2, (Response)null, (Response)obj); } internal void <CreateUI>b__18_9() { PlanetFunctions.RecreatePlanet(revertReform: true); } internal void <CreateUI>b__18_1() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown string text = Localization.Translate("Dismantle All Buildings"); string text2 = Localization.Translate("Dismantle All Buildings Confirm"); string text3 = Localization.Translate("取消"); string text4 = Localization.Translate("确定"); object obj = <>9__18_10; if (obj == null) { Response val = delegate { PlanetFunctions.DismantleAll(toBag: false); }; <>9__18_10 = val; obj = (object)val; } UIMessageBox.Show(text, text2, text3, text4, 2, (Response)null, (Response)obj); } internal void <CreateUI>b__18_10() { PlanetFunctions.DismantleAll(toBag: false); } internal void <CreateUI>b__18_2() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown string text = Localization.Translate("Initialize Dyson Sphere"); string text2 = Localization.Translate("Initialize Dyson Sphere Confirm"); string text3 = Localization.Translate("取消"); string text4 = Localization.Translate("确定"); object obj = <>9__18_18; if (obj == null) { Response val = delegate { DysonSphereFunctions.InitCurrentDysonLayer(null, -1); }; <>9__18_18 = val; obj = (object)val; } UIMessageBox.Show(text, text2, text3, text4, 2, (Response)null, (Response)obj); } internal void <CreateUI>b__18_18() { DysonSphereFunctions.InitCurrentDysonLayer(null, -1); } internal void <CreateUI>b__18_3() { GameData data = GameMain.data; if (data != null && data.gameDesc.isCombatMode) { UIGame uiGame = UIRoot.instance.uiGame; uiGame.ShutPlayerInventory(); uiGame.CloseEnemyBriefInfo(); uiGame.OpenCommunicatorWindow(5); } } } private static RectTransform _windowTrans; private static RectTransform _dysonTab; private static UIButton _dysonInitBtn; private static readonly UIButton[] DysonLayerBtn = (UIButton[])(object)new UIButton[10]; public static void Init() { I18N.Add("UXAssist", "UXAssist", "UX助手"); I18N.Add("General", "General", "常规"); I18N.Add("Factory", "Factory", "工厂"); I18N.Add("Logistics", "Logistics", "物流"); I18N.Add("Player/Mecha", "Player/Mecha", "玩家/机甲"); I18N.Add("Dyson Sphere", "Dyson Sphere", "戴森球"); I18N.Add("Tech/Combat", "Tech/Combat", "科研/战斗"); I18N.Add("Enable game window resize", "Enable game window resize (maximum box and thick frame)", "可调整游戏窗口大小(可最大化和拖动边框)"); I18N.Add("Remeber window position and size on last exit", "Remeber window position and size on last exit", "记住上次退出时的窗口位置和大小"); I18N.Add("Scale up mouse cursor", "Scale up mouse cursor", "放大鼠标指针"); I18N.Add("Convert old saves to Combat Mode on loading", "Convert old saves to Combat Mode on loading (Use settings in new game panel)", "读取旧档时转为战斗模式(使用新游戏面板的战斗难度设置)"); I18N.Add("Profile-based save folder", "Mod manager profile based save folder", "基于mod管理器配置档案名的存档文件夹"); I18N.Add("Profile-based save folder tips", "Save files are stored in 'Save\\<ProfileName>' folder.\nWill use original save location if matching default profile name", "存档文件会存储在'Save\\<ProfileName>'文件夹中\n如果匹配默认配置档案名则使用原始存档位置"); I18N.Add("Profile-based option", "Mod manager profile based option", "基于mod管理器配置档案名的选项设置"); I18N.Add("Profile-based option tips", "Options are stored in 'Option\\<ProfileName>.xml'.\nWill use original location if matching default profile name", "配置选项会存储在'Option\\<ProfileName>.xml'里\n如果匹配默认配置档案名则使用原始位置"); I18N.Add("Default profile name", "Default profile name", "默认配置档案名"); I18N.Add("Logical Frame Rate", "Logical Frame Rate", "逻辑帧倍率"); I18N.Add("Reset", "Reset", "重置"); I18N.Add("Process priority", "Process priority", "进程优先级"); I18N.Add("High", "High", "高"); I18N.Add("Above Normal", "Above Normal", "高于正常"); I18N.Add("Normal", "Normal", "正常"); I18N.Add("Below Normal", "Below Normal", "低于正常"); I18N.Add("Idle", "Idle", "空闲"); I18N.Add("Enabled CPUs", "Enabled CPU Threads", "使用CPU线程"); I18N.Add("All CPUs", "All CPUs", "所有CPU"); I18N.Add("First {0} CPUs", "First {0} CPUs", "前{0}个CPU"); I18N.Add("First 8 CPUs", "First 8 CPUs", "前8个CPU"); I18N.Add("First CPU only", "First CPU only", "仅第一个CPU"); I18N.Add("All P-Cores", "All P-Cores", "所有性能(P)核心"); I18N.Add("All E-Cores", "All E-Cores", "所有能效(E)核心"); I18N.Add("CPU Info", "CPU Info", "CPU信息"); I18N.Add("Unlimited interactive range", "Unlimited interactive range", "无限交互距离"); I18N.Add("Night Light", "Sunlight at night", "夜间日光灯"); I18N.Add("Angle X:", "Angle X:", "入射角度X:"); I18N.Add("Remove some build conditions", "Remove some build conditions", "移除部分不影响游戏逻辑的建造条件"); I18N.Add("Remove build range limit", "Remove build count and range limit", "移除建造数量和距离限制"); I18N.Add("Larger area for upgrade and dismantle", "Larger area for upgrade and dismantle", "范围升级和拆除的最大区域扩大"); I18N.Add("Larger area for terraform", "Larger area for terraform", "范围铺设地基的最大区域扩大"); I18N.Add("Off-grid building and stepped rotation", "Off-grid building and stepped rotation (Hold Shift)", "脱离网格建造以及小角度旋转(按住Shift)"); I18N.Add("Enable player actions in globe view", "Enable player actions in globe view", "在行星视图中允许玩家操作"); I18N.Add("Hide tips for soil piles changes", "Hide tips for soil piles changes", "隐藏沙土数量变动的提示"); I18N.Add("Enhanced count control for hand-make", "Enhanced count control for hand-make", "手动制造物品的数量控制改进"); I18N.Add("Enhanced count control for hand-make tips", "Maximum count is increased to 1000.\nHold Ctrl/Shift/Alt to change the count rapidly.", "最大数量提升至1000\n按住Ctrl/Shift/Alt可快速改变数量"); I18N.Add("Quick build and dismantle stacking labs", "Quick build and dismantle stacking labs/storages/tanks(hold shift)", "快速建造和拆除堆叠研究站/储物仓/储液罐(按住shift)"); I18N.Add("Fast fill in to and take out from tanks", "Fast fill in to and take out from tanks", "储液罐快速注入和抽取液体"); I18N.Add("Speed Ratio", "Speed Ratio", "速度倍率"); I18N.Add("Cut conveyor belt (with shortcut key)", "Cut conveyor belt (with shortcut key)", "切割传送带(使用快捷键)"); I18N.Add("Protect veins from exhaustion", "Protect veins from exhaustion", "保护矿脉不会耗尽"); I18N.Add("Protect veins from exhaustion tips", "By default, the vein amount is protected at 100, and oil speed is protected at 1.0/s, you can set them yourself in config file.\nWhen reach the protection value, veins/oils steeps will not be mined/extracted any longer.\nClose this function to resume mining and pumping, usually when you have enough level on `Veins Utilization`", "默认矿脉数量保护于剩余100,采油速保护于速度1.0/s,你可以在配置文件中自行设置。\n当达到保护值时,矿脉和油井将不再被开采。\n关闭此功能以恢复开采,一般是当你在`矿物利用`上有足够的等级时。\n"); I18N.Add("Do not render factory entities", "Do not render factory entities (except belts and sorters)", "不渲染工厂建筑实体(除了传送带和分拣器)"); I18N.Add("Drag building power poles in maximum connection range", "Drag building power poles in maximum connection range", "拖动建造电线杆时自动使用最大连接距离间隔"); I18N.Add("Build Tesla Tower and Wireless Power Tower alternately", "Build Tesla Tower and Wireless Power Tower alternately", "交替建造电力感应塔和无线输电塔"); I18N.Add("Belt signals for buy out dark fog items automatically", "Belt signals for buy out dark fog items automatically", "用于自动购买黑雾物品的传送带信号"); I18N.Add("Auto-config logistic stations", "Auto-config logistic stations", "自动配置物流设施"); I18N.Add("Limit auto-replenish count to values below", "Limit auto-replenish count to values below", "限制自动补充数量为下面配置的值"); I18N.Add("Dispenser", "Logistics Distributor", "物流配送器"); I18N.Add("Battlefield Analysis Base", "Battlefield Analysis Base", "战场分析基站"); I18N.Add("PLS", "PLS", "行星物流站"); I18N.Add("ILS", "ILS", "星际物流站"); I18N.Add("Advanced Mining Machine", "Advanced Mining Machine", "大型采矿机"); I18N.Add("Max. Charging Power", "Max. Charging Power", "最大充能功率"); I18N.Add("Count of Bots filled", "Count of Bots filled", "填充的配送机数量"); I18N.Add("Drone transport range", "Drone transport range", "运输机最远路程"); I18N.Add("Min. Load of Drones", "Min. Load of Drones", "运输机起送量"); I18N.Add("Outgoing integration count", "Outgoing integration count", "输出货物集装数量"); I18N.Add("Count of Drones filled", "Count of Drones filled", "填充的运输机数量"); I18N.Add("Vessel transport range", "Vessel transport range", "运输船最远路程"); I18N.Add("Warp distance", "Warp distance", "曲速启用路程"); I18N.Add("Min. Load of Vessels", "Min. Load of Vessels", "运输船起送量"); I18N.Add("Outgoing integration count", "Outgoing integration count", "输出货物集装数量"); I18N.Add("Include Orbital Collector", "Include Orbital Collector", "包含轨道采集器"); I18N.Add("Warpers required", "Warpers required", "翘曲器必备"); I18N.Add("Count of Vessels filled", "Count of Vessels filled", "填充的运输船数量"); I18N.Add("Collecting Speed", "Collecting Speed", "开采速度"); I18N.Add("Min. Piler Value", "Outgoing integration count", "输出货物集装数量"); I18N.Add("Allow overflow for Logistic Stations and Advanced Mining Machines", "Allow overflow for Logistic Stations and Advanced Mining Machines", "允许物流站和大型采矿机物品溢出"); I18N.Add("Enhance control for logistic storage capacities", "Enhance control for logistic storage capacities", "物流塔存储容量控制改进"); I18N.Add("Enhance control for logistic storage capacities tips", "Logistic storage capacity limits are not scaled on upgrading 'Logistics Carrier Capacity', if they are not set to maximum capacity or already greater than upgraded maximum capacity.\nUse arrow keys to adjust logistic storage capacities:\n ←/→: -/+10 ↓↑: -/+100", "当升级'运输机舱扩容'时,不会对各种物流塔的存储容量按比例提升,除非设置为最大允许容量或者已经超过升级后的最大容量。\n你可以使用方向键微调物流塔存储容量:\n ←→: -/+10 ↓↑: -/+100"); I18N.Add("Logistics Control Panel Improvement", "Logistics Control Panel Improvement", "物流控制面板改进"); I18N.Add("Logistics Control Panel Improvement tips", "Auto apply filter with item under mouse cursor while opening the panel\nQuick-set item filter while right-clicking item icons in storage list on the panel", "打开面板时自动将鼠标指向物品设为筛选条件\n在控制面板物流塔列表中右键点击物品图标快速设置为筛选条件"); I18N.Add("Real-time logistic stations info panel", "Real-time logistic stations info panel", "物流运输站实时信息面板"); I18N.Add("Show status bars for storage items", "Show status bars for storage items", "显示存储物品状态条"); I18N.Add("Tweak building buffers", "Tweak building buffers", "调整建筑输入缓冲"); I18N.Add("Assembler buffer time multiplier(in seconds)", "Assembler buffer time multiplier(in seconds)", "工厂配方缓冲时间倍率(秒)"); I18N.Add("Assembler buffer minimum multiplier", "Assembler buffer minimum multiplier", "工厂配方缓冲最小倍率"); I18N.Add("Buffer count for assembling in labs", "Buffer count for assembling in labs", "研究站矩阵合成模式缓存数量"); I18N.Add("Extra buffer count for Self-evolution Labs", "Extra buffer count for Self-evolution Labs", "自演化研究站矩阵额外缓冲数量"); I18N.Add("Buffer count for researching in labs", "Buffer count for researching in labs", "研究站科研模式缓存数量"); I18N.Add("Ray Receiver Graviton Lens buffer count", "Ray Receiver Graviton Lens buffer count", "射线接收器透镜缓冲数量"); I18N.Add("Dismantle blueprint selected buildings", "Dismantle blueprint selected buildings", "拆除蓝图选中的建筑"); I18N.Add("Shortcut keys for showing stars' name", "Shortcut keys for showing stars' name", "启用显示所有星系名称的快捷键"); I18N.Add("Auto navigation on sailings", "Auto navigation on sailings", "宇宙航行时自动导航"); I18N.Add("Enable auto-cruise", "Enable auto-cruise", "启用自动巡航"); I18N.Add("Auto boost", "Auto boost", "自动加速"); I18N.Add("Distance to use warp", "Distance to use warp (AU)", "使用曲速的距离(AU)"); I18N.Add("Treat stack items as single in monitor components", "Treat stack items as single in monitor components", "在流速计中将堆叠物品视为单个物品"); I18N.Add("Initialize This Planet", "Initialize this planet", "初始化本行星"); I18N.Add("Initialize This Planet Confirm", "This operation will destroy all buildings and revert terrains on this planet, are you sure?", "此操作将会摧毁本行星上的所有建筑并恢复地形,确定吗?"); I18N.Add("Dismantle All Buildings", "Dismantle all buildings", "拆除所有建筑"); I18N.Add("Dismantle All Buildings Confirm", "This operation will dismantle all buildings on this planet, are you sure?", "此操作将会拆除本行星上的所有建筑,确定吗?"); I18N.Add("Quick build Orbital Collectors", "Quick build Orbital Collectors", "快速建造轨道采集器"); I18N.Add("Maximum count to build", "Maximum count to build", "最大建造数量"); I18N.Add("max", "max", "最大"); I18N.Add("Stop ejectors when available nodes are all filled up", "Stop ejectors when available nodes are all filled up", "可用节点全部造完时停止弹射"); I18N.Add("Construct only structure points but frames", "Construct only structure points but frames", "只造节点不造框架"); I18N.Add("Initialize Dyson Sphere", "Initialize Dyson Sphere", "初始化戴森球"); I18N.Add("Initialize Dyson Sphere Confirm", "This operation will destroy all layers on this dyson sphere, are you sure?", "此操作将会摧毁戴森球上的所有层级,确定吗?"); I18N.Add("Click to dismantle selected layer", "Click to dismantle selected layer", "点击拆除对应的戴森壳"); I18N.Add("Dismantle selected layer", "Dismantle selected layer", "拆除选中的戴森壳"); I18N.Add("Dismantle selected layer Confirm", "This operation will dismantle selected layer, are you sure?", "此操作将会拆除选中的戴森壳,确定吗?"); I18N.Add("Auto Fast Build Speed Multiplier", "Auto Fast Build Speed Multiplier", "自动快速建造速度倍率"); I18N.Add("Restore upgrades of \"Sorter Cargo Stacking\" on panel", "Restore upgrades of \"Sorter Cargo Stacking\" on panel", "在升级面板上恢复\"分拣器货物叠加\"的升级"); I18N.Add("Disable battle-related techs in Peace mode", "Disable battle-related techs in Peace mode", "在和平模式下隐藏战斗相关科技"); I18N.Add("Buy out techs with their prerequisites", "Buy out techs with their prerequisites", "购买科技也同时购买所有前置科技"); I18N.Add("Set \"Sorter Cargo Stacking\" to unresearched state", "Set \"Sorter Cargo Stacking\" to unresearched state", "将\"分拣器货物叠加\"设为未研究状态"); I18N.Add("Unlock all techs with metadata", "Unlock all techs with metadata", "使用元数据解锁所有科技"); I18N.Add("Open Dark Fog Communicator", "Open Dark Fog Communicator", "打开黑雾通讯器"); I18N.Apply(); MyConfigWindow.OnUICreated = (Action<MyConfigWindow, RectTransform>)Delegate.Combine(MyConfigWindow.OnUICreated, new Action<MyConfigWindow, RectTransform>(CreateUI)); MyConfigWindow.OnUpdateUI = (Action)Delegate.Combine(MyConfigWindow.OnUpdateUI, new Action(UpdateUI)); } private static void CreateUI(MyConfigWindow wnd, RectTransform trans) { //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Expected O, but got Unknown //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Expected O, but got Unknown //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Expected O, but got Unknown //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08c8: Expected O, but got Unknown //IL_08fc: Unknown result type (might be due to invalid IL or missing references) //IL_0901: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Expected O, but got Unknown //IL_19dc: Unknown result type (might be due to invalid IL or missing references) //IL_19e1: Unknown result type (might be due to invalid IL or missing references) //IL_19e7: Expected O, but got Unknown //IL_1a63: Unknown result type (might be due to invalid IL or missing references) //IL_1a6d: Expected O, but got Unknown //IL_1bc2: Unknown result type (might be due to invalid IL or missing references) //IL_1bc7: Unknown result type (might be due to invalid IL or missing references) //IL_1bcd: Expected O, but got Unknown //IL_1c01: Unknown result type (might be due to invalid IL or missing references) //IL_1c06: Unknown result type (might be due to invalid IL or missing references) //IL_1c0c: Expected O, but got Unknown //IL_1c4c: Unknown result type (might be due to invalid IL or missing references) //IL_1c51: Unknown result type (might be due to invalid IL or missing references) //IL_1c57: Expected O, but got Unknown _windowTrans = trans; wnd.AddTabGroup(trans, "UXAssist", "tab-group-uxassist"); RectTransform parent = wnd.AddTab(trans, "General"); float num = 0f; float num2 = 10f; wnd.AddCheckBox(num, num2, parent, GamePatch.EnableWindowResizeEnabled, "Enable game window resize"); num2 += 36f; wnd.AddCheckBox(num, num2, parent, GamePatch.LoadLastWindowRectEnabled, "Remeber window position and size on last exit"); num2 += 36f; Text val = wnd.AddText2(num + 2f, num2, parent, "Scale up mouse cursor", 15, "text-scale-up-mouse-cursor"); wnd.AddSlider(num + val.preferredWidth + 7f, num2 + 6f, parent, GamePatch.MouseCursorScaleUpMultiplier, new int[4] { 1, 2, 3, 4 }, "0x", 100f); num2 += 36f; wnd.AddCheckBox(num, num2, parent, GamePatch.ConvertSavesFromPeaceEnabled, "Convert old saves to Combat Mode on loading"); MyCheckBox myCheckBox; if (WindowFunctions.ProfileName != null) { num2 += 36f; myCheckBox = wnd.AddCheckBox(num, num2, parent, GamePatch.ProfileBasedSaveFolderEnabled, "Profile-based save folder"); wnd.AddTipsButton2(myCheckBox.Width + 5f, num2 + 6f, parent, "Profile-based save folder", "Profile-based save folder tips", "btn-profile-based-save-folder-tips"); num2 += 36f; myCheckBox = wnd.AddCheckBox(num, num2, parent, GamePatch.ProfileBasedOptionEnabled, "Profile-based option"); wnd.AddTipsButton2(myCheckBox.Width + 5f, num2 + 6f, parent, "Profile-based option", "Profile-based option tips", "btn-profile-based-option-tips"); num2 += 36f; wnd.AddText2(num + 2f, num2, parent, "Default profile name", 15, "text-default-profile-name"); num2 += 24f; wnd.AddInputField(num + 2f, num2, 200f, parent, GamePatch.DefaultProfileName, 15, "input-profile-save-folder"); num2 += 18f; } if (!BulletTimeWrapper.HasBulletTime) { num2 += 36f; val = wnd.AddText2(num + 2f, num2, parent, "Logical Frame Rate", 15, "game-frame-rate"); num += val.preferredWidth + 7f; wnd.AddSlider(num, num2 + 6f, parent, GamePatch.GameUpsFactor, new UpsMapper(), "0.0x", 100f).WithSmallerHandle(); float x = num + 104f; float y = num2 + 6f; object obj = <>c.<>9__18_4; if (obj == null) { UnityAction val2 = delegate { GamePatch.GameUpsFactor.Value = 1.0; }; <>c.<>9__18_4 = val2; obj = (object)val2; } ((RectTransform)((Component)wnd.AddFlatButton(x, y, parent, "Reset", 13, "reset-game-frame-rate", (UnityAction)obj)).transform).sizeDelta = new Vector2(40f, 20f); num = 0f; } num2 += 36f; wnd.AddComboBox(num + 2f, num2, parent, "Process priority").WithItems("High", "Above Normal", "Normal", "Below Normal", "Idle").WithSize(100f, 0f) .WithConfigEntry(WindowFunctions.ProcessPriority); WinApi.LogicalProcessorDetails processorDetails = WindowFunctions.ProcessorDetails; string[] array = ((!processorDetails.HybridArchitecture) ? new string[3] : new string[5] { null, null, null, "All P-Cores", "All E-Cores" }); array[0] = "All CPUs"; array[1] = string.Format(Localization.Translate("First {0} CPUs"), processorDetails.ThreadCount / 2); array[2] = ((processorDetails.ThreadCount > 16) ? "First 8 CPUs" : "First CPU only"); num2 += 36f; wnd.AddComboBox(num + 2f, num2, parent, "Enabled CPUs").WithItems(array).WithSize(200f, 0f) .WithConfigEntry(WindowFunctions.ProcessAffinity); num2 += 36f; float x2 = num; float y2 = num2; object obj2 = <>O.<2>__ShowCPUInfo; if (obj2 == null) { UnityAction val3 = WindowFunctions.ShowCPUInfo; <>O.<2>__ShowCPUInfo = val3; obj2 = (object)val3; } ((RectTransform)((Component)wnd.AddButton(x2, y2, parent, "CPU Info", 16, "button-show-cpu-info", (UnityAction)obj2)).transform).sizeDelta = new Vector2(100f, 25f); RectTransform parent2 = wnd.AddTab(trans, "Factory"); num = 0f; num2 = 10f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.RemoveSomeConditionEnabled, "Remove some build conditions"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.RemoveBuildRangeLimitEnabled, "Remove build range limit"); num2 += 36f; myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryPatch.NightLightEnabled, "Night Light"); num += myCheckBox.Width + 5f + 10f; val = wnd.AddText2(num, num2 + 2f, parent2, "Angle X:", 13, "text-nightlight-angle-x"); num += val.preferredWidth + 5f; wnd.AddSlider(num, num2 + 7f, parent2, FactoryPatch.NightLightAngleX, new AngleMapper(), "0", 60f).WithSmallerHandle(); num += 70f; val = wnd.AddText2(num, num2 + 2f, parent2, "Y:", 13, "text-nightlight-angle-y"); wnd.AddSlider(num + val.preferredWidth + 5f, num2 + 7f, parent2, FactoryPatch.NightLightAngleY, new AngleMapper(), "0", 60f).WithSmallerHandle(); num = 0f; num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.LargerAreaForUpgradeAndDismantleEnabled, "Larger area for upgrade and dismantle"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.LargerAreaForTerraformEnabled, "Larger area for terraform"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.OffGridBuildingEnabled, "Off-grid building and stepped rotation"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.CutConveyorBeltEnabled, "Cut conveyor belt (with shortcut key)"); num2 += 36f; myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryPatch.TreatStackingAsSingleEnabled, "Treat stack items as single in monitor components"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.QuickBuildAndDismantleLabsEnabled, "Quick build and dismantle stacking labs"); num2 += 36f; MyCheckBox myCheckBox2 = wnd.AddCheckBox(num, num2, parent2, FactoryPatch.TankFastFillInAndTakeOutEnabled, "Fast fill in to and take out from tanks"); num += myCheckBox2.Width + 5f; val = wnd.AddText2(num, num2 + 2f, parent2, "Speed Ratio", 13, "text-tank-fast-fill-speed-ratio"); MySlider tankSlider = wnd.AddSlider(num + val.preferredWidth + 5f, num2 + 7f, parent2, FactoryPatch.TankFastFillInAndTakeOutMultiplier, new int[8] { 2, 5, 10, 20, 50, 100, 500, 1000 }, "G", 100f).WithSmallerHandle(); FactoryPatch.TankFastFillInAndTakeOutEnabled.SettingChanged += TankSettingChanged; wnd.OnFree += delegate { FactoryPatch.TankFastFillInAndTakeOutEnabled.SettingChanged -= TankSettingChanged; }; TankSettingChanged(null, null); num = 0f; num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.DoNotRenderEntitiesEnabled, "Do not render factory entities"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.DismantleBlueprintSelectionEnabled, "Dismantle blueprint selected buildings"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.BeltSignalsForBuyOutEnabled, "Belt signals for buy out dark fog items automatically"); num2 += 36f; myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryPatch.ProtectVeinsFromExhaustionEnabled, "Protect veins from exhaustion"); wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent2, "Protect veins from exhaustion", "Protect veins from exhaustion tips", "protect-veins-tips"); num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.DragBuildPowerPolesEnabled, "Drag building power poles in maximum connection range"); num2 += 27f; MyCheckBox alternatelyCheckBox = wnd.AddCheckBox(num + 20f, num2, parent2, FactoryPatch.DragBuildPowerPolesAlternatelyEnabled, "Build Tesla Tower and Wireless Power Tower alternately", 13); FactoryPatch.DragBuildPowerPolesEnabled.SettingChanged += AlternatelyCheckBoxChanged; wnd.OnFree += delegate { FactoryPatch.DragBuildPowerPolesEnabled.SettingChanged -= AlternatelyCheckBoxChanged; }; AlternatelyCheckBoxChanged(null, null); num = 400f; num2 = 10f; float x3 = num; float y3 = num2; object obj3 = <>c.<>9__18_0; if (obj3 == null) { UnityAction val4 = delegate { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown string text9 = Localization.Translate("Initialize This Planet"); string text10 = Localization.Translate("Initialize This Planet Confirm"); string text11 = Localization.Translate("取消"); string text12 = Localization.Translate("确定"); object obj12 = <>c.<>9__18_9; if (obj12 == null) { Response val15 = delegate { PlanetFunctions.RecreatePlanet(revertReform: true); }; <>c.<>9__18_9 = val15; obj12 = (object)val15; } UIMessageBox.Show(text9, text10, text11, text12, 2, (Response)null, (Response)obj12); }; <>c.<>9__18_0 = val4; obj3 = (object)val4; } wnd.AddButton(x3, y3, parent2, "Initialize This Planet", 16, "button-init-planet", (UnityAction)obj3); num2 += 36f; float x4 = num; float y4 = num2; object obj4 = <>c.<>9__18_1; if (obj4 == null) { UnityAction val5 = delegate { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown string text5 = Localization.Translate("Dismantle All Buildings"); string text6 = Localization.Translate("Dismantle All Buildings Confirm"); string text7 = Localization.Translate("取消"); string text8 = Localization.Translate("确定"); object obj11 = <>c.<>9__18_10; if (obj11 == null) { Response val14 = delegate { PlanetFunctions.DismantleAll(toBag: false); }; <>c.<>9__18_10 = val14; obj11 = (object)val14; } UIMessageBox.Show(text5, text6, text7, text8, 2, (Response)null, (Response)obj11); }; <>c.<>9__18_1 = val5; obj4 = (object)val5; } wnd.AddButton(x4, y4, parent2, "Dismantle All Buildings", 16, "button-dismantle-all", (UnityAction)obj4); num2 += 72f; float x5 = num; float y5 = num2; object obj5 = <>O.<3>__BuildOrbitalCollectors; if (obj5 == null) { UnityAction val6 = PlanetFunctions.BuildOrbitalCollectors; <>O.<3>__BuildOrbitalCollectors = val6; obj5 = (object)val6; } wnd.AddButton(x5, y5, 200f, parent2, "Quick build Orbital Collectors", 16, "button-init-planet", (UnityAction)obj5); num2 += 30f; val = wnd.AddText2(num + 10f, num2, parent2, "Maximum count to build", 15, "text-oc-build-count"); wnd.AddSlider(num + 10f + val.preferredWidth + 5f, num2 + 6f, parent2, PlanetFunctions.OrbitalCollectorMaxBuildCount, new OcMapper(), "G", 160f); num2 += 18f; num2 += 36f; wnd.AddCheckBox(num, num2, parent2, FactoryPatch.TweakBuildingBufferEnabled, "Tweak building buffers"); num2 += 27f; val = wnd.AddText2(num + 20f, num2, parent2, "Assembler buffer time multiplier(in seconds)", 13); float num3 = val.preferredWidth + 5f; num2 += 27f; val = wnd.AddText2(num + 20f, num2, parent2, "Assembler buffer minimum multiplier", 13); float num4 = val.preferredWidth + 5f; num2 += 27f; val = wnd.AddText2(num + 20f, num2, parent2, "Buffer count for assembling in labs", 13); float num5 = val.preferredWidth + 5f; num2 += 27f; val = wnd.AddText2(num + 20f, num2, parent2, "Extra buffer count for Self-evolution Labs", 13); float num6 = val.preferredWidth + 5f; num2 += 27f; val = wnd.AddText2(num + 20f, num2, parent2, "Buffer count for researching in labs", 13); float num7 = val.preferredWidth + 5f; num2 += 27f; val = wnd.AddText2(num + 20f, num2, parent2, "Ray Receiver Graviton Lens buffer count", 13); float num8 = val.preferredWidth + 5f; num2 -= 135f; float num9 = Mathf.Max(new float[6] { num3, num4, num5, num6, num7, num8 }) + 20f; MySlider assemblerBufferTimeMultiplierSlider = wnd.AddSlider(num + num9, num2 + 5f, parent2, FactoryPatch.AssemblerBufferTimeMultiplier, new MyWindow.RangeValueMapper<int>(2, 10), "0", 80f).WithSmallerHandle(); num2 += 27f; MySlider assemblerBufferMininumMultiplierSlider = wnd.AddSlider(num + num9, num2 + 5f, parent2, FactoryPatch.AssemblerBufferMininumMultiplier, new MyWindow.RangeValueMapper<int>(2, 10), "0", 80f).WithSmallerHandle(); num2 += 27f; MySlider labBufferMaxCountForAssembleSlider = wnd.AddSlider(num + num9, num2 + 5f, parent2, FactoryPatch.LabBufferMaxCountForAssemble, new MyWindow.RangeValueMapper<int>(2, 20), "0", 80f).WithSmallerHandle(); num2 += 27f; MySlider labBufferExtraCountForAdvancedAssembleSlider = wnd.AddSlider(num + num9, num2 + 5f, parent2, FactoryPatch.LabBufferExtraCountForAdvancedAssemble, new MyWindow.RangeValueMapper<int>(1, 10), "0", 80f).WithSmallerHandle(); num2 += 27f; MySlider labBufferMaxCountForResearchSlider = wnd.AddSlider(num + num9, num2 + 5f, parent2, FactoryPatch.LabBufferMaxCountForResearch, new MyWindow.RangeValueMapper<int>(2, 20), "0", 80f).WithSmallerHandle(); num2 += 27f; MySlider receiverBufferCountSlider = wnd.AddSlider(num + num9, num2 + 5f, parent2, FactoryPatch.ReceiverBufferCount, new MyWindow.RangeValueMapper<int>(1, 20), "0", 80f).WithSmallerHandle(); FactoryPatch.TweakBuildingBufferEnabled.SettingChanged += TweakBuildingBufferChanged; wnd.OnFree += delegate { FactoryPatch.TweakBuildingBufferEnabled.SettingChanged -= TweakBuildingBufferChanged; }; TweakBuildingBufferChanged(null, null); RectTransform parent3 = wnd.AddTab(trans, "Logistics"); num = 0f; num2 = 10f; myCheckBox = wnd.AddCheckBox(num, num2, parent3, LogisticsPatch.LogisticsCapacityTweaksEnabled, "Enhance control for logistic storage capacities"); wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent3, "Enhance control for logistic storage capacities", "Enhance control for logistic storage capacities tips", "enhanced-logistic-capacities-tips"); num2 += 36f; wnd.AddCheckBox(num, num2, parent3, LogisticsPatch.AllowOverflowInLogisticsEnabled, "Allow overflow for Logistic Stations and Advanced Mining Machines"); num2 += 36f; myCheckBox = wnd.AddCheckBox(num, num2, parent3, LogisticsPatch.LogisticsConstrolPanelImprovementEnabled, "Logistics Control Panel Improvement"); wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent3, "Logistics Control Panel Improvement", "Logistics Control Panel Improvement tips", "lcp-improvement-tips"); num2 += 36f; MyCheckBox realtimeLogisticsInfoPanelCheckBox = wnd.AddCheckBox(num, num2, parent3, LogisticsPatch.RealtimeLogisticsInfoPanelEnabled, "Real-time logistic stations info panel"); num2 += 27f; MyCheckBox realtimeLogisticsInfoPanelBarsCheckBox = wnd.AddCheckBox(num + 20f, num2, parent3, LogisticsPatch.RealtimeLogisticsInfoPanelBarsEnabled, "Show status bars for storage items", 13); if (AuxilaryfunctionWrapper.ShowStationInfo != null) { AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged += RealtimeLogisticsInfoPanelChanged; wnd.OnFree += delegate { AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged -= RealtimeLogisticsInfoPanelChanged; }; } LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.SettingChanged += RealtimeLogisticsInfoPanelChanged; wnd.OnFree += delegate { LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.SettingChanged -= RealtimeLogisticsInfoPanelChanged; }; RealtimeLogisticsInfoPanelChanged(null, null); num2 += 36f; wnd.AddCheckBox(num, num2, parent3, LogisticsPatch.AutoConfigLogisticsEnabled, "Auto-config logistic stations"); num2 += 24f; wnd.AddCheckBox(10f, num2, parent3, LogisticsPatch.AutoConfigLimitAutoReplenishCount, "Limit auto-replenish count to values below", 13).WithSmallerBox(); num2 += 18f; float num10 = 0f; wnd.AddText2(10f, num2, parent3, "Dispenser", 14, "text-dispenser"); num2 += 18f; float num11 = num2; num = 20f; Text val7 = wnd.AddText2(num, num2, parent3, "Max. Charging Power", 13, "text-dispenser-max-charging-power"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Count of Bots filled", 13, "text-dispenser-count-of-bots-filled"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; wnd.AddText2(10f, num2, parent3, "Battlefield Analysis Base", 14, "text-battlefield-analysis-base"); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Max. Charging Power", 13, "text-battlefield-analysis-base-max-charging-power"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; wnd.AddText2(10f, num2, parent3, "PLS", 14, "text-pls"); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Max. Charging Power", 13, "text-pls-max-charging-power"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Drone transport range", 13, "text-pls-drone-transport-range"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Min. Load of Drones", 13, "text-pls-min-load-of-drones"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Outgoing integration count", 13, "text-pls-outgoing-integration-count"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Count of Drones filled", 13, "text-pls-count-of-drones-filled"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; wnd.AddText2(10f, num2, parent3, "ILS", 14, "text-ils"); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Max. Charging Power", 13, "text-ils-max-charging-power"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Drone transport range", 13, "text-ils-drone-transport-range"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Vessel transport range", 13, "text-ils-vessel-transport-range"); num10 = Mathf.Max(num10, val7.preferredWidth); wnd.AddCheckBox(num + 360f, num2 + 6f, parent3, LogisticsPatch.AutoConfigILSIncludeOrbitCollector, "Include Orbital Collector", 13).WithSmallerBox(); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Warp distance", 13, "text-ils-warp-distance"); num10 = Mathf.Max(num10, val7.preferredWidth); wnd.AddCheckBox(num + 360f, num2 + 6f, parent3, LogisticsPatch.AutoConfigILSWarperNecessary, "Warpers required", 13).WithSmallerBox(); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Min. Load of Drones", 13, "text-ils-min-load-of-drones"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Min. Load of Vessels", 13, "text-ils-min-load-of-vessels"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Outgoing integration count", 13, "text-ils-outgoing-integration-count"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Count of Drones filled", 13, "text-ils-count-of-drones-filled"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Count of Vessels filled", 13, "text-ils-count-of-vessels-filled"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; wnd.AddText2(10f, num2, parent3, "Advanced Mining Machine", 14, "text-amm"); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Collecting Speed", 13, "text-amm-collecting-speed"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 += 18f; val7 = wnd.AddText2(num, num2, parent3, "Min. Piler Value", 13, "text-amm-min-piler-value"); num10 = Mathf.Max(num10, val7.preferredWidth); num2 = num11 + 1f; float x6 = num + num10 + 5f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigDispenserChargePower, new AutoConfigDispenserChargePowerMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigDispenserCourierCount, new MyWindow.RangeValueMapper<int>(0, 10), "G", 150f, -100f).WithFontSize(13); num2 += 36f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigBattleBaseChargePower, new AutoConfigBattleBaseChargePowerMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 36f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigPLSChargePower, new AutoConfigPLSChargePowerMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigPLSMaxTripDrone, new MyWindow.RangeValueMapper<int>(1, 180), "0°", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigPLSDroneMinDeliver, new AutoConfigCarrierMinDeliverMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigPLSMinPilerValue, new AutoConfigMinPilerValueMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigPLSDroneCount, new MyWindow.RangeValueMapper<int>(0, 50), "G", 150f, -100f).WithFontSize(13); num2 += 36f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSChargePower, new AutoConfigILSChargePowerMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSMaxTripDrone, new MyWindow.RangeValueMapper<int>(1, 180), "0°", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSMaxTripShip, new AutoConfigILSMaxTripShipMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSWarperDistance, new AutoConfigILSWarperDistanceMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSDroneMinDeliver, new AutoConfigCarrierMinDeliverMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSShipMinDeliver, new AutoConfigCarrierMinDeliverMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSMinPilerValue, new AutoConfigMinPilerValueMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSDroneCount, new MyWindow.RangeValueMapper<int>(0, 100), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigILSShipCount, new MyWindow.RangeValueMapper<int>(0, 10), "G", 150f, -100f).WithFontSize(13); num2 += 36f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigVeinCollectorHarvestSpeed, new AutoConfigVeinCollectorHarvestSpeedMapper(), "G", 150f, -100f).WithFontSize(13); num2 += 18f; wnd.AddSideSlider(x6, num2, parent3, LogisticsPatch.AutoConfigVeinCollectorMinPilerValue, new AutoConfigMinPilerValueMapper(), "G", 150f, -100f).WithFontSize(13); num = 0f; RectTransform parent4 = wnd.AddTab(trans, "Player/Mecha"); num = 0f; num2 = 10f; wnd.AddCheckBox(num, num2, parent4, FactoryPatch.UnlimitInteractiveEnabled, "Unlimited interactive range"); num2 += 36f; wnd.AddCheckBox(num, num2, parent4, PlanetPatch.PlayerActionsInGlobeViewEnabled, "Enable player actions in globe view"); num2 += 36f; wnd.AddCheckBox(num, num2, parent4, PlayerPatch.HideTipsForSandsChangesEnabled, "Hide tips for soil piles changes"); num2 += 36f; myCheckBox = wnd.AddCheckBox(num, num2, parent4, PlayerPatch.EnhancedMechaForgeCountControlEnabled, "Enhanced count control for hand-make"); wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent4, "Enhanced count control for hand-make", "Enhanced count control for hand-make tips", "enhanced-count-control-tips"); num2 += 36f; wnd.AddCheckBox(num, num2, parent4, PlayerPatch.ShortcutKeysForStarsNameEnabled, "Shortcut keys for showing stars' name"); num2 += 36f; wnd.AddCheckBox(num, num2, parent4, PlayerPatch.AutoNavigationEnabled, "Auto navigation on sailings"); num2 += 27f; MyCheckBox autoCruiseCheckBox = wnd.AddCheckBox(num + 20f, num2, parent4, PlayerPatch.AutoCruiseEnabled, "Enable auto-cruise", 13); num2 += 27f; MyCheckBox autoBoostCheckBox = wnd.AddCheckBox(num + 20f, num2, parent4, PlayerPatch.AutoBoostEnabled, "Auto boost", 13); num2 += 27f; val = wnd.AddText2(num + 20f, num2, parent4, "Distance to use warp", 15, "text-distance-to-warp"); MySlider navDistanceSlider = wnd.AddSlider(num + 20f + val.preferredWidth + 5f, num2 + 6f, parent4, PlayerPatch.DistanceToWarp, new DistanceMapper(), "0.0", 100f); PlayerPatch.AutoNavigationEnabled.SettingChanged += NavSettingChanged; wnd.OnFree += delegate { PlayerPatch.AutoNavigationEnabled.SettingChanged -= NavSettingChanged; }; NavSettingChanged(null, null); RectTransform val8 = wnd.AddTab(trans, "Dyson Sphere"); num = 0f; num2 = 10f; wnd.AddCheckBox(num, num2, val8, DysonSpherePatch.StopEjectOnNodeCompleteEnabled, "Stop ejectors when available nodes are all filled up"); num2 += 36f; wnd.AddCheckBox(num, num2, val8, DysonSpherePatch.OnlyConstructNodesEnabled, "Construct only structure points but frames"); num = 400f; num2 = 10f; float x7 = num; float y6 = num2; object obj6 = <>c.<>9__18_2; if (obj6 == null) { UnityAction val9 = delegate { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown string text = Localization.Translate("Initialize Dyson Sphere"); string text2 = Localization.Translate("Initialize Dyson Sphere Confirm"); string text3 = Localization.Translate("取消"); string text4 = Localization.Translate("确定"); object obj10 = <>c.<>9__18_18; if (obj10 == null) { Response val13 = delegate { DysonSphereFunctions.InitCurrentDysonLayer(null, -1); }; <>c.<>9__18_18 = val13; obj10 = (object)val13; } UIMessageBox.Show(text, text2, text3, text4, 2, (Response)null, (Response)obj10); }; <>c.<>9__18_2 = val9; obj6 = (object)val9; } _dysonInitBtn = wnd.AddButton(x7, y6, val8, "Initialize Dyson Sphere", 16, "init-dyson-sphere", (UnityAction)obj6); num2 += 36f; wnd.AddText2(num, num2, val8, "Click to dismantle selected layer", 16, "text-dismantle-layer"); num2 += 27f; for (int i = 0; i < 10; i++) { int id = i + 1; MyFlatButton myFlatButton = wnd.AddFlatButton(num, num2, val8, id.ToString(), 12, "dismantle-layer-" + id, (UnityAction)delegate { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown StarData star = DysonSphereFunctions.CurrentStarForDysonSystem(); UIMessageBox.Show(Localization.Translate("Dismantle selected layer"), Localization.Translate("Dismantle selected layer Confirm"), Localization.Translate("取消"), Localization.Translate("确定"), 2, (Response)null, (Response)delegate { DysonSphereFunctions.InitCurrentDysonLayer(star, id); }); }).WithSize(40f, 20f); DysonLayerBtn[i] = myFlatButton.uiButton; if (i == 4) { num -= 160f; num2 += 20f; } else { num += 40f; } } num = 400f; num2 += 36f; val = wnd.AddText2(num, num2, val8, "Auto Fast Build Speed Multiplier", 15, "text-auto-fast-build-multiplier"); wnd.AddSlider(num + val.preferredWidth + 5f, num2 + 6f, val8, DysonSpherePatch.AutoConstructMultiplier, new int[7] { 1, 2, 5, 10, 20, 50, 100 }, "0", 100f); _dysonTab = val8; RectTransform parent5 = wnd.AddTab(trans, "Tech/Combat"); num = 10f; num2 = 10f; wnd.AddCheckBox(num, num2, parent5, TechPatch.BatchBuyoutTechEnabled, "Buy out techs with their prerequisites"); num2 += 36f; wnd.AddCheckBox(num, num2, parent5, TechPatch.SorterCargoStackingEnabled, "Restore upgrades of \"Sorter Cargo Stacking\" on panel"); num2 += 36f; wnd.AddCheckBox(num, num2, parent5, TechPatch.DisableBattleRelatedTechsInPeaceModeEnabled, "Disable battle-related techs in Peace mode"); num2 += 36f; float x8 = num; float y7 = num2; object obj7 = <>O.<4>__RemoveCargoStackingTechs; if (obj7 == null) { UnityAction val10 = TechFunctions.RemoveCargoStackingTechs; <>O.<4>__RemoveCargoStackingTechs = val10; obj7 = (object)val10; } wnd.AddButton(x8, y7, 300f, parent5, "Set \"Sorter Cargo Stacking\" to unresearched state", 16, "button-remove-cargo-stacking", (UnityAction)obj7); num2 += 36f; float x9 = num; float y8 = num2; object obj8 = <>O.<5>__UnlockAllProtoWithMetadataAndPrompt; if (obj8 == null) { UnityAction val11 = TechFunctions.UnlockAllProtoWithMetadataAndPrompt; <>O.<5>__UnlockAllProtoWithMetadataAndPrompt = val11; obj8 = (object)val11; } wnd.AddButton(x9, y8, 300f, parent5, "Unlock all techs with metadata", 16, "button-unlock-all-techs-with-metadata", (UnityAction)obj8); num2 += 36f; num2 += 36f; float x10 = num; float y9 = num2; object obj9 = <>c.<>9__18_3; if (obj9 == null) { UnityAction val12 = delegate { GameData data = GameMain.data; if (data != null && data.gameDesc.isCombatMode) { UIGame uiGame = UIRoot.instance.uiGame; uiGame.ShutPlayerInventory(); uiGame.CloseEnemyBriefInfo(); uiGame.OpenCommunicatorWindow(5); } }; <>c.<>9__18_3 = val12; obj9 = (object)val12; } wnd.AddButton(x10, y9, 300f, parent5, "Open Dark Fog Communicator", 16, "button-open-df-communicator", (UnityAction)obj9); void AlternatelyCheckBoxChanged(object o, EventArgs e) { alternatelyCheckBox.SetEnable(FactoryPatch.DragBuildPowerPolesEnabled.Value); } void NavSettingChanged(object o, EventArgs e) { autoCruiseCheckBox.SetEnable(PlayerPatch.AutoNavigationEnabled.Value); autoBoostCheckBox.SetEnable(PlayerPatch.AutoNavigationEnabled.Value); navDistanceSlider.SetEnable(PlayerPatch.AutoNavigationEnabled.Value); } void RealtimeLogisticsInfoPanelChanged(object o, EventArgs e) { if (AuxilaryfunctionWrapper.ShowStationInfo == null) { realtimeLogisticsInfoPanelCheckBox.SetEnable(on: true); realtimeLogisticsInfoPanelBarsCheckBox.SetEnable(LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value); } else { bool flag = !AuxilaryfunctionWrapper.ShowStationInfo.Value; realtimeLogisticsInfoPanelCheckBox.SetEnable(flag); realtimeLogisticsInfoPanelBarsCheckBox.SetEnable(flag & LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value); if (!flag) { LogisticsPatch.RealtimeLogisticsInfoPanelEnabled.Value = false; } } } void TankSettingChanged(object o, EventArgs e) { tankSlider.SetEnable(FactoryPatch.TankFastFillInAndTakeOutEnabled.Value); } void TweakBuildingBufferChanged(object o, EventArgs e) { assemblerBufferTimeMultiplierSlider.SetEnable(FactoryPatch.TweakBuildingBufferEnabled.Value); assemblerBufferMininumMultiplierSlider.SetEnable(FactoryPatch.TweakBuildingBufferEnabled.Value); labBufferMaxCountForAssembleSlider.SetEnable(FactoryPatch.TweakBuildingBufferEnabled.Value); labBufferExtraCountForAdvancedAssembleSlider.SetEnable(FactoryPatch.TweakBuildingBufferEnabled.Value); labBufferMaxCountForResearchSlider.SetEnable(FactoryPatch.TweakBuildingBufferEnabled.Value); receiverBufferCountSlider.SetEnable(FactoryPatch.TweakBuildingBufferEnabled.Value); } } private static void UpdateUI() { UpdateDysonShells(); } private static void UpdateDysonShells() { if (!((Component)_dysonTab).gameObject.activeSelf) { return; } StarData val = DysonSphereFunctions.CurrentStarForDysonSystem(); if (val == null) { for (int i = 0; i < 10; i++) { ((Selectable)DysonLayerBtn[i].button).interactable = false; } return; } DysonSphere[] array = GameMain.data?.dysonSpheres; if (((array != null) ? array[val.index] : null) != null) { DysonSphere val2 = array[val.index]; for (int j = 1; j <= 10; j++) { DysonSphereLayer val3 = val2.layersIdBased[j]; ((Selectable)DysonLayerBtn[j - 1].button).interactable = val3 != null && val3.id == j; } } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [CommonAPISubmoduleDependency(new string[] { "CustomKeyBindSystem" })] [BepInPlugin("org.soardev.uxassist", "UXAssist", "1.3.5")] public class UXAssist : BaseUnityPlugin, IModCanSave { public static readonly ManualLogSource Logger = Logger.CreateLogSource("UXAssist"); private static ConfigFile _dummyConfig; private Type[] _patches; private Type[] _compats; private const ushort ModSaveVersion = 1; public void Export(BinaryWriter w) { w.Write((ushort)1); FactoryPatch.Export(w); } public void Import(BinaryReader r) { if (r.ReadUInt16() > 0) { FactoryPatch.Import(r); } } public void IntoOtherSave() { } private void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Expected O, but got Unknown //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Expected O, but got Unknown //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Expected O, but got Unknown //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Expected O, but got Unknown //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Expected O, but got Unknown //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Expected O, but got Unknown //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Expected O, but got Unknown //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Expected O, but got Unknown //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Expected O, but got Unknown //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Expected O, but got Unknown //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Expected O, but got Unknown //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Expected O, but got Unknown //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_077d: Expected O, but got Unknown //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Expected O, but got Unknown //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Expected O, but got Unknown //IL_080a: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Expected O, but got Unknown //IL_083c: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Expected O, but got Unknown //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Expected O, but got Unknown //IL_08a8: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Expected O, but got Unknown //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08e5: Expected O, but got Unknown //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Expected O, but got Unknown //IL_0941: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Expected O, but got Unknown //IL_0972: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Expected O, but got Unknown //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_09ef: Expected O, but got Unknown //IL_0a18: Unknown result type (might be due to invalid IL or missing references) //IL_0a22: Expected O, but got Unknown //IL_0a4b: Unknown result type (might be due to invalid IL or missing references) //IL_0a55: Expected O, but got Unknown //IL_0a7c: Unknown result type (might be due to invalid IL or missing references) //IL_0a86: Expected O, but got Unknown _dummyConfig = new ConfigFile(Path.Combine(Paths.ConfigPath, "org.soardev.uxassist_dummy.cfg"), false) { SaveOnConfigSet = false }; GamePatch.EnableWindowResizeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "EnableWindowResize", false, "Enable game window resize (maximum box and thick frame)"); GamePatch.LoadLastWindowRectEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "LoadLastWindowRect", false, "Load last window position and size when game starts"); GamePatch.LastWindowRect = ((BaseUnityPlugin)this).Config.Bind<Vector4>("Game", "LastWindowRect", new Vector4(0f, 0f, 0f, 0f), "Last window position and size"); GamePatch.MouseCursorScaleUpMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Game", "MouseCursorScaleUpMultiplier", 1, "Mouse cursor scale up multiplier"); GamePatch.ProfileBasedSaveFolderEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "ProfileBasedSaveFolder", false, "Profile-based save folder"); GamePatch.ProfileBasedOptionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "ProfileBasedOption", false, "Profile-based option"); GamePatch.DefaultProfileName = ((BaseUnityPlugin)this).Config.Bind<string>("Game", "DefaultProfileName", "Default", "Default profile name, used when profile-based save folder is enabled. Use original game save folder if matched"); GamePatch.ConvertSavesFromPeaceEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "ConvertSavesFromPeace", false, "Convert saves from Peace mode to Combat mode on save loading"); GamePatch.GameUpsFactor = _dummyConfig.Bind<double>("Game", "GameUpsFactor", 1.0, "Game UPS factor (1.0 for normal speed)"); WindowFunctions.ProcessPriority = ((BaseUnityPlugin)this).Config.Bind<int>("Game", "ProcessPriority", 2, new ConfigDescription("Game process priority\n 0: High 1: Above Normal 2: Normal 3: Below Normal 4: Idle", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>())); WindowFunctions.ProcessAffinity = ((BaseUnityPlugin)this).Config.Bind<int>("Game", "CPUAffinity", -1, new ConfigDescription("Game process CPU affinity\r\n 0: All 1: First-half CPUs 2. First 8 CPUs (if total CPUs are greater than 16)\r\n 3. All Performance Cores(If Intel 13th or greater) 4. All Efficiency Cores(If Intel 13th or greater)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>())); FactoryPatch.UnlimitInteractiveEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "UnlimitInteractive", false, "Unlimit interactive range"); FactoryPatch.RemoveSomeConditionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "RemoveSomeBuildConditionCheck", false, "Remove part of build condition checks that does not affect game logic"); FactoryPatch.NightLightEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "NightLight", false, "Night light"); FactoryPatch.NightLightAngleX = ((BaseUnityPlugin)this).Config.Bind<float>("Factory", "NightLightAngleX", -8f, "Night light angle X"); FactoryPatch.NightLightAngleY = ((BaseUnityPlugin)this).Config.Bind<float>("Factory", "NightLightAngleY", -2f, "Night light angle Y"); PlanetPatch.PlayerActionsInGlobeViewEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "PlayerActionsInGlobeView", false, "Enable player actions in globe view"); FactoryPatch.RemoveBuildRangeLimitEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("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 = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LargerAreaForUpgradeAndDismantle", false, "Increase maximum area size for upgrade and dismantle to 31x31 (from 11x11)"); FactoryPatch.LargerAreaForTerraformEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LargerAreaForTerraform", false, "Increase maximum area size for terraform to 30x30 (from 10x10)\nNote: this may impact game performance while using large area"); FactoryPatch.OffGridBuildingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "OffGridBuilding", false, "Enable off grid building and stepped rotation"); FactoryPatch.TreatStackingAsSingleEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "TreatStackingAsSingle", false, "Treat stack items as single in monitor components"); FactoryPatch.QuickBuildAndDismantleLabsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "QuickBuildAndDismantleLab", false, "Quick build and dismantle stacking labs"); FactoryPatch.ProtectVeinsFromExhaustionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "ProtectVeinsFromExhaustion", false, "Protect veins from exhaustion"); FactoryPatch.ProtectVeinsFromExhaustion.KeepVeinAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "KeepVeinAmount", 1000, new ConfigDescription("Keep veins amount (0 to disable)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), Array.Empty<object>())).Value; FactoryPatch.ProtectVeinsFromExhaustion.KeepOilSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Factory", "KeepOilSpeed", 1f, new ConfigDescription("Keep minimal oil speed (< 0.1 to disable)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())).Value; FactoryPatch.DoNotRenderEntitiesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DoNotRenderEntities", false, "Do not render factory entities"); FactoryPatch.DragBuildPowerPolesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DragBuildPowerPoles", false, "Drag building power poles in maximum connection range"); FactoryPatch.DragBuildPowerPolesAlternatelyEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DragBuildPowerPolesAlternately", true, "Build Tesla Tower and Wireless Power Tower alternately"); FactoryPatch.BeltSignalsForBuyOutEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "BeltSignalsForBuyOut", false, "Belt signals for buy out dark fog items automatically"); FactoryPatch.TankFastFillInAndTakeOutEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "TankFastFillInAndTakeOut", false, "Fast fill in to and take out from tanks"); FactoryPatch.TankFastFillInAndTakeOutMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "TankFastFillInAndTakeOutMultiplier", 1000, "Speed multiplier for fast filling in to and takeing out from tanks"); FactoryPatch.CutConveyorBeltEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "CutConveyorBeltShortcut", false, "Cut conveyor belt (with shortcut key)"); FactoryPatch.TweakBuildingBufferEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "TweakBuildingBuffer", false, "Tweak buffer count for assemblers and power generators"); FactoryPatch.AssemblerBufferTimeMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AssemblerBufferTimeMultiplier", 4, new ConfigDescription("Assembler buffer time multiplier in seconds", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 10), Array.Empty<object>())); FactoryPatch.AssemblerBufferMininumMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AssemblerBufferMininumMultiplier", 4, new ConfigDescription("Assembler buffer minimum multiplier", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 10), Array.Empty<object>())); FactoryPatch.LabBufferMaxCountForAssemble = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "LabBufferMaxCountForAssemble", 6, new ConfigDescription("Buffer count for assembling in labs", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>())); FactoryPatch.LabBufferExtraCountForAdvancedAssemble = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "LabBufferExtraCountForAdvancedAssemble", 3, new ConfigDescription("Extra buffer count for Self-evolution Labs", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>())); FactoryPatch.LabBufferMaxCountForResearch = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "LabBufferMaxCountForResearch", 10, new ConfigDescription("Buffer count for researching in labs", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>())); FactoryPatch.ReceiverBufferCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "ReceiverBufferCount", 1, new ConfigDescription("Ray Receiver Graviton Lens buffer count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>())); FactoryPatch.DismantleBlueprintSelectionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DismantleBlueprintSelection", false, "Dismantle blueprint selected buildings"); LogisticsPatch.AutoConfigLogisticsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigLogistics", false, "Auto-config logistic stations"); LogisticsPatch.AutoConfigLimitAutoReplenishCount = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigLimitAutoReplenishCount", false, "Limit auto-replenish count to config values"); LogisticsPatch.AutoConfigDispenserChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigDispenserChargePower", 30, new ConfigDescription("LD: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 30), Array.Empty<object>())); LogisticsPatch.AutoConfigDispenserCourierCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigDispenserCourierCount", 10, new ConfigDescription("LD: Count of Bots filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>())); LogisticsPatch.AutoConfigBattleBaseChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigBattleBaseChargePower", 8, new ConfigDescription("Battlefield Analysis Base: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(4, 40), Array.Empty<object>())); LogisticsPatch.AutoConfigPLSChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSChargePower", 4, new ConfigDescription("PLS: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>())); LogisticsPatch.AutoConfigPLSMaxTripDrone = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSMaxTripDrone", 180, new ConfigDescription("PLS: Drone transport range", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 180), Array.Empty<object>())); LogisticsPatch.AutoConfigPLSDroneMinDeliver = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSDroneMinDeliver", 10, new ConfigDescription("PLS: Min. Load of Drones", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>())); LogisticsPatch.AutoConfigPLSMinPilerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSMinPilerValue", 0, new ConfigDescription("PLS: Outgoing integration count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>())); LogisticsPatch.AutoConfigPLSDroneCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSDroneCount", 10, new ConfigDescription("PLS: Count of Drones filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 50), Array.Empty<object>())); LogisticsPatch.AutoConfigILSChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSChargePower", 4, new ConfigDescription("ILS: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>())); LogisticsPatch.AutoConfigILSMaxTripDrone = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSMaxTripDrone", 180, new ConfigDescription("ILS: Drone transport range", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 180), Array.Empty<object>())); LogisticsPatch.AutoConfigILSMaxTripShip = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSMaxTripShip", 41, new ConfigDescription("ILS: Vessel transport range", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 41), Array.Empty<object>())); LogisticsPatch.AutoConfigILSWarperDistance = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSWarperDistance", 16, new ConfigDescription("ILS: Warp distance", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 21), Array.Empty<object>())); LogisticsPatch.AutoConfigILSDroneMinDeliver = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSDroneMinDeliver", 10, new ConfigDescription("ILS: Min. Load of Drones", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>())); LogisticsPatch.AutoConfigILSShipMinDeliver = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSShipMinDeliver", 10, new ConfigDescription("ILS: Min. Load of Vessels", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>())); LogisticsPatch.AutoConfigILSMinPilerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSMinPilerValue", 0, new ConfigDescription("ILS: Outgoing integration count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>())); LogisticsPatch.AutoConfigILSIncludeOrbitCollector = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigILSIncludeOrbitCollector", true, "ILS: Include Orbital Collector"); LogisticsPatch.AutoConfigILSWarperNecessary = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigILSWarperNecessary", true, "ILS: Warpers required"); LogisticsPatch.AutoConfigILSDroneCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSDroneCount", 20, new ConfigDescription("ILS: Count of Drones filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); LogisticsPatch.AutoConfigILSShipCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSShipCount", 10, new ConfigDescription("ILS: Count of Vessels filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>())); LogisticsPatch.AutoConfigVeinCollectorHarvestSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigVeinCollectorHarvestSpeed", 20, new ConfigDescription("AMM: Collecting Speed", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 20), Array.Empty<object>())); LogisticsPatch.AutoConfigVeinCollectorMinPilerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigVeinCollectorMinPilerValue", 0, new ConfigDescription("AMM: Outgoing integration count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>())); LogisticsPatch.LogisticsCapacityTweaksEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LogisticsCapacityTweaks", true, "Logistics capacity related tweaks"); LogisticsPatch.AllowOverflowInLogisticsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AllowOverflowInLogistics", false, "Allow overflow in logistic stations"); LogisticsPatch.LogisticsConstrolPanelImprovementEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LogisticsConstrolPanelImprovement", false, "Logistics control panel improvement"); LogisticsPatch.RealtimeLogisticsInfoPanelEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "RealtimeLogisticsInfoPanel", false, "Realtime logistics info panel"); LogisticsPatch.RealtimeLogisticsInfoPanelBarsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "RealtimeLogisticsInfoPanelBars", false, "Realtime logistics info panel - Show status bars for storage item"); PlanetFunctions.OrbitalCollectorMaxBuildCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "OCMaxBuildCount", 0, "Maximum Orbital Collectors to build once, set to 0 to build as many as possible"); PlayerPatch.EnhancedMechaForgeCountControlEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("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"); PlayerPatch.HideTipsForSandsChangesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "HideTipsForGettingSands", false, "Hide tips for getting soil piles"); PlayerPatch.ShortcutKeysForStarsNameEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "ShortcutKeysForStarsName", false, "Shortcut keys for showing stars' name"); PlayerPatch.AutoNavigationEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "AutoNavigation", false, "Auto navigation"); PlayerPatch.AutoCruiseEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "AutoCruise", false, "Auto-cruise enabled"); PlayerPatch.AutoBoostEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "AutoBoost", false, "Auto boost speed with auto-cruise enabled"); PlayerPatch.DistanceToWarp = ((BaseUnityPlugin)this).Config.Bind<double>("Player", "DistanceToWarp", 5.0, "Distance to warp (in AU)"); TechPatch.SorterCargoStackingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Tech", "SorterCargoStacking", false, "Restore upgrades of `Sorter Cargo Stacking` on panel"); TechPatch.DisableBattleRelatedTechsInPeaceModeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Tech", "DisableBattleRelatedTechsInPeaceMode", false, "Disable battle-related techs in Peace mode"); TechPatch.BatchBuyoutTechEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Tech", "BatchBuyoutTech", false, "Can buy out techs with their prerequisites"); DysonSpherePatch.StopEjectOnNodeCompleteEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "StopEjectOnNodeComplete", false, "Stop ejectors when available nodes are all filled up"); DysonSpherePatch.OnlyConstructNodesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "OnlyConstructNodes", false, "Construct only nodes but frames"); DysonSpherePatch.AutoConstructMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("DysonSphere", "AutoConstructMultiplier", 1, "Dyson Sphere auto-construct speed multiplier"); I18N.Init(); I18N.Add("UXAssist Config", "UXAssist Config", "UX助手设置"); PatchImpl<GameLogic>.Enable(enable: true); UIConfigWindow.Init(); _patches = global::UXAssist.Common.Util.GetTypesFiltered(Assembly.GetExecutingAssembly(), (Type t) => string.Equals(t.Namespace, "UXAssist.Patches", StringComparison.Ordinal) || string.Equals(t.Namespace, "UXAssist.Functions", StringComparison.Ordinal)); Type[] patches = _patches; if (patches != null) { CollectionExtensions.Do<Type>((IEnumerable<Type>)patches, (Action<Type>)delegate(Type type) { type.GetMethod("Init")?.Invoke(null, null); }); } _compats = global::UXAssist.Common.Util.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "UXAssist.ModsCompat"); Type[] compats = _compats; if (compats != null) { CollectionExtensions.Do<Type>((IEnumerable<Type>)compats, (Action<Type>)delegate(Type type) { type.GetMethod("Init")?.Invoke(null, null); }); } I18N.Apply(); } private void Start() { MyWindowManager.InitBaseObjects(); MyWindowManager.Enable(on: true); Type[] patches = _patches; if (patches != null) { CollectionExtensions.Do<Type>((IEnumerable<Type>)patches, (Action<Type>)delegate(Type type) { type.GetMethod("Start")?.Invoke(null, null); }); } object[] parameters = new object[1] { PatchImpl<UIPatch>.GetHarmony() }; Type[] compats = _compats; if (compats != null) { CollectionExtensions.Do<Type>((IEnumerable<Type>)compats, (Action<Type>)delegate(Type type) { type.GetMethod("Start")?.Invoke(null, parameters); }); } } private void OnDestroy() { Type[] patches = _patches; if (patches != null) { CollectionExtensions.Do<Type>((IEnumerable<Type>)patches, (Action<Type>)delegate(Type type) { type.GetMethod("Uninit")?.Invoke(null, null); }); } PatchImpl<UIPatch>.Enable(enable: false); MyWindowManager.Enable(on: false); PatchImpl<GameLogic>.Enable(enable: false); } private void Update() { if (!VFInput.inputing) { if (DSPGame.IsMenuDemo) { UIFunctions.OnInputUpdate(); return; } LogisticsPatch.OnInputUpdate(); UIFunctions.OnInputUpdate(); GamePatch.OnInputUpdate(); FactoryPatch.OnInputUpdate(); PlayerPatch.OnInputUpdate(); } } private void FixedUpdate() { LogisticsPatch.OnUpdate(); } } public static class PluginInfo { public const string PLUGIN_GUID = "org.soardev.uxassist"; public const string PLUGIN_NAME = "UXAssist"; public const string PLUGIN_VERSION = "1.3.5"; } } namespace UXAssist.UI { public class MyCheckBox : MonoBehaviour { public RectTransform rectTrans; public UIButton uiButton; public Image boxImage; public Image checkImage; public Text labelText; private bool _checked; private static GameObject _baseObject; private static readonly Color BoxColor = new Color(1f, 1f, 1f, 20f / 51f); private static readonly Color CheckColor = new Color(1f, 1f, 1f, 1f); private static readonly Color TextColor = new Color(0.69803923f, 0.69803923f, 0.69803923f, 56f / 85f); private EventHandler _configChanged; private Action _checkedChanged; private ConfigEntry<bool> _config; public bool Checked { get { return _checked; } set { _checked = value; ((Behaviour)checkImage).enabled = value; } } public float Width => rectTrans.sizeDelta.x + ((Graphic)labelText).rectTransform.sizeDelta.x; public float Height => Math.Max(rectTrans.sizeDelta.y, ((Graphic)labelText).rectTransform.sizeDelta.y); public event Action OnChecked; public static void InitBaseObject() { if (Object.op_Implicit((Object)(object)_baseObject)) { return; } GameObject obj = Object.Instantiate<GameObject>(((Component)UIRoot.instance.uiGame.buildMenu.uxFacilityCheck).gameObject); ((Object)obj).name = "my-checkbox"; obj.SetActive(false); Transform val = obj.transform.Find("text"); if (Object.op_Implicit((Object)(object)val)) { Text component = ((Component)val).GetComponent<Text>(); if (Object.op_Implicit((Object)(object)component)) { component.text = ""; } Localizer component2 = ((Component)val).GetComponent<Localizer>(); if (Object.op_Implicit((Object)(object)component2)) { Object.DestroyImmediate((Object)(object)component2); } } _baseObject = obj; } protected void OnDestroy() { if (_config != null) { _config.SettingChanged -= _configChanged; } } public static MyCheckBox CreateCheckBox(float x, float y, RectTransform parent, ConfigEntry<bool> config, string label = "", int fontSize = 15) { return CreateCheckBox(x, y, parent, config.Value, label, fontSize).WithConfigEntry(config); } public static MyCheckBox CreateCheckBox(float x, float y, RectTransform parent, bool check, string label = "", int fontSize = 15) { return CreateCheckBox(x, y, parent, fontSize).WithCheck(check).WithLabelText(label); } public static MyCheckBox CreateCheckBox(float x, float y, RectTransform parent, int fontSize = 15) { GameObject val = Object.Instantiate<GameObject>(_baseObject); ((Object)val).name = "my-checkbox"; val.SetActive(true); MyCheckBox myCheckBox = val.AddComponent<MyCheckBox>(); RectTransform val2 = Util.NormalizeRectWithTopLeft((Component)(object)myCheckBox, x, y, (Transform)(object)parent); myCheckBox.rectTrans = val2; myCheckBox.uiButton = val.GetComponent<UIButton>(); myCheckBox.boxImage = ((Component)val.transform).GetComponent<Image>(); Transform obj = val.transform.Find("checked"); myCheckBox.checkImage = ((obj != null) ? ((Component)obj).GetComponent<Image>() : null); Util.NormalizeRectWithTopLeft((Component)(object)myCheckBox.checkImage, 0f, 0f); Transform val3 = val.transform.Find("text"); if ((Object)(object)val3 != (Object)null) { myCheckBox.labelText = ((Component)val3).GetComponent<Text>(); if (Object.op_Implicit((Object)(object)myCheckBox.labelText)) { myCheckBox.labelText.text = ""; myCheckBox.labelText.fontSize = fontSize; myCheckBox.UpdateLabelTextWidth(); } } myCheckBox.uiButton.onClick += myCheckBox.OnClick; return myCheckBox; } private void UpdateLabelTextWidth() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)labelText)) { ((Graphic)labelText).rectTransform.sizeDelta = new Vector2(labelText.preferredWidth, ((Graphic)labelText).rectTransform.sizeDelta.y); } } public void SetLabelText(string val) { if ((Object)(object)labelText != (Object)null) { labelText.text = Localization.Translate(val); UpdateLabelTextWidth(); } } public void SetEnable(bool on) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)uiButton)) { ((Behaviour)uiButton).enabled = on; } if (on) { if (Object.op_Implicit((Object)(object)boxImage)) { ((Graphic)boxImage).color = BoxColor; } if (Object.op_Implicit((Object)(object)checkImage)) { ((Graphic)checkImage).color = CheckColor; } if (Object.op_Implicit((Object)(object)labelText)) { ((Graphic)labelText).color = TextColor; } return; } Color val; if (Object.op_Implicit((Object)(object)boxImage)) { Image obj = boxImage; val = BoxColor; ((Graphic)obj).color = ((Color)(ref val)).RGBMultiplied(0.5f); } if (Object.op_Implicit((Object)(object)checkImage)) { Image obj2 = checkImage; val = CheckColor; ((Graphic)obj2).color = ((Color)(ref val)).RGBMultiplied(0.5f); } if (Object.op_Implicit((Object)(object)labelText)) { Text obj3 = labelText; val = TextColor; ((Graphic)obj3).color = ((Color)(ref val)).RGBMultiplied(0.5f); } } public void SetConfigEntry(ConfigEntry<bool> config) { if (_checkedChanged != null) { OnChecked -= _checkedChanged; } if (_configChanged != null) { config.SettingChanged -= _configChanged; } _config = config; _checkedChanged = delegate { config.Value = !config.Value; }; OnChecked += _checkedChanged; _configChanged = delegate { Checked = config.Value; }; config.SettingChanged += _configChanged; } public MyCheckBox WithLabelText(string val) { SetLabelText(val); return this; } public MyCheckBox WithCheck(bool check) { Checked = check; return this; } public MyCheckBox WithSmallerBox(float boxSize = 20f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) float x = rectTrans.sizeDelta.x; rectTrans.sizeDelta = new Vector2(boxSize, boxSize); ((Graphic)checkImage).rectTransform.sizeDelta = new Vector2(boxSize, boxSize); ((Graphic)labelText).rectTransform.sizeDelta = new Vector2(((Graphic)labelText).rectTransform.sizeDelta.x, boxSize); ((Transform)((Graphic)labelText).rectTransform).localPosition = new Vector3(((Transform)((Graphic)labelText).rectTransform).localPosition.x + boxSize - x, ((Transform)((Graphic)labelText).rectTransform).localPosition.y, ((Transform)((Graphic)labelText).rectTransform).localPosition.z); return this; } public MyCheckBox WithEnable(bool on) { SetEnable(on); return this; } public MyCheckBox WithConfigEntry(ConfigEntry<bool> config) { SetConfigEntry(config); return this; } public void OnClick(int obj) { _checked = !_checked; ((Behaviour)checkImage).enabled = _checked; this.OnChecked?.Invoke(); } } public class MyCheckButton : MonoBehaviour { public RectTransform rectTrans; public UIButton uiButton; public Image icon; public Text labelText; private bool _checked; private float _iconWidth = 28f; private static GameObject _baseObject; private static Color openMouseOverColor; private static Color openPressColor; private static Color openNormalColor; private static Color closeMouseOverColor; private static Color closePressColor; private static Color closeNormalColor; private EventHandler _configChanged; private Action _checkedChanged; private ConfigEntry<bool> _config; public bool Checked { get { return _checked; } set { _checked = value; UpdateCheckColor(); } } public float Width => rectTrans.sizeDelta.x + ((Graphic)labelText).rectTransform.sizeDelta.x; public float Height => Math.Max(rectTrans.sizeDelta.y, ((Graphic)labelText).rectTransform.sizeDelta.y); public event Action OnChecked; public static void InitBaseObject() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_baseObject)) { return; } UITankWindow tankWindow = UIRoot.instance.uiGame.tankWindow; openMouseOverColor = tankWindow.openMouseOverColor; openPressColor = tankWindow.openPressColor; openNormalColor = tankWindow.openNormalColor; closeMouseOverColor = tankWindow.closeMouseOverColor; closePressColor = tankWindow.closePressColor; closeNormalColor = tankWindow.closeNormalColor; GameObject obj = Object.Instantiate<GameObject>(((Component)UIRoot.instance.uiGame.beltWindow.reverseButton).gameObject); ((Object)obj).name = "my-checkbutton"; obj.SetActive(false); Transform val = obj.transform.Find("text"); if (Object.op_Implicit((Object)(object)val)) { Text component = ((Component)val).GetComponent<Text>(); if (Object.op_Implicit((Object)(object)component)) { component.text = ""; component.alignment = (TextAnchor)4; ((Graphic)component).rectTransform.anchorMax = new Vector2(0f, 1f); ((Graphic)component).rectTransform.anchorMin = new Vector2(0f, 1f); ((Graphic)component).rectTransform.pivot = new Vector2(0f, 1f); ((Transform)((Graphic)component).rectTransform).localPosition = new Vector3(0f, 0f, 0f); } Localizer component2 = ((Component)val).GetComponent<Localizer>(); if (Object.op_Implicit((Object)(object)component2)) { Object.DestroyImmediate((Object)(object)component2); } } _baseObject = obj; } protected void OnDestroy() { if (_config != null) { _config.SettingChanged -= _configChanged; } } public static MyCheckButton CreateCheckButton(float x, float y, RectTransform parent, ConfigEntry<bool> config, string label = "", int fontSize = 15) { return CreateCheckButton(x, y, parent, config.Value, label, fontSize).WithConfigEntry(config); } public static MyCheckButton CreateCheckButton(float x, float y, RectTransform parent, bool check, string label = "", int fontSize = 15) { return CreateCheckButton(x, y, parent, fontSize).WithCheck(check).WithLabelText(label); } public static MyCheckButton CreateCheckButton(float x, float y, RectTransform parent, int fontSize = 15) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(_baseObject); ((Object)val).name = "my-checkbutton"; val.SetActive(true); MyCheckButton myCheckButton = val.AddComponent<MyCheckButton>(); RectTransform val2 = (myCheckButton.rectTrans = Util.NormalizeRectWithTopLeft((Component)(object)myCheckButton, x, y, (Transform)(object)parent)); myCheckButton.uiButton = val.GetComponent<UIButton>(); Transform val3 = val.transform.Find("text"); if ((Object)(object)val3 != (Object)null) { myCheckButton.labelText = ((Component)val3).GetComponent<Text>(); if (Object.op_Implicit((Object)(object)myCheckButton.labelText)) { myCheckButton.labelText.text = ""; myCheckButton.labelText.fontSize = fontSize; } } myCheckButton._iconWidth = Mathf.Min((myCheckButton._iconWidth > 0f) ? myCheckButton._iconWidth : 32f, val2.sizeDelta.y); myCheckButton.UpdateCheckC