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