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"); }
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); }
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; }
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); } }
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); }