diff --git a/CharactersPage.js b/CharactersPage.js index afc365d29..3defd14d5 100644 --- a/CharactersPage.js +++ b/CharactersPage.js @@ -798,7 +798,12 @@ function observe_character_sheet_changes(documentToObserve) { e.stopPropagation(); $(this).closest('.ct-content-group').find(`.ct-slot-manager [aria-checked='false']`).first().click(); - let rollButtons = $(this).parent().find(`.integrated-dice__container:not('.avtt-roll-formula-button'):not('.above-vtt-visited'):not('.above-vtt-dice-visited')`); + let rollButtons = $(this).parent().find(`.integrated-dice__container:not('.avtt-roll-formula-button'):not('.above-vtt-visited'):not('.above-vtt-dice-visited'):not('.above-aoe'), .integrated-dice__container.abovevtt-icon-roll`); + let spellSave = $(this).parent().find(`.ct-spells-spell__save`); + let spellSaveText; + if(spellSave.length>0){ + spellSaveText = `${spellSave.find('.ct-spells-spell__save-label').text().toUpperCase()} DC${spellSave.find('.ct-spells-spell__save-value').text()}`; + } for(let i = 0; iCasts ${$(this).parent().find('[class*="styles_spellName"]').text()}: ${spellSaveText}`, + playerId: window.PLAYER_ID, + sendTo: window.sendToTab + } + if(is_abovevtt_page()){ + window.MB.inject_chat(msgdata) } + else if(window.sendToTab != undefined){ + tabCommunicationChannel.postMessage({ + msgType: 'SendToGamelog', + player: msgdata.player, + img: msgdata.img, + text: msgdata.text, + sendTo: msgdata.sendTo + }); + } } }); if($(`style#advantageHover`).length == 0){ @@ -1028,7 +1055,12 @@ function observe_character_sheet_changes(documentToObserve) { e.stopPropagation(); let versatileRoll = window.CHARACTER_AVTT_SETTINGS.versatile; - let rollButtons = $(this).parent().find(`.integrated-dice__container:not('.avtt-roll-formula-button'):not('.above-vtt-visited'):not('.above-vtt-dice-visited'), .integrated-dice__container.abovevtt-icon-roll`); + let rollButtons = $(this).parent().find(`.integrated-dice__container:not('.avtt-roll-formula-button'):not('.above-vtt-visited'):not('.above-vtt-dice-visited'):not('.above-aoe'), .integrated-dice__container.abovevtt-icon-roll`); + let spellSave = $(this).parent().find(`[class*='__save']`); + let spellSaveText; + if(spellSave.length>0){ + spellSaveText = `${spellSave.find('[class*="__save-label"]').text().toUpperCase()} DC${spellSave.find('[class*="__save-value"]').text()}`; + } for(let i = 0; iCasts ${$($(this).parent().find('[class*="__name"]>[class*="__label"]')[0]).text()}: ${spellSaveText}`, + playerId: window.PLAYER_ID, + sendTo: window.sendToTab + } + if(is_abovevtt_page()){ + window.MB.inject_chat(msgdata) + } + else if(window.sendToTab != undefined){ + tabCommunicationChannel.postMessage({ + msgType: 'SendToGamelog', + player: msgdata.player, + img: msgdata.img, + text: msgdata.text, + sendTo: msgdata.sendTo + }); + } + } + }) if($(`style#advantageHover`).length == 0){ $('body').append(`