diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-20 18:10:33 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | d68a8f5426e335fce66c8b366646657115bbe65a (patch) | |
tree | cd509fbc50bddbb65d725652a2a86e9c388a8256 /play.js | |
parent | 8fb42cd1821020f433d19c01ce70fa45b4797ec4 (diff) | |
download | time-of-crisis-d68a8f5426e335fce66c8b366646657115bbe65a.tar.gz |
Clickable support boxes.
This reverts commit 0a1c421615aebefd26accf668c4ec640be917344.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -622,6 +622,17 @@ function create_building(region, className, xoff, yoff) { return e } +function create_support_buttons(region) { + let [ x0, y0 ] = LAYOUT_SUPPORT[region] + for (let i = 0; i <= 4; ++i) { + let x = Math.floor(-1 + x0 + i * 51.6666) + let y = (-1 + y0) + let e = create_thing({ className: "support", my_action: "support", my_id: (region << 3) + i }) + e.style.top = y + "px" + e.style.left = x + "px" + } +} + function is_action(action, arg) { if (arg === undefined) return !!(view.actions && view.actions[action] === 1) @@ -691,6 +702,8 @@ function on_init() { register_action(ui.capital[region], "capital", region) register_action(ui.regions[region], "region", region) + create_support_buttons(region) + ui.neutral_governors[region] = create_thing({ className: "neutral governor hide" }) } for (let region = 12; region < 21; ++region) { @@ -1103,7 +1116,6 @@ function on_update() { action_button("roll", "Roll") action_button("place_militia", "Place Militia") - action_button("support", "Increase Support Level") action_button("hold_games", "Hold Games") action_button("build_improvement", "Build an Improvement") |