Added npc generator v1

This commit is contained in:
Vlyan
2021-11-18 18:42:18 +01:00
parent 64af62a69c
commit ee2a485ab6
12 changed files with 1087 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import { BaseCharacterSheetL5r5e } from "./base-character-sheet.js";
import { CharacterGeneratorDialog } from "./character-generator-dialog.js";
/**
* NPC Sheet
@@ -16,6 +17,28 @@ export class NpcSheetL5r5e extends BaseCharacterSheetL5r5e {
});
}
/**
* Add the NpcGenerator button on top of sheet
* @override
*/
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
if (!this.isEditable || this.actor.limited) {
return buttons;
}
buttons.unshift({
label: game.i18n.localize("l5r5e.char_generator.head_bt_title"),
class: "character-generator",
icon: "fas fa-cogs",
onclick: async () => {
await new CharacterGeneratorDialog(this.actor).render(true);
},
});
return buttons;
}
/** @inheritdoc */
getData(options = {}) {
const sheetData = super.getData();