Пример #1
0
        private static void PatchAuxUpgradeConsole()
        {
            if (ModConfig.Main.AuxConsoleEnabled)
            {
                QuickLogger.Debug("Patching Auxiliary Upgrade Console");
            }
            else
            {
                QuickLogger.Info("Auxiliary Upgrade Console disabled by config settings");
            }

            var console = new AuxCyUpgradeConsole();

            console.Patch(ModConfig.Main.AuxConsoleEnabled);
        }
Пример #2
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());
            }
        }
Пример #3
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);
            }
        }
Пример #4
0
        public static void Patch()
        {
            QuickLogger.Info("Started patching " + QuickLogger.GetAssemblyVersion());

            // If enabled, patch the Auxiliary Upgrade Console as a new buildable.
            if (ModConfig.Main.AuxConsoleEnabled)
            {
                var console = new AuxCyUpgradeConsole();
                console.Patch();
            }
            else
            {
                // SMLHelper now handles previously used but now disabled TechTypes
                QuickLogger.Info("Auxiliary Upgrade Console disabled by config settings");
            }

            Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "com.morecyclopsupgrades.psmod");

            QuickLogger.Info("Finished Patching");
        }
Пример #5
0
        public static void Patch()
        {
            try
            {
                QuickLogger.Info("Started patching " + QuickLogger.GetAssemblyVersion());

                // If enabled, patch the Auxiliary Upgrade Console as a new buildable.
                var console = new AuxCyUpgradeConsole();
                console.Patch(ModConfig.Main.AuxConsoleEnabled);

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

                QuickLogger.Info("Finished Patching");
            }
            catch
            {
                QuickLogger.Error($"Critical error in patching");
                throw; // Rethrow for QModManager to catch and report
            }
        }