summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-19 21:50:38 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:08:56 +0100
commitfd8e3e00747d24fbd583f92f5c7a3504427898d6 (patch)
tree1e501dcefeca235e7948f7c9b822f6f7fd34cf14
parent646086a82fd8058c7a237886ab0cb0108072a6d3 (diff)
downloadjulius-caesar-fd8e3e00747d24fbd583f92f5c7a3504427898d6.tar.gz
Small fixes to block games.
-rw-r--r--play.html6
-rw-r--r--ui.js11
2 files changed, 11 insertions, 6 deletions
diff --git a/play.html b/play.html
index 03a621e..dd5b468 100644
--- a/play.html
+++ b/play.html
@@ -121,12 +121,12 @@
.space.city {
width: 60px;
height: 60px;
- border-radius: 60px;
+ border-radius: 50%;
}
.space.sea {
width: 70px;
height: 70px;
- border-radius: 70px;
+ border-radius: 50%;
}
.space.highlight {
cursor: pointer;
@@ -148,7 +148,7 @@ body.shift .block.known:hover {
.map .block { position: absolute; z-index: 2; }
.map .block.highlight { z-index: 3; }
.map .block.selected { z-index: 4; }
-.map .block:hover { z-index: 5; }
+.map .block.known:hover { z-index: 5; }
.block.highlight { cursor: pointer; }
diff --git a/ui.js b/ui.js
index 6e192a1..4629578 100644
--- a/ui.js
+++ b/ui.js
@@ -181,7 +181,7 @@ function build_map() {
element.classList.add("block_"+block.label);
element.addEventListener("mouseenter", on_focus_block);
element.addEventListener("mouseleave", on_blur_block);
- element.addEventListener("click", select_block);
+ element.addEventListener("click", on_click_map_block);
document.getElementById("known_blocks").appendChild(element);
element.style.visibility = 'hidden';
element.block = b;
@@ -222,7 +222,7 @@ function build_map() {
element.classList.add("block_"+block.label);
element.addEventListener("mouseenter", on_focus_battle_block);
element.addEventListener("mouseleave", on_blur_battle_block);
- element.addEventListener("click", select_block);
+ element.addEventListener("click", on_click_battle_block);
element.block = b;
ui.battle_block[b] = element;
@@ -732,10 +732,15 @@ function select_space(evt) {
send_action('space', evt.target.space);
}
-function select_block(evt) {
+function on_click_battle_block(evt) {
send_action('block', evt.target.block);
}
+function on_click_map_block(evt) {
+ if (!game.battle)
+ send_action('block', evt.target.block);
+}
+
function select_secret_block(evt) {
let element = evt.target;
let owner = null;