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

            // Patch in new items
            var booster = new BioReactorBooster();

            booster.Patch();

            var reactor = new CyBioReactor(booster);

            reactor.Patch();

            // Apply Harmony patches
            var harmony = new Harmony("com.morecyclopsupgrades.psmod");

            harmony.PatchAll(Assembly.GetExecutingAssembly());

            // Register with MoreCyclopsUpgrades
            MCUServices.Register.AuxCyclopsManager <BioAuxCyclopsManager>((SubRoot cyclops) => new BioAuxCyclopsManager(cyclops));
            MCUServices.Register.CyclopsCharger <BioChargeHandler>((SubRoot cyclops) => new BioChargeHandler(booster.TechType, cyclops));
            MCUServices.Register.CyclopsUpgradeHandler((SubRoot cyclops) => new BioBoosterUpgradeHandler(booster.TechType, cyclops));
            MCUServices.Register.PdaIconOverlay(booster.TechType, (uGUI_ItemIcon icon, InventoryItem upgradeModule) => new BoosterOverlay(icon, upgradeModule));

            // Register config for display
            CyBioReactorDisplayHandler.Config = OptionsPanelHandler.Main.RegisterModOptions <CyBioConfig>();

            MCUServices.Logger.Info("Finished Patching");
        }
예제 #2
0
        private static void PatchBioEnergy(bool enableBioreactors)
        {
            if (enableBioreactors)
            {
                QuickLogger.Info("Patching Cyclops Bioreactor");
            }
            else
            {
                QuickLogger.Info("Cyclops Bioreactor disabled by config settings");
            }

            CyBioReactor.PatchCyBioReactor(enableBioreactors);
        }
예제 #3
0
        public void OnHandClick(GUIHand guiHand)
        {
            if (OverLimit)
            {
                ErrorMessage.AddMessage(CyBioReactor.OverLimitString());
                return;
            }

            PDA pda = Player.main.GetPDA();

            Inventory.main.SetUsedStorage(Container);
            pda.Open(PDATab.Inventory, null, new PDA.OnClose(CyOnPdaClose), 4f);

            pdaIsOpen = true;
        }
예제 #4
0
        public static void Patch()
        {
            try
            {
                QuickLogger.Info("Started patching " + QuickLogger.GetAssemblyVersion());
#if DEBUG
                QuickLogger.DebugLogsEnabled = true;
#else
                QuickLogger.DebugLogsEnabled = false;
#endif
                var booster = new BioReactorBooster();
                booster.Patch();

                var reactor = new CyBioReactor(booster);
                reactor.Patch();

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

                MCUServices.Register.AuxCyclopsManager <BioAuxCyclopsManager>((SubRoot cyclops) =>
                {
                    return(new BioAuxCyclopsManager(cyclops, booster.TechType, reactor.TechType));
                });

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

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

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

                QuickLogger.Info("Finished Patching");
            }
            catch (Exception ex)
            {
                QuickLogger.Error(ex);
            }
        }
예제 #5
0
        public void OnHandHover(GUIHand guiHand)
        {
            if (!Buildable.constructed)
            {
                return;
            }

            HandReticle main = HandReticle.main;

            if (OverLimit)
            {
                main.SetInteractText(CyBioReactor.OverLimitString());
            }
            else
            {
                main.SetInteractText(CyBioReactor.OnHoverFormatString(Mathf.FloorToInt(Battery._charge), Battery._capacity, (this.MaterialsProcessing.Count > 0 ? "+" : "")));
            }

            main.SetIcon(HandReticle.IconType.Hand, 1f);
        }