Skip to content

Commit

Permalink
fix: dialog labels should't wrap inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin9257 committed Nov 21, 2024
1 parent 0de0cae commit fd71ab3
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 166 deletions.
4 changes: 2 additions & 2 deletions src/module/entities/TwodsixActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@ async function getMoveNumber(itemData:TwodsixItem): Promise <number> {
window: {title: "TWODSIX.Actor.Items.QuantityToTransfer"},
content:
`<div style="display: flex; align-items: center; gap: 2ch; justify-content: center;"><img src="` + itemData.img + `" data-tooltip = "` + itemData.name +`" width="50" height="50"> ` + itemData.name + `</div>`+
`<div><label for='amount'>` + game.i18n.localize("TWODSIX.Actor.Items.Amount") + `<input type="number" name="amount" value="` +
itemData.system.quantity + `" max="` + itemData.system.quantity + `" min = "0"></input></label></div>`,
`<div><label for='amount'>` + game.i18n.localize("TWODSIX.Actor.Items.Amount") + `</label><input type="number" name="amount" value="` +
itemData.system.quantity + `" max="` + itemData.system.quantity + `" min = "0"></input></div>`,
buttons: [
{
action: "Transfer",
Expand Down
5 changes: 3 additions & 2 deletions static/styles/twodsix.css
Original file line number Diff line number Diff line change
Expand Up @@ -1834,7 +1834,7 @@ input.item-value-edit, input.joat-skill-input {
gap: 1px;
}

select.select-mod {
/*select.select-mod {
width: 6em;
margin-left: 1em;
}
Expand All @@ -1847,7 +1847,7 @@ select.select-difficulty {
select.select-rolltype {
width: 10em;
margin-left: 1em;
}
}*/

span.total-output {
text-align: center;
Expand Down Expand Up @@ -4108,6 +4108,7 @@ multi-select.actor-sheet select {
.standard-form .form-group > label {
color: var(--s2d6-default-color);
font-weight: normal;
flex: 2 1 0%;
}

.filepicker .favorites .path a.link[data-source]::before {
Expand Down
96 changes: 47 additions & 49 deletions static/templates/actors/damage-dialog.html
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
<form>
<div class="standard-form damage-dialog">
{{#with stats}}
<div class = "form-group">
<label>{{localize "TWODSIX.Damage.DamageCalculation"}}
<table class="damage-table center-table-text">
<thead class="centre">
<tr>
<th>{{localize "TWODSIX.Damage.Damage"}}</th>
{{#unless useCUData}}
<th>{{localize "TWODSIX.Items.Armor.PrimaryArmor"}}</th>
<th>{{localize "TWODSIX.Items.Armor.SecondaryArmor"}}</th>
<div class = "">
<label>{{localize "TWODSIX.Damage.DamageCalculation"}} </label>
<table class="damage-table center-table-text">
<thead class="centre">
<tr>
<th>{{localize "TWODSIX.Damage.Damage"}}</th>
{{#unless useCUData}}
<th>{{localize "TWODSIX.Items.Armor.PrimaryArmor"}}</th>
<th>{{localize "TWODSIX.Items.Armor.SecondaryArmor"}}</th>
{{else}}
<th>{{localize "TWODSIX.Items.Armor.Armor"}}</th>
{{#if canOnlyBeBlocked}}
<th>{{localize "TWODSIX.Items.Weapon.ShieldAV"}}</th>
{{else}}
<th>{{localize "TWODSIX.Items.Armor.Armor"}}</th>
{{#if canOnlyBeBlocked}}
<th>{{localize "TWODSIX.Items.Weapon.ShieldAV"}}</th>
{{else}}
<th>{{localize "TWODSIX.Items.Weapon.ParryAV"}}</th>
{{/if}}
{{/unless}}
<th>{{localize "TWODSIX.Actor.Items.EffectiveArmor"}}</th>
<th>{{localize "TWODSIX.Damage.TotalDamage"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="number" value="{{damageValue}}" class="damage"></td>
{{#unless useCUData}}
<td><input type="number" value="{{primaryArmor}}" class="armor" readonly></td>
{{/unless}}
<td><input type="number" value="{{secondaryArmor}}" class="armor" readonly></td>
{{#if useCUData}}
<td><input type="number" value="{{parryArmor}}" class="armor" readonly></td>
<th>{{localize "TWODSIX.Items.Weapon.ParryAV"}}</th>
{{/if}}
<td><input type="number" value="{{effectiveArmor}}" class="armor"></td>
<td class="applied-damage"></td>
</tr>
{{#iff damageLabel "!==" "---"}}
<tr>
<td>({{localize damageLabel}})</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
{{/iff}}
</tbody>
</table>
</label>
{{/unless}}
<th>{{localize "TWODSIX.Actor.Items.EffectiveArmor"}}</th>
<th>{{localize "TWODSIX.Damage.TotalDamage"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="number" value="{{damageValue}}" class="damage"></td>
{{#unless useCUData}}
<td><input type="number" value="{{primaryArmor}}" class="armor" readonly></td>
{{/unless}}
<td><input type="number" value="{{secondaryArmor}}" class="armor" readonly></td>
{{#if useCUData}}
<td><input type="number" value="{{parryArmor}}" class="armor" readonly></td>
{{/if}}
<td><input type="number" value="{{effectiveArmor}}" class="armor"></td>
<td class="applied-damage"></td>
</tr>
{{#iff damageLabel "!==" "---"}}
<tr>
<td>({{localize damageLabel}})</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
{{/iff}}
</tbody>
</table>
</div>
<div class = "form-group">
<label>{{localize "TWODSIX.Damage.Characteristics"}}
<div class = "">
<label>{{localize "TWODSIX.Damage.Characteristics"}}</label>
<table class="damage center-table-text">
<thead class="centre">
<tr>
Expand Down Expand Up @@ -115,12 +114,11 @@
{{/if}}
</tbody>
</table>
</label>
</div>
<div class = "form-group">
<div class = "">
<span class="unalocated-damage-text">{{localize "TWODSIX.Damage.UnallocatedDamage"}}: <span class="unalocated-damage"></span></span>
</div>
<div class = "form-group">
<div class = "">
<span class="character-dead red">{{localize "TWODSIX.Damage.CharacterIsDead"}}</span>
</div>
{{/with}}
Expand Down
29 changes: 13 additions & 16 deletions static/templates/chat/initiative-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,25 @@
<fieldset>
<legend>{{localize "TWODSIX.Chat.Roll.RollDetails"}}</legend>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.Type"}}
<select name="rollType">
{{selectOptions rollTypes selected=rollType}}
</select>
</label>
<label>{{localize "TWODSIX.Chat.Roll.Type"}}</label>
<select name="rollType">
{{selectOptions rollTypes selected=rollType}}
</select>
</div>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.OtherModifiers"}}
<input type="number" name="diceModifier" value="{{diceModifier}}" placeholder="0" onClick="this.select();" style="width: 8ch;"/>
</label>
<label>{{localize "TWODSIX.Chat.Roll.OtherModifiers"}}</label>
<input type="number" name="diceModifier" value="{{diceModifier}}" placeholder="0" onClick="this.select();" style="width: 8ch;"/>

</div>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.Mode"}}
<select name="rollMode">
{{selectOptions rollModes selected="publicroll" localize=true}}
</select>
</label>
<label>{{localize "TWODSIX.Chat.Roll.Mode"}}</label>
<select name="rollMode">
{{selectOptions rollModes selected="publicroll" localize=true}}
</select>
</div>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.RollFormula"}}
<input type="text" name="rollFormula" value="{{rollFormula}}" placeholder="" onClick="this.select();" />
</label>
<label>{{localize "TWODSIX.Chat.Roll.RollFormula"}}</label>
<input type="text" name="rollFormula" value="{{rollFormula}}" placeholder="" onClick="this.select();" />
</div>
</fieldset>
</form>
46 changes: 20 additions & 26 deletions static/templates/chat/request-roll-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,41 @@
<fieldset>
<legend>{{localize "TWODSIX.Chat.Roll.RollDetails"}}</legend>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.Difficulty"}}
<select name="difficulty">
{{selectOptions difficultyList selected=difficulty}}
</select>
</label>
<label>{{localize "TWODSIX.Chat.Roll.Difficulty"}}</label>
<select name="difficulty">
{{selectOptions difficultyList selected=difficulty}}
</select>
</div>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.Type"}}
<select name="rollType">
{{selectOptions rollTypes selected=rollType}}
</select>
</label>
<label>{{localize "TWODSIX.Chat.Roll.Type"}}</label>
<select name="rollType">
{{selectOptions rollTypes selected=rollType}}
</select>
</div>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.Mode"}}
<select name="rollMode">
{{selectOptions rollModes selected=rollMode localize=true}}
</select>
</label>
<label>{{localize "TWODSIX.Chat.Roll.Mode"}}</label>
<select name="rollMode">
{{selectOptions rollModes selected=rollMode localize=true}}
</select>
</div>
</fieldset>
<fieldset>
<legend>{{localize "TWODSIX.Chat.Roll.RollModifiers"}}</legend>
<div class="form-group">
<label>{{localize "TWODSIX.Actor.Skills.SkillName"}}
<select class="select-skill" name="selectedSkill">
<label>{{localize "TWODSIX.Actor.Skills.SkillName"}}</label>
<select class="select-skill" name="selectedSkill">
{{selectOptions skillsList selected=initialSkill}}
</select>
</label>
</select>
</div>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.CharacteristicModifier"}}
<select class="select-mod" name="characteristic">
<label>{{localize "TWODSIX.Chat.Roll.CharacteristicModifier"}}</label>
<select class="select-mod" name="characteristic">
{{selectOptions characteristicList selected=initialChoice}}
</select>
</label>
</select>
</div>
<div class="form-group">
<label>{{localize "TWODSIX.Chat.Roll.OtherModifiers"}}
<input type="number" name="other" value="{{other}}" placeholder="0" onClick="this.select();" style="width: 8ch;"/>
</label>
<label>{{localize "TWODSIX.Chat.Roll.OtherModifiers"}}</label>
<input type="number" name="other" value="{{other}}" placeholder="0" onClick="this.select();" style="width: 8ch;"/>
</div>
</fieldset>
</div>
Expand Down
Loading

0 comments on commit fd71ab3

Please sign in to comment.