limited sheet for limited rights ^^
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user