From 668c32ed8a98e92dcac354d04be5a4d8d8059153 Mon Sep 17 00:00:00 2001 From: vikingowl Date: Wed, 12 Nov 2025 23:34:37 +0100 Subject: [PATCH] feat: Add CS:GO rank icons for legacy matches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented rank icon display system for pre-CS2 matches: New Components: - RankIcon.svelte: Displays CS:GO skill group icons (0-18) - Supports sm/md/lg sizes - Shows appropriate rank icon based on skill group - Includes hover tooltips with rank names - Handles all 19 rank tiers (Silver I → Global Elite) Updated Components: - PremierRatingBadge: Now intelligently switches between: - CS:GO rank icons (when rank_old exists, rank_new doesn't) - Premier rating badge (when rank_new exists) - "Unranked" text (when neither exists) Assets: - Rank icons already present in static/images/rank_icons/ - Weapon icons already present in static/images/weapons/ - All icons in SVG format for crisp display at any size Display Logic: - Legacy matches (pre-Sept 2023): Show CS:GO rank icons - Modern matches (CS2): Show Premier rating with trophy icon - Automatically detects based on rank_old/rank_new fields The scoreboard now displays the appropriate ranking visualization based on match era, matching the original CSGO.WTF design. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/ui/PremierRatingBadge.svelte | 53 +++++++++----- src/lib/components/ui/RankIcon.svelte | 69 +++++++++++++++++++ .../static/images/rank_icons/skillgroup.svg | 1 + .../images/rank_icons/skillgroup_expired.svg | 48 +++++++++++++ .../images/rank_icons/skillgroup_none.svg | 56 +++++++++++++++ 5 files changed, 208 insertions(+), 19 deletions(-) create mode 100644 src/lib/components/ui/RankIcon.svelte create mode 100644 static/images/static/images/rank_icons/skillgroup.svg create mode 100644 static/images/static/images/rank_icons/skillgroup_expired.svg create mode 100644 static/images/static/images/rank_icons/skillgroup_none.svg diff --git a/src/lib/components/ui/PremierRatingBadge.svelte b/src/lib/components/ui/PremierRatingBadge.svelte index 2aac8ec..31cb50e 100644 --- a/src/lib/components/ui/PremierRatingBadge.svelte +++ b/src/lib/components/ui/PremierRatingBadge.svelte @@ -1,6 +1,7 @@ -
- {#if showIcon} - - {/if} +{#if isLegacyRank} + + +{:else if !rating || rating === 0} + + Unranked +{:else} + +
+ {#if showIcon} + + {/if} - {tierInfo.formatted} + {tierInfo.formatted} - {#if showTier} - ({tierInfo.tier}) - {/if} + {#if showTier} + ({tierInfo.tier}) + {/if} - {#if showChange && changeInfo} - - {#if changeInfo.isPositive} - - {:else if changeInfo.change < 0} - - {/if} - {changeInfo.display} - - {/if} -
+ {#if showChange && changeInfo} + + {#if changeInfo.isPositive} + + {:else if changeInfo.change < 0} + + {/if} + {changeInfo.display} + + {/if} +
+{/if} diff --git a/src/lib/components/ui/RankIcon.svelte b/src/lib/components/ui/RankIcon.svelte new file mode 100644 index 0000000..84ec623 --- /dev/null +++ b/src/lib/components/ui/RankIcon.svelte @@ -0,0 +1,69 @@ + + +{#if showLabel} +
+ {rankName} + {rankName} +
+{:else} + {rankName} +{/if} diff --git a/static/images/static/images/rank_icons/skillgroup.svg b/static/images/static/images/rank_icons/skillgroup.svg new file mode 100644 index 0000000..4aa1203 --- /dev/null +++ b/static/images/static/images/rank_icons/skillgroup.svg @@ -0,0 +1 @@ +Not found. diff --git a/static/images/static/images/rank_icons/skillgroup_expired.svg b/static/images/static/images/rank_icons/skillgroup_expired.svg new file mode 100644 index 0000000..addd6cb --- /dev/null +++ b/static/images/static/images/rank_icons/skillgroup_expired.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/static/images/rank_icons/skillgroup_none.svg b/static/images/static/images/rank_icons/skillgroup_none.svg new file mode 100644 index 0000000..94ba8af --- /dev/null +++ b/static/images/static/images/rank_icons/skillgroup_none.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +