fixed controls, texts and added image, v1.4.1

This commit is contained in:
TAASONI3
2023-07-05 17:42:35 +02:00
parent 0dc2ff831f
commit d0d9a6847a
33 changed files with 11964 additions and 405 deletions

View File

@@ -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)