diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-10-08 12:45:42 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-10-08 23:02:03 +0200 |
commit | fa93dc1cbb185bab17da9c09d6c2c08fefb2e99c (patch) | |
tree | 9c795adab354659eea91a5d044793b5bd4854380 /play.js | |
parent | 111988c6d409029a1a27e20ebb9a4e2c90bcfeab (diff) | |
download | time-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.js | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -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") |