Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Daybreak.API/Services/InventoryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ 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)
{
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)
{
Expand All @@ -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));
}
}

Expand All @@ -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());
}));
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Daybreak.Shared/Models/Api/ItemEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public sealed record ItemEntry(
string DecodedSingleName,
string EncodedCompleteName,
string DecodedCompleteName,
string ItemType,
int Quantity,
uint[] Modifiers)
{
Expand Down
21 changes: 12 additions & 9 deletions Daybreak/Views/App.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<NoWarn>$(NoWarn);IL2104;IL3053;IL3000;IL3002;NU1701;CS0108</NoWarn>

<Version>0.9.9.88</Version>
<Version>0.9.9.89</Version>

<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Loading