diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-21 12:55:27 +0200 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-21 12:55:27 +0200 |
commit | aea2e24bc734bebde542f574cdac4d098c38573c (patch) | |
tree | 4cc3aecc4433b7ce162bca65c620964dee62e67d /play.js | |
parent | 9710d61e5fada502334866e5cb648abab24a1b6a (diff) | |
download | algeria-aea2e24bc734bebde542f574cdac4d098c38573c.tar.gz |
dice WIP
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -603,6 +603,27 @@ function on_update() { // eslint-disable-line no-unused-vars action_button("reset", "Reset") } +const ICONS = { + B0: '<span class="black d0"></span>', + B1: '<span class="black d1"></span>', + B2: '<span class="black d2"></span>', + B3: '<span class="black d3"></span>', + B4: '<span class="black d4"></span>', + B5: '<span class="black d5"></span>', + B6: '<span class="black d6"></span>', + W0: '<span class="white d0"></span>', + W1: '<span class="white d1"></span>', + W2: '<span class="white d2"></span>', + W3: '<span class="white d3"></span>', + W4: '<span class="white d4"></span>', + W5: '<span class="white d5"></span>', + W6: '<span class="white d6"></span>', +} + +function sub_icon(match) { + return ICONS[match] +} + function on_focus_area_tip(x) { // eslint-disable-line no-unused-vars ui.areas[x].classList.add("tip") } @@ -653,6 +674,8 @@ function on_log(text) { // eslint-disable-line no-unused-vars text = text.replace(/U(\d+)/g, sub_unit_name) text = text.replace(/A(\d+)/g, sub_area_name) + text = text.replace(/\b[BW]\d\b/g, sub_icon) + if (text.match(/^\.h1/)) { text = text.substring(4) p.className = 'h1' |