Skip to content

Commit

Permalink
elegance++
Browse files Browse the repository at this point in the history
  • Loading branch information
Muttley committed Sep 15, 2023
1 parent ec961c4 commit 7146502
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions system/src/apps/CompendiumItemSelector.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class CompendiumItemSelector extends FormApplication {
async decorateName(item) {
// By default we just use the name, but this can be overriden by each
// selector class if needed
item.decoratedName = item.name;
return item.name;
}

async getAllItemData() {
Expand All @@ -46,7 +46,7 @@ export default class CompendiumItemSelector extends FormApplication {
this.currentItems = await this.getCurrentItems() ?? [];

for (const item of this.availableItems) {
await this.decorateName(item);
item.decoratedName = await this.decorateName(item);
}
}

Expand Down
7 changes: 1 addition & 6 deletions system/src/apps/CompendiumItemSelectors/LanguageSelector.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ export default class LanguageSelector extends CompendiumItemSelector {

async decorateName(item) {
// Decorate rare languages so they're easy to spot in the selector
if (item.system.rarity === "rare") {
item.decoratedName = `*${item.name}`;
}
else {
item.decoratedName = item.name;
}
return item.system.rarity === "rare" ? `*${item.name}` : item.name;
}

async getAvailableItems() {
Expand Down

0 comments on commit 7146502

Please sign in to comment.