- Closes #71
- Improves dice rolling and attribute reset logic
This commit is contained in:
Megastruktur 2020-09-02 11:16:38 +03:00
parent 4a5fa5f7b7
commit d7504598b4
8 changed files with 72 additions and 40 deletions

View file

@ -1,3 +1,6 @@
v2.1
- Minor css improvements
v2.0
- Refactored the Stress to have dynamic Max value
- Added Hull

View file

@ -149,6 +149,22 @@ Hooks.once("init", async function() {
return accum;
});
// "N Times" loop for handlebars.
// Block is executed N times starting from n=0.
//
// Usage:
// {{#times_from_0 10}}
// <span>{{this}}</span>
// {{/times_from_0}}
Handlebars.registerHelper('times_from_0', function(n, block) {
var accum = '';
for (var i = 0; i <= n; ++i) {
accum += block.fn(i);
}
return accum;
});
});
/**

View file

@ -35,8 +35,11 @@
width: auto;
height: auto;
background-image: none !important;
background: $almost_black !important;
margin-right: 0px;
color: $almost_white;
i {
margin-top: 4px;
}
}
@if $changeable {

View file

@ -238,6 +238,14 @@ $hover-brightness: 0.8;
}
#character-stress {
label {
&[for$="-0"] {
margin-right: 0px;
}
}
}
// Abilities
#abilities {

View file

@ -209,8 +209,10 @@
width: auto;
height: auto;
background-image: none !important;
background: #191813 !important;
margin-right: 0px;
color: #EEEFFF;
}
* .big-teeth-section .big-teeth label[for$="-0"] i {
margin-top: 4px;
}
* .big-teeth-section .big-teeth label:hover {
filter: brightness(0.8);
@ -246,8 +248,10 @@
width: auto;
height: auto;
background-image: none !important;
background: #191813 !important;
margin-right: 0px;
color: #EEEFFF;
}
* .big-teeth-section .small-teeth-container .small-teeth-wrap label[for$="-0"] i {
margin-top: 4px;
}
* .big-teeth-section .small-teeth-container .small-teeth-wrap input {
display: none;
@ -294,6 +298,9 @@
text-decoration: none;
font-weight: bold;
}
* #character-stress label[for$="-0"] {
margin-right: 0px;
}
* #abilities .item-name {
width: 70px;
}
@ -330,8 +337,10 @@
width: auto;
height: auto;
background-image: none !important;
background: #191813 !important;
margin-right: 0px;
color: #EEEFFF;
}
* .teeth-experience label[for$="-0"] i {
margin-top: 4px;
}
* .teeth-experience label:hover {
filter: brightness(0.8);
@ -466,8 +475,10 @@
width: auto;
height: auto;
background-image: none !important;
background: #191813 !important;
margin-right: 0px;
color: #EEEFFF;
}
* #attributes .attributes-exp .stripe-tooth-body label[for$="-0"] i {
margin-top: 4px;
}
* #attributes .attributes-exp .stripe-tooth-body label:hover {
filter: brightness(0.8);
@ -668,8 +679,10 @@
width: auto;
height: auto;
background-image: none !important;
background: #191813 !important;
margin-right: 0px;
color: #EEEFFF;
}
* #crew-reputation label[for$="-0"] i {
margin-top: 4px;
}
* #crew-reputation label:hover {
filter: brightness(0.8);

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
"name": "blades-in-the-dark",
"title": "Blades in the Dark",
"description": "Blades in the dark game system.",
"version": "2.0",
"version": "2.1",
"minimumCoreVersion": "0.5.3",
"compatibleCoreVersion": "0.7.2",
"templateVersion": 1,
@ -26,8 +26,8 @@
}
],
"url": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/",
"manifest": "https://raw.githubusercontent.com/megastruktur/foundryvtt-blades-in-the-dark/2.0/system.json",
"download": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/archive/2.0.zip",
"manifest": "https://raw.githubusercontent.com/megastruktur/foundryvtt-blades-in-the-dark/2.1/system.json",
"download": "https://github.com/megastruktur/foundryvtt-blades-in-the-dark/archive/2.1.zip",
"packs": [
{
"name": "class",

View file

@ -5,23 +5,17 @@
<div id="attributes-{{attribute_name}}" class="attribute">
<div id="attributes-{{attribute_name}}-title" class="attributes-exp">
<div class="stripe">
<label class="attribute-label roll-die-attribute rollable-text" data-roll-attribute="{{attribute_name}}" for="{{attribute_name}}-exp-0">{{localize attribute.label}}</label>
<a class="attribute-label roll-die-attribute rollable-text" data-roll-attribute="{{attribute_name}}">{{localize attribute.label}}</a>
</div>
<div class="stripe-tooth-body">
{{#multiboxes attribute.exp}}
<label for="{{attribute_name}}-exp-0"><i class="fab fa-creative-commons-zero"></i></label>
<input type="radio" id="{{attribute_name}}-exp-0" name="data.attributes.{{attribute_name}}.exp" value="0" checked="checked">
<input type="radio" id="{{attribute_name}}-exp-1" name="data.attributes.{{attribute_name}}.exp" value="1">
<label for="{{attribute_name}}-exp-1"></label>
<input type="radio" id="{{attribute_name}}-exp-2" name="data.attributes.{{attribute_name}}.exp" value="2">
<label for="{{attribute_name}}-exp-2"></label>
<input type="radio" id="{{attribute_name}}-exp-3" name="data.attributes.{{attribute_name}}.exp" value="3">
<label for="{{attribute_name}}-exp-3"></label>
<input type="radio" id="{{attribute_name}}-exp-4" name="data.attributes.{{attribute_name}}.exp" value="4">
<label for="{{attribute_name}}-exp-4"></label>
<input type="radio" id="{{attribute_name}}-exp-5" name="data.attributes.{{attribute_name}}.exp" value="5">
<label for="{{attribute_name}}-exp-5"></label>
<input type="radio" id="{{attribute_name}}-exp-6" name="data.attributes.{{attribute_name}}.exp" value="6">
<label for="{{attribute_name}}-exp-6"></label>
{{#times_from_1 6}}
<input type="radio" id="{{attribute_name}}-exp-{{this}}" name="data.attributes.{{attribute_name}}.exp" value="{{this}}">
<label for="{{attribute_name}}-exp-{{this}}"></label>
{{/times_from_1}}
{{/multiboxes}}
</div>
</div>
@ -32,17 +26,12 @@
<div class="flex-horizontal">
<div class="attributes-container">
{{#multiboxes skill.value}}
<input type="radio" id="attributes-{{skill_name}}-0" name="data.attributes.{{attribute_name}}.skills.{{skill_name}}.value" value="0">
<label for="attributes-{{skill_name}}-0"></label>
<input type="radio" id="attributes-{{skill_name}}-1" name="data.attributes.{{attribute_name}}.skills.{{skill_name}}.value" value="1">
<label for="attributes-{{skill_name}}-1"></label>
<span>|</span>
<input type="radio" id="attributes-{{skill_name}}-2" name="data.attributes.{{attribute_name}}.skills.{{skill_name}}.value" value="2">
<label for="attributes-{{skill_name}}-2"></label>
<input type="radio" id="attributes-{{skill_name}}-3" name="data.attributes.{{attribute_name}}.skills.{{skill_name}}.value" value="3">
<label for="attributes-{{skill_name}}-3"></label>
<input type="radio" id="attributes-{{skill_name}}-4" name="data.attributes.{{attribute_name}}.skills.{{skill_name}}.value" value="4">
<label for="attributes-{{skill_name}}-4"></label>
{{#times_from_0 4}}
<input type="radio" id="attributes-{{skill_name}}-{{this}}" name="data.attributes.{{attribute_name}}.skills.{{skill_name}}.value" value="{{this}}">
<label for="attributes-{{skill_name}}-{{this}}"></label>
{{/times_from_0}}
<div class="attribute-skill-label roll-die-attribute rollable-text" data-roll-attribute="{{skill_name}}">{{localize skill.label}}</div>
{{/multiboxes}}
</div>