Skip to content

Commit

Permalink
Merge pull request #784 from wowsims/hotfix/add-60u-random-suffix
Browse files Browse the repository at this point in the history
Remove random suffix and reforge from 60U
  • Loading branch information
1337LutZ authored Jun 25, 2024
2 parents 948bc63 + 1414d2b commit c51fe72
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion ui/core/components/importers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ export class Individual60UImporter<SpecType extends Spec> extends Importer {
talentsStr = talentSpellIdsToTalentString(charClass, talentIds);
}

let hasRemovedRandomSuffix = false;
const modifiedItemNames: string[] = [];
const equipmentSpec = EquipmentSpec.create();
(importJson.items as Array<any>).forEach(itemJson => {
const itemSpec = ItemSpec.create();
Expand All @@ -285,16 +287,45 @@ export class Individual60UImporter<SpecType extends Spec> extends Importer {
if (itemJson.gems) {
itemSpec.gems = (itemJson.gems as Array<any>).filter(gemJson => gemJson?.id).map(gemJson => gemJson.id);
}

// As long as 60U exports the wrong suffixes we should
// inform the user that they need to manually add them.
// Due to this we also remove the reforge on the item.
if (itemJson.suffixId) {
hasRemovedRandomSuffix = true;
if (itemJson.reforge?.id) {
itemJson.reforge.id = null;
}
modifiedItemNames.push(itemJson.name);
}
if (itemJson.reforge?.id) {
itemSpec.reforging = itemJson.reforge.id;
}

equipmentSpec.items.push(itemSpec);
});

this.simUI.sim.db.lookupEquipmentSpec(equipmentSpec);

this.finishIndividualImport(this.simUI, charClass, race, equipmentSpec, talentsStr, null, []);

if (hasRemovedRandomSuffix && modifiedItemNames.length) {
new Toast({
variant: 'warning',
body: (
<>
<p>60U currently exports the wrong Random Suffixes. We have removed the random suffix on the following item(s):</p>
<ul>
{modifiedItemNames.map(itemName => (
<li>
<strong>{itemName}</strong>
</li>
))}
</ul>
</>
),
delay: 8000,
});
}
}
}

Expand Down

0 comments on commit c51fe72

Please sign in to comment.