mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 19:52:29 +00:00
69 lines
2.2 KiB
Plaintext
69 lines
2.2 KiB
Plaintext
//-Roll Template Mixins to be included in Sheet files
|
|
mixin rolltemplate(name)
|
|
rolltemplate(class=`sheet-rolltemplate-${name}`)
|
|
block
|
|
//- End Mixin
|
|
mixin templateWrapper(name)
|
|
+rolltemplate(name)
|
|
div(class=`template ${name}`)
|
|
block
|
|
//- End Mixin
|
|
mixin multiPartTemplate(name)
|
|
rolltemplate(class=`sheet-rolltemplate-${name}`)
|
|
+templateHelperFunction({func:'rollBetween',values:'computed::finished 0 0',invert:true})
|
|
span(class='finished')
|
|
div(class=`template ${name}{{#continuation}} continuation{{/continuation}}{{#first}} first{{/first}} finished`)
|
|
block
|
|
//- End Mixin
|
|
mixin characterLink
|
|
+templateConditionalDisplay('character_name')
|
|
+templateConditionalDisplay('character_id')
|
|
h4.character_name [{{character_name}}](http://journal.roll20.net/character/{{character_id}})
|
|
+templateConditionalDisplay('character_id',true)
|
|
h4.character_name {{character_name}}
|
|
//-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 |