From e333776a3177c7bdaec2deedcda79234554d8819 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 13 Dec 2024 00:53:33 +0100 Subject: change color of retroactive re-conquest markers --- play.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 9be37f9..9969032 100644 --- a/play.js +++ b/play.js @@ -1230,7 +1230,7 @@ function count_victory_markers(pow) { // count retroactive markers for display (except 4 special electoral colleges) for (let i = 0; i < view.retro.length; i += 2) if (!set_has(all_elector_fortresses, view.retro[i])) - if (view.retro[i+1] === pow) + if (actual_retro_power(view.retro[i], view.retro[i+1]) === pow) ++n return n @@ -1438,6 +1438,12 @@ function update_political() { } } +function actual_retro_power(s, current) { + // conquest retroactive markers have color of new conquering power + // re-conquest retroactive markers have color of old conquest marker + return map_get(view.victory, s, current) +} + function on_update() { ui.header.classList.toggle("france", view.power === P_FRANCE) ui.header.classList.toggle("bavaria", view.power === P_BAVARIA) @@ -1541,7 +1547,7 @@ function on_update() { ui.markers_element.replaceChildren() for (let i = 0; i < view.retro.length; i += 2) - layout_retro(view.retro[i], view.retro[i+1]) + layout_retro(view.retro[i], actual_retro_power(view.retro[i], view.retro[i+1])) for (let i = 0; i < view.victory.length; i += 2) if (!map_has(view.retro, view.victory[i])) -- cgit v1.2.3