Merge branch 'renovate/league-of-foundry-developers-foundry-vtt-types-9.x' into 'master'

chore(deps): update dependency @league-of-foundry-developers/foundry-vtt-types to v9.242.0

See merge request dungeonslayers/ds4!165
This commit is contained in:
Johannes Loher 2022-01-23 10:14:15 +00:00
commit 70714629cb
4 changed files with 19 additions and 31 deletions

View file

@ -61,7 +61,7 @@
"@commitlint/cli": "16.1.0",
"@commitlint/config-conventional": "16.0.0",
"@guanghechen/rollup-plugin-copy": "1.8.6",
"@league-of-foundry-developers/foundry-vtt-types": "9.238.1",
"@league-of-foundry-developers/foundry-vtt-types": "9.242.0",
"@seald-io/nedb": "2.2.1",
"@types/fs-extra": "9.0.13",
"@types/jest": "27.4.0",

View file

@ -80,7 +80,7 @@ export class DS4ActiveEffect extends ActiveEffect {
}
/**
* Gets the source document for this effect. Uses the cached {@link DS4ActiveEffect#origin} if it has already been
* Gets the source document for this effect. Uses the cached {@link DS4ActiveEffect#source} if it has already been
* set.
*/
protected async getSource(): ReturnType<typeof fromUuid> {

View file

@ -9,41 +9,29 @@ export class DS4Roll<D extends Record<string, unknown> = Record<string, unknown>
static CHAT_TEMPLATE = "systems/ds4/templates/dice/roll.hbs";
/**
* This only differs from {@link Roll.render} in that it provides `isCoup` and `isFumble` properties to the roll
* template if the first dice term is a ds4 check.
* @override
* @remarks
* This only differs from {@link Roll#render} in that it provides `isCoup` and `isFumble` properties to the roll
* template if the first dice term is a ds4 check.
*/
async render(chatOptions: Parameters<Roll["render"]>[0] = {}): Promise<string> {
chatOptions = foundry.utils.mergeObject(
{
user: getGame().user?.id,
flavor: null,
template: DS4Roll.CHAT_TEMPLATE,
blind: false,
},
chatOptions,
);
const isPrivate = chatOptions.isPrivate;
// Execute the roll, if needed
if (!this._evaluated) this.evaluate();
// Define chat data
async render({
flavor,
template = (this.constructor as typeof DS4Roll).CHAT_TEMPLATE,
isPrivate = false,
}: Parameters<Roll["render"]>[0] = {}): Promise<string> {
if (!this._evaluated) await this.evaluate({ async: true });
const firstDiceTerm = this.dice[0];
const isCoup = firstDiceTerm instanceof DS4Check && firstDiceTerm.coup;
const isFumble = firstDiceTerm instanceof DS4Check && firstDiceTerm.fumble;
const chatData = {
formula: isPrivate ? "???" : this._formula,
flavor: isPrivate ? null : chatOptions.flavor,
user: chatOptions.user,
flavor: isPrivate ? null : flavor,
user: getGame().user?.id,
tooltip: isPrivate ? "" : await this.getTooltip(),
total: isPrivate ? "?" : Math.round((this.total ?? 0) * 100) / 100,
isCoup: isPrivate ? null : isCoup,
isFumble: isPrivate ? null : isFumble,
};
// Render the roll display template
return renderTemplate(chatOptions.template ?? "", chatData);
return renderTemplate(template, chatData);
}
}

View file

@ -1151,9 +1151,9 @@ __metadata:
languageName: node
linkType: hard
"@league-of-foundry-developers/foundry-vtt-types@npm:9.238.1":
version: 9.238.1
resolution: "@league-of-foundry-developers/foundry-vtt-types@npm:9.238.1"
"@league-of-foundry-developers/foundry-vtt-types@npm:9.242.0":
version: 9.242.0
resolution: "@league-of-foundry-developers/foundry-vtt-types@npm:9.242.0"
dependencies:
"@types/jquery": ~3.5.9
"@types/simple-peer": ~9.11.1
@ -1162,7 +1162,7 @@ __metadata:
pixi.js: 5.3.11
socket.io-client: 4.3.2
tinymce: 5.10.1
checksum: 8d266dd7f3f44ffa354e3c5a15541ac335bc58a551388b8d336ee2c0fb4147920da34ff8042b0128fb2df2074b3bdbab8f4af5bd918f9dd11606b8b42422ddf9
checksum: f749fd271ca4a2c4cb6a53284329fe242ae8b36043ae1a2abf3ed3d89d4ff19b3d8f798dcd9615472a06c7937d6eff5ee7fa80aa0225c0c151a9a0539f10858d
languageName: node
linkType: hard
@ -3699,7 +3699,7 @@ __metadata:
"@commitlint/cli": 16.1.0
"@commitlint/config-conventional": 16.0.0
"@guanghechen/rollup-plugin-copy": 1.8.6
"@league-of-foundry-developers/foundry-vtt-types": 9.238.1
"@league-of-foundry-developers/foundry-vtt-types": 9.242.0
"@seald-io/nedb": 2.2.1
"@types/fs-extra": 9.0.13
"@types/jest": 27.4.0