示例#1
0
        public static void Patch()
        {
            try
            {
                var modConfig = new EmModPatchConfig();

                modConfig.Initialize();

                bool hasVehicleUpgradesInCyclops = Directory.Exists(@"./QMods/VehicleUpgradesInCyclops");

                // ----------------------------------------------

                Console.WriteLine("[MoreCyclopsUpgrades] Patching new upgrade modules");
                CyclopsModule.PatchAllModules(hasVehicleUpgradesInCyclops, modConfig.EnableNewUpgradeModules);

                if (!modConfig.EnableNewUpgradeModules)
                {
                    Console.WriteLine("[MoreCyclopsUpgrades] New upgrade modules disabled by config settings");
                }

                // ----------------------------------------------

                Console.WriteLine("[MoreCyclopsUpgrades] Patching Auxiliary Upgrade Console");

                var auxConsole = new AuxCyUpgradeConsole();

                auxConsole.Patch(modConfig.EnableAuxiliaryUpgradeConsoles);

                if (!modConfig.EnableAuxiliaryUpgradeConsoles)
                {
                    Console.WriteLine("[MoreCyclopsUpgrades] Auxiliary Upgrade Console disabled by config settings");
                }

                // ----------------------------------------------

                HarmonyInstance harmony = HarmonyInstance.Create("com.morecyclopsupgrades.psmod");
                harmony.PatchAll(Assembly.GetExecutingAssembly());

                Console.WriteLine("[MoreCyclopsUpgrades] Finished Patching");
            }
            catch (Exception ex)
            {
                Console.WriteLine("[MoreCyclopsUpgrades] ERROR: " + ex.ToString());
            }
        }
示例#2
0
        public static void Patch()
        {
            try
            {
                QuickLogger.Message("Started patching " + QuickLogger.GetAssemblyVersion());

                OtherMods.VehicleUpgradesInCyclops = Directory.Exists(@"./QMods/VehicleUpgradesInCyclops");

                if (OtherMods.VehicleUpgradesInCyclops)
                {
                    QuickLogger.Message("VehicleUpgradesInCyclops detected. Correcting placement of craft nodes in Cyclops Fabricator.");
                }

                var modConfig = new EmModPatchConfig();
                modConfig.Initialize();

                QuickLogger.Message("Patching new upgrade modules");
                CyclopsModule.PatchAllModules(modConfig.EnableNewUpgradeModules);

                if (!modConfig.EnableNewUpgradeModules)
                {
                    QuickLogger.Message("New upgrade modules disabled by config settings");
                }

                QuickLogger.Message("Patching Auxiliary Upgrade Console");

                var auxConsole = new AuxCyUpgradeConsole();

                auxConsole.Patch(modConfig.EnableAuxiliaryUpgradeConsoles);

                if (!modConfig.EnableAuxiliaryUpgradeConsoles)
                {
                    QuickLogger.Message("Auxiliary Upgrade Console disabled by config settings");
                }

                var harmony = HarmonyInstance.Create("com.morecyclopsupgrades.psmod");
                harmony.PatchAll(Assembly.GetExecutingAssembly());

                QuickLogger.Message("Finished Patching");
            }
            catch (Exception ex)
            {
                QuickLogger.Error(ex);
            }
        }