diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-12-13 00:53:33 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-12-13 00:53:33 +0100 |
commit | e333776a3177c7bdaec2deedcda79234554d8819 (patch) | |
tree | 2f343ca7281c063c4047cd15f066a39dad138e0b | |
parent | c70c909671e9a629bccb785d2777954131480dd7 (diff) | |
download | maria-e333776a3177c7bdaec2deedcda79234554d8819.tar.gz |
change color of retroactive re-conquest markers
-rw-r--r-- | play.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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])) |