mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Part progress on adding config tab to scene config
This commit is contained in:
parent
fcf35ac17e
commit
55edd6b3ac
7 changed files with 49 additions and 1 deletions
|
|
@ -147,6 +147,15 @@ Hooks.once('init', () => {
|
||||||
// Make Compendium Dialog resizable
|
// Make Compendium Dialog resizable
|
||||||
foundry.applications.sidebar.apps.Compendium.DEFAULT_OPTIONS.window.resizable = true;
|
foundry.applications.sidebar.apps.Compendium.DEFAULT_OPTIONS.window.resizable = true;
|
||||||
|
|
||||||
|
applications.scene.DhSceneConfig.PARTS.dh = {template: "systems/daggerheart/templates/scene/dh-config.hbs"};
|
||||||
|
applications.scene.DhSceneConfig.TABS.sheet.tabs.push({id: "dh", icon: "fa-solid"});
|
||||||
|
|
||||||
|
DocumentSheetConfig.registerSheet(foundry.documents.Scene, SYSTEM.id, applications.scene.DhSceneConfig , {
|
||||||
|
makeDefault: true,
|
||||||
|
label: "Daggerheart"
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
settingsRegistration.registerDHSettings();
|
settingsRegistration.registerDHSettings();
|
||||||
RegisterHandlebarsHelpers.registerHelpers();
|
RegisterHandlebarsHelpers.registerHelpers();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,14 @@
|
||||||
"CONTROLS": {
|
"CONTROLS": {
|
||||||
"inFront": "In Front"
|
"inFront": "In Front"
|
||||||
},
|
},
|
||||||
|
"SCENE": {
|
||||||
|
"TABS": {
|
||||||
|
"SHEET": {
|
||||||
|
"dh": "Daggerheart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
"DAGGERHEART": {
|
"DAGGERHEART": {
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"TYPES": {
|
"TYPES": {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ export * as characterCreation from './characterCreation/_module.mjs';
|
||||||
export * as dialogs from './dialogs/_module.mjs';
|
export * as dialogs from './dialogs/_module.mjs';
|
||||||
export * as hud from './hud/_module.mjs';
|
export * as hud from './hud/_module.mjs';
|
||||||
export * as levelup from './levelup/_module.mjs';
|
export * as levelup from './levelup/_module.mjs';
|
||||||
|
export * as scene from './scene/_module.mjs';
|
||||||
export * as settings from './settings/_module.mjs';
|
export * as settings from './settings/_module.mjs';
|
||||||
export * as sheets from './sheets/_module.mjs';
|
export * as sheets from './sheets/_module.mjs';
|
||||||
export * as sheetConfigs from './sheets-configs/_module.mjs';
|
export * as sheetConfigs from './sheets-configs/_module.mjs';
|
||||||
|
|
|
||||||
1
module/applications/scene/_module.mjs
Normal file
1
module/applications/scene/_module.mjs
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export { default as DhSceneConfig } from './sceneConfig.mjs';
|
||||||
19
module/applications/scene/sceneConfig.mjs
Normal file
19
module/applications/scene/sceneConfig.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
|
||||||
|
export default class DhSceneConfig extends foundry.applications.sheets.SceneConfig {
|
||||||
|
|
||||||
|
/** @inheritDoc */
|
||||||
|
async _preparePartContext(partId, context, options) {
|
||||||
|
console.log("_preparePartContext", partId, context, options);
|
||||||
|
context = await super._preparePartContext(partId, context, options);
|
||||||
|
switch ( partId ) {
|
||||||
|
case "dh":
|
||||||
|
context.fields.rangeMeasurementSettingsOverride = "Override Global Range Measurement Settings";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
context = await super._preparePartContext(partId, context, options);
|
||||||
|
}
|
||||||
|
if ( partId in context.tabs ) context.tab = context.tabs[partId];
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -35,5 +35,8 @@ export const preloadHandlebarsTemplates = async function () {
|
||||||
'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs',
|
'systems/daggerheart/templates/ui/chat/parts/damage-part.hbs',
|
||||||
'systems/daggerheart/templates/ui/chat/parts/target-part.hbs',
|
'systems/daggerheart/templates/ui/chat/parts/target-part.hbs',
|
||||||
'systems/daggerheart/templates/ui/chat/parts/button-part.hbs',
|
'systems/daggerheart/templates/ui/chat/parts/button-part.hbs',
|
||||||
|
|
||||||
|
'systems/daggerheart/templates/scene/dh-config.hbs',
|
||||||
|
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
7
templates/scene/dh-config.hbs
Normal file
7
templates/scene/dh-config.hbs
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<div class="tab{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-fields">
|
||||||
|
{{formInput fields.rangeMeasurementSettingsOverride value=source.rangeMeasurementSettingsOverride}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue