mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
new style for dialog roll and remove console.log debuggers (#272)
* new style for dialog roll and remove console.log debuggers * enhance advantage logic
This commit is contained in:
parent
0add5f369e
commit
41181f19f1
50 changed files with 682 additions and 233 deletions
24
templates/dialogs/dice-roll/costSelection.hbs
Normal file
24
templates/dialogs/dice-roll/costSelection.hbs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<div>
|
||||
{{#if uses}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label for="uses.enabled">Uses: {{uses.value}}/{{uses.max}}</label>
|
||||
<input name="uses.enabled" type="checkbox"{{#if uses.enabled}} checked{{/if}}>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#each costs as | cost index |}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label for="{{type}}">{{type}}: {{total}}</label>
|
||||
<input name="costs.{{index}}.enabled" type="checkbox"{{#if enabled}} checked{{/if}}>
|
||||
{{#if scalable}}
|
||||
<input type="range" value="{{scale}}" min="1" max="10" step="{{step}}" name="costs.{{index}}.scale">
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{!-- <footer>
|
||||
<button data-action="sendCost"{{#unless canUse}} disabled{{/unless}}>Accept</button>
|
||||
</footer> --}}
|
||||
</div>
|
||||
33
templates/dialogs/dice-roll/damageSelection.hbs
Normal file
33
templates/dialogs/dice-roll/damageSelection.hbs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<div>
|
||||
<div class="form-group">
|
||||
<label><strong>{{title}}</strong></label>
|
||||
<div class="form-fields">
|
||||
{{!-- <input type="text" value="{{formula}}" disabled /> --}}
|
||||
<div>{{@root.formula}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" value="{{extraFormula}}" name="extraFormula" placeholder="Situational Bonus">
|
||||
</div>
|
||||
</div>
|
||||
{{!-- {{#each bonusDamage as |damage index|}}
|
||||
<div class="form-group">
|
||||
<label><strong>{{damage.description}}</strong></label>
|
||||
<div class="form-fields">
|
||||
<label>Enabled</label>
|
||||
<input style="align-self: baseline;" type="checkbox" name="bonusDamage.{{index}}.initiallySelected" {{checked damage.initiallySelected}} />
|
||||
{{#if (and damage.initiallySelected damage.hopeIncrease)}}
|
||||
|
||||
<label>Hope</label>
|
||||
<div class="hope-container">
|
||||
<i data-action="decreaseHopeUse" data-index="{{index}}" class="fa-solid fa-caret-left icon-button {{#if (eq damage.hopeUses 0)}}disabled{{/if}}"></i>
|
||||
<div>{{damage.hopeUses}}</div>
|
||||
<i data-action="increaseHopeUse" data-index="{{index}}" class="fa-solid fa-caret-right icon-button {{#if (eq ../hopeUsed ../hope)}}disabled{{/if}}"></i>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}} --}}
|
||||
<footer>
|
||||
<button data-action="submitRoll">Roll</button>
|
||||
</footer>
|
||||
</div>
|
||||
7
templates/dialogs/dice-roll/header.hbs
Normal file
7
templates/dialogs/dice-roll/header.hbs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<header class="dialog-header">
|
||||
{{#if rollConfig.headerTitle}}
|
||||
<h1>{{rollConfig.headerTitle}}</h1>
|
||||
{{else}}
|
||||
<h1>{{rollConfig.title}}</h1>
|
||||
{{/if}}
|
||||
</header>
|
||||
126
templates/dialogs/dice-roll/rollSelection.hbs
Normal file
126
templates/dialogs/dice-roll/rollSelection.hbs
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
<div>
|
||||
{{#if @root.hasRoll}}
|
||||
<div class="roll-dialog-container">
|
||||
{{#unless @root.isLite}}
|
||||
<div class="dices-section">
|
||||
{{#if (eq @root.rollType 'D20Roll')}}
|
||||
<div class="dice-option">
|
||||
<img class="dice-icon" src="{{concat 'systems/daggerheart/assets/icons/dice/default/' @root.roll.d20.denomination '.svg'}}" alt="">
|
||||
<div class="dice-select">
|
||||
<select name="roll.dice.d20">
|
||||
{{selectOptions diceOptions selected=@root.roll.d20.denomination}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{#if @root.advantage}}
|
||||
{{#if (eq @root.advantage 1)}}
|
||||
<div class="dice-option">
|
||||
<img class="dice-icon" src="{{concat 'systems/daggerheart/assets/icons/dice/adv/' @root.roll.d20.denomination '.svg'}}" alt="">
|
||||
<div class="dice-select">
|
||||
<span class="label">Advantage</span>
|
||||
</div>
|
||||
</div>
|
||||
{{else if (eq @root.advantage -1)}}
|
||||
<div class="dice-option">
|
||||
<img class="dice-icon" src="{{concat 'systems/daggerheart/assets/icons/dice/disadv/' @root.roll.d20.denomination '.svg'}}" alt="">
|
||||
<div class="dice-select">
|
||||
<span class="label">Disdvantage</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if (eq @root.rollType 'DualityRoll')}}
|
||||
<div class="dice-option">
|
||||
<img class="dice-icon" src="{{concat 'systems/daggerheart/assets/icons/dice/hope/' @root.roll.dHope.denomination '.svg'}}" alt="">
|
||||
<div class="dice-select">
|
||||
<span class="label">Hope</span>
|
||||
<select name="roll.dice.dHope">
|
||||
{{selectOptions diceOptions selected=@root.roll.dHope.denomination}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dice-option">
|
||||
<img class="dice-icon" src="{{concat 'systems/daggerheart/assets/icons/dice/fear/' @root.roll.dFear.denomination '.svg'}}" alt="">
|
||||
<div class="dice-select">
|
||||
<span class="label">Fear</span>
|
||||
<select name="roll.dice.dFear">
|
||||
{{selectOptions diceOptions selected=@root.roll.dFear.denomination}}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{#if @root.advantage}}
|
||||
{{#if (eq @root.advantage 1)}}
|
||||
<div class="dice-option">
|
||||
<img class="dice-icon" src="{{concat 'systems/daggerheart/assets/icons/dice/adv/' @root.roll.dAdvantage.denomination '.svg'}}" alt="">
|
||||
<div class="dice-select">
|
||||
<span class="label">Advantage</span>
|
||||
</div>
|
||||
</div>
|
||||
{{else if (eq @root.advantage -1)}}
|
||||
<div class="dice-option">
|
||||
<img class="dice-icon" src="{{concat 'systems/daggerheart/assets/icons/dice/disadv/' @root.roll.dAdvantage.denomination '.svg'}}" alt="">
|
||||
<div class="dice-select">
|
||||
<span class="label">Disdvantage</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<fieldset class="experience-container">
|
||||
<legend>Experiences</legend>
|
||||
{{#each experiences}}
|
||||
{{#if name}}
|
||||
<div class="experience-chip {{#if (includes ../selectedExperiences id)}}selected{{/if}}" data-action="selectExperience" data-key="{{id}}">
|
||||
{{#if (includes ../selectedExperiences id)}}
|
||||
<span><i class="fa-solid fa-circle"></i></span>
|
||||
{{else}}
|
||||
<span><i class="fa-regular fa-circle"></i></span>
|
||||
{{/if}}
|
||||
{{#if (eq @root.rollType 'D20Roll')}}
|
||||
<span class="label">{{name}} +{{modifier}}</span>
|
||||
{{else}}
|
||||
<span class="label">{{name}} +{{value}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</fieldset>
|
||||
<fieldset class="modifier-container one-column">
|
||||
<legend>Modifiers</legend>
|
||||
<div class="nest-inputs">
|
||||
<button class="advantage-chip flex1 {{#if (eq advantage 1)}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="1">
|
||||
{{#if (eq advantage 1)}}
|
||||
<span><i class="fa-solid fa-circle"></i></span>
|
||||
{{else}}
|
||||
<span><i class="fa-regular fa-circle"></i></span>
|
||||
{{/if}}
|
||||
<span class="label">{{localize "DAGGERHEART.General.Advantage.Full"}}</span>
|
||||
</button>
|
||||
<button class="disadvantage-chip flex1 {{#if (eq advantage -1)}}selected{{/if}}" data-action="updateIsAdvantage" data-advantage="-1">
|
||||
{{#if (eq advantage -1)}}
|
||||
<span><i class="fa-solid fa-circle"></i></span>
|
||||
{{else}}
|
||||
<span><i class="fa-regular fa-circle"></i></span>
|
||||
{{/if}}
|
||||
<span class="label">{{localize "DAGGERHEART.General.Disadvantage.Full"}}</span>
|
||||
</button>
|
||||
{{#unless (eq @root.rollType 'D20Roll')}}
|
||||
<select name="roll.dice.advantageFaces">
|
||||
{{selectOptions diceOptions selected=@root.roll.dAdvantage.denomination}}
|
||||
</select>
|
||||
{{/unless}}
|
||||
</div>
|
||||
<input type="text" value="{{extraFormula}}" name="extraFormula" placeholder="Situational Bonus">
|
||||
</fieldset>
|
||||
{{/unless}}
|
||||
<span class="formula-label"><b>Formula:</b> {{@root.formula}}</span>
|
||||
<button class="sunmit-btn" data-action="submitRoll"{{#unless canRoll}} disabled{{/unless}}>
|
||||
<i class="fa-solid fa-dice"></i>
|
||||
<span class="label">Roll</span>
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue