summaryrefslogtreecommitdiff
path: root/ui.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-23 14:37:40 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:38 +0100
commitba49b45691c35d4b4a1a484f0b8c26e2dcbad206 (patch)
tree6ddf2893ee205e3d4592b2d0ff5c91c10448be88 /ui.js
parentb90969b17567a17d9f2ac44dac7b156daf3d887a (diff)
downloadcrusader-rex-ba49b45691c35d4b4a1a484f0b8c26e2dcbad206.tar.gz
crusader: Add Jihad badges.
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui.js b/ui.js
index dcf5648..f590fde 100644
--- a/ui.js
+++ b/ui.js
@@ -235,7 +235,6 @@ function on_button_end_move_phase(evt) { send_action('end_move_phase'); }
function on_button_end_regroup(evt) { send_action('end_regroup'); }
function on_button_end_retreat(evt) { send_action('end_retreat'); }
function on_button_eliminate(evt) { send_action('eliminate'); }
-function on_button_jihad(evt) { send_action('jihad'); }
function build_battle_button(menu, b, c, click, enter, img_src) {
let img = new Image();
@@ -591,7 +590,8 @@ function update_map() {
element.classList = info.owner + known + " block" + image + steps + moved;
} else {
let besieging = (game.sieges[town] == info.owner) ? " besieging" : "";
- element.classList = info.owner + " block" + moved + besieging;
+ let jihad = (game.jihad == town) ? " jihad" : "";
+ element.classList = info.owner + " block" + moved + besieging + jihad;
}
if (info.owner == FRANKS)
layout[town].north.push(element);
@@ -750,6 +750,10 @@ function update_battle() {
ui.battle_block[block].classList.add("moved");
else
ui.battle_block[block].classList.remove("moved");
+ if (!show && (game.battle.jihad == block_owner(block)))
+ ui.battle_block[block].classList.add("jihad");
+ else
+ ui.battle_block[block].classList.remove("jihad");
}
for (let b in BLOCKS) {
@@ -794,7 +798,6 @@ function on_update() {
show_action_button("#end_move_phase_button", "end_move_phase");
show_action_button("#end_regroup_button", "end_regroup");
show_action_button("#end_retreat_button", "end_retreat");
- show_action_button("#jihad_button", "jihad");
show_action_button("#eliminate_button", "eliminate");
document.getElementById("frank_vp").textContent = game.f_vp;