• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

problems with the Header section of a template

barrelv

Well-known member
I'm getting really odd behavior on the header section of a template and I can't seem to find out why. Hoping someone else here can give me some hints. (and also hoping it's not something silly like my last issue)

Here's the portal
Code:
  <portal
    id="baAttrib"
    style="tblInvis">
    <table_fixed
      component="Attribute"
      showtemplate="baAttrPick"
      headertemplate="baAttrPick"
      showsortset="explicit"
      scrollable="no">
      <list>!Hide.Attribute</list>
      </table_fixed>
    </portal>

and here's the template it calls
Code:
<template
    id="baAttrPick"
    name="Attribute Pick"
    compset="Attribute"
    marginhorz="13"
    marginvert="9">

	<portal
      id="hdrName"
      style="lblBright">
      <label
        text="Racial Max">
        </label>
      </portal>

	<portal
      id="name"
      style="lblLarge"
      showinvalid="yes">
      <label
        field="name">
        </label>
      </portal>
      
	<portal
      id="hdrMax"
      style="lblBright"
      showinvalid="yes"
      isheader="yes">
      <label
        text="Racial Max">
        </label>
      </portal>      

    <portal
      id="max"
      style="lblLarge">
      <label
          field="trtMaximum">      
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "Attribute Max"
        ]]></mouseinfo>
      </portal>

	<portal
      id="hdrRace"
      style="lblBright"
      isheader="yes">
      <label
        text="Racial Bonus">
        </label>
      </portal>  
	  
    <portal
      id="race"
      style="lblLarge">
      <label>
        <labeltext><![CDATA[
          @text = field[trtRace].text & "    +"
          ]]></labeltext>
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "Racial Bonus"
        ]]></mouseinfo>
      </portal>

	<portal
      id="hdrEquip"
      style="lblBright"
      isheader="yes">
      <label
        text="Equipment Bonus">
        </label>
      </portal>  
	  
      <portal
      id="equip"
      style="lblLarge">
      <label>
        <labeltext><![CDATA[
          @text = field[trtEquip].text & "    +"
          ]]></labeltext>
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "Equiptment Bonus"
        ]]></mouseinfo>
      </portal>

	<portal
      id="hdrValue"
      style="lblBright"
      isheader="yes">
      <label
        text="Current Value">
        </label>
      </portal>  

    <portal
      id="value"
      style="incrSimple">
      <incrementer
        field="trtUser">
        </incrementer>
      <mouseinfo><![CDATA[
        if (hero.tagis[mode.creation] = 0) then
          @text = "Attributes must be modified via the Advances tab once the character is locked for play."
        elseif (autonomous = 0) then
          @text = "This trait has been improved via the Advances tab and cannot be modified further from here."
        else
          @text = "Allocate points to this attribute by clicking on the arrows to increase/decrease the number of points assigned."
          endif
        ]]></mouseinfo>
      </portal>

	<portal
      id="hdrFinal"
      style="lblBright"
      isheader="yes">
      <label
        text="Final Value">
        </label>
      </portal>  
	  
	<portal
      id="final"
      style="lblLarge"
      showinvalid="yes">
      <label
        field="trtFinal">
        </label>
      </portal>

    <position><![CDATA[
      ~set up our height based on our tallest portal
      height = portal[max].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~freeze our value in advancement mode or if an advancement has modified us
      ~Note: All freezing must be done *before* any positioning is performed.
      if (state.iscreate = 0) then
        portal[value].freeze = 1
      elseif (autonomous = 0) then
        portal[value].freeze = 1
        endif

      ~position our tallest portal at the top
      portal[name].top = 0

      ~center the other portals vertically
      perform portal[max].centervert
      perform portal[final].centervert
      perform portal[value].centervert
      perform portal[equip].centervert
      perform portal[race].centervert

      ~position the info portal on the far right
      ~perform portal[info].alignedge[right,0]

      ~position the incrementer to the left of the info portal (plus a gap)
      perform portal[max].alignedge[right,0]
      perform portal[final].alignrel[rtol,max,-40]
      perform portal[value].alignrel[rtol,final,-40]
      perform portal[equip].alignrel[rtol,value,-40]
      perform portal[race].alignrel[rtol,equip,-40]

      ~position the name on the left and make sure its width does not exceed the available space
      portal[name].left = 0
      portal[name].width = minimum(portal[name].width,portal[value].left - portal[name].left - 10)
      ]]></position>
<header><![CDATA[
~our header height is the height of our labels
height = portal[name].height

~each of our header labels has the same width as the corresponding data beneath
portal[hdrName].width = portal[name].width
portal[hdrMax].width = portal[max].width
portal[hdrFinal].width = portal[final].width
portal[hdrValue].width = portal[value].width
portal[hdrEquip].width = portal[equip].width
portal[hdrRace].width = portal[race].width

~center each header label on the corresponding data beneath
perform portal[hdrName].centeron[horz,name]
perform portal[hdrMax].centeron[horz,max]
perform portal[hdrFinal].centeron[horz,final]
perform portal[hdrValue].centeron[horz,value]
perform portal[hdrEquip].centeron[horz,equip]
perform portal[hdrRace].centeron[horz,race]


~align all header labels at the bottom of the header region
perform portal[hdrName].alignedge[bottom,0]
perform portal[hdrMax].alignedge[bottom,0]
perform portal[hdrFinal].alignedge[bottom,0]
perform portal[hdrValue].alignedge[bottom,0]
perform portal[hdrEquip].alignedge[bottom,0]
perform portal[hdrRace].alignedge[bottom,0]
]]></header>
</template>

Attached is what I'm getting. Any ideas?
 

Attachments

  • 2014-08-12_094507.png
    2014-08-12_094507.png
    174.5 KB · Views: 10
I'm sorry to say that I can't see anything wrong on a quick glance, and I'm getting on a plane to Gen Con in 5 hours, so I won't have time to study it before I leave. I'll take a look when I get home next week, if no-one else has answered in the meantime.
 
completely forgot about the GenCon blackout. You guys have fun! I'll bang my head on other parts of my project in the meantime, no worries.
 
So, the first thing I'd look for is which string is being displayed.

On initial thought, it could be Racial Max, but which one?

Change one of the instances of Racial Max to Racial Map.

If the text changes to Map, then you'll have a better idea of where to continue troubleshooting.


BoomerET
 
so I made some sense of this last night. It seems that the centeron works a lot better when the target item is itself placed by the centerpoint option. No clue why.

Code and screenshot to follow:

Code:
<portal
    id="baAttrib"
    style="tblInvis">
    <table_fixed
      component="Attribute"
      showtemplate="baAttrPick"
      headertemplate="baAttrPick"
      showsortset="explicit"
      scrollable="no">
      <list>!Hide.Attribute</list>
      </table_fixed>
    </portal>

Code:
<template
    id="baAttrPick"
    name="Attribute Pick"
    compset="Attribute"
    marginhorz="13"
    marginvert="9">

	<portal
      id="hdrName"
      style="lblHeader"
      isheader="yes">
      <label
        text="Attribute">
        </label>
      </portal>

	<portal
      id="name"
      style="lblLarge"
      showinvalid="yes">
      <label
        field="name">
        </label>
      </portal>
      
	<portal
      id="hdrMin"
      style="lblHeader"
      isheader="yes">
      <label
        text="MIN">
        </label>
      </portal>      

    <portal
      id="min"
      style="lblLarge">
      <label
          field="trtMinimum">      
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "Attribute Min"
        ]]></mouseinfo>
      </portal>
      
	<portal
      id="hdrRace"
      style="lblHeader"
      isheader="yes">
      <label
        text="RACE">
        </label>
      </portal>      
	  
    <portal
      id="race"
      style="lblLarge">
      <label
        field="trtRace">
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "Racial Bonus"
        ]]></mouseinfo>
      </portal>
      
	<portal
      id="hdrEquip"
      style="lblHeader"
      isheader="yes">
      <label
        text="EQUIP">
        </label>
      </portal>      
	  
    <portal
      id="equip"
      style="lblLarge">
      <label
        field="trtEquip">
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "Equipment Bonus"
        ]]></mouseinfo>
      </portal>
      
	<portal
      id="hdrMax"
      style="lblHeader"
      isheader="yes">
      <label
        text="MAX">
        </label>
      </portal>      

    <portal
      id="max"
      style="lblLarge">
      <label
          field="trtMaximum">      
        </label>
      <mouseinfo><![CDATA[
        ~insert appropriate code to explain how the trait was derived
        @text = "Attribute Max"
        ]]></mouseinfo>
      </portal>
      
	  
	<portal
      id="hdrValue"
      style="lblHeader"
      isheader="yes">
      <label
        text="CURRENT">
        </label>
      </portal>  

    <portal
      id="value"
      style="incrSimple">
      <incrementer
        field="trtUser">
        </incrementer>
      <mouseinfo><![CDATA[
        if (hero.tagis[mode.creation] = 0) then
          @text = "Attributes must be modified via the Advances tab once the character is locked for play."
        elseif (autonomous = 0) then
          @text = "This trait has been improved via the Advances tab and cannot be modified further from here."
        else
          @text = "Allocate points to this attribute by clicking on the arrows to increase/decrease the number of points assigned."
          endif
        ]]></mouseinfo>
      </portal>

	<portal
      id="hdrFinal"
      style="lblHeader"
      isheader="yes">
      <label
        text="FINAL">
        </label>
      </portal>  
	  
	<portal
      id="final"
      style="lblLarge"
      showinvalid="yes">
      <label
        field="trtFinal">
        </label>
      </portal>

    <position><![CDATA[
      ~set up our height based on our tallest portal
      height = portal[max].height

      ~if this is a "sizing" calculation, we're done
      doneif (issizing <> 0)

      ~freeze our value in advancement mode or if an advancement has modified us
      ~Note: All freezing must be done *before* any positioning is performed.
      if (state.iscreate = 0) then
        portal[value].freeze = 1
      elseif (autonomous = 0) then
        portal[value].freeze = 1
        endif

      ~position our tallest portal at the top
      portal[name].top = 0

      ~center the other portals vertically
      perform portal[min].centervert
      perform portal[max].centervert
      perform portal[final].centervert
      perform portal[value].centervert
      perform portal[race].centervert
      perform portal[equip].centervert

      ~position the info portal on the far right
      ~perform portal[info].alignedge[right,0]

      ~position the incrementer to the left of the info portal (plus a gap)
      perform portal[final].alignedge[right,0]
      
      ~perform portal[final].centerpoint[horz,400]
      perform portal[equip].centerpoint[horz,400]
      perform portal[max].centerpoint[horz,350]
      perform portal[value].centerpoint[horz,250]
      perform portal[race].centerpoint[horz,150]
      perform portal[min].centerpoint[horz,100]

      ~position the name on the left and make sure its width does not exceed the available space
      portal[name].left = 0
      ~portal[name].width = minimum(portal[name].width,portal[value].left - portal[name].left - 10)
      ]]></position>
<header><![CDATA[
~our header height is the height of our labels
height = portal[name].height

portal[hdrName].left = portal[name].left
perform portal[hdrFinal].alignedge[right,0]

~center each header label on the corresponding data beneath
perform portal[hdrMin].centeron[horz,min]
perform portal[hdrMax].centeron[horz,max]
~perform portal[hdrFinal].centeron[horz,final]
perform portal[hdrValue].centeron[horz,value]
perform portal[hdrRace].centeron[horz,race]
perform portal[hdrEquip].centeron[horz,equip]

~align all header labels at the bottom of the header region
perform portal[hdrName].alignedge[bottom,0]
perform portal[hdrMin].alignedge[bottom,0]
perform portal[hdrMax].alignedge[bottom,0]
perform portal[hdrFinal].alignedge[bottom,0]
perform portal[hdrValue].alignedge[bottom,0]
perform portal[hdrRace].alignedge[bottom,0]
perform portal[hdrEquip].alignedge[bottom,0]
]]></header>
</template>
 

Attachments

  • 2014-08-14_082803.png
    2014-08-14_082803.png
    125.6 KB · Views: 9
Back
Top