|
|
@ -274,8 +274,10 @@ function BurningDataService($http) { |
|
|
|
this.whenStocksLoaded = fetch("/stocks") |
|
|
|
this.whenStocksLoaded = fetch("/stocks") |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((data) => { |
|
|
|
.then((data) => { |
|
|
|
if(DEBUG) |
|
|
|
if(DEBUG) { |
|
|
|
console.log("Loaded stock data: "+data); |
|
|
|
console.log("Loaded stock data:"); |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
} |
|
|
|
myself.stocks = data; |
|
|
|
myself.stocks = data; |
|
|
|
for (var stock of Object.keys(data)) { |
|
|
|
for (var stock of Object.keys(data)) { |
|
|
|
myself.startingStatPts[stock] = new StartingStatPoints(myself.stocks[stock].starting_stats); |
|
|
|
myself.startingStatPts[stock] = new StartingStatPoints(myself.stocks[stock].starting_stats); |
|
|
@ -290,8 +292,10 @@ function BurningDataService($http) { |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((data) => { |
|
|
|
.then((data) => { |
|
|
|
myself.skills = data; |
|
|
|
myself.skills = data; |
|
|
|
if(DEBUG) |
|
|
|
if(DEBUG) { |
|
|
|
console.log("Loaded skill data: "+data); |
|
|
|
console.log("Loaded skill data:"); |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
.catch((error) => { |
|
|
|
console.log("Error: Getting skills from server failed: "+error); |
|
|
|
console.log("Error: Getting skills from server failed: "+error); |
|
|
@ -302,8 +306,10 @@ function BurningDataService($http) { |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((data) => { |
|
|
|
.then((data) => { |
|
|
|
myself.traits = data; |
|
|
|
myself.traits = data; |
|
|
|
if(DEBUG) |
|
|
|
if(DEBUG) { |
|
|
|
console.log("Loaded trait data: "+data); |
|
|
|
console.log("Loaded trait data:"); |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
.catch((error) => { |
|
|
|
console.log("Error: Getting traits from server failed: "+error); |
|
|
|
console.log("Error: Getting traits from server failed: "+error); |
|
|
@ -318,8 +324,10 @@ function BurningDataService($http) { |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((data) => { |
|
|
|
.then((data) => { |
|
|
|
myself.lifepaths[stock] = data; |
|
|
|
myself.lifepaths[stock] = data; |
|
|
|
if(DEBUG) |
|
|
|
if(DEBUG) { |
|
|
|
console.log("Loaded "+stock+" lifepaths. " + Object.keys(myself.lifepaths[stock]).length + " settings"); |
|
|
|
console.log("Loaded "+stock+" lifepaths:"); |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
.catch((error) => { |
|
|
|
console.log("Error: Getting "+stock+" lifepaths from server failed: "+error); |
|
|
|
console.log("Error: Getting "+stock+" lifepaths from server failed: "+error); |
|
|
@ -333,11 +341,13 @@ function BurningDataService($http) { |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((response) => response.json()) |
|
|
|
.then((data) => { |
|
|
|
.then((data) => { |
|
|
|
myself.resources[stock] = data; |
|
|
|
myself.resources[stock] = data; |
|
|
|
if(DEBUG) |
|
|
|
if(DEBUG) { |
|
|
|
console.log("Loaded "+stock+" resources. "); |
|
|
|
console.log("Loaded "+stock+" resources:"); |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
.catch((error) => { |
|
|
|
console.log("Error: Getting "+stock+" stat points from server failed: "+error); |
|
|
|
console.log("Error: Getting "+stock+" resources from server failed: "+error); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|