From fa93dc1cbb185bab17da9c09d6c2c08fefb2e99c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 8 Oct 2023 12:45:42 +0200 Subject: 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. --- play.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'play.js') 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: '', B1: '', @@ -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") -- cgit v1.2.3