mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Fixed so observer permission doesn't allow using or editing anything (#1073)
This commit is contained in:
parent
16173363d4
commit
661808b5f1
2 changed files with 24 additions and 0 deletions
|
|
@ -15,6 +15,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
static DEFAULT_OPTIONS = {
|
||||
classes: ['character'],
|
||||
position: { width: 850, height: 800 },
|
||||
/* Foundry adds disabled to all buttons and inputs if editPermission is missing. This is not desired. */
|
||||
editPermission: CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER,
|
||||
actions: {
|
||||
toggleVault: CharacterSheet.#toggleVault,
|
||||
rollAttribute: CharacterSheet.#rollAttribute,
|
||||
|
|
@ -148,6 +150,13 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
.querySelector('.level-value')
|
||||
?.addEventListener('change', event => this.document.updateLevel(Number(event.currentTarget.value)));
|
||||
|
||||
const observer = this.document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER, {
|
||||
exact: true
|
||||
});
|
||||
if (observer) {
|
||||
this.element.querySelector('.window-content').classList.add('viewMode');
|
||||
}
|
||||
|
||||
this._createFilterMenus();
|
||||
this._createSearchFilter();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,21 @@
|
|||
padding-bottom: 0;
|
||||
overflow-x: auto;
|
||||
|
||||
&.viewMode {
|
||||
button:not(.btn-toggle-view),
|
||||
input:not(.search),
|
||||
.controls,
|
||||
.character-sidebar-sheet,
|
||||
.img-portait,
|
||||
.name-row,
|
||||
.hope-section,
|
||||
.downtime-section,
|
||||
.character-traits,
|
||||
.card-list {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.character-sidebar-sheet {
|
||||
grid-row: 1 / span 2;
|
||||
grid-column: 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue