|
|
@ -22,10 +22,13 @@ namespace Blazor.Components
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!NoDrop)
|
|
|
|
if(!NoDrop)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Parent.CurrentDragItem = this.Items;
|
|
|
|
Parent.CurrentDragItem = this.Items;
|
|
|
|
Parent.inventory.inventoryItems[Index] = null;
|
|
|
|
Parent.inventory.inventoryItems[this.Index] = null;
|
|
|
|
|
|
|
|
this.NoDrop = false;
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction("On drag start",this.Index,this));
|
|
|
|
Parent.update();
|
|
|
|
Parent.update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -37,14 +40,20 @@ namespace Blazor.Components
|
|
|
|
this.Items = Parent.CurrentDragItem;
|
|
|
|
this.Items = Parent.CurrentDragItem;
|
|
|
|
NoDrop = true;
|
|
|
|
NoDrop = true;
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction("On Drop",this.Index,this));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(Parent.CurrentDragItem == null)
|
|
|
|
if (Parent.CurrentDragItem != this.Items)
|
|
|
|
{
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Parent.CurrentDragItem.item.Id != this.Items.item.Id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InventoryItem tmp = Parent.CurrentDragItem;
|
|
|
|
this.Items = Parent.CurrentDragItem;
|
|
|
|
Parent.CurrentDragItem = this.Items;
|
|
|
|
this.NoDrop= true;
|
|
|
|
this.Items = tmp;
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction("On drag start",this.Index,this));
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -52,22 +61,24 @@ namespace Blazor.Components
|
|
|
|
if (total >this.Items.item.StackSize)
|
|
|
|
if (total >this.Items.item.StackSize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.Items.Stack = this.Items.item.StackSize;
|
|
|
|
this.Items.Stack = this.Items.item.StackSize;
|
|
|
|
Parent.CurrentDragItem.Stack=total - this.Items.item.StackSize;
|
|
|
|
Parent.Actions.Add(new InventoryAction("On drag start",this.Index,this));
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.Items.Stack = total;
|
|
|
|
this.Items.Stack = total;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
internal void OnDragEnter()
|
|
|
|
internal void OnDragEnter()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Enter", Item = this, Index = this.Index });
|
|
|
|
Parent.Actions.Add(new InventoryAction("Drag Enter",this.Index,this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal void OnDragLeave()
|
|
|
|
internal void OnDragLeave()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Leave", Item = this, Index = this.Index });
|
|
|
|
Parent.Actions.Add(new InventoryAction("Drag Leave",this.Index,this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|