Skip to content

Commit 94c8ef8

Browse files
Update dependencies
1 parent 7110e73 commit 94c8ef8

9 files changed

Lines changed: 245 additions & 249 deletions

File tree

LeveHelper/LeveHelper.Shared.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
<!-- NuGet dependencies -->
3131
<ItemGroup>
3232
<PackageReference Include="AutoCtor" Version="2.8.1" PrivateAssets="all" ExcludeAssets="compile;runtime" />
33-
<PackageReference Include="Injectio" Version="5.0.0" PrivateAssets="all" />
34-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.8" />
35-
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.8" />
36-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.8" />
33+
<PackageReference Include="Injectio" Version="5.1.0" PrivateAssets="all" />
3734
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183" PrivateAssets="All" />
3835
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
3936
</ItemGroup>

LeveHelper/LeveHelper.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<!-- NuGet dependencies -->
2727
<ItemGroup>
2828
<PackageReference Include="AutoCtor" Version="2.8.1" PrivateAssets="all" ExcludeAssets="compile;runtime" />
29-
<PackageReference Include="Injectio" Version="5.0.0" PrivateAssets="all" />
29+
<PackageReference Include="Injectio" Version="5.1.0" PrivateAssets="all" />
3030
</ItemGroup>
3131

3232
<!-- HaselCommon -->

LeveHelper/Records/QueuedItem.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using HaselCommon.Utils;
12
using LeveHelper.Services;
23
using Lumina.Excel.Sheets;
34

@@ -7,15 +8,15 @@ public record QueuedItem
78
{
89
private readonly ExtendedItemService ExtendedItemService;
910

10-
public QueuedItem(Item Item, uint AmountNeeded, ExtendedItemService ExtendedItemService)
11+
public QueuedItem(ItemProxy Item, uint AmountNeeded, ExtendedItemService ExtendedItemService)
1112
{
1213
this.Item = Item;
1314
this.AmountNeeded = AmountNeeded;
1415
this.ExtendedItemService = ExtendedItemService;
1516
}
1617

17-
public Item Item { get; init; }
18-
public uint AmountHave => ExtendedItemService.GetQuantity(Item.RowId);
18+
public ItemProxy Item { get; init; }
19+
public uint AmountHave => ExtendedItemService.GetQuantity(Item.ItemId);
1920
public uint AmountNeeded { get; set; }
2021
public uint AmountLeft
2122
{

LeveHelper/Services/CraftQueueState.cs

Lines changed: 64 additions & 65 deletions
Large diffs are not rendered by default.

LeveHelper/Services/ExtendedItemService.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
using System.Linq;
33
using AutoCtor;
44
using HaselCommon.Services;
5+
using HaselCommon.Utils;
56
using LeveHelper.Caches;
67
using LeveHelper.Enums;
7-
using Lumina.Excel.Sheets;
88

99
namespace LeveHelper.Services;
1010

1111
[RegisterTransient, AutoConstruct]
1212
public partial class ExtendedItemService : ItemService
1313
{
14-
private readonly ExcelService _excelService;
1514
private readonly ItemQuantityCache _itemQuantityCache = new();
1615
private readonly Dictionary<uint, ItemQueueCategory> _itemQueueCategoryCache = [];
1716

@@ -22,26 +21,26 @@ public uint GetQuantity(uint itemId)
2221
=> _itemQuantityCache.GetValue(itemId);
2322

2423
public bool HasAllIngredients(uint itemId)
25-
=> GetIngredients(itemId).All(ingredient => GetQuantity(ingredient.Item.RowId) > ingredient.Amount);
24+
=> GetIngredients(itemId).All(ingredient => GetQuantity(ingredient.Item) > ingredient.Amount);
2625

27-
public ItemQueueCategory GetQueueCategory(uint itemId)
26+
public ItemQueueCategory GetQueueCategory(ItemProxy item)
2827
{
29-
if (_itemQueueCategoryCache.TryGetValue(itemId, out var category))
28+
if (_itemQueueCategoryCache.TryGetValue(item, out var category))
3029
return category;
3130

32-
if (!_excelService.TryGetRow<Item>(itemId, out _))
31+
if (!item.TryGetItem(out _))
3332
{
3433
category = ItemQueueCategory.None;
3534
}
36-
else if (IsCrystal(itemId))
35+
else if (item.IsCrystal)
3736
{
3837
category = ItemQueueCategory.Crystals;
3938
}
40-
else if (IsGatherable(itemId) || IsFish(itemId) || IsSpearfish(itemId))
39+
else if (item.IsGatherable || item.IsFish || item.IsSpearfish)
4140
{
4241
category = ItemQueueCategory.Gatherable;
4342
}
44-
else if (IsCraftable(itemId))
43+
else if (item.IsCraftable)
4544
{
4645
category = ItemQueueCategory.Craftable;
4746
}
@@ -50,7 +49,7 @@ public ItemQueueCategory GetQueueCategory(uint itemId)
5049
category = ItemQueueCategory.OtherSources;
5150
}
5251

53-
_itemQueueCategoryCache.Add(itemId, category);
52+
_itemQueueCategoryCache.Add(item, category);
5453
return category;
5554
}
5655
}

LeveHelper/Tabs/DebugTab.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void Draw(Window window)
5555

5656
ImGui.TableNextColumn();
5757

58-
using var node = ImRaii.TreeNode($"{itemService.GetGatheringPoints(gatheringItem).Length} Gathering Points###GatheringPoints_{gatheringItem.RowId}", ImGuiTreeNodeFlags.SpanAvailWidth);
58+
using var node = ImRaii.TreeNode($"{itemService.GetGatheringPoints(gatheringItem).Count} Gathering Points###GatheringPoints_{gatheringItem.RowId}", ImGuiTreeNodeFlags.SpanAvailWidth);
5959
if (!node) continue;
6060

6161
foreach (var point in itemService.GetGatheringPoints(gatheringItem))

LeveHelper/Tabs/QueueTab.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,18 @@ private void DrawExportButton()
129129

130130
foreach (var item in requiredItems)
131131
{
132-
if (items.TryGetValue(item.Item.RowId, out var tuple))
132+
if (items.TryGetValue(item.Item, out var tuple))
133133
{
134-
items[item.Item.RowId] = (tuple.Item1, tuple.Item2 + item.Amount);
134+
items[item.Item] = (tuple.Item1, tuple.Item2 + item.Amount);
135135
}
136136
else
137137
{
138-
var recipes = _itemService.GetRecipes(item.Item.RowId);
138+
var recipes = _itemService.GetRecipes(item.Item);
139139

140-
if (recipes != null && recipes.Count() == 1)
141-
items[item.Item.RowId] = (recipes.First().RowId, item.Amount);
140+
if (recipes != null && recipes.Count == 1)
141+
items[item.Item] = (recipes[0].RowId, item.Amount);
142142
else
143-
items[item.Item.RowId] = (0, item.Amount);
143+
items[item.Item] = (0, item.Amount);
144144
}
145145
}
146146
}

0 commit comments

Comments
 (0)