-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtab_armory.dat
1161 lines (997 loc) · 34.3 KB
/
tab_armory.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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- This file contains the definition of the "Armory" tab panel. This tab is where
the user selects weapons and armor for the character.
All public visual elements used with this tab panel start with the prefix "ar"
to associate them with the tab.
-->
<document signature="Hero Lab Data">
<!-- arMelee portal
Presents a dynamic table where the user can add melee weapons for the
character.
We use separate templates for selecting weapons and showing the weapons
that have been chosen. Each of these appears further below.
We use an "additem" script to simply prompt the user to add weapons.
The "buytemplate" and "selltemplate" attributes automatically hook in the
logic appropriate for buying and selling items for cash. When a "buytemplate"
is specified, adding an item automatically shows the template in the lower
right corner (beneath the description), allowing the user to control the
purchase price. When a "selltemplate" is specified, the template is shown
when the user clicks on the delete button, allowing the user to control the
selling price and quantity for the item.
We use a "candidate" tag expression to limit the choices the user can make.
We don't want to include natural attacks as purchasable, so we omit them.
In all other respects, the want the "candidate" tag expression to behave
just like the "list" tag expression.
We could specify a component of "WeapMelee" and achieve the same result,
with one exception. For consistency and to eliminate any need for code
duplication, all of the transaction logic for buying and selling gear is
defined for the "Gear" component. HL invokes the buy/sell logic associated
with the component specified, with none being invoked if the component does
not specify the logic. Consequently, we have to specify the "Gear" component
in order to ensure that all the buy/sell logic is invoked properly. This
forces us to filter on the "WeapMelee" component in both the "list" and the
"candidate" tag expressions.
We use the default "description" behavior to generate the appropriate
information for display to the user as a description when choosing melee
weapons. This invokes the "Descript" procedure for the purpose.
We use a "headertitle" script to place a suitable title above the table.
-->
<portal
id="arMelee"
style="tblNormal">
<table_dynamic
component="Gear"
headertemplate="arMeleeHdr"
showtemplate="arWpnPick"
choosetemplate="arWpnThing"
buytemplate="BuyCash"
selltemplate="SellCash"
alwaysupdate="yes">
<list>component.WeapMelee</list>
<candidate inheritlist="yes">!(Hide.Equipment|Equipment.Natural)</candidate>
<titlebar><![CDATA[
@text = "Select Melee Weapons to Purchase from the List Below"
]]></titlebar>
<additem><![CDATA[
@text = "Add New Melee Weapons"
]]></additem>
</table_dynamic>
</portal>
<!-- yRange portal
Presents a dynamic table where the user can add ranged weapons for the
character. This portal is identical to "arMelee" above, except that it
manages ranged weapons instead of melee weapons, resulting in a few minor
but important differences from the melee weapons table.
-->
<portal
id="arRange"
style="tblNormal">
<table_dynamic
component="Gear"
headertemplate="arRangedHdr"
showtemplate="arWpnPick"
choosetemplate="arWpnThing"
buytemplate="BuyCash"
selltemplate="SellCash"
alwaysupdate="yes">
<list>component.WeapRange</list>
<candidate inheritlist="yes">!(Hide.Equipment|Equipment.Natural)</candidate>
<titlebar><![CDATA[
@text = "Select Ranged Weapons to Purchase from the List Below"
]]></titlebar>
<additem><![CDATA[
@text = "Add New Ranged Weapons"
]]></additem>
</table_dynamic>
</portal>
<!-- arDefense portal
Presents a dynamic table where the user can add armor and shields for the
character. This portal is identical to "arMelee" above, except that it
manages defensive gear instead of melee weapons, resulting in a few minor
but important differences from the melee weapons table.
Since we show both armor AND shields in the same table, we use the "Armory"
sortset to sort all of the armor first and then the shields below.
-->
<portal
id="arDefense"
style="tblNormal">
<table_dynamic
component="Gear"
showtemplate="arDefPick"
choosetemplate="arDefThing"
headertemplate="arDefHdr"
showsortset="Armory"
buytemplate="BuyCash"
selltemplate="SellCash"
alwaysupdate="yes">
<list>component.Defense</list>
<candidate inheritlist="yes">!(Hide.Equipment|Equipment.Natural)</candidate>
<titlebar><![CDATA[
@text = "Select Armor and Shields to Purchase from the List Below"
]]></titlebar>
<additem><![CDATA[
@text = "Add New Armor and Shields"
]]></additem>
</table_dynamic>
</portal>
<template
id="arMeleeHdr"
name="Melee Header"
compset="Weapon"
marginhorz="3"
marginvert="3">
<portal
id="hdrTitle"
style="lblTitle"
isheader="yes">
<label
istitle="yes"
text="Melee Weapons">
</label>
</portal>
<portal
id="hdrName"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Weapon"
]]></labeltext>
</label>
</portal>
<portal
id="hdrSkill"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Skill"
]]></labeltext>
</label>
</portal>
<portal
id="hdrDamage"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Dmg"
]]></labeltext>
</label>
</portal>
<portal
id="hdrCrit"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Crit"
]]></labeltext>
</label>
</portal>
<portal
id="hdrSpecial"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Notes"
]]></labeltext>
</label>
</portal>
<header><![CDATA[
~our header height is the title plus a gap plus the header text
height = portal[hdrTitle].height + portal[hdrName].height + 2
~if this is a "sizing" calculation, we're done
doneif (issizing <> 0)
~our title spans the full width of the template
portal[hdrTitle].width = width
~each of our header labels has the same width as the corresponding data beneath
perform portal[hdrName].centerpoint[horz,100]
perform portal[hdrSkill].centerpoint[horz,180]
perform portal[hdrDamage].centerpoint[horz,230]
perform portal[hdrCrit].centerpoint[horz,260]
perform portal[hdrSpecial].centerpoint[horz,350]
~align all header labels at the bottom of the header region
perform portal[hdrName].alignedge[bottom,0]
perform portal[hdrSkill].alignedge[bottom,0]
perform portal[hdrCrit].alignedge[bottom,0]
perform portal[hdrDamage].alignedge[bottom,0]
perform portal[hdrSpecial].alignedge[bottom,0]
height = portal[hdrName].bottom
]]></header>
</template>
<template
id="arRangedHdr"
name="Ranged Header"
compset="Weapon"
marginhorz="3"
marginvert="3">
<portal
id="hdrTitle"
style="lblTitle"
isheader="yes">
<label
istitle="yes"
text="Ranged Weapons">
</label>
</portal>
<portal
id="hdrName"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Weapon"
]]></labeltext>
</label>
</portal>
<portal
id="hdrSkill"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Skill"
]]></labeltext>
</label>
</portal>
<portal
id="hdrDamage"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Dmg"
]]></labeltext>
</label>
</portal>
<portal
id="hdrCrit"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Crit"
]]></labeltext>
</label>
</portal>
<portal
id="hdrRange"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Rng"
]]></labeltext>
</label>
</portal>
<portal
id="hdrSpecial"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Notes"
]]></labeltext>
</label>
</portal>
<header><![CDATA[
~our header height is the title plus a gap plus the header text
height = portal[hdrTitle].height + portal[hdrName].height + 2
~if this is a "sizing" calculation, we're done
doneif (issizing <> 0)
~our title spans the full width of the template
portal[hdrTitle].width = width
~each of our header labels has the same width as the corresponding data beneath
perform portal[hdrName].centerpoint[horz,100]
perform portal[hdrSkill].centerpoint[horz,180]
perform portal[hdrDamage].centerpoint[horz,230]
perform portal[hdrCrit].centerpoint[horz,260]
perform portal[hdrRange].centerpoint[horz,305]
perform portal[hdrSpecial].centerpoint[horz,350]
~align all header labels at the bottom of the header region
perform portal[hdrName].alignedge[bottom,0]
perform portal[hdrSkill].alignedge[bottom,0]
perform portal[hdrDamage].alignedge[bottom,0]
perform portal[hdrCrit].alignedge[bottom,0]
perform portal[hdrRange].alignedge[bottom,0]
perform portal[hdrSpecial].alignedge[bottom,0]
height = portal[hdrName].bottom
]]></header>
</template>
<!-- arWpnThing template
Derived from the SimpleItem template, this template includes the weapon
damage and purchase cost. It is specifically for showing things for the
user to select.
It would be reasonable to assume that we could designate the range as a
simple field-based label portal, but that won't work. If the weapon is a
melee weapon, it won't have the range field, so you'll get run-time errors
when Hero Lab tries to access the field associated with the portal. The
solution is to use a script-based label that properly checks whether the
weapon is ranged. If so, then the field can be safely accessed. If not,
then the text is left as empty.
-->
<template
id="arWpnThing"
name="Weapon Thing"
compset="Weapon"
marginhorz="3"
marginvert="2">
<portal
id="name"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = field[name].text
]]></labeltext>
</label>
</portal>
<portal
id="damage"
style="lblNormal">
<label
field="wpDamage">
</label>
</portal>
<portal
id="range"
style="lblDisable">
<label>
<labeltext><![CDATA[
if (tagis[component.WeapRange] <> 0) then
@text = field[wpRange].text
else
@text = ""
endif
]]></labeltext>
</label>
</portal>
<portal
id="cost"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = field[grCost].text
]]></labeltext>
</label>
</portal>
<position><![CDATA[
~set up our dimensions, with a width that we dictate; our width can vary
~between weapon types, since ranged weapons require extra space for the range
height = portal[name].height
if (tagis[component.WeapRange] <> 0) then
width = 350
else
width = 250
endif
~if this is a "sizing" calculation, we're done
doneif (issizing <> 0)
~position the cost portal on the far right
perform portal[cost].alignedge[right,0]
~position the damage portal to the left of the cost; we want the damage to
~be centered in its own column relative to a centerpoint position
perform portal[damage].centerpoint[horz,180]
~position the range portal to be centered in its own column relative to a
~centerpoint position
perform portal[range].centerpoint[horz,260]
~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[range].left - 10)
]]></position>
</template>
<!-- arWpnPick template
Derived from the SimpleItem template, this includes the weapon damage and
the gear button to move equipment between various containers. We also show
the range for ranged weapons. This template is specifically for showing the
weapons that the user has already purchased.
For more details, please see the "arWpnThing" template above.
-->
<template
id="arWpnPick"
name="Weapon Pick"
compset="Weapon"
marginhorz="3"
marginvert="3">
<portal
id="name"
style="chkNormal"
showinvalid="yes"
tiptext="Click to equip this weapon">
<checkbox
field="grIsEquip"
dynamicfield="grStkName">
</checkbox>
</portal>
<portal
id="heldby"
style="imgNormal">
<image_literal
image="gearinfo.bmp"
isbuiltin="yes"
istransparent="yes">
</image_literal>
<mouseinfo><![CDATA[
call InfoHeld
]]></mouseinfo>
</portal>
<portal
id="strreq"
style="imgNormal">
<image_literal
image="strengthreq.bmp"
isbuiltin="yes"
istransparent="yes">
</image_literal>
<mouseinfo><![CDATA[
@text = "You do not meet this weapon's minimum brawn requirement."
]]></mouseinfo>
</portal>
<portal
id="agireq"
style="imgNormal">
<image_literal
image="strengthreq.bmp"
isbuiltin="yes"
istransparent="yes">
</image_literal>
<mouseinfo><![CDATA[
@text = "You do not meet this weapon's minimum agility requirement."
]]></mouseinfo>
</portal>
<portal
id="skill"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = field[wpSkillColor].text
]]></labeltext>
</label>
</portal>
<portal
id="damage"
style="lblNormal">
<label
field="wpNetDmg">
</label>
</portal>
<portal
id="crit"
style="lblNormal">
<label
field="wpCrit">
</label>
</portal>
<portal
id="range"
style="lblDisable">
<label>
<labeltext><![CDATA[
@text = field[wpRange].text
]]></labeltext>
</label>
</portal>
<portal
id="special"
style="imgNormal">
<image_literal
image="special.bmp"
isbuiltin="yes"
istransparent="yes">
</image_literal>
<mouseinfo><![CDATA[
@text = "Special: " & field[wpNotes].text
]]></mouseinfo>
</portal>
<portal
id="edit"
style="actEdit"
tiptext="Edit this Gear">
<action
action="edit"
buttontext="">
</action>
</portal>
<portal
id="gearmanage"
style="actGear"
tiptext="Click here to choose which container to place this equipment within.">
<action
action="gear">
</action>
</portal>
<portal
id="info"
style="actInfo">
<action
action="info">
</action>
<mouseinfo/>
</portal>
<portal
id="delete"
style="actDelete"
tiptext="Click to delete this equipment">
<action
action="delete">
</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)
~center the portals vertically
perform portal[info].centervert
perform portal[name].centervert
perform portal[skill].centervert
perform portal[damage].centervert
perform portal[crit].centervert
perform portal[range].centervert
perform portal[special].centervert
perform portal[gearmanage].centervert
perform portal[delete].centervert
perform portal[strreq].centervert
perform portal[agireq].centervert
perform portal[heldby].centervert
perform portal[edit].centervert
~position the delete portal on the far right
perform portal[delete].alignedge[right,0]
~position the info portal to the left of the delete button
perform portal[info].alignrel[rtol,delete,-8]
~position the gear portal to the left of the info button
perform portal[gearmanage].alignrel[rtol,info,-8]
~position the special portal to the left of the gear button
perform portal[edit].alignrel[rtol,gearmanage,-8]
if (tagis[Equipment.Natural] <> 0) then
portal[edit].visible = 0
endif
~position the special portal to the left of the gear button
perform portal[special].centerpoint[horz,350]
~position the range portal to the left of the delete button; we want the
~damage to be centered in its own column relative to a centerpoint position
perform portal[range].centerpoint[horz,305]
~position the crit portal to the left of the range column; we want the
~crit to be centered in its own column relative to a centerpoint position
perform portal[crit].centerpoint[horz,260]
~position the damage portal to the left of the range column; we want the
~damage to be centered in its own column relative to a centerpoint position
perform portal[damage].centerpoint[horz,230]
~position the skill portal to the left of damage column; we want the
~skill to be centered in its own column relative to a centerpoint position
perform portal[skill].centerpoint[horz,180]
~position the name on the left and let it use all available space
var limit as number
limit = portal[skill].left - 8 - portal[heldby].width - 5 - portal[strreq].width - 2
portal[name].left = 0
portal[name].width = minimum(portal[name].width,limit)
~show the 'strength requirement' icon to the right of the name
perform portal[strreq].alignrel[ltor,name,2]
portal[strreq].visible = tagis[Helper.BadStrReq]
~show the 'agility requirement' icon to the right of the name
perform portal[agireq].alignrel[ltor,name,2]
portal[agireq].visible = tagis[Helper.BadAgiReq]
~show the 'held by' icon to the right of the strenght requirement if appropriate
if (portal[strreq].visible = 0) then
portal[heldby].left = portal[strreq].left
else
perform portal[heldby].alignrel[ltor,strreq,5]
endif
portal[heldby].visible = isgearheld
~if this is not a ranged weapon, hide the range portal
if (tagis[component.WeapRange] = 0) then
portal[range].visible = 0
endif
~only show the special portal if there are special abilities/notes to view
portal[special].visible = 1 - field[wpNotes].isempty
]]></position>
</template>
<!-- arDefThing template
Derived from the SimpleItem template, this includes the defense rating and
purchase cost. This template is specifically for showing things that the
user can select.
-->
<template
id="arDefThing"
name="Defense Thing"
compset="Defense"
marginhorz="3"
marginvert="2">
<portal
id="name"
style="lblNormal">
<label
field="name">
</label>
</portal>
<portal
id="defense"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = field[defDefenseMelee].text & "/" & field[defDefenseRange].text
]]></labeltext>
</label>
</portal>
<portal
id="cost"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = field[grCost].text
]]></labeltext>
</label>
</portal>
<position><![CDATA[
~set up our dimensions, with a width that we dictate
height = portal[name].height
width = 250
~if this is a "sizing" calculation, we're done
doneif (issizing <> 0)
~position the cost portal on the far right
perform portal[cost].alignedge[right,0]
~position the defense portal to the left of the cost; we want the defense
~to be centered in its own column relative to a centerpoint position
perform portal[defense].centerpoint[horz,180]
~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[defense].left - 8)
]]></position>
</template>
<template
id="arDefHdr"
name="Ranged Header"
compset="Weapon"
marginhorz="3"
marginvert="3">
<portal
id="hdrTitle"
style="lblTitle"
isheader="yes">
<label
istitle="yes"
text="Armor & Shields">
</label>
</portal>
<portal
id="hdrName"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Armor/Shield"
]]></labeltext>
</label>
</portal>
<portal
id="hdrSoak"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Soak"
]]></labeltext>
</label>
</portal>
<portal
id="hdrDefenseMel"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Melee"
]]></labeltext>
</label>
</portal>
<portal
id="hdrDefenseRng"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Ranged"
]]></labeltext>
</label>
</portal>
<portal
id="hdrSpecial"
style="lblHeader"
isheader="yes">
<label>
<labeltext><![CDATA[
@text = "Notes"
]]></labeltext>
</label>
</portal>
<header><![CDATA[
~our header height is the title plus a gap plus the header text
height = portal[hdrTitle].height + portal[hdrName].height + 2
~if this is a "sizing" calculation, we're done
doneif (issizing <> 0)
~our title spans the full width of the template
portal[hdrTitle].width = width
~each of our header labels has the same width as the corresponding data beneath
perform portal[hdrName].centerpoint[horz,100]
perform portal[hdrSoak].centerpoint[horz,220]
perform portal[hdrDefenseMel].centerpoint[horz,260]
perform portal[hdrDefenseRng].centerpoint[horz,300]
perform portal[hdrSpecial].centerpoint[horz,350]
~align all header labels at the bottom of the header region
perform portal[hdrName].alignedge[bottom,0]
perform portal[hdrSoak].alignedge[bottom,0]
perform portal[hdrDefenseMel].alignedge[bottom,0]
perform portal[hdrDefenseRng].alignedge[bottom,0]
perform portal[hdrSpecial].alignedge[bottom,0]
height = portal[hdrName].bottom
]]></header>
</template>
<!-- arDefPick template
Derived from the SimpleItem template, this includes the defense rating and
the gear button to move equipment between various containers. This template
is specifically for showing picks that the user has already purchased.
-->
<template
id="arDefPick"
name="Defense Pick"
compset="Defense"
marginhorz="3"
marginvert="3">
<portal
id="name"
style="chkNormal"
showinvalid="yes"
tiptext="Click to equip this item">
<checkbox
field="grIsEquip"
dynamicfield="grStkName">
</checkbox>
</portal>
<portal
id="heldby"
style="imgNormal">
<image_literal
image="gearinfo.bmp"
isbuiltin="yes"
istransparent="yes">
</image_literal>
<mouseinfo><![CDATA[
call InfoHeld
]]></mouseinfo>
</portal>
<portal
id="strreq"
style="imgNormal">
<image_literal
image="strengthreq.bmp"
isbuiltin="yes"
istransparent="yes">
</image_literal>
<mouseinfo><![CDATA[
@text = "You do not meet this equipment's minimum strength requirement."
]]></mouseinfo>
</portal>
<portal
id="soak"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = signed(field[defSoak].text)
]]></labeltext>
</label>
</portal>
<portal
id="defensemelee"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = field[defDefenseMelee].text
]]></labeltext>
</label>
</portal>
<portal
id="defenserange"
style="lblNormal">
<label>
<labeltext><![CDATA[
@text = field[defDefenseRange].text
]]></labeltext>
</label>
</portal>
<portal
id="special"
style="imgNormal">
<image_literal
image="special.bmp"
isbuiltin="yes"
istransparent="yes">
</image_literal>
<mouseinfo><![CDATA[
@text = "Special: " & field[grNotes].text
]]></mouseinfo>
</portal>
<portal
id="edit"
style="actEdit"
tiptext="Edit this Gear">
<action
action="edit"
buttontext="">
</action>
</portal>
<portal
id="gearmanage"
style="actGear"
tiptext="Click here to choose which container to place this equipment within.">
<action
action="gear">
</action>
</portal>
<portal
id="info"
style="actInfo">
<action
action="info">
</action>
<mouseinfo/>
</portal>
<portal
id="delete"
style="actDelete"
tiptext="Click to delete this equipment">
<action
action="delete">
</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)
~center the portals vertically
perform portal[info].centervert
perform portal[name].centervert
perform portal[soak].centervert
perform portal[defensemelee].centervert
perform portal[defenserange].centervert
perform portal[special].centervert
perform portal[gearmanage].centervert
perform portal[edit].centervert
perform portal[delete].centervert
perform portal[strreq].centervert
perform portal[heldby].centervert
~position the delete portal on the far right
perform portal[delete].alignedge[right,0]
~position the info portal to the left of the delete button
perform portal[info].alignrel[rtol,delete,-8]