summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-21 01:13:46 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commit2d5f74c94b1ac69598c0b00a2bfb3601a5703c61 (patch)
tree4602875933cae6a116291e3d0500549e50814d0f /play.js
parentd68a8f5426e335fce66c8b366646657115bbe65a (diff)
downloadtime-of-crisis-2d5f74c94b1ac69598c0b00a2bfb3601a5703c61.tar.gz
Streamline UI action flow.
Diffstat (limited to 'play.js')
-rw-r--r--play.js31
1 files changed, 15 insertions, 16 deletions
diff --git a/play.js b/play.js
index 33917d9..64d9aef 100644
--- a/play.js
+++ b/play.js
@@ -276,16 +276,16 @@ const LAYOUT_NOMADS = [
]
const LAYOUT_ITALIA = [
- [ -3, -2 ],
- [ -2, -2 ],
+ //[ 0, -2 ],
[ -1, -2 ],
- [ 0, -2 ],
+ [ -2, -2 ],
+ [ -3, -2 ],
[ -2, -1 ],
[ -1, -1 ],
[ 0, -1 ],
- [ -1, 0 ],
[ 1, 0 ],
[ 2, 0 ],
+ [ -1, 0 ],
[ 0, 3 ],
]
@@ -627,7 +627,7 @@ function create_support_buttons(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 })
+ let e = create_thing({ className: "support s" + i, my_action: "support", my_id: (region << 3) + i })
e.style.top = y + "px"
e.style.left = x + "px"
}
@@ -1043,7 +1043,7 @@ function on_update() {
e.classList.toggle("unavailable", region === UNAVAILABLE)
e.classList.toggle("selected", view.selected_general === pi * 6 + ai)
}
- layout_available(avail_stack, 63, pi * 625 + 0, 30)
+ layout_available(avail_stack, avail_stack.length > 5 ? 48 : 63, pi * 625 + 0, 30)
}
for (let pi = 0; pi < player_count; ++pi) {
@@ -1063,9 +1063,12 @@ function on_update() {
e.classList.toggle("unavailable", region === UNAVAILABLE)
e.classList.toggle("selected", view.selected_governor === pi * 6 + ai)
}
- layout_available(avail_stack, 58, pi * 625 + 325, 27)
+ layout_available(avail_stack, avail_stack.length > 5 ? 43 : 58, pi * 625 + 325, 27)
}
+ ui.body.classList.toggle("sel_governor", typeof view.selected_governor === "number")
+ ui.body.classList.toggle("sel_general", typeof view.selected_general === "number")
+
ui.dice[0].className = "dice black d" + view.dice[0]
ui.dice[1].className = "dice white d" + view.dice[1]
ui.dice[2].className = "dice black d" + view.dice[2]
@@ -1112,27 +1115,23 @@ function on_update() {
action_button("enter", "Enter Capital")
action_button("leave", "Leave Capital")
- action_button("spend", "Spend")
+ action_button("spend_military", "Spend Military")
+ action_button("spend_senate", "Spend Senate")
action_button("roll", "Roll")
- action_button("place_militia", "Place Militia")
action_button("hold_games", "Hold Games")
- action_button("build_improvement", "Build an Improvement")
+ action_button("place_militia", "Place Militia")
action_button("disperse_mob", "Disperse Mob")
action_button("train_legions", "Train Legions")
action_button("add_legion_to_army", "Add Legion to Army")
- action_button("move_army", "Move Army")
- action_button("initiate_battle", "Initiate Battle")
action_button("amphitheater", "Amphitheater")
action_button("basilica", "Basilica")
action_button("limes", "Limes")
- action_button("recall", "Recall")
- action_button("recruit", "Recruit")
- action_button("place_governor", "Place Governor")
- action_button("create_army", "Create Army")
+ action_button("recruit_general", "Recruit General")
+ action_button("recruit_governor", "Recruit Governor")
action_button("end_actions", "End Actions")