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)
-   -   Height of confusion ... or confusion of height (http://forums.wolflair.com/showthread.php?t=59355)

EightBitz October 19th, 2017 03:31 PM

Height of confusion ... or confusion of height
 
1 Attachment(s)
I'm having an issue with a character sheet layout. It's based on a table pick, but then I add extra text to it through a script, and this is confusing me in regards to how I can manage the height.

The concept I'm going for is that each character can pick from a list of schools of the art (supernatural predilections), and they can then pick certain disciplines associated with those schools.

For instance, I can pick the "Kinetic" school and the "Protective" school, then I can pick the "Hidden Hand" and "Skeleton Key" disciplines which are associated with the "Kinetic" school, and the "Line of Defense" discipline which is associated with the "Protective" school. I want this to show up on the character sheet as such:

Code:

Kinetic
 » Hidden Hand
 » Skeleton Key
Protective
 » Line of Defense

The problem is that each the number of disciplines each school can have is variable, which means the height of each table element is variable. If my position script includes the following line:

height = portal[name].height +10

...then each School will have the height of the first element, in this case "Kinetic", regardless of how many disciplines have been added. In this case, that means that "Protective" would have too much white space.

If I reversed it, and gave one discipline to "Kinetic" and two to "Protective", then the second discipline in "Protective" would be cut off.

I'm pasting my template code below, and I'm attaching a PDF that shows how things get cut off.

If anyone has any ideas, I'd appreciate the feedback.

Thanks.

Code:

  <template
    id="oSchPick"
    name="Output The Art Table"
    compset="School"
    marginvert="10">

    <portal
      id="name"
      style="outNormLt">
      <output_label>
              <labeltext><![CDATA[
            var schname as string
            var discipname as string
            var linkname as string
          var disciplvl as string
          var disciproll as number
                                       
            schname = field[name].text
                                 
            @text = schname
              foreach pick in hero from Discipline where "component.Discipline & !Hide.Discipline"
                  discipname = eachpick.field[name].text
                  disciplvl = eachpick.field[disLvlInit].text
                  disciproll = eachpick.field[disRoll].value
                  linkname = eachpick.linkage[dissch].field[name].text
              if (compare(schname,linkname) = 0) then
                    @text &= "{br} » " & discipname & " " & disciplvl & " " & disciproll
                    endif
                nexteach
                ]]></labeltext>
        </output_label>
      </portal>

    <!-- Portals used as the header -->
    <portal
      id="thearthdr"
      style="outTitle"
      isheader="yes">
      <output_label
        text="The Art">
        </output_label>
      </portal>

    <position><![CDATA[
      var thirdwidth as number
     
      ~our height is driven by the tallest portal (they're all the same)
      height = portal[name].height +10
     
      ~Calculate 1/3 of available width to account for three portals,
      ~  each with it's own column, with a padding of 6 between each.
      thirdwidth = (width-12)/3
      thirdwidth = round(thirdwidth,0,0)
      doneif (issizing <> 0)
             
      ~setup appropriate widths for the various value portals
      portal[name].width = thirdwidth
                       
      ~center everything vertically within the template
      perform portal[name].centervert

      ~perform portal[name].alignedge[left,0]
      ]]></position>

    <header><![CDATA[
      ~our header height is the title plus a gap plus the header text
      ~height = portal[thearthdr].height
      ~width = (width-12)/3
      doneif (issizing <> 0)

      ~our title spans the full width of the name portal
      portal[thearthdr].width = portal[name].width
      ]]></header>
    </template>


Mathias October 19th, 2017 04:11 PM

On the portal this template is being displayed from, add varyheight="yes".

EightBitz October 19th, 2017 05:56 PM

Quote:

Originally Posted by Mathias (Post 257605)
On the portal this template is being displayed from, add varyheight="yes".

Perfect! Thank you.

Duggan October 25th, 2017 07:30 PM

Is there anything similar with a dynamic_table?

Mathias October 26th, 2017 07:28 AM

That is only an option on the printout. Same-height tables is an annoying limitation of some of the standard windows methods that HL calls to build its tables, so in the UI, they all have to be the height set by the first one.


All times are GMT -8. The time now is 02:11 AM.

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