summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-07-13 13:16:48 +0200
committerTor Andersson <tor@ccxvii.net>2024-07-13 13:16:48 +0200
commit52c9f0882311a976d3eef1ae842b8500ca844648 (patch)
tree6f72052745a1a9a7383a84b32599e32381bffa49
parentd8eb06fb7bcf7b6e2218a92aa9db1a5aef533faa (diff)
downloadplantagenet-52c9f0882311a976d3eef1ae842b8500ca844648.tar.gz
show feed x4/x5/x6 using multiple feed markers
-rw-r--r--play.js34
1 files changed, 25 insertions, 9 deletions
diff --git a/play.js b/play.js
index 1cb5a09..a9fcf69 100644
--- a/play.js
+++ b/play.js
@@ -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)