From eddf155524f44b5437a7028cbf33695a0d449f2c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 5 Jun 2024 23:12:25 +0200 Subject: shorten combat prompts to fit mobile --- play.css | 1 + play.js | 2 ++ rules.js | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/play.css b/play.css index 69017bc..7f55c65 100644 --- a/play.css +++ b/play.css @@ -11,6 +11,7 @@ #prompt { font-family: "Suit Symbols", var(--font-widget); font-variant-numeric: tabular-nums; + white-space: wrap; } #log { diff --git a/play.js b/play.js index 31515b2..eecd8fe 100644 --- a/play.js +++ b/play.js @@ -1453,6 +1453,8 @@ function on_log(text) { text = text.replace(//g, ">") + text = text.replaceAll(" 1 troops", " 1 troop") + text = colorize(text) text = text.replace(/S(\d+)/g, sub_space) text = text.replace(/P(\d+)/g, sub_piece) diff --git a/rules.js b/rules.js index 023d5ea..0012843 100644 --- a/rules.js +++ b/rules.js @@ -2300,9 +2300,8 @@ function format_combat(value) { let a = format_combat_stack(game.attacker) let d = format_combat_stack(game.defender) let s = signed_number(value) - let city = data.cities.name[game.attacker] let p = POWER_NAME[game.power] - return `${p} at ${s} in combat (${a} vs ${d} at ${city}).` + return `${a} vs ${d}. ${p} is at ${s}.` } function inactive_attack() { -- cgit v1.2.3