mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
[Feature] Browser Compendium Handling (#1648)
* Initial version * . * Fixed so that CompendiumSetting saving refreshes the CompendiumBrowser for all users * . * Improved design * Fixed max height * Fixed local reload * Added GM restriction * Raised version * Fixed tooltip * Raised verison to 1.7.0
This commit is contained in:
parent
7c86417752
commit
b23b6c75fb
17 changed files with 392 additions and 9 deletions
12
lang/en.json
12
lang/en.json
|
|
@ -352,6 +352,11 @@
|
||||||
"requestSpotlight": "Request The Spotlight",
|
"requestSpotlight": "Request The Spotlight",
|
||||||
"openCountdowns": "Countdowns"
|
"openCountdowns": "Countdowns"
|
||||||
},
|
},
|
||||||
|
"CompendiumBrowserSettings": {
|
||||||
|
"title": "Enable Compendiums",
|
||||||
|
"enableSource": "Enable Source",
|
||||||
|
"disableSource": "Disable Source"
|
||||||
|
},
|
||||||
"ContextMenu": {
|
"ContextMenu": {
|
||||||
"disableEffect": "Disable Effect",
|
"disableEffect": "Disable Effect",
|
||||||
"enableEffect": "Enable Effect",
|
"enableEffect": "Enable Effect",
|
||||||
|
|
@ -2177,7 +2182,9 @@
|
||||||
"configuration": "Configuration",
|
"configuration": "Configuration",
|
||||||
"base": "Base",
|
"base": "Base",
|
||||||
"triggers": "Triggers",
|
"triggers": "Triggers",
|
||||||
"deathMoves": "Deathmoves"
|
"deathMoves": "Deathmoves",
|
||||||
|
"sources": "Sources",
|
||||||
|
"packs": "Packs"
|
||||||
},
|
},
|
||||||
"Tiers": {
|
"Tiers": {
|
||||||
"singular": "Tier",
|
"singular": "Tier",
|
||||||
|
|
@ -2846,6 +2853,7 @@
|
||||||
"ItemBrowser": {
|
"ItemBrowser": {
|
||||||
"title": "Daggerheart Compendium Browser",
|
"title": "Daggerheart Compendium Browser",
|
||||||
"hint": "Select a Folder in sidebar to start browsing through the compendium",
|
"hint": "Select a Folder in sidebar to start browsing through the compendium",
|
||||||
|
"browserSettings": "Browser Settings",
|
||||||
"searchPlaceholder": "Search...",
|
"searchPlaceholder": "Search...",
|
||||||
"columnName": "Name",
|
"columnName": "Name",
|
||||||
"tooltipFilters": "Filters",
|
"tooltipFilters": "Filters",
|
||||||
|
|
@ -3002,7 +3010,7 @@
|
||||||
"rulesOn": "Rules On",
|
"rulesOn": "Rules On",
|
||||||
"rulesOff": "Rules Off",
|
"rulesOff": "Rules Off",
|
||||||
"remainingUses": "Uses refresh on {type}",
|
"remainingUses": "Uses refresh on {type}",
|
||||||
"rightClickExtand": "Right-Click to extand",
|
"rightClickExtend": "Right-Click to extend",
|
||||||
"companionPartnerLevelBlock": "The companion needs an assigned partner to level up.",
|
"companionPartnerLevelBlock": "The companion needs an assigned partner to level up.",
|
||||||
"configureAttribution": "Configure Attribution",
|
"configureAttribution": "Configure Attribution",
|
||||||
"deleteItem": "Delete Item",
|
"deleteItem": "Delete Item",
|
||||||
|
|
|
||||||
136
module/applications/dialogs/CompendiumBrowserSettings.mjs
Normal file
136
module/applications/dialogs/CompendiumBrowserSettings.mjs
Normal file
|
|
@ -0,0 +1,136 @@
|
||||||
|
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
|
||||||
|
|
||||||
|
export default class CompendiumBrowserSettings extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.browserSettings = game.settings
|
||||||
|
.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.CompendiumBrowserSettings)
|
||||||
|
.toObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
tag: 'div',
|
||||||
|
classes: ['daggerheart', 'dialog', 'dh-style', 'views', 'compendium-brower-settings'],
|
||||||
|
window: {
|
||||||
|
icon: 'fa-solid fa-book',
|
||||||
|
title: 'DAGGERHEART.APPLICATIONS.CompendiumBrowserSettings.title'
|
||||||
|
},
|
||||||
|
position: {
|
||||||
|
width: 500
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
toggleSource: CompendiumBrowserSettings.#toggleSource,
|
||||||
|
finish: CompendiumBrowserSettings.#finish
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
static PARTS = {
|
||||||
|
packs: {
|
||||||
|
id: 'packs',
|
||||||
|
template: 'systems/daggerheart/templates/dialogs/compendiumBrowserSettingsDialog/packs.hbs'
|
||||||
|
},
|
||||||
|
footer: { template: 'systems/daggerheart/templates/dialogs/compendiumBrowserSettingsDialog/footer.hbs' }
|
||||||
|
};
|
||||||
|
|
||||||
|
static #browserPackTypes = ['Actor', 'Item'];
|
||||||
|
|
||||||
|
_attachPartListeners(partId, htmlElement, options) {
|
||||||
|
super._attachPartListeners(partId, htmlElement, options);
|
||||||
|
|
||||||
|
for (const element of htmlElement.querySelectorAll('.pack-checkbox'))
|
||||||
|
element.addEventListener('change', this.toggleTypedPack.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**@inheritdoc */
|
||||||
|
async _prepareContext(_options) {
|
||||||
|
const context = await super._prepareContext(_options);
|
||||||
|
|
||||||
|
const excludedSourceData = this.browserSettings.excludedSources;
|
||||||
|
const excludedPackData = this.browserSettings.excludedPacks;
|
||||||
|
context.typePackCollections = game.packs.reduce((acc, pack) => {
|
||||||
|
const { type, label, packageType, packageName, id } = pack.metadata;
|
||||||
|
if (packageType === 'world' || !CompendiumBrowserSettings.#browserPackTypes.includes(type)) return acc;
|
||||||
|
|
||||||
|
const sourceChecked =
|
||||||
|
!excludedSourceData[packageName] ||
|
||||||
|
!excludedSourceData[packageName].excludedDocumentTypes.includes(type);
|
||||||
|
const sourceLabel = game.modules.get(packageName)?.title ?? game.system.title;
|
||||||
|
if (!acc[type]) acc[type] = { label: game.i18n.localize(`DOCUMENT.${type}s`), sources: {} };
|
||||||
|
if (!acc[type].sources[packageName])
|
||||||
|
acc[type].sources[packageName] = { label: sourceLabel, checked: sourceChecked, packs: [] };
|
||||||
|
|
||||||
|
const checked = !excludedPackData[id] || !excludedPackData[id].excludedDocumentTypes.includes(type);
|
||||||
|
|
||||||
|
acc[type].sources[packageName].packs.push({
|
||||||
|
pack: id,
|
||||||
|
type,
|
||||||
|
label: id === game.system.id ? game.system.title : game.i18n.localize(label),
|
||||||
|
checked: checked
|
||||||
|
});
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
static #toggleSource(event, button) {
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
const { type, source } = button.dataset;
|
||||||
|
const currentlyExcluded = this.browserSettings.excludedSources[source]
|
||||||
|
? this.browserSettings.excludedSources[source].excludedDocumentTypes.includes(type)
|
||||||
|
: false;
|
||||||
|
|
||||||
|
if (!this.browserSettings.excludedSources[source])
|
||||||
|
this.browserSettings.excludedSources[source] = { excludedDocumentTypes: [] };
|
||||||
|
this.browserSettings.excludedSources[source].excludedDocumentTypes = currentlyExcluded
|
||||||
|
? this.browserSettings.excludedSources[source].excludedDocumentTypes.filter(x => x !== type)
|
||||||
|
: [...(this.browserSettings.excludedSources[source]?.excludedDocumentTypes ?? []), type];
|
||||||
|
|
||||||
|
const toggleIcon = button.querySelector('a > i');
|
||||||
|
toggleIcon.classList.toggle('fa-toggle-off');
|
||||||
|
toggleIcon.classList.toggle('fa-toggle-on');
|
||||||
|
button.closest('.source-container').querySelector('.checks-container').classList.toggle('collapsed');
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleTypedPack(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
const { type, pack } = event.target.dataset;
|
||||||
|
const currentlyExcluded = this.browserSettings.excludedPacks[pack]
|
||||||
|
? this.browserSettings.excludedPacks[pack].excludedDocumentTypes.includes(type)
|
||||||
|
: false;
|
||||||
|
|
||||||
|
if (!this.browserSettings.excludedPacks[pack])
|
||||||
|
this.browserSettings.excludedPacks[pack] = { excludedDocumentTypes: [] };
|
||||||
|
this.browserSettings.excludedPacks[pack].excludedDocumentTypes = currentlyExcluded
|
||||||
|
? this.browserSettings.excludedPacks[pack].excludedDocumentTypes.filter(x => x !== type)
|
||||||
|
: [...(this.browserSettings.excludedPacks[pack]?.excludedDocumentTypes ?? []), type];
|
||||||
|
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
static async #finish() {
|
||||||
|
const settings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.CompendiumBrowserSettings);
|
||||||
|
await settings.updateSource(this.browserSettings);
|
||||||
|
await game.settings.set(
|
||||||
|
CONFIG.DH.id,
|
||||||
|
CONFIG.DH.SETTINGS.gameSettings.CompendiumBrowserSettings,
|
||||||
|
settings.toObject()
|
||||||
|
);
|
||||||
|
|
||||||
|
this.updated = true;
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
static async configure() {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
const app = new this();
|
||||||
|
app.addEventListener('close', () => resolve(app.updated), { once: true });
|
||||||
|
app.render({ force: true });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,3 +16,4 @@ export { default as ActionSelectionDialog } from './actionSelectionDialog.mjs';
|
||||||
export { default as GroupRollDialog } from './group-roll-dialog.mjs';
|
export { default as GroupRollDialog } from './group-roll-dialog.mjs';
|
||||||
export { default as TagTeamDialog } from './tagTeamDialog.mjs';
|
export { default as TagTeamDialog } from './tagTeamDialog.mjs';
|
||||||
export { default as RiskItAllDialog } from './riskItAllDialog.mjs';
|
export { default as RiskItAllDialog } from './riskItAllDialog.mjs';
|
||||||
|
export { default as CompendiumBrowserSettingsDialog } from './CompendiumBrowserSettings.mjs';
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { RefreshType, socketEvent } from '../../systemRegistration/socket.mjs';
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -17,6 +19,15 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
this.config = CONFIG.DH.ITEMBROWSER.compendiumConfig;
|
this.config = CONFIG.DH.ITEMBROWSER.compendiumConfig;
|
||||||
this.presets = {};
|
this.presets = {};
|
||||||
this.compendiumBrowserTypeKey = 'compendiumBrowserDefault';
|
this.compendiumBrowserTypeKey = 'compendiumBrowserDefault';
|
||||||
|
|
||||||
|
this.setupHooks = Hooks.on(socketEvent.Refresh, ({ refreshType }) => {
|
||||||
|
if (refreshType === RefreshType.CompendiumBrowser) {
|
||||||
|
if (this.rendered) {
|
||||||
|
this.render();
|
||||||
|
this.loadItems();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
|
|
@ -35,7 +46,8 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
selectFolder: this.selectFolder,
|
selectFolder: this.selectFolder,
|
||||||
expandContent: this.expandContent,
|
expandContent: this.expandContent,
|
||||||
resetFilters: this.resetFilters,
|
resetFilters: this.resetFilters,
|
||||||
sortList: this.sortList
|
sortList: this.sortList,
|
||||||
|
openSettings: this.openSettings
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
left: 100,
|
left: 100,
|
||||||
|
|
@ -157,6 +169,8 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
context.formatChoices = this.formatChoices;
|
context.formatChoices = this.formatChoices;
|
||||||
context.items = this.items;
|
context.items = this.items;
|
||||||
context.presets = this.presets;
|
context.presets = this.presets;
|
||||||
|
context.isGM = game.user.isGM;
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -214,6 +228,10 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
loadItems() {
|
loadItems() {
|
||||||
let loadTimeout = this.toggleLoader(true);
|
let loadTimeout = this.toggleLoader(true);
|
||||||
|
|
||||||
|
const browserSettings = game.settings.get(
|
||||||
|
CONFIG.DH.id,
|
||||||
|
CONFIG.DH.SETTINGS.gameSettings.CompendiumBrowserSettings
|
||||||
|
);
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
|
||||||
game.packs.forEach(pack => {
|
game.packs.forEach(pack => {
|
||||||
|
|
@ -227,7 +245,7 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
|
|
||||||
Promise.all(promises).then(async result => {
|
Promise.all(promises).then(async result => {
|
||||||
this.items = ItemBrowser.sortBy(
|
this.items = ItemBrowser.sortBy(
|
||||||
result.flatMap(r => r),
|
result.flatMap(r => r).filter(r => !browserSettings.isEntryExcluded.bind(browserSettings)(r)),
|
||||||
'name'
|
'name'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -512,6 +530,22 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
itemListContainer.replaceChildren(...newOrder);
|
itemListContainer.replaceChildren(...newOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async openSettings() {
|
||||||
|
const settingsUpdated = await game.system.api.applications.dialogs.CompendiumBrowserSettingsDialog.configure();
|
||||||
|
if (settingsUpdated) {
|
||||||
|
if (this.rendered) {
|
||||||
|
this.render();
|
||||||
|
this.loadItems();
|
||||||
|
}
|
||||||
|
await game.socket.emit(`system.${CONFIG.DH.id}`, {
|
||||||
|
action: socketEvent.Refresh,
|
||||||
|
data: {
|
||||||
|
refreshType: RefreshType.CompendiumBrowser
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_createDragProcess() {
|
_createDragProcess() {
|
||||||
new foundry.applications.ux.DragDrop.implementation({
|
new foundry.applications.ux.DragDrop.implementation({
|
||||||
dragSelector: '.item-container',
|
dragSelector: '.item-container',
|
||||||
|
|
@ -571,4 +605,9 @@ export class ItemBrowser extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
headerActions.append(button);
|
headerActions.append(button);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async close(options = {}) {
|
||||||
|
Hooks.off(socketEvent.Refresh, this.setupHooks);
|
||||||
|
await super.close(options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ export const gameSettings = {
|
||||||
LastMigrationVersion: 'LastMigrationVersion',
|
LastMigrationVersion: 'LastMigrationVersion',
|
||||||
TagTeamRoll: 'TagTeamRoll',
|
TagTeamRoll: 'TagTeamRoll',
|
||||||
SpotlightRequestQueue: 'SpotlightRequestQueue',
|
SpotlightRequestQueue: 'SpotlightRequestQueue',
|
||||||
|
CompendiumBrowserSettings: 'CompendiumBrowserSettings'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const actionAutomationChoices = {
|
export const actionAutomationChoices = {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ export { default as DhCombatant } from './combatant.mjs';
|
||||||
export { default as DhTagTeamRoll } from './tagTeamRoll.mjs';
|
export { default as DhTagTeamRoll } from './tagTeamRoll.mjs';
|
||||||
export { default as DhRollTable } from './rollTable.mjs';
|
export { default as DhRollTable } from './rollTable.mjs';
|
||||||
export { default as RegisteredTriggers } from './registeredTriggers.mjs';
|
export { default as RegisteredTriggers } from './registeredTriggers.mjs';
|
||||||
|
export { default as CompendiumBrowserSettings } from './compendiumBrowserSettings.mjs';
|
||||||
|
|
||||||
export * as countdowns from './countdowns.mjs';
|
export * as countdowns from './countdowns.mjs';
|
||||||
export * as actions from './action/_module.mjs';
|
export * as actions from './action/_module.mjs';
|
||||||
|
|
|
||||||
35
module/data/compendiumBrowserSettings.mjs
Normal file
35
module/data/compendiumBrowserSettings.mjs
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
export default class CompendiumBrowserSettings extends foundry.abstract.DataModel {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
|
||||||
|
return {
|
||||||
|
excludedSources: new fields.TypedObjectField(
|
||||||
|
new fields.SchemaField({
|
||||||
|
excludedDocumentTypes: new fields.ArrayField(
|
||||||
|
new fields.StringField({ required: true, choices: CONST.SYSTEM_SPECIFIC_COMPENDIUM_TYPES })
|
||||||
|
)
|
||||||
|
})
|
||||||
|
),
|
||||||
|
excludedPacks: new fields.TypedObjectField(
|
||||||
|
new fields.SchemaField({
|
||||||
|
excludedDocumentTypes: new fields.ArrayField(
|
||||||
|
new fields.StringField({ required: true, choices: CONST.SYSTEM_SPECIFIC_COMPENDIUM_TYPES })
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
isEntryExcluded(item) {
|
||||||
|
const pack = game.packs.get(item.pack);
|
||||||
|
if (!pack) return false;
|
||||||
|
|
||||||
|
const excludedSourceData = this.excludedSources[pack.metadata.packageName];
|
||||||
|
if (excludedSourceData && excludedSourceData.excludedDocumentTypes.includes(pack.metadata.type)) return true;
|
||||||
|
|
||||||
|
const excludedPackData = this.excludedPacks[item.pack];
|
||||||
|
if (excludedPackData && excludedPackData.excludedDocumentTypes.includes(pack.metadata.type)) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ import {
|
||||||
DhHomebrewSettings,
|
DhHomebrewSettings,
|
||||||
DhVariantRuleSettings
|
DhVariantRuleSettings
|
||||||
} from '../applications/settings/_module.mjs';
|
} from '../applications/settings/_module.mjs';
|
||||||
import { DhTagTeamRoll } from '../data/_module.mjs';
|
import { CompendiumBrowserSettings, DhTagTeamRoll } from '../data/_module.mjs';
|
||||||
|
|
||||||
export const registerDHSettings = () => {
|
export const registerDHSettings = () => {
|
||||||
registerMenuSettings();
|
registerMenuSettings();
|
||||||
|
|
@ -142,6 +142,12 @@ const registerNonConfigSettings = () => {
|
||||||
config: false,
|
config: false,
|
||||||
type: DhTagTeamRoll
|
type: DhTagTeamRoll
|
||||||
});
|
});
|
||||||
|
|
||||||
|
game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.CompendiumBrowserSettings, {
|
||||||
|
scope: 'client',
|
||||||
|
config: false,
|
||||||
|
type: CompendiumBrowserSettings
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ export const RefreshType = {
|
||||||
Countdown: 'DhCoundownRefresh',
|
Countdown: 'DhCoundownRefresh',
|
||||||
TagTeamRoll: 'DhTagTeamRollRefresh',
|
TagTeamRoll: 'DhTagTeamRollRefresh',
|
||||||
EffectsDisplay: 'DhEffectsDisplayRefresh',
|
EffectsDisplay: 'DhEffectsDisplayRefresh',
|
||||||
Scene: 'DhSceneRefresh'
|
Scene: 'DhSceneRefresh',
|
||||||
|
CompendiumBrowser: 'DhCompendiumBrowserRefresh'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const registerSocketHooks = () => {
|
export const registerSocketHooks = () => {
|
||||||
|
|
|
||||||
105
styles/less/dialog/compendiumBrowserPackDialog/sheet.less
Normal file
105
styles/less/dialog/compendiumBrowserPackDialog/sheet.less
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
.daggerheart.dialog.dh-style.views.compendium-brower-settings {
|
||||||
|
--text-color: light-dark(@dark-blue, @beige);
|
||||||
|
color: var(--text-color);
|
||||||
|
|
||||||
|
.window-content {
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
overflow: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
max-height: 440px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.types-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
|
.type-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
|
> label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: var(--font-size-16);
|
||||||
|
font-family: @font-subtitle;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
flex: 1;
|
||||||
|
height: 2px;
|
||||||
|
background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, light-dark(@dark-blue, @golden) 100%);
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
flex: 1;
|
||||||
|
height: 2px;
|
||||||
|
background: linear-gradient(90deg, light-dark(@dark-blue, @golden) 0%, rgba(0, 0, 0, 0) 100%);
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sources-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
|
.source-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
|
||||||
|
.source-inner-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.source-inner-label-container {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 18px;
|
||||||
|
// color: light-dark(@dark-blue, @golden);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.checks-container {
|
||||||
|
padding-left: 24px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 4px;
|
||||||
|
transition: height 0.4s ease-in-out;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&.collapsed {
|
||||||
|
height: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
margin-top: 8px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -43,3 +43,5 @@
|
||||||
@import './risk-it-all/sheet.less';
|
@import './risk-it-all/sheet.less';
|
||||||
|
|
||||||
@import './character-reset/sheet.less';
|
@import './character-reset/sheet.less';
|
||||||
|
|
||||||
|
@import './compendiumBrowserPackDialog/sheet.less';
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type='checkbox'] {
|
||||||
|
&:indeterminate {
|
||||||
|
&::before {
|
||||||
|
content: '\f0fe';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input[type='checkbox'],
|
input[type='checkbox'],
|
||||||
input[type='radio'] {
|
input[type='radio'] {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@
|
||||||
font-family: @font-subtitle;
|
font-family: @font-subtitle;
|
||||||
font-size: var(--font-size-18);
|
font-size: var(--font-size-18);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--text-color);
|
color: light-dark(@dark-blue, var(--text-color));
|
||||||
margin-bottom: -2px;
|
margin-bottom: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "1.6.4",
|
"version": "1.7.0",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13.346",
|
"minimum": "13.346",
|
||||||
"verified": "13.351",
|
"verified": "13.351",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<footer>
|
||||||
|
<button data-action="finish">{{localize "Save Settings"}}</button>
|
||||||
|
</footer>
|
||||||
36
templates/dialogs/compendiumBrowserSettingsDialog/packs.hbs
Normal file
36
templates/dialogs/compendiumBrowserSettingsDialog/packs.hbs
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
<div>
|
||||||
|
<div class="types-container">
|
||||||
|
{{#each typePackCollections as |type|}}
|
||||||
|
<div class="type-container">
|
||||||
|
<label>{{type.label}}</label>
|
||||||
|
|
||||||
|
<div class="sources-container">
|
||||||
|
{{#each type.sources as |source|}}
|
||||||
|
<div class="source-container">
|
||||||
|
<div class="source-inner-container">
|
||||||
|
<div class="source-inner-label-container">
|
||||||
|
<a
|
||||||
|
data-action="toggleSource" data-source="{{@key}}" data-type="{{@../key}}"
|
||||||
|
data-tooltip="{{#if source.checked}}{{localize "DAGGERHEART.APPLICATIONS.CompendiumBrowserSettings.disableSource"}}{{else}}{{localize "DAGGERHEART.APPLICATIONS.CompendiumBrowserSettings.enableSource"}}{{/if}}"
|
||||||
|
>
|
||||||
|
<i class="fa-solid {{#if source.checked}}fa-toggle-on{{else}}fa-toggle-off{{/if}}"></i>
|
||||||
|
</a>
|
||||||
|
<label>{{source.label}}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checks-container {{#unless source.checked}}collapsed{{/unless}}">
|
||||||
|
{{#each source.packs as |pack|}}
|
||||||
|
<div class="check-container">
|
||||||
|
<input type="checkbox" class="pack-checkbox" data-type="{{pack.type}}" data-pack="{{pack.pack}}" {{checked pack.checked}} />
|
||||||
|
<label>{{pack.label}}</label>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
<div class="compendium-sidebar">
|
<div class="compendium-sidebar">
|
||||||
|
{{#if isGM}}<button data-action="openSettings"><i class="fa-solid fa-gear"></i> {{localize "DAGGERHEART.UI.ItemBrowser.browserSettings"}}</button>{{/if}}
|
||||||
<div class="folder-list">
|
<div class="folder-list">
|
||||||
{{#each compendiums}}
|
{{#each compendiums}}
|
||||||
<div class="{{#if selected}} is-selected{{/if}}" data-action="selectFolder" data-folder-id="{{id}}" {{#if folders.length}}data-tooltip="DAGGERHEART.UI.Tooltip.rightClickExtand" data-tooltip-direction="RIGHT"{{/if}}>{{label}}</div>
|
<div class="{{#if selected}} is-selected{{/if}}" data-action="selectFolder" data-folder-id="{{id}}" {{#if folders.length}}data-tooltip="DAGGERHEART.UI.Tooltip.rightClickExtend" data-tooltip-direction="RIGHT"{{/if}}>{{label}}</div>
|
||||||
{{#if folders.length}}
|
{{#if folders.length}}
|
||||||
<div class="subfolder-list">
|
<div class="subfolder-list">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue