|
|
@ -17,6 +17,9 @@ public partial class InventoryItem
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
public int Number { get; set; }
|
|
|
|
public int Number { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
|
|
|
public int StackSize { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
public bool NoDrop { get; set; }
|
|
|
|
public bool NoDrop { get; set; }
|
|
|
|
|
|
|
|
|
|
|
@ -29,7 +32,7 @@ public partial class InventoryItem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Enter", ItemName = this.Item, Index = this.Index, Number = this.Number });
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Enter", ItemName = this.Item, Index = this.Index, Number = this.Number, StackSize = this.StackSize });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal void OnDragLeave()
|
|
|
|
internal void OnDragLeave()
|
|
|
@ -38,7 +41,7 @@ public partial class InventoryItem
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Leave", ItemName = this.Item, Index = this.Index, Number = this.Number });
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Leave", ItemName = this.Item, Index = this.Index, Number = this.Number, StackSize = this.StackSize });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal void OnDrop()
|
|
|
|
internal void OnDrop()
|
|
|
@ -54,22 +57,26 @@ public partial class InventoryItem
|
|
|
|
this.Number = this.Number + Parent.CurrentDragNumber;
|
|
|
|
this.Number = this.Number + Parent.CurrentDragNumber;
|
|
|
|
Parent.CurrentInventoryItem.Number = 0;
|
|
|
|
Parent.CurrentInventoryItem.Number = 0;
|
|
|
|
Parent.CurrentInventoryItem.Item = "null";
|
|
|
|
Parent.CurrentInventoryItem.Item = "null";
|
|
|
|
Parent.ItemsInventory[Parent.CurrentInventoryItem.Index-1] = new InventoryListItem(Parent.CurrentInventoryItem.Item, Parent.CurrentInventoryItem.Index, Parent.CurrentInventoryItem.Number);
|
|
|
|
Parent.CurrentInventoryItem.StackSize = 0;
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "End", ItemName = Parent.CurrentInventoryItem.Item, Index = Parent.CurrentInventoryItem.Index, Number = Parent.CurrentInventoryItem.Number });
|
|
|
|
Parent.ItemsInventory[Parent.CurrentInventoryItem.Index-1] = new InventoryListItem(Parent.CurrentInventoryItem.Item, Parent.CurrentInventoryItem.Index, Parent.CurrentInventoryItem.Number, Parent.CurrentInventoryItem.StackSize);
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "End", ItemName = Parent.CurrentInventoryItem.Item, Index = Parent.CurrentInventoryItem.Index, Number = Parent.CurrentInventoryItem.Number, StackSize = Parent.CurrentInventoryItem.StackSize });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string tmpItem = this.Item;
|
|
|
|
string tmpItem = this.Item;
|
|
|
|
int tmpNumber = this.Number;
|
|
|
|
int tmpNumber = this.Number;
|
|
|
|
Parent.ItemsInventory[Parent.CurrentDragIndex-1] = new InventoryListItem(tmpItem, Parent.CurrentDragIndex, tmpNumber);
|
|
|
|
int tmpStackSize = this.StackSize;
|
|
|
|
|
|
|
|
Parent.ItemsInventory[Parent.CurrentDragIndex-1] = new InventoryListItem(tmpItem, Parent.CurrentDragIndex, tmpNumber, tmpStackSize);
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
this.Number = Parent.CurrentDragNumber;
|
|
|
|
this.Number = Parent.CurrentDragNumber;
|
|
|
|
|
|
|
|
this.StackSize = Parent.CurrentDragStackSize;
|
|
|
|
Parent.CurrentInventoryItem.Item = tmpItem;
|
|
|
|
Parent.CurrentInventoryItem.Item = tmpItem;
|
|
|
|
Parent.CurrentInventoryItem.Number = tmpNumber;
|
|
|
|
Parent.CurrentInventoryItem.Number = tmpNumber;
|
|
|
|
|
|
|
|
Parent.CurrentInventoryItem.StackSize = tmpStackSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drop", ItemName = this.Item, Index = this.Index, Number = this.Number });
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drop", ItemName = this.Item, Index = this.Index, Number = this.Number, StackSize = this.StackSize });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal void OnDragEnd()
|
|
|
|
internal void OnDragEnd()
|
|
|
@ -80,14 +87,16 @@ public partial class InventoryItem
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Parent.CurrentDragIndex != -1 && Parent.CurrentDragIndex != this.Index)
|
|
|
|
if (Parent.CurrentDragIndex != -1 && Parent.CurrentDragIndex != this.Index)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Parent.ItemsInventory[this.Index-1] = new InventoryListItem(Parent.CurrentDragItem, Parent.CurrentDragIndex, Parent.CurrentDragNumber);
|
|
|
|
Parent.ItemsInventory[this.Index-1] = new InventoryListItem(Parent.CurrentDragItem, Parent.CurrentDragIndex, Parent.CurrentDragNumber, Parent.CurrentDragStackSize);
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
this.Item = Parent.CurrentDragItem;
|
|
|
|
this.Number = Parent.CurrentDragNumber;
|
|
|
|
this.Number = Parent.CurrentDragNumber;
|
|
|
|
|
|
|
|
this.StackSize = Parent.CurrentDragStackSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Parent.CurrentDragIndex = -1;
|
|
|
|
Parent.CurrentDragIndex = -1;
|
|
|
|
Parent.CurrentDragItem = "null";
|
|
|
|
Parent.CurrentDragItem = "null";
|
|
|
|
Parent.CurrentDragNumber = 0;
|
|
|
|
Parent.CurrentDragNumber = 0;
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "End", ItemName = this.Item, Index = this.Index, Number = this.Number });
|
|
|
|
Parent.CurrentDragStackSize = 0;
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "End", ItemName = this.Item, Index = this.Index, Number = this.Number, StackSize = this.StackSize });
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -97,9 +106,11 @@ public partial class InventoryItem
|
|
|
|
Parent.CurrentDragIndex = this.Index;
|
|
|
|
Parent.CurrentDragIndex = this.Index;
|
|
|
|
Parent.CurrentDragItem = this.Item;
|
|
|
|
Parent.CurrentDragItem = this.Item;
|
|
|
|
Parent.CurrentDragNumber = this.Number;
|
|
|
|
Parent.CurrentDragNumber = this.Number;
|
|
|
|
|
|
|
|
Parent.CurrentDragStackSize = this.StackSize;
|
|
|
|
this.Item = "null";
|
|
|
|
this.Item = "null";
|
|
|
|
this.Number = 0;
|
|
|
|
this.Number = 0;
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Start", ItemName = this.Item, Index = this.Index, Number = this.Number});
|
|
|
|
this.StackSize = 0;
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Start", ItemName = this.Item, Index = this.Index, Number = this.Number, StackSize = this.StackSize});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|