From: Christian Heller Date: Sun, 22 Nov 2020 03:23:16 +0000 (+0100) Subject: Hide map movement keys unavailable in current map geometry. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/processes?a=commitdiff_plain;h=bdc9cfa20f92bb41749790ac4943ab2a11e39d9a;p=plomrogue2 Hide map movement keys unavailable in current map geometry. --- diff --git a/rogue_chat_nocanvas_monochrome.html b/rogue_chat_nocanvas_monochrome.html index b1dd992..4ea33d6 100644 --- a/rogue_chat_nocanvas_monochrome.html +++ b/rogue_chat_nocanvas_monochrome.html @@ -549,13 +549,26 @@ let tui = { for (let key_selector of key_selectors) { this.keys[key_selector.id.slice(4)] = key_selector.value; } - this.movement_keys = { - [this.keys.square_move_up]: 'UP', - [this.keys.square_move_left]: 'LEFT', - [this.keys.square_move_down]: 'DOWN', - [this.keys.square_move_right]: 'RIGHT' - }; - if (game.map_geometry == 'Hex') { + if (game.map_geometry == 'Square') { + this.movement_keys = { + [this.keys.square_move_up]: 'UP', + [this.keys.square_move_left]: 'LEFT', + [this.keys.square_move_down]: 'DOWN', + [this.keys.square_move_right]: 'RIGHT' + }; + document.getElementById("move_upright").hidden = true; + document.getElementById("move_upleft").hidden = true; + document.getElementById("move_downright").hidden = true; + document.getElementById("move_downleft").hidden = true; + document.getElementById("move_up").hidden = false; + document.getElementById("move_down").hidden = false; + } else if (game.map_geometry == 'Hex') { + document.getElementById("move_upright").hidden = false; + document.getElementById("move_upleft").hidden = false; + document.getElementById("move_downright").hidden = false; + document.getElementById("move_downleft").hidden = false; + document.getElementById("move_up").hidden = true; + document.getElementById("move_down").hidden = true; this.movement_keys = { [this.keys.hex_move_upleft]: 'UPLEFT', [this.keys.hex_move_upright]: 'UPRIGHT',