From feb3ab2f33cbac726a14aa37ef68ce9cec21131e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 23 Jun 2021 12:28:57 +0200 Subject: crusader: Kingdom names in tooltip. --- ui.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; } -- cgit v1.2.3