Exemplo n.º 1
0
    void Update()
    {
        //背景音樂調整
        GameObject.Find("GameManager").GetComponent <AudioSource>().volume = musicAdjValue.value;

        for (int i = 0; i < toggleInventoryKeys.Length; i++)
        {
            if (Input.GetKeyDown(toggleInventoryKeys[i]))
            {
                itemTooltip.HideTooltip(); //不論開啟關閉物品欄,tooltip始終保持關閉,直到游標指定物品才顯示
                inventoryPanelGameObject.SetActive(!inventoryPanelGameObject.activeSelf);
                break;
            }
        }

        for (int i = 0; i < toggleEquipmentKeys.Length; i++)
        {
            if (Input.GetKeyDown(toggleEquipmentKeys[i]))
            {
                itemTooltip.HideTooltip(); //不論開啟關閉裝備欄,tooltip始終保持關閉,直到游標指定物品才顯示
                equipmentPanelGameObject.SetActive(!equipmentPanelGameObject.activeSelf);
                break;
            }
        }

        for (int i = 0; i < toggleMinimenuKeys.Length; i++)
        {
            if (Input.GetKeyDown(toggleMinimenuKeys[i]))
            {
                minimenuPanelGameObject.SetActive(!minimenuPanelGameObject.activeSelf);
                break;
            }
        }

        for (int i = 0; i < toggleSettingKeys.Length; i++)
        {
            if (Input.GetKeyDown(toggleSettingKeys[i]))
            {
                settingPanelGameObject.SetActive(!settingPanelGameObject.activeSelf);
                break;
            }
        }

        for (int i = 0; i < toggleMissionKeys.Length; i++)
        {
            if (Input.GetKeyDown(toggleMissionKeys[i]))
            {
                missionPanelGameObject.SetActive(!missionPanelGameObject.activeSelf);
                break;
            }
        }

        for (int i = 0; i < hotkeySlot.Length; i++)
        {
            if (Input.GetKeyDown(hotkeySlot[i]._key))
            {
                hotkeySlot[i]._button.onClick.Invoke();
            }
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        if (InputManager.Pause())
        {
            if (!craftingEnabled)
            {
                pauseEnabled = !pauseEnabled;

                if (pauseEnabled)
                {
                    PausedGame();
                    inventoryUI.SetActive(true);
                    screenUI.GetComponent <Canvas>().enabled = false;
                    prompt.SetActive(false);
                }
                else if (!pauseEnabled)
                {
                    UnpausedGame();
                    inventoryUI.SetActive(false);
                    screenUI.GetComponent <Canvas>().enabled = true;
                    tooltip.HideTooltip();
                    armorTooltip.HideTooltip();
                    //the object in itemslot has to shrink
                }
            }
        }

        if (pB.atForge == true)
        {
            if (InputManager.Interact())
            {
                craftingEnabled = !craftingEnabled;

                if (craftingEnabled)
                {
                    PausedGame();
                    pB.prompt.SetActive(false);
                    craftingUI.SetActive(true);
                    inventoryUI.SetActive(true);
                    screenUI.GetComponent <Canvas>().enabled = false;
                }
                else if (!craftingEnabled)
                {
                    UnpausedGame();
                    craftingUI.SetActive(false);
                    notEnough.SetActive(false);
                    pB.prompt.SetActive(true);
                    inventoryUI.SetActive(false);
                    screenUI.GetComponent <Canvas>().enabled = true;
                    tooltip.HideTooltip();
                    armorTooltip.HideTooltip();
                }
            }
        }
    }
Exemplo n.º 3
0
    public void ShowTooltip(GameObject go)
    {
        if (go.GetComponent <ItemDrop>() == null)
        {
            _itemTooltip.HideTooltip();
        }

        if (this.gameObject != go)
        {
            return;
        }

        _itemTooltip.ShowTooltip(_item);
    }
Exemplo n.º 4
0
 private void HideTooltip(InventorySlotUI itemSlot)
 {
     if (itemTooltip.gameObject.activeSelf)
     {
         itemTooltip.HideTooltip();
     }
 }
Exemplo n.º 5
0
 private void HideTooltip(BaseItemSlot itemSlot)
 {
     if (itemTooltip.gameObject.activeSelf)
     {
         itemTooltip.HideTooltip();
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Callback for highlighting a new item.
        /// Updates the text box on the main form.
        /// </summary>
        /// <param name="sender">sender object</param>
        /// <param name="e">SackPanelEventArgs data</param>
        private void NewItemHighlightedCallback(object sender, SackPanelEventArgs e)
        {
            Item           item      = e.Item;
            SackCollection sack      = e.Sack;
            SackPanel      sackPanel = (SackPanel)sender;

            if (item == null)
            {
                // Only do something if this sack is the "owner" of the current item highlighted.
                if (sack == this.lastSackHighlighted)
                {
                    this.itemText.Text = string.Empty;

                    // hide the tooltip
                    ItemTooltip.HideTooltip();
                }
            }
            else
            {
                var itt = ItemTooltip.ShowTooltip(this.ServiceProvider, item, sackPanel);

                this.itemText.ForeColor = itt.Data.Item.GetColor(itt.Data.BaseItemInfoDescription);
                this.itemText.Text      = itt.Data.FullNameBagTooltipClean;
            }

            this.lastSackHighlighted      = sack;
            this.lastSackPanelHighlighted = sackPanel;
        }
Exemplo n.º 7
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.I) || Input.GetKeyDown(KeyCode.C))
     {
         _charPanel.SetActive(!_charPanel.activeSelf);
         _itemTooltip.HideTooltip();
         _statTooltip.HideTooltip();
     }
 }
Exemplo n.º 8
0
    private void SetAllWindowsActive(bool pSetActive = true)
    {
        playerIsInShop = pSetActive;

        _inventory.SetActive(pSetActive);
        _characterPanel.SetActive(pSetActive);

        if (!pSetActive)
        {
            _statTooltip.HideTooltip();
            _itemTooltip.HideTooltip();
        }
    }
Exemplo n.º 9
0
 private void Update()
 {
     #region closeMenues
     if (_activeMenu == ActiveMenuEnum.Inventory)
     {
         if (Input.GetButtonDown("Inventory") || Input.GetButtonDown("Cancel"))
         {
             DisableMenu(_inventory);
             _itemTooltip.HideTooltip();
             OnInventoryClose?.Invoke();
         }
         return;
     }
     if (_activeMenu == ActiveMenuEnum.Pause)
     {
         if (Input.GetButtonDown("Cancel"))
         {
             _pauseMenu.GetComponent <PauseMenu>().Back();
         }
         return;
     }
     #endregion
     #region openMenues
     if (_activeMenu == ActiveMenuEnum.None)
     {
         if (Input.GetButtonDown("Inventory"))
         {
             _activeMenu = ActiveMenuEnum.Inventory;
             _inventory.SetActive(true);
             ToggleTime();
             return;
         }
         if (Input.GetButtonDown("Cancel"))
         {
             _activeMenu = ActiveMenuEnum.Pause;
             _pauseMenu.SetActive(true);
             ToggleTime();
         }
     }
     #endregion
 }
Exemplo n.º 10
0
 private void HideTooltip(ItemSlot pItemSlot)
 {
     _itemTooltip.HideTooltip();
 }
Exemplo n.º 11
0
 public void OnPointerExit(PointerEventData eventData)
 {
     itemTooltip.HideTooltip();
 }
Exemplo n.º 12
0
 private void HideToolTip(ItemSlot itemSlot)
 {
     itemTooltip.HideTooltip();
 }
Exemplo n.º 13
0
 public void OnPointerExit(PointerEventData eventData)
 {
     tooltip.HideTooltip();
     Shrink();
 }
Exemplo n.º 14
0
 public void OnPointerExit(PointerEventData eventData)
 {
     OnPointerExitEvent(this);
     itemTooltip.HideTooltip();
 }
Exemplo n.º 15
0
 private void HideTooltip(BaseItemSlot itemSlot)
 {
     itemTooltip.HideTooltip();
 }
Exemplo n.º 16
0
 public void HideTooltip(BaseItemSlot itemSlot)
 {
     itemTooltip.HideTooltip();
 }
Exemplo n.º 17
0
 public void HideTooltip(InventorySlot inventorySlot)
 {
     itemTooltip.HideTooltip();
 }