/// <summary> /// Displays the Objects tab /// </summary> /// <param name="tiles">List of GameObjects to include in the Item List Tab</param> public static void ShowItemListTab(List <GameObject> tiles) { //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); } foreach (GameObject tile in tiles) { UITileList.AddObjectToItemPanel(tile); //TODO re-implement for new tile system if (tile.GetComponent <FloorTile>()) { Instance.ItemListTab.GetComponentInChildren <Text>().text = tile.name; } } Instance.ItemListTab.gameObject.SetActive(true); Instance.Button_Item_List(); Instance.itemListTabExists = true; }
/// <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(); } }
/// <summary> /// Hides the Item List Tab /// </summary> public static void HideItemListTab() { if (!Instance.itemListTabExists) { return; } SlideOptionsAndMoreTabs(Vector3.left); Instance.ItemListTab.gameObject.SetActive(false); Instance.Button_Stats(); Instance.itemListTabExists = false; Instance.ItemListTab.GetComponentInChildren <Text>().text = "Objects"; UITileList.ClearItemPanel(); }
/// <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; } }
/// <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(List <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.AddTileToItemPanel(tile, position); foreach (GameObject itemObject in objects) { UITileList.AddObjectToItemPanel(itemObject); } Instance.ItemListTab.GetComponentInChildren <Text>().text = tile.name; Instance.ItemListTab.gameObject.SetActive(true); Instance.Button_Item_List(); Instance.itemListTabExists = true; }