mirror of
https://github.com/migatu/vtt_work.git
synced 2026-07-14 13:34:42 +00:00
asd
This commit is contained in:
@@ -95,6 +95,7 @@ try {
|
|||||||
data.rtRawString = "{}";
|
data.rtRawString = "{}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// expose a minimal config (labels)
|
// expose a minimal config (labels)
|
||||||
data.cfg = {
|
data.cfg = {
|
||||||
labels: {
|
labels: {
|
||||||
@@ -145,16 +146,16 @@ try {
|
|||||||
callback: async (html) => {
|
callback: async (html) => {
|
||||||
const form = html[0].querySelector("form") || html[0];
|
const form = html[0].querySelector("form") || html[0];
|
||||||
const get = (k) => Number(form.querySelector(`[name="${k}"]`)?.value || 0);
|
const get = (k) => Number(form.querySelector(`[name="${k}"]`)?.value || 0);
|
||||||
const patch = {
|
const patchBase = {
|
||||||
"base.armour": get("armour"),
|
armour: get("armour"),
|
||||||
"base.integrity": get("integrity"),
|
integrity: get("integrity"),
|
||||||
"base.manoeuvre": get("manoeuvre"),
|
manoeuvre: get("manoeuvre"),
|
||||||
"base.detection": get("detection"),
|
detection: get("detection"),
|
||||||
"base.speed": get("speed"),
|
speed: get("speed"),
|
||||||
"base.space": get("space"),
|
space: get("space"),
|
||||||
"base.power": get("power")
|
power: get("power")
|
||||||
};
|
};
|
||||||
for (const [k, v] of Object.entries(patch)) await this.actor.setFlag(VB_MOD, k, v);
|
await this.actor.setFlag(VB_MOD, "base", patchBase);
|
||||||
this.render(true);
|
this.render(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
Hooks.once('init', () => {
|
Hooks.once('init', async () => {
|
||||||
try {
|
try {
|
||||||
if (typeof Handlebars?.registerHelper === "function") {
|
if (typeof Handlebars?.registerHelper === "function") {
|
||||||
Handlebars.registerHelper("json", (ctx) => JSON.stringify(ctx ?? {}, null, 2));
|
Handlebars.registerHelper("json", (ctx) => JSON.stringify(ctx ?? {}, null, 2));
|
||||||
}
|
}
|
||||||
|
await loadTemplates([
|
||||||
|
"modules/wg-voidships-builder/templates/voidship-sheet.hbs"
|
||||||
|
]);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("wg-voidships-builder: handlebars helper failed", e);
|
console.warn("wg-voidships-builder: init failed", e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user