~armagetronad-dev/armagetronad/0.4-cockpit

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
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE Resource SYSTEM "cockpit.dtd">

<Resource type="aacockpit" name="standard" version="0.0.1" author="Anonymous" category="">
    <Cockpit version="0.0.1">

<!-- Speed meter as a turning needle -->
        <NeedleGauge camera="^in">
            <Anchor x="0" y="-1" />
            <DataSet>
                <AtomicData field="source" source="player_speed" />
                <AtomicData field="minimum" source="0" />
                <AtomicData field="maximum" source="max_speed" />
            </DataSet>
            <Position x="0" y="-.12" />
            <Align x="0" y="-1" />
            <Size height="0.3" width="0.3" />
            <ShowCurrent>
                <TextSize size=".045" />
            </ShowCurrent>
            <ShowMinimum value="false" />
            <ShowMaximum value="false" />
            <Caption>
                <Text value="Speed" />
            </Caption>
            <CaptionStyle>
                <Position x="0" y=".02" />
                <Align x="0" y="1" />
                <TextSize size=".045" />
            </CaptionStyle>
            <Foreground>
                <Solid>
                    <Color r="1." g="0." b="0." alpha="1." />
                </Solid>
            </Foreground>
        </NeedleGauge>

<!-- Rubber and brakes -->
        <WidgetTemplate id="bottomgauge">
            <Anchor x="0" y="-1" />
            <Size height="0.062" width="0.3" />
            <ShowCurrent>
                <TextSize size=".045" />
            </ShowCurrent>
            <ShowMaximum>
                <Anchor x="1" y="1" />
                <Position x="0" y=".2" />
                <Align x="1" y="-1" />
                <TextSize size=".045" />
            </ShowMaximum>
            <ShowMinimum location="off" />
            <CaptionStyle>
                <Anchor x="-1" y="1" />
                <Position x="0" y=".2" />
                <Align x="-1" y="-1" />
                <TextSize size=".045" />
            </CaptionStyle>
            <Background>
                <Solid>
                    <Color r="1." g="1." b="1." alpha=".5" />
                </Solid>
            </Background>
            <LineColor>
                <Solid>
                    <Color r="0" g="0" b="0" alpha="0" />
                </Solid>
            </LineColor>
        </WidgetTemplate>

        <WidgetTemplate id="rubbergauge">
            <DataSet>
                <AtomicData field="source" source="player_rubber" />
                <AtomicData field="minimum" source="0" />
                <AtomicData field="maximum" source="cycle_rubber" />
            </DataSet>
            <Caption>
                <Text value="Rubber" />
            </Caption>
            <Foreground>
                <Gradient orientation="value">
                    <Color r="0." g="1." b="0." alpha=".9" at="0." />
                    <Color r="0." g="1." b="0." alpha=".9" at=".3" />
                    <Color r="1." g="1." b="0." alpha=".9" at=".6" />
                    <Color r="1." g="0." b="0." alpha=".9" at=".8" />
                    <Color r="1." g="0." b="0." alpha=".9" at="1." />
                </Gradient>
            </Foreground>
        </WidgetTemplate>

        <BarGauge camera="^in" usetemplate="bottomgauge rubbergauge">
            <Position x="-.25" y=".005" />
            <Align x="1" y="-1" />
        </BarGauge>

        <WidgetTemplate id="brakesgauge">
            <DataSet>
                <AtomicData field="source" source="player_brakes" />
                <AtomicData field="minimum" source="0" />
                <AtomicData field="maximum" source="1" />
            </DataSet>
            <Caption>
                <Text value="Brakes" />
            </Caption>
            <Foreground>
                <Gradient orientation="value">
                    <Color r="1." g="0." b="0." alpha=".9" at="0." />
                    <Color r="1." g="1." b="0." alpha=".9" at=".5" />
                    <Color r="0." g="1." b="0." alpha=".9" at="1." />
                </Gradient>
            </Foreground>
        </WidgetTemplate>

        <BarGauge camera="^in" usetemplate="bottomgauge brakesgauge">
            <Position x="0.25" y=".005" />
            <Align x="-1" y="-1" />
        </BarGauge>

<!-- Map in the bottom-right corner -->
        <Map camera="^in">
            <Anchor x="1" y="-1" />
            <Position x="-.005" y=".005" />
            <Align x="1" y="-1" />
            <Size height="0.395" width="0.395" />
            <Background>
                <Image scale_x=".075" scale_y=".075" repeat="both">
                    <Graphic author="wrtlprnft" version="1" name="floor" extension="png" uri="http://wrtlprnft.ath.cx/floor.png" />
                </Image>
                <Solid>
                    <Color r=".5" g="1." b=".5" alpha="1." />
                </Solid>
            </Background>
            <MapModes toggleKey="1">
                <MapMode mode="full" rotation="spawn" />
                <MapMode mode="closestZone" rotation="spawn" />
                <MapMode mode="cycle" rotation="camera" zoomFactor="3" clipMode="ellipse" />
                <MapMode mode="cycle" rotation="cycle" zoomFactor="3" />
                <MapMode mode="cycle" rotation="spawn" zoomFactor="4" />
                <MapMode mode="full" rotation="fixed" />
            </MapModes>
        </Map>

<!-- Player/gamestate infobox in the bottom-left corner -->
        <WidgetTemplate id="pinfobox">
            <Anchor x="-1" y="-1"/>
            <Align x="0" y ="-1" />
            <TextSize size=".06" />
        </WidgetTemplate>

        <WidgetTemplate id="alivetable">
            <DataSet id="friendlies">
                <AtomicData source="friends_alive" />
            </DataSet>
            <DataSet id="enemies">
                <AtomicData source="enemies_alive" />
            </DataSet>
            <DataSet id="good">
                <Math type="difference">
                    <LValue><AtomicData source="friends_alive" /></LValue>
                    <RValue><AtomicData source="enemies_alive" /></RValue>
                </Math>
                <AtomicData field="minimum" source="-1" />
                <AtomicData field="maximum" source="1" />
            </DataSet>
            <TextColor>
                <Gradient orientation="value" data="good">
                    <Color at="0" r="1" g=".3" b=".3" alpha="1"/>
                    <Color at=".5" r=".9" g=".9" b="1" alpha="1"/>
                    <Color at="1" r=".3" g="1" b=".3" alpha="1"/>
                </Gradient>
            </TextColor>
            <Face>
                <Table>
                    <Row>
                        <Cell halign="0">
                            <Text value="Alive" />
                        </Cell>
                    </Row>
                    <Row>
                        <Cell width="3" halign="-1">
                            <Text value="Enemies" />
                        </Cell>
                        <Cell width="1" halign="1">
                            <GameData data="enemies" />
                        </Cell>
                    </Row>
                    <Row>
                        <Cell>
                            <Text value="Friends" />
                        </Cell>
                        <Cell>
                            <GameData data="friendlies" />
                        </Cell>
                    </Row>
                </Table>
            </Face>
        </WidgetTemplate>

        <Label camera="^in" usetemplate="pinfobox alivetable">
            <Position x=".205" y=".205" />
            <Size height="0.2" width="0.25" />
        </Label>

        <WidgetTemplate id="scoretable">
            <DataSet id="score">
                <AtomicData source="current_score_team" />
            </DataSet>
            <DataSet id="topscore">
                <AtomicData source="top_other_score_team" />
            </DataSet>
            <DataSet id="good">
                <Math type="difference">
                    <LValue><AtomicData source="current_score_team" /></LValue>
                    <RValue><AtomicData source="top_other_score_team" /></RValue>
                </Math>
                <AtomicData field="minimum" source="-1" />
                <AtomicData field="maximum" source="1" />
            </DataSet>
            <TextColor>
                <Gradient orientation="value" data="good">
                    <Color at="0" r="1" g=".3" b=".3" alpha="1"/>
                    <Color at=".5" r=".9" g=".9" b="1" alpha="1"/>
                    <Color at="1" r=".3" g="1" b=".3" alpha="1"/>
                </Gradient>
            </TextColor>
            <Face>
                <Table>
                    <Row>
                        <Cell halign="0">
                            <Text value="Scores" />
                        </Cell>
                    </Row>
                    <Row>
                        <Cell width="1" halign="0">
                            <Text value="Me" />
                        </Cell>
                        <Cell width="1" halign="0">
                            <Text value="Top" />
                        </Cell>
                    </Row>
                    <Row>
                        <Cell>
                            <GameData data="score" />
                        </Cell>
                        <Cell>
                            <GameData data="topscore" />
                        </Cell>
                    </Row>
                </Table>
            </Face>
        </WidgetTemplate>

        <Label camera="^in" usetemplate="pinfobox scoretable">
            <Position x=".205" y=".005" />
            <Size height="0.2" width="0.395" />
        </Label>

<!-- optional general infobox above the map -->
        <WidgetTemplate id="generalinfo">
            <DataSet id="hours">
                <AtomicData source="current_hours" minwidth="2" fill="0" />
            </DataSet>
            <DataSet id="minutes">
                <AtomicData source="current_minutes" minwidth="2" fill="0" />
            </DataSet>
            <DataSet id="fps">
                <AtomicData source="current_framerate" />
            </DataSet>
            <DataSet id="seconds">
                <AtomicData source="time_since_start" />
            </DataSet>
            <DataSet id="ping">
                <AtomicData source="current_ping" />
            </DataSet>
            <DataSet id="perf">
                <!-- 2**((ping - 75)/175) + 6**((60 - fps)/60) -->
                <Math field="source" type="sum">
                    <LValue>
                        <Math type="power" lvalue="2">
                            <RValue>
                                <Math type="quotient" rvalue="75">
                                    <LValue>
                                        <Math type="difference" rvalue="75">
                                            <LValue><AtomicData source="current_ping" /></LValue>
                                        </Math>
                                    </LValue>
                                </Math>
                            </RValue>
                        </Math>
                    </LValue>
                    <RValue>
                        <Math type="power" lvalue="6">
                            <RValue>
                                <Math type="quotient" rvalue="60">
                                    <LValue>
                                        <Math type="difference" lvalue="60">
                                            <RValue><AtomicData source="current_framerate" /></RValue>
                                        </Math>
                                    </LValue>
                                </Math>
                            </RValue>
                        </Math>
                    </RValue>
                </Math>
                <AtomicData field="minimum" source="1" />
                <AtomicData field="maximum" source="5" />
            </DataSet>
            <Size height="0.125" width="0.3925" />
            <TextSize size="0.035" />
            <TextColor>
                <Gradient orientation="value" data="perf">
                    <Color at="0" r=".6" g="1" b=".6" alpha="1" />
                    <Color at=".5" r="1" g=".6" b=".3" alpha="1" />
                    <Color at=".8" r="1" g=".3" b=".3" alpha="1" />
                    <Color at="1" r="1" g=".0" b=".0" alpha="1" />
                </Gradient>
            </TextColor>
            <Face>
                <Table>
                    <Row>
                        <Cell width="3"><Text value="Time:" /></Cell>
                        <Cell width="1"><GameData data="hours" /><Text value=":" /><GameData data="minutes" /></Cell>
                    </Row>
                    <Row>
                        <Cell><Text value="Ping:" /></Cell>
                        <Cell><GameData data="ping" /><Text value=" ms" /></Cell>
                    </Row>
                    <Row>
                        <Cell><Text value="Framerate:" /></Cell>
                        <Cell><GameData data="fps" /><Text value=" FPS" /></Cell>
                    </Row>
                    <Row>
                        <Cell><Text value="Running for:" /></Cell>
                        <Cell><GameData data="seconds" /><Text value=" s" /></Cell>
                    </Row>
                </Table>
            </Face>
        </WidgetTemplate>
        <Label usetemplate="generalinfo" camera="^in" toggle="2" toggleDefault="off">
            <Anchor x="1" y="-1" />
            <Position x="-.005" y="0.405" />
            <Align x="1" y="-1" />
        </Label>

<!-- incam cockpit follows -->

<!-- HUD Map -->
        <Map camera="in">
            <Anchor x="0" y="-1" minadjust=".3" maxadjust=".75"/>
            <Position x="0" y="0.02" />
            <Align x="0" y="-1" />
            <Size height="0.66" width="0.66" />
            <Background>
                <Solid>
                    <Color r="1." g="1." b="1." alpha=".2" />
                </Solid>
            </Background>
        </Map>

<!-- mirror-like camviews on either side -->
        <WidgetTemplate id="incammirror">
            <Anchor x="0" y="-1" minadjust=".3" maxadjust=".75" />
            <Size height="0.4" width="0.8" />
            <Mirror value="true" />
        </WidgetTemplate>

        <Camview camera="in" usetemplate="incammirror" view="in">
            <Position x="-0.4" y=".05" />
            <Align x="1" y="-1" />
            <Translation x="0.5" y="0" z="0" />
            <Rotation value="150" />
        </Camview>

        <Camview camera="in" usetemplate="incammirror" view="in">
            <Position x="0.4" y=".05" />
            <Align x="-1" y="-1" />
            <Translation x="-0.5" y="0" z="0" />
            <Rotation value="210" />
        </Camview>

<!-- brake gauge above the map -->
        <BarGauge camera="in">
            <DataSet>
                <AtomicData field="source" source="player_speed" />
                <AtomicData field="minimum" source="0" />
                <AtomicData field="maximum" source="80" />
            </DataSet>
            <Anchor x="0" y="-1" minadjust=".3" maxadjust=".75" />
            <Position x="0" y=".69" />
            <Align x="0" y="-1" />
            <Size height="0.03" width="0.66" />
            <ShowCurrent>
                <Anchor x="1" y="1" />
                <Position x="0" y=".2" />
                <Align x="1" y="-1" />
                <TextSize size=".04" />
            </ShowCurrent>
            <ShowMinimum value="false" />
            <ShowMaximum value="false" />
            <Caption>
                <Text value="Speed" />
            </Caption>
            <CaptionStyle>
                <Anchor x="-1" y="1" />
                <Position x="0" y=".2" />
                <Align x="-1" y="-1" />
                <TextSize size=".04" />
            </CaptionStyle>
            <Background>
                <Solid>
                    <Color r="0.1" g="0.3" b="0.2" alpha="0.2" />
                </Solid>
            </Background>
            <Foreground>
                <Gradient orientation="horizontal">
                    <Color r="0.0" g="0.0" b="1.0" alpha="0.7" at="0.0" />
                    <Color r="1.0" g="0.0" b="0.0" alpha="0.7" at="1.0" />
                </Gradient>
            </Foreground>
            <LineColor>
                <Solid>
                    <Color r="1" g="1" b="1" alpha="0" />
                </Solid>
            </LineColor>
        </BarGauge>

<!-- rubber and brakes -->
        <BarGauge camera="in" usetemplate="bottomgauge rubbergauge">
            <Anchor x="0" y="-1" minadjust=".3" maxadjust=".75" />
            <Position x="-0.4" y="0.5" />
            <Align x="1" y="-1" />
        </BarGauge>

        <BarGauge camera="in" usetemplate="bottomgauge brakesgauge">
            <Anchor x="0" y="-1" minadjust=".3" maxadjust=".75" />
            <Position x="0.4" y="0.5" />
            <Align x="-1" y="-1" />
        </BarGauge>

<!-- alive players and scores -->
        <WidgetTemplate id="incamtable">
            <Anchor x="0" y="-1" minadjust=".3" maxadjust=".75" />
            <TextSize size=".06" />
        </WidgetTemplate>

        <Label camera="in" usetemplate="incamtable alivetable">
            <Position x="-.9" y="0.5" />
            <Align x="0" y="-1" />
            <Size width=".2" height=".15" />
        </Label>

        <Label camera="in" usetemplate="incamtable scoretable">
            <Position x=".9" y="0.5" />
            <Align x="0" y="-1" />
            <Size width=".3" height=".15" />
        </Label>

<!-- optional general infobox above the map -->
        <Label usetemplate="generalinfo" camera="in" toggle="2" toggleDefault="off">
            <Anchor x="1" y="1" />
            <Position x="-.005" y="-.005" />
            <Align x="1" y="1" />

        </Label>

<!-- the end -->
    </Cockpit>
</Resource>