summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-27 22:11:34 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-30 21:59:25 +0200
commitf361c42df67f66e1f3817a232a2309c3c54853de (patch)
tree56a18cd51779714f640294f4aafafb44d0f315a5 /play.js
parent15086e3cd5f4ca9d042d51805e19acad0c16ac35 (diff)
downloadfriedrich-f361c42df67f66e1f3817a232a2309c3c54853de.tar.gz
no piece tooltip on cards!
Diffstat (limited to 'play.js')
-rw-r--r--play.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/play.js b/play.js
index 2b52dee..c664c89 100644
--- a/play.js
+++ b/play.js
@@ -324,6 +324,13 @@ function is_action(action, arg) {
return !!(view.actions && view.actions[action] && set_has(view.actions[action], arg))
}
+function create_element(action, id, style) {
+ let e = document.createElement("div")
+ e.className = style
+ register_action(e, action, id)
+ return e
+}
+
function create_piece(action, id, style) {
let e = document.createElement("div")
e.className = style
@@ -343,12 +350,12 @@ function make_tc_deck(n) {
for (let suit = 0; suit <= 3; ++suit) {
for (let value = 2; value <= 13; ++value) {
let c = (n << 7) | (suit << 4) | value
- ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " " + suit_class[suit] + value)
+ ui.tc[c] = create_element("card", c, "card tc deck_" + (n+1) + " " + suit_class[suit] + value)
}
}
for (let value = 2; value <= 3; ++value) {
let c = (n << 7) | (4 << 4) | value
- ui.tc[c] = create_piece("card", c, "card tc deck_" + (n+1) + " R")
+ ui.tc[c] = create_element("card", c, "card tc deck_" + (n+1) + " R")
}
}