From 0eecf99578c091875c8b34c233218e76f0898b94 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 29 Oct 2024 19:26:09 +0000 Subject: Fix spaces starting at 0 not 1 --- play.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/play.js b/play.js index 2528f4e..10eeb96 100644 --- a/play.js +++ b/play.js @@ -401,7 +401,7 @@ function create_ui() { ui.dem_inf = [] ui.com_inf = [] - for (let s = 1; s <= last_space; ++s) { + for (let s = 0; s <= last_space; ++s) { let info = spaces[s] let [ x, y, w, h ] = LAYOUT[info.ascii_name] let xc = Math.round(x + w / 2) @@ -451,10 +451,9 @@ function create_ui() { for (let c = 1; c <= last_power_card; ++c) { const power_card_e = document.createElement("div") register_action(power_card_e, "power_card", c) - power_card_e.className = "card power_" + c + power_card_e.className = "card power_card power_" + c ui.power_cards[c] = power_card_e } - ui.events = [] for (let id of box_events) { ui.events[id] = document.createElement("div") @@ -613,7 +612,7 @@ function on_update() { // UPDATE INFLUENCE VALUES - for (let s = 1; s <= last_space; ++s) { + for (let s = 0; s <= last_space; ++s) { const demInfl = view.demInfl[s] const comInfl = view.comInfl[s] @@ -662,9 +661,6 @@ function on_update() { if (view.show_opp_hand && view.opp_hand) for (let c of view.opp_hand) ui.opp_hand.appendChild(ui.cards[c]) - - // TODO: fix rules to set view.opp_power_hand - ui.opp_power_hand.replaceChildren() if (view.opp_power_hand) for (let c of view.opp_power_hand) ui.opp_hand.appendChild(ui.power_cards[c]) -- cgit v1.2.3