diff --git a/src/app/components/ModalShoppingList.jsx b/src/app/components/ModalShoppingList.jsx index cd2e2ec3..5900d8ce 100644 --- a/src/app/components/ModalShoppingList.jsx +++ b/src/app/components/ModalShoppingList.jsx @@ -90,8 +90,10 @@ export default class ModalShoppingList extends TranslatedComponent { request .get('http://localhost:44405/commanders') .end((err, res) => { + this.display = 'block'; if (err) { console.log(err); + this.display = 'none'; return this.setState({ failed: true }); } const cmdrs = JSON.parse(res.text); @@ -178,8 +180,34 @@ export default class ModalShoppingList extends TranslatedComponent { if (g < module.m.blueprint.grade) { continue; } + let item = ""; + // If the module blueprint fdname contains "Armour_" it's a bulkhead and we need to pre-populate the item field with the correct name from the ship object + if (module.m.blueprint.fdname.includes("Armour_")) { + switch (ship.bulkheads.m.name){ + case "Lightweight Alloy": + item = ship.id + "_Armour_Grade1"; + break; + case "Reinforced Alloy": + item = ship.id + "_Armour_Grade2"; + break; + case "Military Grade Composite": + item = ship.id + "_Armour_Grade3"; + break; + case "Mirrored Surface Composite": + item = ship.id + "_Armour_Mirrored"; + break; + case "Reactive Surface Composite": + item = ship.id + "_Armour_Reactive"; + break; + } + console.log(item); + } + else { + item = module.m.symbol; + } + blueprints.push({ - "item": module.m.symbol, + "item": item, "blueprint": module.m.blueprint.fdname, "grade": module.m.blueprint.grade, "highestGradePercentage":1.0 @@ -193,11 +221,12 @@ export default class ModalShoppingList extends TranslatedComponent { "version":1, "name":ship.name, // TO-DO: Import build name and put that here correctly "items": blueprints - } - + } + let JSONString = JSON.stringify(baseJson) + console.log(JSONString) let deflated = zlib.deflateSync(JSONString) - + //actually encode let link = base64url.encode(deflated) link = "edomh://coriolis/?" + link; @@ -320,16 +349,22 @@ export default class ModalShoppingList extends TranslatedComponent {
{translate('PHRASE_FAIL_EDENGINEER')}
{translate('PHRASE_FIREFOX_EDENGINEER')}
- - +{translate('PHRASE_FAILED_TO_FIND_EDENGINEER')}
+{translate('PHRASE_ENSURE_EDOMH')}
+ +