diff --git a/The Fantasy Trip/TFT.css b/The Fantasy Trip/TFT.css
index dfb0dc28b6..f91f338873 100644
--- a/The Fantasy Trip/TFT.css
+++ b/The Fantasy Trip/TFT.css
@@ -94,13 +94,14 @@ body.sheet-darkmode .charsheet {
content: "y"
}
+/* the weapon and spell selection button */
.sheet-select-button
{
font-family: "Pictos";
display: inline-block;
border-style: solid;
height: 1rem;
- width: 0rem;
+ width: .1rem;
border-radius: .75rem;
border-width: 1px;
/*font-weight: bold;*/
@@ -108,6 +109,23 @@ body.sheet-darkmode .charsheet {
text-align: center;
}
+/* our custom checkboxes */
+.sheet-checkbox-button
+{
+ font-family: "Pictos";
+ display: inline-block;
+ border-style: solid;
+ height: 1rem;
+ width: .03rem;
+ border-radius: .35rem;
+ border-width: 1px;
+ margin-left: .2rem;
+ align-self: center;
+ text-align: center;
+ font-size: smaller;
+}
+
+
.sheet-attack-button {
display: inline-block;
border-style: solid;
@@ -147,15 +165,31 @@ body.sheet-darkmode .charsheet {
.sheet-expand-button,
.sheet-describe-button,
.sheet-select-button,
+.sheet-checkbox-button,
.sheet-attack-button,
.sheet-dice-button {
background-color: #F9F9F9;
border-color: #BBBBBB;
}
+/* A bit darker because checkboxes, not real buttons. */
+.sheet-checkbox-button {
+ border-color: #767676;
+}
+
+/* a white check */
+.sheet-checkbox-checkbox:checked + button::after {
+ color: white;
+}
+
+body.sheet-darkmode .sheet-checkbox-checkbox:checked + button::after {
+ color: black;
+}
+
body.sheet-darkmode .sheet-expand-button,
body.sheet-darkmode .sheet-describe-button,
body.sheet-darkmode .sheet-select-button,
+body.sheet-darkmode .sheet-checkbox-button,
body.sheet-darkmode .sheet-attack-button,
body.sheet-darkmode .sheet-dice-button {
background-color: #202020;
@@ -166,6 +200,7 @@ body.sheet-darkmode .sheet-dice-button {
.sheet-expand-button:hover,
.sheet-describe-button:hover,
.sheet-select-button:hover,
+.sheet-checkbox-button:hover,
.sheet-attack-button:hover,
.sheet-dice-button:hover {
background-color: #EBEBEB;
@@ -174,6 +209,7 @@ body.sheet-darkmode .sheet-dice-button {
.sheet-expand-button:active,
.sheet-describe-button:active,
.sheet-select-button:active,
+.sheet-checkbox-button:active,
.sheet-attack-button:active,
.sheet-dice-button:active {
background-color: #E1E1E1;
@@ -687,10 +723,27 @@ body.sheet-darkmode .charsheet .sheet-selected-tab {
background-color: #272730;
}
+/* Make the button after the checked radio button be blue */
+/* See we actually hide the checkbox, but make a button after it */
.charsheet .sheet-select-radio:checked + button {
background-color: blue;
}
+.charsheet .sheet-checkbox-checkbox:checked + button {
+ background-color: #0060ff;
+}
+.charsheet .sheet-checkbox-checkbox:checked + button:hover {
+ background-color: blue;
+}
+
+.charsheet .sheet-checkbox-checkbox:checked + button::after {
+ /*content: "3"; 3 is check*/
+ content: "*"; /* x */
+ position: relative;
+ right: .4rem;
+ bottom: .4rem;
+}
+
.charsheet .sheet-nowrap {
white-space : nowrap;
}
diff --git a/The Fantasy Trip/TFT.html b/The Fantasy Trip/TFT.html
index 1be2bfc9ac..e1ff1e1399 100644
--- a/The Fantasy Trip/TFT.html
+++ b/The Fantasy Trip/TFT.html
@@ -267,7 +267,7 @@
Lbs
NC
-
+
@@ -283,7 +283,8 @@
-
+
+
@@ -373,7 +374,7 @@
NC
-
+
@@ -388,7 +389,8 @@
-
+
+
@@ -408,7 +410,7 @@
Lbs
NC
-
+
@@ -420,7 +422,8 @@
-
+
+
@@ -856,6 +859,10 @@
// Safe method to get a repeating property.
const getFloatProperty = function(v, repName, id, itemName) {
let property = repeatingPropertyName(repName, id, itemName);
+ if (v[property] == 'on')
+ {
+ return 1
+ }
let val = parseFloat(v[property]);
return isNaN(val) ? 0 : val;
}
@@ -1008,6 +1015,20 @@
});
}
+ // toggle this not carried. id starts with repeating_[weapon][spell] or any of them, really.
+ const toggleNotCarried = function(id) {
+ let selected = (id + "_notcarried").toLowerCase();
+ getAttrs([selected], function(values) {
+ let oldValue = values[selected];
+ let newValue = (oldValue == 'on' ? 0 : 'on');
+ let valueMap = {};
+ // toggle this one, turn off the rest.
+ valueMap[selected] = newValue;
+ // Can't be silent, has to tell them.
+ setAttrs(valueMap);
+ });
+ }
+
// select this weapon or spell, id starts with repeating_[weapon][spell]
const selectWeaponOrSpell = function(id) {
// get them all, and de check any not me...
@@ -1018,7 +1039,7 @@
let oldValue = values[selected];
let newValue = (oldValue == 'on' ? 0 : 'on');
let valueMap = {};
- // toggle this one, turn off the rest.
+ // toggle this one, turn off the rest
valueMap[selected] = newValue;
// Radio button the rest.
@@ -1533,14 +1554,17 @@
});
});
- // Weapons Select/Expand/Describe
+ // Weapons Select/Expand/Describe/NC
on('clicked:repeating_weapons', (info) => {
let name = info.htmlAttributes.name;
let id = info.sourceAttribute;
if (name == 'act_select') {
selectWeaponOrSpell(id);
}
- if (name == 'act_describe') {
+ else if (name == 'act_check_notcarried') {
+ toggleNotCarried(id);
+ }
+ else if (name == 'act_describe') {
describeItem(id + '_weaponname', id + '_description',
['To Hit', id + '_tohit'
, 'Damage', id + '_weapondamage'
@@ -1588,11 +1612,13 @@
});
/* Armor Handlers */
- // Expand or describe a talent.
+ // Armor expand/describe/notcarried
on('clicked:repeating_armor', (info) => {
let id = info.sourceAttribute;
let name = info.htmlAttributes.name;
- if (name == 'act_describe') {
+ if (name == 'act_check_notcarried') {
+ toggleNotCarried(id);
+ } else if (name == 'act_describe') {
describeItem(id + '_defensename', id + '_description',
['Hits Blocked', id + '_hitsblocked',
'Minus to Hit', id + '_minustohit',
@@ -1607,11 +1633,13 @@
});
/* Equipment Handlers */
- // Expand or describe a talent.
+ // Expand/Describe/NotCarried a talent.
on('clicked:repeating_equipment', (info) => {
let id = info.sourceAttribute;
let name = info.htmlAttributes.name;
- if (name == 'act_describe') {
+ if (name == 'act_check_notcarried') {
+ toggleNotCarried(id);
+ } else if (name == 'act_describe') {
describeItem(id + '_name', id + '_description',
['Count', id + '_count',
'Weight', id + '_weight',
@@ -1680,7 +1708,6 @@
getSectionIDs("armor", function(v) {grabIds(v, 'armor', 'minustohit', '', 'notcarried', 'nonflanking', idCallback);});
});
-
on('sheet:opened change:st change:hits change:fatigue', function() {
getAttrs(['st', 'hits', 'fatigue'], function(v) {
let hitpoints = v.st - v.hits - v.fatigue;