<button id="switch_to_password">change tile editing password</button>
<button id="switch_to_annotate">annotate tile</button>
<button id="switch_to_portal">edit portal link</button>
-<button id="toggle_map_mode">toggle terrain/control view</button>
+<button id="toggle_map_mode">toggle terrain/annotations/control view</button>
</div>
<h3>edit keybindings</h3> (see <a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values">here</a> for non-obvious available values):<br />
<ul>
<li>enter tile password (from play mode): <input id="key_switch_to_password" type="text" value="P" />
<li>annotate tile (from play mode): <input id="key_switch_to_annotate" type="text" value="M" />
<li>annotate portal (from play mode): <input id="key_switch_to_portal" type="text" value="T" />
-<li>toggle terrain/control view (from study mode): <input id="key_toggle_map_mode" type="text" value="M" />
+<li>toggle terrain/annotations/control view (from study mode): <input id="key_toggle_map_mode" type="text" value="M" />
</ul>
</div>
<script>
let tokens = parser.tokenize(event.data);
if (tokens[0] === 'TURN') {
game.turn_complete = false;
+ explorer.empty_info_db();
game.things = {};
game.portals = {};
game.turn = parseInt(tokens[1]);
game.map_control = tokens[1]
} else if (tokens[0] === 'GAME_STATE_COMPLETE') {
game.turn_complete = true;
- explorer.empty_info_db();
if (tui.mode == mode_post_login_wait) {
tui.switch_mode(mode_play);
} else if (tui.mode == mode_study) {
} else if (tokens[0] === 'PORTAL') {
let position = parser.parse_yx(tokens[1]);
game.portals[position] = tokens[2];
+ } else if (tokens[0] === 'ANNOTATION_HINT') {
+ let position = parser.parse_yx(tokens[1]);
+ explorer.info_hints = explorer.info_hints.concat([position]);
} else if (tokens[0] === 'ANNOTATION') {
let position = parser.parse_yx(tokens[1]);
explorer.update_info_db(position, tokens[2]);
line.push(map_content[i] + ' ');
};
map_lines_split.push(line);
- if (this.map_mode == 'terrain') {
+ if (this.map_mode == 'annotations') {
+ for (const coordinate of explorer.info_hints) {
+ map_lines_split[coordinate[0]][coordinate[1]] = 'A ';
+ }
+ } else if (this.map_mode == 'terrain') {
for (const p in game.portals) {
let coordinate = p.split(',')
map_lines_split[coordinate[0]][coordinate[1]] = 'P ';
} else if (this.mode == mode_study) {
content += "Available actions:\n";
content += '[' + movement_keys_desc + '] – move question mark\n';
- content += '[' + this.keys.toggle_map_mode + '] – toggle view between terrain, and password protection areas\n';
+ content += '[' + this.keys.toggle_map_mode + '] – toggle view between terrain, annotations, and password protection areas\n';
content += '\nOther modes available from here:\n';
content += '[' + this.keys.switch_to_chat + '] – chat mode\n';
content += '[' + this.keys.switch_to_play + '] – play mode\n';
let explorer = {
position: [0,0],
info_db: {},
+ info_hints: [],
move: function(direction) {
let target = game.move(this.position, direction);
if (target) {
},
empty_info_db: function() {
this.info_db = {};
+ this.info_hints = [];
if (tui.mode == mode_study) {
tui.full_refresh();
}
explorer.move(tui.movement_keys[event.key]);
} else if (event.key == tui.keys.toggle_map_mode) {
if (tui.map_mode == 'terrain') {
+ tui.map_mode = 'annotations';
+ } else if (tui.map_mode == 'annotations') {
tui.map_mode = 'control';
} else {
tui.map_mode = 'terrain';
};
document.getElementById("toggle_map_mode").onclick = function() {
if (tui.map_mode == 'terrain') {
+ tui.map_mode = 'annotations';
+ } else if (tui.map_mode == 'annotations') {
tui.map_mode = 'control';
} else {
tui.map_mode = 'terrain';