|
|
@ -1,4 +1,5 @@
|
|
|
|
using BlazorApp.Models;
|
|
|
|
using BlazorApp.Data;
|
|
|
|
|
|
|
|
using BlazorApp.Models;
|
|
|
|
using BlazorApp.Pages;
|
|
|
|
using BlazorApp.Pages;
|
|
|
|
using BlazorApp.Services;
|
|
|
|
using BlazorApp.Services;
|
|
|
|
using Blazorise;
|
|
|
|
using Blazorise;
|
|
|
@ -8,6 +9,7 @@ using Microsoft.Extensions.Localization;
|
|
|
|
using Microsoft.JSInterop;
|
|
|
|
using Microsoft.JSInterop;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
|
|
|
|
using System.Text.Json;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BlazorApp.Components
|
|
|
|
namespace BlazorApp.Components
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -38,7 +40,10 @@ namespace BlazorApp.Components
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Actions = new ObservableCollection<InventoryAction>();
|
|
|
|
Actions = new ObservableCollection<InventoryAction>();
|
|
|
|
Actions.CollectionChanged += OnActionsCollectionChanged;
|
|
|
|
Actions.CollectionChanged += OnActionsCollectionChanged;
|
|
|
|
this.RecipeItems = new List<Item> { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null };
|
|
|
|
|
|
|
|
|
|
|
|
string fileName = "Inventory.json";
|
|
|
|
|
|
|
|
string jsonString = File.ReadAllText(fileName);
|
|
|
|
|
|
|
|
this.RecipeItems = JsonSerializer.Deserialize<List<Item>>(jsonString)!;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -49,6 +54,9 @@ namespace BlazorApp.Components
|
|
|
|
private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
|
|
|
|
private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems);
|
|
|
|
JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|