Skip to content

Commit

Permalink
fix: show player level in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed May 8, 2023
1 parent c8c2a9b commit e739698
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,23 +392,48 @@ export default class InitiativeTrackerSettings extends PluginSettingTab {
);

headers.createDiv({ text: "Name" });
new ExtraButtonComponent(headers.createDiv())
.setIcon(HP)
.setTooltip("Max HP");
new ExtraButtonComponent(headers.createDiv())
.setIcon(AC)
.setTooltip("Armor Class");
new ExtraButtonComponent(headers.createDiv())
.setIcon(INITIATIVE)
.setTooltip("Initiative Modifier");

setIcon(
headers.createDiv({
attr: {
"aria-label": "Level"
}
}),
"swords"
);
setIcon(
headers.createDiv({
attr: {
"aria-label": "Max HP"
}
}),
HP
);
setIcon(
headers.createDiv({
attr: {
"aria-label": "Armor Class"
}
}),
AC
);
setIcon(
headers.createDiv({
attr: {
"aria-label": "Initiative Modifier"
}
}),
INITIATIVE
);
headers.createDiv();

for (let player of this.plugin.data.players) {
const playerDiv = playerView.createDiv(
"initiative-tracker-player"
);
playerDiv.createDiv({ text: player.name });
playerDiv.createDiv({
text: `${player.level ?? DEFAULT_UNDEFINED}`
});
playerDiv.createDiv({
text: `${player.hp ?? DEFAULT_UNDEFINED}`
});
Expand Down

0 comments on commit e739698

Please sign in to comment.