Nemesis v1.1 (#4718)

* SR 1.41 - fixed modifier,edge,wound buttons

* CSS update for French & Spanish

* Dice roller, Wounds improvement (#14)
This commit is contained in:
Cassie Levett
2019-02-19 07:11:03 -06:00
committed by GitHub
parent a81bebe695
commit dfebdc4a87
2 changed files with 155 additions and 84 deletions
+53 -35
View File
@@ -117,16 +117,19 @@
display: inline-block;}
div.sheet-tabs div:nth-of-type(1) {
margin-right: 2em;
width: 20%;}
margin-right: 1%;
width: 18%;}
div.sheet-tabs div:nth-of-type(2) {
margin-right: 2em;
width: 25%;}
margin-right: 2%;
width: 22%;}
div.sheet-tabs div:nth-of-type(3) {
padding: 1%;
width: 16%;}
margin-right: 1%;
width: 45%;}
div.sheet-tabs div:nth-of-type(4) {
width: 9%;}
div.sheet-tabs h1 {
color: #39201e;
@@ -143,6 +146,26 @@
input.sheet-whisper-toggle + button {
font-family: "pictos";}
div.sheet-diceroller {
display: inline;}
div.sheet-diceroller button {
border: 1px solid black;
box-shadow: inset 0 0 8px 3px #ccc;
text-transform: uppercase;}
div.sheet-diceroller label {
width: fit-content;}
div.sheet-diceroller input[type="number"] {
maring-left : 2%;
maring-right: 2%;
text-align : center;}
div.sheet-diceroller input[type="text"] {
margin-right: 1%;
width: 60%;}
/**********************************************************************************************************/
/*************************** PC ***************************/
/********************************************************************************************************/
@@ -200,16 +223,23 @@
text-transform: capitalize;
width : 25%;}
div.sheet-wounds input[type="radio"] {
cursor : pointer;
height : 20px;
left : 11px;
margin : -10px;
opacity : 0;
position: relative;
top : -5px;
width : 20px;
z-index : 1;}
div.sheet-wounds input[type="hidden"] + button {
display : inline-block;
height : 20px;
border : solid 1px #a8a8a8;
border-radius: 50%;
margin-right : 1%;
width : 20px;}
div.sheet-wounds input[type="hidden"][value="0"] + button {
background: #33333305;
box-shadow: inset 0 0 8px 3px #ccc;}
div.sheet-wounds input[type="hidden"][value="1"] + button {
background: #3333336e;}
div.sheet-wounds input[type="hidden"][value="2"] + button {
background: #333;}
/* STAST section */
div.sheet-stats {
@@ -235,7 +265,6 @@
background: #929082;}
/* Fake radio */
div.sheet-wounds input[type="radio"] + span::before,
div.sheet-meters input[type="radio"] + span::before {
background : #333;
border : solid 1px #a8a8a8;
@@ -263,8 +292,6 @@
border-color: #658160;}
/* Remove dot from all radios _after_ selected one */
div.sheet-wounds input[type="radio"]:checked ~ input[type="radio"] + span::before,
div.sheet-wounds input[type="hidden"][value="0"] ~ span::before,
div.sheet-meters input[type="radio"]:checked ~ input[type="radio"] + span::before,
div.sheet-meters input[type="hidden"][value="0"] ~ span::before {
background: #f6f6f6;
@@ -610,39 +637,30 @@
text-transform : capitalize;}
.sheet-rolltemplate-rolls .sheet-template-row {
background-color: #555;
}
background-color: #555;}
/* Use this to alternate the background colors for each row */
.sheet-rolltemplate-rolls .sheet-template-row:nth-child(2n+0) {
background-color: #1c1c1c;
}
background-color: #1c1c1c;}
/* Remove some fo the built in styles around rolls */
.sheet-rolltemplate-rolls .inlinerollresult {
background-color: transparent;
border : none;
color : black;
color : white;
display :inline-block;
font-size : 25px;
padding : 5px;
}
padding : 5px;}
.sheet-rolltemplate-rolls .inlinerollresult.fullfail,
.sheet-rolltemplate-rolls .inlinerollresult.fullcrit,
.sheet-rolltemplate-rolls.inlinerollresult.importantroll {
border: none;
}
border: none;}
/* Change the colors of Full Fails & Full Crits from their built in defaults */
.sheet-rolltemplate-rolls .inlinerollresult.fullfail {
color: white;
}
.sheet-rolltemplate-rolls .inlinerollresult.fullfail,
.sheet-rolltemplate-rolls .inlinerollresult.fullcrit {
color: white;
}
color: white;}
/**********************************************************************************************************/
/*************************** FIREFOX ***************************/
+102 -49
View File
@@ -10,6 +10,11 @@
<div>
<h2>Role Playing in World of Horrors</h2>
</div>
<div class="diceroller">
<label>D10s</label><input name="attr_d10s" max="10" `min="1" type="number" value="1" />
<button type="roll" value="@{gm_toggle} &{template:rolls}{{header=d10s}}@{dicepool}{{desc=@{roll_description})}">Roll</button>
<input name="attr_roll_description" placeholder="Roll description" type="text" value="" />
</div>
<div>
<button type="action" name="act_sheet_toggle_pc">PC</button>
<button type="action" name="act_sheet_toggle_npc">NPC</button>
@@ -20,7 +25,6 @@
<!--*************************** PC SHEET ***************************-->
<!--*********************************************************************************************************-->
<div class="pc">
<!--<button type="roll" value="@{gm_toggle} &{template:rolls}{{header=Title}}{{dice=[[1d20]]}}{{desc=Some Text}}">A Button</button>-->
<div class="info-row">
<div class="flexcol details">
<div>
@@ -55,57 +59,52 @@
<div class="wounds">
<div>
<button name="act_reset_wound_head" type="action">head (10)</button>
<input name="attr_wound_head" type="hidden" value="0" />
<input name="attr_wound_head" title="@{wound_head}" type="radio" value="1" /><span></span>
<input name="attr_wound_head" title="@{wound_head}" type="radio" value="2" /><span></span>
<input name="attr_wound_head" title="@{wound_head}" type="radio" value="3" /><span></span>
<input name="attr_wound_head" title="@{wound_head}" type="radio" value="4" /><span></span>
<input name="attr_wound_head_1" type="hidden" value="0" /><button name="act_wound_head_1" type="action"></button>
<input name="attr_wound_head_2" type="hidden" value="0" /><button name="act_wound_head_2" type="action"></button>
<input name="attr_wound_head_3" type="hidden" value="0" /><button name="act_wound_head_3" type="action"></button>
<input name="attr_wound_head_4" type="hidden" value="0" /><button name="act_wound_head_4" type="action"></button>
</div>
<div>
<button name="act_reset_wound_body" type="action">body (7-9)</button>
<input name="attr_wound_body" type="hidden" value="0" />
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="1" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="2" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="3" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="4" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="5" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="6" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="7" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="8" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="9" /><span></span>
<input name="attr_wound_body" title="@{wound_body}" type="radio" value="10" /><span></span>
<input name="attr_wound_body_1" type="hidden" value="0" /><button name="act_wound_body_1" type="action"></button>
<input name="attr_wound_body_2" type="hidden" value="0" /><button name="act_wound_body_2" type="action"></button>
<input name="attr_wound_body_3" type="hidden" value="0" /><button name="act_wound_body_3" type="action"></button>
<input name="attr_wound_body_4" type="hidden" value="0" /><button name="act_wound_body_4" type="action"></button>
<input name="attr_wound_body_5" type="hidden" value="0" /><button name="act_wound_body_5" type="action"></button>
<input name="attr_wound_body_6" type="hidden" value="0" /><button name="act_wound_body_6" type="action"></button>
<input name="attr_wound_body_7" type="hidden" value="0" /><button name="act_wound_body_7" type="action"></button>
<input name="attr_wound_body_8" type="hidden" value="0" /><button name="act_wound_body_8" type="action"></button>
<input name="attr_wound_body_9" type="hidden" value="0" /><button name="act_wound_body_9" type="action"></button>
<input name="attr_wound_body_10" type="hidden" value="0" /><button name="act_wound_body_10" type="action"></button>
</div>
<div>
<button name="act_reset_wound_right_arm" type="action">right arm (5-6)</button>
<input name="attr_wound_right_arm" type="hidden" value="0" />
<input name="attr_wound_right_arm" title="@{wound_right_arm}" type="radio" value="1" /><span></span>
<input name="attr_wound_right_arm" title="@{wound_right_arm}" type="radio" value="2" /><span></span>
<input name="attr_wound_right_arm" title="@{wound_right_arm}" type="radio" value="3" /><span></span>
<input name="attr_wound_right_arm" title="@{wound_right_arm}" type="radio" value="4" /><span></span>
<input name="attr_wound_right_arm" title="@{wound_right_arm}" type="radio" value="5" /><span></span>
<input name="attr_wound_right_arm_1" type="hidden" value="0" /><button name="act_wound_right_arm_1" type="action"></button>
<input name="attr_wound_right_arm_2" type="hidden" value="0" /><button name="act_wound_right_arm_2" type="action"></button>
<input name="attr_wound_right_arm_3" type="hidden" value="0" /><button name="act_wound_right_arm_3" type="action"></button>
<input name="attr_wound_right_arm_4" type="hidden" value="0" /><button name="act_wound_right_arm_4" type="action"></button>
<input name="attr_wound_right_arm_5" type="hidden" value="0" /><button name="act_wound_right_arm_5" type="action"></button>
</div>
<div>
<button name="act_reset_wound_left_arm" type="action">left arm (3-4)</button>
<input name="attr_wound_left_arm" type="hidden" value="0" />
<input name="attr_wound_left_arm" title="@{wound_left_arm}" type="radio" value="1" /><span></span>
<input name="attr_wound_left_arm" title="@{wound_left_arm}" type="radio" value="2" /><span></span>
<input name="attr_wound_left_arm" title="@{wound_left_arm}" type="radio" value="3" /><span></span>
<input name="attr_wound_left_arm" title="@{wound_left_arm}" type="radio" value="4" /><span></span>
<input name="attr_wound_left_arm" title="@{wound_left_arm}" type="radio" value="5" /><span></span>
<input name="attr_wound_left_arm_1" type="hidden" value="0" /><button name="act_wound_left_arm_1" type="action"></button>
<input name="attr_wound_left_arm_2" type="hidden" value="0" /><button name="act_wound_left_arm_2" type="action"></button>
<input name="attr_wound_left_arm_3" type="hidden" value="0" /><button name="act_wound_left_arm_3" type="action"></button>
<input name="attr_wound_left_arm_4" type="hidden" value="0" /><button name="act_wound_left_arm_4" type="action"></button>
<input name="attr_wound_left_arm_5" type="hidden" value="0" /><button name="act_wound_left_arm_5" type="action"></button>
</div>
<div>
<button name="act_reset_wound_legs" type="action">legs (2)</button>
<input name="attr_wound_legs" type="hidden" value="0" />
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="1" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="2" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="3" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="4" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="5" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="6" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="7" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="8" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="9" /><span></span>
<input name="attr_wound_legs" title="@{wound_legs}" type="radio" value="10" /><span></span>
<input name="attr_wound_legs_1" type="hidden" value="0" /><button name="act_wound_legs_1" type="action"></button>
<input name="attr_wound_legs_2" type="hidden" value="0" /><button name="act_wound_legs_2" type="action"></button>
<input name="attr_wound_legs_3" type="hidden" value="0" /><button name="act_wound_legs_3" type="action"></button>
<input name="attr_wound_legs_4" type="hidden" value="0" /><button name="act_wound_legs_4" type="action"></button>
<input name="attr_wound_legs_5" type="hidden" value="0" /><button name="act_wound_legs_5" type="action"></button>
<input name="attr_wound_legs_6" type="hidden" value="0" /><button name="act_wound_legs_6" type="action"></button>
<input name="attr_wound_legs_7" type="hidden" value="0" /><button name="act_wound_legs_7" type="action"></button>
<input name="attr_wound_legs_8" type="hidden" value="0" /><button name="act_wound_legs_8" type="action"></button>
<input name="attr_wound_legs_9" type="hidden" value="0" /><button name="act_wound_legs_9" type="action"></button>
<input name="attr_wound_legs_10" type="hidden" value="0" /><button name="act_wound_legs_10" type="action"></button>
</div>
</div>
<div class="stats">
@@ -496,7 +495,9 @@
<!--*********************************************************************************************************-->
<!--*************************** HIDDEN ATTRIBUTES ***************************-->
<!--*********************************************************************************************************-->
<input type="hidden" name="attr_version" value="1" />
<input name="attr_version" type="hidden" value="1.1" />
<input name="attr_dicepool" type="hidden" />
<input name="attr_gm_toggle" type="hidden" />
<!--*********************************************************************************************************-->
<!--*************************** ROLL TEMPLATE ***************************-->
@@ -509,9 +510,22 @@
</div>
<!--- Display the dice roll in the template --->
<div class="sheet-template-body">
{{#dice}}
<div class="sheet-template-row">{{dice}}</div>
{{/dice}}
{{#dice1}}
<div class="sheet-template-row">
<div class="sheet-template-dice">
{{dice1}}
{{#dice2}}{{dice2}}{{/dice2}}
{{#dice3}}{{dice3}}{{/dice3}}
{{#dice4}}{{dice4}}{{/dice4}}
{{#dice5}}{{dice5}}{{/dice5}}
{{#dice6}}{{dice6}}{{/dice6}}
{{#dice7}}{{dice7}}{{/dice7}}
{{#dice8}}{{dice8}}{{/dice8}}
{{#dice9}}{{dice9}}{{/dice9}}
{{#dice10}}{{dice10}}{{/dice10}}
</div>
</div>
{{/dice1}}
<!--- Display a description. This is great for text included with a roll --->
{{#desc}}
<div class="sheet-template-row">
@@ -529,14 +543,14 @@
<script type="text/worker">
['sheet_toggle_pc', 'sheet_toggle_npc'].forEach(attr => {
on(`clicked:${attr}`, function(eventinfo) {
on(`clicked:${attr}`, (eventinfo) => {
setAttrs({
sheet_type : eventinfo.triggerName.split("_")[2]
});
});
});
on("clicked:whisper", function(eventinfo) {
on("clicked:whisper", (eventinfo) => {
getAttrs(["gm_toggle"], function (v) {
setAttrs({
gm_toggle : (v.gm_toggle.includes("gm")) ? " " : "/w gm"
@@ -544,9 +558,9 @@ on("clicked:whisper", function(eventinfo) {
});
});
['wound_head', 'wound_body', `wound_right_arm`, `wound_left_arm`, `wound_legs`, `failed_violance`, `hardened_violance`, `failed_unnatural`, `hardened_unnatural`, `failed_self`, `hardened_self`, `hardened_helplessness`,`failed_helplessness` ].forEach(attr => {
on(`clicked:reset_${attr}`, function(eventinfo) {
const attr = eventinfo.triggerName.split("reset_")[1];
[`failed_violance`, `hardened_violance`, `failed_unnatural`, `hardened_unnatural`, `failed_self`, `hardened_self`, `hardened_helplessness`,`failed_helplessness` ].forEach(attr => {
on(`clicked:reset_${attr}`, (eventinfo) => {
const attr = eventinfo.triggerName.split("reset_")[1];
setAttrs({
[`${attr}`] : 0
@@ -554,5 +568,44 @@ on(`clicked:reset_${attr}`, function(eventinfo) {
});
});
['wound_head', 'wound_body', `wound_right_arm`, `wound_left_arm`, `wound_legs`].forEach(attr => {
on(`clicked:reset_${attr}`, (eventinfo) => {
const trigger = eventinfo.triggerName.split("reset_")[1];
const num = (trigger === "head") ? 4 : (trigger.includes("arm")) ? 5 : 10;
let update = [];
for (x = 1; x <= num; x++) {
update[`${trigger}_${x}`] = 0;
};
setAttrs(update);
});
});
['body','head','legs','right_arm','left_arm'].forEach(attr => {
on(`clicked:wound_${attr}_1 clicked:wound_${attr}_2 clicked:wound_${attr}_3 clicked:wound_${attr}_4 clicked:wound_${attr}_5 clicked:wound_${attr}_6 clicked:wound_${attr}_7 clicked:wound_${attr}_8 clicked:wound_${attr}_9 clicked:wound_${attr}_10`, (eventinfo) => {
const trigger = eventinfo.triggerName.split("clicked:")[1];
getAttrs([`${trigger}`], (v) => {
const value = (v[`${trigger}`] === 0) ? 1 : (v[`${trigger}`] === 1) ? 2 : 0;
setAttrs({
[`${trigger}`] : value
});
});
});
});
on("change:d10s", (eventinfo) => {
const d10s = eventinfo.newValue;
update_roll(d10s);
});
const update_roll = (d10s) => {
let pool = [], set = {};
for (x = 1; x <= d10s; x++) {
pool.push(`{{dice`.concat(x, `=[[1d10]]}}`));
};
set["dicepool"] = (pool.join());
setAttrs(set, {silent: true});
};
</script>