home · contact · privacy
In web client, fix study mode explorer positioning bug.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 19 Nov 2020 21:48:43 +0000 (22:48 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 19 Nov 2020 21:48:43 +0000 (22:48 +0100)
rogue_chat_nocanvas_monochrome.html

index 021ae85f9c6e39dd0cb46246e524a83a6aca4857..644f567008e48bc85e00db3c2e90cc507934a1c9 100644 (file)
@@ -412,13 +412,12 @@ let tui = {
   },
   switch_mode: function(mode_name) {
     this.inputEl.focus();
-    //this.show_help = false;
     this.map_mode = 'terrain';
+    this.mode = this['mode_' + mode_name];
     if (this.mode.shows_info && game.player_id in game.things) {
       explorer.position = game.things[game.player_id].position;
       explorer.query_info();
     }
-    this.mode = this['mode_' + mode_name];
     this.empty_input();
     this.restore_input_values();
     document.getElementById("take_thing").disabled = true;
@@ -456,13 +455,13 @@ let tui = {
             document.getElementById("move_down").disabled = false;
         }
     }
-    if (!this.mode.is_intro && this.mode != this.mode_play) {
+    if (!this.mode.is_intro && this.mode.name != 'play') {
         document.getElementById("switch_to_play").disabled = false;
     }
-    if (!this.mode.is_intro && this.mode != this.mode_study) {
+    if (!this.mode.is_intro && this.mode.name != 'study') {
         document.getElementById("switch_to_study").disabled = false;
     }
-    if (!this.mode.is_intro && this.mode != this.mode_chat) {
+    if (!this.mode.is_intro && this.mode.name != 'chat') {
         document.getElementById("switch_to_chat").disabled = false;
     }
     if (this.mode.name == 'login') {