-
Recipe
+
@Localizer["InventoryTitle"]
@@ -50,7 +48,7 @@
-
Available items:
+
@Localizer["AvailableItems"]
-
+
-
Actions
+
@Localizer["Logs"]
+
\ No newline at end of file
diff --git a/BlazorApp1/Components/InventoryComponent.razor.cs b/BlazorApp1/Components/InventoryComponent.razor.cs
index 0e1b9a4..ed9f0b7 100644
--- a/BlazorApp1/Components/InventoryComponent.razor.cs
+++ b/BlazorApp1/Components/InventoryComponent.razor.cs
@@ -1,5 +1,7 @@
using BlazorApp1.Models;
+using BlazorApp1.Pages;
using Microsoft.AspNetCore.Components;
+using Microsoft.Extensions.Localization;
using Microsoft.JSInterop;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
@@ -23,6 +25,9 @@ namespace BlazorApp1.Components
public List
- InventoryItems { get; set; }
+ [Inject]
+ public IStringLocalizer Localizer { get; set; }
+
///
/// Gets or sets the java script runtime.
///
diff --git a/BlazorApp1/Components/InventoryItem.razor b/BlazorApp1/Components/InventoryItem.razor
index b14c5a7..c51d5cb 100644
--- a/BlazorApp1/Components/InventoryItem.razor
+++ b/BlazorApp1/Components/InventoryItem.razor
@@ -10,7 +10,9 @@
@ondragleave="@OnDragLeave">
@if (Item != null)
- {
-
+ {
}
\ No newline at end of file
diff --git a/BlazorApp1/Components/InventoryItem.razor.cs b/BlazorApp1/Components/InventoryItem.razor.cs
index a89a4a4..72b2080 100644
--- a/BlazorApp1/Components/InventoryItem.razor.cs
+++ b/BlazorApp1/Components/InventoryItem.razor.cs
@@ -13,6 +13,9 @@ namespace BlazorApp1.Components
[Parameter]
public bool NoDrop { get; set; }
+
+ [Parameter]
+ public int Stack { get; set; }
[CascadingParameter]
public InventoryComponent Parent { get; set; }
@@ -44,9 +47,21 @@ namespace BlazorApp1.Components
return;
}
- this.Item = Parent.CurrentDragItem;
+ if (this.Item != null)
+ {
+ if (this.Item.Name == Parent.CurrentDragItem.Name)
+ {
+ this.Stack = this.Stack + 1;
+ }
+ else { return; }
+ }
+
+ else
+ {
+ this.Item = Parent.CurrentDragItem;
- Parent.Actions.Add(new CraftingAction { Action = "Drop", Item = this.Item, Index = this.Index });
+ Parent.Actions.Add(new CraftingAction { Action = "Drop", Item = this.Item, Index = this.Index });
+ }
}
private void OnDragStart()
diff --git a/BlazorApp1/Components/InventoryItem.razor.css b/BlazorApp1/Components/InventoryItem.razor.css
index b2d4521..288333f 100644
--- a/BlazorApp1/Components/InventoryItem.razor.css
+++ b/BlazorApp1/Components/InventoryItem.razor.css
@@ -4,3 +4,7 @@
border: 1px solid;
overflow: hidden;
}
+
+.oui{
+ position: absolute;
+}
\ No newline at end of file
diff --git a/BlazorApp1/Pages/Inventory.razor b/BlazorApp1/Pages/Inventory.razor
index 4428a54..6f1afc7 100644
--- a/BlazorApp1/Pages/Inventory.razor
+++ b/BlazorApp1/Pages/Inventory.razor
@@ -3,7 +3,8 @@
@using BlazorApp1.Components
@using BlazorApp1.Models
-
Inventory
+
@Localizer["TitlePage"]
+
@Localizer["Title"]
diff --git a/BlazorApp1/Pages/Inventory.razor.cs b/BlazorApp1/Pages/Inventory.razor.cs
index 4604350..0fb2391 100644
--- a/BlazorApp1/Pages/Inventory.razor.cs
+++ b/BlazorApp1/Pages/Inventory.razor.cs
@@ -2,6 +2,7 @@
using BlazorApp1.Models;
using Blazorise.DataGrid;
using Microsoft.AspNetCore.Components;
+using Microsoft.Extensions.Localization;
namespace BlazorApp1.Pages
{
@@ -13,6 +14,9 @@ namespace BlazorApp1.Pages
private int totalItem;
public List- Items { get; set; } = new List
- ();
+ [Inject]
+ public IStringLocalizer Localizer { get; set; }
+
protected override async Task OnAfterRenderAsync(bool firstRender)
{
base.OnAfterRenderAsync(firstRender);
diff --git a/BlazorApp1/Resources/Pages.Inventory.fr-FR.resx b/BlazorApp1/Resources/Pages.Inventory.fr-FR.resx
index 67b7493..d61508d 100644
--- a/BlazorApp1/Resources/Pages.Inventory.fr-FR.resx
+++ b/BlazorApp1/Resources/Pages.Inventory.fr-FR.resx
@@ -117,7 +117,19 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Items disponibles
+
+
+ Votre inventaire
+
+
+ Historique des actions
+
Inventaire
+
+ Inventaire
+
\ No newline at end of file
diff --git a/BlazorApp1/Resources/Pages.Inventory.resx b/BlazorApp1/Resources/Pages.Inventory.resx
index 6c5f871..b743558 100644
--- a/BlazorApp1/Resources/Pages.Inventory.resx
+++ b/BlazorApp1/Resources/Pages.Inventory.resx
@@ -117,7 +117,19 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Available Items
+
+
+ Your inventory
+
+
+ Action logs
+
Inventory
+
+ Inventory
+
\ No newline at end of file