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 = "{}";
|
||||
}
|
||||
|
||||
|
||||
// expose a minimal config (labels)
|
||||
data.cfg = {
|
||||
labels: {
|
||||
@@ -145,16 +146,16 @@ try {
|
||||
callback: async (html) => {
|
||||
const form = html[0].querySelector("form") || html[0];
|
||||
const get = (k) => Number(form.querySelector(`[name="${k}"]`)?.value || 0);
|
||||
const patch = {
|
||||
"base.armour": get("armour"),
|
||||
"base.integrity": get("integrity"),
|
||||
"base.manoeuvre": get("manoeuvre"),
|
||||
"base.detection": get("detection"),
|
||||
"base.speed": get("speed"),
|
||||
"base.space": get("space"),
|
||||
"base.power": get("power")
|
||||
const patchBase = {
|
||||
armour: get("armour"),
|
||||
integrity: get("integrity"),
|
||||
manoeuvre: get("manoeuvre"),
|
||||
detection: get("detection"),
|
||||
speed: get("speed"),
|
||||
space: get("space"),
|
||||
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);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
Hooks.once('init', () => {
|
||||
Hooks.once('init', async () => {
|
||||
try {
|
||||
if (typeof Handlebars?.registerHelper === "function") {
|
||||
Handlebars.registerHelper("json", (ctx) => JSON.stringify(ctx ?? {}, null, 2));
|
||||
}
|
||||
await loadTemplates([
|
||||
"modules/wg-voidships-builder/templates/voidship-sheet.hbs"
|
||||
]);
|
||||
} 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