Attempt to add HUD core

This commit is contained in:
2025-11-12 23:41:15 +01:00
parent 68a0d03740
commit 6ad8226265
37 changed files with 1639 additions and 903 deletions

View File

@@ -6,6 +6,7 @@
</div>
<div class="intro-right">
<ul>
<li><strong>{{actingCharName}}</strong></li>
{{#if (eq rollType "char")}}
<li><strong>{{localize "CTHULHUETERNAL.Label.charRoll"}}</strong></li>
{{/if}}
@@ -66,6 +67,7 @@
<li>{{localize "CTHULHUETERNAL.Label.targetScore"}}
:
{{targetScore}}%</li>
{{#if isSuccess}}
{{#if isCritical}}
<li class="result-critical-success">{{localize
@@ -75,70 +77,8 @@
{{else}}
<li class="result-success">
{{localize "CTHULHUETERNAL.Label.success"}}
{{#if isNudge}}
<a
class="nudge-roll"
data-tooltip="{{localize ' CTHULHUETERNAL.Label.rollNudge'}}"
><i class="fa-solid fa-circle-sort-down"></i></a>
{{/if}}
</li>
{{/if}}
{{#if (eq rollType "weapon")}}
<li>
{{#if (eq weapon.system.weaponType "rangedfirearm")}}
{{#if weapon.system.hasDamageDistance}}
{{#each weapon.system.damageDistance as |damageDistance|}}
{{#if (gt damageDistance.distance 0)}}
<a
class="damage-roll"
data-item-id="{{weapon.id}}"
data-action="roll"
data-roll-type="damage"
data-roll-value="{{damageDistance.damage}}"
>
<i class="fa-solid fa-gun"></i>
<span
class="damage-distance"
>{{damageDistance.distance}}:{{damageDistance.damage}}&nbsp;&nbsp;</span>
</a>
{{/if}}
{{/each}}
{{else}}
<a
class="damage-roll"
data-roll-value="{{weapon.system.damage}}"
data-tooltip="{{localize
'
CTHULHUETERNAL.Label.rollDamage'
}}"
><i class="fa-solid fa-gun"></i></a>
{{/if}}
{{else}}
<a
class="damage-roll"
data-roll-value="{{weapon.system.damage}}"
data-tooltip="{{localize
'
CTHULHUETERNAL.Label.rollDamage'
}}"
><i class="fa-solid fa-sword"></i></a>
{{/if}}
</li>
{{/if}}
{{#if (eq rollType "skill")}}
{{#if rollItem.system.isHealing}}
<li>
<a
class="healing-roll"
data-tooltip="{{localize
' CTHULHUETERNAL.Label.rollHealing'
}}"
><i class="fa-solid fa-heart"></i></a>
</li>
{{/if}}
{{/if}}
{{/if}}
{{#if isFailure}}
@@ -152,19 +92,9 @@
{{localize "CTHULHUETERNAL.Label.failure"}}
</li>
{{/if}}
{{#if isNudge}}
<li>
<a
class="nudge-roll"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollNudge'}}"
><i class="fa-solid fa-circle-sort-down"></i></a>
</li>
{{/if}}
{{/if}}
{{#if isAttackRoll}}
<!-- {{#if isAttackRoll}}
{{#if defenseRoll}}
<li>{{localize "CTHULHUETERNAL.Label.defenseRoll"}}</li>
{{#if attackSuccess}}
@@ -181,27 +111,18 @@
<li class="orange-warning">{{localize
"CTHULHUETERNAL.Label.noDefenseRoll"
}}</li>
<a
class="opposed-roll"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.opposedRoll'}}"
>
<i class="fa-duotone fa-light fa-arrows-to-line"></i></a>
{{else}}
<li class="orange-warning">{{localize
"CTHULHUETERNAL.Label.noTarget"
}}</li>
<a
class="opposed-roll"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.opposedRoll'}}"
>
<i class="fa-duotone fa-light fa-arrows-to-line"></i></a>
{{/if}}
{{/if}}
{{/if}}
{{/if}} -->
</ul>
</div>
</div>
{{#if isDamage}}
<div>
{{#if (and isGM hasTarget)}}
@@ -221,4 +142,86 @@
{{{tooltip}}}
</div>
{{/unless}}
{{! Zone d'actions regroupées }}
<div class="chat-actions">
{{#if isSuccess}}
{{#if isNudge}}
<a
class="nudge-roll chat-action-button"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollNudge'}}"
>
<i class="fa-solid fa-circle-sort-down"></i>
</a>
{{/if}}
{{#if (eq rollType "weapon")}}
{{#if (eq weapon.system.weaponType "rangedfirearm")}}
{{#if weapon.system.hasDamageDistance}}
{{#each weapon.system.damageDistance as |damageDistance|}}
{{#if (gt damageDistance.distance 0)}}
<a
class="damage-roll chat-action-button"
data-item-id="{{weapon.id}}"
data-action="roll"
data-roll-type="damage"
data-roll-value="{{damageDistance.damage}}"
data-tooltip="{{localize
'CTHULHUETERNAL.Label.rollDamage'
}} ({{damageDistance.distance}}m : {{damageDistance.damage}})"
>
<i class="fa-solid fa-gun"></i>
</a>
{{/if}}
{{/each}}
{{else}}
<a
class="damage-roll chat-action-button"
data-roll-value="{{weapon.system.damage}}"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollDamage'}}"
>
<i class="fa-solid fa-gun"></i>
</a>
{{/if}}
{{else}}
<a
class="damage-roll chat-action-button"
data-roll-value="{{weapon.system.damage}}"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollDamage'}}"
>
<i class="fa-solid fa-sword"></i>
</a>
{{/if}}
{{/if}}
{{#if (eq rollType "skill")}}
{{#if rollItem.system.isHealing}}
<a
class="healing-roll chat-action-button"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollHealing'}}"
>
<i class="fa-solid fa-heart"></i>
</a>
{{/if}}
{{/if}}
{{/if}}
{{#if isFailure}}
{{#if isNudge}}
<a
class="nudge-roll chat-action-button"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollNudge'}}"
>
<i class="fa-solid fa-circle-sort-down"></i>
</a>
{{/if}}
{{/if}}
<a
class="opposed-roll chat-action-button"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.opposedRoll'}}"
>
<i class="fa-duotone fa-light fa-arrows-to-line"></i>
</a>
</div>
</div>

View File

@@ -0,0 +1,64 @@
w{{! Template for opposed roll result }}
<div class="cthulhu-eternal-roll opposed-roll-result">
<div class="opposed-header">
<h3>{{localize "CTHULHUETERNAL.Label.opposedRollResult"}}</h3>
</div>
<div class="opposed-content">
<div class="opposed-winner">
<div class="character-info">
<img src="{{winner.actor.img}}" alt="{{winner.actor.name}}" />
<div class="character-name">
<strong>{{localize "CTHULHUETERNAL.Label.opposedRollWinner"}}</strong>
<span class="winner-name">{{winner.actor.name}}</span>
</div>
</div>
<div class="roll-result winner-result">
<span class="roll-value">{{winner.rollData.rollResult}}</span>
{{#if winner.rollData.isCritical}}
<span class="critical-badge">{{localize
"CTHULHUETERNAL.Label.critical"
}}</span>
{{/if}}
</div>
</div>
<div class="versus-separator">
<i class="fas fa-swords"></i>
<span>{{localize "CTHULHUETERNAL.Label.defeats"}}</span>
</div>
<div class="opposed-loser">
<div class="character-info">
<img src="{{loser.actor.img}}" alt="{{loser.actor.name}}" />
<div class="character-name">
<span class="loser-name">{{loser.actor.name}}</span>
</div>
</div>
<div class="roll-result loser-result">
<span class="roll-value">{{loser.rollData.rollResult}}</span>
{{#if loser.rollData.isCritical}}
<span class="critical-badge">{{localize
"CTHULHUETERNAL.Label.critical"
}}</span>
{{/if}}
</div>
</div>
</div>
{{#if canApplyDamage}}
<div class="chat-actions">
<a
class="damage-roll chat-action-button"
data-roll-value="{{winner.rollData.weapon.system.damage}}"
data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollDamage'}}"
>
{{#if (eq winner.rollData.weapon.system.weaponType "rangedfirearm")}}
<i class="fa-solid fa-gun"></i>
{{else}}
<i class="fa-solid fa-sword"></i>
{{/if}}
</a>
</div>
{{/if}}
</div>

View File

@@ -1,135 +1,214 @@
<div class="fvtt-cthulhu-eternal-roll-dialog">
<fieldSet>
{{#if (eq rollType "skill")}}
<legend>{{localize "CTHULHUETERNAL.Label.skill"}}</legend>
<legend>{{localize "CTHULHUETERNAL.Label.skill"}}</legend>
{{/if}}
{{#if (eq rollType "char")}}
<legend>{{localize "CTHULHUETERNAL.Label.characteristic"}}</legend>
<legend>{{localize "CTHULHUETERNAL.Label.characteristic"}}</legend>
{{/if}}
{{#if (eq rollType "resource")}}
<legend>{{localize "CTHULHUETERNAL.Label.resourceRating"}}</legend>
<div class="dialog-skill">{{rollItem.name}} : <span class="resource-score">{{initialScore}} ({{mul initialScore
5}}%)</span></div>
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Hand"}} : {{rollItem.hand}} <input type="checkbox"
data-action="selectHand" {{checked rollItem.enableHand}}></div>
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Stowed"}} : {{rollItem.stowed}} <input type="checkbox"
data-action="selectStowed" {{checked rollItem.enableStowed}}></div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.Storage"}} : {{rollItem.storage}}
<input type="checkbox" data-action="selectStorage" {{checked rollItem.enableStorage}}>
</div>
<legend>{{localize "CTHULHUETERNAL.Label.resourceRating"}}</legend>
<div class="dialog-skill">{{rollItem.name}}
:
<span class="resource-score">{{initialScore}}
({{mul initialScore 5}}%)</span></div>
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Hand"}}
:
{{rollItem.hand}}
<input
type="checkbox"
data-action="selectHand"
{{checked rollItem.enableHand}}
/></div>
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Stowed"}}
:
{{rollItem.stowed}}
<input
type="checkbox"
data-action="selectStowed"
{{checked rollItem.enableStowed}}
/></div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.Storage"}}
:
{{rollItem.storage}}
<input
type="checkbox"
data-action="selectStorage"
{{checked rollItem.enableStorage}}
/>
</div>
{{else}}
<div class="dialog-skill">{{rollItem.name}} : {{initialScore}}%</div>
<div class="dialog-skill">{{rollItem.name}} : {{initialScore}}%</div>
{{/if}}
{{#if weapon}}
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Weapon"}} : {{weapon.name}}</div>
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Weapon"}}
:
{{weapon.name}}</div>
{{#if targetName}}
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Target"}} : {{targetName}}</div>
{{/if}}
{{#if targetName}}
<div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Target"}}
:
{{targetName}}</div>
{{/if}}
{{#if (eq weapon.system.weaponType "melee")}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.targetMove"}}
<select name="meleeTargetMoveChoice" class="roll-skill-modifier">
{{selectOptions
choiceMeleeTargetMove
localize=true
selected=meleeTargetMoveChoice
valueAttr="id"
labelAttr="label"
}}
</select>
</div>
{{/if}}
{{#if isRangedWeapon}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.rangedRange"}}
<select name="rangedRangeChoice" class="roll-skill-modifier">
{{selectOptions
choiceRangedRange
localize=true
selected=rangedRangeChoice
valueAttr="id"
labelAttr="label"
}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.targetMove"}}
<select name="rangedTargetMoveChoice" class="roll-skill-modifier">
{{selectOptions
choiceRangedTargetMove
localize=true
selected=rangedTargetMoveChoice
valueAttr="id"
labelAttr="label"
}}
</select>
</div>
{{#if (eq weapon.system.weaponType "melee")}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.targetMove"}}
<select name="meleeTargetMoveChoice" class="roll-skill-modifier">
{{selectOptions choiceMeleeTargetMove localize=true selected=meleeTargetMoveChoice valueAttr="id"
labelAttr="label"}}
</select>
</div>
{{/if}}
{{#if isRangedWeapon}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.rangedRange"}}
<select name="rangedRangeChoice" class="roll-skill-modifier">
{{selectOptions choiceRangedRange localize=true selected=rangedRangeChoice valueAttr="id" labelAttr="label"}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.targetMove"}}
<select name="rangedTargetMoveChoice" class="roll-skill-modifier">
{{selectOptions choiceRangedTargetMove localize=true selected=rangedTargetMoveChoice valueAttr="id"
labelAttr="label"}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.aimingLastRound"}}
<input
type="checkbox"
class="aimingLastRound"
name="aimingLastRound"
/>
</div>
{{#if weapon.system.hasSight}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.aimingWithSight"}}
<input
type="checkbox"
class="aimingWithSight"
name="aimingWithSight"
/>
</div>
{{/if}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.aimingLastRound"}}
<input type="checkbox" name="aimingLastRound">
</div>
{{#if weapon.system.hasSight}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.aimingWithSight"}}
<input type="checkbox" name="aimingWithSight">
</div>
{{/if}}
{{/if}}
{{/if}}
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.visibility"}}
<select name="visibilityChoice" class="roll-skill-modifier">
{{selectOptions
choiceVisibility
localize=true
selected=visibilityChoice
valueAttr="id"
labelAttr="label"
}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.attackerState"}}
<select name="attackerStateChoice" class="roll-skill-modifier">
{{selectOptions
choiceAttackerState
localize=true
selected=attackerStateChoice
valueAttr="id"
labelAttr="label"
}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.targetSize"}}
<select name="targetSizeChoice" class="roll-skill-modifier">
{{selectOptions
choiceTargetSize
localize=true
selected=targetSizeChoice
valueAttr="id"
labelAttr="label"
}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.visibility"}}
<select name="visibilityChoice" class="roll-skill-modifier">
{{selectOptions choiceVisibility localize=true selected=visibilityChoice valueAttr="id" labelAttr="label"}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.attackerState"}}
<select name="attackerStateChoice" class="roll-skill-modifier">
{{selectOptions choiceAttackerState localize=true selected=attackerStateChoice valueAttr="id"
labelAttr="label"}}
</select>
</div>
<div class="dialog-skill">
{{localize "CTHULHUETERNAL.Label.targetSize"}}
<select name="targetSizeChoice" class="roll-skill-modifier">
{{selectOptions choiceTargetSize localize=true selected=targetSizeChoice valueAttr="id" labelAttr="label"}}
</select>
</div>
{{#if weapon.system.hasSelectiveFire}}
<div class="dialog-skill">Selective Fire :
<select name="selectiveFireChoice" class="roll-skill-modifier">
{{selectOptions choiceSelectiveFire localize=true selected=selectiveFireChoice valueAttr="id"
labelAttr="label"}}
</select>
</div>
{{/if}}
{{#if weapon.system.hasSelectiveFire}}
<div class="dialog-skill">Selective Fire :
<select name="selectiveFireChoice" class="roll-skill-modifier">
{{selectOptions
choiceSelectiveFire
localize=true
selected=selectiveFireChoice
valueAttr="id"
labelAttr="label"
}}
</select>
</div>
{{/if}}
{{/if}}
{{#if isZeroWP}}
<div class="dialog-skill red-warning">{{localize "CTHULHUETERNAL.Label.ZeroWP"}}</div>
<div class="dialog-skill red-warning">{{localize
"CTHULHUETERNAL.Label.ZeroWP"
}}</div>
{{else}}
{{#if isLowWP}}
<div class="dialog-skill orange-warning">{{localize "CTHULHUETERNAL.Label.LowWP"}} : -20%</div>
{{/if}}
{{#if isLowWP}}
<div class="dialog-skill orange-warning">{{localize
"CTHULHUETERNAL.Label.LowWP"
}}
: -20%</div>
{{/if}}
{{/if}}
{{#if isExhausted}}
<div class="dialog-skill orange-warning">{{localize "CTHULHUETERNAL.Label.Exhausted"}} : -20%</div>
<div class="dialog-skill orange-warning">{{localize
"CTHULHUETERNAL.Label.Exhausted"
}}
: -20%</div>
{{/if}}
</fieldSet>
{{#if hasModifier}}
<fieldSet class="dialog-modifier">
<legend>{{localize "CTHULHUETERNAL.Label.modifier"}}</legend>
<select name="modifier" class="roll-skill-modifier">
{{selectOptions choiceModifier selected=modifier}}
</select>
</fieldSet>
<fieldSet class="dialog-modifier">
<legend>{{localize "CTHULHUETERNAL.Label.modifier"}}</legend>
<select name="modifier" class="roll-skill-modifier">
{{selectOptions choiceModifier selected=modifier}}
</select>
</fieldSet>
{{/if}}
{{#if hasMultiplier}}
<fieldSet class="dialog-modifier">
<legend>{{localize "CTHULHUETERNAL.Label.multiplier"}}</legend>
<select name="multiplier" class="roll-skill-modifier roll-skill-multiplier">
{{selectOptions choiceMultiplier selected=multiplier}}
</select>
</fieldSet>
<fieldSet class="dialog-modifier">
<legend>{{localize "CTHULHUETERNAL.Label.multiplier"}}</legend>
<select
name="multiplier"
class="roll-skill-modifier roll-skill-multiplier"
>
{{selectOptions choiceMultiplier selected=multiplier}}
</select>
</fieldSet>
{{/if}}
<fieldSet>