Skip to content

Commit

Permalink
fix gem summary tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Apr 14, 2024
1 parent 4e90b93 commit caff715
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions ui/core/components/individual_sim_ui/gem_summary.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { SimUI } from "../../sim_ui";
import { Component } from "../../components/component";
import { Player } from "../../player";
import { setItemQualityCssClass } from "../../css_utils";
import { ActionId } from "../../proto_utils/action_id";
import { Component } from '../../components/component';
import { setItemQualityCssClass } from '../../css_utils';
import { Player } from '../../player';
import { UIGem as Gem } from '../../proto/ui.js';
import { ContentBlock } from "../content_block";
import { ActionId } from '../../proto_utils/action_id';
import { SimUI } from '../../sim_ui';
import { ContentBlock } from '../content_block';

interface GemSummaryData {
gem: Gem
count: number
gem: Gem;
count: number;
}

export class GemSummary extends Component {
Expand All @@ -23,7 +23,7 @@ export class GemSummary extends Component {
this.player = player;

this.container = new ContentBlock(this.rootElem, 'gem-summary-container', {
header: {title: 'Gem Summary'}
header: { title: 'Gem Summary' },
});
player.gearChangeEmitter.on(() => this.updateTable());
}
Expand All @@ -35,21 +35,21 @@ export class GemSummary extends Component {

for (const gem of fullGemList) {
if (gemCounts[gem.name]) {
gemCounts[gem.name].count += 1
gemCounts[gem.name].count += 1;
} else {
gemCounts[gem.name] = {
gem: gem,
count: 1,
}
};
}
}

for (const gemName of Object.keys(gemCounts)) {
const gemData = gemCounts[gemName]
const gemData = gemCounts[gemName];
const row = document.createElement('div');
row.classList.add('d-flex', 'align-items-center', 'justify-content-between')
row.classList.add('d-flex', 'align-items-center', 'justify-content-between');
row.innerHTML = `
<a class="gem-summary-link">
<a class="gem-summary-link" data-whtticon="false" target="_blank">
<img class="gem-icon"/>
<div>${gemName}</div>
</a>
Expand All @@ -61,10 +61,12 @@ export class GemSummary extends Component {

setItemQualityCssClass(gemLinkElem, gemData.gem.quality);

ActionId.fromItemId(gemData.gem.id).fill().then(filledId => {
gemIconElem.src = filledId.iconUrl;
filledId.setWowheadHref(gemLinkElem);
});
ActionId.fromItemId(gemData.gem.id)
.fill()
.then(filledId => {
gemIconElem.src = filledId.iconUrl;
filledId.setWowheadHref(gemLinkElem);
});

this.container.bodyElement.appendChild(row);
}
Expand Down

0 comments on commit caff715

Please sign in to comment.