-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform_config.dat
361 lines (296 loc) · 11.4 KB
/
form_config.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file contains the definition of the "config" form for the game system.
The "config" form represents the form where the user customizes the basic
configuration details of the character. This form is automatically shown when
the user first creates a new character and can again be shown via the menu
option to "Configure" the character.
This form is shown as a standalone form, so the form must specify its own
dimensions. No sizing information is externally provided.
In general, the "config" form should contain fundamental details of the
character that will be configured once at character creation and thereafter
left unchanged. Customization of source and setting selections should
also typically be performed through this form. However, there are no hard
requirements for what is actually placed in the "config" form.
All public visual elements used with this form start with the prefix "cnf"
to associate them with the form.
NOTE! The unique id of the "config" form is specially recognized by Hero Lab
as the form to be used for character configuration. A form with the id
"config" is required within your data files.
-->
<document signature="Hero Lab Data">
<!-- cnfTitle portal
Displays a title at the top of the form, along with some extra vertical
spacing above the title text.
-->
<portal
id="cnfTitle"
style="lblTitle">
<label_title
text="{vert 6}Configure Your Character">
</label_title>
</portal>
<!-- cnfSummary portal
Displays a special table-based summary of the currently selected sources
and settings for the character.
-->
<portal
id="cnfSummary"
style="special">
<setting_summary>
</setting_summary>
</portal>
<!-- cnfAlly portal
Displays a menu that allows the user to select whether this hero is an
ally or enemy.
-->
<portal
id="cnfAlly"
style="special">
<alliance>
</alliance>
</portal>
<!-- cnfTypeportal
Displays a menu that allows the user to select what type of hero is being created.
-->
<portal id="cnfType"
style="chsNormal"
width="150">
<chooser_table
component="CharType"
choosetemplate="SimpleItem">
<chosen><![CDATA[
if (@ispick = 0) then
@text = "{text ff0000}Select Char Type"
else
@text = field[name].text
endif
]]>
</chosen>
<titlebar>
@text = "Choose your character type"
</titlebar>
</chooser_table>
</portal>
<!-- cnfName template
This template is used to display and edit the name of the actor and player.
-->
<template
id="cnfName"
name="Name Configuration"
compset="useredit">
<portal
id="edit"
style="editNormal">
<edit
field="useredit">
</edit>
</portal>
<portal
id="label"
style="lblSmTitle">
<label_field
field="name">
</label_field>
</portal>
<position><![CDATA[
~set the width of the edit portal to something we like
portal[edit].width = 215
~position the label just beneath the edit portal
portal[label].top = portal[edit].bottom + 4
~set the dimensions of the template based on the extent of the portals
height = portal[label].bottom
width = portal[edit].right
]]></position>
</template>
<!-- cnfStart template
This template displays the starting characteristics of the character, such
as the initial character points, special ability slots, etc. If the game
system allows the creation of "advanced" characters, then starting XP could
be controlled here, as could any other facet of the character that a player
can establish at creation and that has effects on how the character is then
constructed.
The starting character points is controlled through a literal menu with a
few hard-wired options, wherein the selected value is saved in a field for
subsequent use. This could just as easily be handled as an edit portal where
the user types in the starting points or with an incrementer that gives the
user a wide range of initial values to choose from.
The starting number of special abilities is similarly controlled through a
literal menu. As above, you can use a variety of approaches here that are
all equally effective. Choose the method that is more appropriate to the
needs of the game system.
The starting cash possessed by the character is presented as an edit portal,
allowing any arbitrary amount to be specified.
-->
<template
id="cnfStart"
name="Starting Resources"
compset="Actor">
<!--<portal
id="menutype"
style="menuNormal">
<menu_things
component="CharType"
field="acType">
</menu_things>
</portal> -->
<portal id="menuType"
style="chsNormal"
width="150">
<chooser_table
component="CharType"
choosetemplate="SimpleItem">
<chosen><![CDATA[
if (@ispick = 0) then
@text = "{text ff0000}Select Char Type"
else
@text = field[name].text
endif
]]>
</chosen>
<titlebar>
@text = "Choose your character type"
</titlebar>
</chooser_table>
</portal>
<portal
id="label"
style="lblNormal">
<label_title
text="Starting Resources:">
</label_title>
</portal>
<portal
id="menuabil"
style="menuNormal">
<menu_literal
field="acStartTal">
<choice value="0" display="Abilities: 0 Bonus Slots"/>
<choice value="1" display="Abilities: 1 Bonus Slots"/>
<choice value="2" display="Abilities: 2 Bonus Slots"/>
<choice value="3" display="Abilities: 3 Bonus Slots"/>
</menu_literal>
</portal>
<portal
id="lblcash"
style="lblNormal">
<label_literal
text="Starting Cash ($):">
</label_literal>
</portal>
<portal
id="cash"
style="editCenter">
<edit
field="acCashCfg"
maxlength="6"
format="integer">
</edit>
</portal>
<position><![CDATA[
~set the width of the template to something we like
width = 185
~position the type menu at the top
portal[menuType].width = width
~position the resources title just under it
~perform portal[label].centerhorz
~perform portal[label].alignrel[ttob,menutype,10]
~position the starting cash beneath the ability slots
~perform portal[cash].alignrel[ttob,menuabil,15]
~perform portal[lblcash].centeron[vert,cash]
~portal[cash].width = 50
~portal[lblcash].left = (width - portal[lblcash].width - portal[cash].width - 10) / 2
~perform portal[cash].alignrel[ltor,lblcash,10]
~set the height of the template based on the extent of the portals
~Note: Include a little extra space at the bottom for borders and such.
height = portal[menuType].bottom + 3
~hide non-essential portals
portal[lblcash].visible = 0
portal[cash].visible = 0
portal[label].visible = 0
portal[menuabil].visible = 0
]]></position>
</template>
<!-- configure layout
This layout contains all of the facets of initial character configuration.
The general positioning of the visual elements in this form is relatively
consistent across all data files, making it easy for users to move between
game systems. Consequently, you are encouraged to retain the general
scheme with your own data files. However, there is no hard requirement
that you do so.
-->
<layout
id="configure">
<portalref portal="cnfTitle"/>
<portalref portal="cnfAlly" taborder="80"/>
<portalref portal="cnfSummary" taborder="90"/>
<portalref portal="cnfType" taborder="95"/>
<templateref reference="heroname" template="cnfName" thing="heroname" taborder="10"/>
<templateref reference="playername" template="cnfName" thing="playername" taborder="20"/>
<templateref template="cnfStart" thing="actor" taborder="30"/>
<!-- This script sizes and positions the layout and its child visual elements. -->
<position><![CDATA[
~render all templates to generate the appropriate dimensions for each
perform template[heroname].render
perform template[playername].render
~perform template[cnfStart].render
template[cnfStart].visible = 0
~setup a horizontal margin to use
var horz as number
horz = 20
~the title is positioned at the top
~pad the height of the title with some extra space for more visual weight
portal[cnfTitle].height += 8
~position the character name beneath the title on the left
template[heroname].left = horz
template[heroname].top = portal[cnfTitle].bottom + 25
~position the player name beneath the hero name
template[playername].left = template[heroname].left
template[playername].top = template[heroname].bottom + 10
~the settings summary fills the right hand side of the form
portal[cnfSummary].top = template[heroname].top
portal[cnfSummary].left = template[heroname].right + 20
portal[cnfSummary].width = 300
~the total width of the layout (i.e. form) is the right edge of the
~rules summary portal plus our margin
width = portal[cnfSummary].right + horz
~the title needs to extend across the full width of the layout
portal[cnfTitle].width = width
~position the starting values template beneath the title on the left
portal[cnfType].left = (portal[cnfSummary].left - portal[cnfType].width) / 2
portal[cnfType].top = template[playername].bottom + 15
~position the alliance portal beneath the starting values template
portal[cnfAlly].left = portal[cnfType].left
portal[cnfAlly].width = portal[cnfType].width
portal[cnfAlly].top = portal[cnfType].bottom + 10
~our height must encompass the alliance portal and be at least 225 pixels high
~Note: Using a minimum height ensures that the displayed list of user-selected
~settings has some reasonable vertical space to show them to the user.
height = maximum(350,portal[cnfAlly].bottom)
~the summary extends the full height of the layout/form
portal[cnfSummary].height = height - portal[cnfSummary].top
~move the alliance portal downwards on the left, leaving a gap if available
if (portal[cnfSummary].bottom > portal[cnfAlly].bottom) then
perform portal[cnfAlly].alignrel[btob,cnfSummary,0]
endif
]]></position>
</layout>
<!-- config form
This is the "config" form shown to configure a new character within Hero
Lab.
NOTE! The unique id of this form is specially recognized by Hero Lab as
the form to be used for character configuration. A form with this id is
required within your data files.
-->
<form
id="config"
name="Configure">
<layoutref layout="configure"/>
<position><![CDATA[
~render the layout to generate its dimensions
perform layout[configure].render
~set the width and height of the form to the dimensions of the layout
width = layout[configure].width
height = layout[configure].height
]]></position>
</form>
</document>