X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=rogue_chat.html;h=d810c2e580aabb3f4cc1443d8ff040b4f657374a;hb=769c9a9af7f759f89593c5136a1359ce35366fbc;hp=3536d15a0013f12f4c13618fcc6a598cf956dd9d;hpb=424625e4fd534d48db9de6fea18d401ba3bbf698;p=plomrogue2 diff --git a/rogue_chat.html b/rogue_chat.html index 3536d15..d810c2e 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -484,7 +484,7 @@ let server = { if (tokens[0] === 'TURN') { game.turn_complete = false; game.turn = parseInt(tokens[1]); - } else if (tokens[0] === 'PSEUDO_FOV_WIPE') { + } else if (tokens[0] === 'OTHER_WIPE') { game.portals_new = {}; explorer.annotations_new = {}; game.things_new = []; @@ -1045,7 +1045,7 @@ let tui = { }, pick_selectable: function(task_name) { const i = parseInt(this.inputEl.value); - if (isNaN(i) || i < 0 || i >= this.selectables.length) { + if (isNaN(this.inputEl.value) || i < 0 || i >= this.selectables.length) { tui.log_msg('? invalid index, aborted'); } else { server.send(['TASK:' + task_name, tui.selectables[i]]); @@ -1784,7 +1784,7 @@ document.getElementById("consume").onclick = function() { server.send(['TASK:INTOXICATE']); }; document.getElementById("install").onclick = function() { - server.send(['TASK:INSTALL']); + server.send(['TASK:INSTALL', tui.password]); }; document.getElementById("wear").onclick = function() { server.send(['TASK:WEAR']); @@ -1801,15 +1801,17 @@ for (const move_button of document.querySelectorAll('[id*="_move_"]')) { }; let direction = move_button.id.split('_')[2].toUpperCase(); let move_repeat; + function move() { + if (tui.mode.available_actions.includes("move")) { + server.send(['TASK:MOVE', direction]); + } else if (tui.mode.available_actions.includes("move_explorer")) { + explorer.move(direction); + tui.full_refresh(); + }; + } move_button.onmousedown = function() { - move_repeat = window.setInterval(function() { - if (tui.mode.available_actions.includes("move")) { - server.send(['TASK:MOVE', direction]); - } else if (tui.mode.available_actions.includes("move_explorer")) { - explorer.move(direction); - tui.full_refresh(); - }; - }, 100); + move(); + move_repeat = window.setInterval(move, 100); }; move_button.onmouseup = function() { window.clearInterval(move_repeat);