|
|
@ -1,8 +1,8 @@ |
|
|
|
function loadCurrentCharacterFromStruct($scope, charStruct, burningData, appropriateWeapons){ |
|
|
|
function loadCurrentCharacterFromStruct($scope, charStruct, burningData, appropriateWeapons){ |
|
|
|
$scope.name = charStruct.name; |
|
|
|
$scope.name = charStruct.name; |
|
|
|
$scope.gender = charStruct.gender; |
|
|
|
$scope.gender = charStruct.gender; |
|
|
|
$scope.stock = charStruct.stock; |
|
|
|
$scope.stock = charStruct.stock; |
|
|
|
|
|
|
|
$scope.ensureStockLoaded($scope.stock).then(() => { |
|
|
|
// Appropriate weapons must be loaded before calculateLifepathSkills is called.
|
|
|
|
// Appropriate weapons must be loaded before calculateLifepathSkills is called.
|
|
|
|
if(serverSettings.storageType != 'server'){ |
|
|
|
if(serverSettings.storageType != 'server'){ |
|
|
|
appropriateWeapons.appropriateWeapons = charStruct.approp_weapons; |
|
|
|
appropriateWeapons.appropriateWeapons = charStruct.approp_weapons; |
|
|
@ -15,8 +15,8 @@ function loadCurrentCharacterFromStruct($scope, charStruct, burningData, appropr |
|
|
|
var selectedLifepaths = []; |
|
|
|
var selectedLifepaths = []; |
|
|
|
for(var i = 0; i < charStruct.lifepaths.length; i++){ |
|
|
|
for(var i = 0; i < charStruct.lifepaths.length; i++){ |
|
|
|
var lp = charStruct.lifepaths[i]; |
|
|
|
var lp = charStruct.lifepaths[i]; |
|
|
|
// lp[0] is setting name, lp[1] is lifepath name.
|
|
|
|
// lp[0] is setting name, lp[1] is lifepath name.
|
|
|
|
// lp[2] is brutalLifeDOF, lp[3] is brutalLifeTraitName,
|
|
|
|
// lp[2] is brutalLifeDOF, lp[3] is brutalLifeTraitName,
|
|
|
|
// lp[4] is lifepath time, if it's variable and the user selected a value
|
|
|
|
// lp[4] is lifepath time, if it's variable and the user selected a value
|
|
|
|
// lp[5] is the replacement skill for 'Weapon Of Choice' if it's present.
|
|
|
|
// lp[5] is the replacement skill for 'Weapon Of Choice' if it's present.
|
|
|
|
// lp[6] is the replacement stat array, if present. This is needed if the
|
|
|
|
// lp[6] is the replacement stat array, if present. This is needed if the
|
|
|
@ -128,19 +128,19 @@ function loadCurrentCharacterFromStruct($scope, charStruct, burningData, appropr |
|
|
|
|
|
|
|
|
|
|
|
// Load Resources
|
|
|
|
// Load Resources
|
|
|
|
$scope.gear = {}; |
|
|
|
$scope.gear = {}; |
|
|
|
for(var i = 0; i < charStruct.gear.length; i++){
|
|
|
|
for(var i = 0; i < charStruct.gear.length; i++){ |
|
|
|
var gear = charStruct.gear[i]; |
|
|
|
var gear = charStruct.gear[i]; |
|
|
|
$scope.gear[gear.desc] = new DisplayGear(gear.desc, gear.cost); |
|
|
|
$scope.gear[gear.desc] = new DisplayGear(gear.desc, gear.cost); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.property = {}; |
|
|
|
$scope.property = {}; |
|
|
|
for(var i = 0; i < charStruct.property.length; i++){
|
|
|
|
for(var i = 0; i < charStruct.property.length; i++){ |
|
|
|
var property = charStruct.property[i]; |
|
|
|
var property = charStruct.property[i]; |
|
|
|
$scope.property[property.desc] = new DisplayGear(property.desc, property.cost); |
|
|
|
$scope.property[property.desc] = new DisplayGear(property.desc, property.cost); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.relationships = {}; |
|
|
|
$scope.relationships = {}; |
|
|
|
for(var i = 0; i < charStruct.relationships.length; i++){
|
|
|
|
for(var i = 0; i < charStruct.relationships.length; i++){ |
|
|
|
var rel = charStruct.relationships[i]; |
|
|
|
var rel = charStruct.relationships[i]; |
|
|
|
$scope.relationships[rel.desc] = new DisplayRelationship( |
|
|
|
$scope.relationships[rel.desc] = new DisplayRelationship( |
|
|
|
rel.desc, |
|
|
|
rel.desc, |
|
|
@ -154,13 +154,13 @@ function loadCurrentCharacterFromStruct($scope, charStruct, burningData, appropr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.affiliations = {}; |
|
|
|
$scope.affiliations = {}; |
|
|
|
for(var i = 0; i < charStruct.affiliations.length; i++){
|
|
|
|
for(var i = 0; i < charStruct.affiliations.length; i++){ |
|
|
|
var affil = charStruct.affiliations[i]; |
|
|
|
var affil = charStruct.affiliations[i]; |
|
|
|
$scope.affiliations[affil.desc] = new DisplayAffiliation(affil.desc, affil.importance); |
|
|
|
$scope.affiliations[affil.desc] = new DisplayAffiliation(affil.desc, affil.importance); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.reputations = {}; |
|
|
|
$scope.reputations = {}; |
|
|
|
for(var i = 0; i < charStruct.reputations.length; i++){
|
|
|
|
for(var i = 0; i < charStruct.reputations.length; i++){ |
|
|
|
var rep = charStruct.reputations[i]; |
|
|
|
var rep = charStruct.reputations[i]; |
|
|
|
$scope.reputations[rep.desc] = new DisplayReputation(rep.desc, rep.importance); |
|
|
|
$scope.reputations[rep.desc] = new DisplayReputation(rep.desc, rep.importance); |
|
|
|
} |
|
|
|
} |
|
|
@ -173,14 +173,15 @@ function loadCurrentCharacterFromStruct($scope, charStruct, burningData, appropr |
|
|
|
$scope.attributeModifierQuestionResults = loadAttributeModifierQuestionResultsFromSave($scope, charStruct.attr_mod_questions); |
|
|
|
$scope.attributeModifierQuestionResults = loadAttributeModifierQuestionResultsFromSave($scope, charStruct.attr_mod_questions); |
|
|
|
|
|
|
|
|
|
|
|
$scope.brutalLifeWithdrawn = charStruct.brutal_life_withdrawn; |
|
|
|
$scope.brutalLifeWithdrawn = charStruct.brutal_life_withdrawn; |
|
|
|
|
|
|
|
$scope.$digest(); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
// To serialize:
|
|
|
|
// To serialize:
|
|
|
|
// - Serialized version
|
|
|
|
// - Serialized version
|
|
|
|
// - Character name
|
|
|
|
// - Character name
|
|
|
|
// - Stock
|
|
|
|
// - Stock
|
|
|
|
// - Gender
|
|
|
|
// - Gender
|
|
|
|
// - A list Lifepath names, with setting: [setting, lifepath]
|
|
|
|
// - A list Lifepath names, with setting: [setting, lifepath]
|
|
|
|
// - How many points were spent on which stat
|
|
|
|
// - How many points were spent on which stat
|
|
|
@ -225,10 +226,10 @@ function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
var displayStat = $scope.stats[i]; |
|
|
|
var displayStat = $scope.stats[i]; |
|
|
|
|
|
|
|
|
|
|
|
stats.push({ |
|
|
|
stats.push({ |
|
|
|
"name" : displayStat.name,
|
|
|
|
"name" : displayStat.name, |
|
|
|
"shade" : displayStat.shade,
|
|
|
|
"shade" : displayStat.shade, |
|
|
|
"mentalPoints" : displayStat.mentalPointsSpent,
|
|
|
|
"mentalPoints" : displayStat.mentalPointsSpent, |
|
|
|
"physicalPoints" : displayStat.physicalPointsSpent,
|
|
|
|
"physicalPoints" : displayStat.physicalPointsSpent, |
|
|
|
"eitherPoints" : displayStat.eitherPointsSpent |
|
|
|
"eitherPoints" : displayStat.eitherPointsSpent |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -277,7 +278,7 @@ function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var res = serializeResource( $scope.gear, function(display){ |
|
|
|
var res = serializeResource( $scope.gear, function(display){ |
|
|
|
return {
|
|
|
|
return { |
|
|
|
"cost" : display.cost, |
|
|
|
"cost" : display.cost, |
|
|
|
"desc" : display.desc |
|
|
|
"desc" : display.desc |
|
|
|
}; |
|
|
|
}; |
|
|
@ -285,7 +286,7 @@ function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
chardata.gear = res; |
|
|
|
chardata.gear = res; |
|
|
|
|
|
|
|
|
|
|
|
var res = serializeResource( $scope.property, function(display){ |
|
|
|
var res = serializeResource( $scope.property, function(display){ |
|
|
|
return {
|
|
|
|
return { |
|
|
|
"cost" : display.cost, |
|
|
|
"cost" : display.cost, |
|
|
|
"desc" : display.desc |
|
|
|
"desc" : display.desc |
|
|
|
}; |
|
|
|
}; |
|
|
@ -293,7 +294,7 @@ function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
chardata.property = res; |
|
|
|
chardata.property = res; |
|
|
|
|
|
|
|
|
|
|
|
var res = serializeResource( $scope.relationships, function(display){ |
|
|
|
var res = serializeResource( $scope.relationships, function(display){ |
|
|
|
return {
|
|
|
|
return { |
|
|
|
"desc" : display.desc, |
|
|
|
"desc" : display.desc, |
|
|
|
"importance" : display.importance, |
|
|
|
"importance" : display.importance, |
|
|
|
"isImmedFam" : display.isImmedFam, |
|
|
|
"isImmedFam" : display.isImmedFam, |
|
|
@ -306,7 +307,7 @@ function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
chardata.relationships = res; |
|
|
|
chardata.relationships = res; |
|
|
|
|
|
|
|
|
|
|
|
var res = serializeResource( $scope.affiliations, function(display){ |
|
|
|
var res = serializeResource( $scope.affiliations, function(display){ |
|
|
|
return {
|
|
|
|
return { |
|
|
|
"desc" : display.desc, |
|
|
|
"desc" : display.desc, |
|
|
|
"importance" : display.importance |
|
|
|
"importance" : display.importance |
|
|
|
}; |
|
|
|
}; |
|
|
@ -314,7 +315,7 @@ function convertCurrentCharacterToStruct($scope, appropriateWeapons) { |
|
|
|
chardata.affiliations = res; |
|
|
|
chardata.affiliations = res; |
|
|
|
|
|
|
|
|
|
|
|
var res = serializeResource( $scope.reputations, function(display){ |
|
|
|
var res = serializeResource( $scope.reputations, function(display){ |
|
|
|
return {
|
|
|
|
return { |
|
|
|
"desc" : display.desc, |
|
|
|
"desc" : display.desc, |
|
|
|
"importance" : display.importance |
|
|
|
"importance" : display.importance |
|
|
|
}; |
|
|
|
}; |
|
|
|