using System; using System.Collections.Concurrent; 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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BuildBarTool; using CommonAPI; using CommonAPI.Patches; using CommonAPI.Systems; using CommonAPI.Systems.ModLocalization; using DSP_Battle; using FE.Compatibility; using FE.Logic.Building; using FE.Logic.Manager; using FE.Logic.Recipe; using FE.UI.Components; using FE.UI.View; using FE.UI.View.CoreOperate; using FE.UI.View.GetItemRecipe; using FE.UI.View.ModPackage; using FE.UI.View.ProgressSystem; using FE.UI.View.Setting; using FE.UI.View.Statistic; using FE.Utils; using HarmonyLib; using Microsoft.CodeAnalysis; using NebulaAPI; using NebulaAPI.GameState; using NebulaAPI.Interfaces; using NebulaAPI.Networking; using NebulaAPI.Packets; using ProjectGenesis.Patches; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; using UnityEngine.UI.Youthcat; using crecheng.DSPModSave; using xiaoye97; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("FractionateEverything")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FractionateEverything")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3204cf73-a6e8-4c3b-a91d-e4baf6fca974")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } internal static class PluginInfo { public const string PLUGIN_GUID = "com.menglei.dsp.fe"; public const string PLUGIN_NAME = "FractionateEverything"; public const string PLUGIN_VERSION = "2.2.10"; } namespace FE { [BepInPlugin("com.menglei.dsp.fe", "FractionateEverything", "2.2.10")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [CommonAPISubmoduleDependency(new string[] { "CustomKeyBindSystem", "ProtoRegistry", "TabSystem", "LocalizationModule" })] public class FractionateEverything : BaseUnityPlugin, IModCanSave, IMultiplayerModWithSettings, IMultiplayerMod { public const string Tech1134IconPath = "Icons/Tech/1134"; public static int tab分馏; public static string ModPath; public static ResourceData FEAssets; public static readonly Harmony harmony = new Harmony("com.menglei.dsp.fe"); private static bool _finished; private static ConfigFile configFile; public string Version => "2.2.10"; public void LoadConfig() { configFile = ((BaseUnityPlugin)this).Config; CheckPlugins.DisableMessageBox = ((BaseUnityPlugin)this).Config.Bind("other", "DisableMessageBox", false, "Don't show messagebox when FractionateEverything loaded."); MainWindow.LoadConfig(((BaseUnityPlugin)this).Config); Traverse.Create((object)((BaseUnityPlugin)this).Config).Property("OrphanedEntries", (object[])null).GetValue>() .Clear(); ((BaseUnityPlugin)this).Config.Save(); } public static void SaveConfig() { configFile.Save(); } public void Awake() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown using (ProtoRegistry.StartModLoad("com.menglei.dsp.fe")) { FE.Utils.Utils.InitLogger(((BaseUnityPlugin)this).Logger); FE.Utils.Utils.Register("分馏页面", "Fractionate", "分馏"); FE.Utils.Utils.Register("分馏与插件页面", "Frac&Beacon", "分馏&插件"); ERecipeExtension.AddTranslations(); OutputInfo.AddTranslations(); FE.Utils.Utils.AddTranslations(); BuildingManager.AddTranslations(); ItemManager.AddTranslations(); ProcessManager.AddTranslations(); StationManager.AddTranslations(); TechManager.AddTranslations(); TutorialManager.AddTranslations(); MainWindow.AddTranslations(); LoadConfig(); tab分馏 = TabSystem.RegisterTab("com.menglei.dsp.fe:com.menglei.dsp.feTab", new TabData(Localization.Translate("分馏页面"), "Icons/Tech/1134")); Assembly executingAssembly = Assembly.GetExecutingAssembly(); ModPath = Path.GetDirectoryName(executingAssembly.Location); FEAssets = new ResourceData("com.menglei.dsp.fe", "fe", ModPath); FEAssets.LoadAssetBundle("fe"); ProtoRegistry.AddResource(FEAssets); NebulaModAPI.RegisterPackets(executingAssembly); LDBTool.PreAddDataAction = (Action)Delegate.Combine(LDBTool.PreAddDataAction, new Action(PreAddData)); LDBTool.PostAddDataAction = (Action)Delegate.Combine(LDBTool.PostAddDataAction, new Action(PostAddData)); string @namespace = typeof(CheckPlugins).Namespace; Type[] types = executingAssembly.GetTypes(); foreach (Type type in types) { if (type.Namespace != null && (@namespace == null || !type.Namespace.StartsWith(@namespace))) { harmony.PatchAll(type); } } Harmony obj = harmony; MethodInfo methodInfo = AccessTools.Method(typeof(VFPreload), "InvokeOnLoadWorkEnded", (Type[])null, (Type[])null); HarmonyMethod val = new HarmonyMethod(typeof(FractionateEverything), "FinalAction", (Type[])null); val.after = new string[1] { "me.xiaoye97.plugin.Dyson.LDBTool" }; obj.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); MainWindow.Init(); } } private void Start() { MyWindowManager.InitBaseObjects(); MyWindowManager.Enable(on: true); } private void OnDestroy() { MyWindowManager.Enable(on: false); } private void Update() { MainWindow.OnInputUpdate(); } public void PreAddData() { ItemManager.AddFractionalPrototypeAndEssence(); BuildingManager.AddFractionators(); TechManager.AddTechs(); TutorialManager.AddTutorials(); } public void PostAddData() { BuildingManager.SetFractionatorMaterial(); } public static void FinalAction() { if (!_finished) { PreloadAndInitAll(); ProcessManager.Init(); ItemManager.CalculateItemValues(); ItemManager.ClassifyItemsToMatrix(); BuildingManager.UpdateHpAndEnergy(); BuildingManager.SetFractionatorCacheSize(); RecipeManager.AddFracRecipes(); StationManager.CalculateItemModSaveCount(); _finished = true; } } public static void PreloadAndInitAll() { ItemProto.InitFuelNeeds(); ItemProto.InitTurretNeeds(); ItemProto.InitFluids(); ItemProto.InitTurrets(); ItemProto.InitEnemyDropTables(); ItemProto.InitConstructableItems(); ItemProto.InitItemIds(); ItemProto.InitItemIndices(); ItemProto.InitMechaMaterials(); ItemProto.InitFighterIndices(); ItemProto.InitPowerFacilityIndices(); ItemProto.InitProductionMask(); ModelProto.InitMaxModelIndex(); ModelProto.InitModelIndices(); ModelProto.InitModelOrders(); RecipeProto.InitRecipeItems(); RecipeProto.InitFractionatorNeeds(); SignalProtoSet.InitSignalKeyIdPairs(); RaycastLogic.LoadStatic(); StorageComponent.staticLoaded = false; StorageComponent.LoadStatic(); } public void Import(BinaryReader r) { BaseIntoOtherSave(); int num = r.ReadInt32(); RecipeManager.Import(r); BuildingManager.Import(r); ItemManager.Import(r); MainWindow.Import(r); if (num >= 2) { StationManager.Import(r); } } public void Export(BinaryWriter w) { w.Write(2); RecipeManager.Export(w); BuildingManager.Export(w); ItemManager.Export(w); MainWindow.Export(w); StationManager.Export(w); } public void IntoOtherSave() { if (!NebulaMultiplayerModAPI.IsClient) { BaseIntoOtherSave(); } } private void BaseIntoOtherSave() { RecipeManager.IntoOtherSave(); BuildingManager.IntoOtherSave(); ItemManager.IntoOtherSave(); MainWindow.IntoOtherSave(); StationManager.IntoOtherSave(); TechManager.ResetTechUnlockFlags(); } public bool CheckVersion(string hostVersion, string clientVersion) { return hostVersion.Equals(clientVersion); } } } namespace FE.Utils { public static class Utils { private record struct ModStr { public string key; public string enTrans; public string cnTrans; } private static readonly List modStringList = new List(); private static ManualLogSource logger; private static readonly int[] testPackageUsedCounts = new int[12000]; private static DateTime lastSortTime = DateTime.MinValue; internal const int I伊卡洛斯 = 0; internal const int I行星基地 = 1; internal const int I巨构星际组装厂 = 2; internal const int I水 = 1000; internal const int I铁矿 = 1001; internal const int I铜矿 = 1002; internal const int I硅石 = 1003; internal const int I钛石 = 1004; internal const int I石矿 = 1005; internal const int I煤矿 = 1006; internal const int I原油 = 1007; internal const int I可燃冰 = 1011; internal const int I金伯利矿石 = 1012; internal const int I分形硅石 = 1013; internal const int IOR莫桑石 = 1013; internal const int I光栅石 = 1014; internal const int I刺笋结晶 = 1015; internal const int I单极磁石 = 1016; internal const int I木材 = 1030; internal const int IOR植物纤维 = 1030; internal const int I植物燃料 = 1031; internal const int IOR生物质 = 1031; internal const int I沙土 = 1099; internal const int I铁块 = 1101; internal const int I磁铁 = 1102; internal const int I钢材 = 1103; internal const int I铜块 = 1104; internal const int I高纯硅块 = 1105; internal const int I钛块 = 1106; internal const int I钛合金 = 1107; internal const int IOR碳化钛合金 = 1107; internal const int I石材 = 1108; internal const int IOR钢筋混凝土 = 1108; internal const int I高能石墨 = 1109; internal const int IOR石墨 = 1109; internal const int I玻璃 = 1110; internal const int I棱镜 = 1111; internal const int I金刚石 = 1112; internal const int I晶格硅 = 1113; internal const int IOR碳化硅 = 1113; internal const int I精炼油 = 1114; internal const int IGB焦油 = 1114; internal const int IOR重油 = 1114; internal const int I塑料 = 1115; internal const int IGB聚丙烯 = 1115; internal const int I硫酸 = 1116; internal const int I有机晶体 = 1117; internal const int I钛晶石 = 1118; internal const int I钛化玻璃 = 1119; internal const int I氢 = 1120; internal const int I重氢 = 1121; internal const int I反物质 = 1122; internal const int I石墨烯 = 1123; internal const int I碳纳米管 = 1124; internal const int I框架材料 = 1125; internal const int I卡西米尔晶体 = 1126; internal const int IOR金属氢 = 1126; internal const int I奇异物质 = 1127; internal const int I燃烧单元 = 1128; internal const int I爆破单元 = 1129; internal const int IOR炸药单元 = 1129; internal const int I晶石爆破单元 = 1130; internal const int I地基 = 1131; internal const int I增产剂MkI = 1141; internal const int I增产剂MkII = 1142; internal const int I增产剂MkIII = 1143; internal const int IGB增产剂 = 1143; internal const int IOR增产剂 = 1143; internal const int I齿轮 = 1201; internal const int I磁线圈 = 1202; internal const int I电动机 = 1203; internal const int I电磁涡轮 = 1204; internal const int I超级磁场环 = 1205; internal const int I粒子容器 = 1206; internal const int I临界光子 = 1208; internal const int I引力透镜 = 1209; internal const int I空间翘曲器 = 1210; internal const int I电路板 = 1301; internal const int I微晶元件 = 1302; internal const int IOR晶圆 = 1302; internal const int I处理器 = 1303; internal const int IOR主板 = 1303; internal const int I位面过滤器 = 1304; internal const int I量子芯片 = 1305; internal const int I电浆激发器 = 1401; internal const int IOR激光发生器 = 1401; internal const int I粒子宽带 = 1402; internal const int I湮灭约束球 = 1403; internal const int I光子合并器 = 1404; internal const int I推进器 = 1405; internal const int I加力推进器 = 1406; internal const int I动力引擎 = 1407; internal const int I太阳帆 = 1501; internal const int I戴森球组件 = 1502; internal const int I小型运载火箭 = 1503; internal const int I机枪弹箱 = 1601; internal const int I钛化弹箱 = 1602; internal const int I超合金弹箱 = 1603; internal const int I炮弹组 = 1604; internal const int I高爆炮弹组 = 1605; internal const int IOR杀爆榴弹组 = 1605; internal const int I晶石炮弹组 = 1606; internal const int I等离子胶囊 = 1607; internal const int IOR氘核轨道弹 = 1607; internal const int I反物质胶囊 = 1608; internal const int IOR反物质轨道弹 = 1608; internal const int I导弹组 = 1609; internal const int I超音速导弹组 = 1610; internal const int I引力导弹组 = 1611; internal const int IOR重力鱼雷 = 1611; internal const int I干扰胶囊 = 1612; internal const int I压制胶囊 = 1613; internal const int I液氢燃料棒 = 1801; internal const int I氘核燃料棒 = 1802; internal const int I反物质燃料棒 = 1803; internal const int I奇异湮灭燃料棒 = 1804; internal const int I传送带 = 2001; internal const int I高速传送带 = 2002; internal const int I极速传送带 = 2003; internal const int I分拣器 = 2011; internal const int I高速分拣器 = 2012; internal const int I极速分拣器 = 2013; internal const int I集装分拣器 = 2014; internal const int I四向分流器 = 2020; internal const int I流速监测器 = 2030; internal const int I自动集装机 = 2040; internal const int I小型储物仓 = 2101; internal const int I大型储物仓 = 2102; internal const int I行星内物流运输站 = 2103; internal const int IOR物流立交 = 2103; internal const int I星际物流运输站 = 2104; internal const int IOR太空物流港 = 2104; internal const int I轨道采集器 = 2105; internal const int I储液罐 = 2106; internal const int I物流配送器 = 2107; internal const int I电力感应塔 = 2201; internal const int I无线输电塔 = 2202; internal const int I风力涡轮机 = 2203; internal const int I火力发电厂 = 2204; internal const int IGB燃料电池发电厂 = 2204; internal const int I太阳能板 = 2205; internal const int I蓄电器 = 2206; internal const int IOR蓄电器mk2 = 2206; internal const int I蓄电器满 = 2207; internal const int IOR蓄电器mk2满 = 2207; internal const int I射线接收站 = 2208; internal const int IMS射线重构站 = 2208; internal const int I能量枢纽 = 2209; internal const int I人造恒星 = 2210; internal const int IGB朱曦K型人造恒星 = 2210; internal const int IOR地上太阳 = 2210; internal const int I微型聚变发电站 = 2211; internal const int IGB裂变能源发电站 = 2211; internal const int IOR裂变重水堆 = 2211; internal const int I卫星配电站 = 2212; internal const int I地热发电站 = 2213; internal const int I采矿机 = 2301; internal const int I电弧熔炉 = 2302; internal const int I制造台MkI = 2303; internal const int IGB基础制造台 = 2303; internal const int IOR基础制造台 = 2303; internal const int I制造台MkII = 2304; internal const int IGB标准制造单元 = 2304; internal const int IOR高速装配线 = 2304; internal const int I制造台MkIII = 2305; internal const int IGB高精度装配线 = 2305; internal const int IOR粒子打印车间 = 2305; internal const int I抽水站 = 2306; internal const int IOR流体抽取平台 = 2306; internal const int I原油萃取站 = 2307; internal const int IOR激光钻井平台 = 2307; internal const int I原油精炼厂 = 2308; internal const int I化工厂 = 2309; internal const int I微型粒子对撞机 = 2310; internal const int I电磁轨道弹射器 = 2311; internal const int I垂直发射井 = 2312; internal const int IOR电磁弹射井 = 2312; internal const int I喷涂机 = 2313; internal const int I分馏塔 = 2314; internal const int I位面熔炉 = 2315; internal const int IOR等离子熔炉 = 2315; internal const int I大型采矿机 = 2316; internal const int I量子化工厂 = 2317; internal const int IGB先进化学反应釜 = 2317; internal const int I重组式制造台 = 2318; internal const int IGB物质重组工厂 = 2318; internal const int IOR物质重组工厂 = 2318; internal const int I负熵熔炉 = 2319; internal const int I矩阵研究站 = 2901; internal const int I自演化研究站 = 2902; internal const int I高斯机枪塔 = 3001; internal const int I高频激光塔 = 3002; internal const int I聚爆加农炮 = 3003; internal const int IOR轨道加农炮 = 3003; internal const int I磁化电浆炮 = 3004; internal const int IOR重型电浆炮 = 3004; internal const int I导弹防御塔 = 3005; internal const int I干扰塔 = 3006; internal const int IORECM脉冲发射器 = 3006; internal const int I信号塔 = 3007; internal const int I行星护盾发生器 = 3008; internal const int I战场分析基站 = 3009; internal const int I近程电浆塔 = 3010; internal const int IOR近防电浆炮 = 3010; internal const int I物流运输机 = 5001; internal const int I星际物流运输船 = 5002; internal const int IOR太空运输船 = 5002; internal const int I配送运输机 = 5003; internal const int I原型机 = 5101; internal const int I精准无人机 = 5102; internal const int IOR攻击无人机 = 5102; internal const int I攻击无人机 = 5103; internal const int IOR精准无人机 = 5103; internal const int I护卫舰 = 5111; internal const int I驱逐舰 = 5112; internal const int I黑雾矩阵 = 5201; internal const int I硅基神经元 = 5202; internal const int I物质重组器 = 5203; internal const int I负熵奇点 = 5204; internal const int I核心素 = 5205; internal const int I能量碎片 = 5206; internal const int I电磁矩阵 = 6001; internal const int IOR电气矩阵 = 6001; internal const int I能量矩阵 = 6002; internal const int IOR化工矩阵 = 6002; internal const int I结构矩阵 = 6003; internal const int IOR材料矩阵 = 6003; internal const int I信息矩阵 = 6004; internal const int IOR粒子矩阵 = 6004; internal const int I引力矩阵 = 6005; internal const int I宇宙矩阵 = 6006; internal const int IOR大统一矩阵 = 6006; internal const int IGB钨矿 = 6201; internal const int IOR液态金属 = 6201; internal const int IGB铝矿 = 6202; internal const int IOR深层熔岩 = 6202; internal const int IGB铝块 = 6203; internal const int IOR熔融金属 = 6203; internal const int IGB铝合金 = 6204; internal const int IOR金属废液 = 6204; internal const int IGB二氧化硫 = 6205; internal const int IOR甲烷 = 6205; internal const int IGB二氧化碳 = 6206; internal const int IOR激素营养液 = 6206; internal const int IGB硫矿 = 6207; internal const int IOR黄铁矿 = 6207; internal const int IOR激素生长菌群 = 6208; internal const int IGB四氢双环戊二烯JP10 = 6212; internal const int IOR高速生长菌群 = 6212; internal const int IOR次级维度工厂 = 6214; internal const int IOR掌中工厂 = 6215; internal const int IGB四氢双环戊二烯燃料棒 = 6216; internal const int IOR终末螺旋 = 6216; internal const int IGB焦油燃料棒 = 6217; internal const int IOR化学燃料棒 = 6217; internal const int IOR蓄电器 = 6218; internal const int IOR蓄电器满 = 6219; internal const int IGB氮 = 6220; internal const int IGB同位素温差发电机 = 6221; internal const int IOR同位素温差发电机 = 6221; internal const int IGB放射性矿物 = 6222; internal const int IOR铀矿 = 6222; internal const int IGB铀矿 = 6225; internal const int IOR铀238溶液 = 6225; internal const int IGB钚矿 = 6226; internal const int IOR铀235溶液 = 6226; internal const int IGB含铀核燃料 = 6227; internal const int IOR曲率引擎 = 6227; internal const int IGB含钚核燃料 = 6228; internal const int IOR占位物 = 6228; internal const int IGB量子储液罐 = 6229; internal const int IOR量子储液罐 = 6229; internal const int IGB矿物处理厂 = 6230; internal const int IOR深空货舰 = 6230; internal const int IGB量子储物仓 = 6231; internal const int IOR量子储物仓 = 6231; internal const int IGB氦 = 6234; internal const int IOR文明遗物 = 6234; internal const int IGB氦三 = 6235; internal const int IOR十七公斤重的文明 = 6235; internal const int IGB钚燃料棒 = 6241; internal const int IOR文明的定义 = 6241; internal const int IGB铀燃料棒 = 6242; internal const int IOR铀燃料棒 = 6242; internal const int IGBMOX燃料棒 = 6243; internal const int IOR粒子加速器 = 6243; internal const int IGB氦三燃料棒 = 6244; internal const int IOR奇夸克样本 = 6244; internal const int IGB氘氦混合燃料棒 = 6245; internal const int IOR菌丝母株 = 6245; internal const int IGB石粉 = 6251; internal const int IOR岩浆 = 6251; internal const int IGB铁矿粉 = 6252; internal const int IOR大型神经网络 = 6252; internal const int IGB铜矿粉 = 6253; internal const int IOR神经芯片 = 6253; internal const int IGB硅矿粉 = 6254; internal const int IOR手动研究加速 = 6254; internal const int IGB钛矿粉 = 6255; internal const int IOR哈希值 = 6255; internal const int IGB煤矿粉 = 6256; internal const int IOR碳粉 = 6256; internal const int IGB天穹装配厂 = 6257; internal const int IOR太空船坞 = 6257; internal const int IGB物质裂解塔 = 6258; internal const int IOR太空电梯 = 6258; internal const int IGB埃克森美孚化工厂 = 6259; internal const int IOR星环电网枢纽 = 6259; internal const int IGB工业先锋精密加工中心 = 6260; internal const int IOR精密结构组装厂 = 6260; internal const int IGB湛曦O型人造恒星 = 6261; internal const int IOR轨道反物质堆核心 = 6261; internal const int IGB氦闪约束器 = 6263; internal const int IOR太空损管包 = 6263; internal const int IGB物质分解设施 = 6264; internal const int IOR生态穹顶 = 6264; internal const int IGB苍穹粒子加速器 = 6265; internal const int IOR星环对撞机总控站 = 6265; internal const int IGB聚束液体汲取设施 = 6266; internal const int IOR勘察卫星 = 6266; internal const int IGB大气采集站 = 6267; internal const int IOR深空物流港 = 6267; internal const int IGB三元精金 = 6271; internal const int IOR零素装甲 = 6271; internal const int IGB铝矿粉 = 6273; internal const int IOR轨道观测站 = 6273; internal const int IGB硫粉 = 6277; internal const int IOR离子推进器 = 6277; internal const int IGB玻色矩阵 = 6278; internal const int IOR信息矩阵 = 6278; internal const int IGB耗散矩阵 = 6279; internal const int IOR电磁矩阵 = 6279; internal const int IGB奇点矩阵 = 6280; internal const int IOR勘探船 = 6280; internal const int IGB钨矿粉 = 6281; internal const int IOR超空间中继器基座 = 6281; internal const int IGB基础机械组件 = 6501; internal const int IOR轨道熔炼站 = 6501; internal const int IGB先进机械组件 = 6502; internal const int IOR数学率引擎深蓝之井运载火箭 = 6502; internal const int IGB尖端机械组件 = 6503; internal const int IOR数学率引擎算力架构组件 = 6503; internal const int IGB超级机械组件 = 6504; internal const int IOR数学率引擎算力架构运载火箭 = 6504; internal const int IGB创世之书 = 6506; internal const int IOR轨道反物质堆基座 = 6506; internal const int IGB虚空之书 = 6507; internal const int IOR此科技不消耗物品研究1 = 6507; internal const int IGB起源之书 = 6508; internal const int IOR此科技不消耗物品研究2 = 6508; internal const int IGB空燃料棒 = 6509; internal const int IOR此科技不消耗物品研究3 = 6509; internal const int IGB开发者日志01 = 6511; internal const int IOR超空间中继器核心 = 6511; internal const int IGB开发者日志02 = 6512; internal const int IOR预制星舰模块 = 6512; internal const int IGB开发者日志03 = 6513; internal const int IOR重型电磁弹射器 = 6513; internal const int IGB开发者日志04 = 6514; internal const int IOR轨道空投引导站 = 6514; internal const int IGB开发者日志05 = 6515; internal const int IGB开发者日志06 = 6516; internal const int IGB开发者日志07 = 6517; internal const int IGB开发者日志08 = 6518; internal const int IGB开发者日志09 = 6519; internal const int IGB开发者日志10 = 6520; internal const int IGB开发者日志11 = 6521; internal const int IGB电力节约 = 6522; internal const int IGB上传扩容 = 6523; internal const int IGB燃料回收 = 6524; internal const int IGB风力扩容 = 6525; internal const int IGB光伏扩容 = 6526; internal const int IGB热聚增效 = 6527; internal const int IGB资源采掘 = 6528; internal const int IGB裂变增效 = 6529; internal const int IGB先进推进 = 6530; internal const int IGB特征向量模拟 = 6531; internal const int IGB中继信号干扰 = 6532; internal const int IGB神经元重编程 = 6533; internal const int IGB异常代码分析 = 6534; internal const int IGB氨 = 7002; internal const int IOR增生组织 = 7002; internal const int IGB苯 = 7006; internal const int IGB丙烯 = 7009; internal const int IOR轻油 = 7009; internal const int IGB盐酸 = 7014; internal const int IGB三氯化铁 = 7015; internal const int IGB硝酸 = 7017; internal const int IGB海水 = 7018; internal const int IOR重水 = 7018; internal const int IGB氧 = 7019; internal const int IGB氢氧化钠 = 7020; internal const int IGB氯化钠 = 7101; internal const int IGB塑料基板 = 7501; internal const int IGB光学基板 = 7504; internal const int IGB钢芯弹箱 = 7607; internal const int IOR钢芯弹箱 = 7607; internal const int IGB钨芯弹箱 = 7608; internal const int IOR贫铀弹箱 = 7608; internal const int IGB三元弹箱 = 7609; internal const int IOR零素矢 = 7609; internal const int IGB核子爆破单元 = 7610; internal const int IOR金属氢单元 = 7610; internal const int IGB反物质湮灭单元 = 7611; internal const int IGB微型核弹组 = 7612; internal const int IOR金属氢炮弹组 = 7612; internal const int IGB反物质炮弹组 = 7613; internal const int IOR反物质炮弹 = 7613; internal const int IGB反物质导弹组 = 7615; internal const int IOR启示录聚变弹 = 7615; internal const int IGB湮灭弹箱 = 7616; internal const int IOR湮灭弹药箱 = 7616; internal const int IGB电磁加农炮 = 7617; internal const int IOR聚爆加农炮MK2 = 7617; internal const int IGB紫外激光塔 = 7618; internal const int IOR高频激光塔MK2 = 7618; internal const int IGB钨块 = 7705; internal const int IOR磁流体 = 7705; internal const int IGB钨强化玻璃 = 7706; internal const int IOR石墨矿 = 7706; internal const int IGB钨合金 = 7707; internal const int IOR战术核导弹 = 7707; internal const int IGB聚苯硫醚PPS = 7708; internal const int IOR纳米塑料纤维 = 7708; internal const int IGB聚酰亚胺PI = 7709; internal const int IOR聚酰亚胺 = 7709; internal const int IGB光学处理器 = 7803; internal const int IOR光学处理器 = 7803; internal const int IGB光学信息传输纤维 = 7804; internal const int IOR光纤 = 7804; internal const int IGB量子计算主机 = 7805; internal const int IOR量子计算机550MAGI = 7805; internal const int IGB超越X1型光学主机 = 7806; internal const int IOR光学计算机 = 7806; internal const int IFE电磁奖券 = 8001; internal const int IFE能量奖券 = 8002; internal const int IFE结构奖券 = 8003; internal const int IFE信息奖券 = 8004; internal const int IFE引力奖券 = 8005; internal const int IFE宇宙奖券 = 8006; internal const int IFE黑雾奖券 = 8007; internal const int IFE分馏塔原胚I型 = 8011; internal const int IFE分馏塔原胚II型 = 8012; internal const int IFE分馏塔原胚III型 = 8013; internal const int IFE分馏塔原胚IV型 = 8014; internal const int IFE分馏塔原胚V型 = 8015; internal const int IFE分馏塔定向原胚 = 8016; internal const int IFE分馏配方核心 = 8017; internal const int IFE分馏塔增幅芯片 = 8018; internal const int IFE交互塔 = 8021; internal const int IFE矿物复制塔 = 8022; internal const int IFE点数聚集塔 = 8023; internal const int IFE量子复制塔 = 8024; internal const int IFE点金塔 = 8025; internal const int IFE分解塔 = 8026; internal const int IFE转化塔 = 8027; internal const int IFE行星内物流交互站 = 8028; internal const int IFE星际物流交互站 = 8029; internal const int IFE行星交互塔 = 8031; internal const int IFE行星矿物复制塔 = 8032; internal const int IFE行星点数聚集塔 = 8033; internal const int IFE行星量子复制塔 = 8034; internal const int IFE行星点金塔 = 8035; internal const int IFE行星分解塔 = 8036; internal const int IFE行星转化塔 = 8037; internal const int IFE复制精华 = 8041; internal const int IFE点金精华 = 8042; internal const int IFE分解精华 = 8043; internal const int IFE转化精华 = 8044; internal const int IFE万物分馏商店刷新提示 = 8048; internal const int IFE万物分馏科技解锁说明 = 8049; internal const int IBC插件效果分享塔 = 8051; internal const int IBC插件效果分享站 = 8052; internal const int IBC速度插件MK1 = 8061; internal const int IBC速度插件MK2 = 8062; internal const int IBC速度插件MK3 = 8063; internal const int IBC产能插件MK1 = 8064; internal const int IBC产能插件MK2 = 8065; internal const int IBC产能插件MK3 = 8066; internal const int IBC节能插件MK1 = 8067; internal const int IBC节能插件MK2 = 8068; internal const int IBC节能插件MK3 = 8069; internal const int IBC品质插件MK1 = 8070; internal const int IBC品质插件MK2 = 8071; internal const int IBC品质插件MK3 = 8072; internal const int ISM熔炉采矿机A型 = 9446; internal const int ISM熔炉采矿机B型 = 9447; internal const int ISM化工采矿机C型 = 9448; internal const int ICCBS能量核心 = 9446; internal const int ICCBS能量核心满 = 9447; internal const int ICCBS星际能量枢纽 = 9448; internal const int ICCBS星际能量枢纽MK2 = 9449; internal const int ISM大型熔炉采矿机A型 = 9466; internal const int ISM大型熔炉采矿机B型 = 9467; internal const int ISM大型化工采矿机C型 = 9468; internal const int ISM等离子精炼油井 = 9469; internal const int IMS引力发生装置 = 9480; internal const int IMS位面约束环 = 9481; internal const int IMS引力钻头 = 9482; internal const int IMS隧穿激发装置 = 9483; internal const int IMS谐振盘 = 9484; internal const int IMS光子探针 = 9485; internal const int IMS量子计算机 = 9486; internal const int IMS星际组装厂组件 = 9487; internal const int IMS物质解压器运载火箭 = 9488; internal const int IMS科学枢纽运载火箭 = 9489; internal const int IMS谐振发射器运载火箭 = 9490; internal const int IMS星际组装厂运载火箭 = 9491; internal const int IMS晶体重构器运载火箭 = 9492; internal const int IMS星际组装厂生产机器图标专用 = 9493; internal const int IMS铜金属重构装置 = 9494; internal const int IMS高纯硅重构装置 = 9495; internal const int IMS钛金属重构装置 = 9496; internal const int IMS单极磁石重构装置 = 9497; internal const int IMS晶体接收器 = 9498; internal const int IMS组件集成装置 = 9499; internal const int IMS多功能集成组件 = 9500; internal const int IMS石墨提炼装置 = 9501; internal const int IMS光栅晶体接收器 = 9502; internal const int IMS力场发生器 = 9503; internal const int IMS复合态晶体 = 9504; internal const int IMS电磁力抑制器 = 9505; internal const int IMS胶子发生器 = 9506; internal const int IMS强力过载装置 = 9507; internal const int IMS导流框架 = 9508; internal const int IMS恒星炮组件 = 9509; internal const int IMS恒星炮运载火箭 = 9510; internal const int IMS水滴 = 9511; internal const int IMS物资交换物流站 = 9512; internal const int IVD星河卫士勋章 = 9513; internal const int IVD水滴额外伤害 = 9514; internal const int ICCBS_xxldm_能量核心 = 9946; internal const int ICCBS_xxldm_能量核心满 = 9947; internal const int ICCBS_xxldm_星际能量枢纽 = 9948; internal const int ICCBS_xxldm_星际能量枢纽MK2 = 9949; internal const int M传送带 = 35; internal const int M高速传送带 = 36; internal const int M极速传送带 = 37; internal const int M四向分流器 = 38; internal const int M分拣器 = 41; internal const int M高速分拣器 = 42; internal const int M极速分拣器 = 43; internal const int M电力感应塔 = 44; internal const int M能量枢纽 = 45; internal const int M蓄电器 = 46; internal const int M蓄电器满 = 46; internal const int M物流运输机 = 47; internal const int M星际物流运输船 = 48; internal const int M行星内物流运输站 = 49; internal const int M星际物流运输站 = 50; internal const int MMS物资交换物流站 = 50; internal const int M小型储物仓 = 51; internal const int M大型储物仓 = 52; internal const int M风力涡轮机 = 53; internal const int M火力发电厂 = 54; internal const int MGB燃料电池发电厂 = 54; internal const int M太阳能板 = 55; internal const int M人造恒星 = 56; internal const int MGB朱曦K型人造恒星 = 56; internal const int M采矿机 = 57; internal const int M抽水站 = 60; internal const int M原油萃取站 = 61; internal const int M电弧熔炉 = 62; internal const int M原油精炼厂 = 63; internal const int M化工厂 = 64; internal const int M制造台MkI = 65; internal const int MGB基础制造台 = 65; internal const int M制造台MkII = 66; internal const int MGB标准制造单元 = 66; internal const int M制造台MkIII = 67; internal const int MGB高精度装配线 = 67; internal const int M卫星配电站 = 68; internal const int M微型粒子对撞机 = 69; internal const int M矩阵研究站 = 70; internal const int M无线输电塔 = 71; internal const int M电磁轨道弹射器 = 72; internal const int M射线接收站 = 73; internal const int MMS射线重构站 = 73; internal const int M垂直发射井 = 74; internal const int M小型运载火箭 = 75; internal const int M轨道采集器 = 117; internal const int M微型聚变发电站 = 118; internal const int MGB裂变能源发电站 = 118; internal const int M分馏塔 = 119; internal const int M喷涂机 = 120; internal const int M储液罐 = 121; internal const int M位面熔炉 = 194; internal const int M流速监测器 = 208; internal const int M地热发电站 = 255; internal const int M大型采矿机 = 256; internal const int M自动集装机 = 257; internal const int M物流配送器 = 371; internal const int M配送运输机 = 372; internal const int M高频激光塔 = 373; internal const int M高斯机枪塔 = 374; internal const int M聚爆加农炮 = 375; internal const int M量子化工厂 = 376; internal const int MGB先进化学反应釜 = 376; internal const int M行星护盾发生器 = 402; internal const int M信号塔 = 403; internal const int M导弹防御塔 = 407; internal const int M磁化电浆炮 = 408; internal const int M干扰塔 = 422; internal const int M导弹组 = 432; internal const int M超音速导弹组 = 433; internal const int M引力导弹组 = 434; internal const int M原型机 = 448; internal const int M精准无人机 = 449; internal const int M攻击无人机 = 450; internal const int M护卫舰 = 451; internal const int M驱逐舰 = 452; internal const int M战场分析基站 = 453; internal const int M自演化研究站 = 455; internal const int M重组式制造台 = 456; internal const int MGB物质重组工厂 = 456; internal const int M负熵熔炉 = 457; internal const int M近程电浆塔 = 482; internal const int M集装分拣器 = 483; internal const int M炮弹组 = 486; internal const int M高爆炮弹组 = 487; internal const int M晶石炮弹组 = 488; internal const int MGB微型核弹组 = 488; internal const int M燃烧单元 = 489; internal const int M爆破单元 = 490; internal const int M晶石爆破单元 = 491; internal const int MGB反物质湮灭单元 = 491; internal const int M干扰胶囊 = 492; internal const int M压制胶囊 = 493; internal const int M水 = 494; internal const int MFE交互塔 = 601; internal const int MFE矿物复制塔 = 602; internal const int MFE点数聚集塔 = 603; internal const int MFE量子复制塔 = 604; internal const int MFE点金塔 = 605; internal const int MFE分解塔 = 606; internal const int MFE转化塔 = 607; internal const int MFE行星内物流交互站 = 608; internal const int MFE星际物流交互站 = 609; internal const int MFE行星交互塔 = 611; internal const int MFE行星矿物复制塔 = 612; internal const int MFE行星点数聚集塔 = 613; internal const int MFE行星量子复制塔 = 614; internal const int MFE行星点金塔 = 615; internal const int MFE行星分解塔 = 616; internal const int MFE行星转化塔 = 617; internal const int MBC插件效果分享塔 = 621; internal const int MBC插件效果分享站 = 622; internal const int MGB量子储液罐 = 801; internal const int MGB矿物处理厂 = 802; internal const int MGB天穹装配厂 = 803; internal const int MGB物质裂解塔 = 804; internal const int MGB埃克森美孚化工厂 = 805; internal const int MGB工业先锋精密加工中心 = 806; internal const int MGB湛曦O型人造恒星 = 807; internal const int MGB聚束液体汲取设施 = 808; internal const int MGB同位素温差发电机 = 809; internal const int MGB物质分解设施 = 810; internal const int MGB苍穹粒子加速器 = 811; internal const int MGB大气采集站 = 812; internal const int MGB反物质导弹组 = 813; internal const int MGB量子储物仓 = 814; internal const int MGB电磁加农炮 = 815; internal const int MGB紫外激光塔 = 816; internal const int MGB核子爆破单元 = 817; internal const int MGB反物质炮弹组 = 818; internal const int R铁块 = 1; internal const int R磁铁 = 2; internal const int RGB铜线圈 = 2; internal const int R铜块 = 3; internal const int R石材 = 4; internal const int R齿轮 = 5; internal const int RGB湮灭弹药箱 = 5; internal const int R磁线圈 = 6; internal const int RGB电路板 = 6; internal const int R风力涡轮机 = 7; internal const int R电力感应塔 = 8; internal const int R电磁矩阵 = 9; internal const int R矩阵研究站 = 10; internal const int R棱镜 = 11; internal const int R电浆激发器 = 12; internal const int R无线输电塔 = 13; internal const int R原油萃取站 = 14; internal const int R原油精炼厂 = 15; internal const int R等离子精炼 = 16; internal const int R高能石墨 = 17; internal const int R能量矩阵 = 18; internal const int R液氢燃料棒 = 19; internal const int R推进器 = 20; internal const int R加力推进器 = 21; internal const int R化工厂 = 22; internal const int R塑料 = 23; internal const int RGB聚丙烯 = 23; internal const int R硫酸 = 24; internal const int R有机晶体 = 25; internal const int RGB铝块 = 25; internal const int R钛晶石 = 26; internal const int RGB铝合金 = 26; internal const int R结构矩阵 = 27; internal const int R卡西米尔晶体 = 28; internal const int R卡西米尔晶体高效 = 29; internal const int R钛化玻璃 = 30; internal const int R石墨烯 = 31; internal const int R石墨烯高效 = 32; internal const int R碳纳米管 = 33; internal const int R硅石 = 34; internal const int RGB硅石筛选 = 34; internal const int R碳纳米管高效 = 35; internal const int R粒子宽带 = 36; internal const int R晶格硅 = 37; internal const int R位面过滤器 = 38; internal const int R微型粒子对撞机 = 39; internal const int R重氢 = 40; internal const int R氘核燃料棒 = 41; internal const int R湮灭约束球 = 42; internal const int R人造恒星 = 43; internal const int RGB朱曦K型人造恒星 = 43; internal const int R反物质燃料棒 = 44; internal const int R制造台MkI = 45; internal const int RGB基础制造台 = 45; internal const int R制造台MkII = 46; internal const int RGB标准制造单元 = 46; internal const int R制造台MkIII = 47; internal const int RGB高精度装配线 = 47; internal const int R采矿机 = 48; internal const int R抽水站 = 49; internal const int R电路板 = 50; internal const int RGB玻璃 = 50; internal const int R处理器 = 51; internal const int R量子芯片 = 52; internal const int R微晶元件 = 53; internal const int R有机晶体原始 = 54; internal const int RGB埃克森美孚化工厂 = 54; internal const int R信息矩阵 = 55; internal const int R电弧熔炉 = 56; internal const int R玻璃 = 57; internal const int RGB三元精金 = 57; internal const int RX射线裂解 = 58; internal const int R高纯硅块 = 59; internal const int R金刚石 = 60; internal const int R金刚石高效 = 61; internal const int R晶格硅高效 = 62; internal const int R钢材 = 63; internal const int R火力发电厂 = 64; internal const int RGB燃料电池发电厂 = 64; internal const int R钛块 = 65; internal const int R钛合金 = 66; internal const int R太阳能板 = 67; internal const int R光子合并器 = 68; internal const int R光子合并器高效 = 69; internal const int R太阳帆 = 70; internal const int R电磁轨道弹射器 = 71; internal const int R射线接收站 = 72; internal const int RMS射线重构站 = 72; internal const int R卫星配电站 = 73; internal const int R质能储存 = 74; internal const int R宇宙矩阵 = 75; internal const int R蓄电器 = 76; internal const int R能量枢纽 = 77; internal const int R空间翘曲器 = 78; internal const int R空间翘曲器高级 = 79; internal const int R框架材料 = 80; internal const int R戴森球组件 = 81; internal const int R垂直发射井 = 82; internal const int R小型运载火箭 = 83; internal const int R传送带 = 84; internal const int R分拣器 = 85; internal const int R小型储物仓 = 86; internal const int R四向分流器 = 87; internal const int R高速分拣器 = 88; internal const int R高速传送带 = 89; internal const int R极速分拣器 = 90; internal const int R大型储物仓 = 91; internal const int R极速传送带 = 92; internal const int R行星内物流运输站 = 93; internal const int R物流运输机 = 94; internal const int R星际物流运输站 = 95; internal const int R星际物流运输船 = 96; internal const int R电动机 = 97; internal const int R电磁涡轮 = 98; internal const int R粒子容器 = 99; internal const int R粒子容器高效 = 100; internal const int R引力透镜 = 101; internal const int R引力矩阵 = 102; internal const int R超级磁场环 = 103; internal const int R奇异物质 = 104; internal const int R动力引擎 = 105; internal const int R增产剂MkI = 106; internal const int RGB氦核转化 = 106; internal const int R增产剂MkII = 107; internal const int RGB氦原子提取 = 107; internal const int R增产剂MkIII = 108; internal const int RGB增产剂 = 108; internal const int R喷涂机 = 109; internal const int R分馏塔 = 110; internal const int RGB湛曦O型人造恒星 = 110; internal const int R轨道采集器 = 111; internal const int R地基 = 112; internal const int R微型聚变发电站 = 113; internal const int RGB裂变能源发电站 = 113; internal const int R储液罐 = 114; internal const int R重氢分馏 = 115; internal const int RGB氦闪约束器 = 115; internal const int R位面熔炉 = 116; internal const int R流速监测器 = 117; internal const int R地热发电站 = 118; internal const int R大型采矿机 = 119; internal const int R自动集装机 = 120; internal const int R重整精炼 = 121; internal const int RGB铝矿粉 = 121; internal const int R物流配送器 = 122; internal const int R配送运输机 = 123; internal const int R量子化工厂 = 124; internal const int RGB先进化学反应釜 = 124; internal const int R高斯机枪塔 = 125; internal const int R高频激光塔 = 126; internal const int R聚爆加农炮 = 127; internal const int R磁化电浆炮 = 128; internal const int R导弹防御塔 = 129; internal const int R干扰塔 = 130; internal const int R信号塔 = 131; internal const int R行星护盾发生器 = 132; internal const int R燃烧单元 = 133; internal const int R爆破单元 = 134; internal const int R晶石爆破单元 = 135; internal const int RGB核子爆破单元 = 135; internal const int R机枪弹箱 = 136; internal const int R钛化弹箱 = 137; internal const int R超合金弹箱 = 138; internal const int R炮弹组 = 139; internal const int R高爆炮弹组 = 140; internal const int R晶石炮弹组 = 141; internal const int RGB微型核弹组 = 141; internal const int R等离子胶囊 = 142; internal const int R反物质胶囊 = 143; internal const int R导弹组 = 144; internal const int R超音速导弹组 = 145; internal const int R引力导弹组 = 146; internal const int R原型机 = 147; internal const int R精准无人机 = 148; internal const int R攻击无人机 = 149; internal const int R护卫舰 = 150; internal const int R驱逐舰 = 151; internal const int R战场分析基站 = 152; internal const int R自演化研究站 = 153; internal const int R重组式制造台 = 154; internal const int RGB物质重组工厂 = 154; internal const int R负熵熔炉 = 155; internal const int R奇异湮灭燃料棒 = 156; internal const int R近程电浆塔 = 157; internal const int R干扰胶囊 = 158; internal const int R压制胶囊 = 159; internal const int R集装分拣器 = 160; internal const int RMS引力发生装置 = 530; internal const int RMS位面约束环 = 531; internal const int RMS引力钻头 = 532; internal const int RMS隧穿激发装置 = 533; internal const int RMS谐振盘 = 534; internal const int RMS光子探针 = 535; internal const int RMS量子计算机 = 536; internal const int RMS星际组装厂组件 = 537; internal const int RMS物质解压器运载火箭 = 538; internal const int RMS科学枢纽运载火箭 = 539; internal const int RMS谐振发射器运载火箭 = 540; internal const int RMS星际组装厂运载火箭 = 541; internal const int RMS晶体重构器运载火箭 = 542; internal const int RMS星际组装厂生产机器图标专用 = 543; internal const int RMS铜金属重构装置 = 544; internal const int RMS高纯硅重构装置 = 545; internal const int RMS钛金属重构装置 = 546; internal const int RMS单极磁石重构装置 = 547; internal const int RMS晶体接收器 = 548; internal const int RMS组件集成装置 = 549; internal const int RMS多功能集成组件 = 550; internal const int RMS传送带快速组装 = 551; internal const int RMS集装分拣器快速组装 = 352; internal const int RMS制造台4快速组装 = 353; internal const int RMS熔炉3快速组装 = 354; internal const int RMS实验室2快速组装 = 355; internal const int RMS大矿机快速组装 = 356; internal const int RMS抽水泵快速组装 = 357; internal const int RMS石墨提炼装置 = 563; internal const int RMS光栅晶体接收器 = 564; internal const int RMS力场发生器 = 565; internal const int RMS复合态晶体 = 566; internal const int RMS电磁力抑制器 = 567; internal const int RMS胶子发生器 = 568; internal const int RMS强力过载装置 = 569; internal const int RMS导流框架 = 570; internal const int RMS恒星炮组件 = 571; internal const int RMS恒星炮运载火箭 = 572; internal const int RMS水滴gm = 573; internal const int RMS物资交换物流站 = 575; internal const int RVD星河卫士奖章 = 382; internal const int RGB放射性矿物处理 = 401; internal const int RGB铝矿精炼 = 402; internal const int RGB钨矿精炼 = 404; internal const int RGB钨矿粉 = 405; internal const int RGB含铀核燃料 = 406; internal const int RGB含钚核燃料 = 407; internal const int RGB铀燃料棒 = 408; internal const int RGB钚燃料棒 = 409; internal const int RGBMOX燃料棒 = 410; internal const int RGB铁矿精炼 = 411; internal const int RGB铜矿精炼 = 412; internal const int RGB硅矿精炼 = 413; internal const int RGB钛矿精炼 = 414; internal const int RGB天穹装配厂 = 416; internal const int RGB苍穹粒子加速器 = 417; internal const int RGB聚束液体汲取设施 = 418; internal const int RGB大气采集站 = 419; internal const int RGB石矿精炼 = 420; internal const int RGB煤矿精炼 = 421; internal const int RGB工业先锋精密加工中心 = 422; internal const int RGB物质分解设施 = 423; internal const int RGB物质回收 = 429; internal const int RGB焦油裂化 = 501; internal const int RGB二氧化碳 = 506; internal const int RGB催化重整 = 509; internal const int RGB四氢双环戊二烯JP10 = 512; internal const int RGB四氢双环戊二烯燃料棒 = 515; internal const int RGB焦油燃料棒 = 516; internal const int RGB处理器高效 = 519; internal const int RGB量子储液罐 = 522; internal const int RGB矿物处理厂 = 523; internal const int RGB量子储物仓 = 524; internal const int RGB铁矿粉 = 531; internal const int RGB铜矿粉 = 532; internal const int RGB硅矿粉 = 533; internal const int RGB钛矿粉 = 534; internal const int RGB石粉 = 535; internal const int RGB煤矿粉 = 536; internal const int RGB硫粉 = 537; internal const int RGB玻色矩阵 = 539; internal const int RGB耗散矩阵 = 540; internal const int RGB质能储存高效 = 541; internal const int RGB物质裂解塔 = 542; internal const int RGB奇点矩阵 = 544; internal const int RGB有机晶体 = 546; internal const int RGB能量物质化 = 547; internal const int RGB二氧化硫还原 = 548; internal const int RGB有机晶体活化 = 549; internal const int RGB有机晶体重组 = 550; internal const int RMS分拣器快速组装 = 552; internal const int RMS配电站快速组装 = 553; internal const int RMS制造台快速组装 = 554; internal const int RMS位面熔炉快速组装 = 555; internal const int RMS化工厂快速组装 = 556; internal const int RMS精炼厂快速组装 = 557; internal const int RMS对撞机快速组装 = 558; internal const int RMS研究站快速组装 = 559; internal const int RMS人造恒星快速组装 = 560; internal const int RMS行星内物流快速组装 = 561; internal const int RMS星际物流快速组装 = 562; internal const int RGB超越X1型光学主机 = 569; internal const int RGB氘氦混合燃料棒 = 624; internal const int RGB氦三燃料棒 = 625; internal const int RGB基础机械组件 = 641; internal const int RGB先进机械组件 = 642; internal const int RGB尖端机械组件 = 643; internal const int RGB空燃料棒 = 644; internal const int RGB水电解 = 702; internal const int RGB盐水电解 = 703; internal const int RGB钠盐转化 = 704; internal const int RGB钛晶石高效 = 709; internal const int RGB合成氨 = 710; internal const int RGB煤炭液化 = 712; internal const int RGB焦油分馏 = 713; internal const int RGB钛晶石 = 714; internal const int RGB三氯化铁 = 716; internal const int RGB氨氧化 = 717; internal const int RGB羰基合成 = 720; internal const int RGB塑料基板 = 751; internal const int RGB同位素温差发电机 = 752; internal const int RGB光学基板 = 754; internal const int RGB聚苯硫醚PPS = 771; internal const int RGB聚酰亚胺PI = 772; internal const int RGB钨矿筛选 = 773; internal const int RGB钨块 = 774; internal const int RGB钨强化玻璃 = 775; internal const int RGB钨合金 = 776; internal const int RGB钢芯弹箱 = 781; internal const int RGB钨芯弹箱 = 782; internal const int RGB三元弹箱 = 783; internal const int RGB反物质湮灭单元 = 785; internal const int RGB反物质炮弹组 = 787; internal const int RGB反物质导弹组 = 789; internal const int RGB电磁加农炮 = 791; internal const int RGB紫外激光塔 = 792; internal const int RGB光学处理器 = 793; internal const int RGB光学信息传输纤维 = 794; internal const int RGB量子计算主机 = 795; internal const int RGB海水淡化 = 801; internal const int RFE电磁奖券 = 901; internal const int RFE能量奖券 = 902; internal const int RFE结构奖券 = 903; internal const int RFE信息奖券 = 904; internal const int RFE引力奖券 = 905; internal const int RFE宇宙奖券 = 906; internal const int RFE黑雾奖券 = 907; internal const int RFE分馏塔原胚定向 = 916; internal const int RFE交互塔 = 921; internal const int RFE矿物复制塔 = 922; internal const int RFE点数聚集塔 = 923; internal const int RFE量子复制塔 = 924; internal const int RFE点金塔 = 925; internal const int RFE分解塔 = 926; internal const int RFE转化塔 = 927; internal const int RFE行星内物流交互站 = 928; internal const int RFE星际物流交互站 = 929; internal const int RFE行星交互塔 = 931; internal const int RFE行星矿物复制塔 = 932; internal const int RFE行星点数聚集塔 = 933; internal const int RFE行星量子复制塔 = 934; internal const int RFE行星点金塔 = 935; internal const int RFE行星分解塔 = 936; internal const int RFE行星转化塔 = 937; internal const int RBC插件效果分享塔 = 951; internal const int RBC插件效果分享站 = 952; internal const int RBC速度插件MK1 = 961; internal const int RBC速度插件MK2 = 962; internal const int RBC速度插件MK3 = 963; internal const int RBC产能插件MK1 = 964; internal const int RBC产能插件MK2 = 965; internal const int RBC产能插件MK3 = 966; internal const int RBC节能插件MK1 = 967; internal const int RBC节能插件MK2 = 968; internal const int RBC节能插件MK3 = 969; internal const int RBC品质插件MK1 = 970; internal const int RBC品质插件MK2 = 971; internal const int RBC品质插件MK3 = 972; internal const int T戴森球计划 = 1; internal const int T电磁学 = 1001; internal const int T电磁矩阵 = 1002; internal const int T高效电浆控制 = 1101; internal const int T等离子萃取精炼 = 1102; internal const int TX射线裂解 = 1103; internal const int T重整精炼 = 1104; internal const int TGB先进有机合成技术 = 1104; internal const int T能量矩阵 = 1111; internal const int T氢燃料棒 = 1112; internal const int TGB气体冷凝 = 1112; internal const int T推进器 = 1113; internal const int T加力推进器 = 1114; internal const int T流体储存封装 = 1120; internal const int T基础化工 = 1121; internal const int T高分子化工 = 1122; internal const int T高强度晶体 = 1123; internal const int T结构矩阵 = 1124; internal const int T卡西米尔晶体 = 1125; internal const int T高强度玻璃 = 1126; internal const int T应用型超导体 = 1131; internal const int T高强度材料 = 1132; internal const int T粒子可控 = 1133; internal const int T重氢分馏 = 1134; internal const int TGB强相互作用力材料 = 1134; internal const int T波函数干扰 = 1141; internal const int T微型粒子对撞机 = 1142; internal const int TGB粒子对撞机 = 1142; internal const int T奇异物质 = 1143; internal const int T人造恒星 = 1144; internal const int TGB质能转换利用 = 1144; internal const int T可控湮灭反应 = 1145; internal const int T增产剂MkI = 1151; internal const int TGB物品增产 = 1151; internal const int T增产剂MkII = 1152; internal const int TGB量子折跃 = 1152; internal const int T增产剂MkIII = 1153; internal const int TGB人造恒星 = 1153; internal const int T基础制造 = 1201; internal const int T高速制造 = 1202; internal const int TGB标准制造单元 = 1202; internal const int T量子打印 = 1203; internal const int TGB高精度加工 = 1203; internal const int TFE分馏数据中心 = 1251; internal const int TFE分馏塔原胚 = 1252; internal const int TFE物品交互 = 1253; internal const int TFE矿物复制 = 1254; internal const int TFE增产点数聚集 = 1255; internal const int TFE量子复制 = 1256; internal const int TFE物品点金 = 1257; internal const int TFE物品分解 = 1258; internal const int TFE物品转化 = 1259; internal const int TFE行星物品交互 = 1260; internal const int TFE行星矿物复制 = 1261; internal const int TFE行星增产点数聚集 = 1262; internal const int TFE行星量子复制 = 1263; internal const int TFE行星物品点金 = 1264; internal const int TFE行星物品分解 = 1265; internal const int TFE行星物品转化 = 1266; internal const int TFE电磁奖券 = 1271; internal const int TFE能量奖券 = 1272; internal const int TFE结构奖券 = 1273; internal const int TFE信息奖券 = 1274; internal const int TFE引力奖券 = 1275; internal const int TFE宇宙奖券 = 1276; internal const int TFE黑雾奖券 = 1277; internal const int TFE超值礼包1 = 1281; internal const int TFE超值礼包2 = 1282; internal const int TFE超值礼包3 = 1283; internal const int TFE超值礼包4 = 1284; internal const int TFE超值礼包5 = 1285; internal const int TFE超值礼包6 = 1286; internal const int TFE超值礼包7 = 1287; internal const int TFE超值礼包8 = 1288; internal const int TFE超值礼包9 = 1289; internal const int T处理器 = 1302; internal const int T量子芯片 = 1303; internal const int T光子聚束采矿 = 1304; internal const int T亚微观量子纠缠 = 1305; internal const int TGB化学反应釜压力容器 = 1305; internal const int T半导体材料 = 1311; internal const int T信息矩阵 = 1312; internal const int T自动化冶金 = 1401; internal const int T冶炼提纯 = 1402; internal const int T晶体冶炼 = 1403; internal const int T钢材冶炼 = 1411; internal const int T火力发电 = 1412; internal const int TGB燃料电池发电 = 1412; internal const int T钛矿冶炼 = 1413; internal const int T高强度钛合金 = 1414; internal const int T移山填海工程 = 1415; internal const int TGB工业生产 = 1415; internal const int T微型核聚变发电 = 1416; internal const int TGB裂变发电站 = 1416; internal const int T位面冶金 = 1417; internal const int T太阳能收集 = 1501; internal const int T光子变频 = 1502; internal const int T太阳帆轨道系统 = 1503; internal const int T射线接收站 = 1504; internal const int T行星电离层利用 = 1505; internal const int T狄拉克逆变机制 = 1506; internal const int T宇宙矩阵 = 1507; internal const int T任务完成 = 1508; internal const int T能量储存 = 1511; internal const int T星际电力运输 = 1512; internal const int T地热开采 = 1513; internal const int T高强度轻质结构 = 1521; internal const int T垂直发射井 = 1522; internal const int T戴森球应力系统 = 1523; internal const int T基础物流系统 = 1601; internal const int T改良物流系统 = 1602; internal const int T高效物流系统 = 1603; internal const int T行星物流系统 = 1604; internal const int T星际物流系统 = 1605; internal const int T气态行星开采 = 1606; internal const int T集装物流系统 = 1607; internal const int T配送物流系统 = 1608; internal const int T电磁驱动 = 1701; internal const int T磁悬浮 = 1702; internal const int T粒子磁力阱 = 1703; internal const int T引力波折射 = 1704; internal const int T引力矩阵 = 1705; internal const int T超级磁场发生器 = 1711; internal const int T卫星配电系统 = 1712; internal const int T武器系统 = 1801; internal const int T燃烧单元 = 1802; internal const int T爆破单元 = 1803; internal const int T晶石爆破单元 = 1804; internal const int TGB核能爆破单元 = 1804; internal const int T动力引擎 = 1805; internal const int T导弹防御塔 = 1806; internal const int T聚爆加农炮 = 1807; internal const int T信号塔 = 1808; internal const int T行星防御系统 = 1809; internal const int T干扰塔 = 1810; internal const int T磁化电浆炮 = 1811; internal const int T钛化弹箱 = 1812; internal const int TGB钢芯穿甲弹 = 1812; internal const int T超合金弹箱 = 1813; internal const int TGB钛金强化弹壳 = 1813; internal const int T高爆炮弹组 = 1814; internal const int T超音速导弹组 = 1815; internal const int T晶石炮弹组 = 1816; internal const int TGB微型核弹 = 1816; internal const int T引力导弹组 = 1817; internal const int T反物质胶囊 = 1818; internal const int T原型机 = 1819; internal const int T精准无人机 = 1820; internal const int T攻击无人机 = 1821; internal const int T护卫舰 = 1822; internal const int T驱逐舰 = 1823; internal const int T压制胶囊 = 1824; internal const int T战场分析基站 = 1826; internal const int TGB科学理论 = 1900; internal const int T数字模拟计算 = 1901; internal const int T物质重组 = 1902; internal const int T负熵递归 = 1903; internal const int T高密度可控湮灭 = 1904; internal const int TGB钨强化玻璃 = 1911; internal const int TGB焦油精炼 = 1915; internal const int TGB放射性矿物提炼 = 1916; internal const int TMS尼科尔戴森光束 = 1918; internal const int TGB裂变能源燃料棒 = 1919; internal const int TGB同位素温差发电 = 1920; internal const int TGB聚变能源燃料棒 = 1921; internal const int TGB巨型建筑天穹装配厂 = 1923; internal const int TGB巨型建筑物质裂解塔 = 1924; internal const int TGB巨型建筑行星级化学反应釜 = 1925; internal const int TGB巨型建筑精密结构组装厂 = 1926; internal const int TGB巨型建筑巨型粒子对撞机 = 1927; internal const int TGB四氢双环戊二烯燃料棒 = 1928; internal const int TGB矿物处理 = 1929; internal const int TGB先进化工 = 1930; internal const int TGB巨型建筑物质分解设施 = 1931; internal const int TGB化工厂 = 1932; internal const int TGB巨型建筑工程学 = 1934; internal const int TGB行星协调中心 = 1936; internal const int TGB护盾载波调制 = 1937; internal const int TGB基础机械组件 = 1941; internal const int TGB先进机械组件 = 1942; internal const int TGB尖端机械组件 = 1943; internal const int TGB钨强化金属 = 1944; internal const int TGB家园世界虚拟技术革新 = 1947; internal const int TGB家园世界光学信息传输技术 = 1948; internal const int TGB超级量子计算机 = 1949; internal const int TGB家园世界光学计算机 = 1950; internal const int TGB反物质湮灭单元 = 1952; internal const int TGB湮灭战斗部 = 1954; internal const int TGB超重型穿甲弹 = 1955; internal const int TGB强互作用力弹药 = 1956; internal const int TGB小型化湮灭反应 = 1957; internal const int TGB反物质飞弹 = 1959; internal const int TGB行星协调中心黑雾数据库 = 1960; internal const int TGB虚数空间存储 = 1962; internal const int TGB物品仓储 = 1963; internal const int TVD微型恒星能量引导 = 1997; internal const int TVD并入COSMO架构 = 1998; internal const int TVD玻色子操控 = 1999; internal const int T机甲核心 = 2101; internal const int T机械骨骼 = 2201; internal const int T机舱容量 = 2301; internal const int T通讯控制 = 2401; internal const int T能量回路 = 2501; internal const int T无人机引擎 = 2601; internal const int T批量建造 = 2701; internal const int T能量护盾 = 2801; internal const int T驱动引擎 = 2901; internal const int T自动标记重建 = 2951; internal const int T太阳帆寿命 = 3101; internal const int T射线传输效率 = 3201; internal const int T分拣器货物叠加 = 3301; internal const int T分拣器货物集装 = 3306; internal const int T集装分拣器改良 = 3311; internal const int T运输船引擎 = 3401; internal const int T运输机舱扩容 = 3501; internal const int T矿物利用 = 3601; internal const int T垂直建造 = 3701; internal const int T运输站集装物流 = 3801; internal const int T研究速度 = 3901; internal const int T配送范围 = 4001; internal const int T宇宙探索 = 4101; internal const int T太阳帆吸附速度 = 4201; internal const int T动能武器伤害 = 5001; internal const int T能量武器伤害 = 5101; internal const int T爆破武器伤害 = 5201; internal const int T战斗无人机伤害 = 5301; internal const int T战斗无人机射速 = 5401; internal const int T战斗无人机耐久 = 5601; internal const int T行星护盾 = 5701; internal const int T地面编队扩容 = 5801; internal const int T太空编队扩容 = 5901; internal const int T结构强化 = 6001; internal const int T电磁武器效果 = 6101; internal const int TVD元驱动挂载点位扩展 = 6601; public static uint randSeed = (uint)new Random().Next(1, 2147483646); public static Color Gray = new Color(0.5882353f, 0.5882353f, 0.5882353f, 1f); public static Color Gray2 = new Color(1f, 1f, 1f, 0.4f); public static Color Gray3 = new Color(0.69803923f, 0.69803923f, 0.69803923f, 56f / 85f); public static Color White = new Color(0.8784314f, 0.8784314f, 0.8784314f, 61f / 85f); public static Color Green = new Color(32f / 85f, 64f / 85f, 0f, 0.8f); public static Color Blue = new Color(0.38039216f, 72f / 85f, 1f, 0.72156864f); public static Color Purple = new Color(0.6901961f, 32f / 85f, 64f / 85f, 61f / 85f); public static Color Red = new Color(1f, 31f / 85f, 0.29803923f, 61f / 85f); public static Color Orange = new Color(0.99215686f, 0.5882353f, 0.36862746f, 0.8f); public static Color Gold = new Color(0.8784314f, 0.6901961f, 0f, 0.8f); private static bool ArchitectMode => Multfunction_mod.ArchitectMode || CheatEnabler.ArchitectMode || DeliverySlotsTweaks.ArchitectMode; private static bool TechItemInteractionUnlocked => GameMain.history.TechUnlocked(1253); public static string FormatP(this float value) { int i = 3; StringBuilder stringBuilder = new StringBuilder("0.###"); for (; i < 10; i++) { if ((double)value * Math.Pow(10.0, i) >= 1.0) { return value.ToString(stringBuilder.Append("%").ToString()); } stringBuilder.Append("#"); } return "0%"; } public static string FormatName(string s) { if (s == null) { return "null"; } return Localization.Translate(s).Replace("\u00a0", "").Replace("\u2009", "") .Replace(" ", "") .Replace("“", "") .Replace("”", "") .Replace(":", "") .Replace(":", "") .Replace("!", "") .Replace("-", "") .Replace(".", "") .Replace("(", "") .Replace(")", ""); } public static bool IsGridIndexValid(int gridIndex) { if (GenesisBook.Enable) { return gridIndex % 1000 / 100 >= 1 && gridIndex % 1000 / 100 <= 7 && gridIndex % 100 >= 1 && gridIndex % 100 <= 17; } return gridIndex % 1000 / 100 >= 1 && gridIndex % 1000 / 100 <= 8 && gridIndex % 100 >= 1 && gridIndex % 100 <= 14; } public static bool GridIndexValid(this ItemProto proto) { return IsGridIndexValid(proto.GridIndex); } public static bool GridIndexValid(this RecipeProto proto) { return IsGridIndexValid(proto.GridIndex); } public static void Register(string key, string enTrans, string cnTrans = null) { Dictionary dictionary = new Dictionary(); dictionary["enUS"] = enTrans; dictionary["zhCN"] = cnTrans ?? key; dictionary["frFR"] = enTrans; LocalizationModule.RegisterTranslation(key, dictionary); } public static void Edit(string key, string enTrans, string cnTrans = null) { Dictionary dictionary = new Dictionary(); dictionary["enUS"] = enTrans; dictionary["zhCN"] = cnTrans ?? key; dictionary["frFR"] = enTrans; LocalizationModule.EditTranslation(key, dictionary); } public static void RegisterOrEditAsync(string key, string enTrans, string cnTrans = null) { ModStr modStr = default(ModStr); modStr.key = key; modStr.enTrans = enTrans; modStr.cnTrans = cnTrans ?? key; ModStr item = modStr; foreach (ModStr modString in modStringList) { if (modString.key == key) { modStringList.Remove(modString); break; } } modStringList.Add(item); } public static void RegisterOrEditImmediately(string key, string enTrans, string cnTrans = null) { RegisterOrEditAsync(key, enTrans, cnTrans); LoadLanguagePostfixAfterCommonApi(); } public static void LoadLanguagePostfixAfterCommonApi() { try { if (modStringList.Count == 0 || Localization.strings == null || Localization.CurrentLanguageIndex >= Localization.strings.Length || Localization.strings[Localization.CurrentLanguageIndex] == null || Localization.currentStrings == null || Localization.floats == null || Localization.CurrentLanguageIndex >= Localization.floats.Length || Localization.floats[Localization.CurrentLanguageIndex] == null || Localization.currentFloats == null) { return; } List list = Localization.strings[Localization.CurrentLanguageIndex].ToList(); List list2 = Localization.floats[Localization.CurrentLanguageIndex].ToList(); bool flag = Localization.CurrentLanguageLCID == 2052; foreach (ModStr modString in modStringList) { if (!Localization.namesIndexer.TryGetValue(modString.key, out var value)) { value = Localization.namesIndexer.Count; Localization.namesIndexer.Add(modString.key, value); } while (list.Count <= value) { list.Add(Localization.namesIndexer.ElementAt(list.Count).Key); list2.Add(0f); } list[value] = (flag ? modString.cnTrans : modString.enTrans); } Localization.strings[Localization.CurrentLanguageIndex] = list.ToArray(); Localization.currentStrings = Localization.strings[Localization.CurrentLanguageIndex]; Localization.floats[Localization.CurrentLanguageIndex] = list2.ToArray(); Localization.currentFloats = Localization.floats[Localization.CurrentLanguageIndex]; LogInfo($"Modify translations finish, currentStrings.len={Localization.currentStrings.Length}"); } catch (Exception ex) { LogError("LoadLanguagePostfixAfterCommonApi Error: " + ex); } } public static void InitLogger(ManualLogSource logger) { Utils.logger = logger; } public static void LogDebug(object data) { if (logger == null) { Debug.Log((object)string.Format("[{0}]{1}", "FractionateEverything", data)); } else { logger.LogDebug(data); } } public static void LogInfo(object data) { if (logger == null) { Debug.Log((object)string.Format("[{0}]{1}", "FractionateEverything", data)); } else { logger.LogInfo(data); } } public static void LogWarning(object data) { if (logger == null) { Debug.LogWarning((object)string.Format("[{0}]{1}", "FractionateEverything", data)); } else { logger.LogWarning(data); } } public static void LogError(object data) { if (logger == null) { Debug.LogError((object)string.Format("[{0}]{1}", "FractionateEverything", data)); } else { logger.LogError(data); } } public static void LogFatal(object data) { if (logger == null) { Debug.LogError((object)string.Format("[{0}]{1}", "FractionateEverything", data)); } else { logger.LogFatal(data); } } public static RectTransform NormalizeRectWithTopLeft(Component cmp, float left, float top, Transform parent = null) { //IL_003d: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) Transform transform = cmp.transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (val == null) { return null; } if ((Object)(object)parent != (Object)null) { ((Transform)val).SetParent(parent, false); } val.anchorMin = new Vector2(0f, 1f); val.anchorMax = new Vector2(0f, 1f); val.pivot = new Vector2(0f, 1f); val.anchoredPosition3D = new Vector3(left, 0f - top, 0f); return val; } public static RectTransform NormalizeRectWithMidLeft(Component cmp, float left, float top, Transform parent = null, float? height = null) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) RectTransform val = NormalizeRectWithTopLeft(cmp, left, top, parent); float num = height ?? val.sizeDelta.y; val.anchoredPosition3D = new Vector3(left, 0f - top + num / 2f, 0f); return val; } public static RectTransform NormalizeRectWithTopRight(Component cmp, float right, float top, Transform parent = null) { //IL_003d: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) Transform transform = cmp.transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (val == null) { return null; } if ((Object)(object)parent != (Object)null) { ((Transform)val).SetParent(parent, false); } val.anchorMax = new Vector2(1f, 1f); val.anchorMin = new Vector2(1f, 1f); val.pivot = new Vector2(1f, 1f); val.anchoredPosition3D = new Vector3(0f - right, 0f - top, 0f); return val; } public static RectTransform NormalizeRectWithBottomLeft(Component cmp, float left, float bottom, Transform parent = null) { //IL_003d: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Transform transform = cmp.transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (val == null) { return null; } if ((Object)(object)parent != (Object)null) { ((Transform)val).SetParent(parent, false); } val.anchorMax = new Vector2(0f, 0f); val.anchorMin = new Vector2(0f, 0f); val.pivot = new Vector2(0f, 0f); val.anchoredPosition3D = new Vector3(left, bottom, 0f); return val; } public static RectTransform NormalizeRectWithMargin(Component cmp, float top, float left, float bottom, float right, Transform parent = null) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) Transform transform = cmp.transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (val == null) { return null; } if ((Object)(object)parent != (Object)null) { ((Transform)val).SetParent(parent, false); } val.anchoredPosition3D = Vector3.zero; ((Transform)val).localScale = Vector3.one; val.anchorMax = Vector2.one; val.anchorMin = Vector2.zero; val.pivot = new Vector2(0.5f, 0.5f); val.offsetMax = new Vector2(0f - right, 0f - top); val.offsetMin = new Vector2(left, bottom); return val; } public static RectTransform NormalizeRectCenter(GameObject go, float width = 0f, float height = 0f) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0079: Unknown result type (might be due to invalid IL or missing references) Transform transform = go.transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (val == null) { return null; } val.anchorMax = new Vector2(0.5f, 0.5f); val.anchorMin = new Vector2(0.5f, 0.5f); val.pivot = new Vector2(0.5f, 0.5f); if (width > 0f && height > 0f) { val.sizeDelta = new Vector2(width, height); } return val; } public static void SetPosition(this Text text, float x, float y) { NormalizeRectWithMidLeft((Component)(object)text, x, y); } public static void SetPosition(this MySlider slider, float x, float y) { NormalizeRectWithMidLeft((Component)(object)slider, x, y); } public static (float, float) GetPosition(int index, int count, float totalPx = 800f) { float num = (totalPx - (float)((count - 1) * 20)) / (float)count; float item = (float)index * (num + 20f); return (item, num); } public static void SetText(this UIButton btn, string notTranslateStr) { try { Localizer component = ((Component)((Component)btn).gameObject.transform.Find("button-text")).GetComponent(); Text component2 = ((Component)((Component)btn).gameObject.transform.Find("button-text")).GetComponent(); if ((Object)(object)component != (Object)null) { component.stringKey = notTranslateStr; component.translation = Localization.Translate(notTranslateStr); } if ((Object)(object)component2 != (Object)null) { component2.text = Localization.Translate(notTranslateStr); } } catch (Exception arg) { LogError($"SetText error: {arg}"); } } public static void AddTranslations() { Register("提示", "Tip"); Register("确定", "Confirm"); Register("取消", "Cancel"); Register("要花费", "Would you like to spend"); Register("来兑换", "to exchange"); Register("吗?", "?"); Register("兑换", "Exchange"); Register("已兑换", "Exchanged"); Register("无法兑换", "Can not exchange"); Register("配方经验", "recipe experience"); } [HarmonyPrefix] [HarmonyPatch(typeof(Player), "ThrowTrash")] private static bool Player_ThrowTrash_Prefix(Player __instance, int itemId, int count, int inc) { if (!TechItemInteractionUnlocked) { return true; } if (ItemManager.itemValue[itemId] >= float.MaxValue) { return true; } AddItemToModData(itemId, count, inc, manual: true); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(Player), "ThrowHandItems")] private static bool Player_ThrowHandItems_Prefix(Player __instance) { if (!TechItemInteractionUnlocked) { return true; } if (ItemManager.itemValue[__instance.inhandItemId] >= float.MaxValue) { return true; } if (__instance.inhandItemId > 0 && __instance.inhandItemCount > 0) { AddItemToModData(__instance.inhandItemId, __instance.inhandItemCount, __instance.inhandItemInc, manual: true); } __instance.inhandItemId = 0; __instance.inhandItemCount = 0; __instance.inhandItemInc = 0; return false; } public static void AddItemToModData(int itemId, int count, int inc = 0, bool manual = false) { if (itemId == 1099) { Player mainPlayer = GameMain.mainPlayer; mainPlayer.sandCount += count; return; } lock (ItemManager.centerItemCount) { ItemManager.centerItemCount[itemId] += count; ItemManager.centerItemInc[itemId] += inc; if (itemId >= 8021 && itemId <= 8027) { TechManager.CheckTechUnlockCondition(itemId); } } if (NebulaModAPI.IsMultiplayerActive && manual) { NebulaModAPI.MultiplayerSession.Network.SendPacket(new CenterItemChangePacket(itemId, count, inc)); } } public static void AddItemToPackage(int itemId, int count, int inc = 0, bool throwTrash = true) { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { int num = GameMain.mainPlayer.TryAddItemToPackage(itemId, count, inc, throwTrash, 0, false); if (num > 0) { UIItemup.Up(itemId, num); } } } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyAfter(new string[] { "starfi5h.plugin.BuildToolOpt" })] [HarmonyPatch(typeof(BuildTool_Reform), "ReformAction")] [HarmonyPatch(typeof(BuildTool_Reform), "RemoveBasePit")] [HarmonyPatch(typeof(PlanetFactory), "EntityAutoReplenishIfNeeded")] [HarmonyPatch(typeof(PlanetFactory), "StationAutoReplenishIfNeeded")] [HarmonyPatch(typeof(PlayerAction_Inspect), "GameTick")] [HarmonyPatch(typeof(UIBlueprintInspector), "SetComponentItem")] [HarmonyPatch(typeof(UIBlueprintInspector), "_OnUpdate")] [HarmonyPatch(typeof(UIBuildMenu), "OnChildButtonClick")] [HarmonyPatch(typeof(UIBuildMenu), "SetCurrentCategory")] [HarmonyPatch(typeof(UIBuildMenu), "_OnUpdate")] [HarmonyPatch(typeof(UIControlPanelObjectEntry), "ReplenishItems")] [HarmonyPatch(typeof(UIHandTip), "_OnUpdate")] [HarmonyPatch(typeof(UIItemup), "Up")] [HarmonyPatch(typeof(UIRemoveBasePitButton), "_OnUpdate")] [HarmonyPatch(typeof(UIReplicatorWindow), "_OnUpdate")] [HarmonyPatch(typeof(UISandboxMenu), "OnChildButtonClick")] [HarmonyPatch(typeof(UITurretWindow), "OnHandFillAmmoButtonClick")] public static IEnumerable GetItemCount_Transpiler(IEnumerable instructions) { //IL_0038: 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_0059: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(StorageComponent), "GetItemCount", new Type[1] { typeof(int) }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "GetItemCount", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in GetItemCount_Transpiler: {arg}"); return instructions; } } private static int GetItemCount(StorageComponent storage, int itemId) { Player mainPlayer = GameMain.mainPlayer; if (storage != ((mainPlayer != null) ? mainPlayer.package : null)) { return storage.GetItemCount(itemId); } ItemProto val = ((ProtoSet)(object)LDB.items).Select(itemId); if (val == null) { return 0; } if (ArchitectMode && val.BuildMode != 0) { return 999; } return (int)Math.Min(2147483647L, GetItemTotalCount(itemId)); } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(BuildBarToolPlugin), "UIBuildMenuSetCurrentCategoryPostPatch")] [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPatch(typeof(BuildBarToolPlugin), "OnChildButtonClick")] private static IEnumerable BuildBarTool_Transpiler(IEnumerable instructions, MethodBase original) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown try { CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[4] { new CodeMatch((OpCode?)OpCodes.Ldsfld, (object)AccessTools.Field(typeof(DeliverySlotsTweaksCompat), "enabled"), (string)null), new CodeMatch((OpCode?)OpCodes.Stloc_S, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldloc_S, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Brfalse, (object)null, (string)null) }); if (val.IsValid && val.Length >= val.Pos + 12) { for (int j = 0; j <= 12; j++) { val.SetAndAdvance(OpCodes.Nop, (object)null); } } else { LogWarning($"MethodBase {original}, DeliverySlotsTweaksCompat.enabled not found"); } MethodInfo method = AccessTools.Method(typeof(StorageComponent), "GetItemCount", new Type[1] { typeof(int) }, (Type[])null); val = new CodeMatcher(val.InstructionEnumeration(), (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "GetItemCount", (Type[])null, (Type[])null)); }, (Action)null); method = AccessTools.Method(typeof(GameHistoryData), "ItemUnlocked", new Type[1] { typeof(int) }, (Type[])null); val = new CodeMatcher(val.InstructionEnumeration(), (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "ItemUnlocked", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in GetItemCount_Transpiler: {arg}"); return instructions; } } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(UIBuildMenu), "OnChildButtonClick")] [HarmonyPatch(typeof(UIBuildMenu), "SetCurrentCategory")] [HarmonyPatch(typeof(UIBuildMenu), "_OnUpdate")] [HarmonyPatch(typeof(UIItemPicker_Patch), "CheckItem")] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static IEnumerable ItemUnlocked_Transpiler(IEnumerable instructions) { //IL_0038: 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_0059: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(GameHistoryData), "ItemUnlocked", new Type[1] { typeof(int) }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "ItemUnlocked", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in ItemUnlocked_Transpiler: {arg}"); return instructions; } } private static bool ItemUnlocked(GameHistoryData history, int itemId) { return history.ItemUnlocked(itemId) || GetItemTotalCount(itemId) > 0; } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(ConstructionModuleComponent), "PlaceItems")] private static IEnumerable PlaceItems_Transpiler(IEnumerable instructions) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown try { CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[5] { new CodeMatch((OpCode?)OpCodes.Br, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(ConstructionModuleComponent), "entityId"), (string)null), new CodeMatch((OpCode?)OpCodes.Ldc_I4_0, (object)null, (string)null), new CodeMatch((OpCode?)OpCodes.Ble, (object)null, (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[4] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldarg_2, (object)null), new CodeInstruction(OpCodes.Ldloca_S, (object)(byte)0), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "AddConstructableCountsInStorage", (Type[])null, (Type[])null)) }); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in PlaceItems_Transpiler: {arg}"); return instructions; } } private static void AddConstructableCountsInStorage(ConstructionModuleComponent _this, Player player, ref int num) { num = 0; foreach (int item in ItemProto.constructableIdHash) { int itemCount = GetItemCount(player.package, item); int num2 = ItemProto.constructableIndiceById[item]; _this.constructableCountsInStorage[num2].haveCount = itemCount; num += itemCount; } } public static long GetModDataItemCount(int itemId) { long inc; return GetModDataItemCount(itemId, out inc); } public static long GetModDataItemCount(int itemId, out long inc) { inc = 0L; if (itemId == 1099) { if (GameMain.data.history.HasFeatureKey(1100001) && GameMain.sandboxToolsEnabled) { return long.MaxValue; } return GameMain.mainPlayer.sandCount; } inc = ItemManager.centerItemInc[itemId]; return ItemManager.centerItemCount[itemId]; } public static int GetPackageItemCount(int itemId, out int inc) { inc = 0; if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return 0; } StorageComponent package = GameMain.mainPlayer.package; int num = 0; for (int i = 0; i < package.size; i++) { if (package.grids[i].itemId == itemId) { num += package.grids[i].count; inc += package.grids[i].inc; } } return num; } public static int GetDeliveryPackageItemCount(int itemId, out int inc) { inc = 0; if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null || !GameMain.mainPlayer.deliveryPackage.unlocked) { return 0; } DeliveryPackage deliveryPackage = GameMain.mainPlayer.deliveryPackage; int num = 0; for (int num2 = 99; num2 >= 0; num2--) { if (deliveryPackage.grids[num2].itemId == itemId) { num += deliveryPackage.grids[num2].count; inc += deliveryPackage.grids[num2].inc; break; } } return num; } public static long GetItemTotalCount(int itemId) { long inc; int inc2; return GetModDataItemCount(itemId, out inc) + GetPackageItemCount(itemId, out inc2) + GetDeliveryPackageItemCount(itemId, out inc2); } public static long GetItemTotalCountAndInc(int itemId, out long inc) { long inc2; int inc3; int inc4; long result = GetModDataItemCount(itemId, out inc2) + GetPackageItemCount(itemId, out inc3) + GetDeliveryPackageItemCount(itemId, out inc4); inc = inc2 + inc3 + inc4; return result; } private static void TakeItemInternal(this StorageComponent storage, int itemId, int needCount, out int realCount, out int inc, bool useBan = false) { realCount = 0; inc = 0; if (itemId <= 0) { return; } if (itemId == 1099) { if (GameMain.mainPlayer.sandCount >= needCount) { realCount = needCount; Player mainPlayer = GameMain.mainPlayer; mainPlayer.sandCount -= needCount; } else { realCount = (int)GameMain.mainPlayer.sandCount; GameMain.mainPlayer.sandCount = 0L; } return; } ItemProto val = ((ProtoSet)(object)LDB.items).Select(itemId); if (val == null) { return; } if (ArchitectMode && val.BuildMode != 0) { realCount = needCount; return; } int[] takeItemPriority = Miscellaneous.TakeItemPriority; int inc2 = default(int); for (int i = 0; i < takeItemPriority.Length; i++) { int itemId2 = itemId; int num = needCount; if (takeItemPriority[i] == 0) { storage.TakeTailItems(ref itemId2, ref num, ref inc2, useBan); } else if (takeItemPriority[i] == 1) { GameMain.mainPlayer.deliveryPackage.TakeItems(ref itemId2, ref num, ref inc2); } else { num = TakeItemFromModData(itemId2, num, out inc2, manual: true); } needCount -= num; realCount += num; inc += inc2; if (needCount == 0) { break; } } } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(Mecha), "AutoReplenishAmmo")] [HarmonyPatch(typeof(Mecha), "AutoReplenishBomb")] [HarmonyPatch(typeof(Mecha), "AutoReplenishFuel")] [HarmonyPatch(typeof(Mecha), "AutoReplenishFuelAll")] [HarmonyPatch(typeof(Mecha), "AutoReplenishWarper")] [HarmonyPatch(typeof(MechaForge), "AddTaskIterate")] private static IEnumerable TakeItem_Transpiler(IEnumerable instructions) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(StorageComponent), "TakeItem", new Type[3] { typeof(int), typeof(int), typeof(int).MakeByRefType() }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "TakeItem", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in TakeItem_Transpiler: {arg}"); return instructions; } } private static int TakeItem(StorageComponent storage, int itemId, int count, out int inc) { if (storage != GameMain.mainPlayer.package) { return storage.TakeItem(itemId, count, ref inc); } storage.TakeItemInternal(itemId, count, out var realCount, out inc); return realCount; } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(BuildTool_Addon), "CreatePrebuilds")] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), "CreatePrebuilds")] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), "DetermineReforms")] [HarmonyPatch(typeof(BuildTool_Click), "CreatePrebuilds")] [HarmonyPatch(typeof(BuildTool_Inserter), "CreatePrebuilds")] [HarmonyPatch(typeof(BuildTool_Path), "CreatePrebuilds")] [HarmonyPatch(typeof(BuildTool_Reform), "ReformAction")] [HarmonyPatch(typeof(BuildTool_Reform), "RemoveBasePit")] [HarmonyPatch(typeof(ConstructionModuleComponent), "PlaceItems")] [HarmonyPatch(typeof(MechaLab), "ManageSupply")] [HarmonyPatch(typeof(PlanetFactory), "EntityAutoReplenishIfNeeded")] [HarmonyPatch(typeof(PlanetFactory), "StationAutoReplenishIfNeeded")] [HarmonyPatch(typeof(Player), "TakeItemFromPlayer")] [HarmonyPatch(typeof(PlayerAction_Build), "DoUpgradeObject")] [HarmonyPatch(typeof(PlayerAction_Inspect), "GameTick")] [HarmonyPatch(typeof(PlayerPackageUtility), "TakeItemFromAllPackages")] [HarmonyPatch(typeof(PlayerPackageUtility), "TryTakeItemFromAllPackages")] [HarmonyPatch(typeof(UIControlPanelObjectEntry), "ReplenishItems")] [HarmonyPatch(typeof(UITurretWindow), "OnHandFillAmmoButtonClick")] public static IEnumerable TakeTailItems_Transpiler(IEnumerable instructions) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(StorageComponent), "TakeTailItems", new Type[4] { typeof(int).MakeByRefType(), typeof(int).MakeByRefType(), typeof(int).MakeByRefType(), typeof(bool) }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "TakeTailItems", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in TakeTailItems_Transpiler: {arg}"); return instructions; } } private static void TakeTailItems(StorageComponent storage, ref int itemId, ref int count, out int inc, bool useBan = false) { if (storage != GameMain.mainPlayer.package) { storage.TakeTailItems(ref itemId, ref count, ref inc, useBan); return; } storage.TakeItemInternal(itemId, count, out var realCount, out inc, useBan); if (realCount == 0) { itemId = 0; } count = realCount; } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), "DetermineReforms")] private static IEnumerable TakeTailItemsByIncTable_Transpiler(IEnumerable instructions) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(StorageComponent), "TakeTailItemsByIncTable", new Type[4] { typeof(int), typeof(int).MakeByRefType(), typeof(int[]).MakeByRefType(), typeof(bool) }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "TakeTailItemsByIncTable", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in TakeTailItemsByIncTable_Transpiler: {arg}"); return instructions; } } private static bool TakeTailItemsByIncTable(StorageComponent storage, int itemId, out int count, ref int[] incTable, bool useBan = false) { if (storage != GameMain.mainPlayer.package) { return storage.TakeTailItemsByIncTable(itemId, ref count, ref incTable, useBan); } count = 0; for (int i = 0; i < incTable.Length; i++) { count += incTable[i]; } storage.TakeItemInternal(itemId, count, out var realCount, out var _, useBan); count = realCount; int num = incTable.Length - 1; while (num >= 0) { if (realCount >= incTable[num]) { incTable[num] = 0; realCount -= incTable[num]; num--; continue; } incTable[num] -= realCount; return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(MechaForge), "TryAddTask")] [HarmonyPatch(typeof(MechaForge), "TryTaskWithTestPackage")] private static bool MechaForge_ClearTestPackageUsedCounts(MechaForge __instance) { Array.Clear(testPackageUsedCounts, 0, 12000); return true; } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(MechaForge), "TryAddTaskIterate")] private static IEnumerable TryTakeItem_Transpiler(IEnumerable instructions) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(StorageComponent), "TakeItem", new Type[3] { typeof(int), typeof(int), typeof(int).MakeByRefType() }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "TryTakeItem", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in TryTakeItem_Transpiler: {arg}"); return instructions; } } private static int TryTakeItem(StorageComponent storage, int itemId, int count, out int inc) { inc = 0; count = (int)Math.Min(count, GetItemTotalCount(itemId) - testPackageUsedCounts[itemId]); testPackageUsedCounts[itemId] += count; return count; } [HarmonyPrefix] [HarmonyPatch(typeof(BuildTool), "_GameTick")] private static bool BuildTool_ClearTestPackageUsedCounts(BuildTool __instance) { if (!__instance.active) { return true; } Array.Clear(testPackageUsedCounts, 0, 12000); return true; } [HarmonyPostfix] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), "CalculateReformData")] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), "DetermineReforms")] private static void BuildTool_BlueprintPaste_ClearTestPackageUsedCounts() { Array.Clear(testPackageUsedCounts, 0, 12000); } [HarmonyPrefix] [HarmonyPatch(typeof(BuildTool_Reform), "GetNeedSandCountByInc")] private static bool BuildTool_Reform_ClearTestPackageUsedCounts(BuildTool_Reform __instance) { if (!((BuildTool)__instance).active) { Array.Clear(testPackageUsedCounts, 0, 12000); } return true; } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(BuildTool_Addon), "CheckBuildConditions")] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), "CalculateReformData")] [HarmonyPatch(typeof(BuildTool_Click), "CheckBuildConditions")] [HarmonyPatch(typeof(BuildTool_Inserter), "CheckBuildConditions")] [HarmonyPatch(typeof(BuildTool_Path), "CheckBuildConditions")] [HarmonyPatch(typeof(BuildTool_Reform), "GetNeedSandCountByInc")] private static IEnumerable TryTakeTailItems_Transpiler(IEnumerable instructions) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(StorageComponent), "TakeTailItems", new Type[4] { typeof(int).MakeByRefType(), typeof(int).MakeByRefType(), typeof(int).MakeByRefType(), typeof(bool) }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "TryTakeTailItems", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in TryTakeTailItems_Transpiler: {arg}"); return instructions; } } private static void TryTakeTailItems(StorageComponent storage, ref int itemId, ref int count, out int inc, bool useBan = false) { inc = 0; count = (int)Math.Min(count, GetItemTotalCount(itemId) - testPackageUsedCounts[itemId]); testPackageUsedCounts[itemId] += count; if (count == 0) { itemId = 0; } } [HarmonyTranspiler] [HarmonyPriority(600)] [HarmonyPatch(typeof(BuildTool_BlueprintPaste), "DetermineReforms")] private static IEnumerable TakeTailItemsWithIncTable_Transpiler(IEnumerable instructions) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown try { MethodInfo method = AccessTools.Method(typeof(StorageComponent), "TakeTailItemsWithIncTable", new Type[5] { typeof(int), typeof(int).MakeByRefType(), typeof(int).MakeByRefType(), typeof(int[]).MakeByRefType(), typeof(bool) }, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((Func)((CodeInstruction i) => i.opcode == OpCodes.Callvirt && i.operand.Equals(method)), (string)null) }).Repeat((Action)delegate(CodeMatcher matcher) { matcher.SetAndAdvance(OpCodes.Call, (object)AccessTools.Method(typeof(Utils), "TakeTailItemsWithIncTable", (Type[])null, (Type[])null)); }, (Action)null); return val.InstructionEnumeration(); } catch (Exception arg) { LogError($"Error in TakeTailItemsWithIncTable_Transpiler: {arg}"); return instructions; } } private static void TakeTailItemsWithIncTable(StorageComponent storage, int itemId, ref int count, out int inc, ref int[] incTable, bool useBan = false) { inc = 0; if (incTable == null || incTable.Length <= 10) { incTable = new int[11]; } else { Array.Clear(incTable, 0, incTable.Length); } count = (int)Math.Min(count, GetItemTotalCount(itemId) - testPackageUsedCounts[itemId]); if (count > 0) { testPackageUsedCounts[itemId] += count; long inc2; long n = GetItemTotalCountAndInc(itemId, out inc2); long num = split_inc(ref n, ref inc2, count); int num2 = (int)(num / count); int num3 = (int)(num - count * num2); int num4 = count - num3; if (num2 > 10) { num2 = 10; } incTable[num2] += num4; inc += num2 * num4; if (num2 + 1 > 10) { incTable[10] += num3; inc += 10 * num3; } else { incTable[num2 + 1] += num3; inc += (num2 + 1) * num3; } if (count > 0) { storage.lastFullItem = -1; storage.NotifyStorageChange(); } } } public static int TakeItemFromModData(int itemId, int count, out int inc, bool manual = false) { if (itemId == 1099) { inc = 0; if (GameMain.mainPlayer.sandCount >= count) { Player mainPlayer = GameMain.mainPlayer; mainPlayer.sandCount -= count; return count; } count = (int)GameMain.mainPlayer.sandCount; GameMain.mainPlayer.sandCount = 0L; return count; } lock (ItemManager.centerItemCount) { count = (int)Math.Min(count, ItemManager.centerItemCount[itemId]); count = Math.Min(100000, count); if (count <= 0) { inc = 0; return 0; } if (ItemManager.centerItemInc[itemId] / ItemManager.centerItemCount[itemId] >= 4) { inc = (int)split_inc(ref ItemManager.centerItemCount[itemId], ref ItemManager.centerItemInc[itemId], count); } else if (ItemManager.centerItemInc[itemId] >= count * 4) { ItemManager.centerItemCount[itemId] -= count; inc = count * 4; ItemManager.centerItemInc[itemId] -= inc; } else { ItemManager.centerItemCount[itemId] -= count; inc = (int)ItemManager.centerItemInc[itemId]; ItemManager.centerItemInc[itemId] = 0L; } if (NebulaModAPI.IsMultiplayerActive && manual) { NebulaModAPI.MultiplayerSession.Network.SendPacket(new CenterItemChangePacket(itemId, -count, -inc)); } return count; } } public static bool TakeItemWithTip(int itemId, int count, out int inc, bool showMessage = true) { inc = 0; if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return false; } ItemProto val = ((ProtoSet)(object)LDB.items).Select(itemId); if (val == null) { return false; } if (ArchitectMode && val.BuildMode != 0) { return true; } if (GetItemTotalCount(itemId) < count) { if (showMessage) { UIMessageBox.Show(Localization.Translate("提示"), $"{((Proto)val).name} 不足 {count}!", Localization.Translate("确定"), 1, (Response)null); } return false; } if (itemId == 1099) { if (GameMain.data.history.HasFeatureKey(1100001) && GameMain.sandboxToolsEnabled) { return true; } Player mainPlayer = GameMain.mainPlayer; mainPlayer.sandCount -= count; return true; } TakeTailItems(GameMain.mainPlayer.package, ref itemId, ref count, out inc); return true; } public static int split_inc(ref int n, ref int m, int p) { int num = m / n; int num2 = m - num * n; n -= p; int num3 = num2 - n; int num4 = ((num3 > 0) ? (num * p + num3) : (num * p)); m -= num4; return num4; } public static long split_inc(ref long n, ref long m, long p) { long num = m / n; long num2 = m - num * n; n -= p; long num3 = num2 - n; long num4 = ((num3 > 0) ? (num * p + num3) : (num * p)); m -= num4; return num4; } [HarmonyPrefix] [HarmonyPatch(typeof(StorageComponent), "Sort")] private static bool StorageComponent_Sort_Prefix(StorageComponent __instance) { Player mainPlayer = GameMain.mainPlayer; if (__instance != ((mainPlayer != null) ? mainPlayer.package : null)) { return true; } if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return true; } bool flag = (DateTime.Now - lastSortTime).TotalMilliseconds < 400.0 && TechItemInteractionUnlocked; lastSortTime = DateTime.Now; if (!flag) { if (!GameMain.mainPlayer.deliveryPackage.unlocked) { return true; } StorageComponent package = GameMain.mainPlayer.package; DeliveryPackage deliveryPackage = GameMain.mainPlayer.deliveryPackage; int inc = default(int); for (int num = 99; num >= 0; num--) { int itemId = deliveryPackage.grids[num].itemId; for (int i = 0; i < package.size; i++) { if (package.grids[i].itemId == itemId) { int num2 = deliveryPackage.AddItem(itemId, package.grids[i].count, package.grids[i].inc, ref inc); package.grids[i].count -= num2; package.grids[i].inc = inc; } } } } else { if (!TechItemInteractionUnlocked) { return true; } StorageComponent package2 = GameMain.mainPlayer.package; for (int j = 0; j < package2.size; j++) { if (package2.grids[j].filter == 0 && !(ItemManager.itemValue[package2.grids[j].itemId] >= float.MaxValue)) { AddItemToModData(package2.grids[j].itemId, package2.grids[j].count, package2.grids[j].inc, manual: true); package2.grids[j].itemId = 0; package2.grids[j].count = 0; package2.grids[j].inc = 0; } } } return true; } public static void ClickToMoveModDataItem(int itemId, bool leftClick) { ItemProto val = ((ProtoSet)(object)LDB.items).Select(itemId); if (val == null) { return; } int num = (leftClick ? (val.StackSize * Miscellaneous.LeftClickTakeCount) : (val.StackSize * Miscellaneous.RightClickTakeCount)); int inc; lock (ItemManager.centerItemCount) { num = TakeItemFromModData(itemId, num, out inc, manual: true); } if (itemId == 1099) { if (GameMain.mainPlayer.inhandItemId != 1099) { GameMain.mainPlayer.ThrowHandItems(); } GameMain.mainPlayer.inhandItemId = 1099; Player mainPlayer = GameMain.mainPlayer; mainPlayer.inhandItemCount += num; } else { AddItemToPackage(itemId, num, inc, throwTrash: false); } } public static int GetEssenceMinCount() { long val = Math.Min(ItemManager.centerItemCount[8041], ItemManager.centerItemCount[8042]); val = Math.Min(val, ItemManager.centerItemCount[8043]); val = Math.Min(val, ItemManager.centerItemCount[8044]); return (int)Math.Min(2147483647L, val); } public static bool TakeEssenceFromModData(int n, int[] consumeRegister) { if (ItemManager.centerItemCount[8041] < n || ItemManager.centerItemCount[8042] < n || ItemManager.centerItemCount[8043] < n || ItemManager.centerItemCount[8044] < n) { return false; } lock (ItemManager.centerItemCount) { TakeItemFromModData(8041, n, out var inc); TakeItemFromModData(8042, n, out inc); TakeItemFromModData(8043, n, out inc); TakeItemFromModData(8044, n, out inc); } lock (consumeRegister) { consumeRegister[8041] += n; consumeRegister[8042] += n; consumeRegister[8043] += n; consumeRegister[8044] += n; } return true; } public static double GetRandDouble(ref uint seed) { seed = (uint)((int)((ulong)((long)(seed % 2147483646 + 1) * 48271L) % 2147483647uL) - 1); return (double)seed / 2147483646.0; } public static int GetRandInt(int min, int max) { randSeed = (uint)((int)((ulong)((long)(randSeed % 2147483646 + 1) * 48271L) % 2147483647uL) - 1); double num = (double)randSeed / 2147483646.0; return (int)(num * (double)(max - min)) + min; } public static double GetRandDouble() { randSeed = (uint)((int)((ulong)((long)(randSeed % 2147483646 + 1) * 48271L) % 2147483647uL) - 1); return (double)randSeed / 2147483646.0; } public static string WithColor(this string s, Color color) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_004d: Unknown result type (might be due to invalid IL or missing references) string text = $"#{(byte)(color.r * 255f):X2}{(byte)(color.g * 255f):X2}{(byte)(color.b * 255f):X2}{(byte)(color.a * 255f):X2}"; return "" + s + ""; } public static string WithColor(this string s, int colorIdx) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (1 == 0) { } string result = ((colorIdx <= 0) ? s.WithColor(Gray) : (colorIdx switch { 1 => s.WithColor(White), 2 => s.WithColor(Green), 3 => s.WithColor(Blue), 4 => s.WithColor(Purple), 5 => s.WithColor(Red), 6 => s.WithColor(Orange), _ => s.WithColor(Gold), })); if (1 == 0) { } return result; } public static string WithColor(this string s, float itemValue) { //IL_0040: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00a2: Unknown result type (might be due to invalid IL or missing references) if (1 == 0) { } string result = ((itemValue <= 5f) ? s.WithColor(Gray) : ((itemValue <= 20f) ? s.WithColor(White) : ((itemValue <= 100f) ? s.WithColor(Green) : ((itemValue <= 500f) ? s.WithColor(Blue) : ((itemValue <= 2500f) ? s.WithColor(Purple) : ((itemValue <= 10000f) ? s.WithColor(Red) : ((!(itemValue <= 100000f)) ? s.WithColor(Gold) : s.WithColor(Orange)))))))); if (1 == 0) { } return result; } } [AttributeUsage(AttributeTargets.Class, Inherited = false)] public class PatchGuidAttribute : Attribute { public string Guid { get; } public PatchGuidAttribute(string guid) { Guid = guid; base..ctor(); } } public enum PatchCallbackFlag { CallOnEnableBeforePatch, CallOnDisableAfterUnpatch } [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] public class PatchSetCallbackFlagAttribute : Attribute { public PatchCallbackFlag Flag { get; } public PatchSetCallbackFlagAttribute(PatchCallbackFlag flag) { Flag = flag; base..ctor(); } } public class PatchImpl where T : PatchImpl, new() { protected Harmony _patch; protected static T Instance { get; } = new T(); public static void Enable(bool enable) { T instance = Instance; if (enable) { if (instance._patch == null) { string text = typeof(T).GetCustomAttribute()?.Guid ?? ("PatchImpl." + (typeof(T).FullName ?? typeof(T).ToString())); bool flag = typeof(T).GetCustomAttributes().Any((PatchSetCallbackFlagAttribute n) => n.Flag == PatchCallbackFlag.CallOnEnableBeforePatch); if (flag) { instance.OnEnable(); } instance._patch = Harmony.CreateAndPatchAll(typeof(T), text); if (!flag) { instance.OnEnable(); } } } else if (instance._patch != null) { bool flag2 = typeof(T).GetCustomAttributes().Any((PatchSetCallbackFlagAttribute n) => n.Flag == PatchCallbackFlag.CallOnDisableAfterUnpatch); if (!flag2) { instance.OnDisable(); } instance._patch.UnpatchSelf(); instance._patch = null; if (flag2) { instance.OnDisable(); } } } public static Harmony GetHarmony() { return Instance._patch; } protected virtual void OnEnable() { } protected virtual void OnDisable() { } } } namespace FE.UI.View { public static class MainWindow { private static PressKeyBind _toggleKey; private static bool _configWinInitialized; private static MyConfigWindow _configWin; private static bool sandboxMode; public static void AddTranslations() { FE.Utils.Utils.Register("KEYOpenFracCentre", "[FE] Open Fractionation Data Centre", "[FE] 打开分馏数据中心"); FE.Utils.Utils.Register("分馏数据中心", "Fractionation Data Centre"); FE.Utils.Utils.Register("核心操作", "Core Operation"); RecipeOperate.AddTranslations(); BuildingOperate.AddTranslations(); FE.Utils.Utils.Register("物品管理", "Item Management"); ItemInteraction.AddTranslations(); ImportantItem.AddTranslations(); FE.Utils.Utils.Register("资源获取", "Resource Collection"); TicketRaffle.AddTranslations(); LimitedTimeStore.AddTranslations(); FE.Utils.Utils.Register("进度系统", "Progress System"); MainTask.AddTranslations(); Achievements.AddTranslations(); DevelopmentDiary.AddTranslations(); FE.Utils.Utils.Register("统计相关", "Statistic Related"); RecipeGallery.AddTranslations(); FracStatistic.AddTranslations(); FE.Utils.Utils.Register("系统设置", "System Setting"); VipFeatures.AddTranslations(); Miscellaneous.AddTranslations(); SandboxMode.AddTranslations(); } public static void LoadConfig(ConfigFile configFile) { RecipeOperate.LoadConfig(configFile); BuildingOperate.LoadConfig(configFile); ItemInteraction.LoadConfig(configFile); ImportantItem.LoadConfig(configFile); TicketRaffle.LoadConfig(configFile); LimitedTimeStore.LoadConfig(configFile); MainTask.LoadConfig(configFile); Achievements.LoadConfig(configFile); DevelopmentDiary.LoadConfig(configFile); RecipeGallery.LoadConfig(configFile); FracStatistic.LoadConfig(configFile); VipFeatures.LoadConfig(configFile); Miscellaneous.LoadConfig(configFile); SandboxMode.LoadConfig(configFile); } public static void Init() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) MyConfigWindow.OnUICreated = (Action)Delegate.Combine(MyConfigWindow.OnUICreated, new Action(CreateUI)); MyConfigWindow.OnUpdateUI = (Action)Delegate.Combine(MyConfigWindow.OnUpdateUI, new Action(UpdateUI)); BuiltinKey val = default(BuiltinKey); val.key = new CombineKey(102, (byte)1, (ECombineKeyAction)0, false); val.conflictGroup = 2821; val.name = "OpenFracCentre"; val.canOverride = true; _toggleKey = CustomKeyBindSystem.RegisterKeyBindWithReturn(val); } private static void CreateUI(MyConfigWindow wnd, RectTransform trans) { wnd.AddTabGroup(trans, "核心操作"); RecipeOperate.CreateUI(wnd, trans); BuildingOperate.CreateUI(wnd, trans); wnd.AddTabGroup(trans, "物品管理"); ItemInteraction.CreateUI(wnd, trans); ImportantItem.CreateUI(wnd, trans); wnd.AddTabGroup(trans, "资源获取"); TicketRaffle.CreateUI(wnd, trans); LimitedTimeStore.CreateUI(wnd, trans); wnd.AddTabGroup(trans, "进度系统"); MainTask.CreateUI(wnd, trans); Achievements.CreateUI(wnd, trans); DevelopmentDiary.CreateUI(wnd, trans); wnd.AddTabGroup(trans, "统计相关"); RecipeGallery.CreateUI(wnd, trans); FracStatistic.CreateUI(wnd, trans); wnd.AddTabGroup(trans, "系统设置"); VipFeatures.CreateUI(wnd, trans); Miscellaneous.CreateUI(wnd, trans); if (sandboxMode) { SandboxMode.CreateUI(wnd, trans); } } private static void UpdateUI() { RecipeOperate.UpdateUI(); BuildingOperate.UpdateUI(); ItemInteraction.UpdateUI(); ImportantItem.UpdateUI(); TicketRaffle.UpdateUI(); LimitedTimeStore.UpdateUI(); MainTask.UpdateUI(); Achievements.UpdateUI(); DevelopmentDiary.UpdateUI(); RecipeGallery.UpdateUI(); FracStatistic.UpdateUI(); VipFeatures.UpdateUI(); Miscellaneous.UpdateUI(); if (sandboxMode) { SandboxMode.UpdateUI(); } } public static void OnInputUpdate() { if (GameMain.isPaused || !GameMain.isRunning || GameMain.isFullscreenPaused || GameMain.mainPlayer == null) { CloseConfigWindow(); } else if (!VFInput.inputing && _toggleKey.keyValue && GameMain.history.TechUnlocked(1251)) { ToggleConfigWindow(); } } private static void ToggleConfigWindow() { if (!_configWinInitialized) { _configWinInitialized = true; sandboxMode = GameMain.sandboxToolsEnabled; _configWin = MyConfigWindow.CreateInstance("FEMainWindow", "分馏数据中心"); } if (((ManualBehaviour)_configWin).active) { ((ManualBehaviour)_configWin)._Close(); return; } if (sandboxMode != GameMain.sandboxToolsEnabled) { sandboxMode = GameMain.sandboxToolsEnabled; _configWin = MyConfigWindow.CreateInstance("FEMainWindow", "分馏数据中心"); } _configWin.Open(); } private static void CloseConfigWindow() { if (_configWinInitialized && ((ManualBehaviour)_configWin).active) { ((ManualBehaviour)_configWin)._Close(); } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); RecipeOperate.Import(r); BuildingOperate.Import(r); ItemInteraction.Import(r); ImportantItem.Import(r); TicketRaffle.Import(r); if (num <= 1) { r.ReadInt32(); } LimitedTimeStore.Import(r); MainTask.Import(r); if (num <= 2) { r.ReadInt32(); } Achievements.Import(r); DevelopmentDiary.Import(r); RecipeGallery.Import(r); FracStatistic.Import(r); VipFeatures.Import(r); Miscellaneous.Import(r); SandboxMode.Import(r); } public static void Export(BinaryWriter w) { w.Write(3); BuildingOperate.Export(w); RecipeOperate.Export(w); ItemInteraction.Export(w); ImportantItem.Export(w); TicketRaffle.Export(w); LimitedTimeStore.Export(w); MainTask.Export(w); Achievements.Export(w); DevelopmentDiary.Export(w); RecipeGallery.Export(w); FracStatistic.Export(w); VipFeatures.Export(w); Miscellaneous.Export(w); SandboxMode.Export(w); } public static void IntoOtherSave() { BuildingOperate.IntoOtherSave(); RecipeOperate.IntoOtherSave(); ItemInteraction.IntoOtherSave(); ImportantItem.IntoOtherSave(); TicketRaffle.IntoOtherSave(); LimitedTimeStore.IntoOtherSave(); MainTask.IntoOtherSave(); Achievements.IntoOtherSave(); DevelopmentDiary.IntoOtherSave(); RecipeGallery.IntoOtherSave(); FracStatistic.IntoOtherSave(); VipFeatures.IntoOtherSave(); Miscellaneous.IntoOtherSave(); SandboxMode.IntoOtherSave(); } } } namespace FE.UI.View.Statistic { public static class FracStatistic { private static RectTransform window; private static RectTransform tab; public static void AddTranslations() { FE.Utils.Utils.Register("分馏统计", "Frac Statistic"); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "分馏统计"); float num = 0f; float num2 = 18f; } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } public static class RecipeGallery { private static RectTransform window; private static RectTransform tab; private static Text[,] recipeUnlockInfoText = new Text[9, 8]; private static int[] Matrixes = new int[7] { 6001, 6002, 6003, 6004, 6005, 6006, 5201 }; public static void AddTranslations() { FE.Utils.Utils.Register("配方图鉴", "Recipe Gallery"); FE.Utils.Utils.Register("配方解锁情况", "The recipe unlock status is as follows (" + "Full Upgrade".WithColor(7) + "/" + "Max Echo".WithColor(5) + "/" + "Unlocked".WithColor(3) + "/" + "Total".WithColor(1) + "):", "配方解锁情况如下(" + "完全升级".WithColor(7) + "/" + "最大回响".WithColor(5) + "/" + "已解锁".WithColor(3) + "/" + "总数".WithColor(1) + "):"); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "配方图鉴"); float x = 0f; float num = 18f; wnd.AddText2(x, num, tab, "配方解锁情况").supportRichText = true; num += 36f; for (int i = 0; i < 9; i++) { for (int j = 0; j < 8; j++) { (float, float) position = FE.Utils.Utils.GetPosition(j, 8); recipeUnlockInfoText[i, j] = wnd.AddText2(position.Item1, num, tab, "动态刷新"); recipeUnlockInfoText[i, j].supportRichText = true; } num += 36f; } recipeUnlockInfoText[0, 0].text = ""; for (int k = 1; k <= 7; k++) { recipeUnlockInfoText[k, 0].text = ((Proto)((ProtoSet)(object)LDB.items).Select(Matrixes[k - 1])).name.Replace(" Matrix", ""); } recipeUnlockInfoText[8, 0].text = Localization.Translate("总计"); for (int l = 1; l <= 6; l++) { recipeUnlockInfoText[0, l].text = ERecipeExtension.RecipeTypeShortNames[l - 1]; } recipeUnlockInfoText[0, 7].text = Localization.Translate("总计"); } public static void UpdateUI() { if (!((Component)tab).gameObject.activeSelf) { return; } int[,] array = new int[9, 8]; int[,] array2 = new int[9, 8]; int[,] array3 = new int[9, 8]; int[,] array4 = new int[9, 8]; for (int i = 1; i <= 7; i++) { for (int j = 1; j <= 6; j++) { int matrixID = Matrixes[i - 1]; ERecipe recipeType = (ERecipe)j; List list = (from r in RecipeManager.GetRecipesByType(recipeType) where r.MatrixID == matrixID select r).ToList(); array4[i, j] = list.Count; array4[8, j] += list.Count; array4[i, 7] += list.Count; array4[8, 7] += list.Count; list = list.Where((BaseRecipe r) => r.Unlocked).ToList(); array3[i, j] = list.Count; array3[8, j] += list.Count; array3[i, 7] += list.Count; array3[8, 7] += list.Count; list = list.Where((BaseRecipe r) => r.IsMaxEcho).ToList(); array2[i, j] = list.Count; array2[8, j] += list.Count; array2[i, 7] += list.Count; array2[8, 7] += list.Count; list = list.Where((BaseRecipe r) => r.FullUpgrade).ToList(); array[i, j] = list.Count; array[8, j] += list.Count; array[i, 7] += list.Count; array[8, 7] += list.Count; } } for (int k = 1; k <= 8; k++) { for (int l = 1; l <= 7; l++) { recipeUnlockInfoText[k, l].text = array[k, l].ToString().WithColor(7) + "/" + array2[k, l].ToString().WithColor(5) + "/" + array3[k, l].ToString().WithColor(3) + "/" + array4[k, l].ToString().WithColor(1); } } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } } namespace FE.UI.View.Setting { public static class Miscellaneous { private class DownloadThresholdMapper : MyWindow.RangeValueMapper { public DownloadThresholdMapper() : base(0, 20) { } public override float IndexToValue(int index) { return (float)index * 0.02f; } public override int ValueToIndex(float value) { return (int)Math.Round(value / 0.02f); } } private class UploadThresholdMapper : MyWindow.RangeValueMapper { public UploadThresholdMapper() : base(0, 20) { } public override float IndexToValue(int index) { return 0.6f + (float)index * 0.02f; } public override int ValueToIndex(float value) { return (int)Math.Round((value - 0.6f) / 0.02f); } } private static RectTransform window; private static RectTransform tab; private static int[] ClickTakeCounts = new int[7] { 1, 3, 5, 10, 30, 50, 100 }; private static string[] ClickTakeCountsStr = ClickTakeCounts.Select((int count) => count.ToString()).ToArray(); private static ConfigEntry LeftClickTakeCountEntry; private static ConfigEntry RightClickTakeCountEntry; private static readonly string[] TakeItemPriorityStrs = new string[6] { "背包 -> 物流背包 -> 分馏数据中心", "背包 -> 分馏数据中心 -> 物流背包", "物流背包 -> 背包 -> 分馏数据中心", "物流背包 -> 分馏数据中心 -> 背包", "分馏数据中心 -> 背包 -> 物流背包", "分馏数据中心 -> 物流背包 -> 背包" }; private static readonly int[][] TakeItemPriorityArr = new int[6][] { new int[3] { 0, 1, 2 }, new int[3] { 0, 2, 1 }, new int[3] { 1, 0, 2 }, new int[3] { 1, 2, 0 }, new int[3] { 2, 0, 1 }, new int[3] { 2, 1, 0 } }; private static ConfigEntry TakeItemPriorityEntry; private static MySlider DownloadThresholdSlider; private static UIButton DownloadThresholdTipsButton2; private static ConfigEntry DownloadThresholdEntry; private static MySlider UploadThresholdSlider; private static UIButton UploadThresholdTipsButton2; private static ConfigEntry UploadThresholdEntry; private static ConfigEntry ShowFractionateRecipeDetailsEntry; public static int LeftClickTakeCount => ClickTakeCounts[LeftClickTakeCountEntry.Value]; public static int RightClickTakeCount => ClickTakeCounts[RightClickTakeCountEntry.Value]; public static int[] TakeItemPriority => TakeItemPriorityArr[TakeItemPriorityEntry.Value]; public static float DownloadThreshold => DownloadThresholdEntry.Value; public static float UploadThreshold => UploadThresholdEntry.Value; public static bool ShowFractionateRecipeDetails => ShowFractionateRecipeDetailsEntry.Value; public static void AddTranslations() { FE.Utils.Utils.Register("杂项设置", "Miscellaneous"); FE.Utils.Utils.Register("左键单击时提取几组物品", "Extract how many sets of items when left-click"); FE.Utils.Utils.Register("右键单击时提取几组物品", "Extract how many sets of items when right-click"); FE.Utils.Utils.Register("物品消耗顺序", "Order of consumption of items"); FE.Utils.Utils.Register("背包", "Inventory"); FE.Utils.Utils.Register("物流背包", "Logistics Inventory"); FE.Utils.Utils.Register("背包 -> 物流背包 -> 分馏数据中心", "Inventory -> Logistics Inventory -> Fractionation Data Center"); FE.Utils.Utils.Register("背包 -> 分馏数据中心 -> 物流背包", "Inventory -> Fractionation Data Center -> Logistics Inventory"); FE.Utils.Utils.Register("物流背包 -> 背包 -> 分馏数据中心", "Logistics Inventory -> Inventory -> Fractionation Data Center"); FE.Utils.Utils.Register("物流背包 -> 分馏数据中心 -> 背包", "Logistics Inventory -> Fractionation Data Center -> Inventory"); FE.Utils.Utils.Register("分馏数据中心 -> 背包 -> 物流背包", "Fractionation Data Center -> Inventory -> Logistics Inventory"); FE.Utils.Utils.Register("分馏数据中心 -> 物流背包 -> 背包", "Fractionation Data Center -> Logistics Inventory -> Inventory"); FE.Utils.Utils.Register("物流交互站下载阈值", "Interaction Station download threshold"); FE.Utils.Utils.Register("物流交互站上传阈值", "Interaction Station upload threshold"); FE.Utils.Utils.Register("物流交互站阈值修改说明", "To ensure consistent processing logic, this value cannot be modified in multiplayer games. You can change it in single player mode and save it before playing online.", "为保证处理逻辑一致,多人游戏中无法修改此值。你可以在单人模式修改并保存后再联机游玩。"); FE.Utils.Utils.Register("显示分馏配方详细信息", "Show fractionate recipe details"); FE.Utils.Utils.Register("显示分馏配方详细信息说明", "Fractionation recipe details include the name, number, and probability of all products of the recipe.\nWhen disabled, the relevant information is gradually unlocked with the number of successful fractionate counts. When enabled, the relevant information is displayed directly.", "分馏配方详细信息包括配方所有产物的名称、数目、概率。\n禁用时,相关信息会随着分馏成功的次数逐渐解锁。启用时,相关信息会直接显示。"); } public static void LoadConfig(ConfigFile configFile) { LeftClickTakeCountEntry = configFile.Bind("Miscellaneous", "LeftClickTakeCount", 0, "左键单击时提取几组物品"); if (LeftClickTakeCountEntry.Value < 0 || LeftClickTakeCountEntry.Value >= ClickTakeCounts.Length) { LeftClickTakeCountEntry.Value = 0; } RightClickTakeCountEntry = configFile.Bind("Miscellaneous", "RightClickTakeCount", 3, "右键单击时提取几组物品"); if (RightClickTakeCountEntry.Value < 0 || RightClickTakeCountEntry.Value >= ClickTakeCounts.Length) { RightClickTakeCountEntry.Value = 3; } TakeItemPriorityEntry = configFile.Bind("Miscellaneous", "TakeItemPriority", 1, "物品消耗顺序"); if (TakeItemPriorityEntry.Value < 0 || TakeItemPriorityEntry.Value >= TakeItemPriorityArr.Length) { TakeItemPriorityEntry.Value = 1; } DownloadThresholdEntry = configFile.Bind("Miscellaneous", "DownloadThreshold", 0.2f, "物流交互站下载阈值"); if (DownloadThresholdEntry.Value < 0f || DownloadThresholdEntry.Value > 0.4f) { DownloadThresholdEntry.Value = 0.2f; } UploadThresholdEntry = configFile.Bind("Miscellaneous", "UploadThreshold", 0.8f, "物流交互站上传阈值"); if (UploadThresholdEntry.Value < 0.6f || UploadThresholdEntry.Value > 1f) { UploadThresholdEntry.Value = 0.8f; } ShowFractionateRecipeDetailsEntry = configFile.Bind("Miscellaneous", "ShowFractionateRecipeDetails", false, "显示分馏配方详细信息"); } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "杂项设置"); float num = 0f; float num2 = 18f; Text val = wnd.AddText2(num, num2, tab, "左键单击时提取几组物品"); wnd.AddComboBox(num + 5f + val.preferredWidth, num2, tab).WithItems(ClickTakeCountsStr).WithSize(200f, 0f) .WithConfigEntry(LeftClickTakeCountEntry); num2 += 36f; val = wnd.AddText2(num, num2, tab, "右键单击时提取几组物品"); wnd.AddComboBox(num + 5f + val.preferredWidth, num2, tab).WithItems(ClickTakeCountsStr).WithSize(200f, 0f) .WithConfigEntry(RightClickTakeCountEntry); num2 += 36f; val = wnd.AddText2(num, num2, tab, "物品消耗顺序"); wnd.AddComboBox(num + 5f + val.preferredWidth, num2, tab).WithItems(TakeItemPriorityStrs).WithSize(400f, 0f) .WithConfigEntry(TakeItemPriorityEntry); num2 += 36f; val = wnd.AddText2(num, num2, tab, "物流交互站下载阈值"); DownloadThresholdSlider = wnd.AddSlider(num + 5f + val.preferredWidth, num2, tab, DownloadThresholdEntry, new DownloadThresholdMapper(), "P0", 200f); DownloadThresholdTipsButton2 = wnd.AddTipsButton2(num + 5f + val.preferredWidth + 200f + 5f, num2, tab, "物流交互站下载阈值", "物流交互站阈值修改说明"); num2 += 36f; val = wnd.AddText2(num, num2, tab, "物流交互站上传阈值"); UploadThresholdSlider = wnd.AddSlider(num + 5f + val.preferredWidth, num2, tab, UploadThresholdEntry, new UploadThresholdMapper(), "P0", 200f); UploadThresholdTipsButton2 = wnd.AddTipsButton2(num + 5f + val.preferredWidth + 200f + 5f, num2, tab, "物流交互站上传阈值", "物流交互站阈值修改说明"); num2 += 36f; MyCheckBox myCheckBox = wnd.AddCheckBox(num, num2, tab, ShowFractionateRecipeDetailsEntry, "显示分馏配方详细信息"); wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2, tab, "显示分馏配方详细信息", "显示分馏配方详细信息说明"); } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { bool isMultiplayerActive = NebulaMultiplayerModAPI.IsMultiplayerActive; ((Selectable)DownloadThresholdSlider.slider).interactable = !isMultiplayerActive; ((Component)DownloadThresholdTipsButton2).gameObject.SetActive(isMultiplayerActive); ((Selectable)UploadThresholdSlider.slider).interactable = !isMultiplayerActive; ((Component)UploadThresholdTipsButton2).gameObject.SetActive(isMultiplayerActive); } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); if (num >= 2) { float value = r.ReadSingle(); float value2 = r.ReadSingle(); if (NebulaMultiplayerModAPI.IsClient) { DownloadThresholdEntry.Value = value; UploadThresholdEntry.Value = value2; } } } public static void Export(BinaryWriter w) { w.Write(2); w.Write(DownloadThreshold); w.Write(UploadThreshold); } public static void IntoOtherSave() { } } public static class SandboxMode { private class MultiRateMapper : MyWindow.RangeValueMapper { public MultiRateMapper() : base(0, 40) { } public override float IndexToValue(int index) { return (float)Math.Pow(10.0, (double)(index - 10) / 10.0); } public override int ValueToIndex(float value) { return (int)(Math.Log10(value) * 10.0 + 10.0); } } [CompilerGenerated] private static class <>O { public static UnityAction <0>__UnlockAllFracRecipes; } private static RectTransform window; private static RectTransform tab; private static ConfigEntry ExpMultiRateEntry; public static float ExpMultiRate => GameMain.sandboxToolsEnabled ? ExpMultiRateEntry.Value : 1f; public static void AddTranslations() { FE.Utils.Utils.Register("沙盒模式", "Sandbox Mode"); FE.Utils.Utils.Register("解锁所有分馏配方", "Unlock all fractionation recipes"); FE.Utils.Utils.Register("所有分馏配方已解锁。", "All fractionation recipes have been unlocked."); FE.Utils.Utils.Register("经验获取倍率", "Experience gain multiplier"); FE.Utils.Utils.Register("经验获取倍率说明", "Adjust the speed at which recipe experience is gained by processing items.", "调整通过处理物品获取配方经验的速度。"); } public static void LoadConfig(ConfigFile configFile) { ExpMultiRateEntry = configFile.Bind("TabSetting", "ExpMultiRate", 1f, "经验获取倍率"); } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { //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_0054: Expected O, but got Unknown window = trans; tab = wnd.AddTab(trans, "沙盒模式"); float num = 0f; float num2 = 18f; float y = num2; RectTransform parent = tab; object obj = <>O.<0>__UnlockAllFracRecipes; if (obj == null) { UnityAction val = RecipeManager.UnlockAllFracRecipes; <>O.<0>__UnlockAllFracRecipes = val; obj = (object)val; } wnd.AddButton(0, 2, y, parent, "解锁所有分馏配方", 16, "button-unlock-all-recipes", (UnityAction)obj); num2 += 36f; Text val2 = wnd.AddText2(num, num2, tab, "经验获取倍率", 15, "text-exp-multi-rate"); wnd.AddSlider(num + 5f + val2.preferredWidth, num2, tab, ExpMultiRateEntry, new MultiRateMapper(), "0.#", 200f); wnd.AddTipsButton2(num + 5f + val2.preferredWidth + 200f + 5f, num2, tab, "经验获取倍率", "经验获取倍率说明"); } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } public static class VipFeatures { private static RectTransform window; private static RectTransform tab; private static int Level = 0; private static float Exp = 0f; private static Text txtVipInfo; private static Text[] txtVipBonus = (Text[])(object)new Text[3]; private static float ExpLevelUp => (Level == 0) ? 1f : (1000f * (float)Math.Pow(2.0, Level)); public static float TicketValueMulti => (float)Math.Pow(1.0700000524520874, Level); public static int FreeExchangeCount => (Level + 1) / 2; public static float ExchangeDiscount => 1f / TicketValueMulti; public static void AddExp(float exp) { Exp += exp / ItemManager.itemValue[8006] * 50f; while (Exp >= ExpLevelUp) { Level++; for (int i = 0; i < 4; i++) { TicketRaffle.FreshPool(i); } } } public static void AddTranslations() { FE.Utils.Utils.Register("VIP特权", "VIP Features"); FE.Utils.Utils.Register("VIP等级:", "VIP level: "); FE.Utils.Utils.Register("VIP加成如下:", "VIP bonus are as follows:"); FE.Utils.Utils.Register("奖券抽奖加成", "When using lottery tickets for prize draws, the rewards obtained x{0:P2}", "使用奖券抽奖时,获得的奖励 x{0:P2}"); FE.Utils.Utils.Register("限时商店免费兑换项数", "Free exchange for the first {0} recipes/items in the limited-time shop", "免费兑换限时商店的前{0}项配方/物品"); FE.Utils.Utils.Register("限时商店购买折扣", "Exchange recipes/items from the limited-time shop at the price of {0:P2}", "以{0:P2}的价格兑换限时商店的配方/物品"); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "VIP特权"); float x = 0f; float num = 18f; txtVipInfo = wnd.AddText2(x, num, tab, "动态刷新"); txtVipInfo.supportRichText = true; num += 36f; wnd.AddText2(x, num, tab, "VIP加成如下:"); for (int i = 0; i < 3; i++) { num += 36f; txtVipBonus[i] = wnd.AddText2(x, num, tab, "动态刷新"); txtVipBonus[i].supportRichText = true; } } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { txtVipInfo.text = string.Format("{0}{1} ({2:F0} / {3:F0})", Localization.Translate("VIP等级:"), Level, Exp, Math.Ceiling(ExpLevelUp)).WithColor((Level - 1) / 3 + 1); txtVipBonus[0].text = string.Format(Localization.Translate("奖券抽奖加成"), TicketValueMulti).WithColor((Level - 1) / 3 + 1); txtVipBonus[1].text = string.Format(Localization.Translate("限时商店免费兑换项数"), FreeExchangeCount).WithColor((Level - 1) / 3 + 1); txtVipBonus[2].text = string.Format(Localization.Translate("限时商店购买折扣"), ExchangeDiscount).WithColor((Level - 1) / 3 + 1); } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); if (num >= 2) { Exp = r.ReadSingle(); AddExp(0f); } } public static void Export(BinaryWriter w) { w.Write(2); w.Write(Exp); } public static void IntoOtherSave() { Exp = 0f; Level = 0; } } } namespace FE.UI.View.ProgressSystem { public static class Achievements { private static RectTransform window; private static RectTransform tab; public static void AddTranslations() { FE.Utils.Utils.Register("成就详情", "Achievements"); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "成就详情"); float num = 0f; float num2 = 18f; } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } public static class DevelopmentDiary { private static RectTransform window; private static RectTransform tab; private static Dictionary programmingEvents; public static void AddTranslations() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) FE.Utils.Utils.Register("开发日记", "Development Diary"); programmingEvents = new Dictionary { { "FE1.0", 3 }, { "FE1.1", 5 } }; FE.Utils.Utils.Register("FE1.0-1", "", "2023年11月戴森球计划真好玩啊,十分甚至九分的好玩!\n加了Mod更好玩了!像是创世之书,简直变成另一个游戏了,好厉害!\n\n忽然,一个念头在脑海中一闪而过——\n我,能不能也写一个Mod?\n听起来不错,但我对编写戴森球计划的Mod这件事一窍不通,完全不知道从哪里入手。\n要不,去查查看有没有什么教程?"); FE.Utils.Utils.Register("FE1.0-2", "", "2023年11月我还真找到了一些相关的教程,比如:\n宵夜大佬的“【戴森球计划】LDBTool Mod教程”视频,讲了LDBTool的用法;\n宵夜大佬的“【游戏Mod开发教程】”视频,讲了Unity游戏Mod的常用工具——BepInex和Harmony;\n宵夜大佬的“Unity游戏Mod/插件制作教程”文集,详细讲了Harmony的各种功能;\n宵夜大佬的……\n……\n等等,这是不是有点不太对?\n不是哥们,人类进化怎么没带上我啊?\n宵夜大佬(xiaoye97)就是LDBTool的作者???而且他还写了好多其他Unity游戏的Mod???\n我也是97年的,为什么我们一样大,但是我跟个废物一样啥也不会啊?呜呜呜"); FE.Utils.Utils.Register("FE1.0-3", "", "2023年11月不管怎么说,我还是含泪看完了宵夜大佬的Mod教学。\n此时,我的内心仿佛有两个小人在打架:\n其中一个说:“这看起来还行啊,也不难!这不搞一个?”\n另一个说:“对呀对呀!”\n就这样,我踏上了这条不归路。\n\n" + "这就是故事的开端,充满梦想的色彩。".WithColor(FE.Utils.Utils.Orange)); FE.Utils.Utils.Register("FE1.0-4", "", "2023年12月虽说下定决心要写Mod,但是到底写什么呢?\n这段时间我也看了很多Mod,比如:改一下矿机速度;改一下油井速度;改一下制作台速度;改一下电线杆范围;……呃,好吧,这好像有点不对。\n确实,这也是Mod。但是我知道,这样的Mod并不是我想要的。\n我,想写一个" + "有趣".WithColor(FE.Utils.Utils.Blue) + "的Mod。"); FE.Utils.Utils.Register("FE1.0-5", "", "2023年12月" + "分馏宇宙(Fractionate Universe)".WithColor(FE.Utils.Utils.Orange) + "……这是什么Mod?\n虽然这个Mod第一次见,但这个模组的作者Maerd我可是相当了解——没错,就是编写“更多巨构(More Mega Structure)”、维护“深空来敌(They Come From Void)”的大佬!\n说时迟那时快,我的手啪的一下,很快啊,直接就点开了这个模组的简介。\n\n电动机可以分馏出电磁涡轮?\n粒子容器可以分馏出奇异物质?\n石墨烯可以分馏出碳纳米管?\n而且,好像不只是材料,建筑也可以分馏!\n低速传送带可以分馏出高速传送带?\n电弧熔炉可以分馏出位面熔炉?\n这……这也太" + "有趣".WithColor(FE.Utils.Utils.Blue) + "了叭!!!\n\n不得不说,在看到这个Mod的时候,我就被它深深地吸引了。\n这还等什么?我迫不及待地查看这个Mod的源码。"); FE.Utils.Utils.Register("FE1.0-6", "", "2023年12月哇,一个654行的方法AddFracRecipes(),添加了所有的分馏配方?\n18行代码一个配方,都是复制粘贴之后一个个手动改的ID、描述。\n这工作量也太大了叭!0.0\n\n看完之后,我仔细想了想,它应该有很大的优化空间。比如添加一些新的分馏配方,修改一下图标的样式……\n如果我把它改造一下……嘿嘿嘿。\n不过,新项目叫什么名字呢?肯定不能跟之前的一样。\n嗯——有了!不如,就叫它" + "万物分馏(Fractionate Everything)".WithColor(FE.Utils.Utils.Orange) + "吧!"); FE.Utils.Utils.Register("FE1.0-7", "", "2023年12月我新建了一个项目\n每个配方都是十多行代码,看起来是粘贴,然后一个个改的啊!\n没有用一个通用的方法包装一下,这工作量也太大了吧0.0\n嗯,代码看起来有很大的优化空间啊!\n那么——万物分馏(Fractionate Everything),启动!"); FE.Utils.Utils.Register("FE1.0-8", "", "2023年12月26日,周二有一个好消息和一个坏消息。\n坏消息是,我昨天一个苹果都没收到。\n好消息是,万物分馏1.0版本已经找亲(mian)爱(fei)的(xiao)群(bai)友(shu)测试过了。\n那么,是时候了——\n" + "万物分馏1.0,发布!".WithColor(FE.Utils.Utils.Orange) + "\n没错,我萌泪之所以能有今天的成就,全靠我自己的勤奋刻苦……Ctrl+C,Ctrl+V!"); FE.Utils.Utils.Register("FE1.0-9", "", "2024年3月1日时间过的好快啊,转眼间两个月就过去了。\n前些日子我把代码发布在了Github,这样我就能看到外国的小伙伴提出的意见了!\n让我看看他们在Issue里面说了些什么——\n\n看不到图标?呃,好吧,我得承认这是我的问题。\n我之前重构了代码,用一个通用的方法添加所有配方。但是图标我不会制作啊!所以就没管这部分的内容。\n嗯,这个确实比较紧急,那就先用产物图标代替一下,起码能看到再说。\n\n分馏图标错位,与其他Mod冲突?\n这个好像有点麻烦啊。没想到,真的有人反馈了一些Bug,还有一些改进建议。\n有的人说看不到图标在这段日子里,我的Github居然有外国友人 戴森球前几天添加了集装分拣器,瞬时堆叠,好强啊!\n我也得跟上官方的脚步,赶快为这个物品添加对应的升级配方。\n让我看看……好像还有干扰胶囊、压制胶囊、近程电浆塔,也一起加了吧!\nv1.0.1,发布!"); FE.Utils.Utils.Register("FE1.1-1", "", "2024年3月我感觉万物分馏还有挺大的优化空间。\n比如说,现在所有分馏配方都在开局直接解锁。要不改一下,改成随着科技逐渐解锁!\n再比如说\nv1.0.1,发布!"); FE.Utils.Utils.Register("IK-1", "", "今天是开荒新星系的第一天。\n嗯,环境看起来跟之前也没什么区别,就跟我居住的星球差不多。\n尤其是降落点附近的6铁6铜,感觉就像是主脑故意要降落在这里……\n算了,完成任务要紧,希望主脑没听到我刚才的吐槽。\n不过说起来,虽然我已经开荒了挺多星系,伊卡洛斯也控制的很熟练了,还是能感受到这个机甲的强力。\n说起来,我又想吐槽一下主脑了,明明开辟新星域也很危险的,为什么不直接把机甲参数拉满?\n还非要上传数据才能解封机甲的性能……真是辛苦我自己了。\n"); FE.Utils.Utils.Register("141标题", "Fractionate Everything 1.4.1 Update", "万物分馏1.4.1版本更新"); FE.Utils.Utils.Register("141信息", "Even though Fractionate Everything is part of the cheat mods, it has enough restrictions that it should be balanced.\n—until I try it out for myself and get through the game in one night, that's what I'm thinking.\nAfter my experience with the Fractionate Everything mod, the \"planning doesn't even play games\" joke hit me like a boomerang.\n\nThe idea of Fractionate Everything is great, but it's fatal flaw is " + "fractionation skips a lot of yield lines".WithColor(FE.Utils.Utils.Red) + " (especially with matrix fractionation).\nWithout using proliferators, 3% destroy probability means you only get 25% of the product, like 10,000 blue matrix => 2,500 red matrix => 625 yellow matrix => ......\nImagine when players realize that \"there is a huge loss of blue matrix to green matrix\", will they start building yellow or purple matrix production lines as I envisioned?\nThe answer is not. Production enhancers reduce damage and new matrices are overly complex, so players tend to expand the production of lower level matrices and then fractionate them.\nIn the end there are only three things to do in the game: expand the blue or red matrix production line, unlock tech, and wait.\nOh my god I bet there's no worse gaming experience than this!\nIt's hard to believe that the matrix fractionation chain is so poorly designed that it looks like Aunt Susan's apple pie next door!\n\nBack on topic, this mod was originally designed to be " + "fun".WithColor(FE.Utils.Utils.Blue) + ", but I've been working on making it a " + "balanced".WithColor(FE.Utils.Utils.Blue) + " mod.\nIt is an obvious fact that if you want to cheat, why not try \"Multfunction_Mod\" or \"CheatEnabler\"?\nIn response to matrix fractionation, I solicited ideas for improvements from a large number of players. I gathered various ways to change things, such as lag unlocking, fractionation consuming sand,\nincreasing power consumption, fractionated matrices not being able to be fractionated again, and so on, but they weren't in the way I expected.\n\nHowever, I figured out one thing: " + "Fractionation should provide convenience, but not skip game progression.".WithColor(FE.Utils.Utils.Orange) + "\nObviously, the Building-HighSpeed Fractionator is the best building. It's more of an aid and doesn't affect the game experience too much.\nSo in 1.4.1, I added switches for matrix fractionation, split the Building-HighSpeed Fractionator into Upgrade and Downgrade Fractionator and adjusted the fractionate recipes.\nHopefully these changes will make the mod more balanced.\n\nPS1: You can click " + "Update Log".WithColor(FE.Utils.Utils.Blue) + " for all the changes in 1.4.1.\nPS2: Don't forget to check out " + "the new settings".WithColor(FE.Utils.Utils.Blue) + " added in " + "Settings - Miscellaneous".WithColor(FE.Utils.Utils.Blue) + "!\nPS3: To celebrate this update, some " + "Blueprints".WithColor(FE.Utils.Utils.Blue) + " for Fractionate Everything have been added to the Blueprints library. \nThanks to everyone for using Fractionate Everything. " + "Have fun with fractionation!".WithColor(FE.Utils.Utils.Orange), "“尽管万物分馏属于作弊模组,但它的限制已经够多了,它应该是平衡的。”\n——在我亲自试玩并一个晚上通关游戏之前,我都是这样想的。\n在我体验万物分馏mod之后,“策划根本就不玩游戏”这个玩笑就像回旋镖一样打在了我的身上。\n\n万物分馏的想法是很棒的,但它的致命缺陷在于" + "分馏会跳过大量产线".WithColor(FE.Utils.Utils.Red) + "(尤其是矩阵分馏)。\n不使用增产剂的情况下,3%的损毁概率意味着你只能获得25%的产物,也就是10000蓝糖=>2500红糖=>625黄糖=>……\n试想一下,当玩家意识到“蓝糖分馏为绿糖会有巨大损耗”,他们会按照我的预想开始构建黄糖或紫糖产线吗?\n答案是不会。增产剂可以降低损毁,新矩阵又过于复杂,所以玩家倾向于扩大低级矩阵的产量,然后分馏它们。\n最后游戏只剩下三件事:扩大蓝糖或红糖的产线,解锁科技,以及等待。\n哦天哪,我敢打赌,没有比这更糟糕的游戏体验了!\n真是难以相信,矩阵分馏链的设计竟然如此糟糕,就像隔壁苏珊婶婶做的苹果派一样!\n\n回归正题,分馏设计之初是为了" + "有趣".WithColor(FE.Utils.Utils.Blue) + ",但是我一直致力于把它打造成一个" + "平衡".WithColor(FE.Utils.Utils.Blue) + "的mod。\n一个显而易见的事实是,如果你想作弊,为何不试试“Multfunction_Mod”或者“CheatEnabler”?\n针对矩阵分馏,我向大量玩家征集了改进意见。我收集到了各种改动方式,例如滞后解锁、分馏消耗沙土、加大耗电、\n分馏出的矩阵不能再次分馏等等,但它们都不是我所期望的方式。\n\n不过,我想明白了一件事情:" + "分馏应该提供便利,但是不能跳过游戏进程。".WithColor(FE.Utils.Utils.Orange) + "\n显然,建筑极速分馏塔是最优秀的建筑。它更像是一种辅助手段,并不会过多影响游戏体验。\n所以在1.4.1中,我为矩阵分馏增加了开关,将建筑极速分馏塔拆分为升级、转化塔并调整了分馏配方。\n希望这次改动能让分馏更加平衡。\n\nPS1:你可以点击" + "更新日志".WithColor(FE.Utils.Utils.Blue) + ",以了解1.4.1的所有改动。\nPS2:千万不要忘记查看" + "设置-杂项".WithColor(FE.Utils.Utils.Blue) + "中" + "新增的设置项".WithColor(FE.Utils.Utils.Blue) + "!\nPS3:为了庆祝本次更新,一些万物分馏的" + "蓝图".WithColor(FE.Utils.Utils.Blue) + "已添加至蓝图库。\n感谢万物分馏的每一位玩家。" + "尽情享受分馏的乐趣吧!".WithColor(FE.Utils.Utils.Orange)); FE.Utils.Utils.Register("142标题", "Fractionate Everything 1.4.2 Update", "万物分馏1.4.2版本更新"); FE.Utils.Utils.Register("142信息", "Haven't seen you for a long time, and I miss you very much. It's been another month and a half after last update. How are you?\n\nRemember in version 1.4.1, I said I had a couple " + "Blueprints".WithColor(FE.Utils.Utils.Blue) + " for you guys? That was indeed true, and it wasn't an April Fool's joke. \n-- Just " + "R2".WithColor(FE.Utils.Utils.Blue) + " took my blueprints folder " + "deleted".WithColor(FE.Utils.Utils.Red) + "!Σ(っ°Д°;)っ\nAs for why I didn't update the version after discovering this problem that day, it's because the folder is gone but the blueprints are still there...(O_o)??\nYes it's strange but the folder is gone and the blueprints are out there!\n" + "By the way, it's definitely NOT I'm lazy to update!".WithColor(FE.Utils.Utils.Orange) + "\nI'm curious if anyone has actually gone through the folder where the mod is and found those blueprints. (If so be sure to let me know www)\nOf course, this is a small problem for me. Since the files are unusable, I'll just shove them right inside the code!\nShakespeare once said: there's nothing that can't be solved by one string. If there is, then there are four! (three blueprints + intro)\nIf all goes well, you should see the blueprints this time. Be sure to " + "recheck the blueprint library!".WithColor(FE.Utils.Utils.Blue) + "\n\nIn addition, this update fixes an issue with the settings page reporting errors.\n\nThe main reason there hasn't been an update lately is the lack of inspiration, and I really can't think of anything else to optimize.\nI'm sure you can see that the idea of using fractionation as the core actually greatly limits the functionality of the mod.\nHowever, after talking with the group the other day, I've determined the general direction of the MOD afterward - that is " + "Draw".WithColor(FE.Utils.Utils.Orange) + ".\n\"Big company with a billion dollar market cap will only make card draw games, but a team of only five people can make Dyson Sphere Program\", I'm sure you've all heard of it.\n" + "But why couldn't the Dyson Sphere Program be a card draw game, right?".WithColor(FE.Utils.Utils.Orange) + " I'm coming now!\n\nThe next update will be centered around randomness and card draw. The following information can be revealed:\n1.There will be new fractionators for getting currency dedicated to card draw.\n2.Fractionation recipes can be obtained through technology, raffle, and redemption.\n3.The same fractionation recipe has different qualities, the higher the quality the harder it is to obtain.\n4.I hope to complete the initial version before the end of September. Welcome to join the group to experience the latest beta version and give your opinion!\n\nAnd finally, thanks for your support! " + "Have fun with fractionation!".WithColor(FE.Utils.Utils.Orange), "许久不见,甚是想念。时间过得真快啊,转眼又是一个半月。大家过的怎么样啊?\n\n还记得在1.4.1版本中,我说过为你们准备了几个" + "蓝图".WithColor(FE.Utils.Utils.Blue) + "吗?那确实是真的,它并不是一个愚人节玩笑。\n——只不过" + "R2".WithColor(FE.Utils.Utils.Blue) + "将我的蓝图文件夹" + "删掉了".WithColor(FE.Utils.Utils.Red) + "!Σ(っ°Д°;)っ\n至于我为什么当天发现这个问题之后,却并没有更新版本,是因为文件夹没了但是蓝图还在……(O_o)??\n事实正是如此,文件夹没了,蓝图跑外面了!\n" + "顺带一提,绝对不是因为我懒才不更新的!".WithColor(FE.Utils.Utils.Orange) + ")\n我很好奇到底有没有人去翻翻MOD所在的文件夹,把那几个蓝图找出来。(如果有的话务必告诉我哈哈)\n当然,这点小小的问题是难不倒我的。既然文件无法使用,那我就把它们直接塞到代码里面!\n鲁迅曾经说过:没有什么是一个字符串解决不了的。如果有,那就四个!(三个蓝图+简介)\n如果一切顺利的话,这次应该能看到蓝图了。请务必" + "重新检查一下蓝图库!".WithColor(FE.Utils.Utils.Blue) + "\n\n除此之外,此次更新修复了设置页面报错的问题。\n\n近期一直没有更新的主要原因是缺失灵感,我确实想不出有什么可以优化的地方了。\n想必大家也能看出来,以分馏作为核心的思路其实大大限制了MOD的功能。\n不过,前几天与群友交流之后,我确定了MOD之后的大致方向——那就是" + "抽奖".WithColor(FE.Utils.Utils.Orange) + "。\n“百亿大厂十连抽,五人团队戴森球”,想必大家都听过。嘿嘿嘿," + "谁说戴森球不能十连抽?".WithColor(FE.Utils.Utils.Orange) + "我踏马莱纳!\n\n接下来的更新将主要以“随机性与抽奖”作为核心。可以透露的信息如下:\n1.会有新的分馏塔,用于获取专用于抽奖的货币。\n2.分馏配方可通过科技、抽奖、兑换等方式获取。\n3.同一个分馏配方有不同品质,越高品质越难获取。\n4.希望能在9月底之前完成初版。欢迎加群体验最新测试版,并提出你的看法!\n\n一如既往,感谢大家的支持!" + "尽情享受分馏的乐趣吧!".WithColor(FE.Utils.Utils.Orange)); FE.Utils.Utils.Register("143标题", "Fractionate Everything 1.4.3 Update", "万物分馏1.4.3版本更新"); FE.Utils.Utils.Register("143信息", "This is a minor update that fix original fractionator can not fractionate hydrogen into deuterium.\nThanks to starfi5h for exploring why this bug appeared (I really didn't reproduce the bug, so I was never able to fix it).\n\nAdvertisement: If you want to quantify the production, we recommend using the web calculator [https://dsp-calc.pro/]\n\nVersion 1.5.0 is still in the works, and it's more of a pain in the ass than I expected.\nThe design part is basically finished at the moment, and I'm in the code-writing stage, though the UI aspect might be a challenge.\nIn new version, a fractionator similar to Trash Recycle Fractionator will be added for unlocking fractionation recipes, and providing currency to the store.\nRecipes have 'star' and 'rarity' attribute, which indicate the efficiency and rarity of the recipe, respectively.\nIn addition to fixed fractionation recipes, an optional fractionate recipe can be customized for output, allowing items to be reorganized in the early stages!\nThe above is all that's included in this update. As always, thank you for your support! " + "Have fun with fractionation!".WithColor(FE.Utils.Utils.Orange), "这次是一个小更新,修复了原版分馏塔无法将氢分馏为重氢的问题。\n感谢starfi5h大佬对此bug出现原因的探究(我确实没有复现此bug,所以一直无法修复)。\n\n打个广告:如果你想量化产线,推荐使用网页版量化计算器【https://dsp-calc.pro/】\n\n1.5.0版本的抽奖还在制作中,比我预想的要麻烦的多。\n目前设计部分基本完工,正处于编写代码阶段,不过UI方面可能是个难题。\n在新的版本中,将会增加一个与垃圾回收分馏塔类似的分馏塔,用于解锁分馏配方、向商店提供货币。\n配方具有“星级”与“稀有度”这两个属性,分别表示配方的效率与稀有程度。\n除了固定的分馏配方,还有可自定义输出的自选分馏配方,可以在前期将物品随意重组!\n以上就是本次更新的全部内容。一如既往,感谢大家的支持!" + "尽情享受分馏的乐趣吧!".WithColor(FE.Utils.Utils.Orange)); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "开发日记"); float num = 0f; float num2 = 18f; } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } public static class MainTask { private static RectTransform window; private static RectTransform tab; public static void AddTranslations() { FE.Utils.Utils.Register("主线任务", "Main Task"); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "主线任务"); float num = 0f; float num2 = 18f; } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } } namespace FE.UI.View.ModPackage { public static class ImportantItem { private static RectTransform window; private static RectTransform tab; private static readonly int[][] itemIdOriArr = new int[8][] { new int[7] { 8001, 8002, 8003, 8004, 8005, 8006, 8007 }, new int[6] { 8011, 8012, 8013, 8014, 8015, 8016 }, new int[2] { 8017, 8018 }, new int[3] { 8021, 8028, 8029 }, new int[6] { 8022, 8023, 8024, 8025, 8026, 8027 }, new int[4] { 8041, 8042, 8043, 8044 }, new int[6] { 6001, 6002, 6003, 6004, 6005, 6006 }, new int[6] { 5206, 5201, 5203, 5202, 5204, 5205 } }; private static readonly int[] itemIdArr = itemIdOriArr.SelectMany((int[] arr) => arr).ToArray(); private static readonly Text[] itemCountTextArr = (Text[])(object)new Text[itemIdArr.Length]; public static void AddTranslations() { FE.Utils.Utils.Register("重要物品", "Important Item"); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { window = trans; tab = wnd.AddTab(trans, "重要物品"); float num = 0f; float num2 = 18f; Text val = wnd.AddText2(num, num2, tab, "以下物品在分馏数据中心的存储量为:"); wnd.AddTipsButton2(num + 5f + val.preferredWidth, num2, tab, "提取物品", "提取物品说明"); num2 += 43f; int num3 = 0; for (int i = 0; i < itemIdOriArr.Length; i++) { int num4 = 0; for (int j = 0; j < itemIdOriArr[i].Length; j++) { if (num4 > 3) { num2 += 43f; num4 = 0; } (float, float) position = FE.Utils.Utils.GetPosition(num4, 4); num4++; int num5 = itemIdOriArr[i][j]; wnd.AddImageButton(position.Item1, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(num5)).WithTakeItemClickEvent(); itemCountTextArr[num3] = wnd.AddText2(position.Item1 + 45f, num2, tab, "动态刷新"); num3++; } num2 += 43f; } } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { for (int i = 0; i < itemCountTextArr.Length; i++) { itemCountTextArr[i].text = $"x {FE.Utils.Utils.GetModDataItemCount(itemIdArr[i])}"; } } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } public static class ItemInteraction { [CompilerGenerated] private static class <>O { public static UnityAction <0>__PrevPage; public static UnityAction <1>__NextPage; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__17_1; public static Action <>9__19_0; public static Func <>9__19_1; public static Func<(ItemProto, long), float> <>9__20_0; internal void b__17_1() { SelectedItemID = 0; } internal void b__19_0(ItemProto item) { <>c__DisplayClass19_0 CS$<>8__locals0 = new <>c__DisplayClass19_0 { item = item }; if (CS$<>8__locals0.item != null) { if (FE.Utils.Utils.GetModDataItemCount(((Proto)CS$<>8__locals0.item).ID) == 0) { ShowNotStoredItemEntry.Value = true; } SelectedItemID = ((Proto)CS$<>8__locals0.item).ID; List<(ItemProto, long)> displayItems = GetDisplayItems(); int num = displayItems.FindIndex(((ItemProto item, long count) tuple) => ((Proto)tuple.item).ID == ((Proto)CS$<>8__locals0.item).ID); if (num >= 0) { _currentPage = num / 60; } } } internal bool b__19_1(ItemProto item) { return true; } internal float b__20_0((ItemProto, long) tuple) { return ItemManager.itemValue[((Proto)tuple.Item1).ID]; } } [CompilerGenerated] private sealed class <>c__DisplayClass19_0 { public ItemProto item; internal bool b__2((ItemProto item, long count) tuple) { return ((Proto)tuple.item).ID == ((Proto)item).ID; } } private const int RowCount = 12; private const int ColumnCount = 5; private const int ItemsPerPage = 60; private static RectTransform window; private static RectTransform tab; private static ConfigEntry ShowNotStoredItemEntry; private static int SelectedItemID; private static int _currentPage; private static readonly MyImageButton[,] btnItems = new MyImageButton[12, 5]; private static readonly Text[,] txtItemCounts = new Text[12, 5]; private static UIButton _prevPageButton; private static UIButton _nextPageButton; private static Text _pageIndicator; private static bool ShowNotStoredItem => ShowNotStoredItemEntry.Value; public static void AddTranslations() { FE.Utils.Utils.Register("物品交互", "Item Interaction"); FE.Utils.Utils.Register("显示未存储的物品", "Display items not stored"); FE.Utils.Utils.Register("查找指定物品", "Search for a specified item"); FE.Utils.Utils.Register("上一页", "Previous page"); FE.Utils.Utils.Register("下一页", "Next page"); FE.Utils.Utils.Register("以下物品在分馏数据中心的存储量为:", "The storage capacity of the following items in the Fractionation data centre are: "); FE.Utils.Utils.Register("提取物品", "Extract Item"); FE.Utils.Utils.Register("提取物品说明", "Left-click or right-click to extract items. The number of extraction groups can be adjusted on the settings page.", "左键单击、右键单击均可提取物品,提取组数可以在设置页面调整。"); } public static void LoadConfig(ConfigFile configFile) { ShowNotStoredItemEntry = configFile.Bind("Item Interaction", "Show Not Stored Item", false, "是否显示未存储的物品。"); } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown window = trans; tab = wnd.AddTab(trans, "物品交互"); float num = 0f; float num2 = 18f; wnd.AddCheckBox(num, num2, tab, ShowNotStoredItemEntry, "显示未存储的物品"); float popupY = num2 + 18f; wnd.AddButton(3, 4, num2, tab, "查找指定物品", 16, "button", (UnityAction)delegate { SearchSpecifiedItem(popupY); }); num2 += 36f; Text val = wnd.AddText2(num, num2, tab, "以下物品在分馏数据中心的存储量为:"); wnd.AddTipsButton2(num + 5f + val.preferredWidth, num2, tab, "提取物品", "提取物品说明"); num2 += 43f; for (int i = 0; i < 12; i++) { for (int j = 0; j < 5; j++) { MyImageButton[,] array = btnItems; int num3 = i; int num4 = j; MyImageButton myImageButton = wnd.AddImageButton(FE.Utils.Utils.GetPosition(j, 5).Item1, num2, tab).WithTakeItemClickEvent(); object obj = <>c.<>9__17_1; if (obj == null) { UnityAction val2 = delegate { SelectedItemID = 0; }; <>c.<>9__17_1 = val2; obj = (object)val2; } array[num3, num4] = myImageButton.WithDeselectOnHover(enable: true, (UnityAction)obj); txtItemCounts[i, j] = wnd.AddText2(FE.Utils.Utils.GetPosition(j, 5).Item1 + 40f + 5f, num2, tab, "动态刷新"); } num2 += 43f; } float num5 = num2; float item = FE.Utils.Utils.GetPosition(0, 3).Item1; RectTransform parent = tab; object obj2 = <>O.<0>__PrevPage; if (obj2 == null) { UnityAction val3 = PrevPage; <>O.<0>__PrevPage = val3; obj2 = (object)val3; } _prevPageButton = wnd.AddButton(item, num5, parent, "上一页", 16, "button", (UnityAction)obj2); _pageIndicator = wnd.AddText2(FE.Utils.Utils.GetPosition(1, 3).Item1, num5 + 6f, tab, ""); _pageIndicator.alignment = (TextAnchor)4; RectTransform rectTransform = ((Graphic)_pageIndicator).rectTransform; rectTransform.sizeDelta = new Vector2(200f, rectTransform.sizeDelta.y); float item2 = FE.Utils.Utils.GetPosition(2, 3).Item1; RectTransform parent2 = tab; object obj3 = <>O.<1>__NextPage; if (obj3 == null) { UnityAction val4 = NextPage; <>O.<1>__NextPage = val4; obj3 = (object)val4; } _nextPageButton = wnd.AddButton(item2, num5, parent2, "下一页", 16, "button", (UnityAction)obj3); } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { List<(ItemProto, long)> displayItems = GetDisplayItems(); int num = Math.Max(1, (displayItems.Count + 60 - 1) / 60); if (_currentPage >= num) { _currentPage = num - 1; } int num2 = _currentPage * 60; int num3 = Math.Min(num2 + 60, displayItems.Count); int i = 0; for (int j = num2; j < num3; j++) { (ItemProto, long) tuple = displayItems[j]; ItemProto item = tuple.Item1; long item2 = tuple.Item2; int num4 = i / 5; int num5 = i % 5; ((Component)btnItems[num4, num5]).gameObject.SetActive(true); btnItems[num4, num5].Proto = (Proto)(object)item; btnItems[num4, num5].Selected = SelectedItemID > 0 && ((Proto)item).ID == SelectedItemID; txtItemCounts[num4, num5].text = $"x {item2}"; i++; } for (; i < 60; i++) { int num6 = i / 5; int num7 = i % 5; ((Component)btnItems[num6, num7]).gameObject.SetActive(false); txtItemCounts[num6, num7].text = ""; } UpdatePagination(num); } } private static void SearchSpecifiedItem(float y) { //IL_0006: 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_001a: 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_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_0057: Unknown result type (might be due to invalid IL or missing references) float x = tab.anchoredPosition.x; Rect rect = tab.rect; float num = x - ((Rect)(ref rect)).width / 2f; float y2 = tab.anchoredPosition.y; rect = tab.rect; float num2 = y2 + ((Rect)(ref rect)).height / 2f - y; UIItemPickerExtension.Popup(new Vector2(num, num2), (Action)delegate(ItemProto item) { if (item != null) { if (FE.Utils.Utils.GetModDataItemCount(((Proto)item).ID) == 0) { ShowNotStoredItemEntry.Value = true; } SelectedItemID = ((Proto)item).ID; List<(ItemProto, long)> displayItems = GetDisplayItems(); int num3 = displayItems.FindIndex(((ItemProto item, long count) tuple) => ((Proto)tuple.item).ID == ((Proto)item).ID); if (num3 >= 0) { _currentPage = num3 / 60; } } }, true, (Func)((ItemProto item) => true)); } private static List<(ItemProto item, long count)> GetDisplayItems() { List<(ItemProto, long)> list = new List<(ItemProto, long)>(); ItemProto[] dataArray = ((ProtoSet)(object)LDB.items).dataArray; foreach (ItemProto val in dataArray) { long modDataItemCount = FE.Utils.Utils.GetModDataItemCount(((Proto)val).ID); if ((!(ItemManager.itemValue[((Proto)val).ID] >= float.MaxValue) || modDataItemCount > 0) && (modDataItemCount > 0 || ShowNotStoredItem)) { list.Add((val, modDataItemCount)); } } return list.OrderBy(((ItemProto, long) tuple) => ItemManager.itemValue[((Proto)tuple.Item1).ID]).ToList(); } private static void PrevPage() { if (_currentPage > 0) { _currentPage--; } } private static void NextPage() { _currentPage++; } private static void UpdatePagination(int totalPages) { if ((Object)(object)_pageIndicator != (Object)null) { _pageIndicator.text = $"第{_currentPage + 1}页 / 共{totalPages}页"; } if ((Object)(object)_prevPageButton != (Object)null) { ((Selectable)_prevPageButton.button).interactable = _currentPage > 0; } if ((Object)(object)_nextPageButton != (Object)null) { ((Selectable)_nextPageButton.button).interactable = _currentPage < totalPages - 1; } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { SelectedItemID = 0; _currentPage = 0; } } } namespace FE.UI.View.GetItemRecipe { public class ExchangeInfo { public ItemProto item = null; public int itemCount = 0; public BaseRecipe recipe = null; public ItemProto matrix = null; public float matrixCount = 0f; public bool exchanged = false; public int matrixDiscountedCount => (int)Math.Ceiling(matrixCount * VipFeatures.ExchangeDiscount); public bool IsValid => (item != null && itemCount > 0 && matrix != null && matrixCount >= 0f) || (recipe != null && !recipe.IsMaxEcho && matrix != null && matrixCount >= 0f); public ExchangeInfo() { } public ExchangeInfo(ItemProto item, int itemCount, ItemProto matrix, float matrixCount) { this.item = item; this.itemCount = itemCount; this.matrix = matrix; this.matrixCount = matrixCount; } public ExchangeInfo(BaseRecipe recipe, ItemProto matrix, float matrixCount) { this.recipe = recipe; this.matrix = matrix; this.matrixCount = matrixCount; } public ExchangeInfo DeepCopy() { return new ExchangeInfo { item = item, itemCount = itemCount, recipe = recipe, matrix = matrix, matrixCount = matrixCount, exchanged = exchanged }; } public void Import(BinaryReader r) { int num = r.ReadInt32(); item = ((ProtoSet)(object)LDB.items).Select(r.ReadInt32()); itemCount = r.ReadInt32(); recipe = RecipeManager.GetRecipe((ERecipe)r.ReadInt32(), r.ReadInt32()); matrix = ((ProtoSet)(object)LDB.items).Select(r.ReadInt32()); matrixCount = ((num >= 2) ? r.ReadSingle() : ((float)r.ReadInt32())); exchanged = r.ReadBoolean(); } public void Export(BinaryWriter w) { w.Write(2); w.Write((item != null) ? ((Proto)item).ID : 0); w.Write(itemCount); w.Write((int)((recipe != null) ? recipe.RecipeType : ((ERecipe)0))); w.Write((recipe != null) ? recipe.InputID : 0); w.Write((matrix != null) ? ((Proto)matrix).ID : 0); w.Write(matrixCount); w.Write(exchanged); } } public static class LimitedTimeStore { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__21_0; public static UnityAction <>9__21_1; public static Func <>9__24_1; public static Func <>9__24_2; public static Func, IEnumerable> <>9__24_3; public static Func <>9__24_4; public static Func <>9__24_6; public static Predicate <>9__24_5; public static Response <>9__27_0; internal void b__21_0() { ModifyExchangeItemInfo(manual: true); } internal void b__21_1() { ExchangeAll(); } internal bool b__24_1(int itemId) { return GameMain.history.ItemUnlocked(itemId); } internal float b__24_2(int itemId) { return (float)(1.0 / Math.Log(ItemManager.itemValue[itemId] + 10f, Math.E)); } internal IEnumerable b__24_3(List list) { return list; } internal bool b__24_4(BaseRecipe recipe) { return !recipe.IsMaxEcho && GameMain.history.ItemUnlocked(recipe.InputID) && GameMain.history.ItemUnlocked(recipe.MatrixID); } internal bool b__24_6(BaseRecipe recipe) { return recipe.RecipeType != ERecipe.QuantumCopy; } internal bool b__24_5(BaseRecipe recipe) { return recipe.RecipeType == ERecipe.QuantumCopy; } internal void b__27_0() { for (int i = 0; i < exchangeInfoCount; i++) { Exchange(i, showMessage: false); } } internal IEnumerable <.cctor>b__31_0(int[] arr) { return arr; } } private static RectTransform window; private static RectTransform tab; private static int[] Matrixes = new int[6] { 6001, 6002, 6003, 6004, 6005, 6006 }; private static Text[] txtMatrixCount = (Text[])(object)new Text[Matrixes.Length]; private static readonly long baseFreshTs = 36000L; private static long nextFreshTick = baseFreshTs; private static Text txtLeftTime; private static int exchangeInfoCount = 12; private static readonly int exchangeInfoMaxCount = 12; private static ExchangeInfo[] exchangeInfos = new ExchangeInfo[exchangeInfoMaxCount]; private static MyImageButton[] exchangeImages1 = new MyImageButton[exchangeInfoMaxCount]; private static MyImageButton[] exchangeImages2 = new MyImageButton[exchangeInfoMaxCount]; private static Text[] txtExchangeInfos1 = (Text[])(object)new Text[exchangeInfoMaxCount]; private static Text[] txtExchangeInfos2 = (Text[])(object)new Text[exchangeInfoMaxCount]; private static MyImageButton[] exchangeImages3 = new MyImageButton[exchangeInfoMaxCount]; private static Text[] txtExchangeInfos3 = (Text[])(object)new Text[exchangeInfoMaxCount]; private static UIButton[] btnExchangeInfos = (UIButton[])(object)new UIButton[exchangeInfoMaxCount]; private static readonly int[][] itemIdOriArr = new int[7][] { new int[7] { 8001, 8002, 8003, 8004, 8005, 8006, 8007 }, new int[6] { 8011, 8012, 8013, 8014, 8015, 8016 }, new int[2] { 8017, 8018 }, new int[3] { 8021, 8028, 8029 }, new int[6] { 8022, 8023, 8024, 8025, 8026, 8027 }, new int[4] { 8041, 8042, 8043, 8044 }, new int[6] { 5206, 5201, 5203, 5202, 5204, 5205 } }; private static readonly int[] itemIdArr = itemIdOriArr.SelectMany((int[] arr) => arr).ToArray(); public static void AddTranslations() { FE.Utils.Utils.Register("限时商店", "Limited Time Store"); FE.Utils.Utils.Register("刷新剩余时间", "Refresh in {0} min {1} s", "还有 {0} min {1} s 刷新"); FE.Utils.Utils.Register("刷新", "Fresh"); FE.Utils.Utils.Register("刷新商店吗?", "to fresh store?"); FE.Utils.Utils.Register("兑换全部", "Exchange all"); FE.Utils.Utils.Register("要兑换全部配方/物品", "Would you like to exchange all recipes/items"); } public static void LoadConfig(ConfigFile configFile) { } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Expected O, but got Unknown window = trans; tab = wnd.AddTab(trans, "限时商店"); float num = 0f; float num2 = 25f; for (int j = 0; j < Matrixes.Length; j++) { float item = FE.Utils.Utils.GetPosition(j, Matrixes.Length).Item1; wnd.AddImageButton(item, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(Matrixes[j])); txtMatrixCount[j] = wnd.AddText2(item + 40f + 5f, num2, tab, "动态刷新"); } num2 += 43f; txtLeftTime = wnd.AddText2(num, num2, tab, "动态刷新", 15, "textLeftTime"); float y = num2; RectTransform parent = tab; object obj = <>c.<>9__21_0; if (obj == null) { UnityAction val = delegate { ModifyExchangeItemInfo(manual: true); }; <>c.<>9__21_0 = val; obj = (object)val; } wnd.AddButton(1, 3, y, parent, "刷新", 16, "button", (UnityAction)obj); float y2 = num2; RectTransform parent2 = tab; object obj2 = <>c.<>9__21_1; if (obj2 == null) { UnityAction val2 = delegate { ExchangeAll(); }; <>c.<>9__21_1 = val2; obj2 = (object)val2; } wnd.AddButton(2, 3, y2, parent2, "兑换全部", 16, "button", (UnityAction)obj2); num2 += 43f; for (int k = 0; k < exchangeInfoMaxCount; k++) { int i = k; exchangeImages1[i] = wnd.AddImageButton(num, num2, tab); exchangeImages2[i] = wnd.AddImageButton(num + 36f + 7f, num2, tab); txtExchangeInfos1[i] = wnd.AddText2(num + 40f + 5f, num2, tab, "动态刷新"); txtExchangeInfos2[i] = wnd.AddText2(num + 125f, num2, tab, "<="); exchangeImages3[i] = wnd.AddImageButton(FE.Utils.Utils.GetPosition(1, 4).Item1, num2, tab); txtExchangeInfos3[i] = wnd.AddText2(FE.Utils.Utils.GetPosition(1, 4).Item1 + 40f + 5f, num2, tab, "动态刷新"); btnExchangeInfos[i] = wnd.AddButton(2, 3, num2, tab, "兑换", 16, $"btn-exchange{i}", (UnityAction)delegate { Exchange(i); }); num2 += 43f; } } public static void UpdateUI() { if (((Component)tab).gameObject.activeSelf) { for (int i = 0; i < Matrixes.Length; i++) { txtMatrixCount[i].text = $"x {FE.Utils.Utils.GetItemTotalCount(Matrixes[i])}"; } long num = nextFreshTick - GameMain.gameTick; int num2 = (int)(num / 3600); num %= 3600; int num3 = (int)(num / 60); txtLeftTime.text = string.Format(Localization.Translate("刷新剩余时间"), num2, num3); FreshExchangeItemInfo(); } } [HarmonyPostfix] [HarmonyPatch(typeof(GameMain), "FixedUpdate")] public static void GameData_GameTick_Postfix() { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null && GameMain.history.TechUnlocked(1251) && GameMain.gameTick >= nextFreshTick) { ModifyExchangeItemInfo(); } } private static void ModifyExchangeItemInfo(bool manual = false) { //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown long gameTick = GameMain.gameTick; int matrixID; if (GameMain.history.ItemUnlocked(6006)) { matrixID = 6006; } else if (GameMain.history.ItemUnlocked(6005)) { matrixID = 6005; } else if (GameMain.history.ItemUnlocked(6004)) { matrixID = 6004; } else if (GameMain.history.ItemUnlocked(6003)) { matrixID = 6003; } else if (GameMain.history.ItemUnlocked(6002)) { matrixID = 6002; } else { matrixID = 6001; } ItemProto val = ((ProtoSet)(object)LDB.items).Select(matrixID); float num = TicketRaffle.RecipeValues[matrixID - 6001]; int matrixRecipeCostInt = (int)Math.Ceiling(num); if (manual) { UIMessageBox.Show(Localization.Translate("提示"), string.Format("{0} {1} x {2} {3}", Localization.Translate("要花费"), ((Proto)val).name, matrixRecipeCostInt, Localization.Translate("刷新商店吗?")), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (FE.Utils.Utils.TakeItemWithTip(matrixID, matrixRecipeCostInt, out var _)) { VipFeatures.AddExp(ItemManager.itemValue[matrixID] * (float)matrixRecipeCostInt); nextFreshTick = gameTick - baseFreshTs + 1; ModifyExchangeItemInfo(); } }, (Response)null); return; } UIItemup.Up(8048, 1); if (gameTick >= nextFreshTick) { long num2 = gameTick - nextFreshTick; long num3 = num2 / baseFreshTs + 1; nextFreshTick += num3 * baseFreshTs; } float num4 = ItemManager.itemValue[matrixID] * num; List list2 = new List(); int[] array = itemIdArr.Where((int itemId) => GameMain.history.ItemUnlocked(itemId)).ToArray(); float[] array2 = array.Select((int itemId) => (float)(1.0 / Math.Log(ItemManager.itemValue[itemId] + 10f, Math.E))).ToArray(); float num5 = array2.Sum(); for (int i = 0; i < array.Length; i++) { int num6 = array[i]; ItemProto val2 = ((ProtoSet)(object)LDB.items).Select(num6); int num7 = ((num6 == 8017 || num6 == 8018) ? 1 : ((val2.BuildMode != 0) ? (val2.StackSize / 2) : (val2.StackSize * 10))); float num8 = (float)num7 * ItemManager.itemValue[((Proto)val2).ID] / ItemManager.itemValue[((Proto)val).ID]; if (num8 > num) { num7 = (int)(num4 / ItemManager.itemValue[((Proto)val2).ID]); if (num7 == 0) { num7++; } num8 = (float)num7 * ItemManager.itemValue[((Proto)val2).ID] / ItemManager.itemValue[((Proto)val).ID]; } ExchangeInfo item = new ExchangeInfo(val2, num7, val, num8); int num9 = (int)Math.Ceiling(array2[i] / num5 * 10000f); for (int j = 0; j < num9; j++) { list2.Add(item); } } List list3 = new List(); List list4 = (from recipe in RecipeManager.GetRecipesUnderMatrix(((Proto)val).ID).SelectMany((List list) => list) where !recipe.IsMaxEcho && GameMain.history.ItemUnlocked(recipe.InputID) && GameMain.history.ItemUnlocked(recipe.MatrixID) select recipe).ToList(); if (list4.Any((BaseRecipe recipe) => recipe.RecipeType != ERecipe.QuantumCopy)) { list4.RemoveAll((BaseRecipe recipe) => recipe.RecipeType == ERecipe.QuantumCopy); } foreach (BaseRecipe item2 in list4) { ItemProto val3 = ((ProtoSet)(object)LDB.items).Select(item2.MatrixID); float matrixCount = TicketRaffle.RecipeValues[((Proto)val3).ID - 6001]; list3.Add(new ExchangeInfo(item2, val3, matrixCount)); } Dictionary dictionary = new Dictionary(); for (int k = 0; k < exchangeInfoMaxCount; k++) { if (list3.Count > 0 && FE.Utils.Utils.GetRandDouble() < 0.5) { ExchangeInfo exchangeInfo = list3[FE.Utils.Utils.GetRandInt(0, list3.Count)]; BaseRecipe recipe2 = exchangeInfo.recipe; if (dictionary.ContainsKey(recipe2)) { dictionary[recipe2]++; int num10 = (recipe2.Locked ? (1 + recipe2.MaxEcho) : (recipe2.MaxEcho - recipe2.Echo)); if (dictionary[recipe2] >= num10) { list3.Remove(exchangeInfo); } } else { dictionary[recipe2] = 1; } exchangeInfos[k] = exchangeInfo.DeepCopy(); } else { exchangeInfos[k] = list2[FE.Utils.Utils.GetRandInt(0, list2.Count)].DeepCopy(); } if (k < VipFeatures.FreeExchangeCount) { exchangeInfos[k].matrixCount = 0f; } } for (int l = 0; l < exchangeInfos.Length; l++) { if (exchangeInfos[l].matrixCount == 0f) { Exchange(l, showMessage: false); } } } private static void FreshExchangeItemInfo() { for (int i = 0; i < exchangeInfoMaxCount; i++) { ExchangeInfo exchangeInfo = exchangeInfos[i]; if (exchangeInfo.item != null) { ((Component)exchangeImages1[i]).gameObject.SetActive(true); exchangeImages1[i].Proto = (Proto)(object)exchangeInfo.item; ((Component)exchangeImages2[i]).gameObject.SetActive(false); txtExchangeInfos1[i].text = $"x {exchangeInfo.itemCount}"; txtExchangeInfos2[i].text = "<="; ((Component)exchangeImages3[i]).gameObject.SetActive(true); exchangeImages3[i].Proto = (Proto)(object)exchangeInfo.matrix; ((Component)txtExchangeInfos3[i]).gameObject.SetActive(true); txtExchangeInfos3[i].text = $"x {exchangeInfo.matrixDiscountedCount}"; ((Component)btnExchangeInfos[i]).gameObject.SetActive(true); if (!exchangeInfo.IsValid) { ((Behaviour)btnExchangeInfos[i]).enabled = false; btnExchangeInfos[i].SetText(Localization.Translate("无法兑换")); } else if (exchangeInfo.exchanged) { ((Behaviour)btnExchangeInfos[i]).enabled = false; btnExchangeInfos[i].SetText(Localization.Translate("已兑换")); } else { ((Behaviour)btnExchangeInfos[i]).enabled = true; btnExchangeInfos[i].SetText(Localization.Translate("兑换")); } } else if (exchangeInfo.recipe != null) { ((Component)exchangeImages1[i]).gameObject.SetActive(true); exchangeImages1[i].Proto = (Proto)(object)((ProtoSet)(object)LDB.items).Select(exchangeInfo.recipe.RecipeType.GetSpriteItemId()); ((Component)exchangeImages2[i]).gameObject.SetActive(true); exchangeImages2[i].Proto = (Proto)(object)((ProtoSet)(object)LDB.items).Select(exchangeInfo.recipe.InputID); txtExchangeInfos1[i].text = ""; txtExchangeInfos2[i].text = "<="; ((Component)exchangeImages3[i]).gameObject.SetActive(true); exchangeImages3[i].Proto = (Proto)(object)exchangeInfo.matrix; ((Component)txtExchangeInfos3[i]).gameObject.SetActive(true); txtExchangeInfos3[i].text = $"x {exchangeInfo.matrixDiscountedCount}"; ((Component)btnExchangeInfos[i]).gameObject.SetActive(true); if (!exchangeInfo.IsValid) { ((Behaviour)btnExchangeInfos[i]).enabled = false; btnExchangeInfos[i].SetText(Localization.Translate("无法兑换")); } else if (exchangeInfo.exchanged) { ((Behaviour)btnExchangeInfos[i]).enabled = false; btnExchangeInfos[i].SetText(Localization.Translate("已兑换")); } else { ((Behaviour)btnExchangeInfos[i]).enabled = true; btnExchangeInfos[i].SetText(Localization.Translate("兑换")); } } else { ((Component)exchangeImages1[i]).gameObject.SetActive(false); ((Component)exchangeImages2[i]).gameObject.SetActive(false); txtExchangeInfos1[i].text = ""; txtExchangeInfos2[i].text = ""; ((Component)exchangeImages3[i]).gameObject.SetActive(false); txtExchangeInfos3[i].text = ""; ((Component)btnExchangeInfos[i]).gameObject.SetActive(false); } } } private static void Exchange(int index, bool showMessage = true) { //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Expected O, but got Unknown //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown ExchangeInfo info = exchangeInfos[index]; if (!info.IsValid || info.exchanged) { return; } int inc; if (info.item != null) { if (info.matrixDiscountedCount == 0 || !showMessage) { if (FE.Utils.Utils.TakeItemWithTip(((Proto)info.matrix).ID, info.matrixDiscountedCount, out inc, showMessage)) { VipFeatures.AddExp(ItemManager.itemValue[((Proto)info.matrix).ID] * (float)info.matrixDiscountedCount); FE.Utils.Utils.AddItemToModData(((Proto)info.item).ID, info.itemCount, 0, manual: true); info.exchanged = true; } return; } UIMessageBox.Show(Localization.Translate("提示"), string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)info.matrix).name, info.matrixDiscountedCount) + string.Format("{0} {1} x {2} {3}", Localization.Translate("来兑换"), ((Proto)info.item).name, info.itemCount, Localization.Translate("吗?")), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (FE.Utils.Utils.TakeItemWithTip(((Proto)info.matrix).ID, info.matrixDiscountedCount, out var _, showMessage)) { VipFeatures.AddExp(ItemManager.itemValue[((Proto)info.matrix).ID] * (float)info.matrixDiscountedCount); FE.Utils.Utils.AddItemToModData(((Proto)info.item).ID, info.itemCount, 0, manual: true); info.exchanged = true; } }, (Response)null); return; } if (info.matrixDiscountedCount == 0 || !showMessage) { if (FE.Utils.Utils.TakeItemWithTip(((Proto)info.matrix).ID, info.matrixDiscountedCount, out inc, showMessage)) { VipFeatures.AddExp(ItemManager.itemValue[((Proto)info.matrix).ID] * (float)info.matrixDiscountedCount); info.recipe.RewardThis(manual: true); info.exchanged = true; } return; } UIMessageBox.Show(Localization.Translate("提示"), string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)info.matrix).name, info.matrixDiscountedCount) + Localization.Translate("来兑换") + " " + info.recipe.TypeName + " " + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (FE.Utils.Utils.TakeItemWithTip(((Proto)info.matrix).ID, info.matrixDiscountedCount, out var _, showMessage)) { VipFeatures.AddExp(ItemManager.itemValue[((Proto)info.matrix).ID] * (float)info.matrixDiscountedCount); info.recipe.RewardThis(manual: true); info.exchanged = true; } }, (Response)null); } private static void ExchangeAll() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown string text = Localization.Translate("提示"); string text2 = Localization.Translate("要兑换全部配方/物品") + Localization.Translate("吗?"); string text3 = Localization.Translate("确定"); string text4 = Localization.Translate("取消"); object obj = <>c.<>9__27_0; if (obj == null) { Response val = delegate { for (int i = 0; i < exchangeInfoCount; i++) { Exchange(i, showMessage: false); } }; <>c.<>9__27_0 = val; obj = (object)val; } UIMessageBox.Show(text, text2, text3, text4, 2, (Response)obj, (Response)null); } public static void Import(BinaryReader r) { int num = r.ReadInt32(); nextFreshTick = ((num >= 2) ? r.ReadInt64() : baseFreshTs); if (num >= 3) { int num2 = r.ReadInt32(); int i = 0; while (num2 > 0 && i < exchangeInfoMaxCount) { ExchangeInfo exchangeInfo = new ExchangeInfo(); exchangeInfo.Import(r); exchangeInfos[i] = exchangeInfo; num2--; i++; } for (; i < exchangeInfoMaxCount; i++) { exchangeInfos[i] = new ExchangeInfo(); } while (num2 > 0) { new ExchangeInfo().Import(r); num2--; } } else { for (int j = 0; j < exchangeInfoMaxCount; j++) { exchangeInfos[j] = new ExchangeInfo(); } } } public static void Export(BinaryWriter w) { w.Write(3); w.Write(nextFreshTick); w.Write(exchangeInfos.Length); ExchangeInfo[] array = exchangeInfos; foreach (ExchangeInfo exchangeInfo in array) { exchangeInfo.Export(w); } } public static void IntoOtherSave() { nextFreshTick = 0L; for (int i = 0; i < exchangeInfoMaxCount; i++) { exchangeInfos[i] = new ExchangeInfo(); } } } public static class TicketRaffle { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static EventHandler <>9__68_0; public static EventHandler <>9__68_1; public static EventHandler <>9__68_2; public static EventHandler <>9__68_3; public static EventHandler <>9__68_4; public static EventHandler <>9__68_5; public static EventHandler <>9__68_6; public static EventHandler <>9__68_7; public static UnityAction <>9__69_0; public static UnityAction <>9__69_1; public static UnityAction <>9__69_2; public static UnityAction <>9__69_3; public static UnityAction <>9__69_4; public static UnityAction <>9__69_5; public static UnityAction <>9__69_6; public static UnityAction <>9__69_7; public static UnityAction <>9__69_8; public static UnityAction <>9__69_9; public static UnityAction <>9__69_10; public static UnityAction <>9__69_11; public static Func <>9__70_1; public static Func <>9__70_2; public static Func <>9__70_3; public static Predicate <>9__72_2; public static Func <>9__72_3; public static Func <>9__72_0; public static Func <>9__72_1; public static Func <>9__73_3; public static Predicate <>9__73_1; public static Predicate <>9__73_2; public static Func <>9__75_0; public static Func <>9__76_0; internal void b__68_0(object _, EventArgs _) { EnableAutoRaffle1Entry.Value = false; } internal void b__68_1(object _, EventArgs _) { FreshPool(1); } internal void b__68_2(object _, EventArgs _) { EnableAutoRaffle2Entry.Value = false; } internal void b__68_3(object _, EventArgs _) { FreshPool(2); } internal void b__68_4(object _, EventArgs _) { EnableAutoRaffle3Entry.Value = false; } internal void b__68_5(object _, EventArgs _) { FreshPool(3); } internal void b__68_6(object _, EventArgs _) { EnableAutoRaffle4Entry.Value = false; } internal void b__68_7(object _, EventArgs _) { FreshPool(4); } internal void b__69_0() { RaffleRecipe(1); } internal void b__69_1() { RaffleRecipe(10); } internal void b__69_2() { RaffleRecipe(-1, 5); } internal void b__69_3() { RaffleFracProto(1); } internal void b__69_4() { RaffleFracProto(10); } internal void b__69_5() { RaffleFracProto(-1, 5); } internal void b__69_6() { RaffleMaterial(1); } internal void b__69_7() { RaffleMaterial(10); } internal void b__69_8() { RaffleMaterial(-1, 5); } internal void b__69_9() { RaffleBuilding(1); } internal void b__69_10() { RaffleBuilding(10); } internal void b__69_11() { RaffleBuilding(-1, 5); } internal bool b__70_1(BaseRecipe r) { return r.Unlocked; } internal bool b__70_2(BaseRecipe r) { return r.IsMaxEcho; } internal bool b__70_3(BaseRecipe r) { return r.FullUpgrade; } internal bool b__72_2(BaseRecipe recipe) { return recipe.IsMaxEcho; } internal bool b__72_3(ItemProto item) { return ((Proto)item).ID >= 8041 && ((Proto)item).ID <= 8044; } internal bool b__72_0(ItemProto item) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 return ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode == 0 && (int)item.Type != 11 && (((Proto)item).ID < 8001 || ((Proto)item).ID > 8007) && (((Proto)item).ID < 8011 || ((Proto)item).ID > 8018) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID); } internal bool b__72_1(ItemProto item) { return ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode != 0 && (((Proto)item).ID < 8021 || ((Proto)item).ID > 8029) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID); } internal bool b__73_3(BaseRecipe recipe) { return recipe.RecipeType != ERecipe.QuantumCopy; } internal bool b__73_1(BaseRecipe recipe) { return recipe.RecipeType == ERecipe.QuantumCopy; } internal bool b__73_2(BaseRecipe recipe) { return recipe.IsMaxEcho; } internal bool b__75_0(ItemProto item) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 return ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode == 0 && (int)item.Type != 11 && (((Proto)item).ID < 8001 || ((Proto)item).ID > 8007) && (((Proto)item).ID < 8011 || ((Proto)item).ID > 8018) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID); } internal bool b__76_0(ItemProto item) { return ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode != 0 && (((Proto)item).ID < 8021 || ((Proto)item).ID > 8029) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID); } } private static RectTransform window; private static RectTransform tab; private static readonly int[] TicketIds = new int[7] { 8001, 8002, 8003, 8004, 8005, 8006, 8007 }; private static readonly int[] MatrixIds = new int[7] { 6001, 6002, 6003, 6004, 6005, 6006, 5201 }; private static readonly string[] TicketNames = new string[7] { Localization.Translate("电磁奖券"), Localization.Translate("能量奖券"), Localization.Translate("结构奖券"), Localization.Translate("信息奖券"), Localization.Translate("引力奖券"), Localization.Translate("宇宙奖券"), Localization.Translate("黑雾奖券") }; private static readonly Text[] txtTicketCount = (Text[])(object)new Text[TicketIds.Length]; private static ConfigEntry TicketIdx1Entry; private static Text txtCoreCount; private static (float[] rates, int[] counts) pool1; private static List recipes; private static UIButton btnMaxRaffle1; private static ConfigEntry EnableAutoRaffle1Entry; private static readonly float[] RecipeRaffleMaxCounts = new float[7] { 33.614f, 48.02f, 68.6f, 98f, 140f, 200f, 100f }; private static float[] _recipeValues; private static Text[,] recipeUnlockInfoText = new Text[2, 7]; private static ConfigEntry TicketIdx2Entry; private static Text txtChipCount; private static (float[] rates, int[] counts) pool2; private static UIButton btnMaxRaffle2; private static ConfigEntry EnableAutoRaffle2Entry; private static Text[] txtFracProtoCounts = (Text[])(object)new Text[6]; private static ConfigEntry TicketIdx3Entry; private static List commonItems3 = new List(); private static (float[] rates, int[] counts) pool3; private static UIButton btnMaxRaffle3; private static ConfigEntry EnableAutoRaffle3Entry; private static ConfigEntry TicketIdx4Entry; private static List commonItems4 = new List(); private static (float[] rates, int[] counts) pool4; private static UIButton btnMaxRaffle4; private static ConfigEntry EnableAutoRaffle4Entry; private static long lastAutoRaffleTick = 0L; private static int TicketIdx1 => TicketIdx1Entry.Value; private static int SelectedTicketId1 => TicketIds[TicketIdx1]; private static int SelectedMatrixId1 => MatrixIds[TicketIdx1]; private static int MaxRaffleCount1 => (int)Math.Min(100L, FE.Utils.Utils.GetItemTotalCount(SelectedTicketId1)); public static float[] RecipeValues { get { if (_recipeValues == null && ItemManager.itemValue[8001] > 0f) { _recipeValues = new float[7]; for (int i = 0; i < 7; i++) { _recipeValues[i] = (float)Math.Sqrt(ItemManager.itemValue[TicketIds[i]] * RecipeRaffleMaxCounts[i]); } } return _recipeValues; } } private static float RecipeValue => (RecipeValues == null) ? float.MaxValue : RecipeValues[TicketIdx1]; private static int TicketIdx2 => TicketIdx2Entry.Value; private static int SelectedTicketId2 => TicketIds[TicketIdx2]; private static int SelectedMatrixId2 => MatrixIds[TicketIdx2]; private static int MaxRaffleCount2 => (int)Math.Min(100L, FE.Utils.Utils.GetItemTotalCount(SelectedTicketId2)); private static int TicketIdx3 => TicketIdx3Entry.Value; private static int SelectedTicketId3 => TicketIds[TicketIdx3]; private static int SelectedMatrixId3 => MatrixIds[TicketIdx3]; private static int MaxRaffleCount3 => (int)Math.Min(100L, FE.Utils.Utils.GetItemTotalCount(SelectedTicketId3)); private static int TicketIdx4 => TicketIdx4Entry.Value; private static int SelectedTicketId4 => TicketIds[TicketIdx4]; private static int SelectedMatrixId4 => MatrixIds[TicketIdx4]; private static int MaxRaffleCount4 => (int)Math.Min(100L, FE.Utils.Utils.GetItemTotalCount(SelectedTicketId4)); public static void AddTranslations() { FE.Utils.Utils.Register("奖券抽奖", "Ticket Raffle"); FE.Utils.Utils.Register("配方奖池", "Recipe pool"); FE.Utils.Utils.Register("配方奖池说明", "Various fractionate recipes and Fractionate Recipe Core can be drawn.\nEach type of lottery ticket can only yield recipes for items of the same technological tier.\nThe Quantum Replication recipes can only be drawn after all the other recipes are full of echoes.", "可以抽取各种分馏配方,以及分馏配方通用核心。\n每种奖券只能抽到相同科技层次物品的相关配方。\n其他配方全部满回响后,才能抽取到量子复制配方。"); FE.Utils.Utils.Register("当前奖券", "Current ticket"); FE.Utils.Utils.Register("奖券数目", "Ticket count"); FE.Utils.Utils.Register(":", ": "); FE.Utils.Utils.Register("抽奖", "Draw"); FE.Utils.Utils.Register("自动百连", "Auto hundred draws"); FE.Utils.Utils.Register("原胚奖池", "Fractionator Proto pool"); FE.Utils.Utils.Register("原胚奖池说明", "Various fractionator prototypes and Fractionator Increase Chip can be drawn.", "可以抽取各种分馏塔原胚,以及分馏塔增幅芯片。"); FE.Utils.Utils.Register("材料奖池", "Material pool"); FE.Utils.Utils.Register("材料奖池说明", "Various materials can be drawn.\nOnly materials that have been unlocked can be drawn.\nUnable to draw Matrix cards (except Dark Fog Matrix) or lottery tickets.", "可以抽取各种材料。\n只能抽到已解锁的材料。\n无法抽到矩阵(黑雾矩阵除外)、奖券。"); FE.Utils.Utils.Register("建筑奖池", "Building pool"); FE.Utils.Utils.Register("建筑奖池说明", "Various buildings can be drawn.\nOnly buildings that have been unlocked can be drawn.\nUnable to draw the newly added fractionator or logistic interaction station.", "可以抽取各种建筑。\n只能抽到已解锁的建筑。\n无法抽到新增的分馏塔、物流交互站。"); FE.Utils.Utils.Register("抽奖结果", "Raffle results"); FE.Utils.Utils.Register("获得了以下物品", "Obtained the following items"); FE.Utils.Utils.Register("谢谢惠顾喵", "Thank you meow"); FE.Utils.Utils.Register("已解锁", "unlocked"); FE.Utils.Utils.Register("已转为同名回响提示", "has been converted to a homonym echo (currently holding {0} homonym echoes)", "已转为同名回响(当前持有 {0} 同名回响)"); FE.Utils.Utils.Register("所有奖励已存储至分馏数据中心。", "All rewards have been stored in the fractionation data centre."); } public static void LoadConfig(ConfigFile configFile) { TicketIdx1Entry = configFile.Bind("Ticket Raffle", "Ticket Idx 1", 0, "配方抽奖奖券索引。"); if (TicketIdx1Entry.Value < 0 || TicketIdx1Entry.Value >= TicketIds.Length) { TicketIdx1Entry.Value = 0; } EnableAutoRaffle1Entry = configFile.Bind("Ticket Raffle", "Enable Auto Raffle 1", false, "配方抽奖是否自动百连。"); TicketIdx1Entry.SettingChanged += delegate { EnableAutoRaffle1Entry.Value = false; }; TicketIdx1Entry.SettingChanged += delegate { FreshPool(1); }; TicketIdx2Entry = configFile.Bind("Ticket Raffle", "Ticket Idx 2", 0, "原胚抽奖奖券索引。"); if (TicketIdx2Entry.Value < 0 || TicketIdx2Entry.Value >= TicketIds.Length) { TicketIdx2Entry.Value = 0; } EnableAutoRaffle2Entry = configFile.Bind("Ticket Raffle", "Enable Auto Raffle 2", false, "原胚抽奖是否自动百连。"); TicketIdx2Entry.SettingChanged += delegate { EnableAutoRaffle2Entry.Value = false; }; TicketIdx2Entry.SettingChanged += delegate { FreshPool(2); }; TicketIdx3Entry = configFile.Bind("Ticket Raffle", "Ticket Idx 3", 0, "材料抽奖奖券索引。"); if (TicketIdx3Entry.Value < 0 || TicketIdx3Entry.Value >= TicketIds.Length) { TicketIdx3Entry.Value = 0; } EnableAutoRaffle3Entry = configFile.Bind("Ticket Raffle", "Enable Auto Raffle 3", false, "材料抽奖是否自动百连。"); TicketIdx3Entry.SettingChanged += delegate { EnableAutoRaffle3Entry.Value = false; }; TicketIdx3Entry.SettingChanged += delegate { FreshPool(3); }; TicketIdx4Entry = configFile.Bind("Ticket Raffle", "Ticket Idx 4", 0, "建筑抽奖奖券索引。"); if (TicketIdx4Entry.Value < 0 || TicketIdx4Entry.Value >= TicketIds.Length) { TicketIdx4Entry.Value = 0; } EnableAutoRaffle4Entry = configFile.Bind("Ticket Raffle", "Enable Auto Raffle 4", false, "建筑抽奖是否自动百连。"); TicketIdx4Entry.SettingChanged += delegate { EnableAutoRaffle4Entry.Value = false; }; TicketIdx4Entry.SettingChanged += delegate { FreshPool(4); }; } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Expected O, but got Unknown //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Expected O, but got Unknown //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Expected O, but got Unknown //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Expected O, but got Unknown //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Expected O, but got Unknown //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_081d: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Expected O, but got Unknown //IL_0852: Unknown result type (might be due to invalid IL or missing references) //IL_0857: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Expected O, but got Unknown //IL_099f: Unknown result type (might be due to invalid IL or missing references) //IL_09a4: Unknown result type (might be due to invalid IL or missing references) //IL_09aa: Expected O, but got Unknown //IL_09e8: Unknown result type (might be due to invalid IL or missing references) //IL_09ed: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Expected O, but got Unknown //IL_0a22: Unknown result type (might be due to invalid IL or missing references) //IL_0a27: Unknown result type (might be due to invalid IL or missing references) //IL_0a2d: Expected O, but got Unknown window = trans; tab = wnd.AddTab(trans, "奖券抽奖"); float num = 0f; float num2 = 25f; for (int i = 0; i < TicketIds.Length; i++) { float item = FE.Utils.Utils.GetPosition(i, TicketIds.Length).Item1; wnd.AddImageButton(item, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(TicketIds[i])); txtTicketCount[i] = wnd.AddText2(item + 40f + 5f, num2, tab, "动态刷新"); } num2 += 43f; num2 += 27f; Text val = wnd.AddText2(num, num2, tab, "配方奖池"); wnd.AddTipsButton2(num + 5f + val.preferredWidth, num2, tab, "配方奖池", "配方奖池说明"); val = wnd.AddText2(FE.Utils.Utils.GetPosition(1, 4).Item1, num2, tab, "当前奖券"); wnd.AddComboBox(FE.Utils.Utils.GetPosition(1, 4).Item1 + 5f + val.preferredWidth, num2, tab).WithItems(TicketNames).WithSize(200f, 0f) .WithConfigEntry(TicketIdx1Entry); wnd.AddImageButton(FE.Utils.Utils.GetPosition(3, 5).Item1, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(8017)); txtCoreCount = wnd.AddText2(FE.Utils.Utils.GetPosition(3, 4).Item1 + 40f + 5f, num2, tab, "动态刷新"); num2 += 43f; float y = num2; RectTransform parent = tab; string text = Localization.Translate("抽奖") + " x 1"; object obj = <>c.<>9__69_0; if (obj == null) { UnityAction val2 = delegate { RaffleRecipe(1); }; <>c.<>9__69_0 = val2; obj = (object)val2; } wnd.AddButton(0, 4, y, parent, text, 16, "button", (UnityAction)obj); float y2 = num2; RectTransform parent2 = tab; string text2 = Localization.Translate("抽奖") + " x 10"; object obj2 = <>c.<>9__69_1; if (obj2 == null) { UnityAction val3 = delegate { RaffleRecipe(10); }; <>c.<>9__69_1 = val3; obj2 = (object)val3; } wnd.AddButton(1, 4, y2, parent2, text2, 16, "button", (UnityAction)obj2); float y3 = num2; RectTransform parent3 = tab; object obj3 = <>c.<>9__69_2; if (obj3 == null) { UnityAction val4 = delegate { RaffleRecipe(-1, 5); }; <>c.<>9__69_2 = val4; obj3 = (object)val4; } btnMaxRaffle1 = wnd.AddButton(2, 4, y3, parent3, "动态刷新", 16, "button", (UnityAction)obj3); wnd.AddCheckBox(FE.Utils.Utils.GetPosition(3, 4).Item1, num2, tab, EnableAutoRaffle1Entry, "自动百连"); num2 += 36f; wnd.AddText2(num, num2, tab, "配方解锁情况").supportRichText = true; for (int j = 0; j < 2; j++) { num2 += 36f; for (int k = 0; k < 7; k++) { (float, float) position = FE.Utils.Utils.GetPosition(k, 7); recipeUnlockInfoText[j, k] = wnd.AddText2(position.Item1, num2, tab, "动态刷新"); recipeUnlockInfoText[j, k].supportRichText = true; } } for (int l = 0; l <= 5; l++) { recipeUnlockInfoText[0, l].text = ERecipeExtension.RecipeTypeShortNames[l]; } recipeUnlockInfoText[0, 6].text = Localization.Translate("总计"); num2 += 36f; num2 += 27f; val = wnd.AddText2(num, num2, tab, "原胚奖池"); wnd.AddTipsButton2(num + 5f + val.preferredWidth, num2, tab, "原胚奖池", "原胚奖池说明"); val = wnd.AddText2(FE.Utils.Utils.GetPosition(1, 4).Item1, num2, tab, "当前奖券"); wnd.AddComboBox(FE.Utils.Utils.GetPosition(1, 4).Item1 + 5f + val.preferredWidth, num2, tab).WithItems(TicketNames).WithSize(200f, 0f) .WithConfigEntry(TicketIdx2Entry); wnd.AddImageButton(FE.Utils.Utils.GetPosition(3, 4).Item1, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(8018)); txtChipCount = wnd.AddText2(FE.Utils.Utils.GetPosition(3, 4).Item1 + 40f + 5f, num2, tab, "动态刷新"); num2 += 43f; float y4 = num2; RectTransform parent4 = tab; string text3 = Localization.Translate("抽奖") + " x 1"; object obj4 = <>c.<>9__69_3; if (obj4 == null) { UnityAction val5 = delegate { RaffleFracProto(1); }; <>c.<>9__69_3 = val5; obj4 = (object)val5; } wnd.AddButton(0, 4, y4, parent4, text3, 16, "button", (UnityAction)obj4); float y5 = num2; RectTransform parent5 = tab; string text4 = Localization.Translate("抽奖") + " x 10"; object obj5 = <>c.<>9__69_4; if (obj5 == null) { UnityAction val6 = delegate { RaffleFracProto(10); }; <>c.<>9__69_4 = val6; obj5 = (object)val6; } wnd.AddButton(1, 4, y5, parent5, text4, 16, "button", (UnityAction)obj5); float y6 = num2; RectTransform parent6 = tab; object obj6 = <>c.<>9__69_5; if (obj6 == null) { UnityAction val7 = delegate { RaffleFracProto(-1, 5); }; <>c.<>9__69_5 = val7; obj6 = (object)val7; } btnMaxRaffle2 = wnd.AddButton(2, 4, y6, parent6, "动态刷新", 16, "button", (UnityAction)obj6); wnd.AddCheckBox(FE.Utils.Utils.GetPosition(3, 4).Item1, num2, tab, EnableAutoRaffle2Entry, "自动百连"); num2 += 43f; for (int m = 0; m < 6; m++) { wnd.AddImageButton(FE.Utils.Utils.GetPosition(m, 6).Item1, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(8011 + m)); txtFracProtoCounts[m] = wnd.AddText2(FE.Utils.Utils.GetPosition(m, 6).Item1 + 40f + 5f, num2, tab, "动态刷新"); } num2 += 43f; num2 += 20f; val = wnd.AddText2(num, num2, tab, "材料奖池"); wnd.AddTipsButton2(num + 5f + val.preferredWidth, num2, tab, "材料奖池", "材料奖池说明"); val = wnd.AddText2(FE.Utils.Utils.GetPosition(1, 4).Item1, num2, tab, "当前奖券"); wnd.AddComboBox(FE.Utils.Utils.GetPosition(1, 4).Item1 + 5f + val.preferredWidth, num2, tab).WithItems(TicketNames).WithSize(200f, 0f) .WithConfigEntry(TicketIdx3Entry); num2 += 36f; float y7 = num2; RectTransform parent7 = tab; string text5 = Localization.Translate("抽奖") + " x 1"; object obj7 = <>c.<>9__69_6; if (obj7 == null) { UnityAction val8 = delegate { RaffleMaterial(1); }; <>c.<>9__69_6 = val8; obj7 = (object)val8; } wnd.AddButton(0, 4, y7, parent7, text5, 16, "button", (UnityAction)obj7); float y8 = num2; RectTransform parent8 = tab; string text6 = Localization.Translate("抽奖") + " x 10"; object obj8 = <>c.<>9__69_7; if (obj8 == null) { UnityAction val9 = delegate { RaffleMaterial(10); }; <>c.<>9__69_7 = val9; obj8 = (object)val9; } wnd.AddButton(1, 4, y8, parent8, text6, 16, "button", (UnityAction)obj8); float y9 = num2; RectTransform parent9 = tab; object obj9 = <>c.<>9__69_8; if (obj9 == null) { UnityAction val10 = delegate { RaffleMaterial(-1, 5); }; <>c.<>9__69_8 = val10; obj9 = (object)val10; } btnMaxRaffle3 = wnd.AddButton(2, 4, y9, parent9, "动态刷新", 16, "button", (UnityAction)obj9); wnd.AddCheckBox(FE.Utils.Utils.GetPosition(3, 4).Item1, num2, tab, EnableAutoRaffle3Entry, "自动百连"); num2 += 36f; num2 += 20f; val = wnd.AddText2(num, num2, tab, "建筑奖池"); wnd.AddTipsButton2(num + 5f + val.preferredWidth, num2, tab, "建筑奖池", "建筑奖池说明"); val = wnd.AddText2(FE.Utils.Utils.GetPosition(1, 4).Item1, num2, tab, "当前奖券"); wnd.AddComboBox(FE.Utils.Utils.GetPosition(1, 4).Item1 + 5f + val.preferredWidth, num2, tab).WithItems(TicketNames).WithSize(200f, 0f) .WithConfigEntry(TicketIdx4Entry); num2 += 36f; float y10 = num2; RectTransform parent10 = tab; string text7 = Localization.Translate("抽奖") + " x 1"; object obj10 = <>c.<>9__69_9; if (obj10 == null) { UnityAction val11 = delegate { RaffleBuilding(1); }; <>c.<>9__69_9 = val11; obj10 = (object)val11; } wnd.AddButton(0, 4, y10, parent10, text7, 16, "button", (UnityAction)obj10); float y11 = num2; RectTransform parent11 = tab; string text8 = Localization.Translate("抽奖") + " x 10"; object obj11 = <>c.<>9__69_10; if (obj11 == null) { UnityAction val12 = delegate { RaffleBuilding(10); }; <>c.<>9__69_10 = val12; obj11 = (object)val12; } wnd.AddButton(1, 4, y11, parent11, text8, 16, "button", (UnityAction)obj11); float y12 = num2; RectTransform parent12 = tab; object obj12 = <>c.<>9__69_11; if (obj12 == null) { UnityAction val13 = delegate { RaffleBuilding(-1, 5); }; <>c.<>9__69_11 = val13; obj12 = (object)val13; } btnMaxRaffle4 = wnd.AddButton(2, 4, y12, parent12, "动态刷新", 16, "button", (UnityAction)obj12); wnd.AddCheckBox(FE.Utils.Utils.GetPosition(3, 4).Item1, num2, tab, EnableAutoRaffle4Entry, "自动百连"); } public static void UpdateUI() { if (!((Component)tab).gameObject.activeSelf) { return; } for (int i = 0; i < TicketIds.Length; i++) { txtTicketCount[i].text = $"x {FE.Utils.Utils.GetItemTotalCount(TicketIds[i])}"; } txtCoreCount.text = $"x {FE.Utils.Utils.GetItemTotalCount(8017)}"; txtChipCount.text = $"x {FE.Utils.Utils.GetItemTotalCount(8018)}"; for (int j = 0; j < 6; j++) { txtFracProtoCounts[j].text = $"x {FE.Utils.Utils.GetItemTotalCount(8011 + j)}"; } btnMaxRaffle1.SetText(string.Format("{0} x {1}", Localization.Translate("抽奖"), MaxRaffleCount1)); btnMaxRaffle2.SetText(string.Format("{0} x {1}", Localization.Translate("抽奖"), MaxRaffleCount2)); btnMaxRaffle3.SetText(string.Format("{0} x {1}", Localization.Translate("抽奖"), MaxRaffleCount3)); btnMaxRaffle4.SetText(string.Format("{0} x {1}", Localization.Translate("抽奖"), MaxRaffleCount4)); int[,] array = new int[2, 7]; int[,] array2 = new int[2, 7]; int[,] array3 = new int[2, 7]; int[,] array4 = new int[2, 7]; for (int k = 0; k <= 5; k++) { int matrixID = SelectedMatrixId1; ERecipe recipeType = (ERecipe)(k + 1); List list = (from r in RecipeManager.GetRecipesByType(recipeType) where r.MatrixID == matrixID select r).ToList(); array4[1, k] = list.Count; array4[1, 6] += list.Count; list = list.Where((BaseRecipe r) => r.Unlocked).ToList(); array3[1, k] = list.Count; array3[1, 6] += list.Count; list = list.Where((BaseRecipe r) => r.IsMaxEcho).ToList(); array2[1, k] = list.Count; array2[1, 6] += list.Count; list = list.Where((BaseRecipe r) => r.FullUpgrade).ToList(); array[1, k] = list.Count; array[1, 6] += list.Count; } for (int l = 0; l <= 6; l++) { recipeUnlockInfoText[1, l].text = array[1, l].ToString().WithColor(7) + "/" + array2[1, l].ToString().WithColor(5) + "/" + array3[1, l].ToString().WithColor(3) + "/" + array4[1, l].ToString().WithColor(1); } } private static (float[], int[]) GeneratePool(int ticketId, int[] specialItems, float[] specialRates, List commonItems, float recipeValue = float.MaxValue) { float num = ItemManager.itemValue[ticketId] * VipFeatures.TicketValueMulti; float num2 = num; float[] array = new float[12000]; int[] array2 = new int[12000]; float num3 = specialRates.Sum(); bool flag = num3 > 1f; if (flag) { for (int i = 0; i < specialItems.Length; i++) { specialRates[i] /= num3; } } for (int j = 0; j < specialItems.Length; j++) { int num4 = specialItems[j]; if (ItemManager.itemValue[num4] < float.MaxValue) { array[num4] = num * specialRates[j] / ItemManager.itemValue[num4]; } else { array[num4] = num * specialRates[j] / recipeValue; } num2 -= array[num4]; array2[num4] = 1; } if (flag) { return (array, array2); } float[] array3 = new float[12000]; foreach (ItemProto commonItem in commonItems) { float num5 = Math.Min(5f, (float)FE.Utils.Utils.GetItemTotalCount(((Proto)commonItem).ID) / (float)commonItem.StackSize); array3[((Proto)commonItem).ID] = (float)(Math.Sqrt(ItemManager.itemValue[((Proto)commonItem).ID]) * (double)(10f - num5 * 9f / 5f)); } float num6 = array3.Sum(); foreach (ItemProto commonItem2 in commonItems) { array[((Proto)commonItem2).ID] = num2 * array3[((Proto)commonItem2).ID] / num6 / ItemManager.itemValue[((Proto)commonItem2).ID]; array2[((Proto)commonItem2).ID] = 1; } while (array.Sum() > 1f) { float num7 = array.Max(); for (int k = 0; k < array.Length; k++) { if ((double)Math.Abs(array[k] - num7) < 0.0001) { array[k] /= 2f; array2[k] *= 2; } } } return (array, array2); } public static void FreshPool(int poolId) { switch (poolId) { case 1: { recipes = RecipeManager.GetRecipesByMatrix(SelectedMatrixId1); recipes.RemoveAll((BaseRecipe recipe) => recipe.IsMaxEcho); int[] specialItems = new int[2] { 8017, 0 }; float[] specialRates = new float[2] { 0.1f / (float)Math.Sqrt(VipFeatures.TicketValueMulti), (recipes.Count == 0) ? 0f : (1f / RecipeRaffleMaxCounts[TicketIdx1] * RecipeValue / ItemManager.itemValue[SelectedTicketId1] / VipFeatures.TicketValueMulti) }; List commonItems = ((ProtoSet)(object)LDB.items).dataArray.Where((ItemProto item) => ((Proto)item).ID >= 8041 && ((Proto)item).ID <= 8044).ToList(); pool1 = GeneratePool(SelectedTicketId1, specialItems, specialRates, commonItems, RecipeValue); break; } case 2: { int[] specialItems2 = new int[7] { 8018, 8011, 8012, 8013, 8014, 8015, 8016 }; float[] array = new float[7] { 0.1f / (float)Math.Sqrt(VipFeatures.TicketValueMulti), 0f, 0f, 0f, 0f, 0f, 0f }; float num = 1f - array[0]; array[1] = num * 50f / 121f; array[2] = num * 35f / 121f; array[3] = num * 20f / 121f; array[4] = num * 10f / 121f; array[5] = num * 5f / 121f; array[6] = num * 1f / 121f; pool2 = GeneratePool(SelectedTicketId2, specialItems2, array, new List()); break; } case 3: if (commonItems3.Count == 0) { commonItems3 = ((ProtoSet)(object)LDB.items).dataArray.Where((ItemProto item) => ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode == 0 && (int)item.Type != 11 && (((Proto)item).ID < 8001 || ((Proto)item).ID > 8007) && (((Proto)item).ID < 8011 || ((Proto)item).ID > 8018) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID)).ToList(); } pool3 = GeneratePool(SelectedTicketId3, Array.Empty(), Array.Empty(), commonItems3); break; case 4: if (commonItems4.Count == 0) { commonItems4 = ((ProtoSet)(object)LDB.items).dataArray.Where((ItemProto item) => ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode != 0 && (((Proto)item).ID < 8021 || ((Proto)item).ID > 8029) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID)).ToList(); } pool4 = GeneratePool(SelectedTicketId4, Array.Empty(), Array.Empty(), commonItems4); break; } } private static void RaffleRecipe(int raffleCount, int oneLineMaxCount = 1, bool showMessage = true) { //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } if (raffleCount == -1) { raffleCount = MaxRaffleCount1; } if (!FE.Utils.Utils.TakeItemWithTip(SelectedTicketId1, raffleCount, out var _, showMessage)) { return; } float num = ItemManager.itemValue[SelectedTicketId1]; VipFeatures.AddExp(num * (float)raffleCount); (float[] rates, int[] counts) tuple = pool1; float[] array = tuple.rates; int[] array2 = tuple.counts; Dictionary rewardDic = new Dictionary(); StringBuilder stringBuilder = new StringBuilder(Localization.Translate("获得了以下物品") + Localization.Translate(":") + "\n"); StringBuilder stringBuilder2 = new StringBuilder(); int num2 = 0; while (raffleCount > 0) { raffleCount--; double num3 = 0.0; double randDouble = FE.Utils.Utils.GetRandDouble(); bool flag = true; for (int i = 0; i < 12000; i++) { num3 += (double)array[i]; if (randDouble >= num3) { continue; } flag = false; if (i == 0) { List list = recipes.ToList(); if (list.Any((BaseRecipe recipe) => recipe.RecipeType != ERecipe.QuantumCopy)) { list.RemoveAll((BaseRecipe recipe) => recipe.RecipeType == ERecipe.QuantumCopy); } BaseRecipe baseRecipe = list[FE.Utils.Utils.GetRandInt(0, list.Count)]; baseRecipe.RewardThis(manual: true); if (baseRecipe.Echo == 0) { stringBuilder2.AppendLine((baseRecipe.TypeName + " " + Localization.Translate("已解锁")).WithColor(RecipeValue)); } else { string text = string.Format(Localization.Translate("已转为同名回响提示"), baseRecipe.Echo); stringBuilder2.AppendLine((baseRecipe.TypeName + " " + text).WithColor(RecipeValue)); } if (num2 >= oneLineMaxCount) { stringBuilder.Append("\n"); num2 = 0; } else if (num2 > 0) { stringBuilder.Append(" "); } stringBuilder.Append((baseRecipe.TypeName ?? "").WithColor(RecipeValue)); recipes.RemoveAll((BaseRecipe recipe) => recipe.IsMaxEcho); if (recipes.Count == 0) { FreshPool(1); (array, array2) = pool1; } num2++; } else { int num4 = array2[i]; if (rewardDic.ContainsKey(i)) { rewardDic[i] += num4; } else { rewardDic[i] = num4; } if (num2 >= oneLineMaxCount) { stringBuilder.Append("\n"); num2 = 0; } else if (num2 > 0) { stringBuilder.Append(" "); } stringBuilder.Append($"{((Proto)((ProtoSet)(object)LDB.items).Select(i)).name} x {num4}".WithColor(ItemManager.itemValue[i])); num2++; } break; } if (flag) { if (num2 >= oneLineMaxCount) { stringBuilder.Append("\n"); num2 = 0; } else if (num2 > 0) { stringBuilder.Append(" "); } stringBuilder.Append((Localization.Translate("谢谢惠顾喵") + " x 1").WithColor(FE.Utils.Utils.Gray)); num2++; } } if (showMessage) { UIMessageBox.Show(Localization.Translate("抽奖结果"), stringBuilder.ToString().TrimEnd(new char[1] { '\n' }) + "\n\n" + stringBuilder2.ToString().TrimEnd(new char[1] { '\n' }) + "\n\n" + Localization.Translate("所有奖励已存储至分馏数据中心。"), Localization.Translate("确定"), 0, (Response)delegate { foreach (KeyValuePair item in rewardDic) { FE.Utils.Utils.AddItemToModData(item.Key, item.Value, 0, manual: true); } }); return; } foreach (KeyValuePair item2 in rewardDic) { FE.Utils.Utils.AddItemToModData(item2.Key, item2.Value, 0, manual: true); } } private static void RaffleFracProto(int raffleCount, int oneLineMaxCount = 1, bool showMessage = true) { //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Expected O, but got Unknown //IL_0231: Unknown result type (might be due to invalid IL or missing references) if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } if (raffleCount == -1) { raffleCount = MaxRaffleCount2; } if (!FE.Utils.Utils.TakeItemWithTip(SelectedTicketId2, raffleCount, out var _, showMessage)) { return; } VipFeatures.AddExp(ItemManager.itemValue[SelectedTicketId2] * (float)raffleCount); (float[] rates, int[] counts) tuple = pool2; float[] item = tuple.rates; int[] item2 = tuple.counts; Dictionary rewardDic = new Dictionary(); StringBuilder stringBuilder = new StringBuilder(Localization.Translate("获得了以下物品") + Localization.Translate(":") + "\n"); int num = 0; while (raffleCount > 0) { raffleCount--; double num2 = 0.0; double randDouble = FE.Utils.Utils.GetRandDouble(); bool flag = true; for (int i = 0; i < 12000; i++) { num2 += (double)item[i]; if (!(randDouble >= num2)) { flag = false; int num3 = item2[i]; if (rewardDic.ContainsKey(i)) { rewardDic[i] += num3; } else { rewardDic[i] = num3; } if (num >= oneLineMaxCount) { stringBuilder.Append("\n"); num = 0; } else if (num > 0) { stringBuilder.Append(" "); } stringBuilder.Append($"{((Proto)((ProtoSet)(object)LDB.items).Select(i)).name} x {num3}".WithColor(ItemManager.itemValue[i])); num++; break; } } if (flag) { if (num >= oneLineMaxCount) { stringBuilder.Append("\n"); num = 0; } else if (num > 0) { stringBuilder.Append(" "); } stringBuilder.Append((Localization.Translate("谢谢惠顾喵") + " x 1").WithColor(FE.Utils.Utils.Gray)); num++; } } if (showMessage) { UIMessageBox.Show(Localization.Translate("抽奖结果"), stringBuilder.ToString().TrimEnd(new char[1] { '\n' }) + "\n\n" + Localization.Translate("所有奖励已存储至分馏数据中心。"), Localization.Translate("确定"), 0, (Response)delegate { foreach (KeyValuePair item3 in rewardDic) { FE.Utils.Utils.AddItemToModData(item3.Key, item3.Value, 0, manual: true); } }); return; } foreach (KeyValuePair item4 in rewardDic) { FE.Utils.Utils.AddItemToModData(item4.Key, item4.Value, 0, manual: true); } } private static void RaffleMaterial(int raffleCount, int oneLineMaxCount = 1, bool showMessage = true) { //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Expected O, but got Unknown //IL_0296: Unknown result type (might be due to invalid IL or missing references) if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } if (raffleCount == -1) { raffleCount = MaxRaffleCount3; } if (!FE.Utils.Utils.TakeItemWithTip(SelectedTicketId3, raffleCount, out var _, showMessage)) { return; } VipFeatures.AddExp(ItemManager.itemValue[SelectedTicketId3] * (float)raffleCount); List list = ((ProtoSet)(object)LDB.items).dataArray.Where((ItemProto item) => ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode == 0 && (int)item.Type != 11 && (((Proto)item).ID < 8001 || ((Proto)item).ID > 8007) && (((Proto)item).ID < 8011 || ((Proto)item).ID > 8018) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID)).ToList(); if (list.Count != commonItems3.Count) { commonItems3 = list; FreshPool(3); } (float[] rates, int[] counts) tuple = pool3; float[] item2 = tuple.rates; int[] item3 = tuple.counts; Dictionary rewardDic = new Dictionary(); StringBuilder stringBuilder = new StringBuilder(Localization.Translate("获得了以下物品") + Localization.Translate(":") + "\n"); int num = 0; while (raffleCount > 0) { raffleCount--; double num2 = 0.0; double randDouble = FE.Utils.Utils.GetRandDouble(); bool flag = true; for (int i = 0; i < 12000; i++) { num2 += (double)item2[i]; if (!(randDouble >= num2)) { flag = false; int num3 = item3[i]; if (rewardDic.ContainsKey(i)) { rewardDic[i] += num3; } else { rewardDic[i] = num3; } if (num >= oneLineMaxCount) { stringBuilder.Append("\n"); num = 0; } else if (num > 0) { stringBuilder.Append(" "); } stringBuilder.Append($"{((Proto)((ProtoSet)(object)LDB.items).Select(i)).name} x {num3}".WithColor(ItemManager.itemValue[i])); num++; break; } } if (flag) { if (num >= oneLineMaxCount) { stringBuilder.Append("\n"); num = 0; } else if (num > 0) { stringBuilder.Append(" "); } stringBuilder.Append((Localization.Translate("谢谢惠顾喵") + " x 1").WithColor(FE.Utils.Utils.Gray)); num++; } } if (showMessage) { UIMessageBox.Show(Localization.Translate("抽奖结果"), stringBuilder.ToString().TrimEnd(new char[1] { '\n' }) + "\n\n" + Localization.Translate("所有奖励已存储至分馏数据中心。"), Localization.Translate("确定"), 0, (Response)delegate { foreach (KeyValuePair item4 in rewardDic) { FE.Utils.Utils.AddItemToModData(item4.Key, item4.Value, 0, manual: true); } }); return; } foreach (KeyValuePair item5 in rewardDic) { FE.Utils.Utils.AddItemToModData(item5.Key, item5.Value, 0, manual: true); } } private static void RaffleBuilding(int raffleCount, int oneLineMaxCount = 1, bool showMessage = true) { //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Expected O, but got Unknown //IL_0296: Unknown result type (might be due to invalid IL or missing references) if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } if (raffleCount == -1) { raffleCount = MaxRaffleCount4; } if (!FE.Utils.Utils.TakeItemWithTip(SelectedTicketId4, raffleCount, out var _, showMessage)) { return; } VipFeatures.AddExp(ItemManager.itemValue[SelectedTicketId4] * (float)raffleCount); List list = ((ProtoSet)(object)LDB.items).dataArray.Where((ItemProto item) => ItemManager.itemValue[((Proto)item).ID] < float.MaxValue && item.BuildMode != 0 && (((Proto)item).ID < 8021 || ((Proto)item).ID > 8029) && ((Proto)item).ID != 1099 && GameMain.history.ItemUnlocked(((Proto)item).ID)).ToList(); if (list.Count != commonItems4.Count) { commonItems4 = list; FreshPool(4); } (float[] rates, int[] counts) tuple = pool4; float[] item2 = tuple.rates; int[] item3 = tuple.counts; Dictionary rewardDic = new Dictionary(); StringBuilder stringBuilder = new StringBuilder(Localization.Translate("获得了以下物品") + Localization.Translate(":") + "\n"); int num = 0; while (raffleCount > 0) { raffleCount--; double num2 = 0.0; double randDouble = FE.Utils.Utils.GetRandDouble(); bool flag = true; for (int i = 0; i < 12000; i++) { num2 += (double)item2[i]; if (!(randDouble >= num2)) { flag = false; int num3 = item3[i]; if (rewardDic.ContainsKey(i)) { rewardDic[i] += num3; } else { rewardDic[i] = num3; } if (num >= oneLineMaxCount) { stringBuilder.Append("\n"); num = 0; } else if (num > 0) { stringBuilder.Append(" "); } stringBuilder.Append($"{((Proto)((ProtoSet)(object)LDB.items).Select(i)).name} x {num3}".WithColor(ItemManager.itemValue[i])); num++; break; } } if (flag) { if (num >= oneLineMaxCount) { stringBuilder.Append("\n"); num = 0; } else if (num > 0) { stringBuilder.Append(" "); } stringBuilder.Append((Localization.Translate("谢谢惠顾喵") + " x 1").WithColor(FE.Utils.Utils.Gray)); num++; } } if (showMessage) { UIMessageBox.Show(Localization.Translate("抽奖结果"), stringBuilder.ToString().TrimEnd(new char[1] { '\n' }) + "\n\n" + Localization.Translate("所有奖励已存储至分馏数据中心。"), Localization.Translate("确定"), 0, (Response)delegate { foreach (KeyValuePair item4 in rewardDic) { FE.Utils.Utils.AddItemToModData(item4.Key, item4.Value, 0, manual: true); } }); return; } foreach (KeyValuePair item5 in rewardDic) { FE.Utils.Utils.AddItemToModData(item5.Key, item5.Value, 0, manual: true); } } [HarmonyPostfix] [HarmonyPatch(typeof(GameMain), "FixedUpdate")] public static void GameMain_FixedUpdate_Postfix(GameMain __instance) { if (!__instance._running || __instance._paused || __instance.timei - lastAutoRaffleTick < 6) { return; } lastAutoRaffleTick = __instance.timei; int[] array = new int[7]; bool[] array2 = new bool[4]; if (EnableAutoRaffle1Entry.Value) { array[TicketIdx1]++; array2[0] = true; } if (EnableAutoRaffle2Entry.Value) { array[TicketIdx2]++; array2[1] = true; } if (EnableAutoRaffle3Entry.Value) { array[TicketIdx3]++; array2[2] = true; } if (EnableAutoRaffle4Entry.Value) { array[TicketIdx4]++; array2[3] = true; } long[] array3 = new long[7]; for (int i = 0; i < 7; i++) { if (array[i] > 0) { array3[i] = FE.Utils.Utils.GetItemTotalCount(8001 + i); } } array2[0] &= array3[TicketIdx1] >= 100 * array[TicketIdx1]; array2[1] &= array3[TicketIdx2] >= 100 * array[TicketIdx2]; array2[2] &= array3[TicketIdx3] >= 100 * array[TicketIdx3]; array2[3] &= array3[TicketIdx4] >= 100 * array[TicketIdx4]; if (array2[0]) { RaffleRecipe(100, 5, showMessage: false); } if (array2[1]) { RaffleFracProto(100, 5, showMessage: false); } if (array2[2]) { RaffleMaterial(100, 5, showMessage: false); } if (array2[3]) { RaffleBuilding(100, 5, showMessage: false); } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); if (num == 1) { r.ReadInt32(); } else if (num == 2 || num == 3) { for (int i = 0; i < 7; i++) { r.ReadInt32(); } } if (num >= 3) { TicketIdx1Entry.Value = r.ReadInt32(); if (TicketIdx1Entry.Value < 0 || TicketIdx1Entry.Value >= TicketIds.Length) { TicketIdx1Entry.Value = 0; } EnableAutoRaffle1Entry.Value = r.ReadBoolean(); TicketIdx2Entry.Value = r.ReadInt32(); if (TicketIdx2Entry.Value < 0 || TicketIdx2Entry.Value >= TicketIds.Length) { TicketIdx2Entry.Value = 0; } EnableAutoRaffle2Entry.Value = r.ReadBoolean(); TicketIdx3Entry.Value = r.ReadInt32(); if (TicketIdx3Entry.Value < 0 || TicketIdx3Entry.Value >= TicketIds.Length) { TicketIdx3Entry.Value = 0; } EnableAutoRaffle3Entry.Value = r.ReadBoolean(); TicketIdx4Entry.Value = r.ReadInt32(); if (TicketIdx4Entry.Value < 0 || TicketIdx4Entry.Value >= TicketIds.Length) { TicketIdx4Entry.Value = 0; } EnableAutoRaffle4Entry.Value = r.ReadBoolean(); } for (int j = 0; j < 4; j++) { FreshPool(j); } } public static void Export(BinaryWriter w) { w.Write(4); w.Write(TicketIdx1Entry.Value); w.Write(EnableAutoRaffle1Entry.Value); w.Write(TicketIdx2Entry.Value); w.Write(EnableAutoRaffle2Entry.Value); w.Write(TicketIdx3Entry.Value); w.Write(EnableAutoRaffle3Entry.Value); w.Write(TicketIdx4Entry.Value); w.Write(EnableAutoRaffle4Entry.Value); } public static void IntoOtherSave() { lastAutoRaffleTick = 0L; TicketIdx1Entry.Value = 0; EnableAutoRaffle1Entry.Value = false; TicketIdx2Entry.Value = 0; EnableAutoRaffle2Entry.Value = false; TicketIdx3Entry.Value = 0; EnableAutoRaffle3Entry.Value = false; TicketIdx4Entry.Value = 0; EnableAutoRaffle4Entry.Value = false; commonItems3 = new List(); commonItems4 = new List(); for (int i = 0; i < 4; i++) { FreshPool(i); } } } } namespace FE.UI.View.CoreOperate { public static class BuildingOperate { [CompilerGenerated] private static class <>O { public static UnityAction <0>__SetFluidOutputStack; public static UnityAction <1>__AddMaxProductOutputStack; public static UnityAction <2>__SetFracForever; public static UnityAction <3>__AddPointAggregateLevel; public static UnityAction <4>__Reinforcement; public static UnityAction <5>__ReinforcementMax; public static UnityAction <6>__Reset; public static UnityAction <7>__Downgrade; public static UnityAction <8>__Upgrade; public static UnityAction <9>__FullUpgrade; } private static RectTransform window; private static RectTransform tab; private static ConfigEntry BuildingTypeEntry; private static readonly int[] BuildingIds = new int[8] { 8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028 }; private static readonly string[] BuildingTypeNames = new string[8] { Localization.Translate("交互塔"), Localization.Translate("矿物复制塔"), Localization.Translate("点数聚集塔"), Localization.Translate("量子复制塔"), Localization.Translate("点金塔"), Localization.Translate("分解塔"), Localization.Translate("转化塔"), Localization.Translate("物流交互站") }; private static Text txtChipCount; private static Text txtBuildingInfo1; private static UIButton btnTip1; private static UIButton btnBuildingInfo1; private static Text txtBuildingInfo2; private static UIButton btnTip2; private static UIButton btnBuildingInfo2; private static Text txtBuildingInfo3; private static UIButton btnBuildingInfo3; private static UIButton btnTip3; private static Text txtBuildingInfo4; private static UIButton btnTip4; private static UIButton btnBuildingInfo4; private static Text txtBuildingInfo5; private static UIButton btnTip5; private static UIButton btnReinforcement; private static UIButton btnReinforcementMax; private static UIButton[] reinforcementSandboxBtn = (UIButton[])(object)new UIButton[4]; private static Text[] txtReinforcementBonus = (Text[])(object)new Text[6]; private static ItemProto SelectedBuilding => ((ProtoSet)(object)LDB.items).Select(BuildingIds[BuildingTypeEntry.Value]); public static void AddTranslations() { FE.Utils.Utils.Register("建筑操作", "Building Operate"); FE.Utils.Utils.Register("建筑类型", "Building type"); FE.Utils.Utils.Register("建筑加成:", "Building bonuses:"); FE.Utils.Utils.Register("已启用流动输出集装", "Enable flow output integration"); FE.Utils.Utils.Register("未启用流动输出集装", "Not enable flow output integration"); FE.Utils.Utils.Register("流动输出集装", "Flow output integration"); FE.Utils.Utils.Register("流动输出集装说明", "Once enabled, the flow output (i.e., the side output) will be integrated as much as possible before being output.", "启用后,流动输出(即侧面的输出)会尽可能集装后再输出。"); FE.Utils.Utils.Register("启用", "Enable"); FE.Utils.Utils.Register("启用流动输出集装", "to enable flow output integration"); FE.Utils.Utils.Register("输出集装:", "output integration: "); FE.Utils.Utils.Register("输出集装", "output integration"); FE.Utils.Utils.Register("产物输出集装:", "Product output integration: "); FE.Utils.Utils.Register("产物输出集装", "Product output integration"); FE.Utils.Utils.Register("产物输出集装说明", "Product output (i.e., positive output) will be integrated to the extent possible before being output.", "产物输出(即正面的输出)会尽可能集装到该程度后再输出。"); FE.Utils.Utils.Register("+1 集装数目", "+1 integration count"); FE.Utils.Utils.Register("+1 产物输出集装数目", "to +1 product output integration count"); FE.Utils.Utils.Register("分馏永动说明", "Once enabled, when the product cache reaches its limit, the building will no longer process incoming items but will instead transport them directly to the flow output.", "启用后,当产物缓存达到上限时,建筑将不再处理输入的物品,而是直接将其直接搬运到流动输出。"); FE.Utils.Utils.Register("已启用分馏永动", "Enable fractionate forever"); FE.Utils.Utils.Register("未启用分馏永动", "Not enable fractionate forever"); FE.Utils.Utils.Register("启用分馏永动", "to enable fractionate forever"); FE.Utils.Utils.Register("点数聚集效率层次", "Point accumulation efficiency level"); FE.Utils.Utils.Register("点数聚集效率层次说明", "The efficiency level of point accumulation affects the output rate of the product and the maximum increase in points for the product, with an upper limit of 7.", "点数聚集的效率层次会影响产物的输出速率、产物的最大增产点数,上限为7。"); FE.Utils.Utils.Register("点数聚集效率层次:", "Point accumulation efficiency level: "); FE.Utils.Utils.Register("+1 聚集层次", "+1 aggregate level"); FE.Utils.Utils.Register("+1 点数聚集效率层次", "to +1 point accumulation efficiency level"); FE.Utils.Utils.Register("分馏塔强化功能将在以上升级全部升满后解锁。", "The fractionator enhancement feature will unlock once all the above upgrades have been fully completed."); FE.Utils.Utils.Register("强化等级:", "Reinforcement level: "); FE.Utils.Utils.Register("强化等级", "Reinforcement level"); StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder2 = new StringBuilder(); for (int i = 0; i <= ProcessManager.MaxReinforcementLevel; i++) { stringBuilder.Append($"\n+{i}: 加成 +{ProcessManager.ReinforcementBonusArr[i]:P1},强化成功率 {ProcessManager.ReinforcementSuccessRateArr[i]:P0}"); stringBuilder2.Append($"\n+{i}: Bonus +{ProcessManager.ReinforcementBonusArr[i]:P1}, ReinforcementRate {ProcessManager.ReinforcementSuccessRateArr[i]:P0}"); } FE.Utils.Utils.Register("强化等级说明", $"Reinforcement increases durability, power consumption, fractionation success rate, and product quantity. The relationship between reinforcement level and base reinforcement bonuses, as well as reinforcement success rate, is as follows:{stringBuilder2}", $"强化会增加耐久度、电力消耗、分馏成功率和产物数目。强化级别与强化基础加成、强化成功率的关系如下:{stringBuilder}"); FE.Utils.Utils.Register("敲一下!", "Knock once!"); FE.Utils.Utils.Register("一直敲!", "Keep knocking!"); FE.Utils.Utils.Register("强化此建筑", "Reinforce this building"); FE.Utils.Utils.Register("强化成功提示", "Great! The enhancement worked!", "耶,塔诺西!强化成功了!"); FE.Utils.Utils.Register("强化失败提示", "Awful! The enhancement failed...", "呜,苦露西!强化失败了……"); FE.Utils.Utils.Register("一键强化提示", "Confirm that you wish to enhance this building using multiple Fractionator Increase Chips until it reaches Level 20?", "确认使用数个分馏塔增幅芯片强化此建筑,直至达到20级吗?"); FE.Utils.Utils.Register("当前强化加成:", "Current Enhancement Bonuses:"); FE.Utils.Utils.Register("耐久度", "Durability"); FE.Utils.Utils.Register("电力消耗", "Power consumption"); FE.Utils.Utils.Register("分馏成功率", "Fractionation success rate"); FE.Utils.Utils.Register("主产物数目", "Main product count"); FE.Utils.Utils.Register("副产物概率", "Append product rate"); } public static void LoadConfig(ConfigFile configFile) { BuildingTypeEntry = configFile.Bind("BuildingOperate", "Building Type", 0, "想要查看的建筑类型。"); if (BuildingTypeEntry.Value < 0 || BuildingTypeEntry.Value >= BuildingTypeNames.Length) { BuildingTypeEntry.Value = 0; } } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Expected O, but got Unknown //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Expected O, but got Unknown //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Expected O, but got Unknown //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Expected O, but got Unknown //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Expected O, but got Unknown //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Expected O, but got Unknown //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Expected O, but got Unknown //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Expected O, but got Unknown //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Expected O, but got Unknown window = trans; tab = wnd.AddTab(trans, "建筑操作"); float num = 0f; float num2 = 25f; Text val = wnd.AddText2(num, num2, tab, "建筑类型"); wnd.AddComboBox(num + 5f + val.preferredWidth, num2, tab).WithItems(BuildingTypeNames).WithSize(200f, 0f) .WithConfigEntry(BuildingTypeEntry); wnd.AddImageButton(FE.Utils.Utils.GetPosition(3, 4).Item1, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(8018)); txtChipCount = wnd.AddText2(FE.Utils.Utils.GetPosition(3, 4).Item1 + 40f + 5f, num2, tab, "动态刷新"); num2 += 43f; wnd.AddText2(num, num2, tab, "建筑加成:", 15, "text-building-info-0"); num2 += 36f; txtBuildingInfo1 = wnd.AddText2(num, num2, tab, "动态刷新"); btnTip1 = wnd.AddTipsButton2(num + 250f, num2, tab, "流动输出集装", "流动输出集装说明"); float y = num2; RectTransform parent = tab; object obj = <>O.<0>__SetFluidOutputStack; if (obj == null) { UnityAction val2 = SetFluidOutputStack; <>O.<0>__SetFluidOutputStack = val2; obj = (object)val2; } btnBuildingInfo1 = wnd.AddButton(1, 2, y, parent, "启用", 16, "button", (UnityAction)obj); num2 += 36f; txtBuildingInfo2 = wnd.AddText2(num, num2, tab, "动态刷新"); btnTip2 = wnd.AddTipsButton2(num + 250f, num2, tab, "产物输出集装", "产物输出集装说明"); float y2 = num2; RectTransform parent2 = tab; object obj2 = <>O.<1>__AddMaxProductOutputStack; if (obj2 == null) { UnityAction val3 = AddMaxProductOutputStack; <>O.<1>__AddMaxProductOutputStack = val3; obj2 = (object)val3; } btnBuildingInfo2 = wnd.AddButton(1, 2, y2, parent2, "+1 集装数目", 16, "button", (UnityAction)obj2); num2 += 36f; txtBuildingInfo3 = wnd.AddText2(num, num2, tab, "动态刷新"); btnTip3 = wnd.AddTipsButton2(num + 250f, num2, tab, "分馏永动", "分馏永动说明"); float y3 = num2; RectTransform parent3 = tab; object obj3 = <>O.<2>__SetFracForever; if (obj3 == null) { UnityAction val4 = SetFracForever; <>O.<2>__SetFracForever = val4; obj3 = (object)val4; } btnBuildingInfo3 = wnd.AddButton(1, 2, y3, parent3, "启用", 16, "button", (UnityAction)obj3); num2 += 36f; txtBuildingInfo4 = wnd.AddText2(num, num2, tab, "动态刷新"); btnTip4 = wnd.AddTipsButton2(num + 250f, num2, tab, "点数聚集效率层次", "点数聚集效率层次说明"); float y4 = num2; RectTransform parent4 = tab; object obj4 = <>O.<3>__AddPointAggregateLevel; if (obj4 == null) { UnityAction val5 = AddPointAggregateLevel; <>O.<3>__AddPointAggregateLevel = val5; obj4 = (object)val5; } btnBuildingInfo4 = wnd.AddButton(1, 2, y4, parent4, "+1 聚集层次", 16, "button", (UnityAction)obj4); num2 += 36f; txtBuildingInfo5 = wnd.AddText2(num, num2, tab, "动态刷新"); btnTip5 = wnd.AddTipsButton2(num + 250f, num2, tab, "强化等级", "强化等级说明"); if (!GameMain.sandboxToolsEnabled) { float y5 = num2; RectTransform parent5 = tab; object obj5 = <>O.<4>__Reinforcement; if (obj5 == null) { UnityAction val6 = Reinforcement; <>O.<4>__Reinforcement = val6; obj5 = (object)val6; } btnReinforcement = wnd.AddButton(1, 2, y5, parent5, "敲一下!", 16, "button", (UnityAction)obj5); float y6 = num2 + 36f; RectTransform parent6 = tab; object obj6 = <>O.<5>__ReinforcementMax; if (obj6 == null) { UnityAction val7 = ReinforcementMax; <>O.<5>__ReinforcementMax = val7; obj6 = (object)val7; } btnReinforcementMax = wnd.AddButton(1, 2, y6, parent6, "一直敲!", 16, "button", (UnityAction)obj6); } else { UIButton[] array = reinforcementSandboxBtn; float y7 = num2; RectTransform parent7 = tab; object obj7 = <>O.<6>__Reset; if (obj7 == null) { UnityAction val8 = Reset; <>O.<6>__Reset = val8; obj7 = (object)val8; } array[0] = wnd.AddButton(1, 2, y7, parent7, "重置", 16, "button", (UnityAction)obj7); UIButton[] array2 = reinforcementSandboxBtn; float y8 = num2 + 36f; RectTransform parent8 = tab; object obj8 = <>O.<7>__Downgrade; if (obj8 == null) { UnityAction val9 = Downgrade; <>O.<7>__Downgrade = val9; obj8 = (object)val9; } array2[1] = wnd.AddButton(1, 2, y8, parent8, "降级", 16, "button", (UnityAction)obj8); UIButton[] array3 = reinforcementSandboxBtn; float y9 = num2 + 72f; RectTransform parent9 = tab; object obj9 = <>O.<8>__Upgrade; if (obj9 == null) { UnityAction val10 = Upgrade; <>O.<8>__Upgrade = val10; obj9 = (object)val10; } array3[2] = wnd.AddButton(1, 2, y9, parent9, "升级", 16, "button", (UnityAction)obj9); UIButton[] array4 = reinforcementSandboxBtn; float y10 = num2 + 108f; RectTransform parent10 = tab; object obj10 = <>O.<9>__FullUpgrade; if (obj10 == null) { UnityAction val11 = FullUpgrade; <>O.<9>__FullUpgrade = val11; obj10 = (object)val11; } array4[3] = wnd.AddButton(1, 2, y10, parent10, "升满", 16, "button", (UnityAction)obj10); } for (int i = 0; i < txtReinforcementBonus.Length; i++) { num2 += 36f; txtReinforcementBonus[i] = wnd.AddText2(num, num2, tab, "动态刷新"); } } public static void UpdateUI() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) if (((Component)tab).gameObject.activeSelf) { txtChipCount.text = $"x {FE.Utils.Utils.GetItemTotalCount(8018)}"; bool flag = true; if (((Proto)SelectedBuilding).ID != 8028) { flag &= SelectedBuilding.EnableFluidOutputStack(); txtBuildingInfo1.text = (SelectedBuilding.EnableFluidOutputStack() ? Localization.Translate("已启用流动输出集装").WithColor(FE.Utils.Utils.Gold) : Localization.Translate("未启用流动输出集装").WithColor(FE.Utils.Utils.Red)); ((Component)btnTip1).gameObject.SetActive(true); ((Component)btnBuildingInfo1).gameObject.SetActive(!SelectedBuilding.EnableFluidOutputStack()); } else { txtBuildingInfo1.text = ""; ((Component)btnTip1).gameObject.SetActive(false); ((Component)btnBuildingInfo1).gameObject.SetActive(false); } string s = ((((Proto)SelectedBuilding).ID != 8028) ? string.Format("{0}{1}", Localization.Translate("产物输出集装:"), SelectedBuilding.MaxProductOutputStack()) : string.Format("{0}{1}", Localization.Translate("输出集装:"), SelectedBuilding.MaxProductOutputStack())); flag &= SelectedBuilding.MaxProductOutputStack() >= 4; txtBuildingInfo2.text = s.WithColor(SelectedBuilding.MaxProductOutputStack() * 2 - 1); ((Component)btnTip2).gameObject.SetActive(true); ((Component)btnBuildingInfo2).gameObject.SetActive(SelectedBuilding.MaxProductOutputStack() < 4); if (((Proto)SelectedBuilding).ID != 8028) { flag &= SelectedBuilding.EnableFracForever(); txtBuildingInfo3.text = (SelectedBuilding.EnableFracForever() ? Localization.Translate("已启用分馏永动").WithColor(FE.Utils.Utils.Gold) : Localization.Translate("未启用分馏永动").WithColor(FE.Utils.Utils.Red)); ((Component)btnTip3).gameObject.SetActive(true); ((Component)btnBuildingInfo3).gameObject.SetActive(SelectedBuilding.EnableFluidOutputStack() && SelectedBuilding.MaxProductOutputStack() >= 4 && !SelectedBuilding.EnableFracForever()); } else { txtBuildingInfo3.text = ""; ((Component)btnTip3).gameObject.SetActive(false); ((Component)btnBuildingInfo3).gameObject.SetActive(false); } if (((Proto)SelectedBuilding).ID == 8023) { s = string.Format("{0}{1}", Localization.Translate("点数聚集效率层次:"), PointAggregateTower.Level); flag &= PointAggregateTower.IsMaxLevel; txtBuildingInfo4.text = s.WithColor(PointAggregateTower.Level); ((Component)btnTip4).gameObject.SetActive(true); ((Component)btnBuildingInfo4).gameObject.SetActive(!PointAggregateTower.IsMaxLevel); } else { txtBuildingInfo4.text = ""; ((Component)btnTip4).gameObject.SetActive(false); ((Component)btnBuildingInfo4).gameObject.SetActive(false); } s = string.Format("{0}{1}", Localization.Translate("强化等级:"), SelectedBuilding.ReinforcementLevel()); txtBuildingInfo5.text = s.WithColor(SelectedBuilding.ReinforcementLevel() / 3 + 1); ((Component)btnTip5).gameObject.SetActive(true); if (!GameMain.sandboxToolsEnabled) { bool active = flag && SelectedBuilding.ReinforcementLevel() < ProcessManager.MaxReinforcementLevel; ((Component)btnReinforcement).gameObject.SetActive(active); ((Component)btnReinforcementMax).gameObject.SetActive(active); } else { ((Component)reinforcementSandboxBtn[0]).gameObject.SetActive(true); ((Component)reinforcementSandboxBtn[1]).gameObject.SetActive(SelectedBuilding.ReinforcementLevel() > 0); ((Component)reinforcementSandboxBtn[2]).gameObject.SetActive(SelectedBuilding.ReinforcementLevel() < ProcessManager.MaxReinforcementLevel); ((Component)reinforcementSandboxBtn[3]).gameObject.SetActive(SelectedBuilding.ReinforcementLevel() < ProcessManager.MaxReinforcementLevel); } string[] array = ((((Proto)SelectedBuilding).ID == 8023) ? new string[7] { Localization.Translate("当前强化加成:"), string.Format("{0} +{1:P1}", Localization.Translate("耐久度"), SelectedBuilding.ReinforcementBonusDurability()), string.Format("{0} +{1:P1}", Localization.Translate("电力消耗"), SelectedBuilding.ReinforcementBonusEnergy()), string.Format("{0} +{1:P1}", Localization.Translate("分馏成功率"), SelectedBuilding.ReinforcementBonusFracSuccess()), "", "", "" } : ((((Proto)SelectedBuilding).ID != 8028) ? new string[6] { Localization.Translate("当前强化加成:"), string.Format("{0} +{1:P1}", Localization.Translate("耐久度"), SelectedBuilding.ReinforcementBonusDurability()), string.Format("{0} +{1:P1}", Localization.Translate("电力消耗"), SelectedBuilding.ReinforcementBonusEnergy()), string.Format("{0} +{1:P1}", Localization.Translate("主产物数目"), SelectedBuilding.ReinforcementBonusMainOutputCount()), string.Format("{0} +{1:P1}", Localization.Translate("副产物概率"), SelectedBuilding.ReinforcementBonusAppendOutputRate()), "" } : new string[6] { Localization.Translate("当前强化加成:"), string.Format("{0} +{1:P1}", Localization.Translate("耐久度"), SelectedBuilding.ReinforcementBonusDurability()), string.Format("{0} -{1:P1}", Localization.Translate("电力消耗"), 1f - SelectedBuilding.ReinforcementBonusEnergy()), "", "", "" })); for (int i = 0; i < txtReinforcementBonus.Length; i++) { txtReinforcementBonus[i].text = array[i].WithColor(SelectedBuilding.ReinforcementLevel() / 3 + 1); } } } private static void SetFluidOutputStack() { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null || SelectedBuilding.EnableFluidOutputStack()) { return; } int takeId = 8018; int takeCount = 3; ItemProto val = ((ProtoSet)(object)LDB.items).Select(takeId); UIMessageBox.Show(Localization.Translate("提示"), (GameMain.sandboxToolsEnabled ? "" : string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)val).name, takeCount)) + Localization.Translate("启用流动输出集装") + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (GameMain.sandboxToolsEnabled || FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out var _)) { SelectedBuilding.EnableFluidOutputStack(enable: true); if (NebulaModAPI.IsMultiplayerActive) { NebulaModAPI.MultiplayerSession.Network.SendPacket(new BuildingChangePacket(BuildingTypeEntry.Value, 1)); } } }, (Response)null); } private static void AddMaxProductOutputStack() { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } int takeId = 8018; int takeCount = ((((Proto)SelectedBuilding).ID != 8028) ? 1 : 6); if (SelectedBuilding.MaxProductOutputStack() >= 4) { return; } ItemProto val = ((ProtoSet)(object)LDB.items).Select(takeId); UIMessageBox.Show(Localization.Translate("提示"), (GameMain.sandboxToolsEnabled ? "" : string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)val).name, takeCount)) + Localization.Translate("+1 产物输出集装数目") + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (GameMain.sandboxToolsEnabled || FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out var _)) { SelectedBuilding.MaxProductOutputStack(SelectedBuilding.MaxProductOutputStack() + 1); if (NebulaModAPI.IsMultiplayerActive) { NebulaModAPI.MultiplayerSession.Network.SendPacket(new BuildingChangePacket(BuildingTypeEntry.Value, 2)); } } }, (Response)null); } private static void SetFracForever() { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null || SelectedBuilding.EnableFracForever()) { return; } int takeId = 8018; int takeCount = 2; ItemProto val = ((ProtoSet)(object)LDB.items).Select(takeId); UIMessageBox.Show(Localization.Translate("提示"), (GameMain.sandboxToolsEnabled ? "" : string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)val).name, takeCount)) + Localization.Translate("启用分馏永动") + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (GameMain.sandboxToolsEnabled || FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out var _)) { SelectedBuilding.EnableFracForever(enable: true); if (NebulaModAPI.IsMultiplayerActive) { NebulaModAPI.MultiplayerSession.Network.SendPacket(new BuildingChangePacket(BuildingTypeEntry.Value, 3)); } } }, (Response)null); } private static void AddPointAggregateLevel() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } int takeId = 8018; int takeCount = 1; if (PointAggregateTower.Level >= 7) { return; } ItemProto val = ((ProtoSet)(object)LDB.items).Select(takeId); UIMessageBox.Show(Localization.Translate("提示"), (GameMain.sandboxToolsEnabled ? "" : string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)val).name, takeCount)) + Localization.Translate("+1 点数聚集效率层次") + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (GameMain.sandboxToolsEnabled || FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out var _)) { PointAggregateTower.Level++; if (NebulaModAPI.IsMultiplayerActive) { NebulaModAPI.MultiplayerSession.Network.SendPacket(new BuildingChangePacket(BuildingTypeEntry.Value, 4)); } } }, (Response)null); } private static void Reinforcement() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null || SelectedBuilding.ReinforcementLevel() >= ProcessManager.MaxReinforcementLevel) { return; } int takeId = 8018; int takeCount = 1; ItemProto val = ((ProtoSet)(object)LDB.items).Select(takeId); UIMessageBox.Show(Localization.Translate("提示"), (GameMain.sandboxToolsEnabled ? "" : string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)val).name, takeCount)) + Localization.Translate("强化此建筑") + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out var _)) { if (FE.Utils.Utils.GetRandDouble() > (double)SelectedBuilding.ReinforcementSuccessRate()) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("强化失败提示"), Localization.Translate("确定"), 3, (Response)null); } else { SelectedBuilding.ReinforcementLevel(SelectedBuilding.ReinforcementLevel() + 1, manual: true); UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("强化成功提示"), Localization.Translate("确定"), 0, (Response)null); } } }, (Response)null); } private static void ReinforcementMax() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null || SelectedBuilding.ReinforcementLevel() >= ProcessManager.MaxReinforcementLevel) { return; } int takeId = 8018; int takeCount = 1; UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("一键强化提示"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { int inc; while (SelectedBuilding.ReinforcementLevel() < ProcessManager.MaxReinforcementLevel && FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out inc)) { if (!(FE.Utils.Utils.GetRandDouble() > (double)SelectedBuilding.ReinforcementSuccessRate())) { SelectedBuilding.ReinforcementLevel(SelectedBuilding.ReinforcementLevel() + 1, manual: true); } } }, (Response)null); } private static void Upgrade() { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { SelectedBuilding.ReinforcementLevel(SelectedBuilding.ReinforcementLevel() + 1, manual: true); } } private static void Downgrade() { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { SelectedBuilding.ReinforcementLevel(SelectedBuilding.ReinforcementLevel() - 1, manual: true); } } private static void FullUpgrade() { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { SelectedBuilding.ReinforcementLevel(ProcessManager.MaxReinforcementLevel, manual: true); } } private static void Reset() { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { SelectedBuilding.ReinforcementLevel(0, manual: true); } } public static ItemProto GetItemProto(int index) { return ((ProtoSet)(object)LDB.items).Select(BuildingIds[index]); } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } public static class RecipeOperate { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__8_0; public static UnityAction <>9__22_2; public static UnityAction <>9__22_3; public static UnityAction <>9__22_4; public static UnityAction <>9__22_5; public static UnityAction <>9__22_6; public static UnityAction <>9__22_7; public static UnityAction <>9__22_8; public static UnityAction <>9__22_9; internal void b__8_0(ItemProto item) { if (item != null) { SelectedItem = item; } } internal void b__22_2() { GetRecipe(SelectedRecipe); } internal void b__22_3() { UpgradeLevel(SelectedRecipe, maxLevel: false); } internal void b__22_4() { UpgradeLevel(SelectedRecipe, maxLevel: true); } internal void b__22_5() { BreakthroughQualityUntilSuccess(SelectedRecipe); } internal void b__22_6() { Reset(SelectedRecipe); } internal void b__22_7() { Downgrade(SelectedRecipe); } internal void b__22_8() { Upgrade(SelectedRecipe); } internal void b__22_9() { FullUpgrade(SelectedRecipe); } } private static RectTransform window; private static RectTransform tab; private static Text txtCurrItem; private static MyImageButton btnSelectedItem; private static ConfigEntry RecipeTypeEntry; private static Text txtCoreCount; private static UIButton btnGetRecipe; private static Text[] txtRecipeInfo = (Text[])(object)new Text[30]; private static float txtRecipeInfoBaseY = 0f; private static MySlider incSlider; private static ConfigEntry selectedInc; private static ItemProto SelectedItem { get; set; } = ((ProtoSet)(object)LDB.items).Select(1001); private static ERecipe SelectedRecipeType => ERecipeExtension.RecipeTypes[RecipeTypeEntry.Value]; private static BaseRecipe SelectedRecipe => RecipeManager.GetRecipe(SelectedRecipeType, ((Proto)SelectedItem).ID); private static void OnButtonChangeItemClick(bool showLocked, float y) { //IL_0013: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0064: Unknown result type (might be due to invalid IL or missing references) float x = tab.anchoredPosition.x; Rect rect = tab.rect; float num = x - ((Rect)(ref rect)).width / 2f; float y2 = tab.anchoredPosition.y; rect = tab.rect; float num2 = y2 + ((Rect)(ref rect)).height / 2f - y; UIItemPickerExtension.Popup(new Vector2(num, num2), (Action)delegate(ItemProto item) { if (item != null) { SelectedItem = item; } }, true, (Func)delegate(ItemProto item) { BaseRecipe recipe = RecipeManager.GetRecipe(SelectedRecipeType, ((Proto)item).ID); return recipe != null && (showLocked || recipe.Unlocked); }); } public static void AddTranslations() { FE.Utils.Utils.Register("配方操作", "Recipe Operate"); FE.Utils.Utils.Register("当前物品", "Current item"); FE.Utils.Utils.Register("配方操作提示按钮说明1", "Left-click to switch between unlocked recipes in the current recipe category, right-click to switch between all available recipes in the current recipe category.", "左键在当前配方类别已解锁配方之间切换,右键在当前配方类别全部可用配方中切换。"); FE.Utils.Utils.Register("配方类型", "Recipe type"); FE.Utils.Utils.Register("解锁配方", "Unlock recipe"); FE.Utils.Utils.Register("兑换回响", "Exchange echo"); FE.Utils.Utils.Register("无法解锁", "Can not unlock"); FE.Utils.Utils.Register("升至下一级", "Upgrade to next level"); FE.Utils.Utils.Register("升至最高级", "Upgrade to max level"); FE.Utils.Utils.Register("突破品质", "Breakthrough quality"); FE.Utils.Utils.Register("重置", "Reset"); FE.Utils.Utils.Register("降级", "Downgrade"); FE.Utils.Utils.Register("升级", "Upgrade"); FE.Utils.Utils.Register("升满", "Full upgrade"); FE.Utils.Utils.Register("配方不存在!", "Recipe does not exist!"); FE.Utils.Utils.Register("分馏配方未解锁", "Recipe locked", "配方未解锁"); FE.Utils.Utils.Register("费用", "Cost"); FE.Utils.Utils.Register("每种精华", "Each essence"); FE.Utils.Utils.Register("一定量的", "a certain amount of"); FE.Utils.Utils.Register("成功率", "Success Rate"); FE.Utils.Utils.Register("损毁率", "Destroy Rate"); FE.Utils.Utils.Register("产出", "Output"); FE.Utils.Utils.Register("增产点数", "Proliferator Points"); FE.Utils.Utils.Register("完全处理后的输出如下:", "The fully processed output is as follows:"); FE.Utils.Utils.Register(",直至突破成功", ", until the breakthrough succeeds"); FE.Utils.Utils.Register("配方已完全升级!", "Recipe has been completely upgraded!"); FE.Utils.Utils.Register("配方已到最高品质!", "Recipe has reached the highest quality!"); FE.Utils.Utils.Register("配方品质可突破,突破条件:", "Recipe quality can be broken through. Conditions for breaking through:"); FE.Utils.Utils.Register("达到当前品质最高等级(", "Reaching the highest current quality level ("); FE.Utils.Utils.Register(")", ")"); FE.Utils.Utils.Register("达到当前等级经验上限(", "Reach the current level experience cap ("); FE.Utils.Utils.Register("拥有足够的同名回响(", "Have sufficient echoes of the same name ("); FE.Utils.Utils.Register("当前物品尚未解锁,或科技层次不足!", "The current item has not been unlocked, or the technology level is insufficient!"); FE.Utils.Utils.Register("配方回响数目已达到上限!", "The number of recipe echoes has reached the limit!"); FE.Utils.Utils.Register("配方回响数目已达到突破要求,暂时无法兑换!", "The number of recipe echoes has reached the breakthrough requirement and cannot be exchanged for the time being!"); FE.Utils.Utils.Register("配方经验已达上限!", "Recipe experience has reached the limit!"); FE.Utils.Utils.Register("配方已升至当前品质最高等级!", "Recipe has been upgraded to the highest quality level currently available!"); FE.Utils.Utils.Register("配方回响数目不足!", "Insufficient number of recipe echoes!"); } public static void LoadConfig(ConfigFile configFile) { RecipeTypeEntry = configFile.Bind("Recipe Operate", "Recipe Type", 0, "想要查看的配方类型。"); if (RecipeTypeEntry.Value < 0 || RecipeTypeEntry.Value >= ERecipeExtension.RecipeTypes.Length) { RecipeTypeEntry.Value = 0; } selectedInc = configFile.Bind("Recipe Operate", "Selected Inc", 0, "想要查看的最终输出的增产点数"); int value = selectedInc.Value; if ((value < 0 || value > 10) ? true : false) { selectedInc.Value = 0; } } public static void CreateUI(MyConfigWindow wnd, RectTransform trans) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_009a: Expected O, but got Unknown //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Expected O, but got Unknown //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Expected O, but got Unknown //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Expected O, but got Unknown //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Expected O, but got Unknown //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Expected O, but got Unknown window = trans; tab = wnd.AddTab(trans, "配方操作"); float num = 0f; float num2 = 25f; txtCurrItem = wnd.AddText2(num, num2, tab, "当前物品", 15, "textCurrItem"); float popupY = num2 + 21.5f; btnSelectedItem = wnd.AddImageButton(num + txtCurrItem.preferredWidth + 5f, num2, tab, (Proto)(object)SelectedItem, "button-change-item").WithClickEvent((UnityAction)delegate { OnButtonChangeItemClick(showLocked: false, popupY); }, (UnityAction)delegate { OnButtonChangeItemClick(showLocked: true, popupY); }); wnd.AddTipsButton2(num + txtCurrItem.preferredWidth + 5f + btnSelectedItem.Width + 5f, num2, tab, "提示", "配方操作提示按钮说明1"); Text val = wnd.AddText2(FE.Utils.Utils.GetPosition(1, 4).Item1, num2, tab, "配方类型"); wnd.AddComboBox(FE.Utils.Utils.GetPosition(1, 4).Item1 + 5f + val.preferredWidth, num2, tab).WithItems(ERecipeExtension.RecipeTypeShortNames).WithSize(200f, 0f) .WithConfigEntry(RecipeTypeEntry); wnd.AddImageButton(FE.Utils.Utils.GetPosition(3, 4).Item1, num2, tab, (Proto)(object)((ProtoSet)(object)LDB.items).Select(8017)); txtCoreCount = wnd.AddText2(FE.Utils.Utils.GetPosition(3, 4).Item1 + 40f + 5f, num2, tab, "动态刷新"); num2 += 43f; if (!GameMain.sandboxToolsEnabled) { float y = num2; RectTransform parent = tab; object obj = <>c.<>9__22_2; if (obj == null) { UnityAction val2 = delegate { GetRecipe(SelectedRecipe); }; <>c.<>9__22_2 = val2; obj = (object)val2; } btnGetRecipe = wnd.AddButton(0, 4, y, parent, "动态刷新", 16, "button", (UnityAction)obj); float y2 = num2; RectTransform parent2 = tab; object obj2 = <>c.<>9__22_3; if (obj2 == null) { UnityAction val3 = delegate { UpgradeLevel(SelectedRecipe, maxLevel: false); }; <>c.<>9__22_3 = val3; obj2 = (object)val3; } wnd.AddButton(1, 4, y2, parent2, "升至下一级", 16, "button", (UnityAction)obj2); float y3 = num2; RectTransform parent3 = tab; object obj3 = <>c.<>9__22_4; if (obj3 == null) { UnityAction val4 = delegate { UpgradeLevel(SelectedRecipe, maxLevel: true); }; <>c.<>9__22_4 = val4; obj3 = (object)val4; } wnd.AddButton(2, 4, y3, parent3, "升至最高级", 16, "button", (UnityAction)obj3); float y4 = num2; RectTransform parent4 = tab; object obj4 = <>c.<>9__22_5; if (obj4 == null) { UnityAction val5 = delegate { BreakthroughQualityUntilSuccess(SelectedRecipe); }; <>c.<>9__22_5 = val5; obj4 = (object)val5; } wnd.AddButton(3, 4, y4, parent4, "突破品质", 16, "button", (UnityAction)obj4); } else { float y5 = num2; RectTransform parent5 = tab; object obj5 = <>c.<>9__22_6; if (obj5 == null) { UnityAction val6 = delegate { Reset(SelectedRecipe); }; <>c.<>9__22_6 = val6; obj5 = (object)val6; } wnd.AddButton(0, 4, y5, parent5, "重置", 16, "button", (UnityAction)obj5); float y6 = num2; RectTransform parent6 = tab; object obj6 = <>c.<>9__22_7; if (obj6 == null) { UnityAction val7 = delegate { Downgrade(SelectedRecipe); }; <>c.<>9__22_7 = val7; obj6 = (object)val7; } wnd.AddButton(1, 4, y6, parent6, "降级", 16, "button", (UnityAction)obj6); float y7 = num2; RectTransform parent7 = tab; object obj7 = <>c.<>9__22_8; if (obj7 == null) { UnityAction val8 = delegate { Upgrade(SelectedRecipe); }; <>c.<>9__22_8 = val8; obj7 = (object)val8; } wnd.AddButton(2, 4, y7, parent7, "升级", 16, "button", (UnityAction)obj7); float y8 = num2; RectTransform parent8 = tab; object obj8 = <>c.<>9__22_9; if (obj8 == null) { UnityAction val9 = delegate { FullUpgrade(SelectedRecipe); }; <>c.<>9__22_9 = val9; obj8 = (object)val9; } wnd.AddButton(3, 4, y8, parent8, "升满", 16, "button", (UnityAction)obj8); } incSlider = wnd.AddSlider(valueList: GenesisBook.Enable ? new int[3] { 0, 4, 10 } : new int[5] { 0, 1, 2, 4, 10 }, x: 0f, y: 0f, parent: tab, config: selectedInc, format: null, width: 200f); num2 = (txtRecipeInfoBaseY = num2 + 36f); for (int i = 0; i < txtRecipeInfo.Length; i++) { txtRecipeInfo[i] = wnd.AddText2(num, num2, tab, "动态刷新"); } } public static void UpdateUI() { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_0997: Unknown result type (might be due to invalid IL or missing references) //IL_0990: Unknown result type (might be due to invalid IL or missing references) if (!((Component)tab).gameObject.activeSelf) { return; } btnSelectedItem.Proto = (Proto)(object)SelectedItem; ERecipe eRecipe = ERecipeExtension.RecipeTypes[RecipeTypeEntry.Value]; BaseRecipe recipe = RecipeManager.GetRecipe(eRecipe, ((Proto)SelectedItem).ID); txtCoreCount.text = $"x {FE.Utils.Utils.GetItemTotalCount(8017)}"; int num = 0; ((Component)incSlider).gameObject.SetActive(false); if (recipe == null) { if (!GameMain.sandboxToolsEnabled) { ((Behaviour)btnGetRecipe).enabled = false; ((Behaviour)btnGetRecipe.button).enabled = false; btnGetRecipe.SetText(Localization.Translate("无法解锁")); } txtRecipeInfo[num].text = Localization.Translate("配方不存在!").WithColor(FE.Utils.Utils.Red); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; } else if (recipe.Locked) { if (!GameMain.sandboxToolsEnabled) { ((Behaviour)btnGetRecipe).enabled = true; ((Behaviour)btnGetRecipe.button).enabled = true; btnGetRecipe.SetText(Localization.Translate("解锁配方")); } txtRecipeInfo[num].text = recipe.TypeNameWC + " " + Localization.Translate("分馏配方未解锁").WithColor(FE.Utils.Utils.Red); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; } else { if (!GameMain.sandboxToolsEnabled) { ((Behaviour)btnGetRecipe).enabled = true; ((Behaviour)btnGetRecipe.button).enabled = true; btnGetRecipe.SetText(Localization.Translate("兑换回响")); } txtRecipeInfo[num].text = recipe.TypeNameWC + " " + recipe.LvExpWC; txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; txtRecipeInfo[num].text = ""; txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; txtRecipeInfo[num].text = Localization.Translate("费用") + " 1 " + ((Proto)SelectedItem).name; txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; if (eRecipe == ERecipe.QuantumCopy) { QuantumCopyRecipe recipe2 = RecipeManager.GetRecipe(eRecipe, ((Proto)SelectedItem).ID); txtRecipeInfo[num].text = string.Format(" {0:F3} {1}", recipe2.EssenceCost, Localization.Translate("每种精华")); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; } txtRecipeInfo[num].text = string.Format("{0} {1:P3}", Localization.Translate("成功率"), recipe.SuccessRate).WithColor(FE.Utils.Utils.Orange) + " " + string.Format("{0} {1:P3}", Localization.Translate("损毁率"), recipe.DestroyRate).WithColor(FE.Utils.Utils.Red); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; bool flag = true; foreach (OutputInfo item in recipe.OutputMain) { txtRecipeInfo[num].text = string.Format("{0} {1}", flag ? Localization.Translate("产出") : " ", item); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; if (flag) { flag = false; } } flag = true; foreach (OutputInfo item2 in recipe.OutputAppend) { txtRecipeInfo[num].text = string.Format("{0} {1}", flag ? Localization.Translate("其他") : " ", item2); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; if (flag) { flag = false; } } txtRecipeInfo[num].text = ""; txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; txtRecipeInfo[num].text = ((Proto)((ProtoSet)(object)LDB.items).Select(recipe.InputID)).name + " x 1 " + Localization.Translate("完全处理后的输出如下:"); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; txtRecipeInfo[num].text = Localization.Translate("增产点数") ?? ""; txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); incSlider.SetPosition(120f, txtRecipeInfoBaseY + 24f * (float)num); ((Component)incSlider).gameObject.SetActive(true); num++; string sameRecipeStr = GetSameRecipeStr(recipe, selectedInc.Value); string[] array = sameRecipeStr.Split(new char[2] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); string[] array2 = array; foreach (string text in array2) { txtRecipeInfo[num].text = text; txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; } txtRecipeInfo[num].text = ""; txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; if (recipe.FullUpgrade) { txtRecipeInfo[num].text = Localization.Translate("配方已完全升级!").WithColor(FE.Utils.Utils.Gold); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; } else if (recipe.IsMaxQuality) { txtRecipeInfo[num].text = Localization.Translate("配方已到最高品质!").WithColor(FE.Utils.Utils.Orange); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; } else { txtRecipeInfo[num].text = Localization.Translate("配方品质可突破,突破条件:").WithColor(recipe.Quality); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; txtRecipeInfo[num].text = "[" + (recipe.IsCurrQualityMaxLevel ? "√" : "x") + "] " + string.Format("{0}{1} / {2}{3}", Localization.Translate("达到当前品质最高等级("), recipe.Level, recipe.CurrQualityMaxLevel, Localization.Translate(")")).WithColor(recipe.IsCurrQualityMaxLevel ? FE.Utils.Utils.Green : FE.Utils.Utils.Red); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; txtRecipeInfo[num].text = "[" + (recipe.IsCurrQualityCurrLevelMaxExp ? "√" : "x") + "] " + string.Format("{0}{1:F0} / {2}{3}", Localization.Translate("达到当前等级经验上限("), recipe.Exp, recipe.CurrQualityCurrLevelExp, Localization.Translate(")")).WithColor(recipe.IsCurrQualityCurrLevelMaxExp ? FE.Utils.Utils.Green : FE.Utils.Utils.Red); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; txtRecipeInfo[num].text = "[" + (recipe.IsEnoughEchoToBreak ? "√" : "x") + "] " + string.Format("{0}{1} / {2}{3}", Localization.Translate("拥有足够的同名回响("), recipe.Echo, recipe.BreakCurrQualityNeedEcho, Localization.Translate(")")).WithColor(recipe.IsEnoughEchoToBreak ? FE.Utils.Utils.Green : FE.Utils.Utils.Red); txtRecipeInfo[num].SetPosition(0f, txtRecipeInfoBaseY + 24f * (float)num); num++; } } for (; num < txtRecipeInfo.Length; num++) { txtRecipeInfo[num].text = ""; txtRecipeInfo[num].SetPosition(0f, 0f); } } private static string GetSameRecipeStr(BaseRecipe recipe, int fluidInputIncAvg) { QuantumCopyRecipe quantumCopyRecipe = recipe as QuantumCopyRecipe; ItemProto building = ((ProtoSet)(object)LDB.items).Select(recipe.RecipeType.GetSpriteItemId()); float num = (float)ProcessManager.MaxTableMilli(fluidInputIncAvg); float num2 = building.ReinforcementBonusFracSuccess(); float num3 = building.ReinforcementBonusMainOutputCount(); float num4 = building.ReinforcementBonusAppendOutputRate(); float num5 = ((quantumCopyRecipe == null) ? (recipe.SuccessRate * (1f + num) * (1f + num2)) : (recipe.SuccessRate * (1f + num2))); float destroyRate = recipe.DestroyRate; float num6 = (1f - destroyRate) * num5 / (destroyRate + (1f - destroyRate) * num5); Dictionary dictionary = new Dictionary(); float num7 = 0f; foreach (OutputInfo item in recipe.OutputMain) { int outputID = item.OutputID; float num8 = num6; num8 *= item.SuccessRate; num8 *= item.OutputCount * (1f + recipe.MainOutputCountInc + num3); if (quantumCopyRecipe != null) { float num9 = num * 0.5f / (float)ProcessManager.MaxTableMilli(10); num7 = quantumCopyRecipe.EssenceCost * (1f - quantumCopyRecipe.EssenceDec) * (1f - num9); } if (dictionary.TryGetValue(outputID, out var value)) { value.Item1 += num8; } else { value = (num8, item.ShowOutputName, item.ShowSuccessRate); } dictionary[outputID] = value; } foreach (OutputInfo item2 in recipe.OutputAppend) { int outputID2 = item2.OutputID; float num10 = num6; num10 *= item2.SuccessRate * (1f + recipe.AppendOutputRatioInc) * (1f + num4); num10 *= item2.OutputCount; if (dictionary.TryGetValue(outputID2, out var value2)) { value2.Item1 += num10; } else { value2 = (num10, item2.ShowOutputName, item2.ShowSuccessRate); } dictionary[outputID2] = value2; } StringBuilder stringBuilder = new StringBuilder(string.Format("{0} {1:D2} ", Localization.Translate("增产点数"), fluidInputIncAvg)); bool sandboxToolsEnabled = GameMain.sandboxToolsEnabled; int num11 = 1; foreach (KeyValuePair item3 in dictionary) { (float, bool, bool) value3 = item3.Value; if (stringBuilder.Length > 80 * num11) { stringBuilder.AppendLine(); stringBuilder.Append(" "); num11++; } stringBuilder.Append(((value3.Item2 || sandboxToolsEnabled) ? ((Proto)((ProtoSet)(object)LDB.items).Select(item3.Key)).name : "???") + " x " + ((value3.Item3 || sandboxToolsEnabled) ? value3.Item1.ToString("F3") : "???") + " "); } if (quantumCopyRecipe != null) { stringBuilder.Append(string.Format("{0} x -{1:F3}", Localization.Translate("每种精华"), num7)); } return stringBuilder.ToString(); } private static void GetRecipe(BaseRecipe recipe) { //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } if (recipe == null) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方不存在!"), Localization.Translate("确定"), 1, (Response)null); return; } if (!GameMain.history.ItemUnlocked(recipe.InputID) || !GameMain.history.ItemUnlocked(recipe.MatrixID)) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("当前物品尚未解锁,或科技层次不足!"), Localization.Translate("确定"), 1, (Response)null); return; } if (recipe.IsMaxEcho) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方回响数目已达到上限!"), Localization.Translate("确定"), 1, (Response)null); return; } int takeId = 8017; int takeCount = (recipe.Locked ? 1 : Math.Max(0, recipe.BreakCurrQualityNeedEcho - recipe.Echo)); if (takeCount == 0) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方回响数目已达到突破要求,暂时无法兑换!"), Localization.Translate("确定"), 1, (Response)null); return; } ItemProto val = ((ProtoSet)(object)LDB.items).Select(takeId); UIMessageBox.Show(Localization.Translate("提示"), string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)val).name, takeCount) + Localization.Translate("来兑换") + " " + recipe.TypeNameWC + " " + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out var _)) { for (int i = 0; i < takeCount; i++) { recipe.RewardThis(manual: true); } } }, (Response)null); } private static void UpgradeLevel(BaseRecipe recipe, bool maxLevel) { //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } if (recipe == null) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方不存在!"), Localization.Translate("确定"), 1, (Response)null); return; } if (recipe.Locked) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("分馏配方未解锁") + Localization.Translate("!"), Localization.Translate("确定"), 1, (Response)null); return; } if (recipe.FullUpgrade) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方已完全升级!"), Localization.Translate("确定"), 1, (Response)null); return; } if (recipe.IsCurrQualityCurrLevelMaxExp) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方经验已达上限!"), Localization.Translate("确定"), 1, (Response)null); return; } int takeId = 1099; float needExp = (maxLevel ? recipe.GetExpToMaxLevel() : recipe.GetExpToNextLevel()); if (maxLevel && needExp <= 0f) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方已升至当前品质最高等级!"), Localization.Translate("确定"), 1, (Response)null); return; } int takeCount = (int)Math.Ceiling(needExp * 10f); ItemProto val = ((ProtoSet)(object)LDB.items).Select(1099); UIMessageBox.Show(Localization.Translate("提示"), string.Format("{0} {1} x {2} ", Localization.Translate("要花费"), ((Proto)val).name, takeCount) + string.Format("{0} {1} {2} x {3} {4}", Localization.Translate("来兑换"), recipe.TypeNameWC, Localization.Translate("配方经验"), (int)needExp, Localization.Translate("吗?")), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { if (FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out var _)) { recipe.AddExp(needExp, useExpMultiRate: false, manual: true); } }, (Response)null); } private static void BreakthroughQualityUntilSuccess(BaseRecipe recipe) { //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Expected O, but got Unknown if (DSPGame.IsMenuDemo || GameMain.mainPlayer == null) { return; } if (recipe == null) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方不存在!"), Localization.Translate("确定"), 1, (Response)null); return; } if (recipe.Locked) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("分馏配方未解锁") + Localization.Translate("!"), Localization.Translate("确定"), 1, (Response)null); return; } if (recipe.FullUpgrade) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方已完全升级!"), Localization.Translate("确定"), 1, (Response)null); return; } if (recipe.IsMaxQuality) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方已到最高品质!"), Localization.Translate("确定"), 1, (Response)null); return; } if (!recipe.IsEnoughEchoToBreak) { UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("配方回响数目不足!"), Localization.Translate("确定"), 1, (Response)null); return; } int takeId = 1099; float needExp = recipe.GetExpToMaxLevel(); int takeCount = (int)Math.Ceiling(needExp * 10f); ItemProto val = ((ProtoSet)(object)LDB.items).Select(1099); UIMessageBox.Show(Localization.Translate("提示"), Localization.Translate("要花费") + Localization.Translate("一定量的") + " " + ((Proto)val).name + " " + Localization.Translate("来兑换") + " " + recipe.TypeNameWC + " " + Localization.Translate("配方经验") + Localization.Translate(",直至突破成功") + Localization.Translate("吗?"), Localization.Translate("确定"), Localization.Translate("取消"), 2, (Response)delegate { int inc; if (!recipe.IsCurrQualityMaxLevel) { if (!FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out inc)) { return; } recipe.AddExp(needExp, useExpMultiRate: false, manual: true); } int nextQuality = recipe.NextQuality; while (recipe.Quality != nextQuality) { needExp = recipe.GetExpToNextLevel(); takeCount = (int)Math.Ceiling(needExp * 10f); if (!FE.Utils.Utils.TakeItemWithTip(takeId, takeCount, out inc)) { break; } recipe.AddExp(needExp, useExpMultiRate: false, manual: true); } }, (Response)null); } public static void Upgrade(BaseRecipe recipe) { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { recipe?.SandBoxUpDowngrade(up: true, manual: true); } } public static void Downgrade(BaseRecipe recipe) { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { recipe?.SandBoxUpDowngrade(up: false, manual: true); } } public static void FullUpgrade(BaseRecipe recipe) { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { recipe?.SandBoxMaxUpDowngrade(up: true, manual: true); } } public static void Reset(BaseRecipe recipe) { if (!DSPGame.IsMenuDemo && GameMain.mainPlayer != null) { recipe?.SandBoxMaxUpDowngrade(up: false, manual: true); } } public static void Import(BinaryReader r) { int num = r.ReadInt32(); } public static void Export(BinaryWriter w) { w.Write(1); } public static void IntoOtherSave() { } } } namespace FE.UI.Patches { public static class IconSetPatch { [HarmonyPatch(typeof(IconSet), "Create")] [HarmonyPrefix] public static bool IconSet_Create_Prefix(ref IconSet __instance) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Expected O, but got Unknown //IL_078e: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Expected O, but got Unknown //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_096c: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_0981: Unknown result type (might be due to invalid IL or missing references) //IL_0988: Expected O, but got Unknown if (__instance.loaded) { return false; } HighStopwatch val = new HighStopwatch(); val.Begin(); __instance.texture = new Texture2D(2000, 2000, (TextureFormat)5, true); __instance.itemIconIndex = new uint[12000]; __instance.veinIconIndex = new uint[256]; __instance.recipeIconIndex = new uint[12000]; __instance.techIconIndex = new uint[12000]; __instance.signalIconIndex = new uint[60000]; __instance.itemDescArr = new float[25000]; __instance.itemIconIndexBuffer = new ComputeBuffer(12000, 4, (ComputeBufferType)0); __instance.veinIconIndexBuffer = new ComputeBuffer(256, 4, (ComputeBufferType)0); __instance.recipeIconIndexBuffer = new ComputeBuffer(12000, 4, (ComputeBufferType)0); __instance.techIconIndexBuffer = new ComputeBuffer(12000, 4, (ComputeBufferType)0); __instance.signalIconIndexBuffer = new ComputeBuffer(60000, 4, (ComputeBufferType)0); __instance.itemIconDescBuffer = new ComputeBuffer(25000, 4, (ComputeBufferType)0); __instance.spriteIndexMap = new Dictionary(); __instance.texture.SetPixels((Color[])(object)new Color[4000000]); __instance.texture.Apply(); List list = new List(); uint num = 0u; ItemProto[] dataArray = ((ProtoSet)(object)LDB.items).dataArray; int num2 = dataArray.Length; for (int i = 0; i < num2; i++) { uint num3 = 0u; ItemProto val2 = dataArray[i]; Sprite iconSprite = val2.iconSprite; if ((Object)(object)iconSprite != (Object)null) { if (__instance.spriteIndexMap.ContainsKey(iconSprite)) { num3 = __instance.spriteIndexMap[iconSprite]; } else { num3 = ++num; if (num3 >= 625) { num3 = 0u; Debug.LogWarning((object)"图标图集空间不足!"); } else { int num4 = (int)num3 % 25; int num5 = (int)num3 / 25; Graphics.CopyTexture((Texture)(object)val2.iconSprite.texture, 0, 0, 0, 0, 80, 80, (Texture)(object)__instance.texture, 0, 0, num4 * 80, num5 * 80); } __instance.spriteIndexMap[iconSprite] = num3; } if (!string.IsNullOrEmpty(val2.IconTag)) { int num6 = (int)num3 % 25; int num7 = (int)num3 / 25; IconConfig item = new IconConfig(((Proto)val2).name, val2.IconTag, new Vector2((float)num6 / 25f, (float)num7 / 25f), new Vector2((float)(num6 + 1) / 25f, (float)(num7 + 1) / 25f), new Vector2(24f, 24f), true); list.Add(item); } } __instance.itemIconIndex[((Proto)dataArray[i]).ID] = num3; __instance.signalIconIndex[((Proto)dataArray[i]).ID] = num3; } __instance.itemIconIndexBuffer.SetData((Array)__instance.itemIconIndex); VeinProto[] dataArray2 = ((ProtoSet)(object)LDB.veins).dataArray; int num8 = dataArray2.Length; for (int j = 0; j < num8; j++) { uint num9 = 0u; VeinProto val3 = dataArray2[j]; Sprite iconSprite2 = val3.iconSprite; if ((Object)(object)iconSprite2 != (Object)null) { if (__instance.spriteIndexMap.ContainsKey(iconSprite2)) { num9 = __instance.spriteIndexMap[iconSprite2]; } else { num9 = ++num; if (num9 >= 625) { num9 = 0u; Debug.LogWarning((object)"图标图集空间不足!"); } else { int num10 = (int)num9 % 25; int num11 = (int)num9 / 25; Graphics.CopyTexture((Texture)(object)val3.iconSprite80px.texture, 0, 0, 0, 0, 80, 80, (Texture)(object)__instance.texture, 0, 0, num10 * 80, num11 * 80); } __instance.spriteIndexMap[iconSprite2] = num9; } } __instance.veinIconIndex[((Proto)dataArray2[j]).ID] = num9; __instance.signalIconIndex[((Proto)dataArray2[j]).ID + 12000] = num9; } __instance.veinIconIndexBuffer.SetData((Array)__instance.veinIconIndex); RecipeProto[] dataArray3 = ((ProtoSet)(object)LDB.recipes).dataArray; int num12 = dataArray3.Length; for (int k = 0; k < num12; k++) { uint num13 = 0u; RecipeProto val4 = dataArray3[k]; Sprite iconSprite3 = val4.iconSprite; if ((Object)(object)iconSprite3 != (Object)null) { if (__instance.spriteIndexMap.ContainsKey(iconSprite3)) { num13 = __instance.spriteIndexMap[iconSprite3]; } else { num13 = ++num; if (num13 >= 625) { num13 = 0u; Debug.LogWarning((object)"图标图集空间不足!"); } else { int num14 = (int)num13 % 25; int num15 = (int)num13 / 25; Graphics.CopyTexture((Texture)(object)val4.iconSprite.texture, 0, 0, 0, 0, 80, 80, (Texture)(object)__instance.texture, 0, 0, num14 * 80, num15 * 80); } __instance.spriteIndexMap[iconSprite3] = num13; } if (!string.IsNullOrEmpty(val4.IconTag)) { int num16 = (int)num13 % 25; int num17 = (int)num13 / 25; IconConfig item2 = new IconConfig(((Proto)val4).name, val4.IconTag, new Vector2((float)num16 / 25f, (float)num17 / 25f), new Vector2((float)(num16 + 1) / 25f, (float)(num17 + 1) / 25f), new Vector2(24f, 24f), true); list.Add(item2); } } __instance.recipeIconIndex[((Proto)dataArray3[k]).ID] = num13; __instance.signalIconIndex[((Proto)dataArray3[k]).ID + 20000] = num13; } __instance.recipeIconIndexBuffer.SetData((Array)__instance.recipeIconIndex); TechProto[] dataArray4 = ((ProtoSet)(object)LDB.techs).dataArray; int num18 = dataArray4.Length; int num19 = 0; List list2 = new List(); for (int num20 = num18 - 1; num20 >= 0; num20--) { uint num21 = 0u; TechProto val5 = dataArray4[num20]; Sprite iconSprite4 = val5.iconSprite; if ((Object)(object)iconSprite4 != (Object)null) { if (__instance.spriteIndexMap.ContainsKey(iconSprite4)) { num21 = __instance.spriteIndexMap[iconSprite4]; } else { if (((Proto)val5).ID > 2000 && ((Proto)val5).ID == num19 - 1) { num19 = ((Proto)val5).ID; continue; } num19 = ((Proto)val5).ID; if (list2.Contains(dataArray4[num20].IconPath)) { continue; } num21 = ++num; if (num21 >= 625) { num21 = 0u; Debug.LogWarning((object)"图标图集空间不足!"); } else { int num22 = (int)num21 % 25; int num23 = (int)num21 / 25; Graphics.CopyTexture((Texture)(object)val5.iconSprite.texture, 0, 0, 0, 0, 80, 80, (Texture)(object)__instance.texture, 0, 0, num22 * 80, num23 * 80); } __instance.spriteIndexMap[iconSprite4] = num21; } if (!string.IsNullOrEmpty(val5.IconTag)) { int num24 = (int)num21 % 25; int num25 = (int)num21 / 25; IconConfig item3 = new IconConfig(((Proto)val5).name, val5.IconTag, new Vector2((float)num24 / 25f, (float)num25 / 25f), new Vector2((float)(num24 + 1) / 25f, (float)(num25 + 1) / 25f), new Vector2(24f, 24f), true); list.Add(item3); } } __instance.techIconIndex[((Proto)dataArray4[num20]).ID] = num21; __instance.signalIconIndex[((Proto)dataArray4[num20]).ID + 40000] = num21; } __instance.techIconIndexBuffer.SetData((Array)__instance.techIconIndex); SignalProto[] dataArray5 = ((ProtoSet)(object)LDB.signals).dataArray; int num26 = dataArray5.Length; for (int l = 0; l < num26; l++) { uint num27 = 0u; SignalProto val6 = dataArray5[l]; Sprite iconSprite5 = val6.iconSprite; if ((Object)(object)iconSprite5 != (Object)null) { if (__instance.spriteIndexMap.ContainsKey(iconSprite5)) { num27 = __instance.spriteIndexMap[iconSprite5]; } else { num27 = ++num; if (num27 >= 625) { num27 = 0u; Debug.LogWarning((object)"图标图集空间不足!"); } else { int num28 = (int)num27 % 25; int num29 = (int)num27 / 25; Graphics.CopyTexture((Texture)(object)val6.iconSprite.texture, 0, 0, 0, 0, 80, 80, (Texture)(object)__instance.texture, 0, 0, num28 * 80, num29 * 80); } __instance.spriteIndexMap[iconSprite5] = num27; } if (!string.IsNullOrEmpty(val6.IconTag)) { int num30 = (int)num27 % 25; int num31 = (int)num27 / 25; IconConfig item4 = new IconConfig(((Proto)val6).name, val6.IconTag, new Vector2((float)num30 / 25f, (float)num31 / 25f), new Vector2((float)(num30 + 1) / 25f, (float)(num31 + 1) / 25f), new Vector2(24f, 24f), true); list.Add(item4); } } __instance.signalIconIndex[((Proto)dataArray5[l]).ID] = num27; } __instance.signalIconIndexBuffer.SetData((Array)__instance.signalIconIndex); __instance.texture.Apply(true); Array.Clear(__instance.itemDescArr, 0, __instance.itemDescArr.Length); TextAsset val7 = Resources.Load(IconSet.iconDescPath); if ((Object)(object)val7 != (Object)null) { using MemoryStream input = new MemoryStream(val7.bytes); using BinaryReader binaryReader = new BinaryReader(input); binaryReader.ReadInt32(); int num32 = binaryReader.ReadInt32(); for (int m = 0; m < num32; m++) { binaryReader.ReadInt32(); int num33 = binaryReader.ReadInt32(); uint num34 = ((num33 < 12000 && num33 > 0) ? __instance.itemIconIndex[num33] : 0u); for (int n = 0; n < 40; n++) { float num35 = binaryReader.ReadSingle(); if (num34 != 0) { __instance.itemDescArr[num34 * 40 + n] = num35; } } } } __instance.itemIconDescBuffer.SetData((Array)__instance.itemDescArr); __instance.loaded = true; Debug.Log((object)$"Icon set generated. Time cost: {val.duration:0.000} s"); Debug.Log((object)$"共计添加{num}个图标到图集。只有图标数目<=625时,才能看到除屏蔽之外的所有图标。"); TextIconMapping generalIconMapping = Configs.builtin.generalIconMapping; generalIconMapping.iconMappings = list.ToArray(); generalIconMapping.Refresh(); Shader.SetGlobalTexture("_Global_IconSet_Tex", (Texture)(object)__instance.texture); return false; } } public static class ItemPickerDuplicateGridPatch { [HarmonyPostfix] [HarmonyPriority(0)] [HarmonyPatch(typeof(UIItemPicker), "RefreshIcons")] private static void UIItemPicker_RefreshIcons_Postfix(UIItemPicker __instance) { if (__instance?.protoArray == null || __instance.indexArray == null || GameMain.iconSet == null) { return; } int num = (GenesisBook.Enable ? 17 : 14); int num2 = (GenesisBook.Enable ? 7 : 8); int num3 = num2 * num; if (num3 > __instance.protoArray.Length) { num3 = __instance.protoArray.Length; } int currentType = __instance.currentType; if (currentType <= 0) { return; } bool[] array = BuildOccupiedSlots(__instance, num3); if (AllSlotsOccupied(array)) { return; } ItemProto[] dataArray = ((ProtoSet)(object)LDB.items).dataArray; foreach (ItemProto val in dataArray) { if (!ShouldShowInPicker(val, currentType, num2, num)) { continue; } int gridSlot = GetGridSlot(val.GridIndex, num); if (gridSlot >= 0 && gridSlot < num3 && ((Proto)(__instance.protoArray[gridSlot]?)).ID != ((Proto)val).ID && !IsAlreadyVisible(__instance, ((Proto)val).ID)) { int num4 = FindFirstFreeSlot(array); if (num4 < 0) { break; } __instance.indexArray[num4] = GameMain.iconSet.itemIconIndex[((Proto)val).ID]; __instance.protoArray[num4] = val; array[num4] = true; } } } private static bool[] BuildOccupiedSlots(UIItemPicker picker, int visibleSlotCount) { bool[] array = new bool[visibleSlotCount]; for (int i = 0; i < visibleSlotCount; i++) { array[i] = picker.protoArray[i] != null; } return array; } private static bool AllSlotsOccupied(bool[] occupied) { for (int i = 0; i < occupied.Length; i++) { if (!occupied[i]) { return false; } } return true; } private static bool ShouldShowInPicker(ItemProto item, int currentPage, int rowCount, int columnCount) { if (item == null || item.GridIndex < 1101) { return false; } int num = item.GridIndex / 1000; if (num != currentPage) { return false; } int gridRow = GetGridRow(item.GridIndex, num); int gridColumn = GetGridColumn(item.GridIndex); if (gridRow < 0 || gridRow >= rowCount || gridColumn < 0 || gridColumn >= columnCount) { return false; } if (UIItemPickerExtension.currentFilter != null && !UIItemPickerExtension.currentFilter(item)) { return false; } return UIItemPicker.showAll || UIItemPickerExtension.showLocked || (GameMain.history != null && (GameMain.history.ItemUnlocked(((Proto)item).ID) || FE.Utils.Utils.GetItemTotalCount(((Proto)item).ID) > 0)); } private static int GetGridRow(int gridIndex, int page) { return (gridIndex - page * 1000) / 100 - 1; } private static int GetGridColumn(int gridIndex) { return gridIndex % 100 - 1; } private static int GetGridSlot(int gridIndex, int columnCount) { int page = gridIndex / 1000; return GetGridRow(gridIndex, page) * columnCount + GetGridColumn(gridIndex); } private static bool IsAlreadyVisible(UIItemPicker picker, int itemId) { for (int i = 0; i < picker.protoArray.Length; i++) { ItemProto obj = picker.protoArray[i]; if (obj != null && ((Proto)obj).ID == itemId) { return true; } } return false; } private static int FindFirstFreeSlot(bool[] occupied) { for (int i = 0; i < occupied.Length; i++) { if (!occupied[i]) { return i; } } return -1; } } public static class SignalPickerDuplicateGridPatch { [HarmonyPostfix] [HarmonyPriority(0)] [HarmonyPatch(typeof(UISignalPicker), "RefreshIcons")] private static void UISignalPicker_RefreshIcons_Postfix(UISignalPicker __instance) { if (__instance?.signalArray == null || __instance.indexArray == null || GameMain.iconSet == null) { return; } int currentItemPage = GetCurrentItemPage(__instance.currentType); if (currentItemPage <= 0) { return; } int columnCount = GetColumnCount(); int rowCount = GetRowCount(); int num = rowCount * columnCount; if (num > __instance.signalArray.Length) { num = __instance.signalArray.Length; } if (num > __instance.indexArray.Length) { num = __instance.indexArray.Length; } bool[] array = BuildOccupiedSlots(__instance, num); if (AllSlotsOccupied(array)) { return; } ItemProto[] dataArray = ((ProtoSet)(object)LDB.items).dataArray; foreach (ItemProto val in dataArray) { if (!ShouldShowInSignalPicker(val, currentItemPage, rowCount, columnCount)) { continue; } int gridSlot = GetGridSlot(val.GridIndex, columnCount); if (gridSlot < 0 || gridSlot >= num) { continue; } int num2 = SignalProtoSet.SignalId((ESignalType)1, ((Proto)val).ID); if (__instance.signalArray[gridSlot] != num2 && !IsAlreadyVisible(__instance, num2)) { int num3 = FindFirstFreeSlot(array); if (num3 < 0) { break; } __instance.indexArray[num3] = GameMain.iconSet.signalIconIndex[num2]; __instance.signalArray[num3] = num2; array[num3] = true; } } } private static int GetColumnCount() { return GenesisBook.Enable ? 17 : 14; } private static int GetRowCount() { return GenesisBook.Enable ? 7 : 10; } private static int GetCurrentItemPage(int currentType) { switch (currentType) { case 2: return 1; case 3: return 2; default: if (GenesisBook.Enable && currentType > 8) { return currentType - 6; } if (OrbitalRing.Enable && currentType > 7) { return currentType - 5; } if (currentType > 8) { return currentType - 6; } return 0; } } private static bool[] BuildOccupiedSlots(UISignalPicker picker, int visibleSlotCount) { bool[] array = new bool[visibleSlotCount]; for (int i = 0; i < visibleSlotCount; i++) { array[i] = picker.signalArray[i] != 0; } return array; } private static bool AllSlotsOccupied(bool[] occupied) { for (int i = 0; i < occupied.Length; i++) { if (!occupied[i]) { return false; } } return true; } private static bool ShouldShowInSignalPicker(ItemProto item, int currentPage, int rowCount, int columnCount) { if (item == null || item.GridIndex < 1101) { return false; } int num = item.GridIndex / 1000; if (num != currentPage) { return false; } int gridRow = GetGridRow(item.GridIndex, num); int gridColumn = GetGridColumn(item.GridIndex); return gridRow >= 0 && gridRow < rowCount && gridColumn >= 0 && gridColumn < columnCount; } private static int GetGridRow(int gridIndex, int page) { return (gridIndex - page * 1000) / 100 - 1; } private static int GetGridColumn(int gridIndex) { return gridIndex % 100 - 1; } private static int GetGridSlot(int gridIndex, int columnCount) { int page = gridIndex / 1000; return GetGridRow(gridIndex, page) * columnCount + GetGridColumn(gridIndex); } private static bool IsAlreadyVisible(UISignalPicker picker, int signalId) { for (int i = 0; i < picker.signalArray.Length; i++) { if (picker.signalArray[i] == signalId) { return true; } } return false; } private static int FindFirstFreeSlot(bool[] occupied) { for (int i = 0; i < occupied.Length; i++) { if (!occupied[i]) { return i; } } return -1; } } public static class UIButtonPatch { [HarmonyTranspiler] [HarmonyPatch(typeof(UIButton), "LateUpdate")] private static IEnumerable UIButton_LateUpdate_Transpiler(IEnumerable instructions, ILGenerator generator) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown if (UxAssist.Enable) { return instructions; } CodeMatcher val = new CodeMatcher(instructions, generator); val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[3] { new CodeMatch((Func)((CodeInstruction ci) => ci.opcode == OpCodes.Ldloc || ci.opcode == OpCodes.Ldloc_S), (string)null), new CodeMatch((OpCode?)OpCodes.Callvirt, (object)AccessTools.PropertyGetter(typeof(Component), "gameObject"), (string)null), new CodeMatch((OpCode?)OpCodes.Callvirt, (object)AccessTools.PropertyGetter(typeof(GameObject), "activeSelf"), (string)null) }); object operand = val.Operand; List