|
|
|
@ -24,6 +24,9 @@ public partial class InventoryItem
|
|
|
|
|
[Parameter]
|
|
|
|
|
public bool NoDrop { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string Image { get; set; }
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IStringLocalizer<InventoryItem> Localizer { get; set; }
|
|
|
|
|
|
|
|
|
@ -50,13 +53,16 @@ public partial class InventoryItem
|
|
|
|
|
|
|
|
|
|
internal void OnDrop()
|
|
|
|
|
{
|
|
|
|
|
if (NoDrop)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (Parent.CurrentDragItem != "null")
|
|
|
|
|
{
|
|
|
|
|
if(this.Item == Parent.CurrentDragItem)
|
|
|
|
|
if(Parent.CurrentDragIndex == 0)
|
|
|
|
|
{
|
|
|
|
|
this.Number = this.Number + Parent.CurrentDragNumber;
|
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
|
this.StackSize = Parent.CurrentDragStackSize;
|
|
|
|
|
Parent.ItemsInventory[this.Index - 1] = new InventoryListItem(this.Item, this.Index, this.Number, this.StackSize);
|
|
|
|
|
}
|
|
|
|
|
else if (this.Item == Parent.CurrentDragItem)
|
|
|
|
|
{
|
|
|
|
|
this.Number = this.Number + Parent.CurrentDragNumber;
|
|
|
|
|
Parent.CurrentInventoryItem.Number = 0;
|
|
|
|
@ -81,6 +87,7 @@ public partial class InventoryItem
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drop", ItemName = this.Item, Index = this.Index, Number = this.Number, StackSize = this.StackSize });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void OnDragEnd()
|
|
|
|
|