Files
roll20-character-sheets/Pathfinder_Cazra/pug/fields.pug
T

84 lines
2.6 KiB
Plaintext

mixin fieldBox(type, name, label, opts)
- opts = opts || {};
.fieldBox(style=attributes.style)
if(label)
label(data-i18n=opts.i18n)= label
.inner: input(type=type, name='attr_' + name, value=attributes.value|0)
mixin fraction(name)
.fraction
input(type='number', name='attr_' + name)
span /
input(type='number', name='attr_' + name + '_max')
mixin input(type, name, opts)
- opts = opts || {};
input(type=type, name='attr_' + name, placeholder=attributes.placeholder, style=attributes.style, value=attributes.value, data-i18n-placeholder=opts.i18n)
mixin labelledAbove(label, opts)
- opts = opts || {};
.labelledAbove(style=attributes.style)
label(data-i18n=opts.i18n)= label
.inner: block
mixin labelledBoxH(label, opts)
- opts = opts || {};
.labelledBoxH(class=attributes.class, style=attributes.style)
label(data-i18n=opts.i18n)= label
.inner: block
mixin labelledBoxV(label, opts)
- opts = opts || {};
.labelledBoxV(class=attributes.class, style=attributes.style)
label(data-i18n=opts.i18n)= label
.inner: block
mixin labelledUnderlined(label, opts)
- opts = opts || {};
.labelledUnderlined(style=attributes.style)
label(data-i18n=opts.i18n)= label
.inner: block
mixin option(view, value, opts)
-
if(!value)
value = view;
opts = opts || {};
option(value=value, selected=opts.isSelected, data-i18n=opts.i18n)= view
mixin readOnlyBox(name)
.readOnlyBox(style=attributes.style): span(name='attr_' + name)
input(type='hidden', name='attr_' + name)
mixin repeating(name)
fieldset(class='repeating_' + name)
block
mixin rollButton(attr, notes, options)
-
var tpl = '&{template:pf} {{charName=@{character_name}}} ';
if(options && options.isAttack) {
tpl += '{{attr=@{' + options.attackName + '}}} {{result=[[1d20cs>@{' + options.crit.range + '} + @{' + attr + '}]]}} ' +
'{{damage=[[@{' + options.damage + '}]]}} ' +
'{{critConfirm=[[1d20cs>@{' + options.crit.range + '} + @{' + attr + '}]]}} ' +
'{{critDamage=[[(@{' + options.damage + '}) * @{' + options.crit.multiplier + '}]]}}' +
'{{isAttack=true}}';
}
else
tpl += '{{attr=' + attr + '}} {{result=[[1d20 + @{' + attr + '}]]}}' +
'{{isNotAttack=true}}';
if(notes)
tpl += '{{notes=@{' + notes + '}}}';
button(type='roll', value=tpl)
mixin select(name)
select(name='attr_' + name, style=attributes.style)
block
mixin textarea(name, opts)
- opts = opts || {};
textarea(name='attr_' + name, style=attributes.style, placeholder=attributes.placeholder, data-i18n-placeholder=opts.i18n)