Fix edit IDs
This commit is contained in:
parent
bcef76a0a9
commit
6474e1bb2b
1 changed files with 6 additions and 16 deletions
|
@ -210,7 +210,6 @@ function decodeBuild(url_tag) {
|
|||
setValue(equipmentInputs[i], equipment[i]);
|
||||
}
|
||||
calculateBuild(save_skp, skillpoints);
|
||||
updateEditableIDs();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,6 +305,7 @@ function encodeBuild() {
|
|||
|
||||
function calculateBuild(save_skp, skp){
|
||||
try {
|
||||
resetEditableIDs();
|
||||
if(player_build){
|
||||
reset_powder_specials();
|
||||
updateBoosts("skip", false);
|
||||
|
@ -397,6 +397,7 @@ function calculateBuild(save_skp, skp){
|
|||
player_build.assigned_skillpoints += delta_total;
|
||||
}
|
||||
|
||||
updateEditableIDs();
|
||||
calculateBuildStats();
|
||||
if (player_build.errored)
|
||||
throw new ListError(player_build.errors);
|
||||
|
@ -533,16 +534,6 @@ function updateEditableIDs() {
|
|||
/* Resets all IDs in the edit IDs section to their "original" values.
|
||||
*/
|
||||
function resetEditableIDs() {
|
||||
if (player_build) {
|
||||
for (const id of editable_item_fields) {
|
||||
let edit_input = document.getElementById(id);
|
||||
let value_label = document.getElementById(id + "-base");
|
||||
|
||||
edit_input.value = value_label.value;
|
||||
edit_input.placeholder = value_label.value;
|
||||
}
|
||||
} else {
|
||||
//no player build, reset to 0
|
||||
for (const id of editable_item_fields) {
|
||||
let edit_input = document.getElementById(id);
|
||||
|
||||
|
@ -550,7 +541,6 @@ function resetEditableIDs() {
|
|||
edit_input.placeholder = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Updates all spell boosts
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue