forked from public/foundryvtt-reve-de-dragon
Action de visualisation avec droits limités
This commit is contained in:
@ -120,6 +120,18 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
|
||||
HtmlUtility.showControlWhen(this.html.find(".appliquerFatigue"), ReglesOptionnelles.isUsing("appliquer-fatigue"));
|
||||
|
||||
this.html.find('.subacteur-open').click(async event => {
|
||||
const subActorId = RdDSheetUtility.getEventItemData(event, 'subactor-id');
|
||||
this.openSubActeur(subActorId);
|
||||
})
|
||||
|
||||
this.html.find('.show-hide-competences').click(async event => {
|
||||
this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
this.html.find('.visu-tmr').click(async event => this.actor.displayTMR("visu"))
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
@ -137,25 +149,11 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
const subActorId = RdDSheetUtility.getEventItemData(event, 'subactor-id')
|
||||
RdDCoeur.startSubActeurTendreMoment(this.actor.id, subActorId)
|
||||
})
|
||||
this.html.find('.subacteur-open').click(async event => {
|
||||
const subActorId = RdDSheetUtility.getEventItemData(event, 'subactor-id');
|
||||
this.openSubActeur(subActorId);
|
||||
})
|
||||
this.html.find('.subacteur-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
const subActorId = li.data("subactor-id");
|
||||
this.deleteSubActeur(subActorId, li);
|
||||
})
|
||||
this.html.find('.experiencelog-delete').click(async event => {
|
||||
const li = this.html.find(event.currentTarget)?.parents(".experiencelog");
|
||||
const key = Number(li.data("key") ?? -1);
|
||||
await this.actor.deleteExperienceLog(key, 1);
|
||||
});
|
||||
this.html.find('.experiencelog-delete-previous').click(async event => {
|
||||
const li = this.html.find(event.currentTarget)?.parents(".experiencelog");
|
||||
const key = Number(li.data("key") ?? -1);
|
||||
await this.actor.deleteExperienceLog(0, key + 1);
|
||||
});
|
||||
this.html.find("input.derivee-value[name='system.compteurs.stress.value']").change(async event => {
|
||||
this.actor.updateCompteurValue("stress", parseInt(event.target.value));
|
||||
});
|
||||
@ -204,7 +202,18 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
this.html.find('.recettecuisine-label a').click(async event => this.actor.rollRecetteCuisine(RdDSheetUtility.getItemId(event)))
|
||||
|
||||
if (game.user.isGM) {
|
||||
// Boutons spéciaux MJs
|
||||
// experience log
|
||||
this.html.find('.experiencelog-delete').click(async event => {
|
||||
const li = this.html.find(event.currentTarget)?.parents(".experiencelog");
|
||||
const key = Number(li.data("key") ?? -1);
|
||||
await this.actor.deleteExperienceLog(key, 1);
|
||||
});
|
||||
this.html.find('.experiencelog-delete-previous').click(async event => {
|
||||
const li = this.html.find(event.currentTarget)?.parents(".experiencelog");
|
||||
const key = Number(li.data("key") ?? -1);
|
||||
await this.actor.deleteExperienceLog(0, key + 1);
|
||||
});
|
||||
// Boutons spéciaux MJs
|
||||
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
|
||||
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
|
||||
}
|
||||
@ -226,7 +235,6 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
});
|
||||
// Display TMR
|
||||
|
||||
this.html.find('.visu-tmr').click(async event => this.actor.displayTMR("visu"))
|
||||
this.html.find('.monte-tmr').click(async event => this.actor.displayTMR("normal"))
|
||||
this.html.find('.monte-tmr-rapide').click(async event => this.actor.displayTMR("rapide"))
|
||||
|
||||
@ -264,12 +272,6 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
this.html.find('.nouvelle-incarnation').click(async event => this.actor.nouvelleIncarnation())
|
||||
}
|
||||
|
||||
|
||||
this.html.find('.show-hide-competences').click(async event => {
|
||||
this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
// On pts de reve change
|
||||
this.html.find('.pointsreve-value').change(async event => this.actor.update({ "system.reve.reve.value": event.currentTarget.value }))
|
||||
this.html.find('.seuil-reve-value').change(async event => this.actor.setPointsDeSeuil(event.currentTarget.value))
|
||||
|
Reference in New Issue
Block a user