summaryrefslogtreecommitdiff
path: root/ui.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-23 12:28:57 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:38 +0100
commitfeb3ab2f33cbac726a14aa37ef68ce9cec21131e (patch)
tree3390e36c67727d62eed1086ff501ecc62ef93c0b /ui.js
parent1b85d5997e8416674e345c439d379229d74e44ff (diff)
downloadcrusader-rex-feb3ab2f33cbac726a14aa37ef68ce9cec21131e.tar.gz
crusader: Kingdom names in tooltip.
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index 6502cea..dcf5648 100644
--- a/ui.js
+++ b/ui.js
@@ -11,6 +11,18 @@ const ENGLAND = "England";
const FRANCE = "France";
const GERMANIA = "Germania";
+const KINGDOM = {
+ "Syria": "Syria",
+ "Jerusalem": "Kingdom of Jerusalem",
+ "Antioch": "Principality of Antioch",
+ "Tripoli": "County of Tripoli",
+};
+
+const VICTORY_TOWNS = [
+ "Aleppo", "Damascus", "Egypt",
+ "Antioch", "Tripoli", "Acre", "Jerusalem"
+];
+
let label_layout = window.localStorage['crusader-rex/label-layout'] || 'spread';
function set_spread_layout() {
@@ -65,6 +77,11 @@ function on_focus_town(evt) {
let text = where;
if (where in SHIELDS)
text += " \u2014 " + SHIELDS[where].join(", ");
+ let kingdom = KINGDOM[TOWNS[where].region];
+ if (kingdom)
+ text += " \u2014 " + kingdom;
+ if (VICTORY_TOWNS.includes(where))
+ text += " \u2014 1 VP";
document.getElementById("status").textContent = text;
}