diff options
-rw-r--r-- | play.js | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -346,6 +346,11 @@ function add_hit_stick(parent) { throw Error("OUT OF CUBES ERROR") } +function get_player_color(p) { + let c = data.scenarios[view.scenario].players[p].cards[0] + return data.cards[c].wing +} + function on_update() { let p1 = 0, p2 = 1 if (player === "First") @@ -355,8 +360,8 @@ function on_update() { ui.name[p1].textContent = data.scenarios[view.scenario].players[0].name ui.name[p2].textContent = data.scenarios[view.scenario].players[1].name - let w1 = data.cards[view.front[0][0]].wing - let w2 = data.cards[view.front[1][0]].wing + let w1 = get_player_color(0) + let w2 = get_player_color(1) ui.role_panel[0].classList.add(side_color[w1]) ui.role_panel[0].classList.remove(side_color[w2]) |