mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
[Feature] TagTeam Partial Rendering (#1735)
* I done did it, I think * Think I fixed the partial rendering bug for gm->player
This commit is contained in:
parent
7a7940aa04
commit
f119daff07
6 changed files with 545 additions and 438 deletions
|
|
@ -1,4 +1,5 @@
|
|||
<section class="initialization-container tab {{#if tabs.initialization.active}} active{{/if}}" data-group="{{tabs.initialization.group}}" data-tab="{{tabs.initialization.id}}">
|
||||
{{partId}}
|
||||
<h2>{{localize "DAGGERHEART.APPLICATIONS.TagTeamSelect.selectParticipants"}}</h2>
|
||||
<div class="members-container">
|
||||
{{#each memberSelection as |member|}}
|
||||
|
|
|
|||
11
templates/dialogs/tagTeamDialog/rollSelection.hbs
Normal file
11
templates/dialogs/tagTeamDialog/rollSelection.hbs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<section class="roll-selection {{#if (and allHaveRolled tabs.tagTeamRoll.active)}}rendered{{/if}} tab {{#if tabs.tagTeamRoll.active}} active{{/if}}" data-group="{{tabs.tagTeamRoll.group}}">
|
||||
{{#if allHaveRolled}}
|
||||
<div class="roll-selection-container">
|
||||
{{#each members as |member key|}}
|
||||
<a class="select-roll-button" data-action="selectRoll" data-member-key="{{key}}">
|
||||
<i class="{{#if member.selected}}fa-solid fa-circle-check{{else}}fa-regular fa-circle inactive{{/if}}"></i>
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</section>
|
||||
126
templates/dialogs/tagTeamDialog/tagTeamMember.hbs
Normal file
126
templates/dialogs/tagTeamDialog/tagTeamMember.hbs
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
|
||||
{{#with (lookup members partId)}}
|
||||
<fieldset class="team-member-container {{#if @root.allHaveRolled}}select-padding{{/if}} {{#unless isEditable}}inactive{{/unless}}" data-member-key="{{@root.partId}}">
|
||||
<div class="data-container">
|
||||
<div class="member-info">
|
||||
<img src="{{img}}" />
|
||||
<span class="member-name">{{name}}</span>
|
||||
</div>
|
||||
<div class="roll-setup">
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.APPLICATIONS.TagTeamSelect.rollType"}}</label>
|
||||
<select class="roll-type-select" data-member="{{@root.partId}}" {{#if hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions ../rollTypes selected=rollType localize=true}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{#if (or (not rollType) (eq rollType 'trait'))}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.Trait.single"}}</label>
|
||||
<select name="{{concat "system.tagTeam.members." @root.partId ".rollChoice"}}" {{#if hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions ../traitOptions selected=rollChoice localize=true blank=""}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{else if (eq rollType 'damageAbility')}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.CONFIG.TagTeamRollTypes.damageAbility"}}</label>
|
||||
<select name="{{concat "system.tagTeam.members." @root.partId ".rollChoice"}}" {{#if hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions damageRollOptions selected=rollChoice localize=true blank=""}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.Ability.single"}}</label>
|
||||
<select name="{{concat "system.tagTeam.members." @root.partId ".rollChoice"}}" {{#if hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions rollOptions selected=rollChoice localize=true blank=""}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#if readyToRoll}}
|
||||
<div class="roll-container">
|
||||
<span class="roll-title">
|
||||
{{localize "DAGGERHEART.GENERAL.roll"}}
|
||||
<div class="roll-tools">
|
||||
<a class="roll-button" data-action="makeRoll" data-member="{{@root.partId}}">
|
||||
<img src="systems/daggerheart/assets/icons/dice/hope/d12.svg" />
|
||||
</a>
|
||||
|
||||
{{#if hasRolled}}
|
||||
<a class="delete-button" data-action="removeRoll" data-member="{{@root.partId}}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</span>
|
||||
|
||||
{{#if rollData}}
|
||||
{{#with 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="{{@root.partId}}" 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="{{@root.partId}}" 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>
|
||||
{{#if this.advantage.type}}
|
||||
<span class="roll-operator">{{#if (eq this.advantage.type 1)}}+{{else}}-{{/if}}</span>
|
||||
<span class="roll-dice">
|
||||
<span class="dice-label">{{this.advantage.value}}</span>
|
||||
<img src="{{concat "systems/daggerheart/assets/icons/dice/" (ifThen (eq this.advantage.type 1) "adv/" "disadv/") this.advantage.dice ".svg"}}" />
|
||||
</span>
|
||||
{{/if}}
|
||||
<span class="roll-operator">{{#if (gte this.modifierTotal 0)}}+{{else}}-{{/if}}</span>
|
||||
<span class="roll-value">{{positive this.modifierTotal}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/with}}
|
||||
{{else}}
|
||||
<span class="hint">{{localize "DAGGERHEART.APPLICATIONS.TagTeamSelect.makeYourRoll"}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if rollData.options.hasDamage}}
|
||||
<div class="roll-container">
|
||||
<span class="roll-title">
|
||||
{{localize "DAGGERHEART.GENERAL.damage"}}
|
||||
<div class="roll-tools">
|
||||
<a class="roll-button" data-action="makeDamageRoll" data-member-key="{{@root.partId}}" {{#unless readyToRoll}}disabled{{/unless}}>
|
||||
<img src="systems/daggerheart/assets/icons/dice/hope/d20.svg" />
|
||||
</a>
|
||||
|
||||
{{#if damage}}
|
||||
<a class="delete-button" data-action="removeDamageRoll" data-member-key="{{@root.partId}}" {{#unless rollData.options.damage}}disabled{{/unless}}>
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</span>
|
||||
{{#if damage}}
|
||||
{{#if useCritDamage}}
|
||||
{{> "systems/daggerheart/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs" damage=critDamage isCritical=true }}
|
||||
{{else}}
|
||||
{{> "systems/daggerheart/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs" damage=damage }}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<span class="hint">{{localize "DAGGERHEART.APPLICATIONS.TagTeamSelect.makeYourRoll"}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</fieldset>
|
||||
{{/with}}
|
||||
|
|
@ -1,140 +1,5 @@
|
|||
<section class="tag-team-roll tab {{#if tabs.tagTeamRoll.active}} active{{/if}}" data-group="{{tabs.tagTeamRoll.group}}" data-tab="{{tabs.tagTeamRoll.id}}">
|
||||
<div class="tag-team-roll-container {{#unless isEditable}}inactive{{/unless}}">
|
||||
<div class="team-container">
|
||||
{{#each members as |member key|}}
|
||||
<fieldset class="member-container {{#unless member.isEditable}}inactive{{/unless}}">
|
||||
<div class="data-container">
|
||||
<div class="member-info">
|
||||
<img src="{{member.img}}" />
|
||||
<span class="member-name">{{member.name}}</span>
|
||||
</div>
|
||||
<div class="roll-setup">
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.APPLICATIONS.TagTeamSelect.rollType"}}</label>
|
||||
<select class="roll-type-select" data-member="{{key}}" {{#if member.hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions ../rollTypes selected=member.rollType localize=true}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if (eq member.rollType 'trait')}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.Trait.single"}}</label>
|
||||
<select name="{{concat "system.tagTeam.members." key ".rollChoice"}}" {{#if member.hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions ../traitOptions selected=member.rollChoice localize=true blank=""}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{else if (eq member.rollType 'damageAbility')}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.CONFIG.TagTeamRollTypes.damageAbility"}}</label>
|
||||
<select name="{{concat "system.tagTeam.members." key ".rollChoice"}}" {{#if member.hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions member.damageRollOptions selected=member.rollChoice localize=true blank=""}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.GENERAL.Ability.single"}}</label>
|
||||
<select name="{{concat "system.tagTeam.members." key ".rollChoice"}}" {{#if member.hasRolled}}disabled{{/if}}>
|
||||
{{selectOptions member.rollOptions selected=member.rollChoice localize=true blank=""}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#if member.readyToRoll}}
|
||||
<div class="roll-container">
|
||||
<span class="roll-title">
|
||||
{{localize "DAGGERHEART.GENERAL.roll"}}
|
||||
<div class="roll-tools">
|
||||
<a class="roll-button" data-action="makeRoll" data-member="{{key}}">
|
||||
<img src="systems/daggerheart/assets/icons/dice/hope/d12.svg" />
|
||||
</a>
|
||||
|
||||
{{#if member.hasRolled}}
|
||||
<a class="delete-button" data-action="removeRoll" data-member="{{key}}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</span>
|
||||
|
||||
{{#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>
|
||||
{{#if this.advantage.type}}
|
||||
<span class="roll-operator">{{#if (eq this.advantage.type 1)}}+{{else}}-{{/if}}</span>
|
||||
<span class="roll-dice">
|
||||
<span class="dice-label">{{this.advantage.value}}</span>
|
||||
<img src="{{concat "systems/daggerheart/assets/icons/dice/" (ifThen (eq this.advantage.type 1) "adv/" "disadv/") this.advantage.dice ".svg"}}" />
|
||||
</span>
|
||||
{{/if}}
|
||||
<span class="roll-operator">{{#if (gte this.modifierTotal 0)}}+{{else}}-{{/if}}</span>
|
||||
<span class="roll-value">{{positive this.modifierTotal}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/with}}
|
||||
{{else}}
|
||||
<span class="hint">{{localize "DAGGERHEART.APPLICATIONS.TagTeamSelect.makeYourRoll"}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if member.rollData.options.hasDamage}}
|
||||
<div class="roll-container">
|
||||
<span class="roll-title">
|
||||
{{localize "DAGGERHEART.GENERAL.damage"}}
|
||||
<div class="roll-tools">
|
||||
<a class="roll-button" data-action="makeDamageRoll" data-member-key="{{key}}" {{#unless member.readyToRoll}}disabled{{/unless}}>
|
||||
<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}}
|
||||
{{#if useCritDamage}}
|
||||
{{> "systems/daggerheart/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs" damage=critDamage isCritical=true }}
|
||||
{{else}}
|
||||
{{> "systems/daggerheart/templates/dialogs/tagTeamDialog/parts/tagTeamDamageParts.hbs" damage=damage }}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<span class="hint">{{localize "DAGGERHEART.APPLICATIONS.TagTeamSelect.makeYourRoll"}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#if member.hasRolled}}
|
||||
<a class="select-roll-button" data-action="selectRoll" data-member-key="{{key}}">
|
||||
<i class="{{#if member.selected}}fa-solid fa-circle-check{{else}}fa-regular fa-circle inactive{{/if}}"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
</fieldset>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<div class="results-container">
|
||||
<span class="result-container-label">{{localize "DAGGERHEART.GENERAL.result.plural"}}</span>
|
||||
<div class="results-inner-container">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue