mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 22:55:35 +00:00
Tidy-ups
This commit is contained in:
@@ -99,7 +99,7 @@ export default class InternalSlotSection extends SlotSection {
|
|||||||
let slots = [];
|
let slots = [];
|
||||||
let { currentMenu, ship } = this.props;
|
let { currentMenu, ship } = this.props;
|
||||||
let { originSlot, targetSlot } = this.state;
|
let { originSlot, targetSlot } = this.state;
|
||||||
let { internal, fuelCapacity, ladenMass } = ship;
|
let { internal, fuelCapacity } = ship;
|
||||||
let availableModules = ship.getAvailableModules();
|
let availableModules = ship.getAvailableModules();
|
||||||
|
|
||||||
for (let i = 0, l = internal.length; i < l; i++) {
|
for (let i = 0, l = internal.length; i < l; i++) {
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import { MountFixed, MountGimballed, MountTurret } from './SvgIcons';
|
|||||||
import { Modifications } from 'coriolis-data/dist';
|
import { Modifications } from 'coriolis-data/dist';
|
||||||
import Modification from './Modification';
|
import Modification from './Modification';
|
||||||
|
|
||||||
const PRESS_THRESHOLD = 500; // mouse/touch down threshold
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modifications menu
|
* Modifications menu
|
||||||
*/
|
*/
|
||||||
@@ -37,8 +35,6 @@ export default class ModificationsMenu extends TranslatedComponent {
|
|||||||
* @return {Object} list: Array of React Components
|
* @return {Object} list: Array of React Components
|
||||||
*/
|
*/
|
||||||
_initState(props, context) {
|
_initState(props, context) {
|
||||||
let translate = context.language.translate;
|
|
||||||
let formats = context.language.formats;
|
|
||||||
let { m, onChange, ship } = props;
|
let { m, onChange, ship } = props;
|
||||||
let list = [];
|
let list = [];
|
||||||
|
|
||||||
|
|||||||
@@ -79,11 +79,9 @@ export default class Slot extends TranslatedComponent {
|
|||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
let language = this.context.language;
|
let language = this.context.language;
|
||||||
let { termtip, tooltip } = this.context;
|
|
||||||
let translate = language.translate;
|
let translate = language.translate;
|
||||||
let { ship, m, dropClass, dragOver, onOpen, onChange, selected, eligible, onSelect, warning, shipMass, availableModules } = this.props;
|
let { ship, m, dropClass, dragOver, onOpen, onChange, selected, eligible, onSelect, warning, availableModules } = this.props;
|
||||||
let slotDetails, menu;
|
let slotDetails, menu;
|
||||||
let validMods = m == null ? [] : (Modifications.validity[m.grp] || []);
|
|
||||||
|
|
||||||
if (!selected) {
|
if (!selected) {
|
||||||
// If not selected then sure that modifications flag is unset
|
// If not selected then sure that modifications flag is unset
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default class StandardSlot extends TranslatedComponent {
|
|||||||
render() {
|
render() {
|
||||||
let { termtip, tooltip } = this.context;
|
let { termtip, tooltip } = this.context;
|
||||||
let { translate, formats, units } = this.context.language;
|
let { translate, formats, units } = this.context.language;
|
||||||
let { modules, slot, selected, warning, onSelect, onChange, ladenMass, ship } = this.props;
|
let { modules, slot, selected, warning, onSelect, onChange, ship } = this.props;
|
||||||
let m = slot.m;
|
let m = slot.m;
|
||||||
let classRating = m.class + m.rating;
|
let classRating = m.class + m.rating;
|
||||||
let menu;
|
let menu;
|
||||||
|
|||||||
@@ -86,12 +86,10 @@ export default class StandardSlotSection extends SlotSection {
|
|||||||
* @return {Array} Array of Slots
|
* @return {Array} Array of Slots
|
||||||
*/
|
*/
|
||||||
_getSlots() {
|
_getSlots() {
|
||||||
let { translate, units, formats } = this.context.language;
|
|
||||||
let { ship, currentMenu } = this.props;
|
let { ship, currentMenu } = this.props;
|
||||||
let slots = new Array(8);
|
let slots = new Array(8);
|
||||||
let open = this._openMenu;
|
let open = this._openMenu;
|
||||||
let select = this._selectModule;
|
let select = this._selectModule;
|
||||||
let selBulkhead = this._selectBulkhead;
|
|
||||||
let st = ship.standard;
|
let st = ship.standard;
|
||||||
let avail = ship.getAvailableModules().standard;
|
let avail = ship.getAvailableModules().standard;
|
||||||
let bh = ship.bulkheads;
|
let bh = ship.bulkheads;
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ export default class Module {
|
|||||||
*/
|
*/
|
||||||
getHeatPerSecond() {
|
getHeatPerSecond() {
|
||||||
// Modifier for hps is thermload
|
// Modifier for hps is thermload
|
||||||
return this._getModifiedValue('hps');
|
|
||||||
let result = 0;
|
let result = 0;
|
||||||
if (this['hps']) {
|
if (this['hps']) {
|
||||||
result = this['hps'];
|
result = this['hps'];
|
||||||
|
|||||||
@@ -888,7 +888,7 @@ export default class Ship {
|
|||||||
*/
|
*/
|
||||||
updateJumpStats() {
|
updateJumpStats() {
|
||||||
let fsd = this.standard[2].m; // Frame Shift Drive;
|
let fsd = this.standard[2].m; // Frame Shift Drive;
|
||||||
let { unladenMass, ladenMass, fuelCapacity } = this;
|
let { unladenMass, fuelCapacity } = this;
|
||||||
this.unladenRange = this.calcUnladenRange(); // Includes fuel weight for jump
|
this.unladenRange = this.calcUnladenRange(); // Includes fuel weight for jump
|
||||||
this.fullTankRange = Calc.jumpRange(unladenMass + fuelCapacity, fsd); // Full Tank
|
this.fullTankRange = Calc.jumpRange(unladenMass + fuelCapacity, fsd); // Full Tank
|
||||||
this.ladenRange = this.calcLadenRange(); // Includes full tank and caro
|
this.ladenRange = this.calcLadenRange(); // Includes full tank and caro
|
||||||
|
|||||||
Reference in New Issue
Block a user