mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 12:41:07 +01:00
Standardized what gets refreshed by which refreshType
This commit is contained in:
parent
6ae00e15bd
commit
f84fe59c9b
3 changed files with 25 additions and 9 deletions
|
|
@ -451,3 +451,20 @@ export async function waitForDiceSoNice(message) {
|
|||
await game.dice3d.waitFor3DAnimationByMessageID(message.id);
|
||||
}
|
||||
}
|
||||
|
||||
export function refreshIsAllowed(allowedTypes, typeToCheck) {
|
||||
switch (typeToCheck) {
|
||||
case CONFIG.DH.GENERAL.refreshTypes.scene.id:
|
||||
case CONFIG.DH.GENERAL.refreshTypes.session.id:
|
||||
case CONFIG.DH.GENERAL.refreshTypes.longRest.id:
|
||||
return allowedTypes.includes(typeToCheck);
|
||||
case CONFIG.DH.GENERAL.refreshTypes.shortRest.id:
|
||||
return allowedTypes.some(
|
||||
x =>
|
||||
x === CONFIG.DH.GENERAL.refreshTypes.shortRest.id ||
|
||||
x === CONFIG.DH.GENERAL.refreshTypes.longRest.id
|
||||
);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue