mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 04:31:07 +01:00
Moved the roll total to bottom right. A bunch of label fixes
This commit is contained in:
parent
307af1fd77
commit
233a3a5407
9 changed files with 102 additions and 115 deletions
|
|
@ -218,7 +218,7 @@ Hooks.on('chatMessage', (_, message) => {
|
||||||
attribute: attribute
|
attribute: attribute
|
||||||
? {
|
? {
|
||||||
value: attribute.data.value,
|
value: attribute.data.value,
|
||||||
label: `${game.i18n.localize(abilities[attributeValue].label)} ${attribute.data.value >= 0 ? `+` : `-`}${attribute.data.value}`
|
label: `${game.i18n.localize(abilities[attributeValue].label)} ${attribute.data.value >= 0 ? `+` : ``}${attribute.data.value}`
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
title
|
title
|
||||||
|
|
|
||||||
|
|
@ -218,11 +218,12 @@ export const registerDHPSettings = () => {
|
||||||
game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.DualityRollColor, {
|
game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.DualityRollColor, {
|
||||||
name: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Name'),
|
name: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Name'),
|
||||||
hint: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Hint'),
|
hint: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Hint'),
|
||||||
scope: 'world',
|
scope: 'client',
|
||||||
config: true,
|
config: true,
|
||||||
type: Number,
|
type: Number,
|
||||||
choices: Object.values(DualityRollColor),
|
choices: Object.values(DualityRollColor),
|
||||||
default: DualityRollColor.colorful.value
|
default: DualityRollColor.colorful.value,
|
||||||
|
requiresReload: true
|
||||||
});
|
});
|
||||||
|
|
||||||
game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.Automation.Name, {
|
game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.Automation.Name, {
|
||||||
|
|
|
||||||
|
|
@ -489,7 +489,7 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) {
|
||||||
|
|
||||||
static async rollAttribute(event, button) {
|
static async rollAttribute(event, button) {
|
||||||
const { roll, hope, fear, advantage, disadvantage, modifiers } = await this.document.dualityRoll(
|
const { roll, hope, fear, advantage, disadvantage, modifiers } = await this.document.dualityRoll(
|
||||||
{ title: 'Attribute Bonus', value: button.dataset.value },
|
{ title: game.i18n.localize(abilities[button.dataset.attribute].label), value: button.dataset.value },
|
||||||
event.shiftKey
|
event.shiftKey
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ export default class DhpDualityRoll extends foundry.abstract.TypeDataModel {
|
||||||
const total = this.modifiers.reduce((acc, x) => acc + x.value, 0);
|
const total = this.modifiers.reduce((acc, x) => acc + x.value, 0);
|
||||||
return {
|
return {
|
||||||
value: total,
|
value: total,
|
||||||
label: total > 0 ? `+${total}` : total < 0 ? `-${total}` : ''
|
label: total > 0 ? `+${total}` : total < 0 ? `${total}` : ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,16 +116,19 @@ export default class DhpActor extends Actor {
|
||||||
disadvantageDice = null,
|
disadvantageDice = null,
|
||||||
bonusDamageString = '';
|
bonusDamageString = '';
|
||||||
|
|
||||||
const modifiers = [
|
const modifiers =
|
||||||
{
|
modifier.value !== null
|
||||||
value: modifier.value ? Number.parseInt(modifier.value) : 0,
|
? [
|
||||||
label:
|
{
|
||||||
modifier.value >= 0
|
value: modifier.value ? Number.parseInt(modifier.value) : 0,
|
||||||
? `${modifier.title} +${modifier.value}`
|
label:
|
||||||
: `${modifier.title} -${modifier.value}`,
|
modifier.value >= 0
|
||||||
title: modifier.title
|
? `${modifier.title} +${modifier.value}`
|
||||||
}
|
: `${modifier.title} ${modifier.value}`,
|
||||||
];
|
title: modifier.title
|
||||||
|
}
|
||||||
|
]
|
||||||
|
: [];
|
||||||
if (!shiftKey) {
|
if (!shiftKey) {
|
||||||
const dialogClosed = new Promise((resolve, _) => {
|
const dialogClosed = new Promise((resolve, _) => {
|
||||||
new RollSelectionDialog(
|
new RollSelectionDialog(
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,6 @@
|
||||||
align-items: end;
|
align-items: end;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
|
|
||||||
.duality-result-value {
|
|
||||||
border: 1px solid var(--color-dark-5);
|
|
||||||
padding: 2px;
|
|
||||||
font-weight: bold;
|
|
||||||
background: var(--color-dark-1);
|
|
||||||
margin-bottom: 4px;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.duality-modifiers {
|
.duality-modifiers {
|
||||||
|
|
@ -211,7 +202,7 @@
|
||||||
text-shadow: 0 0 1px black;
|
text-shadow: 0 0 1px black;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background: var(--color-dark-1);
|
background: var(--color-dark-1);
|
||||||
padding: 4px;
|
padding: 4px 4px 0 4px;
|
||||||
border-radius: 6px 0 0 0;
|
border-radius: 6px 0 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1369,14 +1369,6 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
}
|
}
|
||||||
.chat-message.duality .duality-data .duality-title .duality-result-value {
|
|
||||||
border: 1px solid var(--color-dark-5);
|
|
||||||
padding: 2px;
|
|
||||||
font-weight: bold;
|
|
||||||
background: var(--color-dark-1);
|
|
||||||
margin-bottom: 4px;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
.chat-message.duality .duality-data .duality-modifiers {
|
.chat-message.duality .duality-data .duality-modifiers {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
|
|
@ -1504,7 +1496,7 @@
|
||||||
text-shadow: 0 0 1px black;
|
text-shadow: 0 0 1px black;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background: var(--color-dark-1);
|
background: var(--color-dark-1);
|
||||||
padding: 4px;
|
padding: 4px 4px 0 4px;
|
||||||
border-radius: 6px 0 0 0;
|
border-radius: 6px 0 0 0;
|
||||||
}
|
}
|
||||||
.chat-message.duality .duality-actions {
|
.chat-message.duality .duality-actions {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
<div class="daggerheart chat roll" data-action="expandRoll">
|
{{#if this.colorful}}
|
||||||
{{#if this.colorful}}
|
<div class="daggerheart chat roll" data-action="expandRoll">
|
||||||
<div class="duality-data">
|
<div class="duality-data">
|
||||||
<div class="duality-title">
|
<div class="duality-title">
|
||||||
<div>{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
|
<div>{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
|
||||||
<div class="duality-result-value">{{this.total}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="duality-modifiers">
|
<div class="duality-modifiers">
|
||||||
{{#each this.modifiers}}
|
{{#each this.modifiers}}
|
||||||
|
|
@ -62,7 +61,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{#if (not this.damage.value)}}
|
{{#if (not this.damage.value)}}
|
||||||
<div class="duality-result">
|
<div class="duality-result">
|
||||||
<div>{{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
|
<div>{{this.total}} {{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -83,90 +82,90 @@
|
||||||
<div class="duality-actions">
|
<div class="duality-actions">
|
||||||
<button class="duality-action" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
|
<button class="duality-action" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
|
||||||
<div class="duality-result">
|
<div class="duality-result">
|
||||||
<div>{{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
|
<div>{{this.total}} {{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
</div>
|
||||||
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
{{else}}
|
||||||
<div class="dice-flavor">{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
<div class="dice-result">
|
<div class="dice-flavor">{{localize "DAGGERHEART.Chat.AttackRoll.Title" attack=this.title}}</div>
|
||||||
<div class="dice-formula">{{roll}}</div>
|
<div class="dice-result">
|
||||||
|
<div class="dice-formula">{{roll}}</div>
|
||||||
|
|
||||||
<div class="dice-tooltip">
|
<div class="dice-tooltip">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<section class="tooltip-part">
|
<section class="tooltip-part">
|
||||||
|
<div class="dice">
|
||||||
|
<header class="part-header flexrow">
|
||||||
|
<span class="part-formula">
|
||||||
|
<span>1{{hope.dice}}</span>
|
||||||
|
|
|
||||||
|
<span>1{{fear.dice}}</span>
|
||||||
|
</span>
|
||||||
|
<span class="part-total">{{this.diceTotal}}</span>
|
||||||
|
</header>
|
||||||
|
<div class="flexrow">
|
||||||
|
<ol class="dice-rolls duality">
|
||||||
|
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
|
||||||
|
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{#if advantage.value}}
|
||||||
<div class="dice">
|
<div class="dice">
|
||||||
<header class="part-header flexrow">
|
<header class="part-header flexrow">
|
||||||
<span class="part-formula">
|
<span class="part-formula">
|
||||||
<span>1{{hope.dice}}</span>
|
<span>1{{advantage.dice}}</span>
|
||||||
|
|
|
||||||
<span>1{{fear.dice}}</span>
|
|
||||||
</span>
|
</span>
|
||||||
<span class="part-total">{{this.diceTotal}}</span>
|
<span class="part-total">{{advantage.value}}</span>
|
||||||
</header>
|
</header>
|
||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
<ol class="dice-rolls duality">
|
<ol class="dice-rolls">
|
||||||
<li class="roll die {{hope.dice}} {{#if hope.discarded}}discarded{{/if}} hope min" title="{{localize "DAGGERHEART.General.Hope"}}">{{hope.value}}</li>
|
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
|
||||||
<li class="roll die {{fear.dice}} {{#if fear.discarded}}discarded{{/if}} fear min" title="{{localize "DAGGERHEART.General.Fear"}}">{{fear.value}}</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{#if advantage.value}}
|
{{/if}}
|
||||||
<div class="dice">
|
{{#if disadvantage.value}}
|
||||||
<header class="part-header flexrow">
|
<div class="dice">
|
||||||
<span class="part-formula">
|
<header class="part-header flexrow">
|
||||||
<span>1{{advantage.dice}}</span>
|
<span class="part-formula">
|
||||||
</span>
|
<span>1{{disadvantage.dice}}</span>
|
||||||
<span class="part-total">{{advantage.value}}</span>
|
</span>
|
||||||
</header>
|
<span class="part-total">{{disadvantage.value}}</span>
|
||||||
<div class="flexrow">
|
</header>
|
||||||
<ol class="dice-rolls">
|
<div class="flexrow">
|
||||||
<li class="roll die {{advantage.dice}} hope min">{{advantage.value}}</li>
|
<ol class="dice-rolls">
|
||||||
</ol>
|
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
|
||||||
</div>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
{{#if disadvantage.value}}
|
|
||||||
<div class="dice">
|
|
||||||
<header class="part-header flexrow">
|
|
||||||
<span class="part-formula">
|
|
||||||
<span>1{{disadvantage.dice}}</span>
|
|
||||||
</span>
|
|
||||||
<span class="part-total">{{disadvantage.value}}</span>
|
|
||||||
</header>
|
|
||||||
<div class="flexrow">
|
|
||||||
<ol class="dice-rolls">
|
|
||||||
<li class="roll die {{disadvantage.dice}} hope min">{{disadvantage.value}}</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="dice-total duality {{#if fear.discarded}}hope{{else}}{{#if hope.discarded}}fear{{else}}critical{{/if}}{{/if}}">
|
|
||||||
<div class="dice-total-label">{{totalLabel}}</div>
|
|
||||||
<div class="dice-total-value">
|
|
||||||
{{this.total}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{#if (gt targets.length 0)}}
|
|
||||||
<div class="target-section">
|
|
||||||
{{#each targets as |target|}}
|
|
||||||
<div class="dice-total target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
|
|
||||||
<img src="{{target.img}}" />
|
|
||||||
<div class="target-inner-container">
|
|
||||||
{{#if target.hit}}{{localize "Hit"}}{{else}}{{#if (not ../total.alternate)}}{{localize "Miss"}}{{else}}?{{/if}}{{/if}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/if}}
|
||||||
</div>
|
</section>
|
||||||
{{/if}}
|
|
||||||
<div class="flexrow">
|
|
||||||
<button class="roll-damage-button" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="dice-total duality {{#if fear.discarded}}hope{{else}}{{#if hope.discarded}}fear{{else}}critical{{/if}}{{/if}}">
|
||||||
|
<div class="dice-total-label">{{totalLabel}}</div>
|
||||||
|
<div class="dice-total-value">
|
||||||
|
{{this.total}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{#if (gt targets.length 0)}}
|
||||||
|
<div class="target-section">
|
||||||
|
{{#each targets as |target|}}
|
||||||
|
<div class="dice-total target-container {{#if target.hit}}hit{{else}}{{#if (not ../total.alternate)}}miss{{/if}}{{/if}}" data-token="{{target.id}}">
|
||||||
|
<img src="{{target.img}}" />
|
||||||
|
<div class="target-inner-container">
|
||||||
|
{{#if target.hit}}{{localize "Hit"}}{{else}}{{#if (not ../total.alternate)}}{{localize "Miss"}}{{else}}?{{/if}}{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
<div class="flexrow">
|
||||||
|
<button class="roll-damage-button" data-value="{{this.total}}" data-damage="{{this.damage.value}}" data-damage-type="{{this.damage.type}}" {{#if this.damage.disabled}}disabled{{/if}}><span>Roll Damage</span></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
<div class="daggerheart chat roll" data-action="expandRoll">
|
{{#if this.colorful}}
|
||||||
{{#if this.colorful}}
|
<div class="daggerheart chat roll" data-action="expandRoll">
|
||||||
<div class="duality-data">
|
<div class="duality-data">
|
||||||
<div class="duality-title">
|
<div class="duality-title">
|
||||||
<div>{{this.title}}</div>
|
<div>{{this.title}}</div>
|
||||||
<div class="duality-result-value">{{this.total}}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="duality-modifiers">
|
<div class="duality-modifiers">
|
||||||
{{#each this.modifiers}}
|
{{#each this.modifiers}}
|
||||||
|
|
@ -62,7 +61,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{#if (not this.damage.value)}}
|
{{#if (not this.damage.value)}}
|
||||||
<div class="duality-result">
|
<div class="duality-result">
|
||||||
<div>{{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
|
<div>{{this.total}} {{#if (eq dualityResult 1)}}With Hope{{else}}{{#if (eq dualityResult 2)}}With Fear{{else}}Critical Success{{/if}}{{/if}}</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -75,7 +74,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
</div>
|
||||||
|
{{else}}
|
||||||
|
<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
|
||||||
<div class="dice-flavor">{{this.title}}</div>
|
<div class="dice-flavor">{{this.title}}</div>
|
||||||
<div class="dice-result">
|
<div class="dice-result">
|
||||||
<div class="dice-formula">{{roll}}</div>
|
<div class="dice-formula">{{roll}}</div>
|
||||||
|
|
@ -138,5 +139,5 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue