Exemplo n.º 1
0
        internal NuclearFabricator(CyclopsNuclearModule module)
            : base("NuclearFabricator",
                   "Nuclear Fabricator",
                   "A specialized fabricator for safe handling of radioactive energy sources.")
        {
            nuclearModule = module;

            OnStartedPatching += () =>
            {
                if (!nuclearModule.IsPatched)
                {
                    nuclearModule.Patch();
                }

                // Load the custom texture
                string executingLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                string folderPath        = Path.Combine(executingLocation, "Assets");

                string textureLocation = Path.Combine(folderPath, "NuclearFabricatorT.png");
                customTexture = ImageUtils.LoadTextureFromFile(textureLocation);

                string spriteLocation = Path.Combine(folderPath, "NuclearFabricator.png");
                sprite = ImageUtils.LoadSpriteFromFile(spriteLocation) ?? SpriteManager.Get(TechType.Fabricator);
            };
        }
Exemplo n.º 2
0
        public DepletedNuclearModule(CyclopsNuclearModule module)
            : base("DepletedCyclopsNuclearModule",
                   "Depleted Cyclops Nuclear Reactor Module",
                   "Nuclear waste.")
        {
            nuclearModule = module;

            OnStartedPatching += () =>
            {
                if (!nuclearModule.IsPatched)
                {
                    nuclearModule.Patch();
                }
            };
        }
        public DepletedNuclearModule(CyclopsNuclearModule module)
            : base("DepletedCyclopsNuclearModule",
                   "Depleted Cyclops Nuclear Reactor Module",
                   "Nuclear waste.")
        {
            nuclearModule = module;

            OnStartedPatching += () =>
            {
                if (!nuclearModule.IsPatched)
                {
                    nuclearModule.Patch();
                }
            };

            OnFinishedPatching += () =>
            {
                LanguageHandler.SetLanguageLine(DepletedEventKey, "Nuclear Reactor Module depleted");
            };
        }
Exemplo n.º 4
0
        internal NuclearFabricator(CyclopsNuclearModule module)
            : base(NameID,
                   "Nuclear Fabricator",
                   "A specialized fabricator for safe handling of radioactive energy sources.")
        {
            nuclearModule = module;

            OnStartedPatching += () =>
            {
                if (!nuclearModule.IsPatched)
                {
                    nuclearModule.Patch();
                }
            };

            OnFinishedPatching += () =>
            {
                LanguageHandler.SetLanguageLine(HandOverKey, "Use Nuclear Fabricator");
                this.TreeTypeID = CreateCustomTree();
            };
        }
Exemplo n.º 5
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");
        }
Exemplo n.º 6
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);
            }
        }