|
|
|
@ -20,7 +20,7 @@ namespace Blazor.Components
|
|
|
|
|
|
|
|
|
|
public void OnDragStart()
|
|
|
|
|
{
|
|
|
|
|
if(!NoDrop)
|
|
|
|
|
if(!this.NoDrop)
|
|
|
|
|
{
|
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
|
return;
|
|
|
|
@ -36,12 +36,13 @@ namespace Blazor.Components
|
|
|
|
|
|
|
|
|
|
public void OnDrop()
|
|
|
|
|
{
|
|
|
|
|
if (!NoDrop)
|
|
|
|
|
if (!this.NoDrop)
|
|
|
|
|
{
|
|
|
|
|
this.Items = Parent.CurrentDragItem;
|
|
|
|
|
NoDrop = true;
|
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
|
if (this.Items == null) return;
|
|
|
|
|
Parent.inventory.inventoryItems[this.Index] = this.Items;
|
|
|
|
|
Parent.Actions.Add(new InventoryAction("On Drop",this.Index,Items.item));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -55,6 +56,8 @@ namespace Blazor.Components
|
|
|
|
|
this.NoDrop= true;
|
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
|
Parent.Actions.Add(new InventoryAction("On drag start",this.Index,Items.item));
|
|
|
|
|
Parent.inventory.inventoryItems[this.Index] = this.Items;
|
|
|
|
|
Parent.update();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -64,11 +67,15 @@ namespace Blazor.Components
|
|
|
|
|
{
|
|
|
|
|
this.Items.Stack = this.Items.item.StackSize;
|
|
|
|
|
Parent.Actions.Add(new InventoryAction("On drag start",this.Index,Items.item));
|
|
|
|
|
Parent.inventory.inventoryItems[this.Index] = this.Items;
|
|
|
|
|
Parent.update();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.Items.Stack = total;
|
|
|
|
|
Parent.inventory.inventoryItems[this.Index] = this.Items;
|
|
|
|
|
Parent.update();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|