20q again, added a refresh bt and fix css
This commit is contained in:
@@ -267,6 +267,7 @@
|
|||||||
"twenty_questions": {
|
"twenty_questions": {
|
||||||
"title": "Twenty questions",
|
"title": "Twenty questions",
|
||||||
"bt_abrev": "20Q",
|
"bt_abrev": "20Q",
|
||||||
|
"bt_refresh": "Refresh",
|
||||||
"intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!",
|
"intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!",
|
||||||
"section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95",
|
"section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95",
|
||||||
"incring1": "Ring increase (1)",
|
"incring1": "Ring increase (1)",
|
||||||
|
|||||||
@@ -267,6 +267,7 @@
|
|||||||
"twenty_questions": {
|
"twenty_questions": {
|
||||||
"title": "Twenty questions",
|
"title": "Twenty questions",
|
||||||
"bt_abrev": "20Q",
|
"bt_abrev": "20Q",
|
||||||
|
"bt_refresh": "Refresh",
|
||||||
"intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!",
|
"intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!",
|
||||||
"section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95",
|
"section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95",
|
||||||
"incring1": "Ring increase (1)",
|
"incring1": "Ring increase (1)",
|
||||||
|
|||||||
@@ -267,6 +267,7 @@
|
|||||||
"twenty_questions": {
|
"twenty_questions": {
|
||||||
"title": "Vingt questions",
|
"title": "Vingt questions",
|
||||||
"bt_abrev": "20Q",
|
"bt_abrev": "20Q",
|
||||||
|
"bt_refresh": "Actualiser",
|
||||||
"intro": "Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser ultérieurement !",
|
"intro": "Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser ultérieurement !",
|
||||||
"section": "Livre de Règles de La Légende des Cinq Anneaux, Chapitre 2 : Création de personnage, p. 41-95",
|
"section": "Livre de Règles de La Légende des Cinq Anneaux, Chapitre 2 : Création de personnage, p. 41-95",
|
||||||
"incring1": "Augmentation d'anneau (1)",
|
"incring1": "Augmentation d'anneau (1)",
|
||||||
|
|||||||
@@ -35,11 +35,30 @@ export class TwentyQuestionsDialog extends FormApplication {
|
|||||||
height: 600,
|
height: 600,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
closeOnSubmit: false,
|
closeOnSubmit: false,
|
||||||
submitOnClose: true,
|
submitOnClose: false,
|
||||||
submitOnChange: true,
|
submitOnChange: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a refresh button on top of sheet
|
||||||
|
* Allow a GM or player to see the change made by another player without closing the dialog
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
_getHeaderButtons() {
|
||||||
|
let buttons = super._getHeaderButtons();
|
||||||
|
|
||||||
|
buttons.unshift({
|
||||||
|
label: game.i18n.localize("l5r5e.twenty_questions.bt_refresh"),
|
||||||
|
class: "twenty-questions",
|
||||||
|
icon: "fas fa-sync-alt",
|
||||||
|
onclick: async () => {
|
||||||
|
await new TwentyQuestionsDialog(this.actor).render(true);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return buttons;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create dialog
|
* Create dialog
|
||||||
*/
|
*/
|
||||||
@@ -182,15 +201,15 @@ export class TwentyQuestionsDialog extends FormApplication {
|
|||||||
this.errors = this.object.validateForm();
|
this.errors = this.object.validateForm();
|
||||||
|
|
||||||
// Only on close/submit
|
// Only on close/submit
|
||||||
if (event.type === "submit") {
|
// if (event.type === "submit") {
|
||||||
// Store this form datas in actor
|
// Store this form datas in actor
|
||||||
this.actor.data.data.twenty_questions = this.object.data;
|
this.actor.data.data.twenty_questions = this.object.data;
|
||||||
this.actor.update({
|
this.actor.update({
|
||||||
data: {
|
data: {
|
||||||
twenty_questions: this.object.data,
|
twenty_questions: this.object.data,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
this.render(false);
|
this.render(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,22 +1,20 @@
|
|||||||
&.l5r5e {
|
&.twenty-questions-dialog {
|
||||||
.twenty-questions-dialog {
|
table {
|
||||||
table {
|
width: 100%;
|
||||||
width: 100%;
|
}
|
||||||
}
|
table tr td {
|
||||||
table tr td {
|
vertical-align: top;
|
||||||
vertical-align: top;
|
}
|
||||||
}
|
.third {
|
||||||
.third {
|
width: 230px;
|
||||||
width: 230px;
|
}
|
||||||
}
|
.fifty {
|
||||||
.fifty {
|
width: 49%;
|
||||||
width: 49%;
|
}
|
||||||
}
|
.or {
|
||||||
.or {
|
width: 100px;
|
||||||
width: 100px;
|
}
|
||||||
}
|
.dropbox {
|
||||||
.dropbox {
|
min-height: 75px;
|
||||||
min-height: 75px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user