mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-09-10 00:52:28 +00:00
Defaulted Creature size to "Large" if NPC is set.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -2903,6 +2903,24 @@ on('change:repeating_lairaction remove:repeating_lairaction', function () {
|
||||
countAction('lairaction');
|
||||
});
|
||||
|
||||
|
||||
function switchToNPC () {
|
||||
var collectionArray = ['is_npc', 'size'];
|
||||
var finalSetAttrs = {};
|
||||
|
||||
getAttrs(collectionArray, function (v) {
|
||||
var isNPC = getIntValue(v.is_npc) === 1;
|
||||
|
||||
if (isNPC && !v.size) {
|
||||
finalSetAttrs.size = 'Large';
|
||||
}
|
||||
setFinalAttrs(v, finalSetAttrs);
|
||||
});
|
||||
}
|
||||
on('change:is_npc', function () {
|
||||
switchToNPC();
|
||||
});
|
||||
|
||||
function updateSize () {
|
||||
var collectionArray = ['size'];
|
||||
var finalSetAttrs = {};
|
||||
|
||||
Reference in New Issue
Block a user