|
|
|
@ -44,15 +44,50 @@ namespace BlazorApp.Components
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Parent.InventoryItems[Parent.CurrentDragIndex] = this.Item;
|
|
|
|
|
if (Parent.CurrentDragItem != null)
|
|
|
|
|
{
|
|
|
|
|
Item tmp = this.Item;
|
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
|
Parent.InventoryItems[this.Index] = this.Item;
|
|
|
|
|
Parent.CurrentDragItem = tmp;
|
|
|
|
|
Parent.CurrentDragIndex = this.Index;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnDragStart()
|
|
|
|
|
{
|
|
|
|
|
Parent.CurrentDragIndex = this.Index;
|
|
|
|
|
|
|
|
|
|
Parent.CurrentDragItem = this.Item;
|
|
|
|
|
if (this.Item != null)
|
|
|
|
|
{
|
|
|
|
|
if (!NoDrop)
|
|
|
|
|
{
|
|
|
|
|
Parent.CurrentDragIndex = this.Index;
|
|
|
|
|
this.Item = null;
|
|
|
|
|
Parent.InventoryItems[Index] = null;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Parent.CurrentDragIndex = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void OnDragEnd()
|
|
|
|
|
{
|
|
|
|
|
if (NoDrop || Parent.CurrentDragItem==null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (Parent.CurrentDragIndex != -1 && Parent.CurrentDragIndex!=this.Index)
|
|
|
|
|
{
|
|
|
|
|
Parent.InventoryItems[this.Index] = this.Item;
|
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
|
}
|
|
|
|
|
Parent.CurrentDragIndex = -1;
|
|
|
|
|
Parent.CurrentDragItem = null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|