diff --git a/BlazorApp/BlazorApp.sln b/BlazorApp/BlazorApp.sln
index 80c6881..fb5c367 100644
--- a/BlazorApp/BlazorApp.sln
+++ b/BlazorApp/BlazorApp.sln
@@ -5,7 +5,13 @@ VisualStudioVersion = 17.2.32616.157
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorApp", "BlazorApp\BlazorApp.csproj", "{1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}"
EndProject
+<<<<<<< Updated upstream
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minecraft.Crafting.Api", "Minecraft.Crafting.Api\Minecraft.Crafting.Api.csproj", "{E1E95C86-6F7D-42A8-983F-C64395DB549C}"
+=======
+Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Minecraft.Crafting.Api", "..\Minecraft.Crafting.Api\Minecraft.Crafting.Api.csproj", "{90D900E1-58D6-48D0-8B7F-B04CF2B32467}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Minecraft.Crafting.Api", "Minecraft.Crafting.Api\Minecraft.Crafting.Api.csproj", "{66D487C8-86D6-4394-BB71-BFA92E57D90E}"
+>>>>>>> Stashed changes
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -17,10 +23,21 @@ Global
{1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E9341D6-EB75-4CD3-8144-A24BE53DB7E1}.Release|Any CPU.Build.0 = Release|Any CPU
+<<<<<<< Updated upstream
{E1E95C86-6F7D-42A8-983F-C64395DB549C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1E95C86-6F7D-42A8-983F-C64395DB549C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1E95C86-6F7D-42A8-983F-C64395DB549C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1E95C86-6F7D-42A8-983F-C64395DB549C}.Release|Any CPU.Build.0 = Release|Any CPU
+=======
+ {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {90D900E1-58D6-48D0-8B7F-B04CF2B32467}.Release|Any CPU.Build.0 = Release|Any CPU
+ {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {66D487C8-86D6-4394-BB71-BFA92E57D90E}.Release|Any CPU.Build.0 = Release|Any CPU
+>>>>>>> Stashed changes
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/BlazorApp/BlazorApp/BlazorApp.csproj b/BlazorApp/BlazorApp/BlazorApp.csproj
index 1bb76d0..0b32f52 100644
--- a/BlazorApp/BlazorApp/BlazorApp.csproj
+++ b/BlazorApp/BlazorApp/BlazorApp.csproj
@@ -7,12 +7,13 @@
-
-
-
+
+
+
+
@@ -25,6 +26,9 @@
+
+
+
diff --git a/BlazorApp/BlazorApp/Components/InventoryComp.razor b/BlazorApp/BlazorApp/Components/InventoryComp.razor
index ab7078a..22e0144 100644
--- a/BlazorApp/BlazorApp/Components/InventoryComp.razor
+++ b/BlazorApp/BlazorApp/Components/InventoryComp.razor
@@ -42,6 +42,7 @@
Available items:
+<<<<<<< Updated upstream
+=======
+
-
+
+
+
+
+>>>>>>> Stashed changes
+
+
+
+
+
+
+
+
+
diff --git a/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs b/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs
index 6ca14eb..d442884 100644
--- a/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs
+++ b/BlazorApp/BlazorApp/Components/InventoryComp.razor.cs
@@ -6,12 +6,15 @@ using System.Collections.ObjectModel;
using System.Collections.Specialized;
using BlazorApp.Services;
using Blazorise.DataGrid;
+using Microsoft.Extensions.Options;
namespace BlazorApp.Components
{
public partial class InventoryComp
{
+
+
public Item CurrentDragItem { get; set; }
public int CurrentDragIndex { get; set; }
@@ -24,17 +27,30 @@ namespace BlazorApp.Components
public List- InventoryItems { get; set; }
+ public ObservableCollection Actions { get; set; }
+
+ public bool IsSorted { get; set; }
+
+
+ [Inject]
+ internal IJSRuntime JavaScriptRuntime { get; set; }
+
+
private int totalItem;
public InventoryComp()
{
- this.InventoryItems = new List
- { };
- for (int i = 0; i < 18; i++)
- {
- this.InventoryItems.Append(null);
+ Actions = new ObservableCollection();
+ Actions.CollectionChanged += OnActionsCollectionChanged;
+
+ this.InventoryItems = new List
- (new Item[18]);
}
+
+ private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
+ {
+ JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems);
}
-
+
private async Task OnReadData(DataGridReadDataEventArgs
- e)
{
if (e.CancellationToken.IsCancellationRequested)
@@ -42,16 +58,33 @@ namespace BlazorApp.Components
return;
}
- if (!e.CancellationToken.IsCancellationRequested)
+ if (!e.CancellationToken.IsCancellationRequested && IsSorted==false)
{
Items = await DataService.List(e.Page, e.PageSize);
totalItem = await DataService.Count();
- }
+ }
+ else
+ {
+ Items = await DataService.SortedList(e.Page, e.PageSize);
+ }
}
- private async Task SortByName()
+ private void SortByName()
{
+<<<<<<< Updated upstream
Items = await DataService.SortedList();
+=======
+ if (IsSorted)
+ {
+ IsSorted = false;
+ }
+ else
+ {
+ IsSorted = true;
+ }
+
+ StateHasChanged();
+>>>>>>> Stashed changes
}
void refresh()
diff --git a/BlazorApp/BlazorApp/Components/InventoryItem.razor b/BlazorApp/BlazorApp/Components/InventoryItem.razor
index 298b7eb..a714c13 100644
--- a/BlazorApp/BlazorApp/Components/InventoryItem.razor
+++ b/BlazorApp/BlazorApp/Components/InventoryItem.razor
@@ -5,10 +5,25 @@
@ondrop="@OnDrop"
@ondragenter="@OnDragEnter"
@ondragleave="@OnDragLeave"
- @ondragend="@OnDragEnd" >
+ @ondragend="@OnDragEnd">
@if (Item != null)
- {
- @Item.DisplayName
- }
+ {
+ if (NoDrop)
+ {
+ @if (!string.IsNullOrWhiteSpace(Item.ImageBase64))
+ {
+
+ }
+ else
+ {
+
+ }
+ }
+ else
+ {
+ @Item.DisplayName
+ }
+
+ }
\ No newline at end of file
diff --git a/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs b/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs
index 6af5477..9e79fd4 100644
--- a/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs
+++ b/BlazorApp/BlazorApp/Components/InventoryItem.razor.cs
@@ -52,6 +52,9 @@ namespace BlazorApp.Components
Parent.CurrentDragItem = tmp;
Parent.CurrentDragIndex = this.Index;
}
+
+ Parent.Actions.Add(new CraftingAction { Action = "On Drop", Item = this.Item, Index = this.Index });
+
}
private void OnDragStart()
@@ -70,8 +73,8 @@ namespace BlazorApp.Components
{
Parent.CurrentDragIndex = -1;
}
-
}
+ Parent.Actions.Add(new CraftingAction { Action = "Drag Start", Item = this.Item, Index = this.Index });
}
internal void OnDragEnd()
@@ -85,6 +88,9 @@ namespace BlazorApp.Components
Parent.InventoryItems[this.Index] = this.Item;
this.Item = Parent.CurrentDragItem;
}
+
+ Parent.Actions.Add(new CraftingAction { Action = "Drag End", Item = this.Item, Index = this.Index });
+
Parent.CurrentDragIndex = -1;
Parent.CurrentDragItem = null;
diff --git a/BlazorApp/BlazorApp/Program.cs b/BlazorApp/BlazorApp/Program.cs
index 77f260e..07f4836 100644
--- a/BlazorApp/BlazorApp/Program.cs
+++ b/BlazorApp/BlazorApp/Program.cs
@@ -10,6 +10,8 @@ using Blazored.Modal;
using System.Globalization;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Localization;
+using Microsoft.Extensions.Logging;
+
var builder = WebApplication.CreateBuilder(args);
@@ -25,6 +27,7 @@ builder.Services
builder.Services.AddBlazoredLocalStorage();
+
builder.Services.AddScoped();
builder.Services.AddBlazoredModal();
diff --git a/BlazorApp/BlazorApp/Services/DataApiService.cs b/BlazorApp/BlazorApp/Services/DataApiService.cs
index 035adb2..905ae06 100644
--- a/BlazorApp/BlazorApp/Services/DataApiService.cs
+++ b/BlazorApp/BlazorApp/Services/DataApiService.cs
@@ -57,10 +57,20 @@ namespace BlazorApp.Services
return await _http.GetFromJsonAsync>("https://localhost:7234/api/Crafting/recipe");
}
+<<<<<<< Updated upstream
public async Task> SortedList()
{
List- it = await _http.GetFromJsonAsync
>($"https://localhost:7234/api/Crafting/all/");
return it.OrderBy(i => i.DisplayName).ToList();
+=======
+ public async Task> SortedList(int currentPage, int pageSize)
+ {
+ List- it = await _http.GetFromJsonAsync
>($"https://localhost:7234/api/Crafting/all");
+ it.OrderBy(i => i.DisplayName).ToList();
+ List- items= it.GetRange((currentPage-1)*10, pageSize);
+ return items;
+
+>>>>>>> Stashed changes
}
diff --git a/BlazorApp/BlazorApp/Services/DataLocalService.cs b/BlazorApp/BlazorApp/Services/DataLocalService.cs
index 3b13a80..e9cbfda 100644
--- a/BlazorApp/BlazorApp/Services/DataLocalService.cs
+++ b/BlazorApp/BlazorApp/Services/DataLocalService.cs
@@ -185,7 +185,11 @@ namespace BlazorApp.Services
return Task.FromResult(items);
}
+<<<<<<< Updated upstream
public Task
> SortedList()
+=======
+ public Task> SortedList(int currentPage, int pageSize)
+>>>>>>> Stashed changes
{
throw new NotImplementedException();
}
diff --git a/BlazorApp/BlazorApp/Services/IDataService.cs b/BlazorApp/BlazorApp/Services/IDataService.cs
index a39928c..2b95484 100644
--- a/BlazorApp/BlazorApp/Services/IDataService.cs
+++ b/BlazorApp/BlazorApp/Services/IDataService.cs
@@ -14,7 +14,11 @@ namespace BlazorApp.Services
Task Update(int id, ItemModel itemModel);
Task Delete(int id);
Task> GetRecipes();
+<<<<<<< Updated upstream
Task> SortedList();
+=======
+ Task> SortedList(int currentPage, int pageSize);
+>>>>>>> Stashed changes
}
}
diff --git a/BlazorApp/BlazorApp/appsettings.Development.json b/BlazorApp/BlazorApp/appsettings.Development.json
index f042c67..2a1e03d 100644
--- a/BlazorApp/BlazorApp/appsettings.Development.json
+++ b/BlazorApp/BlazorApp/appsettings.Development.json
@@ -1,9 +1,9 @@
{
- "DetailedErrors": true,
"Logging": {
"LogLevel": {
- "Default": "Information",
- "Microsoft.AspNetCore": "Warning"
+ "Default": "Trace",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
}
}
-}
+}
\ No newline at end of file
diff --git a/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj b/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj
index c12997a..880b236 100644
--- a/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj
+++ b/BlazorApp/Minecraft.Crafting.Api/Minecraft.Crafting.Api.csproj
@@ -7,8 +7,8 @@
-
-
+
+