Ajoute le nom de l'item dans la liste + corrige un bug de duplication
continuous-integration/drone/push Build is failing Details

master
Lou VALADE 2 years ago
parent c91426d333
commit c467be3e55

@ -54,8 +54,11 @@
@foreach (var item in Items) @foreach (var item in Items)
{ {
<InventoryItem Item="item" NoDrop="true"/> <div>
<InventoryItem Item="item" NoDrop="true"/>
<p>@item.DisplayName</p>
</div>
<br/>
} }
</div> </div>
</div> </div>

@ -16,4 +16,8 @@
border: 1px solid black; border: 1px solid black;
height: 250px; height: 250px;
overflow: scroll; overflow: scroll;
}
.listeItem {
display: inline;
} }

@ -39,8 +39,8 @@ namespace BlazorApp1.Components
internal void OnDrop() internal void OnDrop()
{ {
Item CurrentHoldItem = new Item();//A remplir avec les valeurs de CurrentDragItem Item CurrentHoldItem = new Item(Parent.CurrentDragItem.Id, Parent.CurrentDragItem.DisplayName, Parent.CurrentDragItem.Name, Parent.CurrentDragItem.StackSize, Parent.CurrentDragItem.Stack, Parent.CurrentDragItem.MaxDurability, Parent.CurrentDragItem.EnchantCategories, Parent.CurrentDragItem.RepairWith, Parent.CurrentDragItem.CreatedDate, Parent.CurrentDragItem.UpdatedDate, Parent.CurrentDragItem.ImageBase64);
//CurrentHoldItem = Parent.CurrentDragItem;
if (NoDrop) if (NoDrop)
{ {
@ -54,7 +54,9 @@ namespace BlazorApp1.Components
CurrentHoldItem.Stack = CurrentHoldItem.Stack + this.Item.Stack; CurrentHoldItem.Stack = CurrentHoldItem.Stack + this.Item.Stack;
this.Item = CurrentHoldItem; this.Item = CurrentHoldItem;
} }
else { return; } else {
return;
}
} }
else else
@ -67,7 +69,7 @@ namespace BlazorApp1.Components
private void OnDragStart() private void OnDragStart()
{ {
Parent.CurrentDragItem = this.Item; Parent.CurrentDragItem = new Item(this.Item.Id, this.Item.DisplayName, this.Item.Name, this.Item.StackSize, 1, this.Item.MaxDurability, this.Item.EnchantCategories, this.Item.RepairWith, this.Item.CreatedDate, this.Item.UpdatedDate, this.Item.ImageBase64);
Parent.Actions.Add(new CraftingAction { Action = "Drag Start", Item = this.Item, Index = this.Index }); Parent.Actions.Add(new CraftingAction { Action = "Drag Start", Item = this.Item, Index = this.Index });
} }

Loading…
Cancel
Save