Ajoute la traduction de la page Inventory et le début de l'empilage des items
continuous-integration/drone/push Build is failing Details

master
Lou VALADE 2 years ago
parent 3910a39ac8
commit bb24abb013

@ -1,11 +1,9 @@
<h3>Inventory</h3>
<CascadingValue Value="@this">
<CascadingValue Value="@this">
<div class="container">
<div class="row">
<div class="col-6">
<div>Recipe</div>
<div>@Localizer["InventoryTitle"]</div>
<div class="css-inventory">
<InventoryItem Index="0"/>
@ -50,7 +48,7 @@
<div class="col-6">
<div>Available items:</div>
<div>@Localizer["AvailableItems"]</div>
<div>
<div class="css-grid">
@ -63,13 +61,14 @@
</div>
</div>
<div class="col-12">
<div>Actions</div>
<div>@Localizer["Logs"]</div>
<div class="actions" id="actions">
</div>
</div>
</div>
</div>
</CascadingValue>

@ -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<Item> InventoryItems { get; set; }
[Inject]
public IStringLocalizer<Inventory> Localizer { get; set; }
/// <summary>
/// Gets or sets the java script runtime.
/// </summary>

@ -10,7 +10,9 @@
@ondragleave="@OnDragLeave">
@if (Item != null)
{
<img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" alt="@(Item.DisplayName)" style="min-width: 64px; max-width: 64px"/>
{ <div class="Oui">
<img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" alt="@(Item.DisplayName)" style="min-width: 64px; max-width: 64px"/>
<a>@this.Stack</a>
</div>
}
</div>

@ -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()

@ -4,3 +4,7 @@
border: 1px solid;
overflow: hidden;
}
.oui{
position: absolute;
}

@ -3,7 +3,8 @@
@using BlazorApp1.Components
@using BlazorApp1.Models
<PageTitle>Inventory</PageTitle>
<PageTitle>@Localizer["TitlePage"]</PageTitle>
<h3>@Localizer["Title"]</h3>
<div>
<InventoryComponent Items="Items"/>

@ -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<Item> Items { get; set; } = new List<Item>();
[Inject]
public IStringLocalizer<Inventory> Localizer { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
base.OnAfterRenderAsync(firstRender);

@ -117,7 +117,19 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AvailableItems" xml:space="preserve">
<value>Items disponibles</value>
</data>
<data name="InventoryTitle" xml:space="preserve">
<value>Votre inventaire</value>
</data>
<data name="Logs" xml:space="preserve">
<value>Historique des actions</value>
</data>
<data name="Title" xml:space="preserve">
<value>Inventaire</value>
</data>
<data name="TitlePage" xml:space="preserve">
<value>Inventaire</value>
</data>
</root>

@ -117,7 +117,19 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="AvailableItems" xml:space="preserve">
<value>Available Items</value>
</data>
<data name="InventoryTitle" xml:space="preserve">
<value>Your inventory</value>
</data>
<data name="Logs" xml:space="preserve">
<value>Action logs</value>
</data>
<data name="Title" xml:space="preserve">
<value>Inventory</value>
</data>
<data name="TitlePage" xml:space="preserve">
<value>Inventory</value>
</data>
</root>
Loading…
Cancel
Save