예제 #1
0
        public static void Patch()
        {
            MCUServices.Logger.Info("Started patching v" + QuickLogger.GetAssemblyVersion());

            var nuclearModule  = new CyclopsNuclearModule();
            var depletedModule = new DepletedNuclearModule(nuclearModule);

            nuclearModule.Patch();
            depletedModule.Patch();

            var nuclearFabricator = new NuclearFabricator(nuclearModule);

            nuclearFabricator.AddCraftNode(TechType.ReactorRod);
            nuclearFabricator.AddCraftNode(nuclearModule.TechType);
            nuclearFabricator.AddCraftNode("RReactorRodDUMMY");    // Optional - Refill nuclear reactor rod (old)
            nuclearFabricator.AddCraftNode("ReplenishReactorRod"); // Optional - Refill nuclear reactor rod (new)
            nuclearFabricator.AddCraftNode("CyNukeUpgrade1");      // Optional - Cyclops Nuclear Reactor Enhancer Mk1
            nuclearFabricator.AddCraftNode("CyNukeUpgrade2");      // Optional - Cyclops Nuclear Reactor Enhancer Mk2
            nuclearFabricator.Patch();

            MCUServices.Register.CyclopsUpgradeHandler((SubRoot cyclops) =>
            {
                return(new NuclearUpgradeHandler(nuclearModule.TechType, cyclops));
            });

            MCUServices.Register.CyclopsCharger <NuclearChargeHandler>((SubRoot cyclops) =>
            {
                return(new NuclearChargeHandler(cyclops, nuclearModule.TechType));
            });

            MCUServices.Register.PdaIconOverlay(nuclearModule.TechType, (uGUI_ItemIcon icon, InventoryItem upgradeModule) =>
            {
                return(new NuclearIconOverlay(icon, upgradeModule));
            });

            MCUServices.Logger.Info("Finished patching");
        }
예제 #2
0
        public static void Patch()
        {
            try
            {
                var nuclearModule     = new CyclopsNuclearModule();
                var depletedModule    = new DepletedNuclearModule(nuclearModule);
                var nuclearFabricator = new NuclearFabricator(nuclearModule);

                nuclearModule.Patch();
                depletedModule.Patch();
                nuclearFabricator.Patch();

                MCUServices.Register.CyclopsUpgradeHandler(depletedModule);
                MCUServices.Register.CyclopsCharger <NuclearChargeHandler>(depletedModule);
                MCUServices.Register.PdaIconOverlay(nuclearModule.TechType, (uGUI_ItemIcon icon, InventoryItem upgradeModule) =>
                {
                    return(new NuclearIconOverlay(icon, upgradeModule));
                });
            }
            catch (Exception ex)
            {
                QuickLogger.Error(ex);
            }
        }