From e520208ec6f0224a0138d70930efa9b30c7733d7 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 27 Jan 2018 16:15:21 +0000 Subject: [PATCH] Some more attempts --- package-lock.json | 17 +++++++++++++++++ src/app/pages/OutfittingPage.jsx | 9 ++++++--- src/app/shipyard/Ship.js | 8 ++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b20b18d6..fc0ad1f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1983,6 +1983,11 @@ "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, + "clamp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clamp/-/clamp-1.0.1.tgz", + "integrity": "sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ=" + }, "clap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/clap/-/clap-1.2.3.tgz", @@ -10179,6 +10184,11 @@ "object-assign": "4.1.1" } }, + "react-clickdrag": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/react-clickdrag/-/react-clickdrag-3.0.2.tgz", + "integrity": "sha1-VN9fPfbWlcVOmXigglP4PedhG9I=" + }, "react-dom": { "version": "15.6.2", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.6.2.tgz", @@ -10201,6 +10211,13 @@ "resize-observer-polyfill": "1.4.2" } }, + "react-number-editor": { + "version": "github:Athanasius/react-number-editor#b6ff7b549425c87afca34dccdaa5e4cc59f9fd30", + "requires": { + "clamp": "1.0.1", + "react-clickdrag": "3.0.2" + } + }, "react-resize-detector": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/react-resize-detector/-/react-resize-detector-0.4.1.tgz", diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx index 720ca407..8cacdf4b 100644 --- a/src/app/pages/OutfittingPage.jsx +++ b/src/app/pages/OutfittingPage.jsx @@ -73,9 +73,10 @@ export default class OutfittingPage extends Page { let remoteID = params.remote; if (remoteID) { // Remote instance, fetch data. - Axios.get('https://orbis.zone/api/ships/' + remoteID + '/fdev') + Axios.get('http://127.0.0.1:8081/api/ships/' + remoteID + '/fdev') .then((response) => { let remote = response.data; + let buildName = params.bn; let shipId = SHIP_FD_NAME_TO_CORIOLIS_NAME[remote.Ship]; let data = Ships[shipId]; @@ -94,6 +95,8 @@ export default class OutfittingPage extends Page { error: null, title: this._getTitle(buildName), costTab: Persist.getCostTab() || 'costs', + buildName, + newBuildName: buildName, shipId, ship, sys, @@ -108,10 +111,10 @@ export default class OutfittingPage extends Page { opponentEng, opponentWep, engagementRange - }; + }; }) .catch((err) => { - return { error: { message: 'Issue communicating with remote server'}}; + this.state = { error: { message: 'Issue communicating with remote server'}}; }) } else { let shipId = params.ship; diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 3efabf91..b8825998 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -785,6 +785,14 @@ export default class Ship { ); }; + buildFromLoadout(Modules) { + let internal = this.internal, + standard = this.standard, + hps = this.hardpoints, + cl = standard.length, + i, l; + } + /** * Empties all hardpoints and utility slots * @return {this} The current ship instance for chaining