summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-12-13 00:53:33 +0100
committerTor Andersson <tor@ccxvii.net>2024-12-13 00:53:33 +0100
commite333776a3177c7bdaec2deedcda79234554d8819 (patch)
tree2f343ca7281c063c4047cd15f066a39dad138e0b /play.js
parentc70c909671e9a629bccb785d2777954131480dd7 (diff)
downloadmaria-e333776a3177c7bdaec2deedcda79234554d8819.tar.gz
change color of retroactive re-conquest markers
Diffstat (limited to 'play.js')
-rw-r--r--play.js10
1 files changed, 8 insertions, 2 deletions
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]))