diff --git a/Daybreak.API/Services/InventoryService.cs b/Daybreak.API/Services/InventoryService.cs index e0297a30..7dfed1b6 100644 --- a/Daybreak.API/Services/InventoryService.cs +++ b/Daybreak.API/Services/InventoryService.cs @@ -37,7 +37,7 @@ public sealed class InventoryService( return default; } - var itemTuples = new List<(BagType Type,List<(uint ModelId, string EncodedCompleteName, string EncodedSingleName, string EncodedName, int Quantity, uint[] Modifiers)>)>(); + var itemTuples = new List<(BagType Type,List<(uint ModelId, string EncodedCompleteName, string EncodedSingleName, string EncodedName, int Quantity, uint[] Modifiers, ItemType ItemType)>)>(); foreach (var bag in inventory.Pointer->Bags) { if (bag is null) @@ -45,7 +45,7 @@ public sealed class InventoryService( continue; } - var retBag = new List<(uint ModelId, string EncodedCompleteName, string EncodedSingleName, string EncodedName, int Quantity, uint[] Modifiers)>(); + var retBag = new List<(uint ModelId, string EncodedCompleteName, string EncodedSingleName, string EncodedName, int Quantity, uint[] Modifiers, ItemType ItemType)>(); itemTuples.Add((bag->Type, retBag)); if (bag->ItemsCount is 0) { @@ -69,7 +69,7 @@ public sealed class InventoryService( modifiers[j] = item.Pointer->Modifiers[j].Mod; } - retBag.Add((item.Pointer->ModelId, completeNameEncoded, singleItemName, nameEncoded, item.Pointer->Quantity, modifiers)); + retBag.Add((item.Pointer->ModelId, completeNameEncoded, singleItemName, nameEncoded, item.Pointer->Quantity, modifiers, item.Pointer->Type)); } } @@ -89,7 +89,7 @@ public sealed class InventoryService( var decodedName = await this.uIService.DecodeString(item.EncodedName, Language.English, cancellationToken); var decodedCompleteName = await this.uIService.DecodeString(item.EncodedCompleteName, Language.English, cancellationToken); var decodedSingleName = await this.uIService.DecodeString(item.EncodedSingleName, Language.English, cancellationToken); - return (item.ModelId, item.EncodedName, DecodedName: decodedName, item.EncodedSingleName, DecodedSingleName: decodedSingleName, item.EncodedCompleteName, DecodedCompleteName: decodedCompleteName, item.Quantity, item.Modifiers); + return (item.ModelId, item.EncodedName, DecodedName: decodedName, item.EncodedSingleName, DecodedSingleName: decodedSingleName, item.EncodedCompleteName, DecodedCompleteName: decodedCompleteName, item.Quantity, item.Modifiers, item.ItemType); })); return (tuple.Type, Items: decodedItems.ToList()); })); @@ -108,7 +108,8 @@ public sealed class InventoryService( EncodedCompleteName: ToBase64(item.EncodedCompleteName), DecodedCompleteName: item.DecodedCompleteName ?? string.Empty, Quantity: item.Quantity, - Modifiers: item.Modifiers))]))]); + Modifiers: item.Modifiers, + ItemType: item.ItemType.ToString()))]))]); } private static string ToBase64(string encoded) diff --git a/Daybreak.Shared/Models/Api/ItemEntry.cs b/Daybreak.Shared/Models/Api/ItemEntry.cs index 0bf51bf0..db68cb3e 100644 --- a/Daybreak.Shared/Models/Api/ItemEntry.cs +++ b/Daybreak.Shared/Models/Api/ItemEntry.cs @@ -8,6 +8,7 @@ public sealed record ItemEntry( string DecodedSingleName, string EncodedCompleteName, string DecodedCompleteName, + string ItemType, int Quantity, uint[] Modifiers) { diff --git a/Daybreak/Views/App.razor.cs b/Daybreak/Views/App.razor.cs index 674d05ef..0d2d22ff 100644 --- a/Daybreak/Views/App.razor.cs +++ b/Daybreak/Views/App.razor.cs @@ -307,22 +307,25 @@ private async void OnThemeChange() /* * Below code hooks into the webview to set the trade chat theme based on the current application theme. */ - if (Global.CoreWebView2 is null) + await this.blazorHostWindow.Dispatcher.InvokeAsync(async () => { - return; - } + if (Global.CoreWebView2 is null) + { + return; + } - if (this.tradeChatThemeSetterScript is not null) - { - Global.CoreWebView2.RemoveScriptToExecuteOnDocumentCreated(this.tradeChatThemeSetterScript); - this.tradeChatThemeSetterScript = default; - } + if (this.tradeChatThemeSetterScript is not null) + { + Global.CoreWebView2.RemoveScriptToExecuteOnDocumentCreated(this.tradeChatThemeSetterScript); + this.tradeChatThemeSetterScript = default; + } - this.tradeChatThemeSetterScript = await Global.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(@$" + this.tradeChatThemeSetterScript = await Global.CoreWebView2.AddScriptToExecuteOnDocumentCreatedAsync(@$" if (location.origin === 'https://kamadan.gwtoolbox.com' || location.origin === 'https://ascalon.gwtoolbox.com') {{ localStorage.setItem('mode', '{(this.themeManager.CurrentTheme?.Mode is LightDarkMode.Light ? "light" : "dark")}'); }}"); + }); } private void LoadMenuCategories() diff --git a/Directory.Build.props b/Directory.Build.props index fda7d906..ae877564 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ $(NoWarn);IL2104;IL3053;IL3000;IL3002;NU1701;CS0108 - 0.9.9.88 + 0.9.9.89 enable enable