diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-07-13 13:16:48 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-07-13 13:16:48 +0200 |
commit | 52c9f0882311a976d3eef1ae842b8500ca844648 (patch) | |
tree | 6f72052745a1a9a7383a84b32599e32381bffa49 /play.js | |
parent | d8eb06fb7bcf7b6e2218a92aa9db1a5aef533faa (diff) | |
download | plantagenet-52c9f0882311a976d3eef1ae842b8500ca844648.tar.gz |
show feed x4/x5/x6 using multiple feed markers
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 34 |
1 files changed, 25 insertions, 9 deletions
@@ -350,7 +350,8 @@ const ui = { lord_moved1: [], lord_moved2: [], - lord_feed: [], + lord_feed1: [], + lord_feed2: [], cards: [], cards2: [], @@ -470,7 +471,8 @@ function build_lord_mat(ix, side, name) { ui.lord_moved1[ix] = build_div(ui.marker_area[ix], "marker square moved_fought one hide") ui.lord_moved2[ix] = build_div(ui.marker_area[ix], "marker square moved_fought two hide") - ui.lord_feed[ix] = build_div(ui.marker_area[ix], "marker small feed x2") + ui.lord_feed1[ix] = build_div(ui.marker_area[ix], "marker small feed x2") + ui.lord_feed2[ix] = build_div(ui.marker_area[ix], "marker small feed x2") ui.mat[ix] = mat register_action(ui.mat_card[ix], "lord", ix) @@ -1057,12 +1059,25 @@ function update_lord_mat(ix) { update_lord_troops(ui.routed_troops[ix], view.pieces.routed, ix, true) let n = count_lord_all_forces(ix) - if (n <= 6) - ui.lord_feed[ix].className = "hide" - else if (n <= 12) - ui.lord_feed[ix].className = "marker small feed x2" - else - ui.lord_feed[ix].className = "marker small feed x3" + if (n <= 6) { + ui.lord_feed1[ix].className = "hide" + ui.lord_feed2[ix].className = "hide" + } else if (n <= 12) { + ui.lord_feed1[ix].className = "marker small feed x2" + ui.lord_feed2[ix].className = "hide" + } else if (n <= 18) { + ui.lord_feed1[ix].className = "marker small feed x3" + ui.lord_feed2[ix].className = "hide" + } else if (n <= 24) { + ui.lord_feed1[ix].className = "marker small feed x2" + ui.lord_feed2[ix].className = "marker small feed x2" + } else if (n <= 30) { + ui.lord_feed1[ix].className = "marker small feed x3" + ui.lord_feed2[ix].className = "marker small feed x2" + } else { + ui.lord_feed1[ix].className = "marker small feed x3" + ui.lord_feed2[ix].className = "marker small feed x3" + } if (get_lord_locale(LORD_HENRY_VI) === CAPTURE_OF_THE_KING + ix) ui.marker_area[ix].appendChild(ui.captured_king) @@ -1076,7 +1091,8 @@ function update_lord_mat(ix) { ui.routed_troops[ix].replaceChildren() ui.lord_moved1[ix].classList.add("hide") ui.lord_moved2[ix].classList.add("hide") - ui.lord_feed[ix].className = "hide" + ui.lord_feed1[ix].className = "hide" + ui.lord_feed2[ix].className = "hide" if (get_lord_locale(LORD_HENRY_VI) === CAPTURE_OF_THE_KING + ix) ui.marker_area[ix].appendChild(ui.captured_king) |