|
|
|
@ -364,14 +364,7 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
$scope.stockSelected = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let loadPromises = []; |
|
|
|
|
if(!burningData.resources[$scope.stock]) { |
|
|
|
|
loadPromises.push(burningData.loadResourcesForStock($scope.stock)); |
|
|
|
|
} |
|
|
|
|
if(!burningData.lifepaths[$scope.stock]) { |
|
|
|
|
loadPromises.push(burningData.loadLifepathsForStock($scope.stock)); |
|
|
|
|
} |
|
|
|
|
Promise.all(loadPromises).then(() => { |
|
|
|
|
$scope.ensureStockLoaded($scope.stock).then(() => { |
|
|
|
|
var oldName = $scope.name; |
|
|
|
|
// Make a blank character sheet
|
|
|
|
|
$scope.initialize($scope.stock); |
|
|
|
@ -386,9 +379,21 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
calculateSpecialTraitsForDisplay($scope, burningData); |
|
|
|
|
calculateGearSelectionLists($scope, burningData); |
|
|
|
|
calculatePropertySelectionLists($scope, burningData); |
|
|
|
|
$scope.$digest(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.ensureStockLoaded = function(stock) { |
|
|
|
|
let loadPromises = []; |
|
|
|
|
if(!burningData.lifepaths[stock]) { |
|
|
|
|
loadPromises.push(burningData.loadLifepathsForStock(stock)); |
|
|
|
|
} |
|
|
|
|
if(!burningData.resources[stock]) { |
|
|
|
|
loadPromises.push(burningData.loadResourcesForStock(stock)); |
|
|
|
|
} |
|
|
|
|
return Promise.all(loadPromises); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$scope.onSettingChange = function(){ |
|
|
|
|
|
|
|
|
|
calculateCurrentSettingLifepathNames($scope, burningData); |
|
|
|
@ -413,8 +418,7 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
burningData.whenStocksLoaded.then(() => { |
|
|
|
|
$scope.stocks = [{ name: "Select a stock" }]; |
|
|
|
|
$scope.stocks = $scope.stocks.concat(Object.values(burningData.stocks)); |
|
|
|
|
$scope.stocks = [{ name: "Select a stock" }, ...Object.values(burningData.stocks)]; |
|
|
|
|
$scope.stockSelected = false; |
|
|
|
|
$scope.$digest(); |
|
|
|
|
}); |
|
|
|
|