diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx
index 661483da..9485eac3 100644
--- a/src/app/components/AvailableModulesMenu.jsx
+++ b/src/app/components/AvailableModulesMenu.jsx
@@ -41,6 +41,13 @@ const GRPCAT = {
'mr': 'ordnance',
'tp': 'ordnance',
'nl': 'ordnance',
+ // Utilities
+ 'cs': 'scanners',
+ 'kw': 'scanners',
+ 'ws': 'scanners',
+ 'ch': 'defence',
+ 'po': 'defence',
+ 'ec': 'defence',
};
// Order here is the order in which items will be shown in the modules menu
const CATEGORIES = {
@@ -64,12 +71,8 @@ const CATEGORIES = {
// Utilities
'sb': ['sb'],
'hs': ['hs'],
- 'ch': ['ch'],
- 'po': ['po'],
- 'ec': ['ec'],
- 'cs': ['cs'],
- 'kw': ['kw'],
- 'ws': ['ws'],
+ 'defence': ['ch', 'po', 'ec'],
+ 'scanners': ['cs', 'kw', 'ws'],
};
/**
@@ -128,7 +131,9 @@ export default class AvailableModulesMenu extends TranslatedComponent {
} else {
list = [];
// At present time slots with grouped options (Hardpoints and Internal) can be empty
- list.push(
{translate('empty')}
);
+ if (m) {
+ list.push({translate('empty')}
);
+ }
// Need to regroup the modules by our own categorisation
let catmodules = {};
diff --git a/src/app/components/UtilitySlotSection.jsx b/src/app/components/UtilitySlotSection.jsx
index 0351b4ab..95324219 100644
--- a/src/app/components/UtilitySlotSection.jsx
+++ b/src/app/components/UtilitySlotSection.jsx
@@ -99,11 +99,11 @@ export default class UtilitySlotSection extends SlotSection {
{translate('sb')}
- - E
- - D
- - C
- - B
- A
+ - B
+ - C
+ - D
+ - E
{translate('hs')}
diff --git a/src/app/utils/SlotFunctions.js b/src/app/utils/SlotFunctions.js
index feff8a5b..fc0c7ee3 100644
--- a/src/app/utils/SlotFunctions.js
+++ b/src/app/utils/SlotFunctions.js
@@ -143,13 +143,7 @@ export function diffDetails(language, m, mm) {
let { formats, translate, units } = language;
let propDiffs = [];
- let mCost = m.cost || 0;
- let mmCost = mm ? mm.cost : 0;
- if (mCost != mmCost) propDiffs.push({translate('cost')}: {mCost ? Math.round(mCost * (1 - Persist.getModuleDiscount())) : 0}{units.CR}
);
-
- let mMass = m.mass || 0;
- let mmMass = mm ? mm.getMass() : 0;
- if (mMass != mmMass) propDiffs.push({translate('mass')}: {diff(formats.round, mMass, mmMass)}{units.T}
);
+ // Module-specific items
if (m.grp === 'pp') {
let mPowerGeneration = m.pgen || 0;
@@ -157,7 +151,7 @@ export function diffDetails(language, m, mm) {
if (mPowerGeneration != mmPowerGeneration) propDiffs.push({translate('pgen')}: {diff(formats.round, mPowerGeneration, mmPowerGeneration)}{units.MJ}
);
} else {
let mPowerUsage = m.power || 0;
- let mmPowerUsage = mm ? mm.getPowerUsage() : 0;
+ let mmPowerUsage = mm ? mm.getPowerUsage() || 0 : 0;
if (mPowerUsage != mmPowerUsage) propDiffs.push({translate('power')}: {diff(formats.round, mPowerUsage, mmPowerUsage)}{units.MJ}
);
}
@@ -187,6 +181,20 @@ export function diffDetails(language, m, mm) {
propDiffs.push({translate('shields')}: {diff(formats.int, newShield, shield)}{units.MJ}
);
}
+ if (m.grp === 'mrp') {
+ let mProtection = m.protection;
+ let mmProtection = mm ? mm.getProtection() || 0 : 0;
+ if (mProtection != mmProtection) {
+ propDiffs.push({translate('protection')}: {diff(formats.pct, mProtection, mmProtection)}
);
+ }
+
+ let mIntegrity = m.integrity;
+ let mmIntegrity = mm ? mm.getIntegrity() || 0 : 0;
+ if (mIntegrity != mmIntegrity) {
+ propDiffs.push({translate('integrity')}: {diff(formats.round, mIntegrity, mmIntegrity)}
);
+ }
+ }
+
if (m.grp == 'pd') {
propDiffs.push(
{`${translate('WEP')}: `}
@@ -208,6 +216,16 @@ export function diffDetails(language, m, mm) {
);
}
+ // Common items
+
+ let mCost = m.cost || 0;
+ let mmCost = mm ? mm.cost : 0;
+ if (mCost != mmCost) propDiffs.push({translate('cost')}: {mCost ? Math.round(mCost * (1 - Persist.getModuleDiscount())) : 0}{units.CR}
);
+
+ let mMass = m.mass || 0;
+ let mmMass = mm ? mm.getMass() : 0;
+ if (mMass != mmMass) propDiffs.push({translate('mass')}: {diff(formats.round, mMass, mmMass)}{units.T}
);
+
let massDiff = mMass - mmMass;
let mCap = m.fuel || m.cargo || 0;
let mmCap = mm ? mm.fuel || mm.cargo || 0 : 0;