Pre-release
AdventureJS Docs Downloads Bundler Devlog Score: 0 Moves: 0
// getRoomName.js

(function () {
  /* global AdventureJS A */

  var p = AdventureJS.Game.prototype;

  /**
   * Get room name to print to game display.
   * @method AdventureJS.Game#getRoomName
   * @memberOf AdventureJS.Game
   * @param {Object} params
   */
  p.getRoomName = function Game_printRoom(room) {
    // this.game.log(
    //   "",
    //   "log",
    //   1,
    //   `[getRoomName.js] get ${this.world._room} name`,
    //   "Game"
    // );

    // const room = this.world[this.world._room];
    let output = "";

    if (room.isDark() && this.game.settings.use_dark_room_name) {
      output =
        output +
        `<div class="ajs-p ajs-room-name ajs-dark-room">${room.darkname}</div>`;
    } else {
      output =
        output +
        `<div class="ajs-p ajs-room-name">${room.full_name || room.name}</div>`;
    }

    return output;
  };
})();