Skip to content

Commit dd23ca1

Browse files
Update HaselCommon
1 parent 3d7b74a commit dd23ca1

8 files changed

Lines changed: 90 additions & 14 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This .csproj is part of a mono-repo solution and shares dependencies with other projects. -->
3+
<Project Sdk="Dalamud.NET.Sdk/13.1.0">
4+
<!-- Project settings -->
5+
<PropertyGroup>
6+
<AssemblyName>LeveHelper</AssemblyName>
7+
<Version>2.5.4</Version>
8+
<OutputPath>..\bin\</OutputPath>
9+
<DefineConstants>$(DefineConstants);AUTOCTOR_EMBED_ATTRIBUTES</DefineConstants>
10+
</PropertyGroup>
11+
12+
<!-- Dalamud.NET.Sdk settings -->
13+
<PropertyGroup>
14+
<Use_Dalamud_Newtonsoft_Json>false</Use_Dalamud_Newtonsoft_Json>
15+
<Use_Dalamud_FFXIVClientStructs>false</Use_Dalamud_FFXIVClientStructs>
16+
</PropertyGroup>
17+
18+
<!-- Translations -->
19+
<ItemGroup Condition="Exists('Translations.json')">
20+
<EmbeddedResource Include="Translations.json" />
21+
</ItemGroup>
22+
23+
<!-- Licenses -->
24+
<ItemGroup Condition="Exists('LICENSES.md')">
25+
<EmbeddedResource Include="LICENSES.md" />
26+
<None Include="LICENSES.md" CopyToOutputDirectory="PreserveNewest" />
27+
</ItemGroup>
28+
29+
<!-- NuGet dependencies -->
30+
<ItemGroup>
31+
<PackageReference Include="AutoCtor" Version="2.8.1" PrivateAssets="all" ExcludeAssets="compile;runtime" />
32+
<PackageReference Include="Injectio" Version="5.0.0" PrivateAssets="all" />
33+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.8" />
34+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.8" />
35+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.8" />
36+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183" PrivateAssets="All" />
37+
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
38+
</ItemGroup>
39+
40+
<!-- FFXIVClientStructs -->
41+
<PropertyGroup>
42+
<InteropGenerator_InteropNamespace>$(AssemblyName)</InteropGenerator_InteropNamespace>
43+
</PropertyGroup>
44+
45+
<ItemGroup>
46+
<CompilerVisibleProperty Include="InteropGenerator_InteropNamespace" />
47+
<ProjectReference Include="..\..\libs\FFXIVClientStructs\InteropGenerator\InteropGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
48+
<ProjectReference Include="..\..\libs\FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj" Private="True" />
49+
<ProjectReference Include="..\..\libs\FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj" Private="True" />
50+
</ItemGroup>
51+
52+
<!-- HaselCommon -->
53+
<ItemGroup>
54+
<ProjectReference Include="..\..\libs\HaselCommon\HaselCommon\HaselCommon.csproj" />
55+
</ItemGroup>
56+
</Project>

LeveHelper/LeveHelper.csproj

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project Sdk="Dalamud.NET.Sdk/13.0.0">
2+
<Project Sdk="Dalamud.NET.Sdk/13.1.0">
3+
<!-- Project settings -->
34
<PropertyGroup>
45
<Version>2.5.4</Version>
56
<OutputPath>..\bin\</OutputPath>
6-
<DefineConstants>AUTOCTOR_EMBED_ATTRIBUTES</DefineConstants>
7+
<DefineConstants>$(DefineConstants);AUTOCTOR_EMBED_ATTRIBUTES</DefineConstants>
78
</PropertyGroup>
89

9-
<ItemGroup>
10+
<!-- Dalamud.NET.Sdk settings -->
11+
<PropertyGroup>
12+
<Use_Dalamud_Newtonsoft_Json>false</Use_Dalamud_Newtonsoft_Json>
13+
</PropertyGroup>
14+
15+
<!-- Translations -->
16+
<ItemGroup Condition="Exists('Translations.json')">
1017
<EmbeddedResource Include="Translations.json" />
18+
</ItemGroup>
19+
20+
<!-- Licenses -->
21+
<ItemGroup Condition="Exists('LICENSES.md')">
1122
<EmbeddedResource Include="LICENSES.md" />
23+
<None Include="LICENSES.md" CopyToOutputDirectory="PreserveNewest" />
1224
</ItemGroup>
1325

26+
<!-- NuGet dependencies -->
1427
<ItemGroup>
1528
<PackageReference Include="AutoCtor" Version="2.8.1" PrivateAssets="all" ExcludeAssets="compile;runtime" />
1629
<PackageReference Include="Injectio" Version="5.0.0" PrivateAssets="all" />
1730
</ItemGroup>
1831

32+
<!-- HaselCommon -->
1933
<ItemGroup>
2034
<ProjectReference Include="..\HaselCommon\HaselCommon\HaselCommon.csproj" />
2135
</ItemGroup>

LeveHelper/Plugin.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public sealed class Plugin : IDalamudPlugin
1212

1313
public Plugin(IDalamudPluginInterface pluginInterface)
1414
{
15+
#if CUSTOM_CS
16+
pluginInterface.InitializeCustomClientStructs();
17+
#endif
18+
1519
_host = new HostBuilder()
1620
.UseContentRoot(pluginInterface.AssemblyLocation.Directory!.FullName)
1721
.ConfigureServices(services =>

LeveHelper/Services/CraftQueueState.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ namespace LeveHelper.Services;
2828
public partial class CraftQueueState : IDisposable
2929
{
3030
private readonly IClientState _clientState;
31+
private readonly ITextureProvider _textureProvider;
3132
private readonly ExcelService _excelService;
32-
private readonly TextureService _textureService;
3333
private readonly TextService _textService;
3434
private readonly MapService _mapService;
3535
private readonly ImGuiContextMenuService _imGuiContextMenuService;
@@ -272,7 +272,7 @@ public void DrawItem(Item item, uint neededCount = 0, string key = "Item", bool
272272
// draw icons to the right: Gather, Vendor..
273273
var isLeveRequiredItem = !(_itemService.IsFish(item.RowId) || _itemService.IsSpearfish(item.RowId)) && LeveRequiredItems.Any(entry => entry.Item.RowId == item.RowId);
274274

275-
_textureService.DrawIcon(new GameIconLookup(item.Icon, isLeveRequiredItem), 20);
275+
_textureProvider.DrawIcon(new GameIconLookup(item.Icon, isLeveRequiredItem), 20);
276276
ImGui.SameLine();
277277

278278
var color = Color.White;
@@ -434,7 +434,7 @@ public void DrawItem(Item item, uint neededCount = 0, string key = "Item", bool
434434
}
435435

436436
ImGui.SameLine(availSize.X - 20, 0);
437-
_textureService.DrawIcon(classJobIcon, 20);
437+
_textureProvider.DrawIcon(classJobIcon, 20);
438438
}
439439
}
440440
}

LeveHelper/Tables/Columns/TypeColumn.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
using AutoCtor;
44
using Dalamud.Interface.Utility;
55
using Dalamud.Interface.Utility.Raii;
6+
using Dalamud.Plugin.Services;
67
using FFXIVClientStructs.FFXIV.Client.Game.UI;
8+
using HaselCommon.Extensions;
79
using HaselCommon.Graphics;
810
using HaselCommon.Gui.ImGuiTable;
911
using HaselCommon.Services;
@@ -16,9 +18,9 @@ namespace LeveHelper.Tables.Columns;
1618
public partial class TypeColumn : ColumnNumber<Leve>, IConnectedColumn<LeveListTable>
1719
{
1820
private readonly PluginConfig _config;
21+
private readonly ITextureProvider _textureProvider;
1922
private readonly ExcelService _excelService;
2023
private readonly TextService _textService;
21-
private readonly TextureService _textureService;
2224
private readonly Dictionary<string, LeveAssignmentType[]> _groups = [];
2325

2426
private LeveListTable _table = null!;
@@ -93,7 +95,7 @@ public override void DrawColumn(Leve row)
9395
if (typeIcon != 0)
9496
{
9597
ImGui.BeginGroup();
96-
_textureService.DrawIcon(typeIcon, ImGui.GetTextLineHeight());
98+
_textureProvider.DrawIcon(typeIcon, ImGui.GetTextLineHeight());
9799
ImGui.SameLine();
98100
ImGui.Text(row.LeveAssignmentType.ValueNullable?.Name.ToString() ?? string.Empty);
99101
ImGui.EndGroup();
@@ -253,7 +255,7 @@ private unsafe bool DrawComboOption(LeveAssignmentType type)
253255
if (type.Icon != 0)
254256
{
255257
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X / 2f);
256-
_textureService.DrawIcon(type.Icon, 20);
258+
_textureProvider.DrawIcon(type.Icon, 20);
257259
}
258260

259261
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);

LeveHelper/Windows/ConfigWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public override void Draw()
9292
{
9393
var versionString = "v" + version.ToString(3);
9494
ImGui.SetCursorPos(cursorPos + contentAvail - ImGui.CalcTextSize(versionString));
95-
ImGuiUtils.TextUnformattedDisabled(versionString);
95+
ImGui.TextDisabled(versionString);
9696
}
9797
}
9898
}

LeveHelper/packages.lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"DalamudPackager": {
1212
"type": "Direct",
13-
"requested": "[13.0.0, )",
14-
"resolved": "13.0.0",
15-
"contentHash": "Mb3cUDSK/vDPQ8gQIeuCw03EMYrej1B4J44a1AvIJ9C759p9XeqdU9Hg4WgOmlnlPe0G7ILTD32PKSUpkQNa8w=="
13+
"requested": "[13.1.0, )",
14+
"resolved": "13.1.0",
15+
"contentHash": "XdoNhJGyFby5M/sdcRhnc5xTop9PHy+H50PTWpzLhJugjB19EDBiHD/AsiDF66RETM+0qKUdJBZrNuebn7qswQ=="
1616
},
1717
"DotNet.ReproducibleBuilds": {
1818
"type": "Direct",

0 commit comments

Comments
 (0)