Exemple #1
0
        /// <summary>
        ///     Displays the Objects tab
        /// </summary>
        /// <param name="objects">List of GameObjects to include in the Item List Tab</param>
        /// <param name="tile">Tile to include in the Item List Tab</param>
        /// <param name="position">Position of objects</param>
        public static void ShowItemListTab(IEnumerable <GameObject> objects, LayerTile tile, Vector3 position)
        {
            var tab = Instance.ClientTabs[ClientTabType.ItemList];

            if (!UITileList.Instance)
            {
                UITileList.Instance = tab.GetComponentsInChildren <UITileList>(true)[0];
            }

            if (!Instance.itemListTabExists)
            {
                Instance.UnhideTab(ClientTabType.ItemList);
            }

            UITileList.ClearItemPanel();
            UITileList.UpdateTileList(objects, tile, position);

            if (!UITileList.IsEmpty())
            {
                Instance.SelectTab(ClientTabType.ItemList);
            }
            if (!Instance.rolledOut)
            {
                Instance.OpenTabWindow();
            }
        }
Exemple #2
0
        /// <summary>
        ///     Displays the Objects tab
        /// </summary>
        /// <param name="objects">List of GameObjects to include in the Item List Tab</param>
        /// <param name="tile">Tile to include in the Item List Tab</param>
        /// <param name="position">Position of objects</param>
        public static void ShowItemListTab(IEnumerable <GameObject> objects, LayerTile tile, Vector3 position)
        {
            //If window exists, player is perhaps alt-clicking at another tile. Only slide tabs if Item List Tab doesn't already exist.
            if (Instance.itemListTabExists)
            {
                UITileList.ClearItemPanel();
            }
            else
            {
                SlideOptionsAndMoreTabs(Vector3.right);
            }

            UITileList.UpdateTileList(objects, tile, position);

            if (!UITileList.IsEmpty())
            {
                Instance.ItemListTab.GetComponentInChildren <Text>().text = tile ? tile.name : "Objects";
                Instance.ItemListTab.gameObject.SetActive(true);
                Instance.Button_Item_List();
                Instance.itemListTabExists = true;
            }
        }