mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Merge branch 'main' into feature/Homebrew-Downtime-Actions
This commit is contained in:
commit
86ffca509f
13 changed files with 103 additions and 35 deletions
|
|
@ -1549,7 +1549,9 @@
|
|||
"foreground": "Foreground",
|
||||
"background": "Background",
|
||||
"outline": "Outline",
|
||||
"edge": "Edge"
|
||||
"edge": "Edge",
|
||||
"texture": "Texture",
|
||||
"colorset": "Colorset"
|
||||
}
|
||||
},
|
||||
"variantRules": {
|
||||
|
|
|
|||
|
|
@ -36,10 +36,37 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
|
|||
}
|
||||
};
|
||||
|
||||
/** @inheritdoc */
|
||||
static TABS = {
|
||||
diceSoNice: {
|
||||
tabs: [
|
||||
{ id: 'hope', label: 'DAGGERHEART.GENERAL.hope' },
|
||||
{ id: 'fear', label: 'DAGGERHEART.GENERAL.fear' },
|
||||
{ id: 'advantage', label: 'DAGGERHEART.GENERAL.Advantage.full' },
|
||||
{ id: 'disadvantage', label: 'DAGGERHEART.GENERAL.Advantage.full' }
|
||||
],
|
||||
initial: 'hope'
|
||||
}
|
||||
};
|
||||
|
||||
changeTab(tab, group, options) {
|
||||
super.changeTab(tab, group, options);
|
||||
|
||||
this.render();
|
||||
}
|
||||
|
||||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
context.settingFields = this.settings;
|
||||
|
||||
context.diceSoNiceTextures = game.dice3d?.exports?.TEXTURELIST ?? {};
|
||||
context.diceSoNiceColorsets = game.dice3d?.exports?.COLORSETS ?? {};
|
||||
context.diceTab = {
|
||||
key: this.tabGroups.diceSoNice,
|
||||
source: this.settings._source.diceSoNice[this.tabGroups.diceSoNice],
|
||||
fields: this.settings.schema.fields.diceSoNice.fields[this.tabGroups.diceSoNice].fields
|
||||
};
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
|
|
@ -65,4 +92,13 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
|
|||
|
||||
this.close();
|
||||
}
|
||||
|
||||
_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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -517,9 +517,10 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
const item = getDocFromElement(event.currentTarget);
|
||||
if (!item) return;
|
||||
|
||||
const max = item.system.resource.max ? itemAbleRollParse(item.system.resource.max, this.document, item) : null;
|
||||
const max = event.currentTarget.max ? Number(event.currentTarget.max) : null;
|
||||
const value = max ? Math.min(Number(event.currentTarget.value), max) : event.currentTarget.value;
|
||||
await item.update({ 'system.resource.value': value });
|
||||
this.render();
|
||||
}
|
||||
|
||||
async updateItemQuantity(event) {
|
||||
|
|
@ -527,6 +528,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
if (!item) return;
|
||||
|
||||
await item.update({ 'system.quantity': event.currentTarget.value });
|
||||
this.render();
|
||||
}
|
||||
|
||||
async updateArmorMarks(event) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const attributeField = label =>
|
|||
|
||||
const resourceField = (max = 0, label, reverse = false) =>
|
||||
new fields.SchemaField({
|
||||
value: new fields.NumberField({ initial: 0, integer: true, label }),
|
||||
value: new fields.NumberField({ initial: 0, min: 0, integer: true, label }),
|
||||
max: new fields.NumberField({ initial: max, integer: true }),
|
||||
isReversed: new fields.BooleanField({ initial: reverse })
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,25 +20,33 @@ export default class DhAppearance extends foundry.abstract.DataModel {
|
|||
foreground: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
||||
background: new fields.ColorField({ required: true, initial: '#ffe760' }),
|
||||
outline: new fields.ColorField({ required: true, initial: '#000000' }),
|
||||
edge: new fields.ColorField({ required: true, initial: '#ffffff' })
|
||||
edge: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
||||
texture: new fields.StringField({ initial: 'bloodmoon' }),
|
||||
colorset: new fields.StringField({ initial: 'inspired' })
|
||||
}),
|
||||
fear: new fields.SchemaField({
|
||||
foreground: new fields.ColorField({ required: true, initial: '#000000' }),
|
||||
background: new fields.ColorField({ required: true, initial: '#0032b1' }),
|
||||
outline: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
||||
edge: new fields.ColorField({ required: true, initial: '#000000' })
|
||||
edge: new fields.ColorField({ required: true, initial: '#000000' }),
|
||||
texture: new fields.StringField({ initial: 'bloodmoon' }),
|
||||
colorset: new fields.StringField({ initial: 'inspired' })
|
||||
}),
|
||||
advantage: new fields.SchemaField({
|
||||
foreground: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
||||
background: new fields.ColorField({ required: true, initial: '#008000' }),
|
||||
outline: new fields.ColorField({ required: true, initial: '#000000' }),
|
||||
edge: new fields.ColorField({ required: true, initial: '#ffffff' })
|
||||
edge: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
||||
texture: new fields.StringField({ initial: 'bloodmoon' }),
|
||||
colorset: new fields.StringField({ initial: 'inspired' })
|
||||
}),
|
||||
disadvantage: new fields.SchemaField({
|
||||
foreground: new fields.ColorField({ required: true, initial: '#000000' }),
|
||||
background: new fields.ColorField({ required: true, initial: '#b30000' }),
|
||||
outline: new fields.ColorField({ required: true, initial: '#ffffff' }),
|
||||
edge: new fields.ColorField({ required: true, initial: '#000000' })
|
||||
edge: new fields.ColorField({ required: true, initial: '#000000' }),
|
||||
texture: new fields.StringField({ initial: 'bloodmoon' }),
|
||||
colorset: new fields.StringField({ initial: 'inspired' })
|
||||
})
|
||||
}),
|
||||
showGenericStatusEffects: new fields.BooleanField({
|
||||
|
|
|
|||
|
|
@ -568,13 +568,7 @@ export default class DhpActor extends Actor {
|
|||
}
|
||||
|
||||
convertDamageToThreshold(damage) {
|
||||
return damage >= this.system.damageThresholds.severe
|
||||
? 3
|
||||
: damage >= this.system.damageThresholds.major
|
||||
? 2
|
||||
: damage >= this.system.damageThresholds.minor
|
||||
? 1
|
||||
: 0;
|
||||
return damage >= this.system.damageThresholds.severe ? 3 : damage >= this.system.damageThresholds.major ? 2 : 1;
|
||||
}
|
||||
|
||||
convertStressDamageToHP(resources) {
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ export default class RegisterHandlebarsHelpers {
|
|||
|
||||
static rollParsed(value, actor, item, numerical) {
|
||||
const isNumerical = typeof numerical === 'boolean' ? numerical : false;
|
||||
const result = itemAbleRollParse(value, actor, item);
|
||||
return isNumerical && !result ? 0 : result;
|
||||
const result = itemAbleRollParse(value, actor.getRollData(), item);
|
||||
return isNumerical ? (!result ? 0 : Number(result)) : result;
|
||||
}
|
||||
|
||||
static setVar(name, value, context) {
|
||||
|
|
|
|||
|
|
@ -46,10 +46,6 @@
|
|||
display: flex;
|
||||
gap: 2px;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.mark-container {
|
||||
cursor: pointer;
|
||||
border: 1px solid light-dark(@dark-blue, @golden);
|
||||
|
|
@ -62,6 +58,10 @@
|
|||
justify-content: center;
|
||||
opacity: 0.4;
|
||||
|
||||
&:not(:last-child) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
&.selected {
|
||||
opacity: 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,30 +14,56 @@
|
|||
<div class="title-hint">{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.hint"}}</div>
|
||||
|
||||
<fieldset>
|
||||
<legend>{{localize "DAGGERHEART.GENERAL.hope"}}</legend>
|
||||
<section class='tab-navigation'>
|
||||
<div class='navigation-container'>
|
||||
<div class="navigation-inner-container">
|
||||
<line-div></line-div>
|
||||
<nav class='feature-tab sheet-tabs tabs' data-group='diceSoNice'>
|
||||
{{#each tabs as |tab|}}
|
||||
<a class='{{tab.id}} {{tab.cssClass}}' data-action='tab' data-group='{{tab.group}}' data-tab='{{tab.id}}'>
|
||||
{{localize tab.label}}
|
||||
</a>
|
||||
{{/each}}
|
||||
</nav>
|
||||
<line-div></line-div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="field-section">
|
||||
<div class="split-section">
|
||||
<div class="label-container">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.foreground"}}</label>
|
||||
{{formInput settingFields.schema.fields.diceSoNice.fields.hope.fields.foreground value=settingFields._source.diceSoNice.hope.foreground localize=true}}
|
||||
{{formInput diceTab.fields.foreground value=diceTab.source.foreground localize=true}}
|
||||
</div>
|
||||
<div class="label-container">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.background"}}</label>
|
||||
{{formInput settingFields.schema.fields.diceSoNice.fields.hope.fields.background value=settingFields._source.diceSoNice.hope.background localize=true}}
|
||||
{{formInput diceTab.fields.background value=diceTab.source.background localize=true}}
|
||||
</div>
|
||||
<div class="label-container">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.outline"}}</label>
|
||||
{{formInput settingFields.schema.fields.diceSoNice.fields.hope.fields.outline value=settingFields._source.diceSoNice.hope.outline localize=true}}
|
||||
{{formInput diceTab.fields.outline value=diceTab.source.outline localize=true}}
|
||||
</div>
|
||||
<div class="label-container">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.edge"}}</label>
|
||||
{{formInput settingFields.schema.fields.diceSoNice.fields.hope.fields.edge value=settingFields._source.diceSoNice.hope.edge localize=true}}
|
||||
{{formInput diceTab.fields.edge value=diceTab.source.edge localize=true}}
|
||||
</div>
|
||||
<div class="label-container">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.texture"}}</label>
|
||||
<select name={{concat "diceSoNice." diceTab.key ".texture"}}>
|
||||
{{selectOptions diceSoNiceTextures selected=diceTab.source.texture labelAttr="name" localize=true }}
|
||||
</select>
|
||||
</div>
|
||||
<div class="label-container">
|
||||
<label>{{localize "DAGGERHEART.SETTINGS.Menu.appearance.diceSoNice.colorset"}}</label>
|
||||
<select name="diceSoNice." {{diceTab.key}} ".colorset">
|
||||
{{selectOptions diceSoNiceColorsets selected=diceTab.source.colorset labelAttr="name" localize=true }}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
{{!-- <fieldset>
|
||||
<legend>{{localize "DAGGERHEART.GENERAL.fear"}}</legend>
|
||||
|
||||
<div class="field-section">
|
||||
|
|
@ -108,7 +134,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset> --}}
|
||||
</fieldset>
|
||||
|
||||
<footer class="form-footer">
|
||||
|
|
|
|||
|
|
@ -118,10 +118,10 @@
|
|||
|
||||
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
<div class="character-downtime-container">
|
||||
<button data-action="useDowntime" data-type="shortRest" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Downtime.shortRest.title"}}">
|
||||
<button type="button" data-action="useDowntime" data-type="shortRest" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Downtime.shortRest.title"}}">
|
||||
<i class="fa-solid fa-chair"></i>
|
||||
</button>
|
||||
<button data-action="useDowntime" data-type="longRest" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Downtime.longRest.title"}}">
|
||||
<button type="button" data-action="useDowntime" data-type="longRest" data-tooltip="{{localize "DAGGERHEART.APPLICATIONS.Downtime.longRest.title"}}">
|
||||
<i class="fa-solid fa-bed"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,20 +4,19 @@
|
|||
<a class="death-roll-btn" data-tooltip="DAGGERHEART.UI.Tooltip.makeDeathMove" {{#if
|
||||
isDeath}}data-action="makeDeathMove" {{/if}}><i class="fas fa-skull death-save"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<div class="resources-section">
|
||||
<div class="status-bar">
|
||||
<div class='status-value'>
|
||||
<p><input class="bar-input" name="system.resources.hitPoints.value"
|
||||
<p><input class="bar-input" name="system.resources.hitPoints.value" min="0" max='{{document.system.resources.hitPoints.max}}'
|
||||
value="{{document.system.resources.hitPoints.value}}" type="number"></p>
|
||||
<p>/</p>
|
||||
<p class="bar-label">{{document.system.resources.hitPoints.max}}</p>
|
||||
</div>
|
||||
<progress
|
||||
class='progress-bar'
|
||||
value='{{document.system.resources.hitPoints.value}}'
|
||||
max='{{document.system.resources.hitPoints.max}}'
|
||||
value='{{document.system.resources.hitPoints.value}}'
|
||||
></progress>
|
||||
<div class="status-label">
|
||||
<h4>{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</h4>
|
||||
|
|
@ -26,7 +25,7 @@
|
|||
</div>
|
||||
<div class="status-bar">
|
||||
<div class='status-value'>
|
||||
<p><input class="bar-input" name="system.resources.stress.value"
|
||||
<p><input class="bar-input" name="system.resources.stress.value" min="0" max='{{document.system.resources.stress.max}}'
|
||||
value="{{document.system.resources.stress.value}}" type="number"></p>
|
||||
<p>/</p>
|
||||
<p class="bar-label">{{document.system.resources.stress.max}}</p>
|
||||
|
|
@ -34,6 +33,7 @@
|
|||
<progress
|
||||
class='progress-bar stress-color'
|
||||
value='{{document.system.resources.stress.value}}'
|
||||
min="0"
|
||||
max='{{document.system.resources.stress.max}}'
|
||||
></progress>
|
||||
<div class="status-label">
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ Parameters:
|
|||
{{/if}}
|
||||
{{#if (and (not hideResources) item.system.quantity)}}
|
||||
<div class="item-resource">
|
||||
<input type="number" class="inventory-item-quantity" value="{{item.system.quantity}}" step="1" />
|
||||
<input type="number" class="inventory-item-quantity" value="{{item.system.quantity}}" min="0" />
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{{#if (eq item.system.resource.type 'simple')}}
|
||||
<div class="item-resource">
|
||||
<i class="{{#if item.system.resource.icon}}{{item.system.resource.icon}}{{else}}fa-solid fa-hashtag{{/if}}"></i>
|
||||
<input type="number" class="inventory-item-resource" value="{{item.system.resource.value}}" step="1" />
|
||||
<input type="number" class="inventory-item-resource" value="{{item.system.resource.value}}" min="0" max="{{rollParsed item.system.resource.max item.actor item true}}" />
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="item-resources">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue