mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Split into tabs
This commit is contained in:
parent
4827b337d0
commit
d385bd1a90
7 changed files with 141 additions and 5 deletions
|
|
@ -1854,7 +1854,9 @@
|
|||
"tier1": "Tier 1",
|
||||
"tier2": "Tier 2",
|
||||
"tier3": "Tier 3",
|
||||
"tier4": "tier 4"
|
||||
"tier4": "tier 4",
|
||||
"domains": "Domains",
|
||||
"downtime": "Downtime"
|
||||
},
|
||||
"Tiers": {
|
||||
"singular": "Tier",
|
||||
|
|
@ -1887,6 +1889,7 @@
|
|||
"damageType": "Damage Type",
|
||||
"description": "Description",
|
||||
"difficulty": "Difficulty",
|
||||
"downtime": "Downtime",
|
||||
"dropActorsHere": "Drop Actors here",
|
||||
"duality": "Duality",
|
||||
"dualityRoll": "Duality Roll",
|
||||
|
|
@ -1919,6 +1922,7 @@
|
|||
"inactiveEffects": "Inactive Effects",
|
||||
"inventory": "Inventory",
|
||||
"itemResource": "Item Resource",
|
||||
"label": "Label",
|
||||
"level": "Level",
|
||||
"levelUp": "Level Up",
|
||||
"loadout": "Loadout",
|
||||
|
|
|
|||
|
|
@ -34,9 +34,18 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
|
|||
};
|
||||
|
||||
static PARTS = {
|
||||
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
||||
settings: { template: 'systems/daggerheart/templates/settings/homebrew-settings/settings.hbs' },
|
||||
domains: { template: 'systems/daggerheart/templates/settings/homebrew-settings/domains.hbs' },
|
||||
downtime: { template: 'systems/daggerheart/templates/settings/homebrew-settings/downtime.hbs' }
|
||||
};
|
||||
|
||||
/** @inheritdoc */
|
||||
static TABS = {
|
||||
main: {
|
||||
template: 'systems/daggerheart/templates/settings/homebrew-settings.hbs',
|
||||
scrollable: ['']
|
||||
tabs: [{ id: 'settings' }, { id: 'domains' }, { id: 'downtime' }],
|
||||
initial: 'settings',
|
||||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -200,4 +209,13 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
|
|||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
_getTabs(tabs) {
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active;
|
||||
v.cssClass = v.active ? 'active' : '';
|
||||
}
|
||||
|
||||
return tabs;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ import { defaultRestOptions } from '../../config/generalConfig.mjs';
|
|||
import { ActionsField } from '../fields/actionField.mjs';
|
||||
|
||||
export default class DhHomebrew extends foundry.abstract.DataModel {
|
||||
static LOCALIZATION_PREFIXES = ['DAGGERHEART.SETTINGS.Homebrew']; // Doesn't work for some reason
|
||||
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
|
|
@ -98,6 +96,16 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
|
|||
{ initial: defaultRestOptions.shortRest() }
|
||||
)
|
||||
})
|
||||
}),
|
||||
domains: new fields.SchemaField({
|
||||
id: new fields.StringField({ required: true }),
|
||||
label: new fields.StringField({ required: true, initial: '', label: 'DAGGERHEART.GENERAL.label' }),
|
||||
src: new fields.FilePathField({
|
||||
categories: ['IMAGE'],
|
||||
base64: false,
|
||||
label: 'Image'
|
||||
}),
|
||||
description: new fields.StringField({ label: 'DAGGERHEART.GENERAL.description' })
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
|
|||
7
templates/settings/homebrew-settings/domains.hbs
Normal file
7
templates/settings/homebrew-settings/domains.hbs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<section
|
||||
class="tab {{tabs.domains.cssClass}} {{tabs.domains.id}}"
|
||||
data-tab="{{tabs.domains.id}}"
|
||||
data-group="{{tabs.domains.group}}"
|
||||
>
|
||||
|
||||
</section>
|
||||
51
templates/settings/homebrew-settings/downtime.hbs
Normal file
51
templates/settings/homebrew-settings/downtime.hbs
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<section
|
||||
class="tab {{tabs.downtime.cssClass}} {{tabs.downtime.id}}"
|
||||
data-tab="{{tabs.downtime.id}}"
|
||||
data-group="{{tabs.downtime.group}}"
|
||||
>
|
||||
<fieldset class="two-columns even">
|
||||
<legend>{{localize "DAGGERHEART.SETTINGS.Homebrew.downtimeMoves"}}</legend>
|
||||
|
||||
<fieldset class="start-align">
|
||||
<legend>
|
||||
{{localize "DAGGERHEART.APPLICATIONS.Downtime.longRest.title"}}
|
||||
<a data-action="addItem" data-type="longRest"><i class="fa-solid fa-plus"></i></a>
|
||||
<a data-action="resetMoves" data-type="longRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||
</legend>
|
||||
|
||||
<div class="form-group setting-group-field">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Homebrew.nrChoices"}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="restMoves.longRest.nrChoices" value="{{settingFields._source.restMoves.longRest.nrChoices}}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-items">
|
||||
{{#each settingFields._source.restMoves.longRest.moves as |move id|}}
|
||||
{{> "systems/daggerheart/templates/settings/components/settings-item-line.hbs" this type="longRest" id=id }}
|
||||
{{/each}}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="start-align">
|
||||
<legend>
|
||||
{{localize "DAGGERHEART.APPLICATIONS.Downtime.shortRest.title"}}
|
||||
<a data-action="addItem" data-type="shortRest"><i class="fa-solid fa-plus"></i></a>
|
||||
<a data-action="resetMoves" data-type="shortRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||
</legend>
|
||||
|
||||
<div class="form-group setting-group-field">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Homebrew.nrChoices"}}</label>
|
||||
<div class="form-fields">
|
||||
<input type="text" name="restMoves.shortRest.nrChoices" value="{{settingFields._source.restMoves.shortRest.nrChoices}}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-items">
|
||||
{{#each settingFields._source.restMoves.shortRest.moves as |move id|}}
|
||||
{{> "systems/daggerheart/templates/settings/components/settings-item-line.hbs" this type="shortRest" id=id }}
|
||||
{{/each}}
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</section>
|
||||
10
templates/settings/homebrew-settings/footer.hbs
Normal file
10
templates/settings/homebrew-settings/footer.hbs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<footer class="form-footer">
|
||||
<button data-action="reset">
|
||||
<i class="fa-solid fa-arrow-rotate-left"></i>
|
||||
<span>{{localize "Reset"}}</span>
|
||||
</button>
|
||||
<button data-action="save" >
|
||||
<i class="fa-solid fa-floppy-disk"></i>
|
||||
<span>{{localize "Save Changes"}}</span>
|
||||
</button>
|
||||
</footer>
|
||||
38
templates/settings/homebrew-settings/settings.hbs
Normal file
38
templates/settings/homebrew-settings/settings.hbs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<section
|
||||
class="tab {{tabs.settings.cssClass}} {{tabs.settings.id}}"
|
||||
data-tab="{{tabs.v.id}}"
|
||||
data-group="{{tabs.settings.group}}"
|
||||
>
|
||||
<div class="scrollable">
|
||||
<header class="dialog-header">
|
||||
<h1>{{localize 'DAGGERHEART.SETTINGS.Menu.homebrew.name'}}</h1>
|
||||
</header>
|
||||
{{formGroup settingFields.schema.fields.maxFear value=settingFields._source.maxFear localize=true}}
|
||||
{{formGroup settingFields.schema.fields.maxDomains value=settingFields._source.maxDomains localize=true}}
|
||||
{{formGroup settingFields.schema.fields.maxLoadout value=settingFields._source.maxLoadout localize=true}}
|
||||
<div class="settings-hint"><label>{{localize "DAGGERHEART.SETTINGS.Homebrew.FIELDS.maxLoadout.hint"}}</label></div>
|
||||
|
||||
<h4>{{localize "DAGGERHEART.SETTINGS.Homebrew.FIELDS.traitArray.label"}}</h4>
|
||||
<div class="trait-array-container">
|
||||
{{#each settingFields._source.traitArray as |trait index|}}
|
||||
<div class="trait-array-item">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.Modifier.single"}} {{add index 1}}</label>
|
||||
<input type="text" data-dtype="Number" name="{{concat "traitArray." index}}" value="{{this}}" />
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
{{localize "DAGGERHEART.SETTINGS.Homebrew.currency.title"}}
|
||||
</legend>
|
||||
{{formGroup settingFields.schema.fields.currency.fields.enabled value=settingFields._source.currency.enabled localize=true}}
|
||||
{{formGroup settingFields.schema.fields.currency.fields.title value=settingFields._source.currency.title localize=true}}
|
||||
{{formGroup settingFields.schema.fields.currency.fields.coins value=settingFields._source.currency.coins localize=true}}
|
||||
{{formGroup settingFields.schema.fields.currency.fields.handfulls value=settingFields._source.currency.handfulls localize=true}}
|
||||
{{formGroup settingFields.schema.fields.currency.fields.bags value=settingFields._source.currency.bags localize=true}}
|
||||
{{formGroup settingFields.schema.fields.currency.fields.chests value=settingFields._source.currency.chests localize=true}}
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue