forked from public/foundryvtt-reve-de-dragon
Support de plusieurs actors
This commit is contained in:
@ -315,63 +315,13 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
static getItem(itemId, actorId = undefined) {
|
||||
return actorId ? game.actors.get(actorId)?.getObjet(itemId) : game.items.get(itemId);
|
||||
return actorId ? game.actors.get(actorId)?.getItem(itemId) : game.items.get(itemId);
|
||||
}
|
||||
|
||||
static linkCompendium(pack, id, name) {
|
||||
return `@Compendium[${pack}.${id}]{${name}}`;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async creerObjet(actorSheet) {
|
||||
let itemType = $(".item-type").val();
|
||||
await actorSheet.createItem('Nouveau ' + itemType, itemType);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async selectObjetType(actorSheet) {
|
||||
let typeObjets = RdDItem.getItemTypesInventaire();
|
||||
let options = `<span class="competence-label">Selectionnez le type d'équipement</span><select class="item-type">`;
|
||||
for (let typeName of typeObjets) {
|
||||
options += `<option value="${typeName}">${typeName}</option>`
|
||||
}
|
||||
options += '</select>';
|
||||
let d = new Dialog({
|
||||
title: "Créer un équipement",
|
||||
content: options,
|
||||
buttons: {
|
||||
one: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Créer l'objet",
|
||||
callback: () => this.creerObjet(actorSheet)
|
||||
}
|
||||
}
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async selectTypeOeuvre(actorSheet) {
|
||||
let typeObjets = RdDItem.getTypesOeuvres();
|
||||
let options = `<span class="competence-label">Selectionnez le type d'oeuvre</span><select class="item-type">`;
|
||||
for (let typeName of typeObjets) {
|
||||
options += `<option value="${typeName}">${typeName}</option>`
|
||||
}
|
||||
options += '</select>';
|
||||
let d = new Dialog({
|
||||
title: "Créer un équipement",
|
||||
content: options,
|
||||
buttons: {
|
||||
one: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Créer l'objet",
|
||||
callback: () => this.creerObjet(actorSheet)
|
||||
}
|
||||
}
|
||||
});
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildListOptions(min, max) {
|
||||
let options = ""
|
||||
|
Reference in New Issue
Block a user