|
|
@ -1954,20 +1954,14 @@ function calculateSettingNames($scope, burningData){ |
|
|
|
// Only settings that are leads from the last lifepath are allowed
|
|
|
|
// Only settings that are leads from the last lifepath are allowed
|
|
|
|
var lastLifepath = $scope.selectedLifepaths[$scope.selectedLifepaths.length-1]; |
|
|
|
var lastLifepath = $scope.selectedLifepaths[$scope.selectedLifepaths.length-1]; |
|
|
|
|
|
|
|
|
|
|
|
// Doing this filtering instead of something like [lastLifepath.setting, ...lastLifepath.leads]
|
|
|
|
// Doing this filtering instead of [lastLifepath.setting, ...lastLifepath.keyLeads] for two reasons:
|
|
|
|
// accomplishes two things: only presents settings present in this server and maintains relative order.
|
|
|
|
// only presents settings present in this server and maintains relative order.
|
|
|
|
$scope.settingNames = $scope.settingNames.filter(s => s == lastLifepath.setting |
|
|
|
$scope.settingNames = $scope.settingNames.filter(s => s == lastLifepath.setting |
|
|
|
|| (lastLifepath.leads && lastLifepath.leads.includes(s))); |
|
|
|
|| (Array.isArray(lastLifepath.keyLeads) && lastLifepath.keyLeads.includes(s))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var currentSettingNeedsUpdate = true; |
|
|
|
var currentSettingNeedsUpdate = !$scope.settingNames.includes(lastCurrentSetting); |
|
|
|
for(var i = 0; i < $scope.settingNames.length; i++){ |
|
|
|
|
|
|
|
if( $scope.settingNames[i] == lastCurrentSetting){ |
|
|
|
|
|
|
|
currentSettingNeedsUpdate = false; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( currentSettingNeedsUpdate && $scope.settingNames.length > 0 ){ |
|
|
|
if ( currentSettingNeedsUpdate && $scope.settingNames.length > 0 ){ |
|
|
|
$scope.currentSetting = $scope.settingNames[0]; |
|
|
|
$scope.currentSetting = $scope.settingNames[0]; |
|
|
|