Skip to content

Commit

Permalink
Add text enrichment to effect descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
DFreds committed Apr 26, 2023
1 parent 3b96f53 commit 99bb582
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/app/effects-panel-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default class EffectsPanelApp extends Application {
}

/** @override */
getData(options) {
return this._controller.getEffectData();
async getData(options) {
return await this._controller.getEffectData();
}

/** @override */
Expand Down
5 changes: 4 additions & 1 deletion scripts/app/effects-panel-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class EffectsPanelController {
this._settings = new Settings();
}

getEffectData() {
async getEffectData() {
const temporaryEffects = [];
const passiveEffects = [];
const disabledTemporaryEffects = [];
Expand All @@ -21,6 +21,9 @@ export default class EffectsPanelController {
const effects = this._actorEffects;

for (const effect of effects) {
effect.description = await TextEditor.enrichHTML(effect.description, {
async: true,
});
if (effect.disabled && this._settings.showDisabledEffects) {
if (effect.isTemporary) {
disabledTemporaryEffects.push(effect);
Expand Down
3 changes: 3 additions & 0 deletions styles/dfreds-effects-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
padding: 0;
text-align: left;
}
.effect-panel .effect-item .effect-info a.content-link {
color: black;
}
.effect-panel .effect-item .effect-info .tags {
justify-content: flex-end;
margin: 8px;
Expand Down

0 comments on commit 99bb582

Please sign in to comment.