
This code below is what I am currently working with, the current problem is if I place a number into unused_experience_points and hit enter it sums up unused_experience_points and used_experience_points and enters a value for total_experiance_points this is as intended, however if I place a number into used_experiance_points and hit enter the number gets entered into the attribute however it is not updating total_experiance_points, so I am not seeing why its not summing unused_experience_points and used_experience_points and is not entering a value for total_experiance_points if I am entering the number in used_experience_points, as far as I can tell it should be updating on change. so could use some extra eyes to help me figure this out. Code Below: on("change:unused_experience_points change:used_experience_points:opened", function() {
getAttrs(["unused_experience_points","used_experience_points"], function(values) {
let unusedexperiencepoints = parseInt(values.unused_experience_points,10)||0;
let usedexperiencepoints = parseInt(values.used_experience_points,10)||0;
let totalexperiencepoints = unusedexperiencepoints + usedexperiencepoints;
setAttrs({
total_experience_points: totalexperiencepoints
});
});
});