some work on 20 questions

fix on actor narrative : social_standing -> social
This commit is contained in:
Vlyan
2020-12-14 23:50:35 +01:00
parent 45ca9d1071
commit a86a0f3ab6
6 changed files with 157 additions and 69 deletions

View File

@@ -1,3 +1,5 @@
import { TwentyQuestionsDialog } from "./twenty-questions-dialog.js";
export class ActorSheetL5r5e extends ActorSheet {
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
@@ -10,6 +12,25 @@ export class ActorSheetL5r5e extends ActorSheet {
});
}
/**
* Add the TwentyQuestions button on top of sheet
* @override
*/
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
label: "20Q", // TODO localization
class: "twenty-questions",
icon: "fas fa-graduation-cap",
onclick: async () => {
await new TwentyQuestionsDialog({}, this.actor).render(true);
},
});
return buttons;
}
getData() {
const sheetData = super.getData();
@@ -131,8 +152,6 @@ export class ActorSheetL5r5e extends ActorSheet {
* @param {string} skillId Unique ID of the skill been clicked.
*/
async _onSkillClicked(skillId) {
console.log("Clicked on skill " + skillId);
new game.l5r5e.DicePickerDialog({ skillId: skillId, actor: this.actor }).render();
new game.l5r5e.DicePickerDialog({ skillId: skillId, actor: this.actor }).render(true);
}
}