|
|
|
@ -13,9 +13,6 @@ namespace BlazorApp1.Components
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public bool NoDrop { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public int Stack { get; set; }
|
|
|
|
|
|
|
|
|
|
[CascadingParameter]
|
|
|
|
|
public InventoryComponent Parent { get; set; }
|
|
|
|
@ -42,6 +39,9 @@ namespace BlazorApp1.Components
|
|
|
|
|
|
|
|
|
|
internal void OnDrop()
|
|
|
|
|
{
|
|
|
|
|
Item CurrentHoldItem = new Item();//A remplir avec les valeurs de CurrentDragItem
|
|
|
|
|
//CurrentHoldItem = Parent.CurrentDragItem;
|
|
|
|
|
|
|
|
|
|
if (NoDrop)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
@ -49,16 +49,17 @@ namespace BlazorApp1.Components
|
|
|
|
|
|
|
|
|
|
if (this.Item != null)
|
|
|
|
|
{
|
|
|
|
|
if (this.Item.Name == Parent.CurrentDragItem.Name)
|
|
|
|
|
if (this.Item.Name == CurrentHoldItem.Name)
|
|
|
|
|
{
|
|
|
|
|
this.Stack = this.Stack + 1;
|
|
|
|
|
CurrentHoldItem.Stack = CurrentHoldItem.Stack + this.Item.Stack;
|
|
|
|
|
this.Item = CurrentHoldItem;
|
|
|
|
|
}
|
|
|
|
|
else { return; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
|
this.Item = CurrentHoldItem;
|
|
|
|
|
|
|
|
|
|
Parent.Actions.Add(new CraftingAction { Action = "Drop", Item = this.Item, Index = this.Index });
|
|
|
|
|
}
|
|
|
|
|