Updates to Fate Core V2 Sheet (#5271)

* Initial commit for a better Fate Core character sheet. Still a WIP, but has all basic elements.

* Added in User Options and a Settings page

Added a message for first time users to better understand how the sheet works
Added a way to auto setup default Stress and Consequences
Bound Stress tracks will now update when the Skill changes

* Add option to make the Ladder rollable

* Redesign the Settings Page

* Option added to hide the Fate Points section of the sheet for NPCs and Extras.

Settings now wrap.

* Implementing Conditions from Fate Toolkit
This commit is contained in:
MagooChris
2019-07-09 07:48:25 -05:00
committed by Cassie Levett
parent 4efffc72cc
commit f3718ae42c
3 changed files with 367 additions and 102 deletions
+83 -4
View File
@@ -446,10 +446,11 @@ button[type=roll]:hover,
}
.sheet-section-id-info {
max-width: calc(100% - 75px);
max-width: 100%;
}
.sheet-section-id-fatepoints {
display: none;
max-width: 65px;
float: right;
}
@@ -459,6 +460,14 @@ button[type=roll]:hover,
text-align: center;
}
.sheet-fatepoints-flag:checked ~ .sheet-section-id-info {
max-width: calc(100% - 75px);
}
.sheet-fatepoints-flag:checked ~ .sheet-section-id-fatepoints {
display: block;
}
/* === ASPECT === */
.sheet-section-aspects {
padding-right: 2.5px
@@ -684,6 +693,7 @@ span.sheet-stress-header-skill:empty:after {
}
/* === CONSEQUENCES === */
.sheet-section-conditions,
.sheet-section-consequences {
padding-left: 2.5px;
}
@@ -701,6 +711,13 @@ span.sheet-stress-header-skill:empty:after {
top: -0.5em;
}
.sheet-conditions-row .sheet-worth-value {
position: relative;
top: -0.25em;
right: -0.5em;
font-weight: bold;
}
.sheet-worth-text {
margin-left: -3px !important;
}
@@ -709,16 +726,78 @@ span.sheet-stress-header-skill:empty:after {
width: 90px;
display: inline-block;
}
.sheet-consequence-aspect {
width: calc(100% - 120px);
vertical-align: middle;
flex-grow: 1;
}
span.sheet-consequence-healing {
font-family: 'pictos';
margin-left: -1.5px !important;
}
.sheet-consequence-healing input[type="checkbox"]::before {
position: relative;
top: -0.65em;
right: 0.5em;
font-weight: bold;
font-family: 'pictos';
content: "k";
}
.sheet-conditions-row .sheet-consequence-worth,
.sheet-consequence-healing {
width: 35px;
}
.sheet-section-conditions,
.sheet-conditions-flag:checked ~ .sheet-section-consequences {
display: none;
}
.sheet-conditions-flag:checked ~ .sheet-section-conditions {
display: block;
}
.sheet-conditions-row,
.sheet-consequence-row {
display: flex;
align-items: center;
}
.sheet-display .sheet-conditions-row,
.sheet-section-conditions .sheet-display .repcontrol[data-groupname="repeating_consequences"] {
display: none;
}
.sheet-section-conditions .sheet-conditions-group8 input.sheet-conditions-filter[type="hidden"][value="8"] ~ .sheet-conditions-row,
.sheet-section-conditions .sheet-conditions-group7 input.sheet-conditions-filter[type="hidden"][value="7"] ~ .sheet-conditions-row,
.sheet-section-conditions .sheet-conditions-group6 input.sheet-conditions-filter[type="hidden"][value="6"] ~ .sheet-conditions-row,
.sheet-section-conditions .sheet-conditions-group5 input.sheet-conditions-filter[type="hidden"][value="5"] ~ .sheet-conditions-row,
.sheet-section-conditions .sheet-conditions-group4 input.sheet-conditions-filter[type="hidden"][value="4"] ~ .sheet-conditions-row,
.sheet-section-conditions .sheet-conditions-group3 input.sheet-conditions-filter[type="hidden"][value="3"] ~ .sheet-conditions-row,
.sheet-section-conditions .sheet-conditions-group2 input.sheet-conditions-filter[type="hidden"][value="2"] ~ .sheet-conditions-row,
.sheet-section-conditions .sheet-conditions-group1 input.sheet-conditions-filter[type="hidden"][value="1"] ~ .sheet-conditions-row {
display: flex;
}
/* === SETTINGS === */
.sheet-settings {
display: flex;
flex-wrap: wrap;
}
.sheet-setting {
width: 200px;
margin: 4px;
padding: 4px;
box-sizing: border-box;
}
.sheet-setting input[type="text"],
.sheet-setting select {
width: 100%;
}
/* === ROLL TEMPLATE === */
.sheet-rolltemplate-fatepoints .sheet-rollTemplate,
.sheet-rolltemplate-refresh .sheet-rollTemplate,
+274 -97
View File
@@ -76,6 +76,7 @@
<div class="sheet-header">
<span>ID</span>
</div>
<input class="sheet-fatepoints-flag sheet-hidden" type="checkbox" name="attr_show_fatepoints_flag" value="1" checked />
<div class="sheet-section sheet-section-id-info">
<div class="sheet-repitem">
<input type="text" name="attr_character_name" placeholder="Name" />
@@ -773,6 +774,7 @@
</fieldset>
</div>
<input class="sheet-conditions-flag sheet-hidden" type="checkbox" name="attr_show_conditions_flag" value="1" />
<div class="sheet-section-consequences sheet-section sheet-half">
<div class="sheet-header">
<span>CONSEQUENCES</span>
@@ -786,12 +788,13 @@
<input class="sheet-options-flag sheet-hidden" type="checkbox" name="attr_options_flag" checked="checked" />
<div class="sheet-options">
<select name="attr_worth">
<option value=2><span>Mild</span> (2)</option>
<option value=2 selected><span>Mild</span> (2)</option>
<option value=4><span>Moderate</span> (4)</option>
<option value=6><span>Severe</span> (6)</option>
<option value=8><span>Extreme</span> (8)</option>
</select>
<input type="hidden" name="attr_worth_text" value="Mild"/>
<input type="checkbox" name="attr_isUsed" class="sheet-hidden" value="1" />
<div class="sheet-item-options sheet-consequence-edit">
<input class="sheet-item-options-flag" type="checkbox" name="attr_options_flag" checked="checked" />
<span>3</span>
@@ -809,6 +812,101 @@
</div>
</fieldset>
</div>
<div class="sheet-section-conditions sheet-section sheet-half">
<div class="sheet-header">
<span>CONDITIONS</span>
<div class="sheet-section-options">
<input class="sheet-section-options-flag" type="checkbox" name="attr_consequences_options_flag" checked="checked" />
<span>p</span>
</div>
</div>
<div class="sheet-repitem sheet-conditions-row">
<span class="sheet-consequence-worth"></span>
<span class="sheet-consequence-healing">k</span>
<span class="sheet-consequence-aspect">Aspect</span>
</div>
<input class="sheet-options-flag sheet-hidden" type="checkbox" name="attr_consequences_options_flag" checked="checked" />
<div class="sheet-options">
<fieldset class="repeating_consequences">
<div class="sheet-conditions-row">
<select name="attr_worth">
<option value=1 selected><span>Fleeting</span> (1)</option>
<option value=2><span>Sticky</span> (2)</option>
<option value=4><span>Lasting</span> (4)</option>
</select>
<input type="hidden" name="attr_worth_text" value="Fleeting"/>
<input type="text" name="attr_aspect" placeholder="Aspect" />
<input type="checkbox" name="attr_isUsed" class="sheet-hidden" value="1" />
<input type="checkbox" name="attr_isHealing" class="sheet-hidden" value="1" />
</div>
</fieldset>
</div>
<div class="sheet-display">
<div class="sheet-conditions-group1">
<h3><span>Fleeting</span></h3>
<fieldset class="repeating_consequences">
<input type="hidden" name="attr_worth" class="sheet-conditions-filter" />
<input type="hidden" name="attr_worth_text" />
<div class="sheet-conditions-row">
<div class="sheet-consequence-worth">
<span class="sheet-worth-value" name="attr_worth"></span>
<input type="checkbox" name="attr_isUsed" value="1" />
</div>
<div class="sheet-consequence-healing">
<input type="checkbox" name="attr_isHealing" value="1" class="sheet-hidden" />
</div>
<div class="sheet-consequence-aspect">
<button type="roll" class="sheet-action-button" name="roll_consequenceRoll" value="&{template:consequence} @{rollTemplate_showCharName} {{fatePoints=@{fatepoints}}} @{rollTemplate_showInfo} {{worth=@{worth}}} {{worthText=@{worth_text}}} {{aspect=@{aspect}}} {{isHealing=[[@{isHealing}]]}}">
<span name="attr_aspect"></span>
</button>
</div>
</div>
</fieldset>
</div>
<div class="sheet-conditions-group2">
<h3><span>Sticky</span></h3>
<fieldset class="repeating_consequences">
<input type="hidden" name="attr_worth" class="sheet-conditions-filter" />
<input type="hidden" name="attr_worth_text" />
<div class="sheet-conditions-row">
<div class="sheet-consequence-worth">
<span class="sheet-worth-value" name="attr_worth"></span>
<input type="checkbox" name="attr_isUsed" value="1" />
</div>
<div class="sheet-consequence-healing">
<input type="checkbox" name="attr_isHealing" value="1" class="sheet-hidden" />
</div>
<div class="sheet-consequence-aspect">
<button type="roll" class="sheet-action-button" name="roll_consequenceRoll" value="&{template:consequence} @{rollTemplate_showCharName} {{fatePoints=@{fatepoints}}} @{rollTemplate_showInfo} {{worth=@{worth}}} {{worthText=@{worth_text}}} {{aspect=@{aspect}}} {{isHealing=[[@{isHealing}]]}}">
<span name="attr_aspect"></span>
</button>
</div>
</div>
</fieldset>
</div>
<div class="sheet-conditions-group4">
<h3><span>Lasting</span></h3>
<fieldset class="repeating_consequences">
<input type="hidden" name="attr_worth" class="sheet-conditions-filter" />
<input type="hidden" name="attr_worth_text" />
<div class="sheet-conditions-row">
<div class="sheet-consequence-worth">
<span class="sheet-worth-value" name="attr_worth"></span>
<input type="checkbox" name="attr_isUsed" value="1" />
</div>
<div class="sheet-consequence-healing">
<input type="checkbox" name="attr_isHealing" value="1" />
</div>
<div class="sheet-consequence-aspect">
<button type="roll" class="sheet-action-button" name="roll_consequenceRoll" value="&{template:consequence} @{rollTemplate_showCharName} {{fatePoints=@{fatepoints}}} @{rollTemplate_showInfo} {{worth=@{worth}}} {{worthText=@{worth_text}}} {{aspect=@{aspect}}} {{isHealing=[[@{isHealing}]]}}">
<span name="attr_aspect"></span>
</button>
</div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="sheet-break"></div>
@@ -859,104 +957,133 @@
<div class="sheet-tab-content sheet-tab4">
<h1>Settings</h1>
<div class="sheet-section sheet-quarter">
<div class="sheet-section">
<div class="sheet-header">
<span>Show First Time Hints</span>
<span>Display Options</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_hints_flag" checked="checked" />
<p><span>Show hints that might be useful for first time players or those upgrading from the previous sheet design.</span></p>
<div class="sheet-settings">
<div class="sheet-setting">
<div class="sheet-header">
<span>Show First Time Hints</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_hints_flag" checked="checked" />
<p><span>Show hints that might be useful for first time players or those upgrading from the previous sheet design.</span></p>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Show Phase 0 Tab</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_phase0_flag" checked="checked" />
<p><span>If you are starting with a Phase 0, then you can use this tab to build up your ideas.</span></p>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Show Notes Tab</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_notesTab_flag" />
<p><span>Set this if you would prefer the notes to show on a Tab of their own.</span></p>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Rollable Ladder</span>
</div>
<div>
<input type="checkbox" class="sheet-ladder-rollable" value="1" name="attr_ladder_rollable_flag" checked="checked" />
<p><span>Make the values on the Ladder rollable.</span></p>
<div class="sheet-ladder-rollable-true">
<select name="attr_ladderRollLabel">
<option value="&nbsp;" selected>Blank</option>
<option value="?{Skill?}">Ask on roll</option>
</select>
<p><span>When rolling from the ladder, what header should be used?</span></p>
</div>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Show Fate Points</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_fatepoints_flag" checked="checked" />
<p><span>NPCs and Extras don't usually have their own Fate Points so uncheck this to hide the Fate Points and Refresh boxes</span></p>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Use Conditions instead of Consequences</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_conditions_flag">
<p><span>Use the Conditions from the Fate Toolkit to replace Consequences</span></p>
</div>
</div>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-section">
<div class="sheet-header">
<span>Show Phase 0 Tab</span>
<span>Roll Options</span>
</div>
<div class="sheet-settings">
<div class="sheet-setting">
<div class="sheet-header">
<span>Show Help Info on Rolls</span>
</div>
<div>
<input type="checkbox" value="{{showInfo=1}}" name="attr_rollTemplate_showInfo" checked="checked" />
<p><span>Show hints that might be useful for first time players on rolls.</span></p>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Show Character Name on Rolls</span>
</div>
<div>
<input type="checkbox" value="{{charname=@{character_name}}}" name="attr_rollTemplate_showCharName" checked="checked" />
<p><span>Show the Character's name on the Roll output. This is useful when rolling other character's Aspects.</span></p>
</div>
</div>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_phase0_flag" checked="checked" />
<p><span>If you are starting with a Phase 0, then you can use this tab to build up your ideas.</span></p>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-header">
<span>Show Notes Tab</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_notesTab_flag" />
<p><span>Set this if you would prefer the notes to show on a Tab of their own.</span></p>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-header">
<span>Show Help Info on Rolls</span>
</div>
<div>
<input type="checkbox" value="{{showInfo=1}}" name="attr_rollTemplate_showInfo" checked="checked" />
<p><span>Show hints that might be useful for first time players on rolls.</span></p>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-header">
<span>Show Character Name on Rolls</span>
</div>
<div>
<input type="checkbox" value="{{charname=@{character_name}}}" name="attr_rollTemplate_showCharName" checked="checked" />
<p><span>Show the Character's name on the Roll output. This is useful when rolling other character's Aspects.</span></p>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-section">
<div class="sheet-header">
<span>Run First Time Setup</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_run_firstTime_setup" checked="checked" />
<p><span>Run scripts to setup the sheet for a default character.</span></p>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-header">
<span>Default Stresses and Skills</span>
</div>
<div>
<input type="text" value="Physical:Physique,Mental:Will" name="attr_default_stressSkills" />
<p><span>When setting up a default sheet, what stress tracks and their guiding skill should be set up? e.g. "Mental:Will,Extra:3"</span></p>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-header">
<span>Default Consequences</span>
</div>
<div>
<input type="text" value="2,4,6" name="attr_default_consequences" />
<p><span>When setting up a default sheet, what consequences are the default consequences? e.g. "2,4,6"</span></p>
</div>
</div>
<div class="sheet-section sheet-quarter">
<div class="sheet-header">
<span>Rollable Ladder</span>
</div>
<div>
<input type="checkbox" class="sheet-ladder-rollable" value="1" name="attr_ladder_rollable_flag" checked="checked" />
<p><span>Make the values on the Ladder rollable.</span></p>
<div class="sheet-ladder-rollable-true">
<select name="attr_ladderRollLabel">
<option value="&nbsp;" selected>Blank</option>
<option value="?{Skill?}">Ask on roll</option>
</select>
<p><span>When rolling from the ladder, what header should be used?</span></p>
<span>Game Defaults</span>
</div>
<div class="sheet-settings">
<div class="sheet-setting">
<div class="sheet-header">
<span>Run First Time Setup</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_run_firstTime_setup" checked="checked" />
<p><span>Run scripts to setup the sheet for a default character.</span></p>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Default Stresses and Skills</span>
</div>
<div>
<input type="text" value="Physical:Physique,Mental:Will" name="attr_default_stressSkills" />
<p><span>When setting up a default sheet, what stress tracks and their guiding skill should be set up? e.g. "Mental:Will,Extra:3"</span></p>
</div>
</div>
<div class="sheet-setting">
<div class="sheet-header">
<span>Default Consequences</span>
</div>
<div>
<input type="text" value="2,4,6" name="attr_default_consequences" />
<p><span>When setting up a default sheet, what consequences are the default consequences? e.g. "2,4,6"</span></p>
</div>
</div>
</div>
</div>
<!--
<div class="sheet-section sheet-quarter">
<div class="sheet-header">
<span>Show First Time Hints</span>
</div>
<div>
<input type="checkbox" value="1" name="attr_show_hints_flag" checked="checked" />
<p><span>Show hints that might be useful for first time players or those upgrading from the previous sheet design.</span></p>
</div>
</div>-->
</div>
</div>
@@ -1295,7 +1422,7 @@
</div>
</div>
</rolltemplate>
<rolltemplate class="sheet-rolltemplate-consequence">
<div class="sheet-rollTemplate">
<div class="sheet-fate-point-circle">
@@ -1323,7 +1450,7 @@
</div>
<div class="row">
{{^aspect}}
<p class="sheet-info"><span>Taking a Consequence is how real damage is dealt during a conflict. When you use a consequence slot, you reduce the shift value of the attack by the shift value of the consequence. You can use more than one consequence at a time if theyre available. Any of the hits remaining shifts must be handled by a stress box to avoid being taken out.</span></p>
<p class="sheet-info"><span>Taking a Consequence is how real damage is dealt during a conflict. When you use a consequence slot, you reduce the shift value of the attack by the shift value of the consequence. You can use more than one consequence at a time if they're available. Any of the hit's remaining shifts must be handled by a stress box to avoid being taken out.</span></p>
{{/aspect}}
{{#aspect}}
<p class="sheet-info"><span>Conflict has caused a lasting injury or setback for the character. The character that caused this gets a free Invoke of the aspect but anyone can invoke the aspect against the character if they know it is there.</span></p>
@@ -1365,10 +1492,11 @@
{{/showInfo}}
</div>
</rolltemplate>
<script type="text/worker">
on('sheet:opened', function () {
getAttrs(["run_firstTime_setup", "default_stressSkills", "default_consequences"], function (values) {
getAttrs(["run_firstTime_setup", "default_stressSkills",
"default_consequences", "show_conditions_flag"], function (values) {
if (Number(values["run_firstTime_setup"]) == 1) {
if (values["default_stressSkills"] != null || values["default_stressSkills"].trim() != "") {
getSectionIDs("repeating_stress", function (idArray) {
@@ -1407,13 +1535,19 @@
if (idArray.length == 0) {
var consequences = values["default_consequences"].split(",")
var newRowAttrs = {};
consequences.forEach(element => {
var worth = Number(element.trim());
consequences.forEach(consequence => {
var elements = consequence.split("|");
var worth = Number(elements[0].trim());
if (!isNaN(worth) && worth > 0) {
var newRowId = generateRowID();
newRowAttrs["repeating_consequences_" + newRowId + "_worth"] = worth;
newRowAttrs["repeating_consequences_" + newRowId + "_worth_text"] = getConsequenceText(worth);
newRowAttrs["repeating_consequences_" + newRowId + "_options_flag"] = 0;
if (elements.length > 1)
newRowAttrs["repeating_consequences_" + newRowId + "_aspect"] = elements[1];
if (values["show_conditions_flag"] == "1")
newRowAttrs["repeating_consequences_" + newRowId + "_worth_text"] = getConditionsText(worth);
else
newRowAttrs["repeating_consequences_" + newRowId + "_worth_text"] = getConsequenceText(worth);
}
});
setAttrs(newRowAttrs);
@@ -1427,7 +1561,37 @@
});
on("change:repeating_consequences:worth", function (eventInfo) {
setAttrs({ repeating_consequences_worth_text: getConsequenceText(Number(eventInfo.newValue)) });
getAttrs(["show_conditions_flag"], function (values) {
if (values["show_conditions_flag"] == "1")
setAttrs({ repeating_consequences_worth_text: getConditionsText(Number(eventInfo.newValue)) });
else
setAttrs({ repeating_consequences_worth_text: getConsequenceText(Number(eventInfo.newValue)) });
});
});
on("change:show_conditions_flag", function (eventInfo) {
getSectionIDs("repeating_consequences", function (idArray) {
if (idArray.length == 0)
return;
var attrs = [];
for (var i = 0; i < idArray.length; i++) {
attrs.push("repeating_consequences_" + idArray[i] + "_worth");
}
getAttrs(attrs, function (values) {
var newRowAttrs = {};
for (var i = 0; i < idArray.length; i++) {
var worth = Number(values["repeating_consequences_" + idArray[i] + "_worth"]);
if (eventInfo.newValue == "1")
newRowAttrs["repeating_consequences_" + idArray[i] + "_worth_text"] = getConditionsText(worth);
else
newRowAttrs["repeating_consequences_" + idArray[i] + "_worth_text"] = getConsequenceText(worth);
}
setAttrs(newRowAttrs);
});
});
});
on("change:repeating_skills:skill", function (eventInfo) {
@@ -1699,6 +1863,19 @@
}
};
function getConditionsText(worth) {
switch (Number(worth)) {
case 1:
return "Fleeting";
case 2:
return "Sticky";
case 4:
return "Lasting";
default:
return "Custom";
}
};
function getStressMax(skillShiftLevel) {
if (skillShiftLevel < 1) {
return 2;
+10 -1
View File
@@ -31,7 +31,7 @@
"displayname": "Default Stresses and Skills",
"displaytranslationkey": "DefaultStressSkill-Q",
"type": "text",
"default": "Physique",
"default": "Physical:Physique,Mental:Will",
"description": "When setting up a default sheet, what stress tracks and their guiding skill should be set up? e.g. \"Mental:Will,Extra:3\"",
"descriptiontranslationkey": "DefaultStressSkill-D"
},
@@ -44,6 +44,15 @@
"description": "When setting up a default sheet, what consequences are the default consequences? e.g. \"2,4,6\"",
"descriptiontranslationkey": "DefaultConsequences-D"
},
{
"attribute": "show_conditions_flag",
"displayname": "Use Conditions instead of Consequences",
"displaytranslationkey": "ShowConditions-Q",
"type": "checkbox",
"value": "1",
"description": "Use the Conditions from the Fate Toolkit to replace Consequences",
"descriptiontranslationkey": "ShowConditions-Q"
},
{
"attribute": "show_phase0_flag",
"displayname": "Show Phase 0 Tab",