Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ui/core/components/individual_sim_ui/gem_summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Player } from '../../player';
import { UIGem as Gem } from '../../proto/ui.js';
import { ActionId } from '../../proto_utils/action_id';
import { SimUI } from '../../sim_ui';
import { TypedEvent } from '../../typed_event';
import { ContentBlock } from '../content_block';

interface GemSummaryData {
Expand All @@ -26,6 +27,20 @@ export class GemSummary extends Component {
header: { title: 'Gem Summary' },
});
player.gearChangeEmitter.on(() => this.updateTable());

const headerElement = this.container.headerElement;
if (headerElement) {
const unequipButton = document.createElement('button');
unequipButton.innerHTML = `<i class="fas fa-times me-1"></i> Unequip All Gems`;
unequipButton.classList.add('btn', 'btn-sm', 'btn-link', 'gem-reset-button');
unequipButton.id = 'unequip-all-gems-btn';
unequipButton.onclick = () => this.unequipAllGems();
headerElement.appendChild(unequipButton);
}
}

private unequipAllGems() {
this.player.setGear(TypedEvent.nextEventID(), this.player.getGear().withoutGems());
}

private updateTable() {
Expand Down
10 changes: 9 additions & 1 deletion ui/scss/shared/_gems.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
position: relative;
width: var(--gem-width);
height: var(--gem-width);

&:not(:last-child) {
margin-right: 1px;
}
Expand All @@ -30,3 +30,11 @@
height: 100%;
inset: 0;
}

.gem-reset-button {
margin-left: auto;
display: flex;
align-items: center;
padding: 0;
color: #ef9eaa;
}