summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-08 12:45:42 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-08 23:02:03 +0200
commitfa93dc1cbb185bab17da9c09d6c2c08fefb2e99c (patch)
tree9c795adab354659eea91a5d044793b5bd4854380 /play.js
parent111988c6d409029a1a27e20ebb9a4e2c90bcfeab (diff)
downloadtime-of-crisis-fa93dc1cbb185bab17da9c09d6c2c08fefb2e99c.tar.gz
Add tinted militia and reduced legions as option (on by default).
Make it easier to see what is what in a mixed stack than just the tiny combat strength number.
Diffstat (limited to 'play.js')
-rw-r--r--play.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/play.js b/play.js
index 2beae4e..c188a83 100644
--- a/play.js
+++ b/play.js
@@ -1,8 +1,11 @@
"use strict"
-// TODO: battle dialog popup for rolling and assigning hits!
// TODO: show killed leaders taken for bonus purchase
+function check_menu(id, x) {
+ document.getElementById(id).className = x ? "menu_item checked" : "menu_item unchecked"
+}
+
const ICONS = {
B0: '<span class="black d0"></span>',
B1: '<span class="black d1"></span>',
@@ -1717,5 +1720,21 @@ function on_blur_tip() {
ui.card_tip.className = "hide"
}
+let tint = window.localStorage[params.title_id + "/tint"]
+if (tint === undefined)
+ tint = 1
+
+set_tint(tint)
+
+function set_tint(x) {
+ window.localStorage[params.title_id + "/tint"] = tint = x
+ check_menu("tint", !!tint)
+ ui.body.classList.toggle("tint", !!tint)
+}
+
+function toggle_tint() {
+ set_tint(!tint)
+}
+
on_init()
scroll_with_middle_mouse("main")