From 619b0e04fb40de888d698ca64bcc906b1c8f0df9 Mon Sep 17 00:00:00 2001 From: mfcp-git <68969644+mfcp-git@users.noreply.github.com> Date: Wed, 10 Mar 2021 16:50:20 +0000 Subject: [PATCH] [Mongoose_Traveller2e] Add fractions weights, fix ship name Fixed ship name/class/TL saving on ship sheet Modified Inventory to have a carried checkbox to only count weight of carried items. Modified weights in inventory and combat sheet to be sub-kilo. --- Mongoose_Traveller2e/MongooseTraveller.css | 62 +++++++++++++++-- Mongoose_Traveller2e/MongooseTraveller.html | 75 ++++++++++++--------- Mongoose_Traveller2e/translation.json | 1 + 3 files changed, 101 insertions(+), 37 deletions(-) diff --git a/Mongoose_Traveller2e/MongooseTraveller.css b/Mongoose_Traveller2e/MongooseTraveller.css index ff56fa69a1..7386a287a4 100644 --- a/Mongoose_Traveller2e/MongooseTraveller.css +++ b/Mongoose_Traveller2e/MongooseTraveller.css @@ -102,10 +102,11 @@ input[type="number"].sheet-input_II { display: inline-block; border: 1px dotted gray; margin: 0px; - width:60px; + width:50px; background-color: transparent; + -moz-appearance: textfield; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); box-shadow: inset 0 1px 1px rgba(0,0,0,0.075); @@ -121,6 +122,16 @@ input[type="number"].sheet-input_II { border-radius: 3px; } +input[type="number"].sheet-input_II::-webkit-outer-spin-button, +input[type="number"].sheet-input_II::-webkit-inner-spin-button, +input[type="number"].sheet-armourweight::-webkit-outer-spin-button, +input[type="number"].sheet-armourweight::-webkit-inner-spin-button, +input[type="number"].sheet-weaponweight::-webkit-outer-spin-button, +input[type="number"].sheet-weaponweight::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + .sheet-bold { font-weight: bold; } @@ -213,6 +224,7 @@ input[type="number"].sheet-input_II { .sheet-th { font-size: 13px; font-weight: bold; + text-align: center; } .sheet-weaponroll, @@ -242,8 +254,8 @@ input[type="number"].sheet-input_II { .sheet-weaponrange { width: 73px; } -.sheet-weaponweight { - width: 48px; +input.sheet-weaponweight { + width: 58px; } .sheet-weaponmag { width: 209px; @@ -703,7 +715,49 @@ input.sheet-untrained[type="checkbox"]:checked + span::before box-shadow: none; } - /*------------------------------*/ + /* -----Fake sheet-arrow checkbox----- */ + +input.sheet-carried[type="checkbox"] +{ + opacity: 0; + width: 16px; + height: 16px; + position: relative; + top: 0px; + left: 0px; + margin-right: -10px; + cursor: pointer; + z-index: 1; +} + +input.sheet-carried[type="checkbox"] + span::before +{ + position: relative; + top: 0px; + left: 0px; + color:red; + text-shadow: none; + margin-right: 4px; + line-height: 14px; + text-align: center; + display: inline-block; + vertical-align: middle; + font-family: "Pictos"; + content: "D"; + width: 14px; + height: 14px; + font-size: 12px; + box-shadow: none; +} +input.sheet-carried[type="checkbox"]:checked + span::before +{ + color:green; + content: "3"; + box-shadow: none; +} + + +/*------------------------------*/ /*------------------------------*/ /*------- Shhet crate ---------*/ /*------------------------------*/ diff --git a/Mongoose_Traveller2e/MongooseTraveller.html b/Mongoose_Traveller2e/MongooseTraveller.html index 64ce87b74e..14b896e0fc 100644 --- a/Mongoose_Traveller2e/MongooseTraveller.html +++ b/Mongoose_Traveller2e/MongooseTraveller.html @@ -2096,16 +2096,16 @@

Gear

- +
- + - - + +
Total Gear WeightTotal Gear Weight
@@ -2114,37 +2114,45 @@
+ + + + - + - + - + - +
Carried
Gear Quantity KG each
+ + + + - + - + - + - +
Carried
Gear Quantity KG each
@@ -2220,7 +2228,7 @@ - + - + - +
 
@@ -2311,7 +2319,7 @@ - +
 
@@ -2327,7 +2335,7 @@ - +
 
@@ -2343,7 +2351,7 @@ - +
 
@@ -2359,7 +2367,7 @@ - +
 
@@ -2375,7 +2383,7 @@ - +
 
@@ -2392,7 +2400,7 @@ - +
 
@@ -2605,9 +2613,9 @@
- - - + + +

@@ -3797,33 +3805,34 @@ var TAS = TAS || (function(){ /* ---- END: TheAaronSheet.js ---- */ -on('change:repeating_othergear', function(){ +on('change:repeating_othergear remove:repeating_othergear', function(){ TAS.repeatingSimpleSum('othergear','masstotalright','weightright'); }); -on('change:repeating_othergear', function(){ +on('change:repeating_othergear remove:repeating_othergear', function(){ TAS.repeatingSimpleSum('othergear','masstotalleft','weightleft'); }); //Total Weight on("change:weightright change:weightleft sheet:opened", function() { getAttrs(["weightright", "weightleft"], function(values) { + const tw = parseFloat(values.weightright) + parseFloat(values.weightleft); setAttrs({ - totalweight: (+values.weightright + +values.weightleft) + totalweight: tw.toFixed(2) }); }); }); -on("change:repeating_othergear:massleft change:repeating_othergear:quantityleft sheet:opened", function() { - getAttrs(["repeating_othergear_massleft", "repeating_othergear_quantityleft"], function(values) { +on("change:repeating_othergear:massleft change:repeating_othergear:quantityleft change:repeating_othergear:equippedleft sheet:opened", function() { + getAttrs(["repeating_othergear_massleft", "repeating_othergear_quantityleft", "repeating_othergear_equippedleft"], function(values) { setAttrs({ - repeating_othergear_masstotalleft: (parseInt(values.repeating_othergear_massleft)) * (parseInt(values.repeating_othergear_quantityleft)) + repeating_othergear_masstotalleft: (parseFloat(values.repeating_othergear_massleft).toFixed(2)) * (parseInt(values.repeating_othergear_quantityleft) * parseInt(values.repeating_othergear_equippedleft)) }); }); }); -on("change:repeating_othergear:massright change:repeating_othergear:quantityright sheet:opened", function() { - getAttrs(["repeating_othergear_massright", "repeating_othergear_quantityright"], function(values) { +on("change:repeating_othergear:massright change:repeating_othergear:quantityright change:repeating_othergear:equippedright sheet:opened", function() { + getAttrs(["repeating_othergear_massright", "repeating_othergear_quantityright", "repeating_othergear_equippedright"], function(values) { setAttrs({ - repeating_othergear_masstotalright: (parseInt(values.repeating_othergear_massright)) * (parseInt(values.repeating_othergear_quantityright)) + repeating_othergear_masstotalright: (parseFloat(values.repeating_othergear_massright).toFixed(2)) * (parseInt(values.repeating_othergear_quantityright) * parseInt(values.repeating_othergear_equippedright)) }); }); }); diff --git a/Mongoose_Traveller2e/translation.json b/Mongoose_Traveller2e/translation.json index aaefb948b3..806d75928f 100644 --- a/Mongoose_Traveller2e/translation.json +++ b/Mongoose_Traveller2e/translation.json @@ -52,6 +52,7 @@ "gearcell-u": "Gear", "gearquantity-u": "Quantity", "gearweight-u": "KG each", + "gearequipped-u": "Carried", "financestitle-u": "Finances", "pension-u": "Pension", "debt-u": "Debt",