mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Start on settings data model for template presets
This commit is contained in:
parent
554bc53dd8
commit
596e149968
5 changed files with 66 additions and 4 deletions
|
|
@ -108,9 +108,8 @@ export default class DhTemplateLayer extends foundry.canvas.layers.TemplateLayer
|
|||
if (game.activeTool) {
|
||||
ui.controls.activate("toggles");
|
||||
}
|
||||
// if (CONFIG.ux.TemplateManager.getActivePreview()) {
|
||||
// return;
|
||||
// }
|
||||
const settings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.PresetTemplate);
|
||||
console.log("settings", settings);
|
||||
const { width, height } = game.canvas.scene.dimensions;
|
||||
const data = {
|
||||
x: width / 2,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ export const gameSettings = {
|
|||
LevelTiers: 'LevelTiers',
|
||||
Countdowns: 'Countdowns',
|
||||
LastMigrationVersion: 'LastMigrationVersion',
|
||||
TagTeamRoll: 'TagTeamRoll'
|
||||
TagTeamRoll: 'TagTeamRoll',
|
||||
PresetTemplate: 'PresetTemplate'
|
||||
};
|
||||
|
||||
export const actionAutomationChoices = {
|
||||
|
|
|
|||
32
module/data/presetTemplate.mjs
Normal file
32
module/data/presetTemplate.mjs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
export const presetTemplateTypes = {
|
||||
circle: {
|
||||
id: 'circle',
|
||||
name: 'circle'
|
||||
},
|
||||
inFront: {
|
||||
id: 'inFront',
|
||||
name: 'inFront'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export default class DhPresetTemplate extends foundry.abstract.DataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
|
||||
return {
|
||||
type: new fields.StringField({
|
||||
required: true,
|
||||
choices: presetTemplateTypes,
|
||||
initial: presetTemplateTypes.inFront.name,
|
||||
label: 'DAGGERHEART.GENERAL.type'
|
||||
}),
|
||||
range: new fields.StringField({
|
||||
required: true,
|
||||
initial: "15",
|
||||
label: 'DAGGERHEART.GENERAL.type'
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import { defaultLevelTiers, DhLevelTiers } from '../data/levelTier.mjs';
|
||||
import DhCountdowns from '../data/countdowns.mjs';
|
||||
import DhPresetTemplate from '../data/presetTemplate.mjs';
|
||||
import { DhAppearance, DhAutomation, DhHomebrew, DhVariantRules } from '../data/settings/_module.mjs';
|
||||
import {
|
||||
DhAppearanceSettings,
|
||||
|
|
@ -129,4 +130,11 @@ const registerNonConfigSettings = () => {
|
|||
config: false,
|
||||
type: DhTagTeamRoll
|
||||
});
|
||||
|
||||
game.settings.register(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.PresetTemplate, {
|
||||
scope: 'client',
|
||||
config: false,
|
||||
type: DhPresetTemplate
|
||||
});
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,25 @@
|
|||
<div>
|
||||
<span>Template stuff.</span>
|
||||
<div class="template-type-container">
|
||||
<span>Template types, e.g. circle, inFront, emanation, etc</span>
|
||||
</div>
|
||||
<div class="template-range-container">
|
||||
<span>Template range, e.g. close, far, plus freeform value field option</span>
|
||||
</div>
|
||||
<div class="template-misc-container">
|
||||
<span>Template settings for angle, width, direction, fill color (default: user), ???</span>
|
||||
</div>
|
||||
<div class="button-container">
|
||||
<button type="button" data-action="reset" data-key="{{dsnTab.id}}">
|
||||
<i class="fa-solid"></i>
|
||||
<span>{{localize "Reset"}}</span>
|
||||
</button>
|
||||
<button type="button" data-action="clipboard" data-key="{{dsnTab.id}}">
|
||||
<i class="fa-solid fa-clipboard"></i>
|
||||
</button>
|
||||
<button type="button" data-action="chat" data-key="{{dsnTab.id}}">
|
||||
<i class="fa-solid fa-message"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue