Skip to content

Commit

Permalink
Merge pull request #616 from wowsims/60u-import-export
Browse files Browse the repository at this point in the history
fix a few things with 60U import/export
  • Loading branch information
kayla-glick authored Jun 5, 2024
2 parents d73aa3c + 070a59f commit eaea172
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions ui/core/components/exporters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,11 @@ export class IndividualWowheadGearPlannerExporter<SpecType extends Spec> extends
}
}

export class Individual80UEPExporter<SpecType extends Spec> extends Exporter {
export class Individual60UEPExporter<SpecType extends Spec> extends Exporter {
private readonly simUI: IndividualSimUI<SpecType>;

constructor(parent: HTMLElement, simUI: IndividualSimUI<SpecType>) {
super(parent, simUI, { title: '85Upgrades EP Export', allowDownload: true });
super(parent, simUI, { title: '60Upgrades Cataclysm EP Export', allowDownload: true });
this.simUI = simUI;
}

Expand All @@ -353,7 +353,7 @@ export class Individual80UEPExporter<SpecType extends Spec> extends Exporter {

const namesToWeights: Record<string, number> = {};
allUnitStats.forEach(stat => {
const statName = Individual80UEPExporter.getName(stat);
const statName = Individual60UEPExporter.getName(stat);
const weight = epValues.getUnitStat(stat);
if (weight == 0 || statName == '') {
return;
Expand All @@ -377,9 +377,9 @@ export class Individual80UEPExporter<SpecType extends Spec> extends Exporter {

static getName(stat: UnitStat): string {
if (stat.isStat()) {
return Individual80UEPExporter.statNames[stat.getStat()];
return Individual60UEPExporter.statNames[stat.getStat()];
} else {
return Individual80UEPExporter.pseudoStatNames[stat.getPseudoStat()] || '';
return Individual60UEPExporter.pseudoStatNames[stat.getPseudoStat()] || '';
}
}

Expand All @@ -399,6 +399,7 @@ export class Individual80UEPExporter<SpecType extends Spec> extends Exporter {
[Stat.StatMeleeHit]: 'hitRating',
[Stat.StatMeleeCrit]: 'critRating',
[Stat.StatMeleeHaste]: 'hasteRating',
[Stat.StatMastery]: 'masteryRating',
[Stat.StatExpertise]: 'expertiseRating',
[Stat.StatMana]: 'mana',
[Stat.StatArmor]: 'armor',
Expand All @@ -414,7 +415,6 @@ export class Individual80UEPExporter<SpecType extends Spec> extends Exporter {
[Stat.StatNatureResistance]: 'natureResistance',
[Stat.StatShadowResistance]: 'shadowResistance',
[Stat.StatBonusArmor]: 'armorBonus',
[Stat.StatMastery]: 'mastery',
};
static pseudoStatNames: Partial<Record<PseudoStat, string>> = {
[PseudoStat.PseudoStatMainHandDps]: 'dps',
Expand Down
4 changes: 2 additions & 2 deletions ui/core/components/importers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ export class IndividualJsonImporter<SpecType extends Spec> extends Importer {
export class Individual80UImporter<SpecType extends Spec> extends Importer {
private readonly simUI: IndividualSimUI<SpecType>;
constructor(parent: HTMLElement, simUI: IndividualSimUI<SpecType>) {
super(parent, simUI, '80 Upgrades Import', true);
super(parent, simUI, '60 Upgrades Cataclysm Import', true);
this.simUI = simUI;

this.descriptionElem.innerHTML = `
<p>
Import settings from <a href="https://eightyupgrades.com" target="_blank">Eighty Upgrades</a>.
Import settings from <a href="https://sixtyupgrades.com/cata" target="_blank">60 Upgrades</a>.
</p>
<p>
This feature imports gear, race, and (optionally) talents. It does NOT import buffs, debuffs, consumes, rotation, or custom stats.
Expand Down
4 changes: 2 additions & 2 deletions ui/core/individual_sim_ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ export abstract class IndividualSimUI<SpecType extends Spec> extends SimUI {

private addTopbarComponents() {
this.simHeader.addImportLink('JSON', new Importers.IndividualJsonImporter(this.rootElem, this), true);
this.simHeader.addImportLink('85U', new Importers.Individual80UImporter(this.rootElem, this), true);
this.simHeader.addImportLink('60U Cata', new Importers.Individual80UImporter(this.rootElem, this), true);
this.simHeader.addImportLink('WoWHead', new Importers.IndividualWowheadGearPlannerImporter(this.rootElem, this), false);
this.simHeader.addImportLink('Addon', new Importers.IndividualAddonImporter(this.rootElem, this), true);

this.simHeader.addExportLink('Link', new Exporters.IndividualLinkExporter(this.rootElem, this), false);
this.simHeader.addExportLink('JSON', new Exporters.IndividualJsonExporter(this.rootElem, this), true);
this.simHeader.addExportLink('WoWHead', new Exporters.IndividualWowheadGearPlannerExporter(this.rootElem, this), false);
this.simHeader.addExportLink('85U EP', new Exporters.Individual80UEPExporter(this.rootElem, this), false);
this.simHeader.addExportLink('60U Cata EP', new Exporters.Individual60UEPExporter(this.rootElem, this), false);
this.simHeader.addExportLink('Pawn EP', new Exporters.IndividualPawnEPExporter(this.rootElem, this), false);
this.simHeader.addExportLink('CLI', new Exporters.IndividualCLIExporter(this.rootElem, this), true);
}
Expand Down

0 comments on commit eaea172

Please sign in to comment.