Add event to just update strength numbers
This commit is contained in:
parent
9d1d64f1d9
commit
f645c234ce
@ -56,16 +56,21 @@ function updateMapDom() {
|
||||
}
|
||||
}
|
||||
|
||||
showStrengths();
|
||||
|
||||
showRemainingReinforcements();
|
||||
}
|
||||
|
||||
function showStrengths() {
|
||||
for (let region of Region.getAllRegions()) {
|
||||
const element = document.querySelector(`.node[data-name=${region.name}]`);
|
||||
element.querySelector(".strength").textContent = region.displayStrength();
|
||||
element.style.backgroundColor =
|
||||
region.owner === null ? "white" : region.owner.getColor();
|
||||
}
|
||||
|
||||
showRemainingReinforcements();
|
||||
}
|
||||
|
||||
document.addEventListener("updateStrengths", showStrengths);
|
||||
document.addEventListener("gameStateUpdate", () => {
|
||||
if (!game.isWaiting()) {
|
||||
document.querySelector("#ready-button").style.display = "none";
|
||||
|
@ -79,6 +79,7 @@ class Strength {
|
||||
let result = proofSessionVerifier.verify(BigInt(data.z));
|
||||
if (result > 0) {
|
||||
this.assumedStrength = plainText;
|
||||
document.dispatchEvent(new CustomEvent("updateStrengths"));
|
||||
controller.abort();
|
||||
} else {
|
||||
console.warn(`Failed to verify ciphertext! ${result}`);
|
||||
|
Loading…
Reference in New Issue
Block a user