Added controls for gamepad, changed input & UI
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -172,27 +172,6 @@ namespace Assets.Scripts
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void move(InventorySlot startDrag, Inventory inventory, InventorySlot endDrag)
|
||||
{
|
||||
if (endDrag.place != ItemPlace.BAG)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Item item = endDrag.getItem(endDrag.getCurrentBag());
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
startDrag.setItem(item, endDrag.getCurrentBag());
|
||||
}
|
||||
else
|
||||
{
|
||||
startDrag.removeItem();
|
||||
}
|
||||
|
||||
endDrag.setItem(this, startDrag.getCurrentBag());
|
||||
}
|
||||
|
||||
private void chooseItem()
|
||||
{
|
||||
int index = rand.Next(4);
|
||||
|
||||
Reference in New Issue
Block a user