public static void Postfix(uGUI_InventoryTab __instance)
        {
            // This event happens whenever the player opens their PDA.

            if (__instance == null)
            {
                return;
            }

            PdaOverlayManager.FinishingConnectingToPda(__instance.equipment);
        }
        public static void Postfix(uGUI_InventoryTab __instance)
        {
            // This event happens whenever the player opens their PDA.
            // We will make a series of checks to see if what they have opened is the Base BioReactor item container.

            if (__instance == null)
            {
                return;
            }

            PdaOverlayManager.FinishingConnectingToPda(__instance.equipment);
        }
Beispiel #3
0
        public static bool Prefix(ref CyclopsUpgradeConsoleHUDManager __instance)
        {
            PdaOverlayManager.UpdateIconOverlays();

            CyclopsHUDManager hudMgr = CyclopsManager.GetManager(__instance.subRoot)?.HUD;

            if (hudMgr == null)
            {
                return(true);
            }

            hudMgr.SlowUpdate(__instance);

            return(false);
        }
        public void OnHandClick(GUIHand guiHand)
        {
            if (!this.Buildable.constructed)
            {
                return;
            }

            PdaOverlayManager.StartConnectingToPda(this.Modules);

            Player main = Player.main;
            PDA    pda  = main.GetPDA();

            Inventory.main.SetUsedStorage(this.Modules, false);
            pda.Open(PDATab.Inventory, null, new PDA.OnClose((PDA closingPda) => PdaOverlayManager.DisconnectFromPda()), -1f);
        }
Beispiel #5
0
        /// <summary>
        /// Opens the player's PDA and displays the equipment module slots.<para/>
        /// Upgrade Console must be fully constructed to access the equipment slots.
        /// </summary>
        protected void OpenEquipmentScreen()
        {
            if (!this.Buildable.constructed)
            {
                return;
            }

            PdaOverlayManager.StartConnectingToPda(this.Modules);

            Player      main = Player.main;
            global::PDA pda  = main.GetPDA();

            Inventory.main.SetUsedStorage(this.Modules, false);
            pda.Open(PDATab.Inventory, null, new global::PDA.OnClose((closingPdaEvent) => PdaOverlayManager.DisconnectFromPda()), -1f);
        }
        public static void UpdatePowerDisplays(CyclopsUpgradeConsoleHUDManager consoleHUDManager)
        {
            PdaOverlayManager.UpdateIconOverlays();

            CyclopsManager.GetManager(ref consoleHUDManager.subRoot)?.HUD?.SlowUpdate(consoleHUDManager);
        }
Beispiel #7
0
        public static void Postfix(UpgradeConsole __instance)
        {
            PDA pda = Player.main.GetPDA();

            pda.onClose = new PDA.OnClose((PDA closingPda) => PdaOverlayManager.DisconnectFromPda());
        }
Beispiel #8
0
 public static void Prefix(UpgradeConsole __instance)
 {
     PdaOverlayManager.StartConnectingToPda(__instance.modules);
 }
 /// <summary>
 /// Registers a <see cref="CreateIconOverlay" /> method that creates a new <see cref="IconOverlay" /> on demand.<para />
 /// This method will be invoked every time the PDA screen opens up on a Cyclops Upgrade Console that contains a module of the specified <see cref="TechType" />.
 /// </summary>
 /// <param name="techType">The upgrade module's techtype.</param>
 /// <param name="createEvent">A method that takes in a <see cref="uGUI_ItemIcon" /> and <see cref="InventoryItem" /> and returns a new <see cref="IconOverlay" />.</param>
 public void PdaIconOverlay(TechType techType, CreateIconOverlay createEvent)
 {
     PdaOverlayManager.RegisterHandlerCreator(techType, createEvent, Assembly.GetCallingAssembly().GetName().Name);
 }
 /// <summary>
 /// Registers a <see cref="IIconOverlayCreator" /> class that can create a new <see cref="IconOverlay" /> on demand.<para />
 /// This method will be invoked every time the PDA screen opens up on a Cyclops Upgrade Console that contains a module of the specified <see cref="TechType" />.
 /// </summary>
 /// <param name="techType">The upgrade module's techtype.</param>
 /// <param name="overlayCreator">A class that implements a method the <see cref="IIconOverlayCreator.CreateIconOverlay(uGUI_ItemIcon, InventoryItem)" /> method.</param>
 public void PdaIconOverlay(TechType techType, IIconOverlayCreator overlayCreator)
 {
     PdaOverlayManager.RegisterHandlerCreator(techType, overlayCreator.CreateIconOverlay, Assembly.GetCallingAssembly().GetName().Name);
 }