Compare commits
17 commits
Author | SHA1 | Date | |
---|---|---|---|
Johannes Loher | f8fe85c154 | ||
Johannes Loher | 5fb8e8ddc5 | ||
Johannes Loher | 68236af6ab | ||
Johannes Loher | 382f6c26ca | ||
fb6ad0b193 | |||
f605d8c9cc | |||
8c758f242c | |||
6a325db053 | |||
a891f18520 | |||
d61c2bdfee | |||
e279daf178 | |||
b397230277 | |||
53e1d8910c | |||
8221371bad | |||
0c0d75e405 | |||
88e58c62c7 | |||
Johannes Loher | 39273db7e9 |
|
@ -19,6 +19,7 @@ module.exports = {
|
|||
plugins: [],
|
||||
|
||||
globals: {
|
||||
DefaultTokenConfig: false,
|
||||
PrototypeTokenDocument: false,
|
||||
},
|
||||
|
||||
|
|
785
.yarn/releases/yarn-3.2.0.cjs
vendored
785
.yarn/releases/yarn-3.2.0.cjs
vendored
File diff suppressed because one or more lines are too long
783
.yarn/releases/yarn-3.2.2.cjs
vendored
Executable file
783
.yarn/releases/yarn-3.2.2.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
2
.yarn/sdks/eslint/package.json
vendored
2
.yarn/sdks/eslint/package.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "eslint",
|
||||
"version": "8.13.0-sdk",
|
||||
"version": "8.22.0-sdk",
|
||||
"main": "./lib/api.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
|
|
2
.yarn/sdks/prettier/package.json
vendored
2
.yarn/sdks/prettier/package.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "prettier",
|
||||
"version": "2.6.2-sdk",
|
||||
"version": "2.7.1-sdk",
|
||||
"main": "./index.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
|
|
|
@ -2,4 +2,4 @@ plugins:
|
|||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: '@yarnpkg/plugin-interactive-tools'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.2.0.cjs
|
||||
yarnPath: .yarn/releases/yarn-3.2.2.cjs
|
||||
|
|
10
module.json
10
module.json
|
@ -3,7 +3,7 @@
|
|||
"id": "darkness-dependent-vision",
|
||||
"title": "Darkness Dependent Vision",
|
||||
"description": "A module for Foundry Virtual Tabletop that provides functionality to make the dim and bright vision of tokens depend on the scene's darkness level.",
|
||||
"version": "0.3.7",
|
||||
"version": "0.3.8",
|
||||
"author": "Johannes Loher",
|
||||
"authors": [
|
||||
{
|
||||
|
@ -33,9 +33,9 @@
|
|||
],
|
||||
"url": "https://git.f3l.de/ghost/darkness-dependent-vision",
|
||||
"manifest": "https://git.f3l.de/api/v4/projects/ghost%2Fdarkness-dependent-vision/packages/generic/darkness-dependent-vision/latest/module.json",
|
||||
"download": "https://git.f3l.de/ghost/darkness-dependent-vision/-/releases/0.3.7/downloads/darkness-dependent-vision.zip",
|
||||
"download": "https://git.f3l.de/ghost/darkness-dependent-vision/-/releases/0.3.8/downloads/darkness-dependent-vision.zip",
|
||||
"bugs": "https://git.f3l.de/ghost/darkness-dependent-vision/-/issues",
|
||||
"changelog": "https://git.f3l.de/ghost/darkness-dependent-vision/-/releases/0.3.7",
|
||||
"readme": "https://git.f3l.de/ghost/darkness-dependent-vision/-/raw/0.3.7/README.md",
|
||||
"license": "https://git.f3l.de/ghost/darkness-dependent-vision/-/raw/0.3.7/LICENSE.md"
|
||||
"changelog": "https://git.f3l.de/ghost/darkness-dependent-vision/-/releases/0.3.8",
|
||||
"readme": "https://git.f3l.de/ghost/darkness-dependent-vision/-/raw/0.3.8/README.md",
|
||||
"license": "https://git.f3l.de/ghost/darkness-dependent-vision/-/raw/0.3.8/LICENSE.md"
|
||||
}
|
||||
|
|
10
package.json
10
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"private": true,
|
||||
"name": "darkness-dependent-vision",
|
||||
"version": "0.3.7",
|
||||
"version": "0.3.8",
|
||||
"description": "A module for Foundry Virtual Tabletop that provides functionality to make the dim and bright vision of tokens depend on the scene's darkness level.",
|
||||
"license": "https://git.f3l.de/ghost/darkness-dependent-vision#licensing",
|
||||
"homepage": "https://git.f3l.de/ghost/darkness-dependent-vision",
|
||||
|
@ -37,11 +37,11 @@
|
|||
"devDependencies": {
|
||||
"@commitlint/cli": "17.0.3",
|
||||
"@commitlint/config-conventional": "17.0.3",
|
||||
"@guanghechen/rollup-plugin-copy": "1.9.7",
|
||||
"@guanghechen/rollup-plugin-copy": "1.9.8",
|
||||
"@typhonjs-fvtt/eslint-config-foundry.js": "0.8.0",
|
||||
"conventional-changelog-cli": "2.2.2",
|
||||
"conventional-changelog-conventionalcommits": "5.0.0",
|
||||
"eslint": "8.20.0",
|
||||
"eslint": "8.22.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"eslint-plugin-prettier": "4.2.1",
|
||||
"fs-extra": "10.1.0",
|
||||
|
@ -51,7 +51,7 @@
|
|||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.7.1",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.77.0",
|
||||
"rollup": "2.78.1",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"semver": "7.3.7",
|
||||
"yargs": "17.5.1"
|
||||
|
@ -60,5 +60,5 @@
|
|||
"*.(js|mjs|cjs)": "eslint --fix",
|
||||
"*.(json|css|yml)": "prettier --write"
|
||||
},
|
||||
"packageManager": "yarn@3.2.0"
|
||||
"packageManager": "yarn@3.2.2"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["config:base", ":automergeAll", ":automergeBranch", ":prHourlyLimitNone", ":prConcurrentLimitNone"]
|
||||
"extends": ["config:base", ":automergeAll", ":automergeBranch", ":prHourlyLimitNone", ":prConcurrentLimitNone"],
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,10 @@ export class DarknessDependentVisionConfig extends FormApplication {
|
|||
return `${name}: ${game.i18n.localize('DarknessDependentVision.Title')}`;
|
||||
}
|
||||
|
||||
get isDefault() {
|
||||
return this.options.tokenConfig instanceof DefaultTokenConfig;
|
||||
}
|
||||
|
||||
async getData() {
|
||||
const data = this.isPrototype ? this.actor.data.token : this.token.data;
|
||||
return {
|
||||
|
@ -69,9 +73,23 @@ export class DarknessDependentVisionConfig extends FormApplication {
|
|||
}
|
||||
|
||||
async _updateObject(event, formData) {
|
||||
// Configure the Default Token Configuration
|
||||
if (this.isDefault) {
|
||||
const current = game.settings.get('core', DefaultTokenConfig.SETTING);
|
||||
const update = foundry.utils.mergeObject(current, formData, { inplace: false });
|
||||
const result = await game.settings.set('core', DefaultTokenConfig.SETTING, update);
|
||||
const tokenConfig = this.options.tokenConfig;
|
||||
tokenConfig.data = new foundry.data.TokenData(result);
|
||||
tokenConfig.object = new TokenDocument(tokenConfig.data, { actor: null });
|
||||
tokenConfig.token = tokenConfig.object;
|
||||
tokenConfig.render();
|
||||
return result;
|
||||
}
|
||||
|
||||
// Configure the Prototype Token data of an Actor
|
||||
if (this.isPrototype) return this.actor.update({ token: formData });
|
||||
|
||||
// Update an embedded Token document
|
||||
else return this.token.update(formData);
|
||||
return this.token.update(formData);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ function onGetTokenConfigHeaderButtons(tokenConfig, buttons) {
|
|||
class: 'configure-darkness-dependent-vision',
|
||||
icon: 'fas fa-eye',
|
||||
onclick: async () => {
|
||||
return new DarknessDependentVisionConfig(tokenConfig.object).render(true);
|
||||
return new DarknessDependentVisionConfig(tokenConfig.object, { tokenConfig }).render(true);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue