finission actions

master
Ness Gaster 2 years ago
parent de1f53862d
commit ce09326935

Binary file not shown.

Binary file not shown.

@ -6,7 +6,7 @@
<div> <div>
<div class="css-gridInv"> <div class="css-gridInv">
@for(int i = 0; i<40; i++) @for(int i = 0; i<30; i++)
{ {
<InventoryItem Index="i" NoDrop="false"/> <InventoryItem Index="i" NoDrop="false"/>
} }
@ -15,7 +15,7 @@
</div> </div>
<div> <div>
<div>Actions</div> <div>Actions</div>
<div class="actions" id="actions"> <div class="actions" id="actionsinv">
</div> </div>
</div> </div>

@ -30,13 +30,11 @@ namespace BlazorApp1.Components
public List<String> InventoryItems { get; set; } = new List<String>() { null, null, null, null, null, null, null, null, null, null, public List<String> InventoryItems { get; set; } = new List<String>() { null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null
}; };
public List<int> InventoryNbElems { get; set; } = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, public List<int> InventoryNbElems { get; set; } = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}; };
public int CurrenttmpNbElem { get; set; } public int CurrenttmpNbElem { get; set; }
@ -77,7 +75,6 @@ namespace BlazorApp1.Components
InventoryItems = new List<String>() { null, null, null, null, null, null, null, null, null, null, InventoryItems = new List<String>() { null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null
}; };
} }
if (currentNumberData != null ) if (currentNumberData != null )
@ -89,7 +86,6 @@ namespace BlazorApp1.Components
InventoryNbElems = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, InventoryNbElems = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}; };
} }
} }

@ -7,10 +7,10 @@
div.innerHTML = 'Action: ' + element.action + ' - Index: ' + element.index; div.innerHTML = 'Action: ' + element.action + ' - Index: ' + element.index;
if (element.item) { if (element.item) {
div.innerHTML += ' - Item Name: ' + element.item.name; div.innerHTML += ' - Item Name: ' + element.item.name + ' - Nb Element : ' + element.nbelem ;
} }
document.getElementById('actions').appendChild(div); document.getElementById('actionsinv').appendChild(div);
}); });
} }
} }

@ -5,5 +5,6 @@
public string Action { get; set; } public string Action { get; set; }
public int Index { get; set; } public int Index { get; set; }
public Item Item { get; set; } public Item Item { get; set; }
public int Nbelem { get; set; }
} }
} }

@ -7,7 +7,7 @@
@ondragenter="@OnDragEnter" @ondragenter="@OnDragEnter"
@ondragleave="@OnDragLeave"> @ondragleave="@OnDragLeave">
@if (Parent.InventoryItems[this.Index] != null && Parent.InventoryItems != null) @if (Parent.InventoryItems[this.Index] != null && @Parent.getItem(Parent.InventoryItems[this.Index]) != null)
{ {
var s = "/"; var s = "/";
//<img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" title="@Item.DisplayName" alt="@Item.DisplayName"/> //<img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" title="@Item.DisplayName" alt="@Item.DisplayName"/>

@ -51,7 +51,7 @@ namespace BlazorApp1.Components
return; return;
} }
Parent.Actions.Add(new InventoryAction { Action = "Drag Enter in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Enter in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index, Nbelem = this.Parent.InventoryNbElems[this.Index] });
} }
internal void OnDragLeave() internal void OnDragLeave()
@ -60,7 +60,7 @@ namespace BlazorApp1.Components
{ {
return; return;
} }
Parent.Actions.Add(new InventoryAction { Action = "Drag Leave in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Leave in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index, Nbelem = this.Parent.InventoryNbElems[this.Index] });
} }
internal void OnDrop() internal void OnDrop()
@ -157,7 +157,7 @@ namespace BlazorApp1.Components
StateHasChanged(); StateHasChanged();
Parent.StateChange(); Parent.StateChange();
Parent.Actions.Add(new InventoryAction { Action = "Drag Drop in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Drop in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index, Nbelem = this.Parent.InventoryNbElems[this.Index] });
} }
private void OnDragStart() private void OnDragStart()
@ -165,7 +165,7 @@ namespace BlazorApp1.Components
Parent.CurrentDragItem = Parent.getItem(Parent.InventoryItems[this.Index]); Parent.CurrentDragItem = Parent.getItem(Parent.InventoryItems[this.Index]);
Parent.CurrentEllement = this; Parent.CurrentEllement = this;
Parent.CurrenttmpNbElem = Parent.InventoryNbElems[this.Index]; Parent.CurrenttmpNbElem = Parent.InventoryNbElems[this.Index];
Parent.Actions.Add(new InventoryAction { Action = "Drag Enter in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Enter in Inventory", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index, Nbelem = this.Parent.InventoryNbElems[this.Index] });
Parent.InventoryItems[this.Index] = null; Parent.InventoryItems[this.Index] = null;
Parent.InventoryNbElems[this.Index] = 0; Parent.InventoryNbElems[this.Index] = 0;

@ -46,7 +46,7 @@ namespace BlazorApp1.Components
{ {
return; return;
} }
Parent.Actions.Add(new InventoryAction { Action = "Drag Enter in Items List", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Enter in Items List", Item = this.Item, Index = this.Index, Nbelem = 1 });
} }
internal void OnDragLeave() internal void OnDragLeave()
@ -55,7 +55,7 @@ namespace BlazorApp1.Components
{ {
return; return;
} }
Parent.Actions.Add(new InventoryAction { Action = "Drag Leave in Items List", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Leave in Items List", Item = this.Item, Index = this.Index, Nbelem = 1 });
} }
internal void OnDrop() internal void OnDrop()
@ -64,7 +64,7 @@ namespace BlazorApp1.Components
{ {
return; return;
} }
Parent.Actions.Add(new InventoryAction { Action = "Drag Drop in Items List", Item = this.Parent.getItem(this.Parent.InventoryItems[this.Index]), Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Drop in Items List", Item = this.Item, Index = this.Index, Nbelem = 1 });
} }
private void OnDragStart() private void OnDragStart()
@ -72,7 +72,7 @@ namespace BlazorApp1.Components
Parent.CurrentDragItem = this.Item; Parent.CurrentDragItem = this.Item;
Parent.CurrentEllement = this; Parent.CurrentEllement = this;
Parent.CurrenttmpNbElem = 1; Parent.CurrenttmpNbElem = 1;
Parent.Actions.Add(new InventoryAction { Action = "Drag Start in Items List", Item = this.Item, Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Start in Items List", Item = this.Item, Index = this.Index, Nbelem = 1 });
} }
public int getIndex() public int getIndex()

@ -1,4 +1,4 @@
@page "/PageInventaire" @page "/Inventory"
@using System.Globalization @using System.Globalization
@using BlazorApp1.Components @using BlazorApp1.Components

@ -20,7 +20,7 @@
</NavLink> </NavLink>
</div> </div>
<div class="nav-item px-3"> <div class="nav-item px-3">
<NavLink class="nav-link" href="PageInventaire"> <NavLink class="nav-link" href="Inventory">
<span class="oi oi-list-rich" aria-hidden="true"></span> inventaire <span class="oi oi-list-rich" aria-hidden="true"></span> inventaire
</NavLink> </NavLink>
</div> </div>

File diff suppressed because one or more lines are too long

@ -255,3 +255,10 @@
2.0 2.0
2.0 2.0
2.0 2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0

Loading…
Cancel
Save