Skip to content

Commit

Permalink
update front-end to use renown object with properties instead of maxR…
Browse files Browse the repository at this point in the history
…enown
  • Loading branch information
maxdekrieger committed Jan 28, 2023
1 parent 005f824 commit f4d3886
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/api/reputations.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ 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);
if (faction.renown) {
const step = faction.renown.step || 2500;
f.levels = renownToLevels(faction.renown.max, step);
f.renown = true;
}

Expand Down Expand Up @@ -110,9 +111,9 @@ function levelsAsList(levelsDict) {
return items;
}

function maxRenownToLevels(maxRenown, step = 2500) {
function renownToLevels(max, step) {
var items = [];
for (i = 0; i <= maxRenown; i++) {
for (i = 0; i <= max; i++) {
items.push([i * step, "Renown " + i])
}
return items;
Expand Down

0 comments on commit f4d3886

Please sign in to comment.