From 20a8b4ebe51cfb15c786937cc2fb580eaa81b5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodo=20H=C3=BCsemann?= Date: Wed, 26 Jan 2022 23:03:39 +0100 Subject: [PATCH] adding non-zero default values for new chars --- The One Ring 2e/sheet.css | 27 +++++-------------- The One Ring 2e/sheet.html | 54 ++++++++++++++------------------------ 2 files changed, 27 insertions(+), 54 deletions(-) diff --git a/The One Ring 2e/sheet.css b/The One Ring 2e/sheet.css index 1b4418edd7..fa5d57f1d0 100644 --- a/The One Ring 2e/sheet.css +++ b/The One Ring 2e/sheet.css @@ -33,7 +33,8 @@ font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif, sans-serif; font-weight: normal; } -.charsheet { +.charsheet, +.sheet-rolltemplate-tor { /* Define CSS variables */ --red: rgb(176, 33, 30); --gray: rgb(104, 104, 104); @@ -68,7 +69,7 @@ .charsheet .sheet-tabstoggle[value="isAdversary"] ~ div.sheet-adversary { display: block; } -/* Generic element styls */ +/* Generic element styles */ .charsheet :is(h1,h2,h3){ font-family: "Aniron", "Palatino Linotype", "Book Antiqua", Palatino, serif, sans-serif; font-weight: normal; @@ -222,30 +223,16 @@ input[type='radio'] { margin-right: 8px; font-family: "Aniron", "Palatino Linotype", "Book Antiqua", Palatino, serif, sans-serif; } -.charsheet .sheet-dots input[type="radio"]:checked ~ input[type="radio"] + span { - -background: url("https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/The%20One%20Ring/assets/images/square-empty.png") no-repeat; - -background-size:100%; -} .sheet-dots input[type='radio']:checked ~ input[type='radio'] + span:before { - -background: url("https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/The%20One%20Ring/assets/images/square-empty.png") no-repeat; background-size:100%; border: 2px solid #AC4637; background-color: transparent; transform: rotate(45deg); } -.charsheet .sheet-dots input[type="radio"]:not([value="0"]) + span { - -background: url("https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/The%20One%20Ring/assets/images/square-filled.png") no-repeat; - -background-size:100%; - -border: 2px solid #AC4637; - -background-color: transparent; - -transform: rotate(45deg); -} .sheet-dots input[type="radio"]:not([value="0"]) + span:before { - -background: url("https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/The%20One%20Ring/assets/images/square-filled.png") no-repeat; background-size:100%; border: 2px solid #AC4637; background-color: #AC4637; - -background-image: url('https://singlecolorimage.com/get/AC4637/10x10'); transform: rotate(45deg); } /* Remove dot from all radios _after_ selected one */ @@ -885,10 +872,10 @@ input[type='radio'] { margin-left: -7px; } .sheet-rolltemplate-tor .sheet-container { - background: url('https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/The%20One%20Ring%202e/assets/background1.webp'); + background: var(--background); background-color: #FEFCF0; border: 5px solid transparent; - border-image-source: url('https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/The%20One%20Ring%202e/assets/boxline-border-red.png'); + border-image-source: var(--borderred); border-image-slice: 8 8 8 8; border-image-repeat: repeat; } @@ -967,7 +954,7 @@ input[type='radio'] { justify-self: center; border: 4px solid transparent; background-color: #FEFCF0; - border-image-source: url('https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/The%20One%20Ring%202e/assets/boxline-border-brown.png'); + border-image-source: var(--borderbrown); /*border-image-source: url('https://raw.githubusercontent.com/bhuesemann/roll20-character-sheets/tor2e_02-00-00/The%20One%20Ring%202e/images/box-border-brown-rttd.png');*/ /*border-image-source: url('https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/The%20One%20Ring%202e/images/box-border-brown-rttd.png');*/ border-image-slice: 8 8 8 8; @@ -1016,7 +1003,7 @@ input[type='radio'] { width: 45px !important; height: 45px !important; border: 5px solid transparent; - border-image-source: url('https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/The%20One%20Ring%202e/assets/boxline-border-red.png'); + border-image-source: var(--borderred); /*border-image-source: url('https://raw.githubusercontent.com/bhuesemann/roll20-character-sheets/tor2e_02-00-00/The%20One%20Ring%202e/images/box-border-red-rttd.png');*/ /*border-image-source: url('https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/The%20One%20Ring%202e/images/box-border-red-rttd.png');*/ border-image-slice: 8 8 8 8; diff --git a/The One Ring 2e/sheet.html b/The One Ring 2e/sheet.html index 541506b9b0..cc180ae67a 100644 --- a/The One Ring 2e/sheet.html +++ b/The One Ring 2e/sheet.html @@ -1,6 +1,7 @@ - +
@@ -92,7 +93,7 @@ - +
@@ -102,7 +103,7 @@ - + @@ -134,7 +135,7 @@ - +
@@ -144,7 +145,7 @@ - +
@@ -363,7 +364,7 @@ data-i18n-title="stance-attack-modifier-description">Attack Mod.: + name="attr_stancedamagebonus" value="0" type="number"> @@ -1029,26 +1030,6 @@
- - - - - - - - - - - - - - - - - - - - @@ -1419,7 +1400,7 @@ ============================*/ // weary roll table change on("change:weary sheet:opened", function() { - getAttrs(["weary","sheetTab"], function(values) { + getAttrs(["weary", "wearytype", "sheetTab"], function(values) { if (values.sheetTab === "isPC"){ let weary = values.weary||0; if (weary === "on" || weary == 1) { @@ -1431,6 +1412,11 @@ setAttrs({ wearytype: wearytype, }); + } else { + // setting default for adversaries and if sheet is opened the first time + setAttrs({ + wearytype: "normal", + }); }; }); }); @@ -1444,13 +1430,13 @@ endurance = int(values.endurance); let weary = values.weary, currentendurance = int(values.currentendurance); - clog(`Endurance: ${JSON.stringify(values)}`); - if ( load >= (currentendurance-fatigue) ) { weary = 1; } else { weary = 0} - if ( currentendurance > endurance ) { currentendurance = endurance; } - setAttrs({ - weary: weary, - currentendurance: currentendurance, - }); + clog(`Endurance: ${JSON.stringify(values)}`); + if ( load >= (currentendurance-fatigue) ) { weary = 1; } else { weary = 0} + if ( currentendurance > endurance ) { currentendurance = endurance; } + setAttrs({ + weary: weary, + currentendurance: currentendurance, + }); }; });