mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-09-08 16:12:33 +00:00
spells from SRD
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
||||
<div class="npc-content-wrap">
|
||||
<div class="compendium-drop-target">
|
||||
<input type="hidden" name="attr_content_srd" accept="Content">
|
||||
<input type="hidden" name="attr_spell_book_srd" accept="Spell Book">
|
||||
<input type="hidden" name="attr_spells_srd" accept="Spell Book">
|
||||
<input type="checkbox" name="attr_npc_edit" class="toggle-npc-edit hidden">
|
||||
|
||||
<div class="shaped-row">
|
||||
|
||||
@@ -1954,6 +1954,28 @@ on('change:saving_throws_srd', function () {
|
||||
updateSavingThrowsFromSRD();
|
||||
});
|
||||
|
||||
function updateSpellsFromSRD () {
|
||||
var collectionArray = ['spells_srd'];
|
||||
var finalSetAttrs = {};
|
||||
|
||||
getAttrs(collectionArray, function (v) {
|
||||
var spells = v.spells_srd.split(', ');
|
||||
|
||||
for (var i = 0; i < spells.length; i++) {
|
||||
var newRowId = generateRowID();
|
||||
var repeatingString = 'repeating_spell_' + newRowId + '_';
|
||||
finalSetAttrs[repeatingString + 'name'] = spells[i];
|
||||
}
|
||||
|
||||
console.log('updateSpellsFromSRD', finalSetAttrs);
|
||||
setFinalAttrs(v, finalSetAttrs);
|
||||
});
|
||||
}
|
||||
on('change:spells_srd', function () {
|
||||
updateSpellsFromSRD();
|
||||
});
|
||||
|
||||
|
||||
var sheetOpened = function () {
|
||||
var collectionArray = ['version', 'strength', 'dexterity', 'constitution', 'intelligence', 'wisdom', 'charisma'];
|
||||
var finalSetAttrs = {};
|
||||
|
||||
Reference in New Issue
Block a user