[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.
This commit is contained in:
mfcp-git
2021-03-10 16:50:20 +00:00
parent d32e788069
commit 619b0e04fb
3 changed files with 101 additions and 37 deletions
+58 -4
View File
@@ -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 ---------*/
/*------------------------------*/
+42 -33
View File
@@ -2096,16 +2096,16 @@
<h3 data-i18n="geartitle-u">Gear</h3>
<div class='sheet-3colrow'>
<div class='sheet-col'>
<input type="number" class="sheet-hidden" name="attr_weightleft" value="0"/>
<input type="number" class="sheet-hidden" name="attr_weightleft" value="0" step="0.05"/>
</div>
<div class='sheet-col'>
</div>
<div class='sheet-col'>
<input type="number" class="sheet-hidden" name="attr_weightright" value="0" /></td>
<input type="number" class="sheet-hidden" name="attr_weightright" value="0" step="0.05"/></td>
<table class="sheet-skill" style="border:1px solid black;">
<tr>
<th data-i18n="totalgearweight-u"e>Total Gear Weight</th>
<td><input type="number" class="sheet-input" name="attr_totalweight" value="0" /></td>
<th data-i18n="totalgearweight-u">Total Gear Weight</th>
<td><input type="number" class="sheet-input_II" name="attr_totalweight" value="0" step="0.05"/></td>
</tr>
</table>
</div>
@@ -2114,37 +2114,45 @@
<div class='sheet-2colrow'>
<div class='sheet-col'>
<table class="sheet-skill" style="width:100%">
<tr>
<th data-i18n="gearequipped-u">Carried</th>
<th><input type="checkbox" class="sheet-carried" name="attr_equippedleft" value="1"/><span></span></th>
</tr>
<tr>
<th data-i18n="gearcell-u">Gear</th>
<th><input type="text" class="sheet-input" name="attr_gear_name-left" /></th>
<th><input type="text" class="sheet-input" style="width:150px" name="attr_gear_name-left" /></th>
<th data-i18n="gearquantity-u">Quantity</th>
<th><input type="number" class="sheet-input" name="attr_quantityleft" value="0" /></th>
<th data-i18n="gearweight-u">KG each</th>
<th><input type="number" class="sheet-input" name="attr_massleft" value="0" /></th>
<th><input type="number" class="sheet-input_II" name="attr_massleft" value="0" step="0.05"/></th>
</tr>
<tr>
<td><input type="hidden" class="sheet-input" name="attr_masstotalleft" value="0" /></tr></td>
<td><input type="hidden" class="sheet-input" name="attr_masstotalleft" value="0" step="0.05"/></tr></td>
</tr>
<tr>
<td colspan="6"><textarea class="sheet-input" name="attr_gearnotes-left"></textarea></td>
<td colspan="8"><textarea class="sheet-input" name="attr_gearnotes-left"></textarea></td>
</tr>
</table>
</div>
<div class='sheet-col'>
<table class="sheet-skill" style="width:100%">
<tr>
<th><span data-i18n="gearequipped-u">Carried</span></th>
<th><input type="checkbox" class="sheet-carried" name="attr_equippedright" value="1" /><span></span></th>
</tr>
<tr>
<th data-i18n="gearcell-u">Gear</th>
<th><input type="text" class="sheet-input" name="attr_gear_name-right" /></th>
<th><input type="text" class="sheet-input" style="width:150px" name="attr_gear_name-right" /></th>
<th data-i18n="gearquantity-u">Quantity</th>
<th><input type="number" class="sheet-input" name="attr_quantityright" value="0" /></th>
<th data-i18n="gearweight-u">KG each</th>
<th><input type="number" class="sheet-input" name="attr_massright" value="0"/></th>
<th><input type="number" class="sheet-input_II" name="attr_massright" value="0" step="0.05"/></th>
</tr>
<tr>
<td><input type="hidden" class="sheet-input" name="attr_masstotalright" value="0" /></tr></td>
<td><input type="hidden" class="sheet-input" name="attr_masstotalright" value="0" step="0.05"/></tr></td>
</tr>
<tr>
<td colspan="6"><textarea class="sheet-input" name="attr_gearnotes-right"></textarea></td>
<td colspan="8"><textarea class="sheet-input" name="attr_gearnotes-right"></textarea></td>
</tr>
</table>
</div>
@@ -2220,7 +2228,7 @@
<input type="number" style="width: 93px;" class="sheet-armourprotection sheet-input" name="attr_armour-protection" />
<input type="number" style="width: 164px;" class="sheet-armourlaser sheet-input" name="attr_armour-protection-laser" />
<input type="number" style="width: 67px;" class="sheet-armourrad sheet-input" name="attr_armour-rads" />
<input type="number" style="width: 67px;" class="sheet-armourweight sheet-input" name="attr_armour-mass" />
<input type="number" style="width: 67px;" class="sheet-armourweight sheet-input" name="attr_armour-mass" step="0.05"/>
<select type="text" class="sheet-armourskill sheet-input" name="attr_armour-RequiredSkill" value="0">
<option value="0" data-i18n="armournoneskill-u">None</option>
<option value="1" data-i18n="armourvaccsuit0-u">Vacc Suit 0</option>
@@ -2238,7 +2246,7 @@
<input type="number" style="width: 93px;" class="sheet-armourprotection sheet-input" name="attr_reparmour-protection" />
<input type="number" style="width: 164px;" class="sheet-armourlaser sheet-input" name="attr_reparmour-protection-laser" />
<input type="number" style="width: 67px;" class="sheet-armourrad sheet-input" name="attr_reparmour-rads" />
<input type="number" style="width: 67px;" class="sheet-armourweight sheet-input" name="attr_reparmour-mass" />
<input type="number" style="width: 67px;" class="sheet-armourweight sheet-input" name="attr_reparmour-mass" step="0.05"/>
<select type="text" class="sheet-armourskill sheet-input" name="attr_reparmour-RequiredSkill" value="0">
<option value="0" data-i18n="armournoneskill-u">None</option>
<option value="1" data-i18n="armourvaccsuit0-u">Vacc Suit 0</option>
@@ -2295,7 +2303,7 @@
<input class="sheet-weapondmg sheet-input" type="text" name="attr_weapon_damage-1" value="" style="width:60px"/>
<input class="sheet-weapontl sheet-input" type="number" name="attr_weapon_tl-1" value="0" />
<input class="sheet-weaponrange sheet-input" type="text" name="attr_weapon_range-1" value="0" style="width:70px" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-1" value="0" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-1" value="0" step="0.05"/>
<input class="sheet-weaponmag sheet-input" type="text" name="attr_weapon_magazine-1" value="0" />
<div class="sheet-weaponspacer">&nbsp;</div>
<textarea class="sheet-weaponnote sheet-input" name="attr_weapon_note-1" ></textarea>
@@ -2311,7 +2319,7 @@
<input class="sheet-weapondmg sheet-input" type="text" name="attr_weapon_damage-2" value="" style="width:60px"/>
<input class="sheet-weapontl sheet-input" type="number" name="attr_weapon_tl-2" value="0" />
<input class="sheet-weaponrange sheet-input" type="text" name="attr_weapon_range-2" value="0" style="width:70px" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-2" value="0" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-2" value="0" step="0.05"/>
<input class="sheet-weaponmag sheet-input" type="text" name="attr_weapon_magazine-2" value="0" />
<div class="sheet-weaponspacer">&nbsp;</div>
<textarea class="sheet-weaponnote sheet-input" name="attr_weapon_note-2" ></textarea>
@@ -2327,7 +2335,7 @@
<input class="sheet-weapondmg sheet-input" type="text" name="attr_weapon_damage-3" value="" style="width:60px"/>
<input class="sheet-weapontl sheet-input" type="number" name="attr_weapon_tl-3" value="0" />
<input class="sheet-weaponrange sheet-input" type="text" name="attr_weapon_range-3" value="0" style="width:70px" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-3" value="0" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-3" value="0" step="0.05"/>
<input class="sheet-weaponmag sheet-input" type="text" name="attr_weapon_magazine-3" value="0" />
<div class="sheet-weaponspacer">&nbsp;</div>
<textarea class="sheet-weaponnote sheet-input" name="attr_weapon_note-3" ></textarea>
@@ -2343,7 +2351,7 @@
<input class="sheet-weapondmg sheet-input" type="text" name="attr_weapon_damage-4" value="" style="width:60px"/>
<input class="sheet-weapontl sheet-input" type="number" name="attr_weapon_tl-4" value="0" />
<input class="sheet-weaponrange sheet-input" type="text" name="attr_weapon_range-4" value="0" style="width:70px" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-4" value="0" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-4" value="0" step="0.05"/>
<input class="sheet-weaponmag sheet-input" type="text" name="attr_weapon_magazine-4" value="0" />
<div class="sheet-weaponspacer">&nbsp;</div>
<textarea class="sheet-weaponnote sheet-input" name="attr_weapon_note-4" ></textarea>
@@ -2359,7 +2367,7 @@
<input class="sheet-weapondmg sheet-input" type="text" name="attr_weapon_damage-5" value="" style="width:60px"/>
<input class="sheet-weapontl sheet-input" type="number" name="attr_weapon_tl-5" value="0" />
<input class="sheet-weaponrange sheet-input" type="text" name="attr_weapon_range-5" value="0" style="width:70px" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-5" value="0" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-5" value="0" step="0.05"/>
<input class="sheet-weaponmag sheet-input" type="text" name="attr_weapon_magazine-5" value="0" />
<div class="sheet-weaponspacer">&nbsp;</div>
<textarea class="sheet-weaponnote sheet-input" name="attr_weapon_note-5" ></textarea>
@@ -2375,7 +2383,7 @@
<input class="sheet-weapondmg sheet-input" type="text" name="attr_weapon_damage-6" value="" style="width:60px"/>
<input class="sheet-weapontl sheet-input" type="number" name="attr_weapon_tl-6" value="0" />
<input class="sheet-weaponrange sheet-input" type="text" name="attr_weapon_range-6" value="0" style="width:70px" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-6" value="0" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-6" value="0" step="0.05"/>
<input class="sheet-weaponmag sheet-input" type="text" name="attr_weapon_magazine-6" value="0" />
<div class="sheet-weaponspacer">&nbsp;</div>
<textarea class="sheet-weaponnote sheet-input" name="attr_weapon_note-6" ></textarea>
@@ -2392,7 +2400,7 @@
<input class="sheet-weapondmg sheet-input" type="text" name="attr_weapon_damage-rep" value="" style="width:60px"/>
<input class="sheet-weapontl sheet-input" type="number" name="attr_weapon_tl-rep" value="0" />
<input class="sheet-weaponrange sheet-input" type="text" name="attr_weapon_range-rep" value="0" style="width:70px" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-rep" value="0" />
<input class="sheet-weaponweight sheet-input" type="number" name="attr_weapon_weight-rep" value="0" step="0.05"/>
<input class="sheet-weaponmag sheet-input" type="text" name="attr_weapon_magazine-rep" value="0" />
<div class="sheet-weaponspacer">&nbsp;</div>
<textarea class="sheet-weaponnote sheet-input" name="attr_weapon_note-rep" ></textarea>
@@ -2605,9 +2613,9 @@
</div>
<div class="sheet-tab-content sheet-ship">
<div>
<span class="sheet-header" data-i18n="shipname-u"></span><input type="text" class="sheet-input"/>
<span class="sheet-header" data-i18n="shipclass-u"></span><input type="text" class="sheet-input"/>
<span class="sheet-header" data-i18n="shiptl-u"></span><input type="number" class="sheet-input"/>
<span class="sheet-header" data-i18n="shipname-u"></span><input type="text" class="sheet-input" name="attr_character_name"/>
<span class="sheet-header" data-i18n="shipclass-u"></span><input type="text" class="sheet-input" name="attr_ship_class"/>
<span class="sheet-header" data-i18n="shiptl-u"></span><input type="number" class="sheet-input" name="attr_ship_tl"/>
</div>
<br/>
<div>
@@ -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))
});
});
});
+1
View File
@@ -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",