Files
roll20-character-sheets/rapidfire_system/scaffold/_rolltemplate mixins.pug
T

85 lines
3.0 KiB
Plaintext

//-Roll Template Mixins to be included in Sheet files
mixin rolltemplate(name)
rolltemplate(class=`sheet-rolltemplate-${name}`)
div(class=`template ${name} system-{{system}}`)
block
div(class='image-border{{#header}} has-header{{/header}}{{#footer}} has-footer{{/footer}}')
mixin multiPartTemplate(name)
rolltemplate(class=`sheet-rolltemplate-${name}`)
+templateHelperFunction({func:'rollTotal',invert:true,values:'computed::finished 0'})
div(class=`template ${name} system-{{system}}{{#continuation}} continuation{{/continuation}}{{#first}} first{{/first}} finished`)
block
+templateHelperFunction({func:'rollBetween',values:'computed::finished 0 0'})
div(class=`template ${name} system-{{system}}{{#continuation}} continuation{{/continuation}}{{#first}} first{{/first}}`)
block
//- End Mixin
mixin characterLink()
+templateConditionalDisplay('footer')
.footer
.footer__background.background
+templateConditionalDisplay('character_id')
h4(tabindex='-1').character_name [{{footer}}](http://journal.roll20.net/character/{{character_id}})
+templateConditionalDisplay('character_id',true)
h4(tabindex='-1').character_name {{footer}}
.footer__content
+templateConditionalDisplay('character_id')
h4.character_name [{{footer}}](http://journal.roll20.net/character/{{character_id}})
+templateConditionalDisplay('character_id',true)
h4.character_name {{footer}}
.footer__image
//-End mixin
mixin templateBase(name)
- name = name.replace(/\s+/g,'_');
+rolltemplate(name)
+characterLink()
block
//-End mixin
mixin templateConditionalDisplay(fieldBool,invert)
!=`{{${invert ? '^' : '#'}${fieldBool}}}`
block
!=`{{/${fieldBool}}}`
//- End mixin
mixin templateHelperFunction(helperObj)
!=`{{${helperObj.invert ? '#^':'#'}${helperObj.func ? `${helperObj.func}() `:''}${helperObj.values ? `${helperObj.values}` : ''}}}`
block
!=`{{/${(helperObj.invert) ? '^' : ''}${helperObj.func ? `${helperObj.func}() `:''}${helperObj.values}}}`
//- End Mixin
mixin rollWasCrit(helperObj)
- helperObj.func = 'rollWasCrit';
+templateHelperFunction(helperObj)
block
//- End Mixin
mixin rollWasFumble(helperObj)
- helperObj.func = 'rollWasFumble';
+templateHelperFunction(helperObj)
block
//- End Mixin
mixin rollTotal(helperObj)
- helperObj.func = 'rollTotal';
+templateHelperFunction(helperObj)
block
//- End Mixin
mixin rollGreater(helperObj)
- helperObj.func = 'rollGreater';
+templateHelperFunction(helperObj)
block
//- End Mixin
mixin rollLess(helperObj)
- helperObj.func = 'rollLess';
+templateHelperFunction(helperObj)
block
//- End Mixin
mixin rollBetween(helperObj)
- helperObj.func = 'rollBetween';
+templateHelperFunction(helperObj)
block
//- End Mixin
mixin allProps(helperObj)
- helperObj.func = 'allprops';
+templateHelperFunction(helperObj)
block
//- End Mixin
mixin templateField(name)
!= `${tField(name)}`
//- End Mixin
- const tField = name => `{{${name}}}`;