Visual improvements

This commit is contained in:
WBHarry 2026-03-15 14:09:36 +01:00
parent aa35e89e32
commit 3769e2c325
5 changed files with 206 additions and 86 deletions

View file

@ -1219,6 +1219,11 @@
"selectType": "Select Action Type", "selectType": "Select Action Type",
"selectAction": "Action Selection" "selectAction": "Action Selection"
}, },
"TagTeamRollTypes": {
"trait": "Trait",
"ability": "Ability",
"damageAbility": "Damage Ability"
},
"TargetTypes": { "TargetTypes": {
"any": "Any", "any": "Any",
"friendly": "Friendly", "friendly": "Friendly",

View file

@ -40,6 +40,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
makeDamageRoll: TagTeamDialog.#makeDamageRoll, makeDamageRoll: TagTeamDialog.#makeDamageRoll,
removeDamageRoll: TagTeamDialog.#removeDamageRoll, removeDamageRoll: TagTeamDialog.#removeDamageRoll,
selectRoll: TagTeamDialog.#selectRoll, selectRoll: TagTeamDialog.#selectRoll,
cancelRoll: TagTeamDialog.#cancelRoll,
finishRoll: TagTeamDialog.#finishRoll finishRoll: TagTeamDialog.#finishRoll
}, },
form: { handler: this.updateData, submitOnChange: true, closeOnSubmit: false } form: { handler: this.updateData, submitOnChange: true, closeOnSubmit: false }
@ -213,7 +214,8 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
await this.party.update({ await this.party.update({
[`system.tagTeam.members.${button.dataset.member}`]: { [`system.tagTeam.members.${button.dataset.member}`]: {
rollData: null, rollData: null,
rollChoice: null rollChoice: null,
selected: false
} }
}); });
@ -420,7 +422,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
? memberValues[1] ? memberValues[1]
: null; : null;
if (!baseMainRoll && !baseSecondaryRoll) return null; if (!baseMainRoll?.rollData || !baseSecondaryRoll) return null;
const mainRoll = new MemberData(baseMainRoll.toObject()); const mainRoll = new MemberData(baseMainRoll.toObject());
const secondaryRollData = new MemberData(baseSecondaryRoll.toObject()).rollData; const secondaryRollData = new MemberData(baseSecondaryRoll.toObject()).rollData;
@ -428,7 +430,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
const isCritical = overrideIsCritical ?? systemData.roll.isCritical; const isCritical = overrideIsCritical ?? systemData.roll.isCritical;
if (isCritical) systemData.damage = await this.getCriticalDamage(systemData.damage); if (isCritical) systemData.damage = await this.getCriticalDamage(systemData.damage);
if (secondaryRollData?.options.hasDamage && systemData.hasDamage) { if (secondaryRollData?.options.hasDamage && systemData.damage) {
const secondaryDamage = (displayVersion ? overrideIsCritical : isCritical) const secondaryDamage = (displayVersion ? overrideIsCritical : isCritical)
? await this.getCriticalDamage(secondaryRollData.options.damage) ? await this.getCriticalDamage(secondaryRollData.options.damage)
: secondaryRollData.options.damage; : secondaryRollData.options.damage;
@ -445,6 +447,13 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
return mainRoll; return mainRoll;
} }
static async #cancelRoll() {
await this.party.update({
'system.tagTeam.==members': {}
});
this.close();
}
static async #finishRoll() { static async #finishRoll() {
// const mainRollId = Object.keys(this.data.members).find(key => this.data.members[key].selected); // const mainRollId = Object.keys(this.data.members).find(key => this.data.members[key].selected);
// const mainRoll = game.messages.get(this.data.members[mainRollId].messageId); // const mainRoll = game.messages.get(this.data.members[mainRollId].messageId);

View file

@ -853,10 +853,14 @@ export const sceneRangeMeasurementSetting = {
export const tagTeamRollTypes = { export const tagTeamRollTypes = {
trait: { trait: {
id: 'trait', id: 'trait',
label: 'DAGGERHEART.GENERAL.Trait.single' label: 'DAGGERHEART.CONFIG.TagTeamRollTypes.trait'
}, },
ability: { ability: {
id: 'ability', id: 'ability',
label: 'DAGGERHEART.GENERAL.Ability.single' label: 'DAGGERHEART.CONFIG.TagTeamRollTypes.ability'
},
damageAbility: {
id: 'damageAbility',
label: 'DAGGERHEART.CONFIG.TagTeamRollTypes.damageAbility'
} }
}; };

View file

@ -45,37 +45,86 @@
width: 100%; width: 100%;
} }
.roll-tools { .roll-container {
width: 100%; display: flex;
flex-direction: column;
}
.roll-title {
font-size: var(--font-size-20);
font-weight: bold;
color: light-dark(@dark-blue, @golden);
text-align: center;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-evenly; gap: 8px;
.roll-button { &::before,
position: relative; &::after {
color: light-dark(@dark-blue, @golden);
content: '';
flex: 1;
height: 2px;
}
&::before {
background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, @golden 100%);
}
&::after {
background: linear-gradient(90deg, @golden 0%, rgba(0, 0, 0, 0) 100%);
}
}
.roll-tools {
display: flex;
gap: 4px;
align-items: center;
img {
height: 16px;
}
a {
display: flex; display: flex;
justify-content: center; font-size: 16px;
.roll-label { &:hover {
position: absolute; text-shadow: none;
top: 8px; filter: drop-shadow(0 0 8px var(--golden));
width: 60px;
text-align: center;
padding: 2px;
background: light-dark(darkblue, gold);
color: light-dark(white, black);
border-radius: 6px;
border: 1px solid light-dark(white, black);
}
img {
height: 80px;
} }
} }
.delete-button i { // width: 100%;
font-size: 40px; // display: flex;
} // align-items: center;
// justify-content: space-evenly;
// .roll-button {
// position: relative;
// display: flex;
// justify-content: center;
// .roll-label {
// position: absolute;
// top: 8px;
// width: 60px;
// text-align: center;
// padding: 2px;
// background: light-dark(darkblue, gold);
// color: light-dark(white, black);
// border-radius: 6px;
// border: 1px solid light-dark(white, black);
// }
// img {
// height: 80px;
// }
// }
// .delete-button i {
// font-size: 40px;
// }
} }
.roll-data { .roll-data {
@ -138,6 +187,10 @@
.roll-operator { .roll-operator {
font-size: var(--font-size-24); font-size: var(--font-size-24);
} }
.roll-value {
font-size: 18px;
}
} }
.roll-total { .roll-total {
@ -148,12 +201,16 @@
} }
} }
.select-roll-button i { .select-roll-button {
color: light-dark(@dark-blue, @golden); margin-top: 8px;
font-size: 48px;
&.inactive { i {
opacity: 0.4; color: light-dark(@dark-blue, @golden);
font-size: 48px;
&.inactive {
opacity: 0.4;
}
} }
} }
} }
@ -183,10 +240,6 @@
font-size: var(--font-size-20); font-size: var(--font-size-20);
} }
.hint {
text-align: center;
}
.result-container { .result-container {
width: 100%; width: 100%;
text-align: center; text-align: center;
@ -202,14 +255,17 @@
} }
.finish-container { .finish-container {
display: flex;
flex-direction: column;
gap: 16px; gap: 16px;
text-align: center; display: grid;
grid-template-columns: 1fr 1fr 1fr;
button { .finish-button {
flex: 1; grid-column: span 2;
} }
} }
.hint {
text-align: center;
}
} }
} }

View file

@ -17,7 +17,7 @@
</select> </select>
</div> </div>
</div> </div>
{{#if (eq member.rollType 'trait')}} {{#if (eq member.rollType 'trait')}}
<div class="form-group"> <div class="form-group">
<div class="form-fields"> <div class="form-fields">
@ -39,57 +39,102 @@
{{/if}} {{/if}}
</div> </div>
<div class="roll-tools"> {{#if member.readyToRoll}}
<a class="roll-button" data-action="makeRoll" data-member="{{key}}" {{#unless member.readyToRoll}}disabled{{/unless}}> <div class="roll-container">
<span class="roll-label">{{#if member.hasRolled}}{{localize "DAGGERHEART.GENERAL.reroll"}}{{else}}{{localize "DAGGERHEART.GENERAL.roll"}}{{/if}}</span> <span class="roll-title">
<img src="systems/daggerheart/assets/icons/dice/duality/Daggerheart%20Foundry_g519.png" /> {{localize "DAGGERHEART.GENERAL.roll"}}
</a> <div class="roll-tools">
<a class="delete-button" data-action="removeRoll" data-member="{{key}}" {{#unless member.hasRolled}}disabled{{/unless}}><i class="fa-solid fa-trash"></i></a> <a class="roll-button" data-action="makeRoll" data-member="{{key}}">
</div> <img src="systems/daggerheart/assets/icons/dice/hope/d12.svg" />
</a>
{{#if member.rollData}} {{#if member.hasRolled}}
{{#with member.rollData.options.roll}} <a class="delete-button" data-action="removeRoll" data-member="{{key}}">
<div class="roll-data {{#if this.isCritical}}critical{{else}}{{#if (eq this.result.duality 1)}}hope{{else}}fear{{/if}}{{/if}}"> <i class="fa-solid fa-trash"></i>
<div class="duality-label">{{this.total}} {{localize "DAGGERHEART.GENERAL.withThing" thing=this.result.label}}</div> </a>
<div class="roll-dice-container"> {{/if}}
<a class="roll-dice" data-action="rerollDice" data-member="{{../key}}" data-dice-type="hope">
<span class="dice-label">{{this.hope.value}}</span>
<img src="{{concat "systems/daggerheart/assets/icons/dice/hope/" this.hope.dice ".svg"}}" />
</a>
<span class="roll-operator">+</span>
<a class="roll-dice" data-action="rerollDice" data-member="{{../key}}" data-dice-type="fear">
<span class="dice-label">{{this.fear.value}}</span>
<img src="{{concat "systems/daggerheart/assets/icons/dice/fear/" this.fear.dice ".svg"}}" />
</a>
</div> </div>
<div class="roll-total">{{this.formula}}</div> </span>
</div>
{{/with}} {{#if member.rollData}}
{{#with member.rollData.options.roll}}
<div class="roll-data {{#if this.isCritical}}critical{{else}}{{#if (eq this.result.duality 1)}}hope{{else}}fear{{/if}}{{/if}}">
<div class="duality-label">{{this.total}} {{localize "DAGGERHEART.GENERAL.withThing" thing=this.result.label}}</div>
<div class="roll-dice-container">
<a class="roll-dice" data-action="rerollDice" data-member="{{../key}}" data-dice-type="hope">
<span class="dice-label">{{this.hope.value}}</span>
<img src="{{concat "systems/daggerheart/assets/icons/dice/hope/" this.hope.dice ".svg"}}" />
</a>
<span class="roll-operator">+</span>
<a class="roll-dice" data-action="rerollDice" data-member="{{../key}}" data-dice-type="fear">
<span class="dice-label">{{this.fear.value}}</span>
<img src="{{concat "systems/daggerheart/assets/icons/dice/fear/" this.fear.dice ".svg"}}" />
</a>
<span class="roll-operator">{{#if (gte this.modifierTotal 0)}}+{{else}}-{{/if}}</span>
<span class="roll-value">{{this.modifierTotal}}</span>
</div>
</div>
{{/with}}
{{else}}
<span class="hint">{{localize "Make your roll"}}</span>
{{/if}}
</div>
{{/if}} {{/if}}
{{#if member.rollData.options.hasDamage}} {{#if member.rollData.options.hasDamage}}
<div class="roll-tools"> <div class="roll-container">
<a class="roll-button" data-action="makeDamageRoll" data-member-key="{{key}}" {{#unless member.readyToRoll}}disabled{{/unless}}> <span class="roll-title">
<span class="roll-label">{{#if member.rollData.options.damage}}{{localize "DAGGERHEART.GENERAL.reroll"}}{{else}}{{localize "DAGGERHEART.GENERAL.roll"}}{{/if}}</span> {{localize "DAGGERHEART.GENERAL.damage"}}
<img src="systems/daggerheart/assets/icons/dice/default/d20.svg" /> <div class="roll-tools">
</a> <a class="roll-button" data-action="makeDamageRoll" data-member-key="{{key}}" {{#unless member.readyToRoll}}disabled{{/unless}}>
<a class="delete-button" data-action="removeDamageRoll" data-member-key="{{key}}" {{#unless member.rollData.options.damage}}disabled{{/unless}}><i class="fa-solid fa-trash"></i></a> <img src="systems/daggerheart/assets/icons/dice/hope/d20.svg" />
</a>
{{#if damage}}
<a class="delete-button" data-action="removeDamageRoll" data-member-key="{{key}}" {{#unless member.rollData.options.damage}}disabled{{/unless}}>
<i class="fa-solid fa-trash"></i>
</a>
{{/if}}
</div>
</span>
{{#if damage}}
{{#each damage as |damage key|}}
<div class="roll-data {{#if ../useCritDamage}}critical{{/if}}">
<div class="duality-label">
<span>{{localize (concat "DAGGERHEART.CONFIG.HealingType." key ".name")}}:</span>
<span>{{#if ../useCritDamage}}{{lookup (lookup ../critDamage key) 'total'}}{{else}}{{damage.total}}{{/if}}</span>
</div>
{{#each damage.parts as |part|}}
<div class="roll-dice-container">
{{#each part.dice as |dice|}}
<a class="roll-dice" data-action="rerollDice" data-member="{{../key}}" data-dice-type="hope">
<span class="dice-label">{{dice.total}}</span>
<img src="{{concat "systems/daggerheart/assets/icons/dice/hope/" dice.dice ".svg"}}" />
</a>
{{#unless @last}}
<span class="roll-operator">+</span>
{{/unless}}
{{/each}}
{{#if part.modifierTotal}}
<span class="roll-operator">{{#if (gte part.modifierTotal 0)}}+{{else}}-{{/if}}</span>
<span class="roll-value">{{part.modifierTotal}}</span>
{{/if}}
</div>
{{/each}}
</div>
{{/each}}
{{else}}
<span class="hint">{{localize "Make your roll"}}</span>
{{/if}}
</div> </div>
{{/if}} {{/if}}
{{#each damage as |damage key|}}
<div class="roll-data {{#if ../useCritDamage}}critical{{/if}}">
<div class="duality-label">
{{localize "DAGGERHEART.GENERAL.damage"}}
<span>{{#if ../useCritDamage}}{{lookup (lookup ../critDamage key) 'total'}}{{else}}{{damage.total}}{{/if}}</span>
</div>
<div class="roll-total">{{#if ../useCritDamage}}{{lookup (lookup ../critDamage key) 'formula'}}{{else}}{{damage.formula}}{{/if}}</div>
</div>
{{/each}}
</div> </div>
<a class="select-roll-button" data-action="selectRoll" data-member-key="{{key}}"> {{#if member.hasRolled}}
<i class="{{#if member.selected}}fa-solid fa-circle-check{{else}}fa-regular fa-circle inactive{{/if}}"></i> <a class="select-roll-button" data-action="selectRoll" data-member-key="{{key}}">
</a> <i class="{{#if member.selected}}fa-solid fa-circle-check{{else}}fa-regular fa-circle inactive{{/if}}"></i>
</a>
{{/if}}
</fieldset> </fieldset>
{{/each}} {{/each}}
</div> </div>
@ -125,7 +170,8 @@
</div> </div>
<div class="finish-container"> <div class="finish-container">
<button type="button" data-action="finishRoll" {{#if hintText}}disabled{{/if}}>{{localize "Finish Tagteam Roll"}}</button> <button type="button" data-action="cancelRoll">{{localize "Cancel TagTeam Roll"}}</button>
<button type="button" data-action="finishRoll" {{#if hintText}}disabled{{/if}} class="finish-button">{{localize "Finish Tagteam Roll"}}</button>
</div> </div>
</div> </div>
</section> </section>