Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Authoring Kit (http://forums.wolflair.com/forumdisplay.php?f=58)
-   -   Is it possible to use a template multiple times in a character sheet layout? (http://forums.wolflair.com/showthread.php?t=60249)

Duggan February 24th, 2018 09:30 AM

Is it possible to use a template multiple times in a character sheet layout?
 
2 Attachment(s)
I'm building part of the character sheet which shows the Health and then some defense values.

http://forums.wolflair.com/attachmen...1&d=1519495970

I started out with a somewhat crude, but reasonably functional setup where I built everything with individual labels (still working on scaling):

http://forums.wolflair.com/attachmen...1&d=1519496677

It then dawned on me that I could probably use templates, since this is essentially all the same data (not to mention that I'm suddenly realizing I never actually stuck the code in to load those box labels with the values). I found the use of "templateref", but it looks like you can only use a template once in a layout. Looking at example source code, it looks like this is usually handled by applying the template to a single trait that has multiple values, such as initiative, and all references in the position script are to the template name. Is there a way to simply build a layout that has four instances of this template, pointing to trHealth, trDR, trDefense, and trDodge, and then refer to each uniquely?

The alternate method which I'm going to mess around with is one templateref for the Health and then a table with three columns for the other three, but I figured I'd ask here while I'm fiddling (and also to remind me to post the answer if I find one).

Duggan February 24th, 2018 09:31 AM

Silly me... I didn't read the documentation well enough.

Quote:

The "templateref" Element

The "templateref" element identifies a template used within the layout and assigns it a logical name for use within the Position script. The complete list of attributes for this element is below.

template Id – Unique id of the template to be utilized within the layout.
reference (Optional) Id – Specifies the alternate unique id to be used when referencing this template within the Position script. This makes it possible to re-use the same template more than once within the same layout, giving each instance a different logical id. If empty, the reference id is simply the template id. Default: Empty.
thing (Optional) Id – Specifies the unique id of the thing or pick that is associated with this template. The given object is used with the template when determining the contents of fields and such. If empty, no thing/pick is associated with the template, which means that the template cannot contain any portals that utilize a field reference. Default: Empty.
dynamic (Optional) Boolean – Instead of specifying a thing, you can flag a template as "dynamic". This means that instead of using a specific pick, the template uses the "dynamic pick" to as its context, for determining field contents and so on. The dynamic pick is only set if the layout is used on a form that's summoned via a pick (usually by clicking a button on a template for that pick); it is set to the pick from which the form was summoned. Default: "no".
ispick (Optional) Boolean – Indicates whether the template is associated with a pick or a thing. If a pick, the first pick within the container that based on the specified thing is used. Default: "yes".
taborder (Optional) Integer – Specifies the relative tab order position of the template and its contents within the overall layout. As long as the tab orders are different for all portals and templates within the layout, HL can properly sequence the flow of control. Default: "0".

Duggan February 24th, 2018 10:42 AM

Note to self... (and to others trying this), if the boxes seem like they're showing up far right of where you put them, check your marginhorz value... ^_^


All times are GMT -8. The time now is 05:03 AM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.