summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-21 12:55:27 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-21 12:55:27 +0200
commitaea2e24bc734bebde542f574cdac4d098c38573c (patch)
tree4cc3aecc4433b7ce162bca65c620964dee62e67d /play.js
parent9710d61e5fada502334866e5cb648abab24a1b6a (diff)
downloadalgeria-aea2e24bc734bebde542f574cdac4d098c38573c.tar.gz
dice WIP
Diffstat (limited to 'play.js')
-rw-r--r--play.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/play.js b/play.js
index d05b184..4ecf7fd 100644
--- a/play.js
+++ b/play.js
@@ -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'