mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-10 19:17:09 +01:00
Compare commits
No commits in common. "e0b3d33f80fdec0a3f0fb30870094f5e32702f62" and "6cbe7708801c0795d567fb1a544d19d0702cb95e" have entirely different histories.
e0b3d33f80
...
6cbe770880
6 changed files with 10 additions and 18 deletions
|
|
@ -355,8 +355,7 @@
|
||||||
"CompendiumBrowserSettings": {
|
"CompendiumBrowserSettings": {
|
||||||
"title": "Enable Compendiums",
|
"title": "Enable Compendiums",
|
||||||
"enableSource": "Enable Source",
|
"enableSource": "Enable Source",
|
||||||
"disableSource": "Disable Source",
|
"disableSource": "Disable Source"
|
||||||
"worldCompendiums": "World Compendiums"
|
|
||||||
},
|
},
|
||||||
"ContextMenu": {
|
"ContextMenu": {
|
||||||
"disableEffect": "Disable Effect",
|
"disableEffect": "Disable Effect",
|
||||||
|
|
|
||||||
|
|
@ -50,20 +50,13 @@ export default class CompendiumBrowserSettings extends HandlebarsApplicationMixi
|
||||||
const excludedSourceData = this.browserSettings.excludedSources;
|
const excludedSourceData = this.browserSettings.excludedSources;
|
||||||
const excludedPackData = this.browserSettings.excludedPacks;
|
const excludedPackData = this.browserSettings.excludedPacks;
|
||||||
context.typePackCollections = game.packs.reduce((acc, pack) => {
|
context.typePackCollections = game.packs.reduce((acc, pack) => {
|
||||||
const { type, label, packageType, packageName: basePackageName, id } = pack.metadata;
|
const { type, label, packageType, packageName, id } = pack.metadata;
|
||||||
if (!CompendiumBrowserSettings.#browserPackTypes.includes(type)) return acc;
|
if (packageType === 'world' || !CompendiumBrowserSettings.#browserPackTypes.includes(type)) return acc;
|
||||||
|
|
||||||
const isWorldPack = packageType === 'world';
|
|
||||||
const packageName = isWorldPack ? 'world' : basePackageName;
|
|
||||||
const sourceChecked =
|
const sourceChecked =
|
||||||
!excludedSourceData[packageName] ||
|
!excludedSourceData[packageName] ||
|
||||||
!excludedSourceData[packageName].excludedDocumentTypes.includes(type);
|
!excludedSourceData[packageName].excludedDocumentTypes.includes(type);
|
||||||
|
const sourceLabel = game.modules.get(packageName)?.title ?? game.system.title;
|
||||||
const sourceLabel =
|
|
||||||
game.modules.get(packageName)?.title ??
|
|
||||||
(isWorldPack
|
|
||||||
? game.i18n.localize('DAGGERHEART.APPLICATIONS.CompendiumBrowserSettings.worldCompendiums')
|
|
||||||
: game.system.title);
|
|
||||||
if (!acc[type]) acc[type] = { label: game.i18n.localize(`DOCUMENT.${type}s`), sources: {} };
|
if (!acc[type]) acc[type] = { label: game.i18n.localize(`DOCUMENT.${type}s`), sources: {} };
|
||||||
if (!acc[type].sources[packageName])
|
if (!acc[type].sources[packageName])
|
||||||
acc[type].sources[packageName] = { label: sourceLabel, checked: sourceChecked, packs: [] };
|
acc[type].sources[packageName] = { label: sourceLabel, checked: sourceChecked, packs: [] };
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ export default class FearTracker extends HandlebarsApplicationMixin(ApplicationV
|
||||||
position: {
|
position: {
|
||||||
width: 222,
|
width: 222,
|
||||||
height: 222
|
height: 222
|
||||||
|
// top: "200px",
|
||||||
|
// left: "120px"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -64,7 +66,7 @@ export default class FearTracker extends HandlebarsApplicationMixin(ApplicationV
|
||||||
max = this.maxFear,
|
max = this.maxFear,
|
||||||
percent = (current / max) * 100,
|
percent = (current / max) * 100,
|
||||||
isGM = game.user.isGM;
|
isGM = game.user.isGM;
|
||||||
|
// Return the data for rendering
|
||||||
return { display, current, max, percent, isGM };
|
return { display, current, max, percent, isGM };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,7 @@ export default class DhSceneNavigation extends foundry.applications.ui.SceneNavi
|
||||||
if (scene.flags.daggerheart.sceneEnvironments[0] !== environment.uuid) {
|
if (scene.flags.daggerheart.sceneEnvironments[0] !== environment.uuid) {
|
||||||
const newEnvironments = scene.flags.daggerheart.sceneEnvironments;
|
const newEnvironments = scene.flags.daggerheart.sceneEnvironments;
|
||||||
const newFirst = newEnvironments.splice(
|
const newFirst = newEnvironments.splice(
|
||||||
newEnvironments.findIndex(x => x === environment.uuid),
|
newEnvironments.findIndex(x => x === environment.uuid)
|
||||||
1
|
|
||||||
)[0];
|
)[0];
|
||||||
newEnvironments.unshift(newFirst);
|
newEnvironments.unshift(newFirst);
|
||||||
emitAsGM(
|
emitAsGM(
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,7 @@ export default class CompendiumBrowserSettings extends foundry.abstract.DataMode
|
||||||
const pack = game.packs.get(item.pack);
|
const pack = game.packs.get(item.pack);
|
||||||
if (!pack) return false;
|
if (!pack) return false;
|
||||||
|
|
||||||
const packageName = pack.metadata.packageType === 'world' ? 'world' : pack.metadata.packageName;
|
const excludedSourceData = this.excludedSources[pack.metadata.packageName];
|
||||||
const excludedSourceData = this.excludedSources[packageName];
|
|
||||||
if (excludedSourceData && excludedSourceData.excludedDocumentTypes.includes(pack.metadata.type)) return true;
|
if (excludedSourceData && excludedSourceData.excludedDocumentTypes.includes(pack.metadata.type)) return true;
|
||||||
|
|
||||||
const excludedPackData = this.excludedPacks[item.pack];
|
const excludedPackData = this.excludedPacks[item.pack];
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ const registerNonConfigSettings = () => {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
onChange: () => {
|
onChange: () => {
|
||||||
if (ui.resources) ui.resources.render();
|
if (ui.resources) ui.resources.render({ force: true });
|
||||||
ui.combat.render({ force: true });
|
ui.combat.render({ force: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue