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]);
|
setValue(equipmentInputs[i], equipment[i]);
|
||||||
}
|
}
|
||||||
calculateBuild(save_skp, skillpoints);
|
calculateBuild(save_skp, skillpoints);
|
||||||
updateEditableIDs();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,6 +305,7 @@ function encodeBuild() {
|
||||||
|
|
||||||
function calculateBuild(save_skp, skp){
|
function calculateBuild(save_skp, skp){
|
||||||
try {
|
try {
|
||||||
|
resetEditableIDs();
|
||||||
if(player_build){
|
if(player_build){
|
||||||
reset_powder_specials();
|
reset_powder_specials();
|
||||||
updateBoosts("skip", false);
|
updateBoosts("skip", false);
|
||||||
|
@ -397,6 +397,7 @@ function calculateBuild(save_skp, skp){
|
||||||
player_build.assigned_skillpoints += delta_total;
|
player_build.assigned_skillpoints += delta_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateEditableIDs();
|
||||||
calculateBuildStats();
|
calculateBuildStats();
|
||||||
if (player_build.errored)
|
if (player_build.errored)
|
||||||
throw new ListError(player_build.errors);
|
throw new ListError(player_build.errors);
|
||||||
|
@ -533,22 +534,11 @@ function updateEditableIDs() {
|
||||||
/* Resets all IDs in the edit IDs section to their "original" values.
|
/* Resets all IDs in the edit IDs section to their "original" values.
|
||||||
*/
|
*/
|
||||||
function resetEditableIDs() {
|
function resetEditableIDs() {
|
||||||
if (player_build) {
|
for (const id of editable_item_fields) {
|
||||||
for (const id of editable_item_fields) {
|
let edit_input = document.getElementById(id);
|
||||||
let edit_input = document.getElementById(id);
|
|
||||||
let value_label = document.getElementById(id + "-base");
|
|
||||||
|
|
||||||
edit_input.value = value_label.value;
|
edit_input.value = 0;
|
||||||
edit_input.placeholder = value_label.value;
|
edit_input.placeholder = 0;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//no player build, reset to 0
|
|
||||||
for (const id of editable_item_fields) {
|
|
||||||
let edit_input = document.getElementById(id);
|
|
||||||
|
|
||||||
edit_input.value = 0;
|
|
||||||
edit_input.placeholder = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue