From c41b9834c835555c8a595ae88af630da2e357537 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 10 Dec 2024 20:27:19 +0000 Subject: Add icons --- play.css | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'play.css') diff --git a/play.css b/play.css index 12dc196..0ad71f5 100644 --- a/play.css +++ b/play.css @@ -72,6 +72,23 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log .card_name:hover { text-decoration: underline; } #log .space_tip:hover { cursor: pointer; text-decoration: underline; } +#log .icon { + display: inline-block; + vertical-align: -2px; + width: 12px; + height: 12px; + box-shadow: none; + border: none; + background-size: contain; + background-position: center; + background-repeat: no-repeat; +} + +#log .com_nc { background-image: url(images/SVd_blank.gif);} +#log .com_c {background-image: url(images/SV_blank.gif);} +#log .dem_nc { background-image: url(images/USd_blank.gif);} +#log .dem_c {background-image: url(images/favicon_dem.svg);} + /* MAP */ #mapwrap { -- cgit v1.2.3 From 97656ab8c2b6a97f2616afa468bc002f1b85af40 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 10 Dec 2024 21:58:16 +0000 Subject: TST results in boxes --- play.css | 14 ++++++++++++++ play.js | 12 ++++++++++++ rules.js | 10 +++++----- 3 files changed, 31 insertions(+), 5 deletions(-) (limited to 'play.css') diff --git a/play.css b/play.css index 0ad71f5..59f65f2 100644 --- a/play.css +++ b/play.css @@ -89,6 +89,20 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log .dem_nc { background-image: url(images/USd_blank.gif);} #log .dem_c {background-image: url(images/favicon_dem.svg);} +#log .number { + display: inline-block; + margin: 0; + text-indent: 0; + text-align: center; + width: 12px; + height: 12px; + line-height: 12px; + border: 1px solid #444; +} + +#log .number.d_tst { background-color: hsl(206, 85%, 80%); } +#log .number.c_tst { background-color: hsl(355, 70%, 80%); } + /* MAP */ #mapwrap { diff --git a/play.js b/play.js index a68ee3c..b74fb1f 100644 --- a/play.js +++ b/play.js @@ -874,6 +874,16 @@ const ICONS = { '£CU': '', '£DC': '', '£DU': '', + '.dT5': '5', + '.dT6': '6', + '.dT7': '7', + '.dT8': '8', + '.dT9': '9', + '.dT10': '10', + '.cT5': '5', + '.cT6': '6', + '.cT7': '7', + '.cT8': '8' } const die = { @@ -910,6 +920,8 @@ function on_log(text, ix) { text = text.replace(/%(\d+)/g, sub_space_name) text = text.replace(/D[1-6]/g, sub_die) text = text.replace(/£[CD][CU]\b/g, sub_icon) + text = text.replace(/\.cT(\d+)/g, sub_icon) + text = text.replace(/\.dT(\d+)/g, sub_icon) text = text.replace(/.to/g, sub_arrow) if (text.match(/^\.h1/)) { diff --git a/rules.js b/rules.js index 3235a31..7768459 100644 --- a/rules.js +++ b/rules.js @@ -2838,7 +2838,7 @@ function do_tst_attempt() { if (game.active === DEM) { game.dem_tst_attempted_this_turn = 1 if (roll >= dem_tst_req[game.dem_tst_position]) { - log(`Success: ${roll} >= ${dem_tst_req[game.dem_tst_position]}`) + log(`Success: ${roll} >= .dT${dem_tst_req[game.dem_tst_position]}`) game.dem_tst_position++ game.dem_tst_attempted = 0 @@ -2866,14 +2866,14 @@ function do_tst_attempt() { } game.state = 'tiananmen_square_attempt_success' } else { - log(`Fail: ${roll} < ${dem_tst_req[game.dem_tst_position]}`) + log(`Fail: ${roll} < .dT${dem_tst_req[game.dem_tst_position]}`) game.dem_tst_attempted = 1 game.state = 'tiananmen_square_attempt_fail' } } else { game.com_tst_attempted_this_turn = 1 if (roll >= com_tst_req[game.com_tst_position]) { - log(`Success: ${roll} >= ${com_tst_req[game.com_tst_position]}`) + log(`Success: ${roll} >= .cT${com_tst_req[game.com_tst_position]}`) game.com_tst_position++ game.com_tst_attempted = 0 @@ -2905,7 +2905,7 @@ function do_tst_attempt() { } game.state = 'tiananmen_square_attempt_success' } else { - log(`Fail: ${roll} < ${com_tst_req[game.com_tst_position]}`) + log(`Fail: ${roll} < .cT${com_tst_req[game.com_tst_position]}`) game.com_tst_attempted = 1 game.state = 'tiananmen_square_attempt_fail' } @@ -5013,7 +5013,7 @@ function vm_do_remove_x_infl(space) { } } } - let end = check_control(space) + let end_control = check_control(space) logi(`${game.vm_available_ops} from %${space}${get_icons(starting_control, end_control)}`) check_tyrant() game.vm_available_ops = 0 -- cgit v1.2.3