modules/dice.js
// Creates dialog box to pick alternative Ability to roll a Focus - option within Focus' context menu
Creates dialog box to pick alternative Ability to roll a Focus - option within Focus' context menu
Creates dialog box to pick alternative Ability to roll a Focus - option within Focus ' context menu
function dialogBoxAbilityFocus(focus, actor) {
    let focusDialog = {
        title: focus.data.name,
        content: `<p>${game.i18n.localize("age-system.abilitySelect")}</p>`,
    };
    const abilitiesPool = CONFIG.ageSystem.abilitiesSettings[game.settings.get("age-system", "abilitySelection")];
    let abilitiesArray = []
    for (const abl in abilitiesPool) {
        if (Object.hasOwnProperty.call(abilitiesPool, abl)) {
            const ablLocal = game.i18n.localize(abilitiesPool[abl]);
            abilitiesArray.push({ability: abl, name: ablLocal});
        };
    };
    abilitiesArray = sortObjArrayByName(abilitiesArray, "name");
    let buttons = {};
    for (let a = 0; a < abilitiesArray.length; a++) {
        const obj = abilitiesArray[a];
        buttons[obj.ability] = {
            label: obj.name,
            callback: ev => {
                ageRollCheck(ev, actor, obj.ability, focus)
            }
        }
    }
    return new Dialog(focusDialog = {
        ...focusDialog,
        buttons
    });
}
function dialogBoxAbilityFocus ( focus , actor ) { let focusDialog = { title : focus . data . name , content : ` ${ game . i18n . localize ( "age-system.abilitySelect" ) } ` , } ; const abilitiesPool = CONFIG . ageSystem . abilitiesSettings [ game . settings . get ( "age-system" , "abilitySelection" ) ] ; let abilitiesArray = [ ] for ( const abl in abilitiesPool ) { if ( Object . hasOwnProperty . call ( abilitiesPool , abl ) ) { const ablLocal = game . i18n . localize ( abilitiesPool [ abl ] ) ; abilitiesArray . push ( { ability : abl , name : ablLocal } ) ; } ; } ; abilitiesArray = sortObjArrayByName ( abilitiesArray , "name" ) ; let buttons = { } ; for ( let a = 0 ; a < abilitiesArray . length ; a ++ ) { const obj = abilitiesArray [ a ] ; buttons [ obj . ability ] = { label : obj . name , callback : ev => { ageRollCheck ( ev , actor , obj . ability , focus ) } } } return new Dialog ( focusDialog = { ... focusDialog , buttons } ) ; }
Creates dialog box to pick alternative Ability to roll a Focus - option within Focus' context menu
Creates dialog box to pick alternative Ability to roll a Focus - option within Focus ' context menu
// In future versions of FoundryVTT (after 0.7.9), Dialog will pass HMTL data and not jQuery // Check this if/when code breaks