mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Fix #240: Added passenger count to individual ship page
This commit is contained in:
@@ -53,6 +53,7 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
<th rowSpan={2}>{translate('TTD')}</th>
|
<th rowSpan={2}>{translate('TTD')}</th>
|
||||||
{/* <th onMouseEnter={termtip.bind(null, 'heat per second')} onMouseLeave={hide} rowSpan={2}>{translate('HPS')}</th> */}
|
{/* <th onMouseEnter={termtip.bind(null, 'heat per second')} onMouseLeave={hide} rowSpan={2}>{translate('HPS')}</th> */}
|
||||||
<th rowSpan={2}>{translate('cargo')}</th>
|
<th rowSpan={2}>{translate('cargo')}</th>
|
||||||
|
<th rowSpan={2}>{translate('passengers')}</th>
|
||||||
<th rowSpan={2}>{translate('fuel')}</th>
|
<th rowSpan={2}>{translate('fuel')}</th>
|
||||||
<th colSpan={3}>{translate('mass')}</th>
|
<th colSpan={3}>{translate('mass')}</th>
|
||||||
<th onMouseEnter={termtip.bind(null, 'hull hardness', { cap: 0 })} onMouseLeave={hide} rowSpan={2}>{translate('hrd')}</th>
|
<th onMouseEnter={termtip.bind(null, 'hull hardness', { cap: 0 })} onMouseLeave={hide} rowSpan={2}>{translate('hrd')}</th>
|
||||||
@@ -86,6 +87,7 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_TTD', { cap: 0 })} onMouseLeave={hide}>{timeToDrain === Infinity ? '∞' : time(timeToDrain)}</td>
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_TTD', { cap: 0 })} onMouseLeave={hide}>{timeToDrain === Infinity ? '∞' : time(timeToDrain)}</td>
|
||||||
{/* <td>{f1(ship.totalHps)}</td> */}
|
{/* <td>{f1(ship.totalHps)}</td> */}
|
||||||
<td>{round(ship.cargoCapacity)}{u.T}</td>
|
<td>{round(ship.cargoCapacity)}{u.T}</td>
|
||||||
|
<td>{ship.passengerCapacity}</td>
|
||||||
<td>{round(ship.fuelCapacity)}{u.T}</td>
|
<td>{round(ship.fuelCapacity)}{u.T}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_HULL_MASS', { cap: 0 })} onMouseLeave={hide}>{ship.hullMass}{u.T}</td>
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_HULL_MASS', { cap: 0 })} onMouseLeave={hide}>{ship.hullMass}{u.T}</td>
|
||||||
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_MASS', { cap: 0 })} onMouseLeave={hide}>{int(ship.unladenMass)}{u.T}</td>
|
<td onMouseEnter={termtip.bind(null, 'TT_SUMMARY_UNLADEN_MASS', { cap: 0 })} onMouseLeave={hide}>{int(ship.unladenMass)}{u.T}</td>
|
||||||
|
|||||||
@@ -569,6 +569,7 @@ export default class Ship {
|
|||||||
// Reset Cumulative stats
|
// Reset Cumulative stats
|
||||||
this.fuelCapacity = 0;
|
this.fuelCapacity = 0;
|
||||||
this.cargoCapacity = 0;
|
this.cargoCapacity = 0;
|
||||||
|
this.passengerCapacity = 0;
|
||||||
this.ladenMass = 0;
|
this.ladenMass = 0;
|
||||||
this.armour = this.baseArmour;
|
this.armour = this.baseArmour;
|
||||||
this.shield = this.baseShieldStrength;
|
this.shield = this.baseShieldStrength;
|
||||||
@@ -1188,6 +1189,7 @@ export default class Ship {
|
|||||||
let unladenMass = this.hullMass;
|
let unladenMass = this.hullMass;
|
||||||
let cargoCapacity = 0;
|
let cargoCapacity = 0;
|
||||||
let fuelCapacity = 0;
|
let fuelCapacity = 0;
|
||||||
|
let passengerCapacity = 0;
|
||||||
|
|
||||||
unladenMass += this.bulkheads.m.getMass();
|
unladenMass += this.bulkheads.m.getMass();
|
||||||
|
|
||||||
@@ -1209,6 +1211,8 @@ export default class Ship {
|
|||||||
fuelCapacity += slot.m.fuel;
|
fuelCapacity += slot.m.fuel;
|
||||||
} else if (slot.m.grp === 'cr') {
|
} else if (slot.m.grp === 'cr') {
|
||||||
cargoCapacity += slot.m.cargo;
|
cargoCapacity += slot.m.cargo;
|
||||||
|
} else if (slot.m.grp.slice(0,2) === 'pc') {
|
||||||
|
passengerCapacity += slot.m.passengers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1224,6 +1228,7 @@ export default class Ship {
|
|||||||
this.unladenMass = unladenMass;
|
this.unladenMass = unladenMass;
|
||||||
this.cargoCapacity = cargoCapacity;
|
this.cargoCapacity = cargoCapacity;
|
||||||
this.fuelCapacity = fuelCapacity;
|
this.fuelCapacity = fuelCapacity;
|
||||||
|
this.passengerCapacity = passengerCapacity;
|
||||||
this.ladenMass = unladenMass + fuelCapacity + cargoCapacity;
|
this.ladenMass = unladenMass + fuelCapacity + cargoCapacity;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Reference in New Issue
Block a user