modules/settings.js
// Creates the Options object with all compendia in alphabetic order
Creates the Options object with all compendia in alphabetic order
Creates the Options object with all compendia in alphabetic order
function allCompendia() {
  let list = {};
  let compendia = game.packs.map(e => e);
  compendia = compendia.sort(function(a, b) {
    const nameA = a.title.toLowerCase();
    const nameB = b.title.toLowerCase();
    if (nameA < nameB) {
      return -1;
    }
    if (nameA > nameB) {
      return 1;
    }
    return 0;
  });
  for (let c = 0; c < compendia.length; c++) {
    const comp = compendia[c];
    list[comp.collection] = comp.title;
  };
  return list
}
function allCompendia ( ) { let list = { } ; let compendia = game . packs . map ( e => e ) ; compendia = compendia . sort ( function ( a , b ) { const nameA = a . title . toLowerCase ( ) ; const nameB = b . title . toLowerCase ( ) ; if ( nameA < nameB ) { return - 1 ; } if ( nameA > nameB ) { return 1 ; } return 0 ; } ) ; for ( let c = 0 ; c < compendia . length ; c ++ ) { const comp = compendia [ c ] ; list [ comp . collection ] = comp . title ; } ; return list }
Creates the Options object with all compendia in alphabetic order
Creates the Options object with all compendia in alphabetic order