Beispiel #1
0
        private void CopyInventoryBox(MenuInventoryBox _element, bool ignoreUnityUI)
        {
            if (ignoreUnityUI)
            {
                uiSlots = null;
            }
            else
            {
                uiSlots = _element.uiSlots;
            }

            isClickable                = _element.isClickable;
            textEffects                = _element.textEffects;
            outlineSize                = _element.outlineSize;
            inventoryBoxType           = _element.inventoryBoxType;
            numSlots                   = _element.numSlots;
            maxSlots                   = _element.maxSlots;
            limitToCategory            = _element.limitToCategory;
            limitToDefinedInteractions = _element.limitToDefinedInteractions;
            categoryID                 = _element.categoryID;
            selectItemsAfterTaking     = _element.selectItemsAfterTaking;
            displayType                = _element.displayType;
            uiHideStyle                = _element.uiHideStyle;
            categoryIDs                = _element.categoryIDs;
            linkUIGraphic              = _element.linkUIGraphic;

            UpdateLimitCategory();

            items = GetItemList();

            base.Copy(_element);

            Upgrade();
        }
        public override void AssignValues(List <ActionParameter> parameters)
        {
            if (useActive)
            {
                runtimeContainer = KickStarter.playerInput.activeContainer;
            }
            else
            {
                runtimeContainer = AssignFile <Container> (parameters, parameterID, constantID, container);
            }

            if (!useActive && setElement && !string.IsNullOrEmpty(menuName) && !string.IsNullOrEmpty(containerElementName))
            {
                string runtimeMenuName             = AssignString(parameters, menuParameterID, menuName);
                string runtimeContainerElementName = AssignString(parameters, elementParameterID, containerElementName);

                runtimeMenuName             = AdvGame.ConvertTokens(runtimeMenuName, Options.GetLanguage(), localVariables, parameters);
                runtimeContainerElementName = AdvGame.ConvertTokens(runtimeContainerElementName, Options.GetLanguage(), localVariables, parameters);

                MenuElement element = PlayerMenus.GetElementWithName(runtimeMenuName, runtimeContainerElementName);
                if (element != null)
                {
                    runtimeInventoryBox = element as MenuInventoryBox;
                }
            }
        }
        private void CopyInventoryBox(MenuInventoryBox _element)
        {
            uiSlots = _element.uiSlots;

            isClickable                = _element.isClickable;
            textEffects                = _element.textEffects;
            outlineSize                = _element.outlineSize;
            inventoryBoxType           = _element.inventoryBoxType;
            numSlots                   = _element.numSlots;
            maxSlots                   = _element.maxSlots;
            limitToCategory            = _element.limitToCategory;
            limitToDefinedInteractions = _element.limitToDefinedInteractions;
            categoryID                 = _element.categoryID;
            selectItemsAfterTaking     = _element.selectItemsAfterTaking;
            displayType                = _element.displayType;
            uiHideStyle                = _element.uiHideStyle;
            categoryIDs                = _element.categoryIDs;

            UpdateLimitCategory();

            PopulateList();

            base.Copy(_element);

            Upgrade();
        }
Beispiel #4
0
        public override MenuElement DuplicateSelf(bool fromEditor, bool ignoreUnityUI)
        {
            MenuInventoryBox newElement = CreateInstance <MenuInventoryBox>();

            newElement.Declare();
            newElement.CopyInventoryBox(this, ignoreUnityUI);
            return(newElement);
        }
Beispiel #5
0
        /**
         * Creates and returns a new MenuInventoryBox that has the same values as itself.
         * <returns>A new MenuInventoryBox with the same values as itself</return>
         */
        public override MenuElement DuplicateSelf()
        {
            MenuInventoryBox newElement = CreateInstance <MenuInventoryBox>();

            newElement.Declare();
            newElement.CopyInventoryBox(this);
            return(newElement);
        }
Beispiel #6
0
        public void CopyInventoryBox(MenuInventoryBox _element)
        {
            uiSlots                = _element.uiSlots;
            isClickable            = _element.isClickable;
            textEffects            = _element.textEffects;
            inventoryBoxType       = _element.inventoryBoxType;
            numSlots               = _element.numSlots;
            maxSlots               = _element.maxSlots;
            limitToCategory        = _element.limitToCategory;
            categoryID             = _element.categoryID;
            selectItemsAfterTaking = _element.selectItemsAfterTaking;
            displayType            = _element.displayType;

            PopulateList();

            base.Copy(_element);
        }
        private void CopyInventoryBox(MenuInventoryBox _element, bool ignoreUnityUI)
        {
            if (ignoreUnityUI)
            {
                uiSlots = null;
            }
            else
            {
                uiSlots = _element.uiSlots;
            }
            uiPointerState = _element.uiPointerState;

            isClickable                = _element.isClickable;
            textEffects                = _element.textEffects;
            outlineSize                = _element.outlineSize;
            inventoryBoxType           = _element.inventoryBoxType;
            numSlots                   = _element.numSlots;
            maxSlots                   = _element.maxSlots;
            limitToCategory            = _element.limitToCategory;
            limitToDefinedInteractions = _element.limitToDefinedInteractions;
            categoryID                 = _element.categoryID;
            selectItemsAfterTaking     = _element.selectItemsAfterTaking;
            displayType                = _element.displayType;
            uiHideStyle                = _element.uiHideStyle;
            categoryIDs                = _element.categoryIDs;
            linkUIGraphic              = _element.linkUIGraphic;

            UpdateLimitCategory();

            items = GetItemList();

            base.Copy(_element);

            if (Application.isPlaying)
            {
                if (!(inventoryBoxType == AC_InventoryBoxType.HotspotBased && maxSlots == 1))
                {
                    alternativeInputButton = "";
                }
            }

            Upgrade();
        }
Beispiel #8
0
        /**
         * <summary>Removes the current Player from the scene, and re-instantiates the correct Player prefab.</summary>
         * <param name = "ref_player">The new Player prefab to instantiate</param>
         * <param name = "ID">The ID number to assign the new Player</param>
         * <param name = "resetReferences">If True, then any references to the Player prefab in other AC scripts will be updated</param>
         * <param name = "_rotation">The new Player's rotation</param>
         * <param name = "keepInventory">If True, then the inventory items of the previous player (if there is one) will be transferred onto the new one, replacing any items held by the new one.</param>
         */
        public static void ResetPlayer(Player ref_player, int ID, bool resetReferences, Quaternion _rotation, bool keepInventory = false)
        {
            // Delete current player(s)
            if (GameObject.FindGameObjectsWithTag(Tags.player) != null)
            {
                foreach (GameObject playerOb in GameObject.FindGameObjectsWithTag(Tags.player))
                {
                    if (playerOb != null)
                    {
                        if (playerOb.GetComponent <Player>())
                        {
                            playerOb.GetComponent <Player>().ReleaseHeldObjects();
                        }
                        DestroyImmediate(playerOb);
                    }
                }
            }

            // Load new player
            if (ref_player)
            {
                SettingsManager settingsManager = AdvGame.GetReferences().settingsManager;

                Player newPlayer = (Player)Instantiate(ref_player, Vector3.zero, _rotation);
                newPlayer.ID   = ID;
                newPlayer.name = ref_player.name;
                playerPrefab   = newPlayer;
                DontDestroyOnLoad(newPlayer);

                if (KickStarter.runtimeInventory)
                {
                    KickStarter.runtimeInventory.SetNull();
                    KickStarter.runtimeInventory.RemoveRecipes();

                    // Clear inventory
                    if (settingsManager.playerSwitching == PlayerSwitching.Allow && !settingsManager.shareInventory)
                    {
                        if (!keepInventory)
                        {
                            KickStarter.runtimeInventory.localItems.Clear();
                        }
                    }

                    if (KickStarter.saveSystem != null && KickStarter.saveSystem.DoesPlayerDataExist(ID, false))
                    {
                        bool loadNewInventory = !settingsManager.shareInventory;
                        if (settingsManager.playerSwitching == PlayerSwitching.DoNotAllow || (!settingsManager.shareInventory && keepInventory))
                        {
                            loadNewInventory = false;
                        }
                        saveSystem.AssignPlayerData(ID, loadNewInventory);
                    }

                    // Menus
                    foreach (AC.Menu menu in PlayerMenus.GetMenus())
                    {
                        foreach (MenuElement element in menu.elements)
                        {
                            if (element is MenuInventoryBox)
                            {
                                MenuInventoryBox invBox = (MenuInventoryBox)element;
                                invBox.ResetOffset();
                            }
                        }
                    }
                }

                newPlayer.Initialise();
                if (KickStarter.eventManager != null)
                {
                    KickStarter.eventManager.Call_OnSetPlayer(newPlayer);
                }
            }

            // Reset player references
            if (resetReferences)
            {
                KickStarter.playerMovement.AssignFPCamera();
                KickStarter.stateHandler.IgnoreNavMeshCollisions();
                KickStarter.stateHandler.GatherObjects(false);
                KickStarter.stateHandler.UpdateAllMaxVolumes();
                _Camera[] cameras = FindObjectsOfType(typeof(_Camera)) as _Camera[];
                foreach (_Camera camera in cameras)
                {
                    camera.ResetTarget();
                }
            }
        }
        private void CopyInventoryBox(MenuInventoryBox _element)
        {
            uiSlots = _element.uiSlots;
            isClickable = _element.isClickable;
            textEffects = _element.textEffects;
            inventoryBoxType = _element.inventoryBoxType;
            numSlots = _element.numSlots;
            maxSlots = _element.maxSlots;
            limitToCategory = _element.limitToCategory;
            limitToDefinedInteractions = _element.limitToDefinedInteractions;
            categoryID = _element.categoryID;
            selectItemsAfterTaking = _element.selectItemsAfterTaking;
            displayType = _element.displayType;

            PopulateList ();

            base.Copy (_element);
        }
Beispiel #10
0
        public void ProcessInventoryBoxClick(AC.Menu _menu, MenuInventoryBox inventoryBox, int _slot, MouseState _mouseState)
        {
            if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.Default || inventoryBox.inventoryBoxType == AC_InventoryBoxType.DisplayLastSelected)
            {
                if (KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Multiple && KickStarter.playerInput.interactionMenuIsOn)
                {
                    KickStarter.playerMenus.SetInteractionMenus(false);
                    KickStarter.playerInteraction.ClickInvItemToInteract();
                }
                else if (KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Multiple && KickStarter.settingsManager.SelectInteractionMethod() == AC.SelectInteractions.CyclingCursorAndClickingHotspot)
                {
                    if (KickStarter.settingsManager.autoCycleWhenInteract && _mouseState == MouseState.SingleClick && (selectedItem == null || KickStarter.settingsManager.cycleInventoryCursors))
                    {
                        int originalIndex = KickStarter.playerInteraction.GetInteractionIndex();
                        KickStarter.playerInteraction.SetNextInteraction();
                        KickStarter.playerInteraction.SetInteractionIndex(originalIndex);
                    }

                    if (!KickStarter.settingsManager.cycleInventoryCursors && selectedItem != null)
                    {
                        inventoryBox.HandleDefaultClick(_mouseState, _slot, KickStarter.settingsManager.interactionMethod);
                    }
                    else if (_mouseState != MouseState.RightClick)
                    {
                        KickStarter.playerMenus.SetInteractionMenus(false);
                        KickStarter.playerInteraction.ClickInvItemToInteract();
                    }

                    if (KickStarter.settingsManager.autoCycleWhenInteract && _mouseState == MouseState.SingleClick)
                    {
                        KickStarter.playerInteraction.RestoreInventoryInteraction();
                    }
                }
                else if (KickStarter.settingsManager.interactionMethod != AC_InteractionMethod.ContextSensitive && KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Single)
                {
                    inventoryBox.HandleDefaultClick(_mouseState, _slot, AC_InteractionMethod.ContextSensitive);
                }
                else
                {
                    inventoryBox.HandleDefaultClick(_mouseState, _slot, KickStarter.settingsManager.interactionMethod);
                }

                _menu.Recalculate();
            }
            else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.Container)
            {
                inventoryBox.ClickContainer(_mouseState, _slot, KickStarter.playerInput.activeContainer);
                _menu.Recalculate();
            }
            else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.HostpotBased)
            {
                if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseHotspotThenInteraction)
                {
                    if (hoverItem != null)
                    {
                        Combine(hoverItem, inventoryBox.items [_slot]);
                    }
                    else if (KickStarter.playerInteraction.GetActiveHotspot())
                    {
                        InvItem _item = inventoryBox.items [_slot];
                        if (_item != null)
                        {
                            SelectItem(_item, SelectItemMode.Use);
                            _menu.TurnOff(false);
                            KickStarter.playerInteraction.ClickButton(InteractionType.Inventory, -2, _item.id);
                            KickStarter.playerCursor.ResetSelectedCursor();
                        }
                    }
                    else
                    {
                        Debug.LogWarning("Cannot handle inventory click since there is no active Hotspot.");
                    }
                }
                else
                {
                    Debug.LogWarning("This type of InventoryBox only works with the Choose Hotspot Then Interaction method of interaction.");
                }
            }
        }
        /**
         * <summary>Processes the clicking of an inventory item within a MenuInventoryBox element</summary>
         * <param name = "_menu">The Menu that contains the MenuInventoryBox element</param>
         * <param name = "inventoryBox">The MenuInventoryBox element that was clicked on</param>
         * <param name = "_slot">The index number of the MenuInventoryBox slot that was clicked on</param>
         * <param name = "_mouseState">The state of the mouse when the click occured (Normal, SingleClick, RightClick, DoubleClick, HeldDown, LetGo)</param>
         */
        public void ProcessInventoryBoxClick(AC.Menu _menu, MenuInventoryBox inventoryBox, int _slot, MouseState _mouseState)
        {
            if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.Default || inventoryBox.inventoryBoxType == AC_InventoryBoxType.DisplayLastSelected)
            {
                if (KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Multiple && KickStarter.playerMenus.IsInteractionMenuOn ())
                {
                    KickStarter.playerMenus.SetInteractionMenus (false);
                    ClickInvItemToInteract ();
                }
                else if (KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Multiple && KickStarter.settingsManager.SelectInteractionMethod () == AC.SelectInteractions.CyclingCursorAndClickingHotspot)
                {
                    if (KickStarter.settingsManager.autoCycleWhenInteract && _mouseState == MouseState.SingleClick && (selectedItem == null || KickStarter.settingsManager.cycleInventoryCursors))
                    {
                        int originalIndex = KickStarter.playerInteraction.GetInteractionIndex ();
                        KickStarter.playerInteraction.SetNextInteraction ();
                        KickStarter.playerInteraction.SetInteractionIndex (originalIndex);
                    }

                    if (!KickStarter.settingsManager.cycleInventoryCursors && selectedItem != null)
                    {
                        inventoryBox.HandleDefaultClick (_mouseState, _slot, KickStarter.settingsManager.interactionMethod);
                    }
                    else if (_mouseState != MouseState.RightClick)
                    {
                        KickStarter.playerMenus.SetInteractionMenus (false);
                        ClickInvItemToInteract ();
                    }

                    if (KickStarter.settingsManager.autoCycleWhenInteract && _mouseState == MouseState.SingleClick)
                    {
                        KickStarter.playerInteraction.RestoreInventoryInteraction ();
                    }

                }
                else if (KickStarter.settingsManager.interactionMethod != AC_InteractionMethod.ContextSensitive && KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Single)
                {
                    inventoryBox.HandleDefaultClick (_mouseState, _slot, AC_InteractionMethod.ContextSensitive);
                }
                else
                {
                    inventoryBox.HandleDefaultClick (_mouseState, _slot, KickStarter.settingsManager.interactionMethod);
                }

                _menu.Recalculate ();
            }
            else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.Container)
            {
                inventoryBox.ClickContainer (_mouseState, _slot, KickStarter.playerInput.activeContainer);
                _menu.Recalculate ();
            }
            else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.HotspotBased)
            {
                if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseHotspotThenInteraction)
                {
                    if (_menu.GetTargetInvItem () != null)
                    {
                        //Combine (hoverItem, inventoryBox.items [_slot]);
                        Combine (_menu.GetTargetInvItem (), inventoryBox.items [_slot + inventoryBox.GetOffset ()]);
                    }
                    else if (_menu.GetTargetHotspot ())
                    {
                        InvItem _item = inventoryBox.items [_slot + inventoryBox.GetOffset ()];
                        if (_item != null)
                        {
                            //SelectItem (_item, SelectItemMode.Use);
                            _menu.TurnOff (false);
                            KickStarter.playerInteraction.ClickButton (InteractionType.Inventory, -2, _item.id, _menu.GetTargetHotspot ());
                            KickStarter.playerCursor.ResetSelectedCursor ();
                        }
                    }
                    else
                    {
                        ACDebug.LogWarning ("Cannot handle inventory click since there is no active Hotspot.");
                    }
                }
                else
                {
                    ACDebug.LogWarning ("This type of InventoryBox only works with the Choose Hotspot Then Interaction method of interaction.");
                }
            }
        }
 /**
  * <summary>Sets the item currently being hovered over by the mouse cursor.</summary>
  * <param name = "item">The item to set</param>
  * <param name = "menuInventoryBox">The MenuInventoryBox that the item is displayed within</param>
  */
 public void SetHoverItem(InvItem item, MenuInventoryBox menuInventoryBox)
 {
     hoverItem = item;
     if (menuInventoryBox.displayType == ConversationDisplayType.IconOnly)
     {
         if (menuInventoryBox.inventoryBoxType == AC_InventoryBoxType.Container && selectedItem != null)
         {
             showHoverLabel = false;
         }
         else
         {
             showHoverLabel = true;
         }
     }
     else
     {
         showHoverLabel = false;
     }
 }
Beispiel #13
0
        public static void ResetPlayer(Player ref_player, int ID, bool resetReferences, Quaternion _rotation)
        {
            // Delete current player
            if (GameObject.FindWithTag(Tags.player))
            {
                DestroyImmediate(GameObject.FindWithTag(Tags.player));
            }

            // Load new player
            if (ref_player)
            {
                SettingsManager settingsManager = AdvGame.GetReferences().settingsManager;

                Player newPlayer = (Player)Instantiate(ref_player, Vector3.zero, _rotation);
                newPlayer.ID   = ID;
                newPlayer.name = ref_player.name;
                playerPrefab   = newPlayer;
                DontDestroyOnLoad(newPlayer);

                if (KickStarter.runtimeInventory)
                {
                    KickStarter.runtimeInventory.SetNull();
                    KickStarter.runtimeInventory.RemoveRecipes();

                    // Clear inventory
                    if (!settingsManager.shareInventory)
                    {
                        KickStarter.runtimeInventory.localItems.Clear();
                    }

                    if (KickStarter.saveSystem != null && KickStarter.saveSystem.DoesPlayerDataExist(ID, false))
                    {
                        saveSystem.AssignPlayerData(ID, !settingsManager.shareInventory);
                    }

                    // Menus
                    foreach (AC.Menu menu in PlayerMenus.GetMenus())
                    {
                        foreach (MenuElement element in menu.elements)
                        {
                            if (element is MenuInventoryBox)
                            {
                                MenuInventoryBox invBox = (MenuInventoryBox)element;
                                invBox.ResetOffset();
                            }
                        }
                    }
                }

                if (newPlayer.GetComponent <Animation>())
                {
                    // Hack: Force idle of Legacy characters
                    AdvGame.PlayAnimClip(newPlayer.GetComponent <Animation>(), AdvGame.GetAnimLayerInt(AnimLayer.Base), newPlayer.idleAnim, AnimationBlendMode.Blend, WrapMode.Loop, 0f, null, false);
                }
                else if (newPlayer.spriteChild)
                {
                    // Hack: update 2D sprites
                    if (newPlayer.spriteChild.GetComponent <FollowSortingMap>())
                    {
                        newPlayer.spriteChild.GetComponent <FollowSortingMap>().UpdateSortingMap();
                    }
                    newPlayer.UpdateSpriteChild(settingsManager.IsTopDown(), settingsManager.IsUnity2D());
                }
                newPlayer.animEngine.PlayIdle();
            }

            // Reset player references
            if (resetReferences)
            {
                KickStarter.sceneSettings.ResetPlayerReference();
                KickStarter.playerMovement.AssignFPCamera();
                KickStarter.stateHandler.IgnoreNavMeshCollisions();
                KickStarter.stateHandler.GatherObjects(false);
                _Camera[] cameras = FindObjectsOfType(typeof(_Camera)) as _Camera[];
                foreach (_Camera camera in cameras)
                {
                    camera.ResetTarget();
                }
            }
        }
Beispiel #14
0
        private void UpdateElements(AC.Menu menu, int languageNumber)
        {
            if (!menu.HasTransition () && menu.IsFading ())
            {
                // Stop until no longer "fading" so that it appears in right place
                return;
            }

            if (KickStarter.settingsManager.inputMethod == InputMethod.MouseAndKeyboard && menu.IsPointInside (KickStarter.playerInput.GetInvertedMouse ()))
            {
                elementIdentifier = menu.id.ToString ();
            }

            foreach (MenuElement element in menu.elements)
            {
                if ((element.GetNumSlots () == 0 || !element.isVisible) && menu.menuSource != MenuSource.AdventureCreator)
                {
                    element.HideAllUISlots ();
                }

                for (int i=0; i<element.GetNumSlots (); i++)
                {
                    if (KickStarter.stateHandler.gameState == GameState.Cutscene)
                    {
                        element.PreDisplay (i, languageNumber, false);
                    }
                    else
                    {
                        element.PreDisplay (i, languageNumber, menu.IsPointerOverSlot (element, i, KickStarter.playerInput.GetInvertedMouse ()));
                    }

                    if (element.isVisible && SlotIsInteractive (menu, element, i))
                    {
                        if ((!interactionMenuIsOn || menu.appearType == AppearType.OnInteraction)
                            && (KickStarter.playerInput.GetDragState () == DragState.None || (KickStarter.playerInput.GetDragState () == DragState.Inventory && CanElementBeDroppedOnto (element))))
                        {
                            if (KickStarter.sceneSettings && element.hoverSound && lastElementIdentifier != (menu.id.ToString () + element.ID.ToString () + i.ToString ()))
                            {
                                KickStarter.sceneSettings.PlayDefaultSound (element.hoverSound, false);
                            }

                            elementIdentifier = menu.id.ToString () + element.ID.ToString () + i.ToString ();
                        }

                        if (KickStarter.stateHandler.gameState != GameState.Cutscene)
                        {
                            if (element is MenuInventoryBox)
                            {
                                //if (KickStarter.stateHandler.gameState == GameState.Normal)
                                if (KickStarter.stateHandler.gameState == GameState.Normal || KickStarter.stateHandler.gameState == GameState.Paused)
                                {
                                    if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot && KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Single && KickStarter.runtimeInventory.selectedItem == null)
                                    {
                                        KickStarter.playerCursor.ResetSelectedCursor ();
                                    }

                                    MenuInventoryBox inventoryBox = (MenuInventoryBox) element;
                                    if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.HotspotBased)
                                    {
                                        if (KickStarter.cursorManager.addHotspotPrefix)
                                        {
                                            if (KickStarter.runtimeInventory.hoverItem != null)
                                            {
                                                hotspotLabel = KickStarter.runtimeInventory.hoverItem.GetLabel (languageNumber);
                                            }
                                            else
                                            {
                                                hotspotLabel = KickStarter.playerInteraction.GetLabel (languageNumber);
                                            }

                                            if ((KickStarter.runtimeInventory.selectedItem == null && !interactionMenuIsOn) || interactionMenuIsOn)
                                            {
                                                hotspotLabel = KickStarter.runtimeInventory.GetHotspotPrefixLabel (inventoryBox.GetItem (i), inventoryBox.GetLabel (i, languageNumber), languageNumber) + hotspotLabel;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        foundMouseOverInventory = true;

                                        if (!mouseOverInteractionMenu)
                                        {
                                            InvItem newHoverItem = inventoryBox.GetItem (i);
                                            KickStarter.runtimeInventory.SetHoverItem (newHoverItem, inventoryBox);
                                            if (oldHoverItem != newHoverItem)
                                            {
                                                KickStarter.runtimeInventory.MatchInteractions ();
                                                KickStarter.playerInteraction.RestoreInventoryInteraction ();
                                                activeInventoryBox = inventoryBox;
                                                activeInventoryBoxMenu = menu;

                                                if (interactionMenuIsOn)
                                                {
                                                    SetInteractionMenus (false);
                                                }
                                            }
                                        }

                                        if (KickStarter.settingsManager.SelectInteractionMethod () == SelectInteractions.CyclingCursorAndClickingHotspot)
                                        {}
                                        else
                                        {
                                            if (!interactionMenuIsOn)
                                            {
                                                if (inventoryBox.displayType == ConversationDisplayType.IconOnly)
                                                {
                                                    if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
                                                    {
                                                        if (KickStarter.playerCursor.GetSelectedCursor () >= 0)
                                                        {
                                                            hotspotLabel = KickStarter.cursorManager.GetCursorIconFromID (KickStarter.playerCursor.GetSelectedCursorID ()).label + " " + inventoryBox.GetLabel (i, languageNumber);
                                                        }
                                                        else if (KickStarter.runtimeInventory.selectedItem == null)
                                                        {
                                                            hotspotLabel = inventoryBox.GetLabel (i, languageNumber);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (KickStarter.runtimeInventory.hoverItem != null && KickStarter.runtimeInventory.hoverItem == KickStarter.runtimeInventory.selectedItem)
                                                        {
                                                            hotspotLabel = inventoryBox.GetLabel (i, languageNumber);
                                                        }
                                                    }
                                                }
                                            }
                                            else if (KickStarter.runtimeInventory.selectedItem != null)
                                            {
                                                hotspotLabel = KickStarter.runtimeInventory.selectedItem.GetLabel (languageNumber);
                                            }
                                        }
                                    }
                                }
                            }
                            else if (element is MenuCrafting)
                            {
                                if (KickStarter.stateHandler.gameState == GameState.Normal)
                                {
                                    MenuCrafting crafting = (MenuCrafting) element;
                                    KickStarter.runtimeInventory.SetHoverItem (crafting.GetItem (i), crafting);

                                    if (KickStarter.runtimeInventory.hoverItem != null)
                                    {
                                        if (!interactionMenuIsOn)
                                        {
                                            hotspotLabel = crafting.GetLabel (i, languageNumber);
                                        }
                                        else if (KickStarter.runtimeInventory.selectedItem != null)
                                        {
                                            hotspotLabel = KickStarter.runtimeInventory.selectedItem.GetLabel (languageNumber);
                                        }
                                    }
                                }
                            }
                            else if (element is MenuInteraction)
                            {
                                if (KickStarter.runtimeInventory.hoverItem != null)
                                {
                                    hotspotLabel = KickStarter.runtimeInventory.hoverItem.GetLabel (languageNumber);
                                }
                                else
                                {
                                    hotspotLabel = KickStarter.playerInteraction.GetLabel (languageNumber);
                                }
                                if (KickStarter.cursorManager.addHotspotPrefix && interactionMenuIsOn && KickStarter.settingsManager.SelectInteractionMethod () == SelectInteractions.ClickingMenu)
                                {
                                    MenuInteraction interaction = (MenuInteraction) element;
                                    hotspotLabel = KickStarter.cursorManager.GetLabelFromID (interaction.iconID, languageNumber) + hotspotLabel;
                                }
                            }
                            else if (element is MenuDialogList)
                            {
                                if (KickStarter.stateHandler.gameState == GameState.DialogOptions)
                                {
                                    MenuDialogList dialogList = (MenuDialogList) element;
                                    if (dialogList.displayType == ConversationDisplayType.IconOnly)
                                    {
                                        hotspotLabel = dialogList.GetLabel (i, languageNumber);
                                    }
                                }
                            }
                            else if (element is MenuButton)
                            {
                                MenuButton button = (MenuButton) element;
                                if (button.hotspotLabel != "")
                                {
                                    hotspotLabel = button.GetHotspotLabel (languageNumber);
                                }
                            }
                        }
                    }
                }
            }
        }