mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Adding in buildname to EDOMH Export
This commit is contained in:
@@ -12,7 +12,8 @@ const base64url = require('base64url');
|
|||||||
export default class ModalShoppingList extends TranslatedComponent {
|
export default class ModalShoppingList extends TranslatedComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
ship: PropTypes.object.isRequired
|
ship: PropTypes.object.isRequired,
|
||||||
|
buildName: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -156,6 +157,7 @@ export default class ModalShoppingList extends TranslatedComponent {
|
|||||||
sendToEDOMH(event) {
|
sendToEDOMH(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const ship = this.props.ship;
|
const ship = this.props.ship;
|
||||||
|
const buildName = this.props.buildName;
|
||||||
let blueprints = [];
|
let blueprints = [];
|
||||||
|
|
||||||
//create the json
|
//create the json
|
||||||
@@ -216,15 +218,18 @@ export default class ModalShoppingList extends TranslatedComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let shipName = buildName + " - " + ship.name;
|
||||||
|
|
||||||
//create JSON to encode
|
//create JSON to encode
|
||||||
let baseJson = {
|
let baseJson = {
|
||||||
"version":1,
|
"version":1,
|
||||||
"name":ship.name, // TO-DO: Import build name and put that here correctly
|
"name": shipName, // TO-DO: Import build name and put that here correctly
|
||||||
"items": blueprints
|
"items": blueprints
|
||||||
}
|
}
|
||||||
|
|
||||||
let JSONString = JSON.stringify(baseJson)
|
let JSONString = JSON.stringify(baseJson)
|
||||||
console.log(JSONString)
|
console.log(JSONString)
|
||||||
|
console.log(ship)
|
||||||
let deflated = zlib.deflateSync(JSONString)
|
let deflated = zlib.deflateSync(JSONString)
|
||||||
|
|
||||||
//actually encode
|
//actually encode
|
||||||
@@ -333,6 +338,7 @@ export default class ModalShoppingList extends TranslatedComponent {
|
|||||||
this.sendToEDOMH = this.sendToEDOMH.bind(this);
|
this.sendToEDOMH = this.sendToEDOMH.bind(this);
|
||||||
return <div className='modal' onClick={ (e) => e.stopPropagation() }>
|
return <div className='modal' onClick={ (e) => e.stopPropagation() }>
|
||||||
<h2>{translate('PHRASE_SHOPPING_MATS')}</h2>
|
<h2>{translate('PHRASE_SHOPPING_MATS')}</h2>
|
||||||
|
<p>{translate('PHRASE_DIFFERENT_ROLLS')}</p>
|
||||||
{/* <label>{translate('Grade 1 rolls ')}</label>
|
{/* <label>{translate('Grade 1 rolls ')}</label>
|
||||||
<input id={1} type={'number'} min={0} defaultValue={this.state.matsPerGrade[1]} onChange={this.changeHandler} />
|
<input id={1} type={'number'} min={0} defaultValue={this.state.matsPerGrade[1]} onChange={this.changeHandler} />
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"PHRASE_NO_SPECIAL": "No experimental effect",
|
"PHRASE_NO_SPECIAL": "No experimental effect",
|
||||||
"PHRASE_SHOPPING_LIST": "Stations that sell this build",
|
"PHRASE_SHOPPING_LIST": "Stations that sell this build",
|
||||||
"PHRASE_SHOPPING_MATS": "Materials needed for this build",
|
"PHRASE_SHOPPING_MATS": "Materials needed for this build",
|
||||||
|
"PHRASE_DIFFERENT_ROLLS": "NOTE: ED Engineer and/or EDOMH likely have their own 'rolls' configuration, so material requirements may differ!",
|
||||||
"PHRASE_REFIT_SHOPPING_LIST": "Stations that sell required modules",
|
"PHRASE_REFIT_SHOPPING_LIST": "Stations that sell required modules",
|
||||||
"PHRASE_TOTAL_EFFECTIVE_SHIELD": "Total amount of damage that can be taken from each damage type, if using all shield cells",
|
"PHRASE_TOTAL_EFFECTIVE_SHIELD": "Total amount of damage that can be taken from each damage type, if using all shield cells",
|
||||||
"PHRASE_TIME_TO_LOSE_SHIELDS": "Shields will hold for",
|
"PHRASE_TIME_TO_LOSE_SHIELDS": "Shields will hold for",
|
||||||
@@ -82,7 +83,7 @@
|
|||||||
"TT_SUMMARY_LADEN_TOTAL_JUMP": "Farthest possible range with full cargo, a full fuel tank, and jumping as far as possible each time",
|
"TT_SUMMARY_LADEN_TOTAL_JUMP": "Farthest possible range with full cargo, a full fuel tank, and jumping as far as possible each time",
|
||||||
"HELP_MODIFICATIONS_MENU": "Click on a number to enter a new value, or drag along the bar for small changes",
|
"HELP_MODIFICATIONS_MENU": "Click on a number to enter a new value, or drag along the bar for small changes",
|
||||||
"PHRASE_FAIL_EDENGINEER": "Failed to send to EDEngineer (Launch EDEngineer and make sure the API is started then refresh the page.)",
|
"PHRASE_FAIL_EDENGINEER": "Failed to send to EDEngineer (Launch EDEngineer and make sure the API is started then refresh the page.)",
|
||||||
"PHRASE_ENSURE_EDOMH": "Ensure EDO Material Helper is running, else this button will do nothing!",
|
"PHRASE_ENSURE_EDOMH": "Ensure EDO Material Helper is installed and registered to handle edomh:// urls, else this button will do nothing!",
|
||||||
"PHRASE_FIREFOX_EDENGINEER": "Sending to EDEngineer is not compatible with Firefox's security settings. Please try again with Chrome.",
|
"PHRASE_FIREFOX_EDENGINEER": "Sending to EDEngineer is not compatible with Firefox's security settings. Please try again with Chrome.",
|
||||||
"PHRASE_FAILED_TO_FIND_EDENGINEER": "Failed to find ED Engineer API. Please ensure it is running and try again.",
|
"PHRASE_FAILED_TO_FIND_EDENGINEER": "Failed to find ED Engineer API. Please ensure it is running and try again.",
|
||||||
"MISSING_MODULES": "Missing Modules",
|
"MISSING_MODULES": "Missing Modules",
|
||||||
|
|||||||
@@ -700,7 +700,9 @@ export default class OutfittingPage extends Page {
|
|||||||
* Generates the shopping list
|
* Generates the shopping list
|
||||||
*/
|
*/
|
||||||
_genShoppingList() {
|
_genShoppingList() {
|
||||||
this.context.showModal(<ModalShoppingList ship={this.state.ship} />);
|
this.context.showModal(<ModalShoppingList
|
||||||
|
ship={this.state.ship}
|
||||||
|
buildName={this.state.buildName} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user