From 1712b5519c852cc69c80f1e6b413f90fae924bc2 Mon Sep 17 00:00:00 2001 From: Xian55 <367101+Xian55@users.noreply.github.com> Date: Thu, 26 Dec 2024 05:20:00 +0100 Subject: [PATCH] Fix: Frontend: Respect item text Quality based color based on the current Theme settings. --- Frontend/Pages/ItemComponent.razor | 24 +++------------------- Frontend/Pages/Swag.razor | 2 +- Frontend/wwwroot/css/site.css | 32 ++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/Frontend/Pages/ItemComponent.razor b/Frontend/Pages/ItemComponent.razor index 2468ba2d..b3c033b8 100644 --- a/Frontend/Pages/ItemComponent.razor +++ b/Frontend/Pages/ItemComponent.razor @@ -2,7 +2,7 @@ - + @if (Count > 1) { @Count @@ -21,7 +21,7 @@ } @if (WasRecentlyUpdated()) { - @ChangeDescription() + @ChangeDescription() } @@ -57,8 +57,7 @@ private string iconName { get; set; } = string.Empty; private string imgLink => string.Format(WApi.TinyIconUrl, iconName); - private static readonly string[] colors = { "#9d9d9d", "#fff", "#1eff00", "#0070dd", "#9345ff", "#ff8000", "#e5cc80", "#e5cc80" }; - private static readonly BadgeColor[] itemBadge = { BadgeColor.Secondary, BadgeColor.Dark, BadgeColor.Success, BadgeColor.Primary, BadgeColor.Warning, BadgeColor.Warning, BadgeColor.Warning, BadgeColor.Warning }; + private static readonly string[] colors = { "poor", "common", "uncommon", "rare", "epic", "legendary", "artifact", "heirloom" }; private static readonly Dictionary icons = new() { @@ -79,23 +78,6 @@ icons.TryAdd(Item.Entry, iconName); } - private string ItemColour() - { - switch (Item.Quality) - { - case 1: - return ""; - default: - return $"color:{colors[Item.Quality]}"; - } - } - - private BadgeColor ItemBadge() - { - if (Item.Quality < 0 || Item.Quality > 7) { return itemBadge[1]; } - return itemBadge[Item.Quality]; - } - private Currency GetItemPrice() { int value = Count * Item.SellPrice; diff --git a/Frontend/Pages/Swag.razor b/Frontend/Pages/Swag.razor index 1e0628ab..699b0fc6 100644 --- a/Frontend/Pages/Swag.razor +++ b/Frontend/Pages/Swag.razor @@ -43,7 +43,7 @@ - + @for (int i = bagReader.Bags.Length - 1; i >= 0; i--) { diff --git a/Frontend/wwwroot/css/site.css b/Frontend/wwwroot/css/site.css index cd2ca084..d68ee87f 100644 --- a/Frontend/wwwroot/css/site.css +++ b/Frontend/wwwroot/css/site.css @@ -215,3 +215,35 @@ app { width: 100%; aspect-ratio: 1.5/1; } + +.poor { + color: #9d9d9d; +} + +.common { + color: var(--bs-emphasis-color); +} + +.uncommon { + color: #1eff00; +} + +.rare { + color: #0070dd; +} + +.epic { + color: #9345ff; +} + +.legendary { + color: #ff8000; +} + +.artifact { + color: #e5cc80; +} + +.heirloom { + color: #e5cc80; +} \ No newline at end of file