├── assets ├── icon.png ├── sprite │ ├── I氦.png │ ├── I氧.png │ ├── I氨.png │ ├── I氮.png │ ├── I苯.png │ ├── I三元弹箱.png │ ├── I三元精金.png │ ├── I三氯化铁.png │ ├── I上传扩容.png │ ├── I丙烯.png │ ├── I二氧化硫.png │ ├── I二氧化碳.png │ ├── I先进推进.png │ ├── I光伏扩容.png │ ├── I光学基板.png │ ├── I创世之书.png │ ├── I塑料基板.png │ ├── I奇点矩阵.png │ ├── I氢氧化钠.png │ ├── I氦三.png │ ├── I氯化钠.png │ ├── I海水.png │ ├── I湮灭弹箱.png │ ├── I热聚增效.png │ ├── I燃料回收.png │ ├── I玻色矩阵.png │ ├── I甲烷.png │ ├── I电力节约.png │ ├── I盐酸.png │ ├── I硝酸.png │ ├── I硫矿.png │ ├── I空燃料棒.png │ ├── I耗散矩阵.png │ ├── I聚苯硫醚.png │ ├── I聚酰亚胺.png │ ├── I虚空之书.png │ ├── I裂变增效.png │ ├── I资源采掘.png │ ├── I起源之书.png │ ├── I钚燃料棒.png │ ├── I钚矿.png │ ├── I钢芯弹箱.png │ ├── I钨合金.png │ ├── I钨块.png │ ├── I钨矿.png │ ├── I钨芯弹箱.png │ ├── I铀燃料棒.png │ ├── I铀矿.png │ ├── I铝合金.png │ ├── I铝块.png │ ├── I铝矿.png │ ├── I风力扩容.png │ ├── Otemp.png │ ├── O原子能.png │ ├── O燃烧角标.png │ ├── O电解角标.png │ ├── O离心角标.png │ ├── O防御.png │ ├── O高效角标.png │ ├── R催化重整.png │ ├── R水电解.png │ ├── R焦油分馏.png │ ├── R焦油裂化.png │ ├── R物质回收.png │ ├── R甲烷偶联.png │ ├── T基础化工.png │ ├── T物品仓储.png │ ├── T矿物处理.png │ ├── T量子折跃.png │ ├── V托林矿脉.png │ ├── V盐矿脉.png │ ├── V硫矿脉.png │ ├── V钨矿脉.png │ ├── V铝矿脉.png │ ├── IMOX燃料棒.png │ ├── I中继信号干扰.png │ ├── I先进机械组件.png │ ├── I光学处理器.png │ ├── I反物质导弹组.png │ ├── I反物质炮弹组.png │ ├── I基础机械组件.png │ ├── I大气采集站.png │ ├── I天穹装配厂.png │ ├── I尖端机械组件.png │ ├── I异常代码分析.png │ ├── I微型核弹组.png │ ├── I放射性矿物.png │ ├── I核子爆破单元.png │ ├── I氦三燃料棒.png │ ├── I氦闪约束器.png │ ├── I焦油燃料棒.png │ ├── I物质分解设施.png │ ├── I物质裂解塔.png │ ├── I特征向量模拟.png │ ├── I电磁加农炮.png │ ├── I神经元重编程.png │ ├── I等离子熔炉.png │ ├── I紫外激光塔.png │ ├── I超级机械组件.png │ ├── I量子储液罐.png │ ├── I量子储物仓.png │ ├── I量子计算主机.png │ ├── I钨强化玻璃.png │ ├── R放射矿物精炼.png │ ├── R有机晶体活化.png │ ├── R有机晶体重组.png │ ├── R能量物质化.png │ ├── T先进机械组件.png │ ├── T反物质导弹组.png │ ├── T基础机械组件.png │ ├── T尖端机械组件.png │ ├── T护盾载波调制.png │ ├── T核能爆破单元.png │ ├── T物质分解设施.png │ ├── T虚拟技术革新.png │ ├── T虚数空间存储.png │ ├── T行星协调中心.png │ ├── T钨强化玻璃.png │ ├── T钨强化金属.png │ ├── T黑雾协调中心.png │ ├── V放射晶体矿脉.png │ ├── I“苍穹”粒子加速器.png │ ├── I光学信息传输纤维.png │ ├── I反物质湮灭单元.png │ ├── I同位素温差发电机.png │ ├── I四氢双环戊二烯.png │ ├── I埃克森美孚化工厂.png │ ├── I开发者日志01.png │ ├── I开发者日志02.png │ ├── I开发者日志03.png │ ├── I开发者日志04.png │ ├── I开发者日志05.png │ ├── I开发者日志06.png │ ├── I开发者日志07.png │ ├── I开发者日志08.png │ ├── I开发者日志09.png │ ├── I开发者日志10.png │ ├── I开发者日志11.png │ ├── I氘氦混合燃料棒.png │ ├── R处理器(高效).png │ ├── R质能储存(高效).png │ ├── R钛晶石(高效).png │ ├── T先进有机合成技术.png │ ├── T光学信息传输技术.png │ ├── T反物质湮灭单元.png │ ├── T超级量子计算机.png │ ├── V托林矿脉-80px.png │ ├── V盐矿脉-80px.png │ ├── V硫矿脉-80px.png │ ├── V钨矿脉-80px.png │ ├── V铝矿脉-80px.png │ ├── I“湛曦”O型人造恒星.png │ ├── I四氢双环戊二烯燃料棒.png │ ├── T四氢双环戊二烯燃料棒.png │ ├── V放射晶体矿脉-80px.png │ ├── I“工业先锋”精密加工中心.png │ └── I“超越”X-1型光学主机.png ├── genesis-models ├── texture │ ├── 中文图标.png │ ├── 英文图标.png │ ├── 黑雾中文图标.png │ ├── 黑雾英文图标.png │ ├── 人造恒星MK2材质.png │ ├── 化工厂渲染索引.png │ ├── 大矿机渲染索引.png │ └── 创世Logo新春贺岁版.png └── genesis-models-lab ├── lib ├── Newtonsoft.Json.dll ├── GalacticScale-publicized.dll ├── Assembly-CSharp-publicized.dll └── BepInEx.AssemblyPublicizer.Cli.exe ├── nuget.config ├── src ├── Utils │ ├── KvpDeconstruct.cs │ ├── ERecipeType.cs │ ├── TranspilerLogUtils.cs │ ├── DictionaryExtend.cs │ ├── TextureHelper.cs │ ├── TranslateUtils.cs │ └── JsonDataUtils.cs ├── Compatibility │ ├── BlueprintTweaks.cs │ ├── FastTravelEnabler.cs │ ├── PlanetwideMining.cs │ ├── WeaponPlus.cs │ ├── PlanetVeinUtilization.cs │ ├── LazyOutposting.cs │ └── GigaStationsUpdated.cs └── Patches │ ├── UI │ ├── UIMainMenuPatches.cs │ ├── FluidColorPatches.cs │ ├── FactoryModelPatches.cs │ ├── UITechNodePatches.cs │ ├── HarmonyLogPatches.cs │ ├── IconSetPatches.cs │ ├── DisplayNamePatches.cs │ ├── UIMonitorPatches.cs │ ├── UpdateLogoPatches.cs │ └── UIPowerGeneratorWindowPatches.cs │ ├── VFPreloadPatches.cs │ ├── GeothermalStrengthPatches.cs │ ├── DarkFogPowerFactorPatches.cs │ ├── GoalLogicPatches.cs │ ├── PlanetFocus │ ├── DronePatches.cs │ ├── UIPlanetDetailExpand.cs │ ├── InternalFunctions.cs │ ├── FactoryPowerPatches.cs │ ├── LabPatches.cs │ ├── PlanetFocusPatches.cs │ ├── DarkFogPatches.cs │ └── PowerSystemPatches.cs │ ├── StationOutputPatches.cs │ ├── MegaAssembler │ ├── UIRecipePickerPatches.cs │ ├── UISlotPickerPatches.cs │ ├── InternalFunctions.cs │ └── NebulaCompat.cs │ ├── DisableLDBToolCachePatches.cs │ ├── ResourcesPatches.cs │ ├── RecipeExtraPowerPatches.cs │ ├── PowerGeneratorEnergyCapPatches.cs │ ├── SpaceMissilePatches.cs │ ├── AbnormalityLogicPatches.cs │ ├── InserterComponentPatches.cs │ ├── GasPowerPatches.cs │ ├── AddVein │ ├── AddEffectEmitterProto.cs │ ├── SwapShaderPatches.cs │ ├── VeinAnimDataPatches.cs │ └── PlanetThemePatches.cs │ ├── GammaGeneratorPatches.cs │ ├── TankComponentPatches.cs │ ├── EjectorPatches.cs │ ├── EnemyDropPatches.cs │ ├── ChemicalRecipeFcol │ └── ChemicalRecipeFcolPatches.cs │ ├── QuantumStorage │ ├── UIPatches.cs │ └── BuildingParametersPatches.cs │ ├── DysonSpherePatches.cs │ ├── ModelLoadingPatches.cs │ ├── FastTravelPatches.cs │ └── UIDetailPatches.cs ├── devtools ├── Program.cs ├── GridMoveTool │ ├── GridPos.cs │ ├── GridMoveTool.cs │ └── GridUtil.cs ├── DropListTool │ ├── DropListTool.cs │ └── DropConfig.cs ├── Properties │ └── AssemblyInfo.cs └── ProjectGenesis.DevTools.csproj ├── ProjectGenesis.sln.DotSettings ├── DefaultPath.props.example ├── data └── tutorials.json ├── ProjectGenesis.csproj.DotSettings ├── preloader ├── Preloader.cs └── ProjectGenesis.Preloader.csproj ├── ProjectGenesis.sln ├── README-For programmer.md └── packer ├── Packer.cs └── ProjectGenesis.Packer.csproj /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/icon.png -------------------------------------------------------------------------------- /assets/sprite/I氦.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氦.png -------------------------------------------------------------------------------- /assets/sprite/I氧.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氧.png -------------------------------------------------------------------------------- /assets/sprite/I氨.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氨.png -------------------------------------------------------------------------------- /assets/sprite/I氮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氮.png -------------------------------------------------------------------------------- /assets/sprite/I苯.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I苯.png -------------------------------------------------------------------------------- /assets/genesis-models: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/genesis-models -------------------------------------------------------------------------------- /assets/sprite/I三元弹箱.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I三元弹箱.png -------------------------------------------------------------------------------- /assets/sprite/I三元精金.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I三元精金.png -------------------------------------------------------------------------------- /assets/sprite/I三氯化铁.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I三氯化铁.png -------------------------------------------------------------------------------- /assets/sprite/I上传扩容.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I上传扩容.png -------------------------------------------------------------------------------- /assets/sprite/I丙烯.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I丙烯.png -------------------------------------------------------------------------------- /assets/sprite/I二氧化硫.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I二氧化硫.png -------------------------------------------------------------------------------- /assets/sprite/I二氧化碳.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I二氧化碳.png -------------------------------------------------------------------------------- /assets/sprite/I先进推进.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I先进推进.png -------------------------------------------------------------------------------- /assets/sprite/I光伏扩容.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I光伏扩容.png -------------------------------------------------------------------------------- /assets/sprite/I光学基板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I光学基板.png -------------------------------------------------------------------------------- /assets/sprite/I创世之书.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I创世之书.png -------------------------------------------------------------------------------- /assets/sprite/I塑料基板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I塑料基板.png -------------------------------------------------------------------------------- /assets/sprite/I奇点矩阵.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I奇点矩阵.png -------------------------------------------------------------------------------- /assets/sprite/I氢氧化钠.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氢氧化钠.png -------------------------------------------------------------------------------- /assets/sprite/I氦三.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氦三.png -------------------------------------------------------------------------------- /assets/sprite/I氯化钠.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氯化钠.png -------------------------------------------------------------------------------- /assets/sprite/I海水.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I海水.png -------------------------------------------------------------------------------- /assets/sprite/I湮灭弹箱.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I湮灭弹箱.png -------------------------------------------------------------------------------- /assets/sprite/I热聚增效.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I热聚增效.png -------------------------------------------------------------------------------- /assets/sprite/I燃料回收.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I燃料回收.png -------------------------------------------------------------------------------- /assets/sprite/I玻色矩阵.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I玻色矩阵.png -------------------------------------------------------------------------------- /assets/sprite/I甲烷.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I甲烷.png -------------------------------------------------------------------------------- /assets/sprite/I电力节约.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I电力节约.png -------------------------------------------------------------------------------- /assets/sprite/I盐酸.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I盐酸.png -------------------------------------------------------------------------------- /assets/sprite/I硝酸.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I硝酸.png -------------------------------------------------------------------------------- /assets/sprite/I硫矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I硫矿.png -------------------------------------------------------------------------------- /assets/sprite/I空燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I空燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/I耗散矩阵.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I耗散矩阵.png -------------------------------------------------------------------------------- /assets/sprite/I聚苯硫醚.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I聚苯硫醚.png -------------------------------------------------------------------------------- /assets/sprite/I聚酰亚胺.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I聚酰亚胺.png -------------------------------------------------------------------------------- /assets/sprite/I虚空之书.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I虚空之书.png -------------------------------------------------------------------------------- /assets/sprite/I裂变增效.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I裂变增效.png -------------------------------------------------------------------------------- /assets/sprite/I资源采掘.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I资源采掘.png -------------------------------------------------------------------------------- /assets/sprite/I起源之书.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I起源之书.png -------------------------------------------------------------------------------- /assets/sprite/I钚燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钚燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/I钚矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钚矿.png -------------------------------------------------------------------------------- /assets/sprite/I钢芯弹箱.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钢芯弹箱.png -------------------------------------------------------------------------------- /assets/sprite/I钨合金.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钨合金.png -------------------------------------------------------------------------------- /assets/sprite/I钨块.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钨块.png -------------------------------------------------------------------------------- /assets/sprite/I钨矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钨矿.png -------------------------------------------------------------------------------- /assets/sprite/I钨芯弹箱.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钨芯弹箱.png -------------------------------------------------------------------------------- /assets/sprite/I铀燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I铀燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/I铀矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I铀矿.png -------------------------------------------------------------------------------- /assets/sprite/I铝合金.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I铝合金.png -------------------------------------------------------------------------------- /assets/sprite/I铝块.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I铝块.png -------------------------------------------------------------------------------- /assets/sprite/I铝矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I铝矿.png -------------------------------------------------------------------------------- /assets/sprite/I风力扩容.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I风力扩容.png -------------------------------------------------------------------------------- /assets/sprite/Otemp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/Otemp.png -------------------------------------------------------------------------------- /assets/sprite/O原子能.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/O原子能.png -------------------------------------------------------------------------------- /assets/sprite/O燃烧角标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/O燃烧角标.png -------------------------------------------------------------------------------- /assets/sprite/O电解角标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/O电解角标.png -------------------------------------------------------------------------------- /assets/sprite/O离心角标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/O离心角标.png -------------------------------------------------------------------------------- /assets/sprite/O防御.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/O防御.png -------------------------------------------------------------------------------- /assets/sprite/O高效角标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/O高效角标.png -------------------------------------------------------------------------------- /assets/sprite/R催化重整.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R催化重整.png -------------------------------------------------------------------------------- /assets/sprite/R水电解.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R水电解.png -------------------------------------------------------------------------------- /assets/sprite/R焦油分馏.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R焦油分馏.png -------------------------------------------------------------------------------- /assets/sprite/R焦油裂化.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R焦油裂化.png -------------------------------------------------------------------------------- /assets/sprite/R物质回收.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R物质回收.png -------------------------------------------------------------------------------- /assets/sprite/R甲烷偶联.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R甲烷偶联.png -------------------------------------------------------------------------------- /assets/sprite/T基础化工.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T基础化工.png -------------------------------------------------------------------------------- /assets/sprite/T物品仓储.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T物品仓储.png -------------------------------------------------------------------------------- /assets/sprite/T矿物处理.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T矿物处理.png -------------------------------------------------------------------------------- /assets/sprite/T量子折跃.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T量子折跃.png -------------------------------------------------------------------------------- /assets/sprite/V托林矿脉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V托林矿脉.png -------------------------------------------------------------------------------- /assets/sprite/V盐矿脉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V盐矿脉.png -------------------------------------------------------------------------------- /assets/sprite/V硫矿脉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V硫矿脉.png -------------------------------------------------------------------------------- /assets/sprite/V钨矿脉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V钨矿脉.png -------------------------------------------------------------------------------- /assets/sprite/V铝矿脉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V铝矿脉.png -------------------------------------------------------------------------------- /assets/texture/中文图标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/中文图标.png -------------------------------------------------------------------------------- /assets/texture/英文图标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/英文图标.png -------------------------------------------------------------------------------- /lib/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/lib/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /assets/genesis-models-lab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/genesis-models-lab -------------------------------------------------------------------------------- /assets/sprite/IMOX燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/IMOX燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/I中继信号干扰.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I中继信号干扰.png -------------------------------------------------------------------------------- /assets/sprite/I先进机械组件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I先进机械组件.png -------------------------------------------------------------------------------- /assets/sprite/I光学处理器.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I光学处理器.png -------------------------------------------------------------------------------- /assets/sprite/I反物质导弹组.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I反物质导弹组.png -------------------------------------------------------------------------------- /assets/sprite/I反物质炮弹组.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I反物质炮弹组.png -------------------------------------------------------------------------------- /assets/sprite/I基础机械组件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I基础机械组件.png -------------------------------------------------------------------------------- /assets/sprite/I大气采集站.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I大气采集站.png -------------------------------------------------------------------------------- /assets/sprite/I天穹装配厂.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I天穹装配厂.png -------------------------------------------------------------------------------- /assets/sprite/I尖端机械组件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I尖端机械组件.png -------------------------------------------------------------------------------- /assets/sprite/I异常代码分析.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I异常代码分析.png -------------------------------------------------------------------------------- /assets/sprite/I微型核弹组.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I微型核弹组.png -------------------------------------------------------------------------------- /assets/sprite/I放射性矿物.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I放射性矿物.png -------------------------------------------------------------------------------- /assets/sprite/I核子爆破单元.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I核子爆破单元.png -------------------------------------------------------------------------------- /assets/sprite/I氦三燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氦三燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/I氦闪约束器.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氦闪约束器.png -------------------------------------------------------------------------------- /assets/sprite/I焦油燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I焦油燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/I物质分解设施.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I物质分解设施.png -------------------------------------------------------------------------------- /assets/sprite/I物质裂解塔.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I物质裂解塔.png -------------------------------------------------------------------------------- /assets/sprite/I特征向量模拟.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I特征向量模拟.png -------------------------------------------------------------------------------- /assets/sprite/I电磁加农炮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I电磁加农炮.png -------------------------------------------------------------------------------- /assets/sprite/I神经元重编程.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I神经元重编程.png -------------------------------------------------------------------------------- /assets/sprite/I等离子熔炉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I等离子熔炉.png -------------------------------------------------------------------------------- /assets/sprite/I紫外激光塔.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I紫外激光塔.png -------------------------------------------------------------------------------- /assets/sprite/I超级机械组件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I超级机械组件.png -------------------------------------------------------------------------------- /assets/sprite/I量子储液罐.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I量子储液罐.png -------------------------------------------------------------------------------- /assets/sprite/I量子储物仓.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I量子储物仓.png -------------------------------------------------------------------------------- /assets/sprite/I量子计算主机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I量子计算主机.png -------------------------------------------------------------------------------- /assets/sprite/I钨强化玻璃.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I钨强化玻璃.png -------------------------------------------------------------------------------- /assets/sprite/R放射矿物精炼.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R放射矿物精炼.png -------------------------------------------------------------------------------- /assets/sprite/R有机晶体活化.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R有机晶体活化.png -------------------------------------------------------------------------------- /assets/sprite/R有机晶体重组.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R有机晶体重组.png -------------------------------------------------------------------------------- /assets/sprite/R能量物质化.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R能量物质化.png -------------------------------------------------------------------------------- /assets/sprite/T先进机械组件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T先进机械组件.png -------------------------------------------------------------------------------- /assets/sprite/T反物质导弹组.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T反物质导弹组.png -------------------------------------------------------------------------------- /assets/sprite/T基础机械组件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T基础机械组件.png -------------------------------------------------------------------------------- /assets/sprite/T尖端机械组件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T尖端机械组件.png -------------------------------------------------------------------------------- /assets/sprite/T护盾载波调制.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T护盾载波调制.png -------------------------------------------------------------------------------- /assets/sprite/T核能爆破单元.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T核能爆破单元.png -------------------------------------------------------------------------------- /assets/sprite/T物质分解设施.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T物质分解设施.png -------------------------------------------------------------------------------- /assets/sprite/T虚拟技术革新.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T虚拟技术革新.png -------------------------------------------------------------------------------- /assets/sprite/T虚数空间存储.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T虚数空间存储.png -------------------------------------------------------------------------------- /assets/sprite/T行星协调中心.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T行星协调中心.png -------------------------------------------------------------------------------- /assets/sprite/T钨强化玻璃.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T钨强化玻璃.png -------------------------------------------------------------------------------- /assets/sprite/T钨强化金属.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T钨强化金属.png -------------------------------------------------------------------------------- /assets/sprite/T黑雾协调中心.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T黑雾协调中心.png -------------------------------------------------------------------------------- /assets/sprite/V放射晶体矿脉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V放射晶体矿脉.png -------------------------------------------------------------------------------- /assets/texture/黑雾中文图标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/黑雾中文图标.png -------------------------------------------------------------------------------- /assets/texture/黑雾英文图标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/黑雾英文图标.png -------------------------------------------------------------------------------- /assets/sprite/I“苍穹”粒子加速器.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I“苍穹”粒子加速器.png -------------------------------------------------------------------------------- /assets/sprite/I光学信息传输纤维.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I光学信息传输纤维.png -------------------------------------------------------------------------------- /assets/sprite/I反物质湮灭单元.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I反物质湮灭单元.png -------------------------------------------------------------------------------- /assets/sprite/I同位素温差发电机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I同位素温差发电机.png -------------------------------------------------------------------------------- /assets/sprite/I四氢双环戊二烯.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I四氢双环戊二烯.png -------------------------------------------------------------------------------- /assets/sprite/I埃克森美孚化工厂.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I埃克森美孚化工厂.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志01.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志02.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志03.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志04.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志05.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志06.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志07.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志08.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志09.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志10.png -------------------------------------------------------------------------------- /assets/sprite/I开发者日志11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I开发者日志11.png -------------------------------------------------------------------------------- /assets/sprite/I氘氦混合燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I氘氦混合燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/R处理器(高效).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R处理器(高效).png -------------------------------------------------------------------------------- /assets/sprite/R质能储存(高效).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R质能储存(高效).png -------------------------------------------------------------------------------- /assets/sprite/R钛晶石(高效).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/R钛晶石(高效).png -------------------------------------------------------------------------------- /assets/sprite/T先进有机合成技术.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T先进有机合成技术.png -------------------------------------------------------------------------------- /assets/sprite/T光学信息传输技术.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T光学信息传输技术.png -------------------------------------------------------------------------------- /assets/sprite/T反物质湮灭单元.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T反物质湮灭单元.png -------------------------------------------------------------------------------- /assets/sprite/T超级量子计算机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T超级量子计算机.png -------------------------------------------------------------------------------- /assets/sprite/V托林矿脉-80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V托林矿脉-80px.png -------------------------------------------------------------------------------- /assets/sprite/V盐矿脉-80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V盐矿脉-80px.png -------------------------------------------------------------------------------- /assets/sprite/V硫矿脉-80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V硫矿脉-80px.png -------------------------------------------------------------------------------- /assets/sprite/V钨矿脉-80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V钨矿脉-80px.png -------------------------------------------------------------------------------- /assets/sprite/V铝矿脉-80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V铝矿脉-80px.png -------------------------------------------------------------------------------- /assets/texture/人造恒星MK2材质.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/人造恒星MK2材质.png -------------------------------------------------------------------------------- /assets/texture/化工厂渲染索引.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/化工厂渲染索引.png -------------------------------------------------------------------------------- /assets/texture/大矿机渲染索引.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/大矿机渲染索引.png -------------------------------------------------------------------------------- /assets/sprite/I“湛曦”O型人造恒星.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I“湛曦”O型人造恒星.png -------------------------------------------------------------------------------- /assets/sprite/I四氢双环戊二烯燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I四氢双环戊二烯燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/T四氢双环戊二烯燃料棒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/T四氢双环戊二烯燃料棒.png -------------------------------------------------------------------------------- /assets/sprite/V放射晶体矿脉-80px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/V放射晶体矿脉-80px.png -------------------------------------------------------------------------------- /assets/texture/创世Logo新春贺岁版.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/texture/创世Logo新春贺岁版.png -------------------------------------------------------------------------------- /assets/sprite/I“工业先锋”精密加工中心.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I“工业先锋”精密加工中心.png -------------------------------------------------------------------------------- /assets/sprite/I“超越”X-1型光学主机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/assets/sprite/I“超越”X-1型光学主机.png -------------------------------------------------------------------------------- /lib/GalacticScale-publicized.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/lib/GalacticScale-publicized.dll -------------------------------------------------------------------------------- /lib/Assembly-CSharp-publicized.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/lib/Assembly-CSharp-publicized.dll -------------------------------------------------------------------------------- /lib/BepInEx.AssemblyPublicizer.Cli.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Awbugl/ProjectGenesis/HEAD/lib/BepInEx.AssemblyPublicizer.Cli.exe -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Utils/KvpDeconstruct.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ProjectGenesis.Utils 4 | { 5 | public static class KvpDeconstruct 6 | { 7 | public static void Deconstruct(this KeyValuePair pair, out TKey key, out TValue value) 8 | { 9 | key = pair.Key; 10 | value = pair.Value; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Compatibility/BlueprintTweaks.cs: -------------------------------------------------------------------------------- 1 | using BepInEx.Bootstrap; 2 | 3 | namespace ProjectGenesis.Compatibility 4 | { 5 | internal static class BlueprintTweaks 6 | { 7 | internal const string GUID = "org.kremnev8.plugin.BlueprintTweaks"; 8 | 9 | internal static bool Installed; 10 | 11 | internal static void Awake() => Installed = Chainloader.PluginInfos.TryGetValue(GUID, out _); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Compatibility/FastTravelEnabler.cs: -------------------------------------------------------------------------------- 1 | using BepInEx.Bootstrap; 2 | 3 | namespace ProjectGenesis.Compatibility 4 | { 5 | internal static class FastTravelEnabler 6 | { 7 | internal const string GUID = "com.hetima.dsp.FastTravelEnabler"; 8 | 9 | internal static bool Installed; 10 | 11 | internal static void Awake() => Installed = Chainloader.PluginInfos.TryGetValue(GUID, out _); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /devtools/Program.cs: -------------------------------------------------------------------------------- 1 | using static ProjectGenesis.GridMoveTool; 2 | using static ProjectGenesis.DropListTool; 3 | 4 | namespace ProjectGenesis 5 | { 6 | internal static class DevTools 7 | { 8 | internal static void Main(string[] args) 9 | { 10 | // MoveRecipeGrid(3302, 3505, 3301); 11 | // MoveItemGrid(3302, 3505, 3301); 12 | // CheckTechUnlockRecipe(); 13 | // CheckItemGrid(); 14 | // CheckRecipeGrid(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Patches/UI/UIMainMenuPatches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | // ReSharper disable InconsistentNaming 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class UIMainMenuPatches 8 | { 9 | [HarmonyPatch(typeof(UIMainMenu), nameof(UIMainMenu.UpdateDemoScene))] 10 | [HarmonyPostfix] 11 | public static void UpdateDemoScene(UIMainMenu __instance) 12 | { 13 | if (DSPGame.LoadDemoIndex != -3) return; 14 | 15 | __instance.scenesCutBlackImage.gameObject.SetActive(false); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Patches/VFPreloadPatches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | // ReSharper disable InconsistentNaming 4 | // ReSharper disable RedundantAssignment 5 | 6 | namespace ProjectGenesis.Patches 7 | { 8 | public static class VFPreloadPatches 9 | { 10 | [HarmonyPatch(typeof(VFPreload), nameof(VFPreload.IsSplashSolid))] 11 | [HarmonyPriority(Priority.VeryHigh)] 12 | [HarmonyPrefix] 13 | public static bool VFPreload_IsSplashSolid(ref bool __result) 14 | { 15 | __result = true; 16 | 17 | return false; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Utils/ERecipeType.cs: -------------------------------------------------------------------------------- 1 | namespace ProjectGenesis.Utils 2 | { 3 | public enum ERecipeType 4 | { 5 | None = 0, 6 | Smelt = 1, 7 | Chemical = 2, 8 | Refine = 3, 9 | Assemble = 4, 10 | Particle = 5, 11 | Exchange = 6, 12 | PhotonStore = 7, 13 | Fractionate = 8, 14 | 标准制造 = 9, 15 | 高精度加工 = 10, 16 | 标准冶炼 = 11, 17 | 所有制造 = 12, // 2 + 3 + 4 + 5 + 9 + 10 + 15 + 16 18 | 高热冶炼 = 13, 19 | 垃圾回收 = 14, 20 | Research = 15, 21 | 高分子化工 = 16, 22 | 所有化工 = 17, // 2 + 3 + 16 23 | 复合制造 = 18, // 4 + 9 24 | 所有熔炉 = 19, // 1 + 11 +13 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /devtools/GridMoveTool/GridPos.cs: -------------------------------------------------------------------------------- 1 | namespace ProjectGenesis 2 | { 3 | internal readonly struct Pos 4 | { 5 | public readonly int Page, Row, Column; 6 | 7 | public Pos(int gridIndex) 8 | { 9 | Page = gridIndex / 1000; 10 | Row = gridIndex / 100 % 10; 11 | Column = gridIndex % 100; 12 | } 13 | 14 | public Pos(int page, int row, int column) 15 | { 16 | Page = page; 17 | Row = row; 18 | Column = column; 19 | } 20 | 21 | public int ToGridIndex() => Page * 1000 + Row * 100 + Column; 22 | 23 | // 关键:隐式转换 24 | public static implicit operator Pos(int gridIndex) => new Pos(gridIndex); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ProjectGenesis.sln.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | ENUS 3 | LDB 4 | ZHCN 5 | True -------------------------------------------------------------------------------- /src/Utils/TranspilerLogUtils.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using ProjectGenesis.Compatibility; 3 | 4 | namespace ProjectGenesis.Utils 5 | { 6 | public static class TranspilerLogUtils 7 | { 8 | public static void LogInstructionEnumeration(this CodeMatcher matcher) 9 | { 10 | foreach (CodeInstruction codeInstruction in matcher.InstructionEnumeration()) 11 | ProjectGenesis.logger.LogInfo(codeInstruction.ToString()); 12 | } 13 | 14 | public static void LogInstructionEnumerationWhenChecking(this CodeMatcher matcher) 15 | { 16 | foreach (CodeInstruction codeInstruction in matcher.InstructionEnumeration()) 17 | InstallationCheckPlugin.logger.LogInfo(codeInstruction.ToString()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Patches/GeothermalStrengthPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class GeothermalStrengthPatches 8 | { 9 | [HarmonyPatch(typeof(PowerSystem), nameof(PowerSystem.CalculateGeothermalStrength))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable SetTargetCargoBytes_Transpiler(IEnumerable instructions) 12 | { 13 | var matcher = new CodeMatcher(instructions); 14 | 15 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_R4, 3f)); 16 | 17 | matcher.SetOperandAndAdvance(2f); 18 | 19 | return matcher.InstructionEnumeration(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /DefaultPath.props.example: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | C:\Users\littl\AppData\Roaming\r2modmanPlus-local\DysonSphereProgram\profiles\Default\BepInEx\ 6 | 7 | HiddenCirno-GenesisBook 8 | 9 | D:\SteamLibrary\steamapps\common\Dyson Sphere Program\DSPGAME_Data\Managed\ 10 | 11 | $(SolutionDir)release\ 12 | 13 | -------------------------------------------------------------------------------- /src/Patches/UI/FluidColorPatches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using ProjectGenesis.Utils; 3 | 4 | // ReSharper disable InconsistentNaming 5 | 6 | namespace ProjectGenesis.Patches 7 | { 8 | internal static class FluidColorPatches 9 | { 10 | [HarmonyPatch(typeof(UITankWindow), nameof(UITankWindow._OnUpdate))] 11 | [HarmonyPostfix] 12 | public static void UITankWindow_OnUpdate(UITankWindow __instance) 13 | { 14 | int tankId = __instance.tankId; 15 | 16 | TankComponent tankComponent = __instance.storage.tankPool[tankId]; 17 | 18 | if (tankComponent.id != tankId) return; 19 | 20 | int fluidId = tankComponent.fluidId; 21 | 22 | if (IconDescUtils.IconDescs.TryGetValue(fluidId, out IconDescUtils.ModIconDesc value)) 23 | __instance.exchangeAndColoring(value.Color); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Patches/DarkFogPowerFactorPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class DarkFogPowerFactorPatches 8 | { 9 | [HarmonyPatch(typeof(DFGBaseComponent), nameof(DFGBaseComponent.UpdateFactoryThreat))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable DFGBaseComponent_UpdateFactoryThreat_Transpiler( 12 | IEnumerable instructions) 13 | { 14 | var matcher = new CodeMatcher(instructions); 15 | 16 | matcher.End().MatchBack(false, new CodeMatch(OpCodes.Ldc_R8, 0.85)); 17 | 18 | matcher.Advance(4).InsertAndAdvance(new CodeInstruction(OpCodes.Ldc_R8, 20.0), new CodeInstruction(OpCodes.Mul)); 19 | 20 | return matcher.InstructionEnumeration(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Patches/GoalLogicPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | using ProjectGenesis.Utils; 5 | 6 | // ReSharper disable InconsistentNaming 7 | 8 | namespace ProjectGenesis.Patches 9 | { 10 | public static class GoalLogicPatches 11 | { 12 | [HarmonyPatch(typeof(GD_GroupElectromagnetism), nameof(GD_GroupElectromagnetism.OnDetermineComplete))] 13 | [HarmonyTranspiler] 14 | public static IEnumerable GD_GroupElectromagnetism_OnDetermineComplete_Transpiler( 15 | IEnumerable instructions) 16 | { 17 | var matcher = new CodeMatcher(instructions); 18 | 19 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4, 1001)); 20 | 21 | matcher.SetOperandAndAdvance(ProtoID.T高效电浆控制); 22 | 23 | return matcher.InstructionEnumeration(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Patches/PlanetFocus/DronePatches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace ProjectGenesis.Patches 4 | { 5 | public static partial class PlanetFocusPatches 6 | { 7 | [HarmonyPatch(typeof(StationComponent), nameof(StationComponent.InternalTickLocal))] 8 | [HarmonyPriority(Priority.VeryHigh)] 9 | [HarmonyPrefix] 10 | public static void StationComponent_InternalTickLocal_PreFix(PlanetFactory factory, ref float droneSpeed) 11 | { 12 | if (ContainsFocus(factory.planetId, 6530)) droneSpeed *= 1.25f; 13 | } 14 | 15 | [HarmonyPatch(typeof(DispenserComponent), nameof(DispenserComponent.InternalTick))] 16 | [HarmonyPriority(Priority.VeryHigh)] 17 | [HarmonyPrefix] 18 | public static void DispenserComponent_InternalTick_PreFix(PlanetFactory factory, ref float courierSpeed) 19 | { 20 | if (ContainsFocus(factory.planetId, 6530)) courierSpeed *= 1.25f; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Utils/DictionaryExtend.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using System.Collections.Generic; 3 | 4 | // ReSharper disable RemoveRedundantBraces 5 | 6 | namespace ProjectGenesis.Utils 7 | { 8 | internal static class DictionaryExtend 9 | { 10 | public static void TryAddOrInsert(this ConcurrentDictionary> dict, TKey key, TValue value) 11 | { 12 | if (dict.ContainsKey(key)) { dict[key].Add(value); } 13 | else { dict[key] = new List { value, }; } 14 | } 15 | 16 | public static void TryRemove(this ConcurrentDictionary> dict, TKey key, TValue value) 17 | { 18 | if (dict.ContainsKey(key)) { dict[key].Remove(value); } 19 | } 20 | 21 | public static bool Contains(this ConcurrentDictionary> dict, TKey key, TValue value) => 22 | dict.TryGetValue(key, out List list) && list.Contains(value); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /devtools/DropListTool/DropListTool.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace ProjectGenesis 4 | { 5 | internal static class DropListTool 6 | { 7 | public static void SetItemModDropList() 8 | { 9 | var items = JsonFileUtils.LoadItemsMod() 10 | .ToDictionary(i => i.ID); 11 | 12 | float cursor = 1f; 13 | for (int i = 0; i < DropConfig.ID.Count; i++) 14 | { 15 | var it = items[DropConfig.ID[i]]; 16 | it.EnemyDropMask = int.MaxValue; 17 | it.EnemyDropCount = DropConfig.Count[i]; 18 | it.EnemyDropLevel = DropConfig.Level[i]; 19 | 20 | cursor -= DropConfig.Prob[i]; 21 | it.EnemyDropRange = new[] 22 | { 23 | (int)(cursor * 100000) / 100000f, 24 | DropConfig.Prob[i], 25 | }; 26 | } 27 | 28 | JsonFileUtils.SaveItemsMod(items.Values.OrderBy(x => x.ID).ToList()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Compatibility/PlanetwideMining.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection; 3 | using BepInEx; 4 | using BepInEx.Bootstrap; 5 | using HarmonyLib; 6 | 7 | namespace ProjectGenesis.Compatibility 8 | { 9 | internal static class PlanetwideMining 10 | { 11 | internal const string GUID = "930f5bae-66d2-4917-988b-162fe2456643"; 12 | 13 | internal static void Awake() 14 | { 15 | if (!Chainloader.PluginInfos.TryGetValue(GUID, out PluginInfo pluginInfo)) return; 16 | 17 | Assembly assembly = pluginInfo.Instance.GetType().Assembly; 18 | 19 | ref List resourceTypes = 20 | ref AccessTools.StaticFieldRefAccess>(assembly.GetType("PlanetwideMining.PlanetwideMining"), 21 | "ResourceTypes"); 22 | 23 | resourceTypes.Add((EVeinType)15); 24 | resourceTypes.Add((EVeinType)16); 25 | resourceTypes.Add((EVeinType)17); 26 | resourceTypes.Add((EVeinType)18); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /data/tutorials.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ID": 31, 4 | "Name": "创世之书介绍标题", 5 | "PreText": "创世之书介绍前字", 6 | "DeterminatorName": "TOR_GameSecond", 7 | "DeterminatorParams": [ 8 | 4 9 | ] 10 | }, 11 | { 12 | "ID": 32, 13 | "Name": "物质分解设施介绍标题", 14 | "PreText": "物质分解设施介绍前字", 15 | "DeterminatorName": "TOR_OnBuild", 16 | "DeterminatorParams": [ 17 | 6264 18 | ] 19 | }, 20 | { 21 | "ID": 33, 22 | "Name": "巨型建筑介绍标题", 23 | "PreText": "巨型建筑介绍前字", 24 | "DeterminatorName": "TOR_OnBuild", 25 | "DeterminatorParams": [ 26 | 6257, 27 | 6258, 28 | 6259, 29 | 6260, 30 | 6265 31 | ] 32 | }, 33 | { 34 | "ID": 34, 35 | "Name": "行星协调中心介绍标题", 36 | "PreText": "行星协调中心介绍前字", 37 | "DeterminatorName": "TOR_TechUnlocked", 38 | "DeterminatorParams": [ 39 | 1936, 40 | 7 41 | ] 42 | }, 43 | { 44 | "ID": 35, 45 | "Name": "制造类型调整介绍标题", 46 | "PreText": "制造类型调整介绍前字", 47 | "DeterminatorName": "TOR_OnBuild", 48 | "DeterminatorParams": [ 49 | 2304 50 | ] 51 | } 52 | ] 53 | -------------------------------------------------------------------------------- /src/Patches/StationOutputPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class StationOutputPatches 8 | { 9 | [HarmonyPatch(typeof(StationComponent), nameof(StationComponent.UpdateInputSlots))] 10 | [HarmonyPatch(typeof(StationComponent), nameof(StationComponent.UpdateOutputSlots))] 11 | [HarmonyTranspiler] 12 | public static IEnumerable UpdateOutputSlots_Transpiler(IEnumerable instructions) 13 | { 14 | var matcher = new CodeMatcher(instructions); 15 | 16 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldloc_S), new CodeMatch(OpCodes.Ldc_I4_1), 17 | new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(SlotData), nameof(SlotData.counter)))); 18 | 19 | matcher.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 20 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)); 21 | 22 | return matcher.InstructionEnumeration(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Patches/MegaAssembler/UIRecipePickerPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | // ReSharper disable InconsistentNaming 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | internal static partial class MegaAssemblerPatches 10 | { 11 | [HarmonyPatch(typeof(UIRecipePicker), nameof(UIRecipePicker.RefreshIcons))] 12 | [HarmonyPriority(int.MaxValue)] 13 | [HarmonyTranspiler] 14 | public static IEnumerable UIRecipePicker_RefreshIcons(IEnumerable instructions) 15 | { 16 | var matcher = new CodeMatcher(instructions); 17 | 18 | matcher.MatchForward(true, new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(RecipeProto), nameof(RecipeProto.Type))), 19 | new CodeMatch(OpCodes.Bne_Un)); 20 | 21 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Call, 22 | AccessTools.Method(typeof(MegaAssemblerPatches), nameof(ContainsRecipeType)))); 23 | 24 | matcher.SetOpcodeAndAdvance(OpCodes.Brfalse); 25 | 26 | return matcher.InstructionEnumeration(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Patches/DisableLDBToolCachePatches.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using BepInEx; 3 | using HarmonyLib; 4 | using xiaoye97; 5 | 6 | namespace ProjectGenesis.Patches 7 | { 8 | public static class DisableLDBToolCachePatches 9 | { 10 | private static bool _finished; 11 | 12 | [HarmonyPatch(typeof(LDBTool), "Bind")] 13 | [HarmonyPriority(Priority.VeryHigh)] 14 | [HarmonyPrefix] 15 | public static bool LDBTool_Bind() => ProjectGenesis.LDBToolCacheEntry.Value; 16 | 17 | [HarmonyPatch(typeof(VFPreload), nameof(VFPreload.InvokeOnLoadWorkEnded))] 18 | [HarmonyAfter(LDBToolPlugin.MODGUID)] 19 | [HarmonyPostfix] 20 | public static void DeleteFiles() 21 | { 22 | if (_finished) return; 23 | 24 | if (!ProjectGenesis.LDBToolCacheEntry.Value) return; 25 | 26 | try 27 | { 28 | string path = Path.Combine(Paths.ConfigPath, "LDBTool"); 29 | 30 | if (Directory.Exists(path)) Directory.Delete(path, true); 31 | } 32 | catch 33 | { 34 | // ignored 35 | } 36 | 37 | _finished = true; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Compatibility/WeaponPlus.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using BepInEx; 4 | using BepInEx.Bootstrap; 5 | using HarmonyLib; 6 | using ProjectGenesis.Utils; 7 | 8 | // ReSharper disable InconsistentNaming 9 | 10 | namespace ProjectGenesis.Compatibility 11 | { 12 | internal static class WeaponPlus 13 | { 14 | internal const string GUID = "org.weaponplus.plugins.Xiaokls"; 15 | 16 | private static readonly Harmony HarmonyPatch = new Harmony("ProjectGenesis.Compatibility." + GUID); 17 | 18 | internal static void Awake() 19 | { 20 | if (!Chainloader.PluginInfos.TryGetValue(GUID, out PluginInfo pluginInfo)) return; 21 | 22 | Assembly assembly = pluginInfo.Instance.GetType().Assembly; 23 | 24 | Type type = assembly.GetType("DSP_WeaponPlus.Utils.WPAddItem"); 25 | 26 | HarmonyPatch.Patch(AccessTools.Method(type, "AddDiyItem"), new HarmonyMethod(typeof(WeaponPlus), nameof(AddDiyItem_Prefix))); 27 | } 28 | 29 | public static void AddDiyItem_Prefix(int[] inputIds) 30 | { 31 | for (var i = 0; i < inputIds.Length; i++) 32 | if (inputIds[i] == 1201) 33 | inputIds[i] = ProtoID.I铝块; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Patches/ResourcesPatches.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HarmonyLib; 3 | using ProjectGenesis.Utils; 4 | using UnityEngine; 5 | 6 | // ReSharper disable InconsistentNaming 7 | 8 | namespace ProjectGenesis.Patches 9 | { 10 | public static class ResourcesPatches 11 | { 12 | [HarmonyPatch(typeof(Resources), nameof(Resources.Load), typeof(string), typeof(Type))] 13 | [HarmonyBefore(CommonAPI.CommonAPIPlugin.GUID)] 14 | [HarmonyPrefix] 15 | public static bool GetAssemblyManifestResource(ref string path, Type systemTypeInstance, ref UnityEngine.Object __result) 16 | { 17 | const string texpackPrefix = "Assets/texpack/"; 18 | 19 | if (!path.StartsWith(texpackPrefix)) return true; 20 | 21 | string name = path.Substring(texpackPrefix.Length); 22 | 23 | if (systemTypeInstance == typeof(Texture2D)) 24 | { 25 | __result = TextureHelper.GetTexture(name); 26 | return __result == null; 27 | } 28 | 29 | if (systemTypeInstance == typeof(Sprite)) 30 | { 31 | __result = TextureHelper.GetSprite(name); 32 | return __result == null; 33 | } 34 | 35 | return true; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Patches/UI/FactoryModelPatches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using ProjectGenesis.Utils; 3 | using UnityEngine; 4 | 5 | // ReSharper disable InconsistentNaming 6 | // ReSharper disable LoopCanBeConvertedToQuery 7 | // ReSharper disable Unity.PreferAddressByIdToGraphicsParams 8 | 9 | namespace ProjectGenesis.Patches 10 | { 11 | public static class FactoryModelPatches 12 | { 13 | private static Material atmosphericCollectStationMaterial; 14 | 15 | [HarmonyPatch(typeof(FactoryModel), nameof(FactoryModel.InitMaterial))] 16 | [HarmonyPostfix] 17 | public static void FactoryModel_InitCollectorMaterial(FactoryModel __instance) 18 | { 19 | ObjectRenderer objectRenderer = __instance.gpuiManager.GetObjectRenderer(ProtoID.M大气采集器); 20 | 21 | if (objectRenderer != null) atmosphericCollectStationMaterial = objectRenderer.lodBatches[0].materials[2]; 22 | } 23 | 24 | [HarmonyPatch(typeof(FactoryModel), nameof(FactoryModel.SetCollectorEffectColor))] 25 | [HarmonyPostfix] 26 | public static void FactoryModel_SetCollectorEffectColor(FactoryModel __instance) 27 | { 28 | if (!(atmosphericCollectStationMaterial != null)) return; 29 | 30 | atmosphericCollectStationMaterial.SetColor("_TintColor", __instance.collectorEffectColor); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Patches/UI/UITechNodePatches.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HarmonyLib; 3 | using UnityEngine; 4 | 5 | // ReSharper disable InconsistentNaming 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | internal static class UITechNodePatches 10 | { 11 | [HarmonyPatch(typeof(UITechNode), nameof(UITechNode.UpdateLayoutDynamic))] 12 | [HarmonyPostfix] 13 | public static void UITechNode_UpdateLayoutDynamic(UITechNode __instance, bool forceUpdate = false, bool forceReset = false) 14 | { 15 | float num4 = Mathf.Clamp( 16 | Mathf.Max(__instance.unlockText.preferredWidth - 40f + __instance.unlockTextTrans.anchoredPosition.x, 17 | Math.Min(__instance.techProto.unlockRecipeArray.Length, 3) * 46) + __instance.baseWidth, __instance.minWidth, 18 | __instance.maxWidth); 19 | 20 | float x = __instance.focusState < 1f 21 | ? Mathf.Lerp(__instance.minWidth, num4, __instance.focusState) 22 | : Mathf.Lerp(num4, __instance.maxWidth, __instance.focusState - 1f); 23 | 24 | __instance.panelRect.sizeDelta = new Vector2(x, __instance.panelRect.sizeDelta.y); 25 | 26 | __instance.titleText.rectTransform.sizeDelta = 27 | new Vector2(x - (GameMain.history.TechState(__instance.techProto.ID).curLevel > 0 ? 65 : 25), 24f); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Patches/UI/HarmonyLogPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using BepInEx.Logging; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | internal class HarmonyLogListener : ILogListener 8 | { 9 | internal static readonly ConcurrentQueue LogData = new ConcurrentQueue(); 10 | 11 | public void LogEvent(object sender, LogEventArgs eventArgs) 12 | { 13 | var s = eventArgs.Data.ToString(); 14 | 15 | if ((eventArgs.Source.SourceName == "HarmonyX" || s.Contains("InvalidProgramException")) && eventArgs.Level == LogLevel.Error) 16 | LogData.Enqueue(s); 17 | } 18 | 19 | public void Dispose() {} 20 | } 21 | 22 | public static class HarmonyLogPatches 23 | { 24 | private static bool _finished; 25 | 26 | [HarmonyPatch(typeof(VFPreload), nameof(VFPreload.InvokeOnLoadWorkEnded))] 27 | [HarmonyPostfix] 28 | public static void InvokeOnLoadWorkEnded() 29 | { 30 | if (_finished) return; 31 | 32 | while (HarmonyLogListener.LogData.Count > 0) 33 | { 34 | UIFatalErrorTip.instance.ShowError("Harmony throws an error when patching!", 35 | HarmonyLogListener.LogData.TryDequeue(out string logData) ? logData : null); 36 | } 37 | 38 | _finished = true; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /devtools/DropListTool/DropConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ProjectGenesis 4 | { 5 | internal static class DropConfig 6 | { 7 | public static IReadOnlyList ID { get; } = new List 8 | { 9 | 7805, 7803, // 10 | 7709, // 11 | 6263, 7804, 6235, // 12 | 7705, // 13 | 6222, // 14 | 6207, 6208, 6204 // 15 | }; 16 | 17 | public static IReadOnlyList Prob { get; } = new List 18 | { 19 | 0.001f, 0.003f, // 20 | 0.002f, // 21 | 0.003f, 0.004f, 0.003f, // 22 | 0.004f, // 23 | 0.005f, // 24 | 0.006f, 0.005f, 0.005f, // 25 | }; 26 | 27 | public static IReadOnlyList Level { get; } = new List 28 | { 29 | 8, 8, // 30 | 7, // 31 | 6, 6, 6, // 32 | 5, // 33 | 4, // 34 | 3, 2, 1, // 35 | }; 36 | 37 | public static IReadOnlyList Count { get; } = new List 38 | { 39 | 0.1f, 0.1f, // 40 | 0.7f, // 41 | 0.7f, 0.7f, 0.7f, // 42 | 0.25f, 0.25f, // 43 | 0.8f, // 44 | 0.8f, // 45 | 1.4f, 1.4f, 1.4f, // 46 | }; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /devtools/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly:AssemblyTitle("ProjectGenesis.DevTools")] 8 | [assembly:AssemblyDescription("")] 9 | [assembly:AssemblyConfiguration("")] 10 | [assembly:AssemblyCompany("")] 11 | [assembly:AssemblyProduct("ProjectGenesis.DevTools")] 12 | [assembly:AssemblyCopyright("Copyright © 2025")] 13 | [assembly:AssemblyTrademark("")] 14 | [assembly:AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly:ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly:Guid("E112CE56-08CD-4F17-94E8-C3866C40AECF")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly:AssemblyVersion("1.0.0.0")] 35 | [assembly:AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /src/Patches/UI/IconSetPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | // ReSharper disable InconsistentNaming 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | public static class IconSetPatches 10 | { 11 | [HarmonyPatch(typeof(IconSet), nameof(IconSet.Create))] 12 | [HarmonyTranspiler] 13 | public static IEnumerable IconSet_Create_Transpiler(IEnumerable instructions) 14 | { 15 | var matcher = new CodeMatcher(instructions); 16 | 17 | matcher.MatchForward(false, 18 | new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(TechProto), nameof(TechProto.iconSprite)))); 19 | 20 | object label = matcher.InstructionAt(5).operand; 21 | 22 | object index_V_23 = matcher.Advance(-2).Operand; 23 | object dataArray3 = matcher.Advance(-1).Operand; 24 | 25 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Ldloc_S, dataArray3), new CodeInstruction(OpCodes.Ldloc_S, index_V_23), 26 | new CodeInstruction(OpCodes.Ldelem_Ref), 27 | new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(IconSetPatches), nameof(IconSet_Create_Patch))), 28 | new CodeInstruction(OpCodes.Brtrue_S, label)); 29 | 30 | return matcher.InstructionEnumeration(); 31 | } 32 | 33 | public static bool IconSet_Create_Patch(TechProto proto) => proto.ID < 2000; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Patches/UI/DisplayNamePatches.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using System.Reflection.Emit; 5 | using HarmonyLib; 6 | using ProjectGenesis.Utils; 7 | 8 | namespace ProjectGenesis.Patches 9 | { 10 | /// 11 | /// special thanks for 12 | /// https://github.com/hubastard/nebula/tree/master/NebulaPatcher/Patches/Transpilers/UIVersionText_Transpiler.cs 13 | /// 14 | public static class DisplayNamePatches 15 | { 16 | [HarmonyTranspiler] 17 | [HarmonyPatch(typeof(UIVersionText), nameof(UIVersionText.Refresh))] 18 | public static IEnumerable Refresh_Transpiler(IEnumerable instructions, ILGenerator generator) 19 | { 20 | CodeMatcher codeMatcher = new CodeMatcher(instructions, generator).MatchForward(true, 21 | new CodeMatch(i => i.opcode == OpCodes.Ldfld && ((FieldInfo)i.operand).Name == "userName")); 22 | 23 | if (codeMatcher.IsInvalid) 24 | 25 | // For XGP version 26 | codeMatcher.Start().MatchForward(true, 27 | new CodeMatch(i => i.opcode == OpCodes.Call && ((MethodInfo)i.operand).Name == "get_usernameAndSuffix")); 28 | 29 | return codeMatcher.Advance(1).InsertAndAdvance(Transpilers.EmitDelegate>(text => 30 | $"{ProjectGenesis.MODNAME.TranslateFromJson()} {ProjectGenesis.VERSION}{ProjectGenesis.DEBUGVERSION}\r\n{text}")) 31 | .InstructionEnumeration(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Patches/RecipeExtraPowerPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HarmonyLib; 3 | using ProjectGenesis.Utils; 4 | 5 | // ReSharper disable InconsistentNaming 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | public static class RecipeExtraPowerPatches 10 | { 11 | /// 12 | /// 1 == 300kw 13 | /// 14 | private static readonly Dictionary RecipePowerRate = new Dictionary 15 | { 16 | { ProtoID.R水电解, 4 }, 17 | { ProtoID.R盐水电解, 4 }, 18 | { ProtoID.R合成氨, 2 }, 19 | { ProtoID.R氨氧化, 2 }, 20 | { ProtoID.R有机晶体活化, 8 }, 21 | { ProtoID.R放射性矿物处理, 8 }, 22 | { ProtoID.R重氢, 18 }, 23 | { ProtoID.R三元精金, 18 }, 24 | { ProtoID.R光子物质化, 18 }, 25 | { ProtoID.R氦核转化, 4 }, 26 | { ProtoID.R质能储存高效, 8 }, 27 | { ProtoID.R能量物质化, 8 }, 28 | }; 29 | 30 | [HarmonyPatch(typeof(AssemblerComponent), nameof(AssemblerComponent.SetPCState))] 31 | [HarmonyPostfix] 32 | public static void AssemblerComponent_SetPCState_Postfix(AssemblerComponent __instance, PowerConsumerComponent[] pcPool) 33 | { 34 | if (!__instance.replicating) return; 35 | 36 | ref PowerConsumerComponent component = ref pcPool[__instance.pcId]; 37 | 38 | int num = RecipePowerRate.GetValueOrDefault(__instance.recipeId, 1); 39 | 40 | component.requiredEnergy = (__instance.speedOverride * num / 2 + component.workEnergyPerTick) 41 | * (1000 + __instance.extraPowerRatio) / 1000; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Patches/PowerGeneratorEnergyCapPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | // ReSharper disable InconsistentNaming 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | public static class PowerGeneratorEnergyCapPatches 10 | { 11 | [HarmonyPatch(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.EnergyCap_Fuel))] 12 | [HarmonyTranspiler] 13 | public static IEnumerable PowerGeneratorComponent_EnergyCap_Fuel_Transpiler( 14 | IEnumerable instructions) 15 | { 16 | var matcher = new CodeMatcher(instructions); 17 | 18 | 19 | matcher.MatchForward(false, 20 | new CodeMatch(OpCodes.Stfld, 21 | AccessTools.Field(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.capacityCurrentTick)))); 22 | matcher.Advance(1); 23 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0), 24 | new CodeInstruction(OpCodes.Call, 25 | AccessTools.Method(typeof(PowerGeneratorEnergyCapPatches), nameof(CapacityCurrentTickPatch)))); 26 | 27 | return matcher.InstructionEnumeration(); 28 | } 29 | 30 | public static void CapacityCurrentTickPatch(ref PowerGeneratorComponent component) 31 | { 32 | short curFuelId = component.curFuelId; 33 | if (curFuelId == 0) return; 34 | 35 | float reactorInc = LDB.items.Select(curFuelId).ReactorInc; 36 | if (reactorInc == 0) return; 37 | 38 | component.capacityCurrentTick += (long)(component.capacityCurrentTick * reactorInc); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Patches/SpaceMissilePatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class SpaceMissilePatches 8 | { 9 | [HarmonyPatch(typeof(DefenseSystem), nameof(DefenseSystem.UpdateOtherGlobalTargets))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable DefenseSystem_UpdateOtherGlobalTargets_Transpiler( 12 | IEnumerable instructions) 13 | { 14 | var matcher = new CodeMatcher(instructions); 15 | 16 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldloc_0), new CodeMatch(OpCodes.Ldnull)); 17 | 18 | matcher.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 19 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 20 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 21 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)); 22 | 23 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldloc_3), new CodeMatch(OpCodes.Ldloc_S), new CodeMatch(OpCodes.Ldelem_Ref)); 24 | 25 | matcher.Advance(1).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 26 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 27 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 28 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 29 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 30 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)); 31 | 32 | return matcher.InstructionEnumeration(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Utils/TextureHelper.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Reflection; 4 | using UnityEngine; 5 | 6 | namespace ProjectGenesis.Utils 7 | { 8 | internal static class TextureHelper 9 | { 10 | private static readonly Assembly Assembly = Assembly.GetExecutingAssembly(); 11 | 12 | private static readonly Dictionary Cache = new Dictionary(); 13 | 14 | internal static Texture2D GetTexture(string name, string type = "texture") 15 | { 16 | if (Cache.TryGetValue(name, out var cached)) return cached; 17 | 18 | using (var stream = Assembly.GetManifestResourceStream($"ProjectGenesis.assets.{type}.{name}.png")) 19 | { 20 | if (stream == null) 21 | { 22 | ProjectGenesis.LogInfo($"Could not find texture for {name}"); 23 | return null; 24 | } 25 | 26 | using (var memoryStream = new MemoryStream()) 27 | { 28 | stream.CopyTo(memoryStream); 29 | var bytes = memoryStream.ToArray(); 30 | 31 | var texture = new Texture2D(2, 2); 32 | if (!texture.LoadImage(bytes)) return null; 33 | 34 | texture.name = name; 35 | Cache[name] = texture; 36 | return texture; 37 | } 38 | } 39 | } 40 | 41 | internal static Sprite GetSprite(string name, int? width = null, int? height = null) 42 | { 43 | if (!Cache.TryGetValue(name, out var texture)) texture = GetTexture(name, "sprite"); 44 | 45 | return texture == null 46 | ? null 47 | : Sprite.Create(texture, new Rect(0, 0, width ?? texture.width, height ?? texture.height), new Vector2(0.5f, 0.5f)); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Patches/PlanetFocus/UIPlanetDetailExpand.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using ProjectGenesis.Utils; 3 | 4 | // ReSharper disable InconsistentNaming 5 | 6 | namespace ProjectGenesis.Patches 7 | { 8 | public static class UIPlanetDetailExpand 9 | { 10 | private static UIButton _planetFocusBtn; 11 | 12 | [HarmonyPatch(typeof(UIGame), nameof(UIGame._OnInit))] 13 | [HarmonyPostfix] 14 | public static void Init(UIGame __instance) 15 | { 16 | if (_planetFocusBtn) return; 17 | 18 | ProjectGenesis.PlanetFocusWindow = UIPlanetFocusWindow.CreateWindow(); 19 | 20 | _planetFocusBtn = UIUtil.CreateButton("星球基地".TranslateFromJson()); 21 | UIUtil.NormalizeRectWithTopLeft(_planetFocusBtn, 5, -40, __instance.planetDetail.rectTrans); 22 | _planetFocusBtn.onClick += _ => ProjectGenesis.PlanetFocusWindow.OpenWindow(); 23 | } 24 | 25 | [HarmonyPatch(typeof(UIPlanetDetail), nameof(UIPlanetDetail.OnPlanetDataSet))] 26 | [HarmonyPostfix] 27 | public static void OnPlanetDataSet_Postfix(UIPlanetDetail __instance) 28 | { 29 | if (__instance.planet == null) 30 | { 31 | ProjectGenesis.PlanetFocusWindow._Close(); 32 | 33 | return; 34 | } 35 | 36 | bool notgas = __instance.planet.type != EPlanetType.Gas && GameMain.history.TechUnlocked(ProtoID.T行星协调中心); 37 | 38 | if (_planetFocusBtn) _planetFocusBtn.gameObject.SetActive(notgas); 39 | 40 | if (notgas) 41 | { 42 | ProjectGenesis.PlanetFocusWindow.nameText.text = __instance.planet.displayName + " - " + "星球倾向".TranslateFromJson(); 43 | 44 | if (UIPlanetFocusWindow.CurPlanetId != __instance.planet.id) 45 | { 46 | UIPlanetFocusWindow.CurPlanetId = __instance.planet.id; 47 | ProjectGenesis.PlanetFocusWindow.OnPlanetChanged(UIPlanetFocusWindow.CurPlanetId); 48 | } 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Patches/AbnormalityLogicPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HarmonyLib; 3 | 4 | // ReSharper disable InconsistentNaming 5 | // ReSharper disable RedundantAssignment 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | public static class AbnormalityLogicPatches 10 | { 11 | [HarmonyPatch(typeof(UIAbnormalityTip), nameof(UIAbnormalityTip._OnInit))] 12 | [HarmonyPostfix] 13 | public static void UIAbnormalityTip_OnInit(UIAbnormalityTip __instance, ref bool ___isWarned, ref bool ___willClose, 14 | ref float ___closeDelayTime) 15 | { 16 | ___isWarned = true; 17 | ___willClose = true; 18 | __instance.mainTweener.Play1To0Continuing(); 19 | ___closeDelayTime = 3f; 20 | } 21 | 22 | [HarmonyPatch(typeof(AbnormalityLogic), nameof(AbnormalityLogic.GameTick))] 23 | [HarmonyPatch(typeof(AbnormalityLogic), nameof(AbnormalityLogic.InitDeterminators))] 24 | [HarmonyPatch(typeof(MilkyWayWebClient), nameof(MilkyWayWebClient.SendUploadLoginRequest))] 25 | [HarmonyPatch(typeof(MilkyWayWebClient), nameof(MilkyWayWebClient.SendUploadRecordRequest))] 26 | [HarmonyPatch(typeof(AchievementSystem), nameof(AchievementSystem.SyncAchievementsToPlatform))] 27 | [HarmonyPatch(typeof(AchievementSystem), nameof(AchievementSystem.UnlockPlatformAchievement))] 28 | [HarmonyPatch(typeof(AchievementSystem), nameof(AchievementSystem.SetPlatformAchievementProgress))] 29 | [HarmonyPatch(typeof(STEAMX), nameof(STEAMX.UploadScoreToLeaderboard))] 30 | [HarmonyPrefix] 31 | [HarmonyPriority(Priority.VeryHigh)] 32 | public static bool Skip() => false; 33 | 34 | [HarmonyPatch(typeof(AbnormalityLogic), nameof(AbnormalityLogic.InitDeterminators))] 35 | [HarmonyPostfix] 36 | [HarmonyPriority(Priority.VeryHigh)] 37 | public static void InitDeterminators(AbnormalityLogic __instance) 38 | { 39 | if (__instance.determinators == null) __instance.determinators = new Dictionary(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ProjectGenesis.csproj.DotSettings: -------------------------------------------------------------------------------- 1 | 2 | True 3 | True 4 | True 5 | True 6 | True 7 | True 8 | True 9 | True 10 | True 11 | True 12 | True 13 | True 14 | -------------------------------------------------------------------------------- /src/Patches/UI/UIMonitorPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | // ReSharper disable InconsistentNaming 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | public static class UIMonitorPatches 10 | { 11 | [HarmonyPatch(typeof(UIMonitorWindow), nameof(UIMonitorWindow._OnInit))] 12 | [HarmonyPostfix] 13 | public static void UIMonitorWindow__OnInit(UIMonitorWindow __instance) => __instance.cargoFlowSlider.maxValue = 600; 14 | 15 | [HarmonyPatch(typeof(MonitorComponent), nameof(MonitorComponent.SetTargetCargoBytes))] 16 | [HarmonyTranspiler] 17 | public static IEnumerable SetTargetCargoBytes_Transpiler(IEnumerable instructions) 18 | { 19 | var matcher = new CodeMatcher(instructions); 20 | 21 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4, 72000)); 22 | matcher.SetOperandAndAdvance(144000); 23 | 24 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4, 72000)); 25 | matcher.SetOperandAndAdvance(144000); 26 | 27 | return matcher.InstructionEnumeration(); 28 | } 29 | 30 | [HarmonyPatch(typeof(UIMonitorWindow), nameof(UIMonitorWindow.OnPeriodValueChange))] 31 | [HarmonyPatch(typeof(UIMonitorWindow), nameof(UIMonitorWindow.RefreshMonitorWindow))] 32 | [HarmonyPatch(typeof(UIMonitorWindow), nameof(UIMonitorWindow.OnCargoFlowValueChange))] 33 | [HarmonyPatch(typeof(UIMonitorWindow), nameof(UIMonitorWindow.OnCargoFlowInputFieldChange))] 34 | [HarmonyPatch(typeof(UIMonitorWindow), nameof(UIMonitorWindow.OnCargoFlowInputFieldEndEdit))] 35 | [HarmonyTranspiler] 36 | public static IEnumerable OnCargoFlow_Transpiler(IEnumerable instructions) 37 | { 38 | var matcher = new CodeMatcher(instructions); 39 | 40 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_R4, 120f)); 41 | matcher.SetOperandAndAdvance(240f); 42 | 43 | return matcher.InstructionEnumeration(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Patches/InserterComponentPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class InserterComponentPatches 8 | { 9 | [HarmonyPatch(typeof(ItemProto), nameof(ItemProto.GetPropValue))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable ItemProto_GetPropValue_Transpiler(IEnumerable instructions) 12 | { 13 | var matcher = new CodeMatcher(instructions); 14 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldstr, "120")); 15 | matcher.SetOperandAndAdvance("240"); 16 | 17 | return matcher.InstructionEnumeration(); 18 | } 19 | 20 | [HarmonyPatch(typeof(UIInserterWindow), nameof(UIInserterWindow._OnUpdate))] 21 | [HarmonyTranspiler] 22 | public static IEnumerable UIInserterWindow__OnUpdate_Transpiler(IEnumerable instructions) 23 | { 24 | var matcher = new CodeMatcher(instructions); 25 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldstr, "120")); 26 | matcher.SetOperandAndAdvance("240"); 27 | 28 | return matcher.InstructionEnumeration(); 29 | } 30 | 31 | [HarmonyPatch(typeof(InserterComponent), nameof(InserterComponent.InternalUpdate_Bidirectional))] 32 | [HarmonyTranspiler] 33 | public static IEnumerable InserterComponent_InternalUpdate_Bidirectional_Transpiler( 34 | IEnumerable instructions) 35 | { 36 | var matcher = new CodeMatcher(instructions); 37 | 38 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4_1), new CodeMatch(OpCodes.Stloc_3)); 39 | matcher.SetOpcodeAndAdvance(OpCodes.Ldc_I4_3); 40 | 41 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4_1), new CodeMatch(OpCodes.Stloc_3)); 42 | matcher.SetOpcodeAndAdvance(OpCodes.Ldc_I4_3); 43 | 44 | return matcher.InstructionEnumeration(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Patches/PlanetFocus/InternalFunctions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | 4 | namespace ProjectGenesis.Patches 5 | { 6 | public static partial class PlanetFocusPatches 7 | { 8 | internal static void Export(BinaryWriter w) 9 | { 10 | lock (PlanetFocuses) 11 | { 12 | w.Write(PlanetFocuses.Count); 13 | 14 | foreach (KeyValuePair pair in PlanetFocuses) 15 | { 16 | w.Write(pair.Key); 17 | w.Write(pair.Value.Length); 18 | 19 | foreach (int t in pair.Value) w.Write(t); 20 | } 21 | } 22 | } 23 | 24 | internal static void Import(BinaryReader r) 25 | { 26 | ReInitAll(); 27 | 28 | try 29 | { 30 | int slotdatacount = r.ReadInt32(); 31 | 32 | for (var j = 0; j < slotdatacount; j++) 33 | { 34 | int key = r.ReadInt32(); 35 | int length = r.ReadInt32(); 36 | var datas = new int[length]; 37 | 38 | for (var i = 0; i < length; i++) datas[i] = r.ReadInt32(); 39 | 40 | PlanetFocuses.TryAdd(key, datas); 41 | } 42 | } 43 | catch (EndOfStreamException) 44 | { 45 | // ignored 46 | } 47 | } 48 | 49 | internal static void IntoOtherSave() => ReInitAll(); 50 | 51 | private static void ReInitAll() => PlanetFocuses.Clear(); 52 | 53 | private static bool ContainsFocus(int planetId, int focusId) 54 | { 55 | if (!PlanetFocuses.TryGetValue(planetId, out int[] focuses)) return false; 56 | 57 | // ReSharper disable once LoopCanBeConvertedToQuery 58 | // ReSharper disable once ForCanBeConvertedToForeach 59 | for (var index = 0; index < focuses.Length; ++index) 60 | { 61 | if (focuses[index] == focusId) return true; 62 | } 63 | 64 | return false; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Patches/UI/UpdateLogoPatches.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HarmonyLib; 3 | using ProjectGenesis.Utils; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | 7 | // ReSharper disable InconsistentNaming 8 | 9 | namespace ProjectGenesis.Patches 10 | { 11 | public static class UpdateLogoPatches 12 | { 13 | [HarmonyPatch(typeof(UIMainMenu), nameof(UIMainMenu._OnOpen))] 14 | [HarmonyPostfix] 15 | public static void UIMainMenu_OnOpen() => UpdateLogo(); 16 | 17 | [HarmonyPatch(typeof(UIEscMenu), nameof(UIEscMenu._OnOpen))] 18 | [HarmonyPostfix] 19 | public static void UIEscMenu_OnOpen() => UpdateLogo(); 20 | 21 | [HarmonyPatch(typeof(UIOptionWindow), nameof(UIOptionWindow.OnApplyClick))] 22 | [HarmonyPatch(typeof(UIOptionWindow), nameof(UIOptionWindow.OnCancelClick))] 23 | [HarmonyPostfix] 24 | public static void UpdateGameOption_Apply() => UpdateLogo(); 25 | 26 | private static void UpdateLogo() 27 | { 28 | var mainLogo = GameObject.Find("UI Root/Overlay Canvas/Main Menu/dsp-logo"); 29 | var escLogo = GameObject.Find("UI Root/Overlay Canvas/In Game/Esc Menu/logo"); 30 | 31 | string iconstr; 32 | 33 | if (Localization.isZHCN) 34 | { 35 | iconstr = "黑雾中文图标"; 36 | 37 | DateTime dateTime = DateTime.Now; 38 | 39 | if (dateTime > new DateTime(2024, 2, 9) && dateTime < new DateTime(2024, 2, 25)) iconstr = "创世Logo新春贺岁版"; 40 | } 41 | else { iconstr = "黑雾英文图标"; } 42 | 43 | Texture2D texture = TextureHelper.GetTexture(iconstr); 44 | mainLogo.GetComponent().texture = texture; 45 | escLogo.GetComponent().texture = texture; 46 | mainLogo.GetComponent().sizeDelta = new Vector2(600f, 250f); 47 | mainLogo.GetComponent().anchoredPosition = new Vector2(120, -60); 48 | escLogo.GetComponent().sizeDelta = new Vector2(600f, 250f); 49 | escLogo.GetComponent().anchoredPosition = new Vector2(30, 300); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Patches/GasPowerPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | using ProjectGenesis.Utils; 5 | using UnityEngine; 6 | using UnityEngine.UI; 7 | 8 | // ReSharper disable InconsistentNaming 9 | 10 | namespace ProjectGenesis.Patches 11 | { 12 | public static class GasPowerPatches 13 | { 14 | [HarmonyTranspiler] 15 | [HarmonyPatch(typeof(PlayerAction_Mine), nameof(PlayerAction_Mine.GameTick))] 16 | public static IEnumerable PlayerAction_Mine_GameTick_Transpiler(IEnumerable instructions) 17 | { 18 | var matcher = new CodeMatcher(instructions); 19 | 20 | matcher.MatchForward(false, 21 | new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(PlayerAction_Mine), nameof(PlayerAction_Mine.autoExtractGas)))); 22 | 23 | matcher.SetAndAdvance(OpCodes.Call, AccessTools.Method(typeof(GasPowerPatches), nameof(GasPowerGen_Patch))); 24 | 25 | matcher.SetOpcodeAndAdvance(OpCodes.Br); 26 | 27 | return matcher.InstructionEnumeration(); 28 | } 29 | 30 | public static void GasPowerGen_Patch(PlayerAction_Mine playerAction) 31 | { 32 | if (!playerAction.autoExtractGas) return; 33 | 34 | playerAction.extractGasProgress[0] = 1; 35 | 36 | Mecha mecha = playerAction.player.mecha; 37 | 38 | double change = mecha.corePowerGen / 4; 39 | 40 | mecha.coreEnergy += change; 41 | 42 | if (mecha.coreEnergy > mecha.coreEnergyCap) mecha.coreEnergy = mecha.coreEnergyCap; 43 | 44 | mecha.MarkEnergyChange(2, change); 45 | } 46 | 47 | [HarmonyPatch(typeof(UIFunctionPanel), nameof(UIFunctionPanel._OnCreate))] 48 | [HarmonyPostfix] 49 | public static void UIFunctionPanel_OnCreate(UIFunctionPanel __instance) 50 | { 51 | Transform child = __instance.extractButton.transform.GetChild(3); 52 | 53 | Object.DestroyImmediate(child.GetComponent()); 54 | Text component = child.GetComponent(); 55 | component.text = "磁流体发电".TranslateFromJson(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /devtools/GridMoveTool/GridMoveTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace ProjectGenesis 6 | { 7 | internal static class GridMoveTool 8 | { 9 | public static void MoveRecipeGrid(Pos pos1, Pos pos2, Pos newPos) => 10 | MoveGrid(JsonFileUtils.LoadRecipes(), JsonFileUtils.SaveRecipes, pos1, pos2, newPos, r => r.GridIndex, 11 | (r, v) => r.GridIndex = v); 12 | 13 | public static void MoveItemGrid(Pos pos1, Pos pos2, Pos newPos) 14 | { 15 | MoveGrid(JsonFileUtils.LoadItemsVanilla(), JsonFileUtils.SaveItemsVanilla, pos1, pos2, newPos, i => i.GridIndex, 16 | (i, v) => i.GridIndex = v); 17 | 18 | MoveGrid(JsonFileUtils.LoadItemsMod(), JsonFileUtils.SaveItemsMod, pos1, pos2, newPos, i => i.GridIndex, 19 | (i, v) => i.GridIndex = v); 20 | } 21 | 22 | private static void MoveGrid(List data, Action> save, Pos pos1, Pos pos2, Pos newPos, Func getGrid, 23 | Action setGrid) 24 | { 25 | if (!GridUtil.ValidateRect(pos1, pos2)) return; 26 | 27 | save(GridUtil.MoveInRect(data, pos1, pos2, newPos, getGrid, setGrid)); 28 | } 29 | 30 | internal static void CheckRecipeGrid() => 31 | GridUtil.CheckGrids(JsonFileUtils.LoadRecipes(), r => r.GridIndex, r => r.ID, 5, 7, 17, "CheckRecipeGrid"); 32 | 33 | internal static void CheckItemGrid() 34 | { 35 | var items = JsonFileUtils.LoadItemsVanilla(); 36 | items.AddRange(JsonFileUtils.LoadItemsMod()); 37 | GridUtil.CheckGrids(items, i => i.GridIndex, i => i.ID, 5, 7, 17, "CheckItemGrid"); 38 | } 39 | 40 | internal static void CheckTechUnlockRecipe() 41 | { 42 | var teches = JsonFileUtils.LoadTechs(); 43 | var recipeDict = JsonFileUtils.LoadRecipes().ToDictionary(r => r.ID); 44 | foreach (var tech in teches) 45 | foreach (int id in tech.UnlockRecipes.Where(id => !recipeDict.ContainsKey(id))) 46 | Console.WriteLine($"CheckTechUnlockRecipe invalid recipe:{id} tech:{tech.ID}"); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Patches/UI/UIPowerGeneratorWindowPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | using ProjectGenesis.Utils; 5 | using UnityEngine; 6 | 7 | // ReSharper disable Unity.UnknownResource 8 | 9 | namespace ProjectGenesis.Patches 10 | { 11 | public static class UIPowerGeneratorWindowPatches 12 | { 13 | [HarmonyPatch(typeof(UIPowerGeneratorWindow), nameof(UIPowerGeneratorWindow._OnUpdate))] 14 | [HarmonyTranspiler] 15 | public static IEnumerable SetTargetCargoBytes_Transpiler(IEnumerable instructions) 16 | { 17 | var matcher = new CodeMatcher(instructions); 18 | 19 | matcher.End().MatchBack(false, new CodeMatch(OpCodes.Ldarg_0), new CodeMatch(OpCodes.Call), new CodeMatch(OpCodes.Ret)); 20 | matcher.Advance(1).SetOperandAndAdvance(AccessTools.Method(typeof(UIPowerGeneratorWindowPatches), nameof(OnUpdate_Patch))); 21 | 22 | return matcher.InstructionEnumeration(); 23 | } 24 | 25 | public static void OnUpdate_Patch(UIPowerGeneratorWindow window) 26 | { 27 | window.group0.gameObject.SetActive(true); 28 | window.group1.gameObject.SetActive(false); 29 | window.group2.gameObject.SetActive(false); 30 | 31 | if (!window.powerNetworkDesc.active) window.powerNetworkDesc._Open(); 32 | 33 | window.group4_gammainfo.gameObject.SetActive(false); 34 | window.group5_product.gameObject.SetActive(false); 35 | window.group6_elec.gameObject.SetActive(true); 36 | Vector2 anchoredPosition = window.speedGroup.anchoredPosition; 37 | anchoredPosition = new Vector2(0.0f, anchoredPosition.y); 38 | window.speedGroup.anchoredPosition = anchoredPosition; 39 | window.elecGroup.anchoredPosition = new Vector2(-80f, anchoredPosition.y); 40 | window.needInventory = false; 41 | window.fuelIcon0.sprite = TextureHelper.GetSprite("O原子能"); 42 | window.fuelText0.text = "裂变能".TranslateFromJson(); 43 | window.fuelText0.color = window.powerColor0; 44 | window.fuelCircle0.fillAmount = 1f; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Patches/AddVein/AddEffectEmitterProto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using UnityEngine; 5 | using Object = UnityEngine.Object; 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | public static partial class AddVeinPatches 10 | { 11 | private static readonly Dictionary Map = new Dictionary(); 12 | 13 | private static ParticleSystem NewParticleSystem() 14 | { 15 | EffectEmitterProto effectEmitterProto = LDB.effectEmitters.Select(21); 16 | 17 | return Object.Instantiate(Resources.Load(effectEmitterProto.PrefabPath)); 18 | } 19 | 20 | internal static void AddEffectEmitterProto() 21 | { 22 | Map.Add(35, new Color(0.685f, 0.792f, 0.000f)); 23 | Map.Add(36, new Color(0.965f, 0.867f, 0.352f)); 24 | Map.Add(37, new Color(0.941f, 0.941f, 0.941f)); 25 | Map.Add(38, new Color(0.745f, 0.231f, 0.110f)); 26 | 27 | AddEffectEmitterProto(Map); 28 | } 29 | 30 | internal static void SetEffectEmitterProto() 31 | { 32 | foreach (KeyValuePair pair in Map) 33 | { 34 | ref ParticleSystem system = ref LDB.effectEmitters.Select(pair.Key).emitter; 35 | system = NewParticleSystem(); 36 | ParticleSystem.MainModule systemMain = system.main; 37 | systemMain.startColor = pair.Value; 38 | } 39 | } 40 | 41 | private static void AddEffectEmitterProto(Dictionary protos) 42 | { 43 | EffectEmitterProtoSet effectEmitters = LDB.effectEmitters; 44 | 45 | int dataArrayLength = effectEmitters.dataArray.Length; 46 | 47 | EffectEmitterProto[] proto = protos.Select(p => new EffectEmitterProto 48 | { 49 | ID = p.Key, Name = "vein-break-" + p.Key, 50 | }).ToArray(); 51 | 52 | Array.Resize(ref effectEmitters.dataArray, dataArrayLength + proto.Length); 53 | 54 | for (var index = 0; index < proto.Length; ++index) effectEmitters.dataArray[dataArrayLength + index] = proto[index]; 55 | 56 | effectEmitters.OnAfterDeserialize(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Patches/GammaGeneratorPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class GammaGeneratorPatches 8 | { 9 | [HarmonyPatch(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.GameTick_Gamma))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable PowerGeneratorComponent_GameTick_Gamma_Transpiler( 12 | IEnumerable instructions) 13 | { 14 | var matcher = new CodeMatcher(instructions); 15 | 16 | matcher.MatchForward(false, 17 | new CodeMatch(OpCodes.Ldfld, 18 | AccessTools.Field(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.catalystPoint))), 19 | new CodeMatch(OpCodes.Ldc_I4_1), new CodeMatch(OpCodes.Sub)); 20 | 21 | // catalystPoint cost * 10 22 | matcher.Advance(1).SetAndAdvance(OpCodes.Ldc_I4_S, (sbyte)10); 23 | 24 | matcher.MatchForward(false, 25 | new CodeMatch(OpCodes.Ldfld, 26 | AccessTools.Field(typeof(PowerGeneratorComponent), nameof(PowerGeneratorComponent.catalystIncPoint))), 27 | new CodeMatch(OpCodes.Ldloc_2), new CodeMatch(OpCodes.Sub)); 28 | 29 | // catalystIncPoint cost * 10 30 | matcher.Advance(2).InsertAndAdvance(new CodeInstruction(OpCodes.Ldc_I4_S, (sbyte)10), new CodeInstruction(OpCodes.Mul)); 31 | 32 | return matcher.InstructionEnumeration(); 33 | } 34 | 35 | [HarmonyPatch(typeof(UIPowerGeneratorWindow), nameof(UIPowerGeneratorWindow._OnUpdate))] 36 | [HarmonyTranspiler] 37 | public static IEnumerable UIPowerGeneratorWindow_OnUpdate_Transpiler(IEnumerable instructions) 38 | { 39 | var matcher = new CodeMatcher(instructions); 40 | 41 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldstr, "0.100 / min")); 42 | matcher.SetOperandAndAdvance("1 / min"); 43 | 44 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldstr, "0.100 / min")); 45 | matcher.SetOperandAndAdvance("1 / min"); 46 | 47 | return matcher.InstructionEnumeration(); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Patches/TankComponentPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | internal static class TankComponentPatches 8 | { 9 | [HarmonyPatch(typeof(TankComponent), nameof(TankComponent.GameTick))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable TankComponent_GameTick_Transpiler(IEnumerable instructions, 12 | ILGenerator ilGenerator) 13 | { 14 | var matcher = new CodeMatcher(instructions, ilGenerator); 15 | 16 | LocalBuilder local = ilGenerator.DeclareLocal(typeof(int)); 17 | local.SetLocalSymInfo("currentOutputStack"); 18 | 19 | matcher.MatchForward(false, 20 | new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(CargoTraffic), nameof(CargoTraffic.TryInsertItemAtHead)))); 21 | 22 | do 23 | { 24 | matcher.Advance(-19).InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0), 25 | new CodeInstruction(OpCodes.Call, 26 | AccessTools.Method(typeof(TankComponentPatches), nameof(TankComponent_GameTick_Insert_Method))), 27 | new CodeInstruction(OpCodes.Stloc_S, local.LocalIndex)); 28 | 29 | matcher.Advance(5).InsertAndAdvance(new CodeInstruction(OpCodes.Ldloc_S, local.LocalIndex), 30 | new CodeInstruction(OpCodes.Mul)); 31 | 32 | matcher.Advance(11).SetInstruction(new CodeInstruction(OpCodes.Ldloc_S, local.LocalIndex)); 33 | 34 | matcher.Advance(8).SetInstruction(new CodeInstruction(OpCodes.Ldloc_S, local.LocalIndex)); 35 | 36 | matcher.MatchForward(false, 37 | new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(CargoTraffic), nameof(CargoTraffic.TryInsertItemAtHead)))); 38 | } 39 | while (matcher.IsValid); 40 | 41 | return matcher.InstructionEnumeration(); 42 | } 43 | 44 | public static int TankComponent_GameTick_Insert_Method(ref TankComponent component) 45 | { 46 | int componentFluidCount = component.fluidCount; 47 | int historyStationPilerLevel = GameMain.history.stationPilerLevel; 48 | 49 | return componentFluidCount < historyStationPilerLevel ? componentFluidCount : historyStationPilerLevel; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Utils/TranslateUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using CommonAPI.Systems.ModLocalization; 4 | using UnityEngine; 5 | using static ProjectGenesis.Utils.JsonHelper; 6 | 7 | namespace ProjectGenesis.Utils 8 | { 9 | internal static class TranslateUtils 10 | { 11 | private static readonly Dictionary StringProtoJsons, StringModProtoJsons; 12 | 13 | private static readonly bool IsSystemZHCN; 14 | 15 | static TranslateUtils() 16 | { 17 | StringProtoJsons = GetJsonContent("strings").ToDictionary(i => i.Name); 18 | StringModProtoJsons = GetJsonContent("strings_mod").ToDictionary(i => i.Name); 19 | 20 | int num = PlayerPrefs.GetInt("language", 0); 21 | 22 | if (num > 2) 23 | { 24 | IsSystemZHCN = num == 2052; 25 | 26 | return; 27 | } 28 | 29 | switch (Application.systemLanguage) 30 | { 31 | case SystemLanguage.Chinese: 32 | case SystemLanguage.ChineseSimplified: 33 | case SystemLanguage.ChineseTraditional: 34 | IsSystemZHCN = true; 35 | 36 | break; 37 | } 38 | } 39 | 40 | internal static void RegisterStrings() 41 | { 42 | foreach ((string key, StringProtoJson value) in StringProtoJsons) 43 | LocalizationModule.RegisterTranslation(key, value.ENUS, value.ZHCN, ""); 44 | } 45 | 46 | public static string TranslateFromJsonSpecial(this string s) 47 | { 48 | if (string.IsNullOrWhiteSpace(s)) return ""; 49 | 50 | if (!StringModProtoJsons.TryGetValue(s, out StringProtoJson stringProtoJson) 51 | && !StringProtoJsons.TryGetValue(s, out stringProtoJson)) 52 | return s; 53 | 54 | return IsSystemZHCN ? stringProtoJson.ZHCN : stringProtoJson.ENUS; 55 | } 56 | 57 | public static string TranslateFromJson(this string s) 58 | { 59 | if (string.IsNullOrWhiteSpace(s)) return ""; 60 | 61 | if (!StringModProtoJsons.TryGetValue(s, out StringProtoJson stringProtoJson) 62 | && !StringProtoJsons.TryGetValue(s, out stringProtoJson)) 63 | return s; 64 | 65 | return Localization.isZHCN ? stringProtoJson.ZHCN : stringProtoJson.ENUS; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Patches/PlanetFocus/FactoryPowerPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using System.Collections.Generic; 3 | using System.Reflection.Emit; 4 | using HarmonyLib; 5 | 6 | namespace ProjectGenesis.Patches 7 | { 8 | public static partial class PlanetFocusPatches 9 | { 10 | private static readonly ConcurrentDictionary ModelPowerCosts = new ConcurrentDictionary(); 11 | 12 | [HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.GameTickBeforePower))] 13 | [HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.ParallelGameTickBeforePower))] 14 | [HarmonyTranspiler] 15 | public static IEnumerable FactorySystem_GameTickBeforePower_Transpiler(IEnumerable instructions) 16 | { 17 | var matcher = new CodeMatcher(instructions); 18 | matcher.MatchForward(false, 19 | new CodeMatch(OpCodes.Call, AccessTools.Method(typeof(AssemblerComponent), nameof(AssemblerComponent.SetPCState)))); 20 | matcher.MatchBack(false, new CodeMatch(OpCodes.Ldarg_0), new CodeMatch(OpCodes.Ldfld)); 21 | matcher.InsertAndAdvance(matcher.InstructionsWithOffsets(0, 4)); 22 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0)); 23 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Ldfld, 24 | AccessTools.Field(typeof(FactorySystem), nameof(FactorySystem.factory)))); 25 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Call, 26 | AccessTools.Method(typeof(PlanetFocusPatches), nameof(GetWorkEnergyPerTick)))); 27 | 28 | return matcher.InstructionEnumeration(); 29 | } 30 | 31 | public static void GetWorkEnergyPerTick(ref AssemblerComponent assembler, PowerConsumerComponent[] pcPool, PlanetFactory factory) 32 | { 33 | short modelIndex = factory.entityPool[assembler.entityId].modelIndex; 34 | 35 | if (!ModelPowerCosts.TryGetValue(modelIndex, out long workEnergyPerTick)) 36 | { 37 | workEnergyPerTick = LDB.models.Select(modelIndex).prefabDesc.workEnergyPerTick; 38 | ModelPowerCosts.TryAdd(modelIndex, workEnergyPerTick); 39 | } 40 | 41 | if (ContainsFocus(factory.planetId, 6522)) workEnergyPerTick = (long)(workEnergyPerTick * 0.9f); 42 | 43 | pcPool[assembler.pcId].workEnergyPerTick = workEnergyPerTick; 44 | 45 | return; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Patches/AddVein/SwapShaderPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HarmonyLib; 3 | using UnityEngine; 4 | 5 | // ReSharper disable LoopCanBePartlyConvertedToQuery 6 | 7 | namespace ProjectGenesis.Patches 8 | { 9 | public static class SwapShaderPatches 10 | { 11 | private static readonly Dictionary ReplaceShaderMap = new Dictionary(); 12 | 13 | [HarmonyPatch(typeof(VFPreload), nameof(VFPreload.SaveMaterial))] 14 | [HarmonyPriority(Priority.VeryHigh)] 15 | [HarmonyPrefix] 16 | public static bool VFPreload_SaveMaterial_Prefix(Material mat) 17 | { 18 | if (mat == null) return false; 19 | 20 | ReplaceShaderIfAvailable(mat); 21 | 22 | return true; 23 | } 24 | 25 | [HarmonyPatch(typeof(VFPreload), nameof(VFPreload.SaveMaterials), typeof(Material[]))] 26 | [HarmonyPriority(Priority.VeryHigh)] 27 | [HarmonyPrefix] 28 | public static bool VFPreload_SaveMaterials_Prefix(Material[] mats) 29 | { 30 | if (mats == null) return false; 31 | 32 | foreach (Material mat in mats) 33 | { 34 | if (mat == null) continue; 35 | 36 | ReplaceShaderIfAvailable(mat); 37 | } 38 | 39 | return true; 40 | } 41 | 42 | [HarmonyPatch(typeof(VFPreload), nameof(VFPreload.SaveMaterials), typeof(Material[][]))] 43 | [HarmonyPriority(Priority.VeryHigh)] 44 | [HarmonyPrefix] 45 | public static bool VFPreload_SaveMaterials_Prefix(Material[][] mats) 46 | { 47 | if (mats == null) return false; 48 | 49 | foreach (Material[] matarray in mats) 50 | { 51 | if (matarray == null) continue; 52 | 53 | foreach (Material mat in matarray) 54 | { 55 | if (mat == null) continue; 56 | 57 | ReplaceShaderIfAvailable(mat); 58 | } 59 | } 60 | 61 | return true; 62 | } 63 | 64 | internal static void AddSwapShaderMapping(string oriShaderName, Shader replacementShader) => 65 | ReplaceShaderMap.Add(oriShaderName, replacementShader); 66 | 67 | private static void ReplaceShaderIfAvailable(Material mat) 68 | { 69 | string oriShaderName = mat.shader.name; 70 | 71 | if (ReplaceShaderMap.TryGetValue(oriShaderName, out Shader replacementShader)) mat.shader = replacementShader; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/Patches/EjectorPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class EjectorPatches 8 | { 9 | [HarmonyPatch(typeof(EjectorComponent), nameof(EjectorComponent.InternalUpdate))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable EjectorComponent_InternalUpdate_Transpiler(IEnumerable instructions, 12 | ILGenerator ilGenerator) 13 | { 14 | var matcher = new CodeMatcher(instructions, ilGenerator); 15 | 16 | matcher.MatchForward(true, 17 | new CodeMatch(OpCodes.Callvirt, AccessTools.Method(typeof(DysonSwarm), nameof(DysonSwarm.AddBullet)))); 18 | 19 | matcher.Advance(-1).InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_S, (sbyte)6)) 20 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Call, 21 | AccessTools.Method(typeof(EjectorPatches), nameof(Ejector_PatchMethod)))) 22 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)); 23 | 24 | CodeMatcher matcher2 = matcher.Clone(); 25 | 26 | matcher2.MatchForward(false, new CodeMatch(OpCodes.Ldarg_0), new CodeMatch(OpCodes.Ldarg_0), 27 | new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.coldSpend))), 28 | new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(EjectorComponent), nameof(EjectorComponent.time)))); 29 | 30 | matcher.SetJumpTo(OpCodes.Br, matcher2.Pos, out _); 31 | 32 | return matcher.InstructionEnumeration(); 33 | } 34 | 35 | public static void Ejector_PatchMethod(DysonSwarm swarm, SailBullet sailBullet, ref EjectorComponent component, 36 | int[] consumeRegister) 37 | { 38 | int stationPilerLevel = GameMain.history.stationPilerLevel; 39 | ref int bulletCount = ref component.bulletCount; 40 | 41 | int count = stationPilerLevel > bulletCount ? bulletCount : stationPilerLevel; 42 | 43 | for (var i = 0; i < count; i++) swarm.AddBullet(sailBullet, component.runtimeOrbitId); 44 | 45 | int bulletInc = component.bulletInc / bulletCount; 46 | if (!component.incUsed) component.incUsed = bulletInc > 0; 47 | component.bulletInc -= bulletInc * count; 48 | bulletCount -= count; 49 | if (bulletCount == 0) component.bulletInc = 0; 50 | lock (consumeRegister) consumeRegister[component.bulletId] += count; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /devtools/GridMoveTool/GridUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ProjectGenesis 5 | { 6 | internal static class GridUtil 7 | { 8 | internal static bool ValidateRect(in Pos p1, in Pos p2) 9 | { 10 | if (p1.Page != p2.Page) 11 | { 12 | Console.WriteLine("page1 != page2"); 13 | return false; 14 | } 15 | 16 | if (p1.Row > p2.Row) 17 | { 18 | Console.WriteLine("row1 > row2"); 19 | return false; 20 | } 21 | 22 | if (p1.Column > p2.Column) 23 | { 24 | Console.WriteLine("column1 > column2"); 25 | return false; 26 | } 27 | 28 | return true; 29 | } 30 | 31 | internal static List MoveInRect(List data, in Pos topLeft, in Pos bottomRight, in Pos newTopLeft, // ← 直接给目标左上角 32 | Func getGrid, Action setGrid) 33 | { 34 | foreach (var item in data) 35 | { 36 | var pos = new Pos(getGrid(item)); 37 | if (pos.Page == topLeft.Page && pos.Row >= topLeft.Row && pos.Row <= bottomRight.Row && pos.Column >= topLeft.Column 38 | && pos.Column <= bottomRight.Column) 39 | { 40 | // 相对坐标平移 41 | setGrid(item, 42 | new Pos(pos.Page + (newTopLeft.Page - topLeft.Page), pos.Row + (newTopLeft.Row - topLeft.Row), 43 | pos.Column + (newTopLeft.Column - topLeft.Column)).ToGridIndex()); 44 | } 45 | } 46 | 47 | return data; 48 | } 49 | 50 | internal static void CheckGrids(IEnumerable data, Func getGrid, Func getId, int maxPage, int maxRow, 51 | int maxCol, string tag) 52 | { 53 | var seen = new HashSet(); 54 | foreach (var x in data) 55 | { 56 | var grid = getGrid(x); 57 | if (grid == 0) continue; 58 | 59 | var p = new Pos(grid); 60 | if (p.Page < 1 || p.Page > maxPage) Console.WriteLine($"{tag} invalid Page: {grid} id:{getId(x)}"); 61 | if (p.Row < 1 || p.Row > maxRow) Console.WriteLine($"{tag} invalid Row: {grid} id:{getId(x)}"); 62 | if (p.Column < 1 || p.Column > maxCol) Console.WriteLine($"{tag} invalid Col: {grid} id:{getId(x)}"); 63 | if (!seen.Add(grid)) Console.WriteLine($"{tag} duplicate: {grid} id:{getId(x)}"); 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Patches/EnemyDropPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static class EnemyDropPatches 8 | { 9 | [HarmonyPatch(typeof(GameHistoryData), nameof(GameHistoryData.ItemCanDropByEnemy))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable GameHistoryData_ItemCanDropByEnemy_Transpiler(IEnumerable instructions) 12 | { 13 | var matcher = new CodeMatcher(instructions); 14 | 15 | //unlock itemId 5205 16 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldarg_1), new CodeMatch(OpCodes.Ldc_I4, 5205)); 17 | 18 | matcher.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)).SetInstructionAndAdvance(new CodeInstruction(OpCodes.Nop)) 19 | .SetOpcodeAndAdvance(OpCodes.Br_S); 20 | 21 | return matcher.InstructionEnumeration(); 22 | } 23 | 24 | [HarmonyPatch(typeof(UILootFilter), nameof(UILootFilter.SetDropRateTip))] 25 | [HarmonyTranspiler] 26 | public static IEnumerable UILootFilter_SetDropRateTip_Transpiler(IEnumerable instructions) 27 | { 28 | var matcher = new CodeMatcher(instructions); 29 | 30 | // dropCountText * 3 31 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_R4, 2f), new CodeMatch(OpCodes.Mul), new CodeMatch(OpCodes.Stloc_1)) 32 | .SetOperandAndAdvance(6f); 33 | 34 | // dropCountMaxText * 3 35 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_R4, 2f), new CodeMatch(OpCodes.Mul), new CodeMatch(OpCodes.Stloc_2)) 36 | .SetOperandAndAdvance(6f); 37 | 38 | return matcher.InstructionEnumeration(); 39 | } 40 | 41 | [HarmonyPatch(typeof(EnemyDFGroundSystem), nameof(EnemyDFGroundSystem.RandomDropItemOnce))] 42 | [HarmonyTranspiler] 43 | public static IEnumerable EnemyDFGroundSystem_RandomDropItemOnce_Transpiler( 44 | IEnumerable instructions) 45 | { 46 | var matcher = new CodeMatcher(instructions); 47 | 48 | // count * 3 49 | matcher.MatchForward(true, new CodeMatch(OpCodes.Ldarg_3), new CodeMatch(OpCodes.Ldloc_S), new CodeMatch(OpCodes.Ldloc_S), 50 | new CodeMatch(OpCodes.Add), new CodeMatch(OpCodes.Conv_I4)) 51 | .InsertAndAdvance(new CodeInstruction(OpCodes.Ldc_R8, 3d), new CodeInstruction(OpCodes.Mul)); 52 | 53 | return matcher.InstructionEnumeration(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Patches/AddVein/VeinAnimDataPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | using UnityEngine; 5 | 6 | namespace ProjectGenesis.Patches 7 | { 8 | public static partial class AddVeinPatches 9 | { 10 | [HarmonyPatch(typeof(PlanetModelingManager), nameof(PlanetModelingManager.LoadingPlanetFactoryMain))] 11 | [HarmonyTranspiler] 12 | public static IEnumerable PlanetModelingManager_LoadingPlanetFactoryMain_Transpiler( 13 | IEnumerable instructions) 14 | { 15 | var matcher = new CodeMatcher(instructions); 16 | 17 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(VeinData), nameof(VeinData.type))), 18 | new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(AnimData), nameof(AnimData.state)))); 19 | 20 | matcher.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Call, 21 | AccessTools.Method(typeof(AddVeinPatches), nameof(RefVeinDataToAnimDataState)))); 22 | 23 | return matcher.InstructionEnumeration(); 24 | } 25 | 26 | [HarmonyPatch(typeof(PlanetFactory), nameof(PlanetFactory.AddVeinData))] 27 | [HarmonyTranspiler] 28 | public static IEnumerable PlanetFactory_AddVeinData_Transpiler(IEnumerable instructions) 29 | { 30 | var matcher = new CodeMatcher(instructions); 31 | 32 | matcher.MatchForward(false, new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(VeinData), nameof(VeinData.type))), 33 | new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(AnimData), nameof(AnimData.state)))); 34 | 35 | matcher.SetInstructionAndAdvance(new CodeInstruction(OpCodes.Call, 36 | AccessTools.Method(typeof(AddVeinPatches), nameof(VeinDataToAnimDataState)))); 37 | 38 | return matcher.InstructionEnumeration(); 39 | } 40 | 41 | public static uint RefVeinDataToAnimDataState(ref VeinData data) 42 | { 43 | if (data.modelIndex > 2) return (uint)data.type; 44 | 45 | Color32 color = VeinColors[(int)data.type]; 46 | 47 | return (uint)(color.a << 24) | (uint)(color.b << 16) | (uint)(color.g << 8) | color.r; 48 | } 49 | 50 | public static uint VeinDataToAnimDataState(VeinData data) 51 | { 52 | if (data.modelIndex > 2) return (uint)data.type; 53 | 54 | Color32 color = VeinColors[(int)data.type]; 55 | 56 | return (uint)(color.a << 24) | (uint)(color.b << 16) | (uint)(color.g << 8) | color.r; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /preloader/Preloader.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Reflection; 4 | using Mono.Cecil; 5 | using FieldAttributes = Mono.Cecil.FieldAttributes; 6 | 7 | [assembly:AssemblyVersion(ProjectGenesis.ProjectGenesis.VERSION)] 8 | 9 | namespace ProjectGenesis 10 | { 11 | public static class Preloader 12 | { 13 | public static IEnumerable TargetDLLs { get; } = new[] { "Assembly-CSharp.dll", }; 14 | 15 | private static TypeDefinition GetTypeByName(this AssemblyDefinition assembly, string name) => 16 | assembly.MainModule.Types.FirstOrDefault(t => t.FullName == name); 17 | 18 | private static FieldDefinition GetFieldByName(this TypeDefinition type, string name) => 19 | type.Fields.FirstOrDefault(t => t.Name == name); 20 | 21 | private static void AddEnumField(this TypeDefinition type, string name, object constant, FieldAttributes fieldAttributes) => 22 | type.Fields.Add(new FieldDefinition(name, fieldAttributes, type) { Constant = constant, }); 23 | 24 | private static void AddTypeField(this AssemblyDefinition assembly, string typeName, string oriFieldName, string newFieldName) 25 | { 26 | TypeDefinition type = assembly.GetTypeByName(typeName); 27 | FieldDefinition oriField = type.GetFieldByName(oriFieldName); 28 | type.Fields.Add(new FieldDefinition(newFieldName, oriField.Attributes, oriField.FieldType)); 29 | } 30 | 31 | public static void Patch(AssemblyDefinition assembly) 32 | { 33 | TypeDefinition veinType = assembly.GetTypeByName("EVeinType"); 34 | FieldDefinition max = veinType.Fields.FirstOrDefault(i => i.HasDefault && (byte)i.Constant == 15); 35 | 36 | if (max != null) veinType.Fields.Remove(max); 37 | 38 | FieldAttributes fieldAttributes = 39 | FieldAttributes.Static | FieldAttributes.Literal | FieldAttributes.Public | FieldAttributes.HasDefault; 40 | 41 | veinType.AddEnumField("Aluminum", 15, fieldAttributes); 42 | veinType.AddEnumField("Radioactive", 16, fieldAttributes); 43 | veinType.AddEnumField("Tungsten", 17, fieldAttributes); 44 | veinType.AddEnumField("Sulfur", 18, fieldAttributes); 45 | 46 | assembly.AddTypeField("PlanetData", "birthResourcePoint0", "birthResourcePoint2"); 47 | assembly.AddTypeField("PlanetData", "birthResourcePoint0", "birthResourcePoint3"); 48 | assembly.AddTypeField("PlanetData", "birthResourcePoint0", "birthResourcePoint4"); 49 | 50 | assembly.AddTypeField("GameDesc", "isSandboxMode", "isFastStartMode"); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Patches/PlanetFocus/LabPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | 5 | namespace ProjectGenesis.Patches 6 | { 7 | public static partial class PlanetFocusPatches 8 | { 9 | [HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.GameTickLabResearchMode))] 10 | [HarmonyTranspiler] 11 | public static IEnumerable FactorySystem_GameTickLabResearchMode_Transpiler(IEnumerable instructions) 12 | { 13 | var matcher = new CodeMatcher(instructions); 14 | 15 | matcher.MatchForward(true, 16 | new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(GameHistoryData), nameof(GameHistoryData.techSpeed))), 17 | new CodeMatch(OpCodes.Conv_R4)); 18 | 19 | matcher.Advance(1).InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0)); 20 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Call, 21 | AccessTools.Method(typeof(PlanetFocusPatches), nameof(LabResearchMode)))); 22 | 23 | return matcher.InstructionEnumeration(); 24 | } 25 | 26 | public static float LabResearchMode(float techSpeed, FactorySystem factorySystem) 27 | { 28 | bool exist = ContainsFocus(factorySystem.factory.planetId, 6523); 29 | 30 | return exist ? techSpeed * 1.1f : techSpeed; 31 | } 32 | 33 | [HarmonyPatch(typeof(UILabWindow), nameof(UILabWindow._OnUpdate))] 34 | [HarmonyTranspiler] 35 | public static IEnumerable UILabWindow_OnUpdate_Transpiler(IEnumerable instructions) 36 | { 37 | var matcher = new CodeMatcher(instructions); 38 | 39 | 40 | matcher.MatchForward(true, 41 | new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(GameHistoryData), nameof(GameHistoryData.techSpeed))), 42 | new CodeMatch(OpCodes.Conv_R4)); 43 | 44 | matcher.Advance(1).InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0), 45 | new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(UILabWindow), nameof(UILabWindow.factory)))); 46 | 47 | matcher.InsertAndAdvance( 48 | new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(PlanetFocusPatches), nameof(LabTechSpeed)))); 49 | 50 | 51 | return matcher.InstructionEnumeration(); 52 | } 53 | 54 | public static double LabTechSpeed(double techSpeed, PlanetFactory factory) 55 | { 56 | bool exist = ContainsFocus(factory.planetId, 6523); 57 | 58 | return exist ? techSpeed * 1.1 : techSpeed; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /ProjectGenesis.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31025.194 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectGenesis", "ProjectGenesis.csproj", "{EFF66744-FAF7-461E-B86E-7130E64E16DF}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectGenesis.Preloader", "preloader/ProjectGenesis.Preloader.csproj", "{E07968B0-4405-43ED-9F89-BCAE7390EEAF}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectGenesis.Packer", "packer/ProjectGenesis.Packer.csproj", "{F7D5FFDE-43BB-4EFB-B3FE-B0219922B0F2}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectGenesis.DevTools", "devtools/ProjectGenesis.DevTools.csproj", "{E112CE56-08CD-4F17-94E8-C3866C40AECF}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {EFF66744-FAF7-461E-B86E-7130E64E16DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {EFF66744-FAF7-461E-B86E-7130E64E16DF}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {EFF66744-FAF7-461E-B86E-7130E64E16DF}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {EFF66744-FAF7-461E-B86E-7130E64E16DF}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {E07968B0-4405-43ED-9F89-BCAE7390EEAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {E07968B0-4405-43ED-9F89-BCAE7390EEAF}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {E07968B0-4405-43ED-9F89-BCAE7390EEAF}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {E07968B0-4405-43ED-9F89-BCAE7390EEAF}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {F7D5FFDE-43BB-4EFB-B3FE-B0219922B0F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {F7D5FFDE-43BB-4EFB-B3FE-B0219922B0F2}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {F7D5FFDE-43BB-4EFB-B3FE-B0219922B0F2}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {F7D5FFDE-43BB-4EFB-B3FE-B0219922B0F2}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {E112CE56-08CD-4F17-94E8-C3866C40AECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {E112CE56-08CD-4F17-94E8-C3866C40AECF}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {E112CE56-08CD-4F17-94E8-C3866C40AECF}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {E112CE56-08CD-4F17-94E8-C3866C40AECF}.Release|Any CPU.Build.0 = Release|Any CPU 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | GlobalSection(ExtensibilityGlobals) = postSolution 41 | SolutionGuid = {50006A02-34FA-4D98-979C-8582CB6FE6C4} 42 | EndGlobalSection 43 | EndGlobal 44 | -------------------------------------------------------------------------------- /src/Compatibility/PlanetVeinUtilization.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Reflection; 4 | using System.Reflection.Emit; 5 | using BepInEx; 6 | using BepInEx.Bootstrap; 7 | using HarmonyLib; 8 | using ProjectGenesis.Patches; 9 | 10 | // ReSharper disable InconsistentNaming 11 | 12 | namespace ProjectGenesis.Compatibility 13 | { 14 | internal static class PlanetVeinUtilization 15 | { 16 | internal const string GUID = "testpostpleaseignore.dsp.planet_vein_utilization"; 17 | 18 | private static readonly Harmony HarmonyPatch = new Harmony("ProjectGenesis.Compatibility." + GUID); 19 | 20 | internal static void Awake() 21 | { 22 | if (!Chainloader.PluginInfos.TryGetValue(GUID, out PluginInfo pluginInfo)) return; 23 | 24 | Assembly assembly = pluginInfo.Instance.GetType().Assembly; 25 | Type type = assembly.GetType("PlanetVeinUtilization.PlanetVeinUtilization"); 26 | Type veinTypeInfoType = type.GetNestedType("VeinTypeInfo"); 27 | 28 | HarmonyPatch.Patch(AccessTools.Method(type, "UIPlanetDetail_RefreshDynamicProperties_Postfix"), null, null, 29 | new HarmonyMethod(typeof(PlanetVeinUtilization), nameof(RefreshDynamicProperties_Postfix_Transpiler))); 30 | 31 | HarmonyPatch.Patch(AccessTools.Method(type, "UIStarDetail_RefreshDynamicProperties_Postfix"), null, null, 32 | new HarmonyMethod(typeof(PlanetVeinUtilization), nameof(RefreshDynamicProperties_Postfix_Transpiler))); 33 | 34 | ref Array local1 = ref AccessTools.StaticFieldRefAccess(type, "planetVeinCount"); 35 | ref Array local2 = ref AccessTools.StaticFieldRefAccess(type, "starVeinCount"); 36 | 37 | sbyte veinTypeCount = AddVeinPatches.VeinTypeCount; 38 | 39 | local1 = Array.CreateInstance(veinTypeInfoType, veinTypeCount); 40 | 41 | for (var i = 0; i < veinTypeCount; i++) local1.SetValue(Activator.CreateInstance(veinTypeInfoType, null), i); 42 | 43 | local2 = Array.CreateInstance(veinTypeInfoType, veinTypeCount); 44 | 45 | for (var i = 0; i < veinTypeCount; i++) local2.SetValue(Activator.CreateInstance(veinTypeInfoType, null), i); 46 | } 47 | 48 | public static IEnumerable RefreshDynamicProperties_Postfix_Transpiler(IEnumerable instructions) 49 | { 50 | var matcher = new CodeMatcher(instructions); 51 | 52 | matcher.MatchForward(true, new CodeMatch(OpCodes.Ldloc_S), new CodeMatch(OpCodes.Ldc_I4_S, (sbyte)15)); 53 | 54 | matcher.SetOperandAndAdvance(AddVeinPatches.VeinTypeCount); 55 | 56 | return matcher.InstructionEnumeration(); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Patches/ChemicalRecipeFcol/ChemicalRecipeFcolPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Reflection.Emit; 3 | using HarmonyLib; 4 | using ProjectGenesis.Utils; 5 | using UnityEngine; 6 | 7 | // ReSharper disable Unity.UnknownResource 8 | 9 | namespace ProjectGenesis.Patches 10 | { 11 | public static partial class ChemicalRecipeFcolPatches 12 | { 13 | [HarmonyPatch(typeof(FactorySystem), nameof(FactorySystem.GameTick), typeof(long), typeof(bool))] 14 | [HarmonyPatch(typeof(GameLogic), nameof(GameLogic._assembler_parallel))] 15 | [HarmonyTranspiler] 16 | public static IEnumerable FactorySystem_GameTick_Transpiler(IEnumerable instructions) 17 | { 18 | var matcher = new CodeMatcher(instructions); 19 | 20 | matcher.MatchForward(false, 21 | new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(AssemblerComponent), nameof(AssemblerComponent.recipeType)))); 22 | 23 | matcher.Advance(1) 24 | .SetInstructionAndAdvance(new CodeInstruction(OpCodes.Call, 25 | AccessTools.Method(typeof(ChemicalRecipeFcolPatches), nameof(ChemicalRecipeTypePatch)))) 26 | .SetOpcodeAndAdvance(OpCodes.Brfalse_S); 27 | 28 | matcher.MatchForward(false, 29 | new CodeMatch(OpCodes.Ldfld, AccessTools.Field(typeof(AssemblerComponent), nameof(AssemblerComponent.recipeId))), 30 | new CodeMatch(OpCodes.Conv_R4), 31 | new CodeMatch(OpCodes.Stfld, AccessTools.Field(typeof(AnimData), nameof(AnimData.working_length)))); 32 | 33 | matcher.Advance(1).InsertAndAdvance(new CodeInstruction(OpCodes.Call, 34 | AccessTools.Method(typeof(ChemicalRecipeFcolPatches), nameof(ChemicalRecipeFcolPatch)))); 35 | 36 | return matcher.InstructionEnumeration(); 37 | } 38 | 39 | private static bool ChemicalRecipeTypePatch(int recipeType) => recipeType == (int)ERecipeType.Chemical || recipeType == 16; 40 | 41 | private static int ChemicalRecipeFcolPatch(int recipeId) => RecipeIdPos.GetValueOrDefault(recipeId, recipeId); 42 | 43 | internal static void SetChemicalRecipeFcol() 44 | { 45 | Texture texture = TextureHelper.GetTexture("化工厂渲染索引"); 46 | int fluidTex = Shader.PropertyToID("_FluidTex"); 47 | 48 | ref PrefabDesc prefabDesc = ref LDB.models.Select(64).prefabDesc; 49 | prefabDesc.lodMaterials[0][1].SetTexture(fluidTex, texture); 50 | prefabDesc.lodMaterials[1][1].SetTexture(fluidTex, texture); 51 | 52 | prefabDesc = ref LDB.models.Select(376).prefabDesc; 53 | prefabDesc.lodMaterials[0][1].SetTexture(fluidTex, texture); 54 | prefabDesc.lodMaterials[1][1].SetTexture(fluidTex, texture); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Patches/PlanetFocus/PlanetFocusPatches.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using ProjectGenesis.Utils; 5 | 6 | // ReSharper disable MemberCanBeInternal 7 | 8 | namespace ProjectGenesis.Patches 9 | { 10 | public static partial class PlanetFocusPatches 11 | { 12 | internal const int FocusMaxCount = 2; 13 | 14 | private static readonly ConcurrentDictionary PlanetFocuses = new ConcurrentDictionary(); 15 | 16 | internal static readonly Dictionary FocusIds = new Dictionary 17 | { 18 | { 6522, "工厂电力需求 -10%" }, 19 | { 6523, "研究上传速度 +10%" }, 20 | { 6524, "火力发电效率 +20%" }, 21 | { 6525, "风力发电效率 +20%" }, 22 | { 6526, "光伏发电效率 +20%" }, 23 | { 6527, "聚变发电效率 +10%" }, 24 | { 6528, "矿物采集速度 +25%" }, 25 | { 6529, "裂变发电效率 +20%" }, 26 | { 6530, "配送物流速度 +25%" }, 27 | { 6531, "电力威胁增长 -20%" }, 28 | { 6532, "太空威胁增长 -20%" }, 29 | { 6533, "部队建造速度 -20%" }, 30 | { 6534, "基地扩张速度 -20%" }, 31 | }; 32 | 33 | internal static void SetPlanetFocus(int planetId, int index, int focusId) 34 | { 35 | if (!PlanetFocuses.ContainsKey(planetId)) PlanetFocuses[planetId] = new int[FocusMaxCount]; 36 | 37 | PlanetFocuses[planetId][index] = focusId; 38 | SyncPlanetFocusData.Sync(planetId, index, focusId); 39 | } 40 | 41 | internal static void SyncPlanetFocus(int planetId, int index, int focusId) 42 | { 43 | if (!PlanetFocuses.ContainsKey(planetId)) PlanetFocuses[planetId] = new int[FocusMaxCount]; 44 | 45 | PlanetFocuses[planetId][index] = focusId; 46 | } 47 | 48 | internal static int[] GetPlanetFocus(int planetId) 49 | { 50 | if (!PlanetFocuses.ContainsKey(planetId)) PlanetFocuses[planetId] = new int[FocusMaxCount]; 51 | 52 | return PlanetFocuses[planetId]; 53 | } 54 | 55 | public static void ExportPlanetFocus(int planetId, BinaryWriter w) 56 | { 57 | if (!PlanetFocuses.ContainsKey(planetId)) PlanetFocuses[planetId] = new int[FocusMaxCount]; 58 | 59 | int[] datas = PlanetFocuses[planetId]; 60 | 61 | w.Write(datas.Length); 62 | w.Write(planetId); 63 | 64 | foreach (int id in datas) w.Write(id); 65 | } 66 | 67 | public static void ImportPlanetFocus(BinaryReader r) 68 | { 69 | int count = r.ReadInt32(); 70 | int planetId = r.ReadInt32(); 71 | 72 | var arr = new int[count]; 73 | 74 | for (var j = 0; j < count; j++) arr[j] = r.ReadInt32(); 75 | 76 | PlanetFocuses[planetId] = arr; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /README-For programmer.md: -------------------------------------------------------------------------------- 1 | ![img.png](https://assets.awbugl.top/dsp-genesisbook/icon.png) 2 | 3 | 构建真实宇宙,撰写创世之书。 4 | 5 | Construct Real Universe. Then leave a GenesisBook. 6 | 7 | ## 意见和反馈 | Feedback and suggestions 8 | 9 | 如果您对本Mod有宝贵的意见或建议, 10 | 请加QQ群(如下)向管理员反馈,欢迎加群交流。 11 | 12 | - 创世之书MOD一号节点 991895539 13 | - 群问题答案:戴森球计划 14 | 15 | If you have any problems, please contact us in [our Discord server](https://discord.gg/QwMEeaRZZR), 16 | or open a issue via [github](https://github.com/Awbugl/ProjectGenesis). 17 | 18 | ## 如何开始 19 | 20 | 1. 在开始之前,请务必确认您对以下内容以及它们的用法都有一定了解: 21 | 22 | * [C#语言](https://www.runoob.com/csharp/csharp-tutorial.html) 23 | * [Harmony](https://harmony.pardeike.net/articles/intro.html),修改游戏运行逻辑 24 | * [BepInEx](https://thunderstore.io/c/dyson-sphere-program/p/xiaoye97/BepInEx/) 25 | ,5.4.18无法正确处理Harmony的部分Transpiler,由于创世大量使用Transpiler,强烈建议使用5.4.17 26 | * [LDBTool](https://thunderstore.io/c/dyson-sphere-program/p/xiaoye97/LDBTool/),向戴森球计划添加物品、配方、科技等 27 | * [CommonAPI](https://thunderstore.io/c/dyson-sphere-program/p/CommonAPI/CommonAPI/),向戴森球计划添加物品、配方、科技等 28 | 29 | 2. 打开本项目,将`DefaultPath.props.example`复制到`DefaultPath.props`。 30 | 3. 修改`DefaultPath.props`中的BepinExPath和DSPAssemblyPath,使其与您的实际路径一致,然后关闭/卸载项目。 31 | 4. 在R2中打开与上一步一致的Profile,在ConfigEditor中搜索`BepInEx.cfg`,修改Preloader-DumpAssemblies为true。 32 | 5. 通过R2启动一次游戏(需要启用创世之书),将会自动生成`BepInEx\DumpedAssemblies\DSPGAME\Assembly-CSharp.dll`。 33 | 6. 重新打开本项目,会自动在项目内生成`lib\Assembly-CSharp-publicized.dll`。至此,准备工作已经完成。现在项目不应有任何报错。 34 | 35 | ## How to start 36 | 37 | 1. Before you begin, make sure you have some understanding of the following and how they are used: 38 | 39 | * [C# Language](https://www.runoob.com/csharp/csharp-tutorial.html) 40 | * [Harmony](https://harmony.pardeike.net/articles/intro.html), Modify the game's runtime logic 41 | * [BepInEx](https://thunderstore.io/c/dyson-sphere-program/p/xiaoye97/BepInEx/), 5.4.18 can't handle some of Harmony's 42 | Transpiler correctly, so 5.4.17 is highly recommended due to lots of Transpilers in this project. 43 | * [LDBTool](https://thunderstore.io/c/dyson-sphere-program/p/xiaoye97/LDBTool/), Adds items, recipes, technologies, etc. 44 | to the Dyson Sphere Program. 45 | * [CommonAPI](https://thunderstore.io/c/dyson-sphere-program/p/CommonAPI/CommonAPI/), Add items, recipes, technologies, 46 | etc. to the Dyson Sphere Program. 47 | 48 | 2. Open this project, copy `DefaultPath.props.example` to `DefaultPath.props`. 49 | 3. Modify the BepinExPath and DSPAssemblyPath in `DefaultPath.props` to match your actual paths, then 50 | close/uninstall the project. 51 | 4. Open a Profile in R2 that matches the previous step, search for `BepInEx.cfg` in the ConfigEditor, and change 52 | Preloader-DumpAssemblies to true. 53 | 5. Launch the game once through R2 (need to enable Genesis Book), it will automatically generate 54 | `BepInEx\DumpedAssemblies\DSPGAME\Assembly-CSharp.dll`. 55 | 6. Re-open the project, it will automatically generate `lib\Assembly-CSharp-publicized.dll` in the project. So, the 56 | preparation work has been completed. The project should not report any errors now. 57 | -------------------------------------------------------------------------------- /src/Compatibility/LazyOutposting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Reflection; 4 | using System.Reflection.Emit; 5 | using BepInEx; 6 | using BepInEx.Bootstrap; 7 | using HarmonyLib; 8 | using ProjectGenesis.Utils; 9 | 10 | // ReSharper disable InconsistentNaming 11 | 12 | namespace ProjectGenesis.Compatibility 13 | { 14 | internal static class LazyOutposting 15 | { 16 | internal const string GUID = "eirshy.dsp.LazyOutposting"; 17 | 18 | private static readonly Harmony HarmonyPatch = new Harmony("ProjectGenesis.Compatibility." + GUID); 19 | 20 | internal static void Awake() 21 | { 22 | if (!Chainloader.PluginInfos.TryGetValue(GUID, out PluginInfo pluginInfo)) return; 23 | 24 | Assembly assembly = pluginInfo.Instance.GetType().Assembly; 25 | 26 | var typeDwarvenContract = assembly.GetType("Eirshy.DSP.LazyOutposting.Components.DwarvenContract"); 27 | var typeDwarfMission = typeDwarvenContract.GetNestedType("DwarfMission", BindingFlags.NonPublic | BindingFlags.Instance); 28 | var typeEGear = typeDwarfMission.GetNestedType("EGear", BindingFlags.NonPublic | BindingFlags.Instance); 29 | 30 | HarmonyPatch.Patch(AccessTools.Constructor(typeDwarfMission, new[] { typeEGear, }), null, null, 31 | new HarmonyMethod(typeof(LazyOutposting), nameof(DwarfMission_Constructor_Transpiler))); 32 | 33 | HarmonyPatch.CreateReversePatcher(AccessTools.Method(typeDwarvenContract, "SetUp"), 34 | new HarmonyMethod(typeof(LazyOutposting), nameof(SetUp_ReversePatch))).Patch(); 35 | 36 | SetUp_ReversePatch(); 37 | } 38 | 39 | public static IEnumerable DwarfMission_Constructor_Transpiler(IEnumerable instructions) 40 | { 41 | var matcher = new CodeMatcher(instructions); 42 | 43 | matcher.MatchForward(false, new CodeMatch(OpCodes.Stloc_2)); 44 | matcher.InsertAndAdvance(new CodeInstruction(OpCodes.Call, 45 | AccessTools.Method(typeof(LazyOutposting), nameof(Patch_Method_validTargets)))); 46 | 47 | return matcher.InstructionEnumeration(); 48 | } 49 | 50 | public static List Patch_Method_validTargets(List validTargets) 51 | { 52 | validTargets.Add(EVeinType.Aluminum); 53 | 54 | return validTargets; 55 | } 56 | 57 | public static void SetUp_ReversePatch() 58 | { 59 | IEnumerable Transpiler(IEnumerable instructions) 60 | { 61 | var matcher = new CodeMatcher(instructions); 62 | 63 | matcher.MatchForward(false, new CodeMatch(OpCodes.Call), new CodeMatch(OpCodes.Ldtoken)); 64 | 65 | matcher.RemoveInstructions(matcher.Remaining - 1); 66 | 67 | return matcher.InstructionEnumeration(); 68 | } 69 | 70 | _ = Transpiler(null); 71 | 72 | return; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /devtools/ProjectGenesis.DevTools.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Debug 7 | AnyCPU 8 | {E112CE56-08CD-4F17-94E8-C3866C40AECF} 9 | Exe 10 | Properties 11 | ProjectGenesis.DevTools 12 | ProjectGenesis.DevTools 13 | v4.7.2 14 | 512 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\lib\Newtonsoft.Json.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /packer/Packer.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.IO; 3 | using System.IO.Compression; 4 | using System.Linq; 5 | using System.Text; 6 | using Newtonsoft.Json; 7 | 8 | namespace ProjectGenesis 9 | { 10 | internal static class Packer 11 | { 12 | private const string SolutionPath = @"..\..\.."; 13 | 14 | private static readonly bool IsDebugBuild = true; 15 | 16 | public const string ManifestDebugVersion = "0.3.20001"; 17 | 18 | internal static void Main() 19 | { 20 | string releasePath = Path.Combine(SolutionPath, "release"); 21 | 22 | foreach (string path in Directory.GetFiles(releasePath, "*.zip").Where(File.Exists)) File.Delete(path); 23 | 24 | var manifestObject = IsDebugBuild ? ManifestObject.DebugObject() : ManifestObject.ReleaseObject(); 25 | 26 | File.WriteAllText(Path.Combine(releasePath, "manifest.json"), JsonConvert.SerializeObject(manifestObject, Formatting.Indented)); 27 | 28 | var zipName = new StringBuilder(80).Append(manifestObject.Name).Append("-v").Append(ProjectGenesis.VERSION).Append("-") 29 | .Append(IsDebugBuild ? ProjectGenesis.DEBUGVERSION : "").Append(".zip").ToString(); 30 | 31 | string archive = Path.Combine(SolutionPath, zipName); 32 | 33 | if (File.Exists(archive)) File.Delete(archive); 34 | 35 | ZipFile.CreateFromDirectory(releasePath, archive); 36 | 37 | File.Move(archive, Path.Combine(releasePath, zipName)); 38 | 39 | Process.Start("explorer", releasePath); 40 | } 41 | } 42 | 43 | public class ManifestObject 44 | { 45 | [JsonProperty("name")] public string Name { get; set; } 46 | 47 | [JsonProperty("version_number")] public string VersionNumber { get; set; } 48 | 49 | [JsonProperty("website_url")] public string WebsiteURL { get; set; } = "https://github.com/Awbugl/ProjectGenesis"; 50 | 51 | [JsonProperty("description")] public string Description { get; set; } 52 | 53 | [JsonProperty("dependencies")] 54 | public string[] Dependencies { get; set; } = 55 | { 56 | "CommonAPI-CommonAPI-1.6.7", "nebula-NebulaMultiplayerModApi-2.1.0", "starfi5h-ErrorAnalyzer-1.3.3", 57 | "Shad0wlife-AssemblerUI-2.3.0", 58 | }; 59 | 60 | internal static ManifestObject DebugObject() 61 | { 62 | return new ManifestObject 63 | { 64 | Name = "GenesisBook_Experimental", 65 | VersionNumber = Packer.ManifestDebugVersion, 66 | Description = 67 | "【测试版本】构建真实宇宙,撰写创世之书。新矿物,新材料,新配方,新科技,新机制。[Test Build]Construct Real Universe. Then leave a GenesisBook. New vein, new material, new recipe, new technology, new structure.", 68 | }; 69 | } 70 | 71 | internal static ManifestObject ReleaseObject() 72 | { 73 | return new ManifestObject 74 | { 75 | Name = "GenesisBook", 76 | VersionNumber = ProjectGenesis.VERSION, 77 | Description = 78 | "构建真实宇宙,撰写创世之书。新矿物,新材料,新配方,新科技,新机制。Construct Real Universe. Then leave a GenesisBook. New vein, new material, new recipe, new technology, new structure.", 79 | }; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/Patches/QuantumStorage/UIPatches.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HarmonyLib; 3 | using ProjectGenesis.Utils; 4 | using UnityEngine; 5 | using UnityEngine.UI; 6 | using Object = UnityEngine.Object; 7 | 8 | // ReSharper disable InconsistentNaming 9 | 10 | namespace ProjectGenesis.Patches 11 | { 12 | public static partial class QuantumStoragePatches 13 | { 14 | private static UIOrbitPicker orbitPicker; 15 | 16 | [HarmonyPatch(typeof(UIGame), nameof(UIGame._OnInit))] 17 | [HarmonyPostfix] 18 | public static void Init() 19 | { 20 | if (orbitPicker) return; 21 | 22 | orbitPicker = Object.Instantiate(UIRoot.instance.uiGame.ejectorWindow.orbitPicker, 23 | UIRoot.instance.uiGame.storageWindow.transform); 24 | 25 | Transform orbitPickerTransform = orbitPicker.transform; 26 | ((RectTransform)orbitPickerTransform).localPosition = new Vector3(90, -443, 0); 27 | 28 | Transform titleTransform = orbitPickerTransform.GetChild(0).transform; 29 | ((RectTransform)titleTransform).localPosition = new Vector3(-120, -33, 0); 30 | 31 | Object.DestroyImmediate(titleTransform.GetComponent()); 32 | Text component = titleTransform.GetComponent(); 33 | component.fontSize = 16; 34 | component.text = "选择量子频道".TranslateFromJson(); 35 | 36 | for (var i = 1; i < orbitPickerTransform.childCount; i++) orbitPickerTransform.GetChild(i).gameObject.SetActive(false); 37 | 38 | for (var i = 3; i < 13; i++) 39 | { 40 | Transform transform = orbitPickerTransform.GetChild(i); 41 | transform.gameObject.SetActive(true); 42 | transform.GetComponent