diff --git a/system/scripts/actors/base-sheet.js b/system/scripts/actors/base-sheet.js index b1dcca9..9ebc88e 100644 --- a/system/scripts/actors/base-sheet.js +++ b/system/scripts/actors/base-sheet.js @@ -15,6 +15,17 @@ export class BaseSheetL5r5e extends ActorSheet { return sheetData; } + /** + * Return a light sheet if in "limited" state + * @override + */ + get template() { + if (!game.user.isGM && this.actor.limited) { + return `${CONFIG.l5r5e.paths.templates}actors/limited-sheet.html`; + } + return this.options.template; + } + /** * Update the actor. * @param event @@ -56,6 +67,11 @@ export class BaseSheetL5r5e extends ActorSheet { activateListeners(html) { super.activateListeners(html); + // *** Everything below here is only needed if the sheet is editable *** + if (!this.options.editable) { + return; + } + // *** Dice event on Skills clic *** html.find(".skill-name").on("click", (event) => { const li = $(event.currentTarget).parents(".skill"); @@ -66,11 +82,6 @@ export class BaseSheetL5r5e extends ActorSheet { }).render(true); }); - // *** Everything below here is only needed if the sheet is editable *** - if (!this.options.editable) { - return; - } - // On focus on one numeric element, select all text for better experience html.find(".select-on-focus").on("focus", (event) => { event.target.select(); diff --git a/system/scripts/actors/character-sheet.js b/system/scripts/actors/character-sheet.js index dbffc63..0d3f1f2 100644 --- a/system/scripts/actors/character-sheet.js +++ b/system/scripts/actors/character-sheet.js @@ -22,6 +22,9 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e { */ _getHeaderButtons() { let buttons = super._getHeaderButtons(); + if (!this.options.editable) { + return buttons; + } buttons.unshift({ label: game.i18n.localize("l5r5e.twenty_questions.bt_abrev"), diff --git a/system/templates/actors/limited-sheet.html b/system/templates/actors/limited-sheet.html new file mode 100644 index 0000000..68b1d01 --- /dev/null +++ b/system/templates/actors/limited-sheet.html @@ -0,0 +1,47 @@ +