mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Fix cosmetic issues.
This commit is contained in:
@@ -84,13 +84,13 @@ angular.module('app').service('Serializer', ['lodash', 'GroupMap', 'MountMap', '
|
|||||||
components: {
|
components: {
|
||||||
standard: {
|
standard: {
|
||||||
bulkheads: ship.bulkheads.c.name,
|
bulkheads: ship.bulkheads.c.name,
|
||||||
powerPlant: { class: standard[0].c.class, rating: standard[0].c.rating, enabled: Boolean(standard[0].enabled), priority: standard[0].priority+1 },
|
powerPlant: { class: standard[0].c.class, rating: standard[0].c.rating, enabled: Boolean(standard[0].enabled), priority: standard[0].priority + 1 },
|
||||||
thrusters: { class: standard[1].c.class, rating: standard[1].c.rating, enabled: Boolean(standard[1].enabled), priority: standard[1].priority+1 },
|
thrusters: { class: standard[1].c.class, rating: standard[1].c.rating, enabled: Boolean(standard[1].enabled), priority: standard[1].priority + 1 },
|
||||||
frameShiftDrive: { class: standard[2].c.class, rating: standard[2].c.rating, enabled: Boolean(standard[2].enabled), priority: standard[2].priority+1 },
|
frameShiftDrive: { class: standard[2].c.class, rating: standard[2].c.rating, enabled: Boolean(standard[2].enabled), priority: standard[2].priority + 1 },
|
||||||
lifeSupport: { class: standard[3].c.class, rating: standard[3].c.rating, enabled: Boolean(standard[3].enabled), priority: standard[3].priority+1 },
|
lifeSupport: { class: standard[3].c.class, rating: standard[3].c.rating, enabled: Boolean(standard[3].enabled), priority: standard[3].priority + 1 },
|
||||||
powerDistributor: { class: standard[4].c.class, rating: standard[4].c.rating, enabled: Boolean(standard[4].enabled), priority: standard[4].priority+1 },
|
powerDistributor: { class: standard[4].c.class, rating: standard[4].c.rating, enabled: Boolean(standard[4].enabled), priority: standard[4].priority + 1 },
|
||||||
sensors: { class: standard[5].c.class, rating: standard[5].c.rating, enabled: Boolean(standard[5].enabled), priority: standard[5].priority+1 },
|
sensors: { class: standard[5].c.class, rating: standard[5].c.rating, enabled: Boolean(standard[5].enabled), priority: standard[5].priority + 1 },
|
||||||
fuelTank: { class: standard[6].c.class, rating: standard[6].c.rating, enabled: Boolean(standard[6].enabled), priority: standard[6].priority+1 }
|
fuelTank: { class: standard[6].c.class, rating: standard[6].c.rating, enabled: Boolean(standard[6].enabled), priority: standard[6].priority + 1 }
|
||||||
},
|
},
|
||||||
hardpoints: _.map(_.filter(hardpoints, function(slot) { return slot.maxClass > 0; }), slotToSchema),
|
hardpoints: _.map(_.filter(hardpoints, function(slot) { return slot.maxClass > 0; }), slotToSchema),
|
||||||
utility: _.map(_.filter(hardpoints, function(slot) { return slot.maxClass === 0; }), slotToSchema),
|
utility: _.map(_.filter(hardpoints, function(slot) { return slot.maxClass === 0; }), slotToSchema),
|
||||||
@@ -132,7 +132,7 @@ angular.module('app').service('Serializer', ['lodash', 'GroupMap', 'MountMap', '
|
|||||||
if (!comps.standard[c].class || !comps.standard[c].rating) {
|
if (!comps.standard[c].class || !comps.standard[c].rating) {
|
||||||
throw 'Invalid value for ' + c;
|
throw 'Invalid value for ' + c;
|
||||||
}
|
}
|
||||||
priorities.push(comps.standard[c].priority === undefined ? 0 : comps.standard[c].priority-1);
|
priorities.push(comps.standard[c].priority === undefined ? 0 : comps.standard[c].priority - 1);
|
||||||
enabled.push(comps.standard[c].enabled === undefined ? true : comps.standard[c].enabled);
|
enabled.push(comps.standard[c].enabled === undefined ? true : comps.standard[c].enabled);
|
||||||
return comps.standard[c].class + comps.standard[c].rating;
|
return comps.standard[c].class + comps.standard[c].rating;
|
||||||
}
|
}
|
||||||
@@ -148,12 +148,12 @@ angular.module('app').service('Serializer', ['lodash', 'GroupMap', 'MountMap', '
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// The ordering of these arrays must match the order in which they are read in Ship.buildWith
|
// The ordering of these arrays must match the order in which they are read in Ship.buildWith
|
||||||
priorities = priorities.concat(_.map(comps.hardpoints, function(c) { return (!c || c.priority===undefined) ? 0 : c.priority-1; }),
|
priorities = priorities.concat(_.map(comps.hardpoints, function(c) { return (!c || c.priority===undefined) ? 0 : c.priority - 1; }),
|
||||||
_.map(comps.utility, function(c) { return (!c || c.priority===undefined) ? 0 : c.priority-1; }),
|
_.map(comps.utility, function(c) { return (!c || c.priority===undefined) ? 0 : c.priority - 1; }),
|
||||||
_.map(comps.internal, function(c) { return (!c || c.priority===undefined) ? 0 : c.priority-1; }));
|
_.map(comps.internal, function(c) { return (!c || c.priority===undefined) ? 0 : c.priority - 1; }));
|
||||||
enabled = enabled.concat(_.map(comps.hardpoints, function(c) { return (!c || c.enabled===undefined) ? false : c.enabled; }),
|
enabled = enabled.concat(_.map(comps.hardpoints, function(c) { return (!c || c.enabled===undefined) ? false : c.enabled; }),
|
||||||
_.map(comps.utility, function(c) { return (!c || c.enabled===undefined) ? false : c.enabled; }),
|
_.map(comps.utility, function(c) { return (!c || c.enabled===undefined) ? false : c.enabled; }),
|
||||||
_.map(comps.internal, function(c) { return (!c || c.enabled===undefined) ? false : c.enabled; }));
|
_.map(comps.internal, function(c) { return (!c || c.enabled===undefined) ? false : c.enabled; }));
|
||||||
|
|
||||||
ship.buildWith({ bulkheads: bulkheads, common: common, hardpoints: hardpoints, internal: internal }, priorities, enabled);
|
ship.buildWith({ bulkheads: bulkheads, common: common, hardpoints: hardpoints, internal: internal }, priorities, enabled);
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ angular.module('app').service('Serializer', ['lodash', 'GroupMap', 'MountMap', '
|
|||||||
|
|
||||||
function slotToSchema(slot) {
|
function slotToSchema(slot) {
|
||||||
if (slot.c) {
|
if (slot.c) {
|
||||||
var o = { class: slot.c.class, rating: slot.c.rating, enabled: Boolean(slot.enabled), priority: slot.priority+1, group: GroupMap[slot.c.grp] };
|
var o = { class: slot.c.class, rating: slot.c.rating, enabled: Boolean(slot.enabled), priority: slot.priority + 1, group: GroupMap[slot.c.grp] };
|
||||||
if (slot.c.name) {
|
if (slot.c.name) {
|
||||||
o.name = slot.c.name;
|
o.name = slot.c.name;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user