Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// updateExitDocks.js

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

  var p = AdventureJS.Display.prototype;

  /**
   * Update exits in exit docks.
   * @method AdventureJS.Display#updateExitDocks
   * @param {Object} properties
   */
  p.updateExitDocks = function Display_updateExitDocks(properties) {
    if (this.exitdocks.length === 0) return;
    const room = this.game.world[this.game.world._room];
    let output = "";
    let exits = "";

    if (this.game.settings.print_exits) {
      if (room.is.dark) {
        exits = ""; // @TODO
      } else {
        exits = A.FX.handlePlaceholders.call(
          this.game,
          this.game.getRoomExits()
        );
      }
    }
    output = `<div class="ajs-exits-container ajs-output"><div class="ajs-p">${exits}</div></div>`;

    this.exitdocks.forEach(function (dock) {
      dock.innerHTML = output;
    });
  };
})();