change rank thresholds

This commit is contained in:
2025-04-10 11:28:13 +02:00
parent 6e69332681
commit b4089a9140

View File

@@ -69,13 +69,16 @@ const EDITION_THRESHOLD = {
} }
const ENHANCEMENT_THRESHOLD = { const ENHANCEMENT_THRESHOLD = {
STEEL: 320, STEEL: 250,
GOLD: 420, GOLD: 320,
LUCKY: 560, LUCKY: 360,
GLASS: 880, GLASS: 620,
} }
const getMedal = (rank: number, mmr: number) => { const getMedal = (rank: number, mmr: number, isVanilla?: boolean) => {
if (isVanilla) {
return null
}
let enhancement = RANK_IMAGES.stone let enhancement = RANK_IMAGES.stone
let tooltip = 'Stone' let tooltip = 'Stone'
if (mmr >= ENHANCEMENT_THRESHOLD.STEEL) { if (mmr >= ENHANCEMENT_THRESHOLD.STEEL) {
@@ -284,6 +287,7 @@ export function LeaderboardPage() {
<div className='m-0 flex flex-1 flex-col'> <div className='m-0 flex flex-1 flex-col'>
<LeaderboardTable <LeaderboardTable
leaderboard={leaderboardFilteredByGameAmounts} leaderboard={leaderboardFilteredByGameAmounts}
isVanilla={leaderboardType !== 'ranked'}
sortColumn={sortColumn} sortColumn={sortColumn}
sortDirection={sortDirection} sortDirection={sortDirection}
onSort={handleSort} onSort={handleSort}
@@ -300,13 +304,15 @@ export function LeaderboardPage() {
interface LeaderboardTableProps { interface LeaderboardTableProps {
leaderboard: any[] leaderboard: any[]
sortColumn: string sortColumn: string
isVanilla?: boolean
sortDirection: 'asc' | 'desc' sortDirection: 'asc' | 'desc'
onSort: (column: string) => void onSort: (column: string) => void
getMedal: (rank: number, mmr: number) => React.ReactNode getMedal: (rank: number, mmr: number, isVanilla?: boolean) => React.ReactNode
} }
function RawLeaderboardTable({ function RawLeaderboardTable({
leaderboard, leaderboard,
isVanilla,
sortColumn, sortColumn,
sortDirection, sortDirection,
onSort, onSort,
@@ -467,7 +473,7 @@ function RawLeaderboardTable({
<span className={cn(entry.rank < 10 && 'ml-[1ch]')}> <span className={cn(entry.rank < 10 && 'ml-[1ch]')}>
{entry.rank} {entry.rank}
</span> </span>
{getMedal(entry.rank, entry.mmr)} {getMedal(entry.rank, entry.mmr, isVanilla)}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell>