Gegenstände
This commit is contained in:
1 parent
4351e5bd1f
commit
14e70d422c
13 files changed
+234
-57
No files matched your search
@@ -5,19 +5,22 @@ export async function addSpezialisierung(event, target) {
|
||||
const dataset = target.dataset;
|
||||
const path = dataset.path.replace(".value", "");
|
||||
const name = dataset.name;
|
||||
const skill = foundry.utils.getProperty(this.actor, path);
|
||||
|
||||
let level = 1;
|
||||
|
||||
const templatePath = systemPath("templates/dialog/spezialisierung-dialog.hbs");
|
||||
const templateData = {
|
||||
classes: ["M6", "dialog"],
|
||||
level
|
||||
};
|
||||
const skill = foundry.utils.getProperty(this.actor, path);
|
||||
console.warn(skill);
|
||||
// 2. Render the Handlebars template into an HTML string
|
||||
const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData);
|
||||
return foundry.applications.api.DialogV2.wait({
|
||||
window: {
|
||||
title: "Würfel Modifikatoren: " + game.i18n.localize(`Midgard6.Skills.${name}`)
|
||||
title:
|
||||
game.i18n.localize("Midgard6.Sheets.spezialisierung") +
|
||||
" " +
|
||||
game.i18n.localize(`Midgard6.Skills.${name}`)
|
||||
},
|
||||
position: {
|
||||
width: 600
|
||||
@@ -26,9 +29,8 @@ export async function addSpezialisierung(event, target) {
|
||||
actions: {},
|
||||
render: (_event, dialog) => {
|
||||
const dialogHTML = dialog.element;
|
||||
const display = dialogHTML.querySelector("#rollDisplay");
|
||||
// Variable bei jeder Änderung aktualisieren
|
||||
document.querySelectorAll('input[name="level-segment"]').forEach((radio) => {
|
||||
dialogHTML.querySelectorAll('input[name="level-segment"]').forEach((radio) => {
|
||||
radio.addEventListener("change", (e) => {
|
||||
level = parseInt(e.target.value);
|
||||
});
|
||||
@@ -61,16 +63,17 @@ export async function editSepzialisierung(event, target) {
|
||||
const dataset = target.dataset;
|
||||
const path = dataset.path;
|
||||
const name = dataset.name;
|
||||
const skill = foundry.utils.getProperty(this.actor, path);
|
||||
|
||||
let level = 1;
|
||||
let spezName = dataset.name;
|
||||
|
||||
const templatePath = systemPath("templates/dialog/spezialisierung-dialog.hbs");
|
||||
const templateData = {
|
||||
classes: ["M6", "dialog"],
|
||||
spezName,
|
||||
level
|
||||
};
|
||||
console.warn(path.replace(/^.*\.(?=[^.]+$)/g, ""));
|
||||
const skill = foundry.utils.getProperty(this.actor, path);
|
||||
// 2. Render the Handlebars template into an HTML string
|
||||
const content = await foundry.applications.handlebars.renderTemplate(templatePath, templateData);
|
||||
return foundry.applications.api.DialogV2.wait({
|
||||
@@ -87,9 +90,8 @@ export async function editSepzialisierung(event, target) {
|
||||
actions: {},
|
||||
render: (_event, dialog) => {
|
||||
const dialogHTML = dialog.element;
|
||||
const display = dialogHTML.querySelector("#rollDisplay");
|
||||
// Variable bei jeder Änderung aktualisieren
|
||||
document.querySelectorAll('input[name="level-segment"]').forEach((radio) => {
|
||||
|
||||
dialogHTML.querySelectorAll('input[name="level-segment"]').forEach((radio) => {
|
||||
radio.addEventListener("change", (e) => {
|
||||
level = parseInt(e.target.value);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user