Added controls for gamepad, changed input & UI

This commit is contained in:
TAASONI3
2023-07-04 20:15:06 +02:00
parent 0b058f9248
commit 7aba856b17
48 changed files with 24176 additions and 15427 deletions

View File

@@ -343,82 +343,6 @@ namespace Assets.Scripts
}
return text;
}
override
public void move(InventorySlot startDrag, Inventory inventory, InventorySlot endDrag)
{
bool isSwap = false;
if (endDrag.place != place && endDrag.place != ItemPlace.BAG)
{
return;
}
if (endDrag.place == ItemPlace.BAG)
{
Item endItem = endDrag.getItem(endDrag.getCurrentBag());
if (endItem != null)
{
if (endItem is Equipment)
{
if (((Equipment)endItem).getPlace() != startDrag.place)
{
return;
}
}
else
{
if (startDrag.place == ItemPlace.BAG)
{
startDrag.setItem(endItem, endDrag.getCurrentBag());
}
else
{
if (endItem is Equipment)
{
startDrag.setEquip((Equipment)endItem);
inventory.calculateStatBoost(attributes, false);
inventory.calculateStatBoost(((Equipment)endItem).getAttributes(), true);
}
else
{
return;
}
}
}
isSwap = true;
}
endDrag.setItem(this, endDrag.getCurrentBag());
}
else
{
if (endDrag.getEquip() != null)
{
if (startDrag.place == ItemPlace.BAG)
{
startDrag.setItem(endDrag.getEquip(), startDrag.getCurrentBag());
isSwap = true;
inventory.calculateStatBoost(endDrag.getEquip().getAttributes(), false);
}
else
{
return;
}
}
inventory.calculateStatBoost(getAttributes(), true);
endDrag.setEquip(this);
}
if (!isSwap)
{
if (startDrag.place != ItemPlace.BAG)
{
inventory.calculateStatBoost(startDrag.getEquip().getAttributes(), false);
startDrag.removeEquip();
}
else
{
startDrag.removeItem();
}
}
}
}
}