mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Compare commits
8 Commits
b1fd7991b6
...
feature/su
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d8dce8407 | ||
|
|
8cbcff8878 | ||
|
|
53b30e64b6 | ||
|
|
00b149521d | ||
|
|
236f8c686a | ||
|
|
5e68685a8b | ||
|
|
25e7be9081 | ||
|
|
fcd8506694 |
@@ -15,22 +15,30 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
cargo: PropTypes.number.isRequired,
|
cargo: PropTypes.number.isRequired,
|
||||||
fuel: PropTypes.number.isRequired,
|
fuel: PropTypes.number.isRequired,
|
||||||
marker: PropTypes.string.isRequired,
|
marker: PropTypes.string.isRequired,
|
||||||
|
pips: PropTypes.object.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
this.didContextChange = this.didContextChange.bind(this);
|
||||||
|
this.state = {
|
||||||
|
shieldColour: 'blue'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the table
|
* Render the table
|
||||||
* @return {React.Component} Summary table
|
* @return {React.Component} Summary table
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
const { ship, cargo, fuel } = this.props;
|
const { ship, cargo, fuel, pips } = this.props;
|
||||||
let { language, tooltip, termtip } = this.context;
|
let { language, tooltip, termtip } = this.context;
|
||||||
let translate = language.translate;
|
let translate = language.translate;
|
||||||
let u = language.units;
|
let u = language.units;
|
||||||
let formats = language.formats;
|
let formats = language.formats;
|
||||||
let { time, int, round, f1, f2 } = formats;
|
let { time, int, round, f1, f2 } = formats;
|
||||||
let hide = tooltip.bind(null, null);
|
let hide = tooltip.bind(null, null);
|
||||||
|
const shieldGenerator = ship.findInternalByGroup('sg') || ship.findInternalByGroup('psg');
|
||||||
const shieldGenerator = ship.findInternalByGroup('sg');
|
|
||||||
const sgClassNames = cn({ warning: shieldGenerator && !ship.shield, muted: !shieldGenerator });
|
const sgClassNames = cn({ warning: shieldGenerator && !ship.shield, muted: !shieldGenerator });
|
||||||
const sgTooltip = shieldGenerator ? 'TT_SUMMARY_SHIELDS' : 'TT_SUMMARY_SHIELDS_NONFUNCTIONAL';
|
const sgTooltip = shieldGenerator ? 'TT_SUMMARY_SHIELDS' : 'TT_SUMMARY_SHIELDS_NONFUNCTIONAL';
|
||||||
const timeToDrain = Calc.timeToDrainWep(ship, 4);
|
const timeToDrain = Calc.timeToDrainWep(ship, 4);
|
||||||
@@ -38,9 +46,13 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
const speedTooltip = canThrust ? 'TT_SUMMARY_SPEED' : 'TT_SUMMARY_SPEED_NONFUNCTIONAL';
|
const speedTooltip = canThrust ? 'TT_SUMMARY_SPEED' : 'TT_SUMMARY_SPEED_NONFUNCTIONAL';
|
||||||
const canBoost = ship.canBoost(cargo, ship.fuelCapacity);
|
const canBoost = ship.canBoost(cargo, ship.fuelCapacity);
|
||||||
const boostTooltip = canBoost ? 'TT_SUMMARY_BOOST' : canThrust ? 'TT_SUMMARY_BOOST_NONFUNCTIONAL' : 'TT_SUMMARY_SPEED_NONFUNCTIONAL';
|
const boostTooltip = canBoost ? 'TT_SUMMARY_BOOST' : canThrust ? 'TT_SUMMARY_BOOST_NONFUNCTIONAL' : 'TT_SUMMARY_SPEED_NONFUNCTIONAL';
|
||||||
|
const sgMetrics = Calc.shieldMetrics(ship, pips.sys || 2);
|
||||||
|
const armourMetrics = Calc.armourMetrics(ship);
|
||||||
|
this.state = {
|
||||||
|
shieldColour: shieldGenerator && shieldGenerator.m.grp === 'psg' ? 'green' : 'blue'
|
||||||
|
}
|
||||||
return <div id='summary'>
|
return <div id='summary'>
|
||||||
<table id='summaryTable'>
|
<table className={'summaryTable'}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr className='main'>
|
<tr className='main'>
|
||||||
<th rowSpan={2} className={ cn({ 'bg-warning-disabled': !canThrust }) }>{translate('speed')}</th>
|
<th rowSpan={2} className={ cn({ 'bg-warning-disabled': !canThrust }) }>{translate('speed')}</th>
|
||||||
@@ -98,6 +110,66 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<table className={'summaryTable'}>
|
||||||
|
<thead className={this.state.shieldColour}>
|
||||||
|
<tr>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'shield ', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('explres')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'shield ', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('kinres')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'shield ', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('thermres')}</th>
|
||||||
|
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'shield ', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('absolute') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'shield ', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('explosive') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'shield ', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('kinetic') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'shield ', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('thermal') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'PHRASE_SG_RECOVER', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('recovery')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'PHRASE_SG_RECHARGE', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('recharge')}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr >
|
||||||
|
<td>{int(ship.shieldExplRes * 100) + '%'}</td>
|
||||||
|
<td>{int(ship.shieldThermRes * 100) + '%'}</td>
|
||||||
|
<td>{int(ship.shieldKinRes * 100) + '%'}</td>
|
||||||
|
<td>{int(sgMetrics && sgMetrics.generator ? sgMetrics.total / sgMetrics.absolute.total : 0)}</td>
|
||||||
|
<td>{int(sgMetrics && sgMetrics.generator ? sgMetrics.total / sgMetrics.explosive.total : 0)}</td>
|
||||||
|
<td>{int(sgMetrics && sgMetrics.generator ? sgMetrics.total / sgMetrics.kinetic.total : 0 )}</td>
|
||||||
|
<td>{int(sgMetrics && sgMetrics.generator ? sgMetrics.total / sgMetrics.thermal.total : 0 )}</td>
|
||||||
|
<td>{formats.time(sgMetrics.recover)}</td>
|
||||||
|
<td>{formats.time(sgMetrics.recharge)}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('explres')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('kinres')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('thermres')}</th>
|
||||||
|
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('absolute') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('explosive') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('kinetic') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('thermal') + ' ' + translate('HP')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('raw module armour')}</th>
|
||||||
|
<th onMouseEnter={termtip.bind(null, 'armour', { cap: 0 })} onMouseLeave={hide} className='lft'>{translate('internal protection')}</th>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>{int(ship.hullExplRes * 100) + '%'}</td>
|
||||||
|
<td>{int(ship.hullThermRes * 100) + '%'}</td>
|
||||||
|
<td>{int(ship.hullKinRes * 100) + '%'}</td>
|
||||||
|
<td>{int(armourMetrics.total / armourMetrics.absolute.total)}</td>
|
||||||
|
<td>{int(armourMetrics.total / armourMetrics.explosive.total)}</td>
|
||||||
|
<td>{int(armourMetrics.total / armourMetrics.kinetic.total)}</td>
|
||||||
|
<td>{int(armourMetrics.total / armourMetrics.thermal.total)}</td>
|
||||||
|
<td>{int(armourMetrics.modulearmour)}</td>
|
||||||
|
<td>{int(armourMetrics.moduleprotection * 100) + '%'}</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,6 +213,7 @@
|
|||||||
"scanrate": "Scan rate",
|
"scanrate": "Scan rate",
|
||||||
"scantime": "Scan time",
|
"scantime": "Scan time",
|
||||||
"shield": "Shield",
|
"shield": "Shield",
|
||||||
|
"armour": "Armour",
|
||||||
"shieldboost": "Shield boost",
|
"shieldboost": "Shield boost",
|
||||||
"shieldreinforcement": "Shield reinforcement",
|
"shieldreinforcement": "Shield reinforcement",
|
||||||
"shotspeed": "Shot speed",
|
"shotspeed": "Shot speed",
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ export default class OutfittingPage extends Page {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Main tables */}
|
{/* Main tables */}
|
||||||
<ShipSummaryTable ship={ship} fuel={fuel} cargo={cargo} marker={shipSummaryMarker} />
|
<ShipSummaryTable ship={ship} fuel={fuel} cargo={cargo} marker={shipSummaryMarker} pips={{sys: this.state.sys, wep: this.state.wep, eng: this.state.eng}} />
|
||||||
<StandardSlotSection ship={ship} fuel={fuel} cargo={cargo} code={standardSlotMarker} onChange={shipUpdated} onCargoChange={this._cargoUpdated} onFuelChange={this._fuelUpdated} currentMenu={menu} />
|
<StandardSlotSection ship={ship} fuel={fuel} cargo={cargo} code={standardSlotMarker} onChange={shipUpdated} onCargoChange={this._cargoUpdated} onFuelChange={this._fuelUpdated} currentMenu={menu} />
|
||||||
<InternalSlotSection ship={ship} code={internalSlotMarker} onChange={shipUpdated} onCargoChange={this._cargoUpdated} onFuelChange={this._fuelUpdated} currentMenu={menu} />
|
<InternalSlotSection ship={ship} code={internalSlotMarker} onChange={shipUpdated} onCargoChange={this._cargoUpdated} onFuelChange={this._fuelUpdated} currentMenu={menu} />
|
||||||
<HardpointSlotSection ship={ship} code={hardpointsSlotMarker} onChange={shipUpdated} onCargoChange={this._cargoUpdated} onFuelChange={this._fuelUpdated} currentMenu={menu} />
|
<HardpointSlotSection ship={ship} code={hardpointsSlotMarker} onChange={shipUpdated} onCargoChange={this._cargoUpdated} onFuelChange={this._fuelUpdated} currentMenu={menu} />
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
@secondary: #1FB0FF; // Light blue
|
@secondary: #1FB0FF; // Light blue
|
||||||
@warning: #FF3B00; // Dark Orange
|
@warning: #FF3B00; // Dark Orange
|
||||||
@disabled: #555; // Light grey
|
@disabled: #555; // Light grey
|
||||||
|
@success: #71a052; // Green
|
||||||
@primary-disabled: darken(@primary, @disabledDarken);
|
@primary-disabled: darken(@primary, @disabledDarken);
|
||||||
@secondary-disabled: darken(@secondary, @disabledDarken);
|
@secondary-disabled: darken(@secondary, @disabledDarken);
|
||||||
@warning-disabled: darken(@warning, @disabledDarken);
|
@warning-disabled: darken(@warning, @disabledDarken);
|
||||||
|
|||||||
@@ -70,10 +70,22 @@
|
|||||||
padding: 0.5em 0.2em;
|
padding: 0.5em 0.2em;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
|
|
||||||
#summaryTable {
|
.summaryTable {
|
||||||
.user-select-none();
|
.user-select-none();
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
|
||||||
|
& > thead.blue {
|
||||||
|
background-color: @secondary;
|
||||||
|
border-left: 1px solid @primary-bg;
|
||||||
|
color: @primary-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > thead.green {
|
||||||
|
background-color: @success;
|
||||||
|
border-left: 1px solid @primary-bg;
|
||||||
|
color: @primary-bg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user