summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-28 02:29:46 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-30 21:59:25 +0200
commit7f0bc6422715e637ec3b80f1426b3ae512298f4e (patch)
treef90072e0b306492b2de58e0d28f0add5c089d823 /play.js
parentff01812e85b4744c9ac1f6826e0bf5c53182aa2a (diff)
downloadfriedrich-7f0bc6422715e637ec3b80f1426b3ae512298f4e.tar.gz
wip piece tips
Diffstat (limited to 'play.js')
-rw-r--r--play.js41
1 files changed, 40 insertions, 1 deletions
diff --git a/play.js b/play.js
index 2ceef9f..82b264b 100644
--- a/play.js
+++ b/play.js
@@ -985,6 +985,44 @@ const piece_log_name = [
"French supply train", "French supply train",
]
+const piece_power = [
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_HANOVER,
+ P_HANOVER,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_SWEDEN,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_IMPERIAL,
+ P_FRANCE,
+ P_FRANCE,
+ P_FRANCE,
+ P_PRUSSIA,
+ P_PRUSSIA,
+ P_HANOVER,
+ P_RUSSIA,
+ P_RUSSIA,
+ P_SWEDEN,
+ P_AUSTRIA,
+ P_AUSTRIA,
+ P_IMPERIAL,
+ P_FRANCE,
+ P_FRANCE,
+]
+
const piece_tooltip_name = [
"P1 Friedrich",
"P2 Winterfeldt",
@@ -1026,7 +1064,8 @@ const piece_tooltip_name = [
function sub_piece(match, p1) {
let x = p1 | 0
let n = piece_log_name[x]
- return `<span class="piece_tip" onclick="on_click_piece_tip(${x})" onmouseenter="on_focus_piece_tip(${x})" onmouseleave="on_blur_piece_tip(${x})">${n}</span>`
+ let p = power_class[piece_power[x]]
+ return `<span class="piece_tip ${p}" onclick="on_click_piece_tip(${x})" onmouseenter="on_focus_piece_tip(${x})" onmouseleave="on_blur_piece_tip(${x})">${n}</span>`
return n
}