Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit


Thread Tools Display Modes
Prev Previous Post   Next Post Next
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,264

Old May 23rd, 2019, 06:47 PM

I have a table of weapons where every weapon is coming out with two lines, when the notes portal should be multiline and make each weapon a different height:
<!-- zWeapon portal
        This is a table of all Weapons carried by the actor. Weapons use the same
        template for both the contents and the header across the top. See the
        template for more details on this.
In the zWeapPick template:
Position Script:
      ~our height is based on the tallest portal within
      ~if (field[wpNotes].isempty = 0) then

	    ~set out portal height to automatically size as needed
	    perform portal[notes].autoheight
		notify "portal - " & portal[notes].height

	    ~our height is the height of our portal
        ~height = portal[notes].bottom
		 height = portal[name].height + portal[notes].height + 5
		 notify "overall - " & height
        ~height = portal[name].height + 5

      ~place the name and indicators at the top, and the notes underneath
      portal[name].top = 0
      perform portal[badstr].alignrel[btob,name,0]
      perform portal[special].alignrel[ttob,name,0]
      perform portal[notes].alignrel[ttob,name,0]

      ~position the other portals with the same baseline as the name; since they
      ~use a smaller font, they will have a smaller height, so centering them will
      ~make them appear to float up relative to the name
      perform portal[attack].alignrel[btob,name,0]
      perform portal[damage].alignrel[btob,name,0]
      perform portal[ap].alignrel[btob,name,0]
      perform portal[range].alignrel[btob,name,0]
      perform portal[dots].alignrel[btob,name,0]

      ~establish suitable fixed widths for the various columns of data
      portal[attack].width = 135
      portal[damage].width = 195
      portal[ap].width = 50
      portal[range].width = 225
~      portal[notes].width = width

      ~assign the name the remaining horizontal space
      ~Note: We must also account for a gap of 5 between portals.
      portal[name].width = width - 4 * 5
      portal[name].width -= portal[attack].width + portal[damage].width
      portal[name].width -= portal[ap].width + portal[range].width

      ~position our columns now, except for the name
      portal[attack].left = portal[name].right + 5
      perform portal[damage].alignrel[ltor,attack,5]
      perform portal[ap].alignrel[ltor,damage,5]
      perform portal[range].alignrel[ltor,ap,5]

      portal[special].left = portal[name].left + 10
      portal[notes].left = portal[special].right

      ~setup to track our position when positioning portals along the x-axis
      var x as number
      x = 0

      ~if the weapon satisfies the minimum strength requirement, hide the bitmap,
      ~else position it on the left
      if (tagis[Helper.BadStrReq] = 0) then
        portal[badstr].visible = 0
        portal[badstr].left = 0
        x = portal[badstr].right

      ~if there are no special details for the weapon, hide the bitmap
      if (field[wpNotes].isempty = 1) then
        portal[special].visible = 0
        portal[notes].visible = 0

      ~shrink the space for the name based on the presence of the two bitmaps
      portal[name].width -= portal[badstr].width * portal[badstr].visible

~      portal[name].width -= portal[special].width * portal[special].visible

      ~size the name to fit the available space, then reposition it at the baseline
      ~Note: This is needed since smaller text will have the same top position.
      perform portal[name].sizetofit[36]
      perform portal[name].autoheight
      perform portal[name].alignrel[btob,attack,0]

      ~recalculate the width of the name based on the sized font
      ~Note: This is needed so we can determine the span for the row of dots.
      ~Note: We must also cap the name portal to its previous width, just in case
      ~       the "sizetofit" didn't shrink the name far enough to fully fit.
      var limit as number
      limit = portal[name].width
      perform portal[name].autowidth
      if (portal[name].width > limit) then
        portal[name].width = limit

      ~position the name and special details indicator portals horizontally now
      portal[name].left = x
      x = portal[name].right

~      if (portal[special].visible <> 0) then
~        portal[special].left = x
~        x = portal[special].right
~        endif

      ~extend the dots from the right of the name across to the attack portal
      if (x > portal[attack].left - 10) then
        portal[dots].visible = 0
        portal[dots].left = x + 5
        portal[dots].width = portal[attack].left - 5 - portal[dots].left

But, the weapons don't become multi-line even if the wpNotes is much longer than a single output line. as seen below....

Thoughts, suggestions?

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #1 Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 05:50 PM.

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