Official Savage Worlds v1.00.29

Minor enhancements to allow users to use a custom logo and custom background for the sheet.

Also provides a roll20 attribute for remaining wounds for people who want to show health decreasing (on a token) instead of wounds increasing.
This commit is contained in:
finderski
2022-09-24 22:04:58 -04:00
parent 5ae77c02a3
commit 54b3c3c986
4 changed files with 325 additions and 144 deletions
+112 -81
View File
@@ -279,22 +279,23 @@ details[open] > summary.config {
}
input.useBackground[value="1"] ~ .background {
background-image: url(https://raw.githubusercontent.com/finderski/SWT/master/Parchement_Background2.jpg);
/*background-image: url(https://raw.githubusercontent.com/finderski/SWT/master/Parchement_Background2.jpg);*/
background-color: rgb(244, 244, 244);
}
input.useBackground[value="2"] ~ .background {
background-image: url(https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/backgrounds/swade-parchment-seamless.jpg);
/*background-image: url(https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/backgrounds/swade-parchment-seamless.jpg);*/
background-color: rgb(244, 244, 244);
}
input.useBackground[value="3"] ~ .background {
background-image: url(https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/backgrounds/r20-rifts-hex-pattern.png);
/*background-image: url(https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/backgrounds/r20-rifts-hex-pattern.png);*/
background-size: 10%;
background-color: #D0D3D4;
background-color: #d0d3d4;
}
input.useBackground[value="0"] ~ .background {
input.useBackground[value="0"] ~ .background,
input.useBackground[value="4"] ~ .background {
background-color: white;
}
@@ -1222,8 +1223,7 @@ label.traitlabel > input.traitradio {
.d8,
.d10,
.d12 {
display: inline;
/*was inline*/
display: inline; /*was inline*/
color: silver;
position: relative;
top: 5px;
@@ -2063,7 +2063,7 @@ select {
flex-wrap: wrap;
justify-content: flex-start;
align-items: flex-start;
align-content: space-between;
align-content: space-around;
margin: 0 5px 5px 5px;
padding: 5px;
box-sizing: content-box;
@@ -2142,13 +2142,13 @@ label.showwealthwilddie {
flex-wrap: wrap;
justify-content: flex-start;
align-items: flex-start;
align-content: space-between;
align-content: space-around;
margin: 0 5px 5px 5px;
padding: 5px;
box-sizing: content-box;
max-width: 832px;
min-height: 305px;
height: calc(305px + (100vw - 832px) * -50);
min-height: 485px;
height: calc(485px + (100vw - 832px) * -50);
max-height: 705px;
overflow: auto;
}
@@ -2163,6 +2163,12 @@ label.showwealthwilddie {
.miscconfig .miscItem .sheet-background {
width: 161px;
}
.miscconfig .showCustomLogo:not([value=Custom]) + .miscItem.customLogo {
display: none;
}
.miscconfig .showCustomBackground:not([value="4"]) + .miscItem.customBackground {
display: none;
}
/*.useBackground[value="0"] ~ .background .miscconfig .darkMode {
display: none;
@@ -2184,12 +2190,12 @@ label.showwealthwilddie {
flex-wrap: wrap;
justify-content: flex-start;
align-items: flex-start;
align-content: space-between;
align-content: space-around;
margin: 0 5px 5px 5px;
padding: 5px;
box-sizing: content-box;
min-height: 525px;
height: calc(525px + (100vw - 832px) * -50);
min-height: 550px;
height: calc(550px + (100vw - 832px) * -50);
max-height: 1050px;
overflow: auto;
/*background: rgb(255,255,255,0.75);*/
@@ -2318,6 +2324,7 @@ label.showwealthwilddie {
.PEG,
.SWPF,
.Rifts,
.Custom,
input[value=Pathfinder].showLogo ~ .SWADE {
display: none;
}
@@ -2329,7 +2336,8 @@ input[value=Pathfinder].showLogo ~ .SWADE {
input[value=Deadlands].showLogo ~ .Deadlands,
input[value=SavageWorlds].showLogo ~ .PEG,
input[value=Pathfinder].showLogo ~ .SWPF,
input[value=Rifts].showLogo ~ .Rifts {
input[value=Rifts].showLogo ~ .Rifts,
input[value=Custom].showLogo ~ .Custom {
display: inline-block;
}
@@ -4576,8 +4584,7 @@ select.armorMinStr {
.charsheet .armorProtection,
.charsheet input.armorProtection {
width: 10% !important;
/*75px;*/
width: 10% !important; /*75px;*/
}
.armorStacks,
@@ -4686,8 +4693,7 @@ div.shieldHalf .statblock {
display: inline;
margin: 0px;
padding: 0px;
width: 45px;
/*50px;*/
width: 45px; /*50px;*/
}
.shieldWorn {
@@ -4749,8 +4755,7 @@ h4.shieldParry {
.shieldCover,
input.shieldCover {
width: 50px;
/*75px;*/
width: 50px; /*75px;*/
}
.shieldWeight,
@@ -5330,50 +5335,43 @@ div.vehicleHandlingBox,
div.vehicleTopSpeedBox,
div.vehicleToughnessBox,
div.vehicleCrewBox {
width: 80px;
/*50*/
height: 50px;
/*40*/
width: 80px; /*50*/
height: 50px; /*40*/
text-align: center;
/*margin-left: 110px;*/
}
div.vehicleSizeBox {
background: url("https://github.com/finderski/SWT/blob/master/redCircle1.png?raw=true");
background-size: 65px;
/*45*/
background-size: 65px; /*45*/
background-repeat: no-repeat;
background-position: center;
}
div.vehicleHandlingBox {
background: url("https://github.com/finderski/SWT/blob/master/redCircle2.png?raw=true");
background-size: 65px;
/*45*/
background-size: 65px; /*45*/
background-repeat: no-repeat;
background-position: center;
}
div.vehicleTopSpeedBox {
background: url("https://github.com/finderski/SWT/blob/master/redCircle3.png?raw=true");
background-size: 65px;
/*45*/
background-size: 65px; /*45*/
background-repeat: no-repeat;
background-position: center;
}
div.vehicleToughnessBox {
background: url("https://github.com/finderski/SWT/blob/master/redCircle5.png?raw=true");
background-size: 65px;
/*45*/
background-size: 65px; /*45*/
background-repeat: no-repeat;
background-position: center;
}
div.vehicleCrewBox {
background: url("https://github.com/finderski/SWT/blob/master/redCircle4.png?raw=true");
background-size: 65px;
/*45*/
background-size: 65px; /*45*/
background-repeat: no-repeat;
background-position: center;
}
@@ -6581,6 +6579,47 @@ li.docList::before {
-- The Themes file for the Main Character Sheet.
-- The Condensed view has it's own file: _statblockViewThemes.scss
------------------------------------------------------------------ */
/* Generic Theme */
.useTheme[value="0"] ~ .background > .base .character .triFold {
background: rgba(255, 255, 255, 0.45);
}
.useTheme[value="0"] ~ .background > .base .character .bottomHalf .groupHeader {
background-color: rgba(255, 255, 255, 0.4);
box-sizing: border-box;
padding: 5px 0 5px 0;
}
.useTheme[value="0"] ~ .background > .base .character .weapons,
.useTheme[value="0"] ~ .background > .base .character .arcane {
background-color: rgba(255, 255, 255, 0.4);
box-sizing: border-box;
padding: 5px 0 5px 0;
}
.useTheme[value="0"] ~ .background > .base .character .armorHalf,
.useTheme[value="0"] ~ .background > .base .character .shieldHalf {
background-color: rgba(255, 255, 255, 0.4);
padding: 0 0 5px 0;
}
.useTheme[value="0"] ~ .background > .base .character .armorHalf .groupHeader,
.useTheme[value="0"] ~ .background > .base .character .shieldHalf .groupHeader {
font-weight: bold;
}
.useTheme[value="0"] ~ .background > .base .configurationpane select {
width: auto;
}
.useTheme[value="0"] ~ .background > .base .configurationpane .configSection {
background-color: transparent;
}
.useTheme[value="0"] ~ .background > .base .configurationpane .configSection .srmconfig,
.useTheme[value="0"] ~ .background > .base .configurationpane .configSection .miscconfig,
.useTheme[value="0"] ~ .background > .base .configurationpane .configSection .csnconfig,
.useTheme[value="0"] ~ .background > .base .configurationpane .configSection .savagedUSImporter {
background-color: rgba(255, 255, 255, 0.4);
}
.useTheme[value="0"] ~ .background > .base .configurationpane .configSection .savagedUSImporter {
box-sizing: border-box;
padding: 15px;
}
/* Deadlands Theme */
.useTheme[value="1"] ~ .background > .base .character .traitHeader {
font-family: Rye;
@@ -6700,7 +6739,7 @@ li.docList::before {
background-size: contain;
background-repeat: no-repeat;
font-family: Rye;
color: #FAE5D3;
color: #fae5d3;
height: 95px;
display: flex;
justify-content: center;
@@ -6710,12 +6749,12 @@ li.docList::before {
.useTheme[value="1"] ~ .background > .base .powerArmor h1.groupHeader input.headerInput,
.useTheme[value="1"] ~ .background > .base .robotArmor h1.groupHeader input.headerInput {
font-family: Rye;
color: #FAE5D3;
color: #fae5d3;
}
.useTheme[value="1"] ~ .background > .base .vehicles h1.groupHeader input.headerInput::placeholder,
.useTheme[value="1"] ~ .background > .base .powerArmor h1.groupHeader input.headerInput::placeholder,
.useTheme[value="1"] ~ .background > .base .robotArmor h1.groupHeader input.headerInput::placeholder {
color: #FAE5D3;
color: #fae5d3;
}
.useTheme[value="1"] ~ .background > .base .vehicles .shipMainSection,
.useTheme[value="1"] ~ .background > .base .powerArmor .shipMainSection,
@@ -6751,7 +6790,7 @@ li.docList::before {
.useTheme[value="1"] ~ .background > .base .vehicles .hideBtn,
.useTheme[value="1"] ~ .background > .base .powerArmor .hideBtn,
.useTheme[value="1"] ~ .background > .base .robotArmor .hideBtn {
color: #FAE5D3;
color: #fae5d3;
position: relative;
top: 10px;
left: 10px;
@@ -6760,9 +6799,9 @@ li.docList::before {
.useTheme[value="1"] ~ .background > .base .powerArmor .powerArmorButton,
.useTheme[value="1"] ~ .background > .base .robotArmor .powerArmorButton {
right: -2.5%;
background-color: #922B21;
background-color: #922b21;
border: none;
color: #FAE5D3;
color: #fae5d3;
}
.useTheme[value="1"] ~ .background > .base .characternotes .standardDiv,
.useTheme[value="1"] ~ .background > .base .characternotes .charnotes {
@@ -6770,10 +6809,11 @@ li.docList::before {
}
.useTheme[value="1"] ~ .background > .base .characternotes h1.groupHeader {
background-image: url(https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/headers/r20-dlww-header.png);
background-size: contain;
/*background-size: contain;*/
background-size: 100% 100%;
background-repeat: no-repeat;
font-family: Rye;
color: #FAE5D3;
color: #fae5d3;
height: 95px;
display: flex;
justify-content: center;
@@ -6799,7 +6839,7 @@ li.docList::before {
background-repeat: no-repeat;
background-color: transparent;
font-family: Rye;
color: #FAE5D3;
color: #fae5d3;
font-size: 2.5em;
height: 95px;
display: flex;
@@ -6825,7 +6865,7 @@ li.docList::before {
background-size: 100%;
background-repeat: no-repeat;
font-family: Rye;
color: #FAE5D3;
color: #fae5d3;
height: 95px;
display: flex;
justify-content: center;
@@ -6836,7 +6876,7 @@ li.docList::before {
background-size: 100%;
background-repeat: no-repeat;
font-family: Rye;
color: #FAE5D3;
color: #fae5d3;
height: 95px;
display: flex;
justify-content: center;
@@ -6860,7 +6900,7 @@ li.docList::before {
background-size: 100%;
background-repeat: no-repeat;
font-family: Rye;
color: #FAE5D3;
color: #fae5d3;
height: 95px;
display: flex;
justify-content: center;
@@ -7008,7 +7048,7 @@ li.docList::before {
background-size: contain;
background-repeat: no-repeat;
font-family: Metamorphous;
color: #FCEEEE;
color: #fceeee;
height: 95px;
display: flex;
justify-content: center;
@@ -7018,12 +7058,12 @@ li.docList::before {
.useTheme[value="2"] ~ .background > .base .powerArmor h1.groupHeader input.headerInput,
.useTheme[value="2"] ~ .background > .base .robotArmor h1.groupHeader input.headerInput {
font-family: Metamorphous;
color: #FCEEEE;
color: #fceeee;
}
.useTheme[value="2"] ~ .background > .base .vehicles h1.groupHeader input.headerInput::placeholder,
.useTheme[value="2"] ~ .background > .base .powerArmor h1.groupHeader input.headerInput::placeholder,
.useTheme[value="2"] ~ .background > .base .robotArmor h1.groupHeader input.headerInput::placeholder {
color: #FCEEEE;
color: #fceeee;
}
.useTheme[value="2"] ~ .background > .base .vehicles .shipMainSection,
.useTheme[value="2"] ~ .background > .base .powerArmor .shipMainSection,
@@ -7059,7 +7099,7 @@ li.docList::before {
.useTheme[value="2"] ~ .background > .base .vehicles .hideBtn,
.useTheme[value="2"] ~ .background > .base .powerArmor .hideBtn,
.useTheme[value="2"] ~ .background > .base .robotArmor .hideBtn {
color: #FCEEEE;
color: #fceeee;
position: relative;
top: 10px;
left: 10px;
@@ -7068,7 +7108,7 @@ li.docList::before {
.useTheme[value="2"] ~ .background > .base .powerArmor .powerArmorButton,
.useTheme[value="2"] ~ .background > .base .robotArmor .powerArmorButton {
right: -2.5%;
background-color: #F1948A;
background-color: #f1948a;
border: none;
color: maroon;
}
@@ -7081,7 +7121,7 @@ li.docList::before {
background-size: contain;
background-repeat: no-repeat;
font-family: Metamorphous;
color: #FCEEEE;
color: #fceeee;
height: 95px;
display: flex;
justify-content: center;
@@ -7107,7 +7147,7 @@ li.docList::before {
background-repeat: no-repeat;
background-color: transparent;
font-family: Metamorphous;
color: #FCEEEE;
color: #fceeee;
font-size: 2.5em;
height: 95px;
display: flex;
@@ -7133,7 +7173,7 @@ li.docList::before {
background-size: 100%;
background-repeat: no-repeat;
font-family: Metamorphous;
color: #FCEEEE;
color: #fceeee;
height: 95px;
display: flex;
justify-content: center;
@@ -7144,7 +7184,7 @@ li.docList::before {
background-size: 100%;
background-repeat: no-repeat;
font-family: Metamorphous;
color: #FCEEEE;
color: #fceeee;
height: 95px;
display: flex;
justify-content: center;
@@ -7168,7 +7208,7 @@ li.docList::before {
background-size: 100%;
background-repeat: no-repeat;
font-family: Metamorphous;
color: #FCEEEE;
color: #fceeee;
height: 95px;
display: flex;
justify-content: center;
@@ -7430,14 +7470,14 @@ li.docList::before {
border-radius: 5px;
}
.useTheme[value="3"] ~ .background > .base .combatoptions .combatOptionDetails .combatoptionItem:nth-child(odd) {
background-color: #34495E;
background-color: #34495e;
color: white;
}
.useTheme[value="3"] ~ .background > .base .combatoptions .combatOptionDetails .combatoptionItem:nth-child(odd) .optionLabel {
color: rgb(242, 159, 64);
}
.useTheme[value="3"] ~ .background > .base .combatoptions .combatOptionDetails .combatoptionItem:nth-child(even) {
background-color: #5D6D7E;
background-color: #5d6d7e;
color: white;
}
.useTheme[value="3"] ~ .background > .base .combatoptions .combatOptionDetails .combatoptionItem:nth-child(even) .optionLabel {
@@ -7507,19 +7547,19 @@ li.docList::before {
}
.useTheme[value="3"] ~ .background > .base .sheetdocumentation .infotable .titleLeft,
.useTheme[value="3"] ~ .background > .base .sheetdocumentation .infotable .titleRight {
background-color: #1B2631;
background-color: #1b2631;
color: white;
}
.useTheme[value="3"] ~ .background > .base .sheetdocumentation .infotable .colLabels {
background-color: #17202A;
background-color: #17202a;
color: white;
}
.useTheme[value="3"] ~ .background > .base .sheetdocumentation .infotable tr:nth-child(odd) {
background-color: #5D6D7E;
background-color: #5d6d7e;
color: white;
}
.useTheme[value="3"] ~ .background > .base .sheetdocumentation .infotable tr:nth-child(even) {
background-color: #34495E;
background-color: #34495e;
color: white;
}
@@ -7544,10 +7584,8 @@ li.docList::before {
--default-header-img-size: 100%;
--default-header-height: 105px;
--default-header-padding: 20px 0 0 0;
--style-font: Teko;
/*used for teh h2 tag in the header */
--accent-font: Teko;
/*Used for h3 tag in the header*/
--style-font: Teko; /*used for teh h2 tag in the header */
--accent-font: Teko; /*Used for h3 tag in the header*/
--header-font-size: 2em;
--subheader-font-size: 1.5em;
/* Roll Text Styling */
@@ -8034,20 +8072,14 @@ li.docList::before {
}
.sheet-rolltemplate-info {
--main-text: black;
/*Color of the text*/
--main-text: black; /*Color of the text*/
--main-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
/* Header Stuff */
--header-text: white;
/*Color of the text in the header */
--default-header: maroon;
/*Background color of Header section */
--default-subheader: black;
/*Background color of Subheader section */
--style-font: Teko;
/*used for teh h2 tag in the header */
/*--accent-font: var(--main-font);*/
/*Used for h3 tag in the header*/
--header-text: white; /*Color of the text in the header */
--default-header: maroon; /*Background color of Header section */
--default-subheader: black; /*Background color of Subheader section */
--style-font: Teko; /*used for teh h2 tag in the header */
/*--accent-font: var(--main-font);*/ /*Used for h3 tag in the header*/
--header-font-size: 2em;
--header-border: 1px solid maroon;
--subheader-font-size: 1em;
@@ -8097,8 +8129,7 @@ li.docList::before {
--header-text: white;
--default-header: #25333c;
--header-border: #72a7b7;
--style-font: Anton;
/*used for teh h2 tag in the header */
--style-font: Anton; /*used for teh h2 tag in the header */
--accent-font: var(--main-font);
--roll-background: #31444f;
--button-background: #25333c;
+137 -61
View File
@@ -1,7 +1,7 @@
<script type="text/worker">
const sheetVersionPrefix = 'Official Savage Worlds v';
const sheetVersion = '1.00.28';
const sheetVersion = '1.00.29';
// Define colors for Logs
const r20color = '#E948C9';
@@ -198,10 +198,10 @@ function repeatingSimpleSumWCheck(
function fauxChange(field, fauxvalue) {
//repeating fields should be passed in the format: repeating_<section>:attributes
//example: repeating_skills:skillnamerank
log("FauxChange Reached: Field",field,r20color);
log('FauxChange Reached: Field', field, r20color);
log('Setting faux value(s) for', field, 'orangered');
if (field.indexOf(':') > -1) {
log("fauxChange","repeating section","#CCCCFF")
log('fauxChange', 'repeating section', '#CCCCFF');
//console.log("Need to update values in a repeating section");
let getfields = field.split(':');
let repeatingSection = getfields[0];
@@ -220,18 +220,22 @@ function fauxChange(field, fauxvalue) {
getAttrs(fieldArray, function (v) {
for (let b = 0; b < idArray.length; b++) {
oldValues[oldValues.length] = v[fieldArray[b]];
log(`Setting Faux Value (${fieldArray[b]})`, fauxvalue,r20color);
log(`Setting Faux Value (${fieldArray[b]})`, fauxvalue, r20color);
sattrs[fieldArray[b]] = fauxvalue;
}
log('Step', '!!! Setting Fake Value !!!', 'orangered');
setAttrs(sattrs,null, () => {
setAttrs(sattrs, null, () => {
for (let c = 0; c < idArray.length; c++) {
log(
'Added Field',
fieldArray[c] + ' = ' + oldValues[c],
'orangered'
);
log(`Setting Previous Value (${fieldArray[c]})`, oldValues[c], r20color);
log(
`Setting Previous Value (${fieldArray[c]})`,
oldValues[c],
r20color
);
sattrs[fieldArray[c]] = oldValues[c];
}
log('Step', '!!! Setting Real Values !!!', 'orangered');
@@ -242,15 +246,15 @@ function fauxChange(field, fauxvalue) {
});
} else {
//console.log("Updating values in a Non-Repeating Section");
log("fauxChange","Not Repeating Section","#CCCCFF")
log('fauxChange', 'Not Repeating Section', '#CCCCFF');
getAttrs([field], function (v) {
let prevValue = v[field];
let sattrs = {};
//console.log(`++++ Setting ${field} to ${fauxvalue} ++++`);
//console.log("Setting " + field + " to " + fauxvalue);
sattrs[field] = fauxvalue;
log(`Setting Faux Value (${field})`, fauxvalue,r20color);
setAttrs(sattrs,null,()=>{
log(`Setting Faux Value (${field})`, fauxvalue, r20color);
setAttrs(sattrs, null, () => {
sattrs[field] = prevValue;
log(`Setting Previous Value (${field})`, prevValue, r20color);
setAttrs(sattrs);
@@ -267,7 +271,7 @@ const stepwiseFaux = function (section, field) {
//field = the field within the section to fauxily change
//example call: stepwiseFaux("weapons","dmgbonusnum");
//will do a faux change during each for loop
log("stepWiseFaux", "Entered this thing", "#CCCCFF");
log('stepWiseFaux', 'Entered this thing', '#CCCCFF');
let repeatingSection = `repeating_${section}`;
getSectionIDs(repeatingSection, function (idArray) {
if (idArray.length > 0) {
@@ -365,6 +369,44 @@ const repeatingCount = function (repSection, countField) {
});
};
//Manage Background Image
const updateBackgroundImage = function (backgroundSelection) {
let imageURL = '';
getAttrs(['background', 'backgroundurl'], function (bgSelection) {
switch (bgSelection.background) {
case '1':
imageURL =
'https://raw.githubusercontent.com/finderski/SWT/master/Parchement_Background2.jpg';
break;
case '2':
imageURL =
'https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/backgrounds/swade-parchment-seamless.jpg';
break;
case '3':
imageURL =
'https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/backgrounds/r20-rifts-hex-pattern.png';
break;
case '4':
imageURL = bgSelection.backgroundurl;
break;
default:
imageURL = '';
}
setAttrs({
backgroundImage: imageURL,
});
});
};
const calcWoundsRemaining = function () {
getAttrs(['wounds_max', 'wounds'], function (v) {
let maxWounds = parseInt(v.wounds_max) || 0;
let totalWounds = parseInt(v.wounds) || 0;
let remainingWounds = maxWounds - totalWounds;
setAttrs({ woundsRemaining: remainingWounds });
});
};
/* ---- Begin Sheet Version Validation & Update ---- */
const upgradeSheet = function (
version,
@@ -517,9 +559,15 @@ const upgradeSheet = function (
}
if (versionthree < 0.26) {
setattrvals['newcontent'] = 'unread';
}
}
if (versionthree < 0.27) {
const nameList = ["faith","focus","performance","psionics","spellcasting"];
const nameList = [
'faith',
'focus',
'performance',
'psionics',
'spellcasting',
];
nameList.forEach(skillName => {
fauxChange(`${skillName}name`, `${skillName}_old`);
});
@@ -527,13 +575,17 @@ const upgradeSheet = function (
setattrvals['newdocumentation'] = 'unread';
}
if (versionthree < 0.28) {
log("Sheet Version", "Upgrading to version 0.0.28", "#CCCCFF");
fauxChange(`repeating_weapons:weaponskill`, "fakeWeapon");
log('Sheet Version', 'Upgrading to version 0.0.28', '#CCCCFF');
fauxChange(`repeating_weapons:weaponskill`, 'fakeWeapon');
//stepwiseFaux("weapons", "weaponbutton");
setattrvals['newcontent'] = 'unread';
} else {
} else {
log('Upgrade', `Sheet already updgraded (${characterName})`, 'lime');
}
if (versionthree < 0.29) {
updateBackgroundImage();
setattrvals['newcontent'] = 'unread';
}
setAttrs(setattrvals);
//setAttrs(setattrvals, { silent: true });
});
@@ -1057,6 +1109,11 @@ on('change:sheet_theme', function (eventInfo) {
}
setAttrs(updatedValues);
});
//watch for a change in the background
on('change:background', function () {
updateBackgroundImage();
});
//Create Trait values for rank and display hidden fields is in the workers.js file
//Setting default Skill Names is in the workers.js file (with all the other on:opened stuff)
@@ -2037,18 +2094,23 @@ on('change:burn_points_mod', function (eventInfo) {
});
//Wound and Fatigue Configuration Pane buttons are in teh actionButtonScripts.js file
on("change:stunned", function(eventInfo) {
if (eventInfo.newValue === "-2") {
getAttrs(["distracted"], function(v) {
v.distracted === "0" ?
setAttrs({ distracted: "-2",
vulnerable: "-2" }) :
log("Distracted", "Setting distracted", "darkblue");
});
} else {
log("Distracted", "Don't need to change Distracted", "darkblue");
}
});/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
on('change:stunned', function (eventInfo) {
if (eventInfo.newValue === '-2') {
getAttrs(['distracted'], function (v) {
v.distracted === '0'
? setAttrs({ distracted: '-2', vulnerable: '-2' })
: log('Distracted', 'Setting distracted', 'darkblue');
});
} else {
log('Distracted', "Don't need to change Distracted", 'darkblue');
}
});
on('change:wounds', function (value) {
//call the function
calcWoundsRemaining();
});
/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
//Initiate a compendium lookup
/*Expansion IDs:
@@ -2145,7 +2207,6 @@ const compendiumLookup = function({queue, callback}) {
compendiumDataLookup({queue,callback,IDPathways});
}catch(err){
debug('No IDPathways found, exiting drag and drop');
console.error(err);
}
}else{
debug(`!!! No product index page found. No valid base compendiums present !!!`);
@@ -2754,17 +2815,12 @@ const dropShields = function({repSectionID,repSection,targetObj,jsonObj}){
const dropVehicle = function({jsonObj}){
log('Vehicle Info', 'Made it to getting Vehicle Fields', r20color);
let prefix = '';
const fields = [
...(jsonObj.subcategory ? powerRobotArmorFields : vehiclefields),
];
if (jsonObj.subcategory) {
prefix = jsonObj.subcategory === 'Power Armor' ? 'pa_' : 'ra_';
}
const fields = (jsonObj.subcategory ? powerRobotArmorFields : vehiclefields)
.map(f => {
if(jsonObj.hasOwnProperty(f)){
jsonObj[`${prefix}${f}`] = jsonObj[f];
}
return `${prefix}${f}`
});
return [false,fields];
};
@@ -2807,6 +2863,7 @@ const getDropInfo = function (jsonObj, targetObj, repSection, attributes) {
debug('Entering getDropInfo');
let repSectionID;
let fields;
let prefix = '';
repSection ?
(repSectionID = generateRowID()) :
log('Repeating Section', 'Not Found', r20color);
@@ -2830,7 +2887,7 @@ const getDropInfo = function (jsonObj, targetObj, repSection, attributes) {
};
[repSection,fields] = dropSwitch.hasOwnProperty(repSection) ?
dropSwitch[repSection]({repSection,targetObj,jsonObj,attributes,fields,repSectionID}) :
[null,[],''];
[null,[]];
if(repSection){
applyGeneralEffects({
targetObj,
@@ -2846,7 +2903,7 @@ const getDropInfo = function (jsonObj, targetObj, repSection, attributes) {
fields.forEach(field => {
jsonObj[`${field}`] !== undefined
? (targetObj[
`repeating_${repSection}_${repSectionID}_${field}`
`repeating_${repSection}_${repSectionID}_${prefix}${field}`
] = jsonObj[`${field}`])
: log(`${field}`, 'Not Found', r20color);
});
@@ -2854,7 +2911,7 @@ const getDropInfo = function (jsonObj, targetObj, repSection, attributes) {
log('Non-Repeating Fields', 'Fields Found', r20color);
fields.forEach(field => {
jsonObj[`${field}`] !== undefined
? (targetObj[`${field}`] = jsonObj[`${field}`])
? (targetObj[`${prefix}${field}`] = jsonObj[`${field}`])
: log(`${field}`, 'Not Found', r20color);
});
}
@@ -3237,27 +3294,20 @@ const processAdditionalPHEGs = function(lookupObj,finalCharacterDetails,monster)
powerCount: obj => obj['data-Powers'].length,
},
Vehicle: {
vehicle: (obj) =>{
return obj['data-Vehicle'].some(o => !o.data.subcategory) ?
'on' :
0;
},
power_armor: (obj) =>{
return obj['data-Vehicle'].some(
vehicle: obj =>
obj['data-Vehicle'].some(o => !o.data.subcategory) ? 'on' : 0,
power_armor: obj =>
obj['data-Vehicle'].some(
o => o.data.subcategory === 'Power Armor'
)
?
1 :
0;
},
robot_armor: (obj) =>{
return obj['data-Vehicle'].some(
? 1
: 0,
robot_armor: obj =>
obj['data-Vehicle'].some(
o => o.data.subcategory === 'Robot Armor'
)
?
1 :
0;
},
? 1
: 0,
},
SpecialAbilities: {
showspecabilities: obj => 1,
@@ -3286,7 +3336,6 @@ const processAdditionalPHEGs = function(lookupObj,finalCharacterDetails,monster)
log(`Import ${singular}`, phegObj.name, r20color);
log(`Monster`, singular, r20color);
let source = phegObj.datasource;
let dropType = getDropInfoCommand(type, source);
finalCharacterDetails = getDropInfo(
phegObj.data,
@@ -6578,7 +6627,7 @@ on(
</script>
<!-- Necessary Mixins-->
<!-- Hidden inputs for character sheet versioning, etc-->
<input type="hidden" name="attr_character_sheet" value="Official Savage Worlds v1.00.28"/>
<input type="hidden" name="attr_character_sheet" value="Official Savage Worlds v1.00.29"/>
<input type="hidden" name="attr_firstInit" value="0"/>
<input type="hidden" name="attr_namelength" value="0"/>
<input type="hidden" name="attr_wdNum" value="1"/>
@@ -6638,7 +6687,7 @@ on(
<input class="useDarkMode" type="hidden" name="attr_dark_mode" value="0"/>
<input class="useTheme" type="hidden" name="attr_sheet_theme" value="0"/>
<input class="useBackground hiddenInput" type="hidden" name="attr_background" value="1"/>
<div class="background">
<div class="background" name="attr_backgroundImage">
<div class="base">
<!--"sheet of paper" the character sheet is on.-->
<div class="buttonbar">
@@ -8317,7 +8366,7 @@ on(
</fieldset>
</div>
<div class="logoBlock">
<input class="showLogo" type="hidden" value="SavageWorlds" name="attr_logo"/><img class="logo PEG" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PEG_LOGO_White.png"/><img class="logo Deadlands" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Deadlands.png"/><img class="logo SWADE" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/SW_Logo_AE.png"/><img class="logo SWPF" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PFforSW_logo9_square_smaller.png"/><img class="logo Rifts" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Savage_Rifts_Logo.png"/>
<input class="showLogo" type="hidden" value="SavageWorlds" name="attr_logo"/><img class="logo PEG" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PEG_LOGO_White.png"/><img class="logo Deadlands" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Deadlands.png"/><img class="logo SWADE" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/SW_Logo_AE.png"/><img class="logo SWPF" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PFforSW_logo9_square_smaller.png"/><img class="logo Rifts" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Savage_Rifts_Logo.png"/><img class="logo Custom" name="attr_logoURL"/>
</div>
</div>
<div class="character">
@@ -13047,7 +13096,7 @@ on(
img(class="logo Deadlands" src="http://www.geeksville.us/roll20/Deadlands.png")
img(class="logo SWADE" src="http://www.geeksville.us/roll20/SW_Logo_AE.png")
-->
<input class="showLogo" type="hidden" value="SavageWorlds" name="attr_logo"/><img class="logo PEG" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PEG_LOGO_White.png"/><img class="logo Deadlands" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Deadlands.png"/><img class="logo SWADE" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/SW_Logo_AE.png"/><img class="logo SWPF" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PFforSW_logo9_square_smaller.png"/><img class="logo Rifts" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Savage_Rifts_Logo.png"/>
<input class="showLogo" type="hidden" value="SavageWorlds" name="attr_logo"/><img class="logo PEG" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PEG_LOGO_White.png"/><img class="logo Deadlands" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Deadlands.png"/><img class="logo SWADE" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/SW_Logo_AE.png"/><img class="logo SWPF" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/PFforSW_logo9_square_smaller.png"/><img class="logo Rifts" src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Official%20Savage%20Worlds/images/logos/Savage_Rifts_Logo.png"/><img class="logo Custom" name="attr_logoURL"/>
<!--Right Column (Hindrances, Ancestry Abilities, Special Abilties, Edges/Advances)-->
<input class="showconditions hiddenInput" type="checkbox" name="attr_showconditions" checked="checked"/>
<div class="conditions">
@@ -13068,6 +13117,7 @@ on(
</div>
</div><!-- End Conditions -->
<div class="health"><!-- Wounds -->
<input class="hidden" type="number" name="attr_woundsRemaining"/>
<div class="baseHealthTrait characterWounds">
<input class="standardHealth" type="number" name="attr_wounds" title="@{wounds}" value="0"/>||
<input class="standardHealth" type="number" name="attr_wounds_max" title="@{wounds_max}" value="3"/>
@@ -15652,16 +15702,26 @@ on(
<option value="Deadlands" data-i18n="deadlands">Deadlands</option>
<option value="Pathfinder" data-i18n="pathfinder-for-savage-worlds">Pathfinder for Savage Worlds</option>
<option value="Rifts" data-i18n="rifts">Rifts</option>
<option value="Custom" data-i18n="custom">Custom </option>
</select>
</label>
<input class="showCustomLogo" type="hidden" name="attr_logo" value="SavageWorlds"/>
<label class="miscItem customLogo"><span data-i18n="logo-url">Logo URL </span>
<input type="text" name="attr_logoURL"/>
</label>
<label class="miscItem"><span data-i18n="sheet-background">Sheet Background</span>
<select class="sheet-background" name="attr_background">
<option class="noBackground" value="0" data-i18n="no-background-image">No Background Image</option>
<option value="1" selected="selected" data-i18n="swade-parchment">SWADE Parchment</option>
<option value="2" data-i18n="seamless-parchment">Seamless Parchment</option>
<option value="3" data-i18n="gray-hex">Gray Hex </option>
<option value="4" data-i18n="custom">Custom</option>
</select>
</label>
<input class="showCustomBackground" type="hidden" name="attr_background" value="1"/>
<label class="miscItem customBackground"><span data-i18n="background-url">Background URL </span>
<input type="text" name="attr_backgroundurl"/>
</label>
<label class="miscItem darkMode">
<input type="checkbox" name="attr_dark_mode" value="1"/>&nbsp; <span data-i18n="dark-mode-invert-colors">Dark Mode</span>
</label>
@@ -15848,6 +15908,22 @@ on(
</div>
<div class="releasenotesTab">
<h1 class="groupHeader documentationHeader" data-i18n="release-notes">Release Notes</h1>
<!-- Release 1.00.29-->
<label class="rowlabel">
<input class="releasenotes" type="checkbox" name="attr_releasenotes10029" value="1"/><span class="releasenotesVersion">
<h4 class="rnversion"><span data-i18n="version"></span>1.00.29</h4></span>
</label>
<input class="releasenotes" type="checkbox" style="display:none;" name="attr_releasenotes10029" value="1"/>
<div class="releasenotes">
<h2 class="releaseNotesSubHeader" data-i18n="minor-release">Minor Release</h2>
<p data-i18n="minor-release-info">This release focuses on Minor Enhancements and Bug Fixes</p>
<h2 class="releaseNotesSubHeader" data-i18n="enhancements">Enhancements</h2>
<ul class="releaseNotesList">
<li> <span class="black" data-i18n="custom-logo">Added the ability to assign your own custom logo to the sheet </span></li>
<li> <span class="black" data-i18n="custom-background">Added the ability to assign your own custom background to the sheet </span></li>
<li> <span class="black" data-i18n="wounds-remaining">Added a field that calculates the number of wounds remaining </span></li>
</ul>
</div>
<!-- Release 1.00.28-->
<label class="rowlabel">
<input class="releasenotes" type="checkbox" name="attr_releasenotes10028" value="1"/><span class="releasenotesVersion">
+65 -1
View File
@@ -6,7 +6,7 @@
"compendium": "SWADE",
"preview": "OfficialSavageWorldsCharacterSheet.jpg",
"legacy": false,
"instructions": "# Official Savage Worlds Character Sheet\r\r### version 1.00.28 \r\r## Character Sheet\r\r* This is the Official Savage Worlds Character Sheet.\r* Supports Wild Cards and Extras\r* Dice rolling\r* various setting rules\r\r## Custom Configuration\r\rTo configure the sheet to meet your needs, click the crossed hammer and wrench.\r\r## Skills\r\r* All skills from the SWADE rules are available, with the ability to change their names. To pick your skills, click the crossed hammer and wrench next to the Skills heading and place a check mark next to each skill you'd like to use.\r* If you need to make a skill an Unskilled roll, you can either use the Unskilled \"skill\" OR place a -2 in the skill modifier field.\r\r## Additional Notes\r\r* More info about individual sections can be found in the Documentation wiki.\r* If there's something you want added, or you'd like to report a bug, feel free to join the Official Savage Worlds Character Sheet Game (https://app.roll20.net/join/8109876/l20ASw). That game has forums for Bug Reports and Enhancement Requests.\r\r---",
"instructions": "# Official Savage Worlds Character Sheet\r\r### version 1.00.29 \r\r## Character Sheet\r\r* This is the Official Savage Worlds Character Sheet.\r* Supports Wild Cards and Extras\r* Dice rolling\r* various setting rules\r\r## Custom Configuration\r\rTo configure the sheet to meet your needs, click the crossed hammer and wrench.\r\r## Skills\r\r* All skills from the SWADE rules are available, with the ability to change their names. To pick your skills, click the crossed hammer and wrench next to the Skills heading and place a check mark next to each skill you'd like to use.\r* If you need to make a skill an Unskilled roll, you can either use the Unskilled \"skill\" OR place a -2 in the skill modifier field.\r\r## Additional Notes\r\r* More info about individual sections can be found in the Documentation wiki.\r* If there's something you want added, or you'd like to report a bug, feel free to join the Official Savage Worlds Character Sheet Game (https://app.roll20.net/join/8109876/l20ASw). That game has forums for Bug Reports and Enhancement Requests.\r\r---",
"useroptions": [
{
"attribute": "WCI",
@@ -63,6 +63,70 @@
"description": "Selecting this option will show the Token (or Avatar) associated with the character sheet. If neither a token nor an avatar are assigned to the character, this option will automatically deselect.",
"descriptiontranslationkey": "show-token-paragraph"
},
{
"attribute": "logo",
"displayname": "Logo to show",
"displaytranslationkey": "logo-to-show",
"type": "select",
"options": [
"Savage Worlds|SavageWorlds",
"Deadlands|Deadlands",
"Pathfinder for Savage Worlds|Pathfinder",
"Rifts|Rifts",
"Custom|Custom"
],
"optiontranslationkeys": [
"savage-worlds",
"deadlands",
"pathfinder-for-savage-worlds",
"rifts",
"custom"
],
"default": "SavageWorlds",
"description": "Select a logo a to display on the character sheet. If you select Custom, use the field below (Logo URL) to indicate the url where the logo image is located.",
"descriptiontranslationkey": "logo-to-show-paragraph"
},
{
"attribute": "logoURL",
"displayname": "Custom Logo URL",
"displaytranslationkey": "custom-logo-url",
"type": "text",
"default": "",
"description": "URL to the (custom) logo image you want to use on your character.",
"descriptiontranslationkey": "custom-logo-url-paragraph"
},
{
"attribute": "background",
"displayname": "Sheet Background",
"displaytranslationkey": "sheet-background",
"type": "select",
"options": [
"No Background Image|0",
"SWADE Parchment|1",
"Seamless Parchment|2",
"Gray Hex|3",
"Custom|4"
],
"optiontranslationkeys": [
"no-background-image",
"swade-parchment",
"seamless-parchment",
"gray-hex",
"custom"
],
"default": "1",
"description": "Select a background image for the character sheet. If you select Custom, use the field below (Custom Background URL) to indicate the url where the background image is located.",
"descriptiontranslationkey": "background-to-show-paragraph"
},
{
"attribute": "backgroundurl",
"displayname": "Custom Logo URL",
"displaytranslationkey": "custom-logo-url",
"type": "text",
"default": "",
"description": "URL to the (custom) logo image you want to use on your character.",
"descriptiontranslationkey": "custom-logo-url-paragraph"
},
{
"attribute": "dark_mode",
"displayname": "Dark Mode (inverted colors)",
+11 -1
View File
@@ -1045,5 +1045,15 @@
"token-in-rolltemplate-not-showing": "Fixed an issue where if the character sheet didn't have a token assigned, the roll template would still attempt to show the image. Now, if a token is not assigned, the sheet will look to see if an Avatar is assigned for the character and if so, it will use that; if neither a token nor an avatar are assigned, the sheet will uncheck the setting to display the token on the roll template.",
"add-artificer-support": "Added support for the Artificer Edge and Arcane Devices; sometimes the user needs to use the Caster's arcane skill, it is now possible to designate an Arcane skill for a weapon. The skill must be checked and configured properly for it to show up in the list of options. Because the user may be using another character's Arcane skill, it's recommended that you add that skill and configure it as temporarily boosted to get the appropriate rank.",
"hide-arcane-skills-in-weapons": "Fixed an issue where the arcane skill (Weird Science) wasn't hidden if the user didn't have Weird Science.",
"weapon-shooting-not-rolling-wild-die": "Fixed an issue where rolling Shooting (or Weird Science) from a weapon was not including the Wild Die roll. This fix should automatically fix any broken skills on the sheet, but if for some reason it doesn't, simply change the skill to a different one and then switch it back."
"weapon-shooting-not-rolling-wild-die": "Fixed an issue where rolling Shooting (or Weird Science) from a weapon was not including the Wild Die roll. This fix should automatically fix any broken skills on the sheet, but if for some reason it doesn't, simply change the skill to a different one and then switch it back.",
"custom": "Custom",
"logo-url": "Logo URL",
"background-url": "Background URL",
"logo-to-show-paragraph": "Select a logo a to display on the character sheet. If you select Custom, use the field below (Logo URL) to indicate the url where the logo image is located.",
"custom-logo-url": "Custom Logo URL",
"custom-logo-url-paragraph": "URL to the (custom) logo image you want to use on your character.",
"background-to-show-paragraph": "Select a background image for the character sheet. If you select Custom, use the field below (Custom Background URL) to indicate the url where the background image is located.",
"custom-logo": "Added the ability to assign your own custom logo to the sheet",
"custom-background": "Added the ability to assign your own custom background to the sheet",
"wounds-remaining": "Added a field that calculates the number of wounds remaining"
}