-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
131 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ styles/*.map | |
.vscode/ | ||
foundry.js | ||
commons.js | ||
packs/ | ||
packs/** | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { compilePack } from "@foundryvtt/foundryvtt-cli"; | ||
import { promises as fs } from "fs"; | ||
|
||
const MODULE_ID = process.cwd(); | ||
|
||
const packs = await fs.readdir("./unpacks"); | ||
for (const pack of packs) { | ||
if (pack === ".gitattributes") continue; | ||
console.log("Packing " + pack); | ||
await compilePack( | ||
`${MODULE_ID}/unpacks/${pack}`, | ||
`${MODULE_ID}/packs/${pack}` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { extractPack } from "@foundryvtt/foundryvtt-cli"; | ||
import { promises as fs } from "fs"; | ||
import path from "path"; | ||
|
||
const MODULE_ID = process.cwd(); | ||
|
||
const packs = await fs.readdir("./packs"); | ||
for (const pack of packs) { | ||
if (pack === ".gitattributes") continue; | ||
console.log("Unpacking " + pack); | ||
const directory = `./unpacks/${pack}`; | ||
try { | ||
for (const file of await fs.readdir(directory)) { | ||
await fs.unlink(path.join(directory, file)); | ||
} | ||
} catch (error) { | ||
if (error.code === "ENOENT") console.log("No files inside of " + pack); | ||
else console.log(error); | ||
} | ||
await extractPack( | ||
`${MODULE_ID}/packs/${pack}`, | ||
`${MODULE_ID}/unpacks/${pack}` | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
import { MODULE } from "./constants.mjs"; | ||
import { localize } from "./helpers/stringHelpers.mjs"; | ||
import { MODULE_ID, SETTINGS, fu } from "./constants.mjs"; | ||
|
||
export function registerSettings() { | ||
game.settings.register(MODULE, "notify-on-error", { | ||
config: true, | ||
default: true, | ||
hint: localize("MHL.Settings.NotifyOnError.Hint"), | ||
name: localize("MHL.Settings.NotifyOnError.Name"), | ||
scope: "client", | ||
type: Boolean, | ||
}); | ||
for (const [setting, data] of Object.entries(SETTINGS)) { | ||
const settingPath = setting.replace("_", "."); | ||
fu.setProperty(game.pf2emhl.settings, settingPath, data?.default ?? null); | ||
const originalOnChange = data?.onChange ?? null; | ||
data.onChange = (value) => { | ||
fu.setProperty(game.pf2emhl.settings, settingPath, value); | ||
if (originalOnChange) originalOnChange(value); | ||
}; | ||
game.settings.register(MODULE_ID, setting, data); | ||
} | ||
} | ||
|
||
export function updateSettingsCache() { | ||
for (const setting of Object.keys(SETTINGS)) { | ||
const settingPath = setting.replace("_", "."); | ||
fu.setProperty(game.pf2emhl.settings, settingPath, game.settings.get(MODULE_ID, setting)); | ||
} | ||
} | ||
export const NOTIFY = () => game.settings.get(MODULE, 'notify-on-error'); | ||
|
||
export function setting(path) { | ||
return game.settings.get(MODULE, path); | ||
} | ||
export function setting(key) { | ||
const settingPath = key.replace("_", "."); | ||
const cached = fu.getProperty(game.pf2mhl.settings, settingPath); | ||
return cached !== undefined ? cached : game.settings.get(MODULE_ID, key); | ||
} |
26 changes: 26 additions & 0 deletions
26
unpacks/helper-library-macros/Lashing_Currents_hRCi5uHwsTJHQ4Dt.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "Lashing Currents", | ||
"type": "script", | ||
"scope": "global", | ||
"author": "xuYHxk9sJoYKM7d6", | ||
"img": "icons/magic/water/waves-water-blue.webp", | ||
"command": "await game.pf2emhl.macros.lashingCurrents();", | ||
"folder": null, | ||
"ownership": { | ||
"default": 0 | ||
}, | ||
"flags": { | ||
"core": {} | ||
}, | ||
"_stats": { | ||
"systemId": "pf2e", | ||
"systemVersion": "5.12.7", | ||
"coreVersion": "11.315", | ||
"createdTime": 1706489620730, | ||
"modifiedTime": 1706489726405, | ||
"lastModifiedBy": "xuYHxk9sJoYKM7d6" | ||
}, | ||
"_id": "hRCi5uHwsTJHQ4Dt", | ||
"sort": 0, | ||
"_key": "!macros!hRCi5uHwsTJHQ4Dt" | ||
} |