<!-- baSkill portal
Presents a table consisting of all skills for the character, which
are shown in alphabetical order (the default).
We use a "headertitle" script to place a suitable title above the table.
-->
<portal
id="baSkill"
style="tblInvis">
<table_dynamic
component="Skill"
showtemplate="baSklPick"
choosetemplate="skThing"
scrollable="yes">
<candidate inheritlist="yes">!Hide.Skill</candidate>
<titlebar><![CDATA[
@text = "Add a Skill"
]]></titlebar>
<!-- <list>!Hide.Skill</list> -->
<headertitle><![CDATA[
@text = "Skills"
]]></headertitle>
<additem><![CDATA[
~if we're in advancement mode, we've been frozen, so display accordingly
if (state.iscreate = 0) then
@text = "{text clrgrey}Add/Increase Skills Via Advances Tab"
done
endif
~get the color-highlighted "add" text
@text = "Add a Skill"
]]></additem>
</table_dynamic>
</portal>
<!-- skThing template
Displays the name of the skill, with its linked attribute at the right edge.
-->
<template
id="skThing"
name="Skill Thing"
compset="Skill"
marginhorz="3"
marginvert="2">
<portal
id="name"
style="lblNormal"
showinvalid="yes">
<label
field="name">
</label>
</portal>
<portal
id="attribute"
style="lblSecond">
<label>
<labeltext><![CDATA[
@text = linkage[attribute].field[name].text
]]></labeltext>
</label>
</portal>
<position><![CDATA[
~set up our height based on our tallest portal
height = portal[name].height
~if this is a "sizing" calculation, we're done
doneif (issizing <> 0)
~center the portals vertically
perform portal[name].centervert
perform portal[attribute].centervert
~position the attribute portal on the far right
perform portal[attribute].alignedge[right,0]
~position the name on the left and let it use all available space
portal[name].left = 0
portal[name].width = minimum(portal[name].width,portal[attribute].left - 8)
]]></position>
</template>
<!-- baSklPick template
Displays one skill within the table of skills. This template is very
similar to the one used for attributes. The key differences are that this
template is tied to skills and has slightly different margins for closer
grouping of the items in the table.
-->
<template
id="baSklPick"
name="Skill Pick"
compset="Skill"
marginhorz="23"
marginvert="3">
<portal
id="name"
style="lblNormal"
showinvalid="yes">
<label
field="name">
</label>
</portal>
<portal
id="value"
style="incrSimple">
<incrementer
field="trtUser">
</incrementer>
<mouseinfo><![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="info"
style="actInfo">
<action
action="info">
</action>
</portal>
<portal
id="skSpec"
style="actLarge">
<action
action="trigger"
buttontext="Specialization">
<trigger><![CDATA[
notify "Adding Specialization to " & field[name].text & " skill."
]]></trigger>
</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
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[info].top = 0
~center the other portals vertically
perform portal[name].centervert
perform portal[value].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[value].alignrel[rtol,info,-10]
~only show the master button if the actor is a minion
portal[skSpec].visible = tagis[User.HasSpec]
if (portal[skSpec].visible <> 0) then
~position the skSpec to the left of the incrementer portal (plus a gap)
portal[skSpec].width = 100
perform portal[skSpec].alignrel[rtol,value,-10]
~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[skSpec].left - portal[name].left - 10)
else
~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)
endif
]]></position>
</template>