X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;ds=sidebyside;f=rogue_chat.html;h=dd8de5b783bbf835fa73d5a1b92b7c80f5901629;hb=fef34d66adc79d129d8f8a1f3dd83501e4564988;hp=5003854e7115ade22a4380f4a63dc788d04c8150;hpb=9f80260dd126a305f4b71541f00dcc88264ce716;p=plomrogue2 diff --git a/rogue_chat.html b/rogue_chat.html index 5003854..dd8de5b 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 = []; @@ -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);