Issue 74: Adding all active conditions to the top of dice-picker-dialog so you are...
This commit is contained in:
@@ -513,6 +513,9 @@ export class DicePickerDialog extends FormApplication {
|
||||
this._updateVoidPointUsage();
|
||||
this.render(false);
|
||||
});
|
||||
|
||||
// Open journal on effect name
|
||||
html.find(".effect-name").on("click", this._openEffectJournal.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -864,4 +867,34 @@ export class DicePickerDialog extends FormApplication {
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the core linked journal effect if exist
|
||||
* @param {Event} event
|
||||
* @private
|
||||
*/
|
||||
async _openEffectJournal(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const effectId = $(event.currentTarget).data("effect-id");
|
||||
if (!effectId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const effect = this._actor?.effects?.get(effectId);
|
||||
if (!effect?.system?.id && !effect?.system?.uuid) {
|
||||
return;
|
||||
}
|
||||
|
||||
const journal = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({
|
||||
id: effect.system.id,
|
||||
uuid: effect.system.uuid,
|
||||
type: "JournalEntry",
|
||||
});
|
||||
if (journal) {
|
||||
// Open on the "rules" section. If non exists then it will open the first page
|
||||
journal.sheet.render(true, {pageIndex: 2});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user