modules/dice/pool.js
/**
   * Create a preview of the dice pool using images
   * @param container {HTMLElement} where to place the preview. A container will be generated if this is undefined
   * @returns {HTMLElement}
   */
Create a preview of the dice pool using images
@param container {HTMLElement} where to place the preview. A container will be generated if this is undefined
@returns {HTMLElement}
Create a preview of the dice pool using images @param container { HTMLElement } where to place the preview . A container will be generated if this is undefined @returns { HTMLElement }
renderPreview(container) {
    if (container === undefined) {
      container = document.createElement("div");
      container.classList.add("dice-pool");
    }
    const totalDice = +this.proficiency + +this.ability + +this.challenge + +this.difficulty + +this.boost + +this.setback + +this.force;
    let height = 36;
    let width = 36;
    if (totalDice > 8) {
      height = 24;
      width = 24;
    }
    if (totalDice > 24) {
      height = 12;
      width = 12;
    }
    this._addIcons(container, CONFIG.FFG.PROFICIENCY_ICON, this.proficiency, height, width);
    this._addIcons(container, CONFIG.FFG.ABILITY_ICON, this.ability, height, width);
    this._addIcons(container, CONFIG.FFG.CHALLENGE_ICON, this.challenge, height, width);
    this._addIcons(container, CONFIG.FFG.DIFFICULTY_ICON, this.difficulty, height, width);
    this._addIcons(container, CONFIG.FFG.BOOST_ICON, this.boost, height, width);
    this._addIcons(container, CONFIG.FFG.SETBACK_ICON, this.setback, height, width);
    this._addIcons(container, CONFIG.FFG.REMOVESETBACK_ICON, this.remsetback, height, width);
    this._addIcons(container, CONFIG.FFG.FORCE_ICON, this.force, height, width);
    this._addSourceToolTip(container);
    return container;
  }
renderPreview ( container ) { if ( container === undefined ) { container = document . createElement ( "div" ) ; container . classList . add ( "dice-pool" ) ; } const totalDice = + this . proficiency + + this . ability + + this . challenge + + this . difficulty + + this . boost + + this . setback + + this . force ; let height = 36 ; let width = 36 ; if ( totalDice > 8 ) { height = 24 ; width = 24 ; } if ( totalDice > 24 ) { height = 12 ; width = 12 ; } this . _addIcons ( container , CONFIG . FFG . PROFICIENCY_ICON , this . proficiency , height , width ) ; this . _addIcons ( container , CONFIG . FFG . ABILITY_ICON , this . ability , height , width ) ; this . _addIcons ( container , CONFIG . FFG . CHALLENGE_ICON , this . challenge , height , width ) ; this . _addIcons ( container , CONFIG . FFG . DIFFICULTY_ICON , this . difficulty , height , width ) ; this . _addIcons ( container , CONFIG . FFG . BOOST_ICON , this . boost , height , width ) ; this . _addIcons ( container , CONFIG . FFG . SETBACK_ICON , this . setback , height , width ) ; this . _addIcons ( container , CONFIG . FFG . REMOVESETBACK_ICON , this . remsetback , height , width ) ; this . _addIcons ( container , CONFIG . FFG . FORCE_ICON , this . force , height , width ) ; this . _addSourceToolTip ( container ) ; return container ; }
Create a preview of the dice pool using images
 @param container {HTMLElement} where to place the preview.
Create a preview of the dice pool using images @param container { HTMLElement } where to place the preview .