-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtab_creaturebasics.dat
179 lines (152 loc) · 7.2 KB
/
tab_creaturebasics.dat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the definition of the "Basics" tab panel. This tab is where
the user configures that attributes and skills of the character.
All public visual elements used with this tab panel start with the prefix "ba"
to associate them with the tab.
-->
<document signature="Hero Lab Data">
<!-- baAttrib portal
Presents a fixed table that consists of the various attributes for the
character. The "explicit" sortset is used to enforce a hand-numbered
ordering of the attributes. Since the full list is short enough to always
be visible, the table has no scroller.
We use a "headertitle" script to place a suitable title above the table.
-->
<portal
id="baCreAttrib"
style="tblInvis">
<table_fixed
component="Attribute"
showtemplate="baAttrPick"
showsortset="explicit"
scrollable="no">
<list>!Hide.Trait & HeroType.Creature</list>
<headertitle><![CDATA[
@text = "Attributes"
]]></headertitle>
</table_fixed>
</portal>
<!-- baTrait portal
Presents a fixed table with all derived traits in it. The sortset allows
us to dictate the order of display via a hand-numbered sequence. All traits
are always visible, so we don't need a scroller.
-->
<portal
id="baCreTrait"
style="tblInvis">
<table_fixed
component="Derived"
showtemplate="baTrtPick"
showsortset="explicit"
scrollable="no">
<list>!Hide.Trait & (HeroType.Creature & !Hero.NoCarry)</list>
<headertitle><![CDATA[
@text = "Traits"
]]></headertitle>
</table_fixed>
</portal>
<portal
id="baCreSkill"
style="tblInvis">
<table_fixed
component="Skill"
showtemplate="baSklPick"
scrollable="no"
columns="3">
<list>HeroType.Creature</list>
<headertitle><![CDATA[
@text = "Skills: " & hero.child[resSkill].field[resSummary].text
]]></headertitle>
</table_fixed>
</portal>
<!-- basics layout
This layout orchestrates the display of all various visual elements that
comprise the Basics tab. We have titles above the attributes and skills,
the attributes and skills tables themselves, a horizontal separator, and
the table of derived traits.
Each of these portals and templates is identified as a "reference" by the
layout. Using references allows distinct instances of portals and templates
to be re-used within multiple layouts. You can even use the same template
multiple times within a single layout.
The visual elements used in the layout are all sized and positioned via
the "position" script. This script is invoked to setup the dimensions of
visual elements and trigger the positioning of the contents of those
elements via the "render" invocation.
The tab order between items is controlled via the optional "taborder" XML
attribute on the various portal and template references. Within a template,
the tab order is dictated by the order the portals are listed within the
XML. Within a table, the tab order is dictated by the item sequence. The
"taborder" attribute coordinates the relative sequence of portals and
templates within the layout. In this layout, the tab order will move down
the left column and then shift over to the right column.
-->
<layout
id="crebasics">
<portalref portal="baCreAttrib" taborder="10"/>
<portalref portal="baCreTrait" taborder="20"/>
<portalref portal="baCreSkill" taborder="30"/>
<!-- This script sizes and positions the layout and its child visual elements. -->
<position><![CDATA[
~size and position the attributes table in the top left; we set the height to
~the full layout height, but the table will only use the space it needs
portal[baCreAttrib].width = width / 2 - 5
portal[baCreAttrib].left = 0
portal[baCreAttrib].height = height
~size and position the skills table in the top right; we set the height to
~the full layout height, but the table will only use the space it needs
portal[baCreTrait].width = portal[baCreAttrib].width
portal[baCreTrait].left = width - portal[baCreTrait].width
portal[baCreTrait].height = height - portal[baCreTrait].top
~set the separator width and position it beneath the attributes
~portal[Horizontal].width = width - 30
~portal[Horizontal].top = maximum(portal[baCreAttrib].bottom,portal[baCreTrait].bottom) + 10
~portal[Horizontal].left = portal[baCreAttrib].left + 15
portal[baCreSkill].width = width - 10
portal[baCreAttrib].left = 5
portal[baCreSkill].top = maximum(portal[baCreAttrib].bottom,portal[baCreTrait].bottom) + 5
portal[baCreSkill].height = height - portal[baCreSkill].top
~figure out the total height we need for the tab
height = portal[baCreSkill].bottom
]]></position>
</layout>
<!-- basics panel
This is the "Basics" panel shown within Hero Lab.
The "order" attribute dictates the sequence in which the various tabs will
be displayed. To keep everything well organized, We break the tabs up into
four logical groupings: (1) traits and creation details, (2) equipment,
(3) details, and (4) in-play support. Each of these groupings will have a
three-digit value that starts with the grouping number. Since the Basics
panel should appear first within the traits group, it has an order of "110".
As we assign order values, We'll leave gaps in the sequence (e.g. 110, 120,
etc.). This will allow us to easily change our minds and slip a new panel
inbetween two existing ones as the data files evolve, without having to go
through and re-number everything.
We setup a suitable margin around the edges of the panel. This ensures that
there is a little bit of spacing from the edges and eliminates the need for
our positioning scripts to make the appropriate adjustments.
Like with layouts, panels have a "position" script to setup the dimensions
of child elements and orchestrate the rendering of their contents. In many
cases, as with this panel, the default handling of panels will ensure that
the layouts are properly rendered.
The panel is assigned a "live" tagexpr so that its visibility can be
controlled for different types of characters. While not really useful in the
sample data files, this approach can be quite useful when the data files
expand to govern creation of widely varying characters, such as vampires vs.
ghosts vs. mortals in the World of Darkness game system.
-->
<panel
id="crebasics"
name="Basics"
marginhorz="5"
marginvert="5"
order="110">
<live>!HideTab.basics & CharType.typCreature</live>
<layoutref layout="crebasics"/>
<position><![CDATA[
~get the height used by the layout and use it, as that means we scroll
~if necessary
perform layout[crebasics].render
height = layout[crebasics].height
]]></position>
</panel>
</document>