View Single Post
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old July 20th, 2017, 08:06 PM
I've set up the batch add as follows (commented out code at the bottom was the autosizing code):

Quote:
<?xml version="1.0" encoding="UTF-8"?>

<!-- This file contains the definition of the "Skills" tab panel. This tab is where
the user selects the skills for the character.

All public visual elements used with this tab panel start with the prefix "sk"
to associate them with the tab.
-->

<document signature="Hero Lab Data">


<!-- skSkills portal
Presents a fixed table where the user can adjust skills for the
character.
-->
<portal
id="skCSkills"
style="tblNormal"
height="0">
<table_fixed component="Skill" showtemplate="skPick"
scrollable="yes">
<list><![CDATA[
Skills.Combat
]]></list>
<headertitle>
@text="Combat Skills"
</headertitle>
</table_fixed>
</portal>

<portal
id="skPSkills"
style="tblNormal">
<table_fixed component="Skill" showtemplate="skPick"
scrollable="yes">
<list><![CDATA[
Skills.Physical
]]></list>
<headertitle>
@text="Physical Skills"
</headertitle>
</table_fixed>
</portal>

<portal
id="skMSkills"
style="tblNormal">
<table_fixed component="Skill" showtemplate="skPick"
scrollable="yes">
<list><![CDATA[
Skills.Mental
]]></list>
<headertitle>
@text="Mental Skills"
</headertitle>
</table_fixed>
</portal>

<portal
id="skSSkills"
style="tblNormal">
<table_fixed component="Skill" showtemplate="skPick"
scrollable="yes">
<list><![CDATA[
Skills.Social
]]></list>
<headertitle>
@text="Social Skills"
</headertitle>
</table_fixed>
</portal>

<template
id="skPick"
name="Skill Pick"
compset="Skill"
marginhorz="3"
marginvert="2">

<portal
id="value"
style="incrSimple">
<incrementer
field="trtUser">
</incrementer>
<mouseinfo mousepos="middle+above"><![CDATA[
if (hero.tagis[mode.creation] = 0) then
@text = "Skills 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 skill by clicking on the arrows to increase/decrease the number of points assigned."
endif
]]></mouseinfo>
</portal>

<portal
id="name"
style="lblSmall"
showinvalid="yes">
<label
field="name">
</label>
</portal>

<portal
id="info"
style="actInfo">
<action
action="info">
</action>
<mouseinfo mousepos="middle+above"/>
</portal>

<portal
id="specialty"
style="actOvalSm"
tiptext="Click to add specialties">
<action
action="form"
form="tacManip">
</action>
</portal>

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

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

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

~position the other portals vertically
perform portal[name].centervert
perform portal[value].centervert
perform portal[specialty].centervert

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

~position the info portal to the left of the specialty button
perform portal[info].alignrel[rtol,specialty,-8]

~position the incrementer on the left
portal[value].left = 0

~position the name next to the incrementer
perform portal[name].alignrel[ltor,value,10]

portal[name].width = minimum(portal[name].width,portal[info].left - portal[name].left - 10)

]]></position>
</template>

<layout
id="skills">
<portalref portal="skCSkills" taborder="10"/>
<portalref portal="skPSkills" taborder="20"/>
<portalref portal="skMSkills" taborder="30"/>
<portalref portal="skSSkills" taborder="40"/>
<position><![CDATA[
~freeze our table in advancement mode to disable adding new choices
~Note: All freezing must be done *before* any positioning is performed.
if (state.iscreate = 0) then
portal[skCSkills].freeze = 1
portal[skPSkills].freeze = 1
portal[skMSkills].freeze = 1
portal[skSSkills].freeze = 1
endif

perform portal[skCSkills].batchadd
perform portal[skPSkills].batchadd
perform portal[skMSkills].batchadd
perform portal[skSSkills].batchadd

perform batchplace

height = autotop

~ perform portal[skCSkills].autoplace
~ perform portal[skPSkills].autoplace
~ perform portal[skMSkills].autoplace
~ perform portal[skSSkills].autoplace

~ portal[skCSkills].left = 0
~ portal[skCSkills].top = 0
~ portal[skCSkills].width = width / 2 - 5
~
~ portal[skMSkills].left = portal[skCSkills].width + 5
~ portal[skMSkills].top = 0
~ portal[skMSkills].width = width / 2 - 5
~
~ portal[skPSkills].left = 0
~ portal[skPSkills].top = maximum(portal[skCSkills].bottom, portal[skMSkills].bottom) + 15
~ portal[skPSkills].width = width / 2 - 5
~
~ portal[skSSkills].left = portal[skCSkills].width + 5
~ portal[skSSkills].top = maximum(portal[skCSkills].bottom, portal[skMSkills].bottom) + 15
~ portal[skSSkills].width = width / 2 - 5

]]></position>
</layout>

<panel
id="skills"
name="Skills"
marginhorz="5"
marginvert="5"
order="120">
<live>!HideTab.skills</live>
<layoutref layout="skills"/>
<position><![CDATA[
]]></position>
</panel>
</document>
Except, I'm getting an odd glitch for the first table. It stays like this until I click on the table a few times in different places.

Attached Images
File Type: png Skill Glitch.png (406.8 KB, 45 views)

Last edited by Duggan; July 21st, 2017 at 05:02 AM. Reason: Adding complete code
Duggan is offline   #6 Reply With Quote