summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.html11
-rw-r--r--rules.js3
-rw-r--r--ui.js14
3 files changed, 25 insertions, 3 deletions
diff --git a/play.html b/play.html
index 9f16a10..aaae0d5 100644
--- a/play.html
+++ b/play.html
@@ -28,8 +28,7 @@
#log .tip {
cursor: help;
- text-decoration: underline;
- color: blue;
+ text-decoration: dotted underline;
}
#log .st {
@@ -40,6 +39,14 @@
padding: 3px;
}
+#log .hr {
+ border-top: 1px solid darkgray;
+ padding-top: 9px;
+}
+
+#log .G { color: #c00; }
+#log .P { color: #00e; }
+
#hand.greek {
background-color: rosybrown;
border-radius: 10px;
diff --git a/rules.js b/rules.js
index ee36620..a5b0bd1 100644
--- a/rules.js
+++ b/rules.js
@@ -578,7 +578,8 @@ states.assassination_of_xerxes = {
// PREPARATION PHASE
function start_campaign() {
- log("");
+ if (game.campaign > 1)
+ log("");
log("Start Campaign " + game.campaign);
goto_persian_preparation_draw();
}
diff --git a/ui.js b/ui.js
index ec0ee88..d088a26 100644
--- a/ui.js
+++ b/ui.js
@@ -59,6 +59,7 @@ let ui = {
selected_fleets: null,
};
+let was_blank = true;
create_log_entry = function (text) {
let p = document.createElement("div");
text = text.replace(/&/g, "&");
@@ -66,10 +67,23 @@ create_log_entry = function (text) {
text = text.replace(/>/g, ">");
text = text.replace(/card (\d+)/g,
'<span class="tip" onmouseenter="on_focus_card_tip($1)" onmouseleave="on_blur_card_tip()">card $1</span>');
+ if (text.match(/Greece plays.*:\n/))
+ text = text.replace(/:\n(.*)/, ':\n<span class="G">$1</span>');
+ if (text.match(/Persia plays.*:\n/))
+ text = text.replace(/:\n(.*)/, ':\n<span class="P">$1</span>');
if (text.match(/^Start Campaign /)) {
p.className = 'st';
text = text.substring(6);
}
+ if (text.match(/Supply Phase$/))
+ p.className = 'hr';
+ if (text.match(/(Greece|Persia|Nobody) scores/))
+ p.className = 'hr';
+ if (text.match(/Greek Preparation Phase$/))
+ p.className = 'hr';
+ if (was_blank && text.match(/^(Greece|Persia) (plays|passes)/))
+ p.className = 'hr';
+ was_blank = (text.length === 0)
p.innerHTML = text;
return p;
}