X-Git-Url: https://plomlompom.com/repos/new_day?a=blobdiff_plain;f=rogue_chat.html;h=d865516eaad3d93054f99e7611cda281f1a85964;hb=49741de058b5320f181c69894da6dbdac2a6fa8d;hp=ce6cf4cae6bcb835be05e2895c72d826a65f96ed;hpb=d4cf3dcecd55a94cae437a7d258f615976857a71;p=plomrogue2 diff --git a/rogue_chat.html b/rogue_chat.html index ce6cf4c..d865516 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -814,7 +814,8 @@ let tui = { } else if (this.map_mode == 'terrain') { for (const p in game.portals) { let coordinate = p.split(',') - map_lines_split[coordinate[0]][coordinate[1]] = 'P '; + let original = map_lines_split[coordinate[0]][coordinate[1]]; + map_lines_split[coordinate[0]][coordinate[1]] = original[0] + 'P'; } let used_positions = []; for (const thing_id in game.things) { @@ -938,10 +939,10 @@ let tui = { content += "[" + movement_keys_desc + "] – move player\n"; } if (game.tasks.includes('PICK_UP')) { - content += "[" + this.keys.take_thing + "] – take thing under player\n"; + content += "[" + this.keys.take_thing + "] – pick up thing\n"; } if (game.tasks.includes('DROP')) { - content += "[" + this.keys.drop_thing + "] – drop carried thing\n"; + content += "[" + this.keys.drop_thing + "] – drop picked up thing\n"; } content += "[" + tui.keys.teleport + "] – teleport to other space\n"; content += '\n'; @@ -1346,49 +1347,12 @@ document.getElementById("help").onclick = function() { tui.show_help = true; tui.full_refresh(); }; -document.getElementById("switch_to_play").onclick = function() { - tui.switch_mode('play'); - tui.full_refresh(); -}; -document.getElementById("switch_to_study").onclick = function() { - tui.switch_mode('study'); - tui.full_refresh(); -}; -document.getElementById("switch_to_chat").onclick = function() { - tui.switch_mode('chat'); - tui.full_refresh(); -}; -document.getElementById("switch_to_password").onclick = function() { - tui.switch_mode('password'); - tui.full_refresh(); -}; -document.getElementById("switch_to_edit").onclick = function() { - tui.switch_mode('edit'); - tui.full_refresh(); -}; -document.getElementById("switch_to_write").onclick = function() { - tui.switch_mode('write'); - tui.full_refresh(); -}; -document.getElementById("switch_to_annotate").onclick = function() { - tui.switch_mode('annotate'); - tui.full_refresh(); -}; -document.getElementById("switch_to_portal").onclick = function() { - tui.switch_mode('portal'); - tui.full_refresh(); -}; -document.getElementById("switch_to_admin_enter").onclick = function() { - tui.switch_mode('admin'); - tui.full_refresh(); -}; -document.getElementById("switch_to_control_pw_type").onclick = function() { - tui.switch_mode('control_pw_type'); - tui.full_refresh(); -}; -document.getElementById("switch_to_control_tile_type").onclick = function() { - tui.switch_mode('control_tile_type'); - tui.full_refresh(); +for (const switchEl of document.querySelectorAll('[id^="switch_to_"]')) { + const mode = switchEl.id.slice("switch_to_".length); + switchEl.onclick = function() { + tui.switch_mode(mode); + tui.full_refresh(); + } }; document.getElementById("toggle_map_mode").onclick = function() { if (tui.map_mode == 'terrain') {