..
This commit is contained in:
File diff suppressed because one or more lines are too long
+17
-10
@@ -1,21 +1,28 @@
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
let path = "./scripts/"
|
let basePath = "./scripts/";
|
||||||
let scripts = fs.readdirSync(path);
|
let scripts = fs.readdirSync(basePath);
|
||||||
let count = 0;
|
let count = 0;
|
||||||
let scriptObj = {};
|
let scriptObj = {};
|
||||||
for(let file of scripts)
|
|
||||||
{
|
for (let file of scripts) {
|
||||||
let script = fs.readFileSync(path + file, {encoding:"utf8"});
|
let fullPath = path.join(basePath, file);
|
||||||
scriptObj[file.split(".")[0]] = script;
|
|
||||||
count++;
|
// Ignoriere Verzeichnisse
|
||||||
|
if (fs.lstatSync(fullPath).isDirectory()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let script = fs.readFileSync(fullPath, { encoding: "utf8" });
|
||||||
|
scriptObj[file.split(".")[0]] = script;
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
let scriptLoader = `export default function()
|
let scriptLoader = `export default function()
|
||||||
{
|
{
|
||||||
mergeObject(game.wfrp4e.config.effectScripts, ${JSON.stringify(scriptObj)});
|
mergeObject(game.wfrp4e.config.effectScripts, ${JSON.stringify(scriptObj)});
|
||||||
|
|
||||||
}`
|
}`
|
||||||
|
|
||||||
fs.writeFileSync("./modules/loadScripts.js", scriptLoader)
|
fs.writeFileSync("./modules/loadScripts.js", scriptLoader);
|
||||||
console.log(`Packed ${count} scripts`);
|
console.log(`Packed ${count} scripts`);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
if (!this.item.name.includes("(") || this.item.system.tests.value.includes("(Sense)"))
|
if (!this.item.name.includes("(") || this.item.system.tests.value.includes("(Sinn)"))
|
||||||
{
|
{
|
||||||
let tests = this.item.system.tests.value
|
let tests = this.item.system.tests.value
|
||||||
let name = this.item.name
|
let name = this.item.name
|
||||||
@@ -12,12 +12,12 @@ if (!this.item.name.includes("(") || this.item.system.tests.value.includes("(Sen
|
|||||||
else // If no sense specified, provide dialog choice
|
else // If no sense specified, provide dialog choice
|
||||||
{
|
{
|
||||||
let choice = await ItemDialog.create(ItemDialog.objectToArray({
|
let choice = await ItemDialog.create(ItemDialog.objectToArray({
|
||||||
taste : "Taste",
|
taste : "Geschmack",
|
||||||
sight : "Sight",
|
sight : "Sicht",
|
||||||
smell : "Smell",
|
smell : "Geruch",
|
||||||
hearing : "Hearing",
|
hearing : "Gehör",
|
||||||
touch : "Touch"
|
touch : "Berührung"
|
||||||
}, this.item.img), 1, "Choose Sense");
|
}, this.item.img), 1, "Wähle Sinn");
|
||||||
if (choice[0])
|
if (choice[0])
|
||||||
{
|
{
|
||||||
name = `${name.split("(")[0].trim()} (${choice[0].name})`
|
name = `${name.split("(")[0].trim()} (${choice[0].name})`
|
||||||
|
|||||||
Reference in New Issue
Block a user