fixed controls, texts and added image, v1.4.1
This commit is contained in:
@@ -75,7 +75,29 @@ namespace Assets.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
private Item getItemForTooltip()
|
||||
public void showTooltipSelect(){
|
||||
GameObject current = EventSystem.current.currentSelectedGameObject;
|
||||
Item item = current.GetComponent<InventorySlot>().getItemForTooltip();
|
||||
if (item != null)
|
||||
{
|
||||
inventory.itemDisplay.transform.Find("itemImage").GetComponent<RawImage>().texture = item.image;
|
||||
inventory.itemDisplay.transform.Find("itemImage").GetComponent<RawImage>().color = item.rarityColor;
|
||||
inventory.itemDisplay.transform.Find("itemName").GetComponent<Text>().text = TextHandler.translate(item.getName());
|
||||
inventory.itemDisplay.transform.Find("itemStats").GetComponent<Text>().text = item.getInformation();
|
||||
int changeY = 0;
|
||||
if (inventory.itemDisplay.transform.localScale == new Vector3(0,0,0))
|
||||
{
|
||||
if (Input.mousePosition.y < Screen.height / 2)
|
||||
{
|
||||
changeY = -150;
|
||||
}
|
||||
inventory.itemDisplay.transform.position = new Vector3(current.transform.position.x - 250, current.transform.position.y + changeY, 0);
|
||||
}
|
||||
inventory.itemDisplay.transform.localScale = new Vector3(1, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Item getItemForTooltip()
|
||||
{
|
||||
Item item = null;
|
||||
if (place == ItemPlace.BAG)
|
||||
|
||||
Reference in New Issue
Block a user