From 52b8b4e660f5a3b2847c6c60a062d50a68fc0093 Mon Sep 17 00:00:00 2001 From: Max de Krieger Date: Sat, 21 Jan 2023 11:56:59 +0100 Subject: [PATCH] make renown reputation scale based on percentage --- src/api/reputations.js | 1 + src/components/ReputationRow.svelte | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/reputations.js b/src/api/reputations.js index 0582feb4..7ba951ea 100644 --- a/src/api/reputations.js +++ b/src/api/reputations.js @@ -74,6 +74,7 @@ function parseFactions(all_factions, my_reputations) { // If it's a faction with renown such as Dragonflight factions if (faction.maxRenown) { f.levels = maxRenownToLevels(faction.maxRenown); + f.renown = true; } var stand = standing[faction.id]; diff --git a/src/components/ReputationRow.svelte b/src/components/ReputationRow.svelte index 4e6716ae..dad3ac94 100644 --- a/src/components/ReputationRow.svelte +++ b/src/components/ReputationRow.svelte @@ -17,7 +17,9 @@ return levelColors[ Math.max( 0, - levelColors.length - (faction.levels.length - level) + faction.renown ? + Math.floor((level / faction.levels.length) * (levelColors.length - 1)) : + levelColors.length - (faction.levels.length - level) ) ]; }