From: Christian Heller Date: Sun, 22 Nov 2020 03:16:25 +0000 (+0100) Subject: Minor refactoring. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/feed.xml?a=commitdiff_plain;h=859fae61e2b7c3ad39a8d158bb88d6a43d59368d;p=plomrogue2 Minor refactoring. --- diff --git a/rogue_chat_nocanvas_monochrome.html b/rogue_chat_nocanvas_monochrome.html index 381b0f2..b1dd992 100644 --- a/rogue_chat_nocanvas_monochrome.html +++ b/rogue_chat_nocanvas_monochrome.html @@ -167,8 +167,7 @@ let key_selectors = document.querySelectorAll('[id^="key_"]'); for (const key_switch_selector of document.querySelectorAll('[id^="key_switch_to_"]')) { const action = key_switch_selector.id.slice("key_switch_to_".length); - const msg = "[" + mode_helps[action].short + "]: "; - key_switch_selector.parentNode.prepend(msg); + key_switch_selector.parentNode.prepend(mode_helps[action].short + ': '); } function restore_selector_value(selector) { @@ -582,29 +581,10 @@ let tui = { } this.empty_input(); this.restore_input_values(); - document.getElementById("take_thing").disabled = true; - document.getElementById("drop_thing").disabled = true; - document.getElementById("flatten").disabled = true; - document.getElementById("teleport").disabled = true; - document.getElementById("toggle_map_mode").disabled = true; - document.getElementById("switch_to_chat").disabled = true; - document.getElementById("switch_to_play").disabled = true; - document.getElementById("switch_to_study").disabled = true; - document.getElementById("switch_to_edit").disabled = true; - document.getElementById("switch_to_portal").disabled = true; - document.getElementById("switch_to_annotate").disabled = true; - document.getElementById("switch_to_password").disabled = true; - document.getElementById("switch_to_admin").disabled = true; - document.getElementById("switch_to_control_pw_type").disabled = true; - document.getElementById("switch_to_control_tile_type").disabled = true; - document.getElementById("move_left").disabled = true; - document.getElementById("move_upleft").disabled = true; - document.getElementById("move_up").disabled = true; - document.getElementById("move_upright").disabled = true; - document.getElementById("move_downleft").disabled = true; - document.getElementById("move_down").disabled = true; - document.getElementById("move_downright").disabled = true; - document.getElementById("move_right").disabled = true; + for (let el of document.getElementsByTagName("button")) { + el.disabled = true; + } + document.getElementById("help").disabled = false; if (this.mode.name == 'play' || this.mode.name == 'study' || this.mode.name == 'control_tile_draw') { document.getElementById("move_left").disabled = false; document.getElementById("move_right").disabled = false;