Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

ROEngine.ROHud


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281
01282
01283
01284
01285
01286
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428
01429
01430
01431
01432
01433
01434
01435
01436
01437
01438
01439
01440
01441
01442
01443
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462
01463
01464
01465
01466
01467
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478
01479
01480
01481
01482
01483
01484
01485
01486
01487
01488
01489
01490
01491
01492
01493
01494
01495
01496
01497
01498
01499
01500
01501
01502
01503
01504
01505
01506
01507
01508
01509
01510
01511
01512
01513
01514
01515
01516
01517
01518
01519
01520
01521
01522
01523
01524
01525
01526
01527
01528
01529
01530
01531
01532
01533
01534
01535
01536
01537
01538
01539
01540
01541
01542
01543
01544
01545
01546
01547
01548
01549
01550
01551
01552
01553
01554
01555
01556
01557
01558
01559
01560
01561
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572
01573
01574
01575
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596
01597
01598
01599
01600
01601
01602
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613
01614
01615
01616
01617
01618
01619
01620
01621
01622
01623
01624
01625
01626
01627
01628
01629
01630
01631
01632
01633
01634
01635
01636
01637
01638
01639
01640
01641
01642
01643
01644
01645
01646
01647
01648
01649
01650
01651
01652
01653
01654
01655
01656
01657
01658
01659
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672
01673
01674
01675
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687
01688
01689
01690
01691
01692
01693
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705
01706
01707
01708
01709
01710
01711
01712
01713
01714
01715
01716
01717
01718
01719
01720
01721
01722
01723
01724
01725
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744
01745
01746
01747
01748
01749
01750
01751
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01792
01793
01794
01795
01796
01797
01798
01799
01800
01801
01802
01803
01804
01805
01806
01807
01808
01809
01810
01811
01812
01813
01814
01815
01816
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826
01827
01828
01829
01830
01831
01832
01833
01834
01835
01836
01837
01838
01839
01840
01841
01842
01843
01844
01845
01846
01847
01848
01849
01850
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863
01864
01865
01866
01867
01868
01869
01870
01871
01872
01873
01874
01875
01876
01877
01878
01879
01880
01881
01882
01883
01884
01885
01886
01887
01888
01889
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905
01906
01907
01908
01909
01910
01911
01912
01913
01914
01915
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935
01936
01937
01938
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953
01954
01955
01956
01957
01958
01959
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969
01970
01971
01972
01973
01974
01975
01976
01977
01978
01979
01980
01981
01982
01983
01984
01985
01986
01987
01988
01989
01990
01991
01992
01993
01994
01995
01996
01997
01998
01999
02000
02001
02002
02003
02004
02005
02006
02007
02008
02009
02010
02011
02012
02013
02014
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034
02035
02036
02037
02038
02039
02040
02041
02042
02043
02044
02045
02046
02047
02048
02049
02050
02051
02052
02053
02054
02055
02056
02057
02058
02059
02060
02061
02062
02063
02064
02065
02066
02067
02068
02069
02070
02071
02072
02073
02074
02075
02076
02077
02078
02079
02080
02081
02082
02083
02084
02085
02086
02087
02088
02089
02090
02091
02092
02093
02094
02095
02096
02097
02098
02099
02100
02101
02102
02103
02104
02105
02106
02107
02108
02109
02110
02111
02112
02113
02114
02115
02116
02117
02118
02119
02120
02121
02122
02123
02124
02125
02126
02127
02128
02129
02130
02131
02132
02133
02134
02135
02136
02137
02138
02139
02140
02141
02142
02143
02144
02145
02146
02147
02148
02149
02150
02151
02152
02153
02154
02155
02156
02157
02158
02159
02160
02161
02162
02163
02164
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178
02179
02180
02181
02182
02183
02184
02185
02186
02187
02188
02189
02190
02191
02192
02193
02194
02195
02196
02197
02198
02199
02200
02201
02202
02203
02204
02205
02206
02207
02208
02209
02210
02211
02212
02213
02214
02215
02216
02217
02218
02219
02220
02221
02222
02223
02224
02225
02226
02227
02228
02229
02230
02231
02232
02233
02234
02235
02236
02237
02238
02239
02240
02241
02242
02243
02244
02245
02246
02247
02248
02249
02250
02251
02252
02253
02254
02255
02256
02257
02258
02259
02260
02261
02262
02263
02264
02265
02266
02267
02268
02269
02270
02271
02272
02273
02274
02275
02276
02277
02278
02279
02280
02281
02282
02283
02284
02285
02286
02287
02288
02289
02290
02291
02292
02293
02294
02295
02296
02297
02298
02299
02300
02301
02302
02303
02304
02305
02306
02307
02308
02309
02310
02311
02312
02313
02314
02315
02316
02317
02318
02319
02320
02321
02322
02323
02324
02325
02326
02327
02328
02329
02330
02331
02332
02333
02334
02335
02336
02337
02338
02339
02340
02341
02342
02343
02344
02345
02346
02347
02348
02349
02350
02351
02352
02353
02354
02355
02356
02357
02358
02359
02360
02361
02362
02363
02364
02365
02366
02367
02368
02369
02370
02371
02372
02373
02374
02375
02376
02377
02378
02379
02380
02381
02382
02383
02384
02385
02386
02387
02388
02389
02390
02391
02392
02393
02394
02395
02396
02397
02398
02399
02400
02401
02402
02403
02404
02405
02406
02407
02408
02409
02410
02411
02412
02413
02414
02415
02416
02417
02418
02419
02420
02421
02422
02423
02424
02425
02426
02427
02428
02429
02430
02431
02432
02433
02434
02435
02436
02437
02438
02439
02440
02441
02442
02443
02444
02445
02446
02447
02448
02449
02450
02451
02452
02453
02454
02455
02456
02457
02458
02459
02460
02461
02462
02463
02464
02465
02466
02467
02468
02469
02470
02471
02472
02473
02474
02475
02476
02477
02478
02479
02480
02481
02482
02483
02484
02485
02486
02487
02488
02489
02490
02491
02492
02493
02494
02495
02496
02497
02498
02499
02500
02501
02502
02503
02504
02505
02506
02507
02508
02509
02510
02511
02512
02513
02514
02515
02516
02517
02518
02519
02520
02521
02522
02523
02524
02525
02526
02527
02528
02529
02530
02531
02532
02533
02534
02535
02536
02537
02538
02539
02540
02541
02542
02543
02544
02545
02546
02547
02548
02549
02550
02551
02552
02553
02554
02555
02556
02557
02558
02559
02560
02561
02562
02563
02564
02565
02566
02567
02568
02569
02570
02571
02572
02573
02574
02575
02576
02577
02578
02579
02580
02581
02582
02583
02584
02585
02586
02587
02588
02589
02590
02591
02592
02593
02594
02595
02596
02597
02598
02599
02600
02601
02602
02603
02604
02605
02606
02607
02608
02609
02610
02611
02612
02613
02614
02615
02616
02617
02618
02619
02620
02621
02622
02623
02624
02625
02626
02627
02628
02629
02630
02631
02632
02633
02634
02635
02636
02637
02638
02639
02640
02641
02642
02643
02644
02645
02646
02647
02648
02649
02650
02651
02652
02653
02654
02655
02656
02657
02658
02659
02660
02661
02662
02663
02664
02665
02666
02667
02668
02669
02670
02671
02672
02673
02674
02675
02676
02677
02678
02679
02680
02681
02682
02683
02684
02685
02686
02687
02688
02689
02690
02691
02692
02693
02694
02695
02696
02697
02698
02699
02700
02701
02702
02703
02704
02705
02706
02707
02708
02709
02710
02711
02712
02713
02714
02715
02716
02717
02718
02719
02720
02721
02722
02723
02724
02725
02726
02727
02728
02729
02730
02731
02732
02733
02734
02735
02736
02737
02738
02739
02740
02741
02742
02743
02744
02745
02746
02747
02748
02749
02750
02751
02752
02753
02754
02755
02756
02757
02758
02759
02760
02761
02762
02763
02764
02765
02766
02767
02768
02769
02770
02771
02772
02773
02774
02775
02776
02777
02778
02779
02780
02781
02782
02783
02784
02785
02786
02787
02788
02789
02790
02791
02792
02793
02794
02795
02796
02797
02798
02799
02800
02801
02802
02803
02804
02805
02806
02807
02808
02809
02810
02811
02812
02813
02814
02815
02816
02817
02818
02819
02820
02821
02822
02823
02824
02825
02826
02827
02828
02829
02830
02831
02832
02833
02834
02835
02836
02837
02838
02839
02840
02841
02842
02843
02844
02845
02846
02847
02848
02849
02850
02851
02852
02853
02854
02855
02856
02857
02858
02859
02860
02861
02862
02863
02864
02865
02866
02867
02868
02869
02870
02871
02872
02873
02874
02875
02876
02877
02878
02879
02880
02881
02882
02883
02884
02885
02886
02887
02888
02889
02890
02891
02892
02893
02894
02895
02896
02897
02898
02899
02900
02901
02902
02903
02904
02905
02906
02907
02908
02909
02910
02911
02912
02913
02914
02915
02916
02917
02918
02919
02920
02921
02922
02923
02924
02925
02926
02927
02928
02929
02930
02931
02932
02933
02934
02935
02936
02937
02938
02939
02940
02941
02942
02943
02944
02945
02946
02947
02948
02949
02950
02951
02952
02953
02954
02955
02956
02957
02958
02959
02960
02961
02962
02963
02964
02965
02966
02967
02968
02969
02970
02971
02972
02973
02974
02975
02976
02977
02978
02979
02980
02981
02982
02983
02984
02985
02986
02987
02988
02989
02990
02991
02992
02993
02994
02995
02996
02997
02998
02999
03000
03001
03002
03003
03004
03005
03006
03007
03008
03009
03010
03011
03012
03013
03014
03015
03016
03017
03018
03019
03020
03021
03022
03023
03024
03025
03026
03027
03028
03029
03030
03031
03032
03033
03034
03035
03036
03037
03038
03039
03040
03041
03042
03043
03044
03045
03046
03047
03048
03049
03050
03051
03052
03053
03054
03055
03056
03057
03058
03059
03060
03061
03062
03063
03064
03065
03066
03067
03068
03069
03070
03071
03072
03073
03074
03075
03076
03077
03078
03079
03080
03081
03082
03083
03084
03085
03086
03087
03088
03089
03090
03091
03092
03093
03094
03095
03096
03097
03098
03099
03100
03101
03102
03103
03104
03105
03106
03107
03108
03109
03110
03111
03112
03113
03114
03115
03116
03117
03118
03119
03120
03121
03122
03123
03124
03125
03126
03127
03128
03129
03130
03131
03132
03133
03134
03135
03136
03137
03138
03139
03140
03141
03142
03143
03144
03145
03146
03147
03148
03149
03150
03151
03152
03153
03154
03155
03156
03157
03158
03159
03160
03161
03162
03163
03164
03165
03166
03167
03168
03169
03170
03171
03172
03173
03174
03175
03176
03177
03178
03179
03180
03181
03182
03183
03184
03185
03186
03187
03188
03189
03190
03191
03192
03193
03194
03195
03196
03197
03198
03199
03200
03201
03202
03203
03204
03205
03206
03207
03208
03209
03210
03211
03212
03213
03214
03215
03216
03217
03218
03219
03220
03221
03222
03223
03224
03225
03226
03227
03228
03229
03230
03231
03232
03233
03234
03235
03236
03237
03238
03239
03240
03241
03242
03243
03244
03245
03246
03247
03248
03249
03250
03251
03252
03253
03254
03255
03256
03257
03258
03259
03260
03261
03262
03263
03264
03265
03266
03267
03268
03269
03270
03271
03272
03273
03274
03275
03276
03277
03278
03279
03280
03281
03282
03283
03284
03285
03286
03287
03288
03289
03290
03291
03292
03293
03294
03295
03296
03297
03298
03299
03300
03301
03302
03303
03304
03305
03306
03307
03308
03309
03310
03311
03312
03313
03314
03315
03316
03317
03318
03319
03320
03321
03322
03323
03324
03325
03326
03327
03328
03329
03330
03331
03332
03333
03334
03335
03336
03337
03338
03339
03340
03341
03342
03343
03344
03345
03346
03347
03348
03349
03350
03351
03352
03353
03354
03355
03356
03357
03358
03359
03360
03361
03362
03363
03364
03365
03366
03367
03368
03369
03370
03371
03372
03373
03374
03375
03376
03377
03378
03379
03380
03381
03382
03383
03384
03385
03386
03387
03388
03389
03390
03391
03392
03393
03394
03395
03396
03397
03398
03399
03400
03401
03402
03403
03404
03405
03406
03407
03408
03409
03410
03411
03412
03413
03414
03415
03416
03417
03418
03419
03420
03421
03422
03423
03424
03425
03426
03427
03428
03429
03430
03431
03432
03433
03434
03435
03436
03437
03438
03439
03440
03441
03442
03443
03444
03445
03446
03447
03448
03449
03450
03451
03452
03453
03454
03455
03456
03457
03458
03459
03460
03461
03462
03463
03464
03465
03466
03467
03468
03469
03470
03471
03472
03473
03474
03475
03476
03477
03478
03479
03480
03481
03482
03483
03484
03485
03486
03487
03488
03489
03490
03491
03492
03493
03494
03495
03496
03497
03498
03499
03500
03501
03502
03503
03504
03505
03506
03507
03508
03509
03510
03511
03512
03513
03514
03515
03516
03517
03518
03519
03520
03521
03522
03523
03524
03525
03526
03527
03528
03529
03530
03531
03532
03533
03534
03535
03536
03537
03538
03539
03540
03541
03542
03543
03544
03545
03546
03547
03548
03549
03550
03551
03552
03553
03554
03555
03556
03557
03558
03559
03560
03561
03562
03563
03564
03565
03566
03567
03568
03569
03570
03571
03572
03573
03574
03575
03576
03577
03578
03579
03580
03581
03582
03583
03584
03585
03586
03587
03588
03589
03590
03591
03592
03593
03594
03595
03596
03597
03598
03599
03600
03601
03602
03603
03604
03605
03606
03607
03608
03609
03610
03611
03612
03613
03614
03615
03616
03617
03618
03619
03620
03621
03622
03623
03624
03625
03626
03627
03628
03629
03630
03631
03632
03633
03634
03635
03636
03637
03638
03639
03640
03641
03642
03643
03644
03645
03646
03647
03648
03649
03650
03651
03652
03653
03654
03655
03656
03657
03658
03659
03660
03661
03662
03663
03664
03665
03666
03667
03668
03669
03670
03671
03672
03673
03674
03675
03676
03677
03678
03679
03680
03681
03682
03683
03684
03685
03686
03687
03688
03689
03690
03691
03692
03693
03694
03695
03696
03697
03698
03699
03700
03701
03702
03703
03704
03705
03706
03707
03708
03709
03710
03711
03712
03713
03714
03715
03716
03717
03718
03719
03720
03721
03722
03723
03724
03725
03726
03727
03728
03729
03730
03731
03732
03733
03734
03735
03736
03737
03738
03739
03740
03741
03742
03743
03744
03745
03746
03747
03748
03749
03750
03751
03752
03753
03754
03755
03756
03757
03758
03759
03760
03761
03762
03763
03764
03765
03766
03767
03768
03769
03770
03771
03772
03773
03774
03775
03776
03777
03778
03779
03780
03781
03782
03783
03784
03785
03786
03787
03788
03789
03790
03791
03792
03793
03794
03795
03796
03797
03798
03799
03800
03801
03802
03803
03804
03805
03806
03807
03808
03809
03810
03811
03812
03813
03814
03815
03816
03817
03818
03819
03820
03821
03822
03823
03824
03825
03826
03827
03828
03829
03830
03831
03832
03833
03834
03835
03836
03837
03838
03839
03840
03841
03842
03843
03844
03845
03846
03847
03848
03849
03850
03851
03852
03853
03854
03855
03856
03857
03858
03859
03860
03861
03862
03863
03864
03865
03866
03867
03868
03869
03870
03871
03872
03873
03874
03875
03876
03877
03878
03879
03880
03881
03882
03883
03884
03885
03886
03887
03888
03889
03890
03891
03892
03893
03894
03895
03896
03897
03898
03899
03900
03901
03902
03903
03904
03905
03906
03907
03908
03909
03910
03911
03912
03913
03914
03915
03916
03917
03918
03919
03920
03921
03922
03923
03924
03925
03926
03927
03928
03929
03930
03931
03932
03933
03934
03935
03936
03937
03938
03939
03940
03941
03942
03943
03944
03945
03946
03947
03948
03949
03950
03951
03952
03953
03954
03955
03956
03957
03958
03959
03960
03961
03962
03963
03964
03965
03966
03967
03968
03969
03970
03971
03972
03973
03974
03975
03976
03977
03978
03979
03980
03981
03982
03983
03984
03985
03986
03987
03988
03989
03990
03991
03992
03993
03994
03995
03996
03997
03998
03999
04000
04001
04002
04003
04004
04005
04006
04007
04008
04009
04010
04011
04012
04013
04014
04015
04016
04017
04018
04019
04020
04021
04022
04023
04024
04025
04026
04027
04028
04029
04030
04031
04032
04033
04034
04035
04036
04037
04038
04039
04040
04041
04042
04043
04044
04045
04046
04047
04048
04049
04050
04051
04052
04053
04054
04055
04056
04057
04058
04059
04060
04061
04062
04063
04064
04065
04066
04067
04068
04069
04070
04071
04072
04073
04074
04075
04076
04077
04078
04079
04080
04081
04082
04083
04084
04085
04086
04087
04088
04089
04090
04091
04092
04093
04094
04095
04096
04097
04098
04099
04100
04101
04102
04103
04104
04105
04106
04107
04108
04109
04110
04111
04112
04113
04114
04115
04116
04117
04118
04119
04120
04121
04122
04123
04124
04125
04126
04127
04128
04129
04130
04131
04132
04133
04134
04135
04136
04137
04138
04139
04140
04141
04142
04143
04144
04145
04146
04147
04148
04149
04150
04151
04152
04153
04154
04155
04156
04157
04158
04159
04160
04161
04162
04163
04164
04165
04166
04167
04168
04169
04170
04171
04172
04173
04174
04175
04176
04177
04178
04179
04180
04181
04182
04183
04184
04185
04186
04187
04188
04189
04190
04191
04192
04193
04194
04195
04196
04197
04198
04199
04200
04201
04202
04203
04204
04205
04206
04207
04208
04209
04210
04211
04212
04213
04214
04215
04216
04217
04218
04219
04220
04221
04222
04223
04224
04225
04226
04227
04228
04229
04230
04231
04232
04233
04234
04235
04236
04237
04238
04239
04240
04241
04242
04243
04244
04245
04246
04247
04248
04249
04250
04251
04252
04253
04254
04255
04256
04257
04258
04259
04260
04261
04262
04263
04264
04265
04266
04267
04268
04269
04270
04271
04272
04273
04274
04275
04276
04277
04278
04279
04280
04281
04282
04283
04284
04285
04286
04287
04288
04289
04290
04291
04292
04293
04294
04295
04296
04297
04298
04299
04300
04301
04302
04303
04304
04305
04306
04307
04308
04309
04310
04311
04312
04313
04314
04315
04316
04317
04318
04319
04320
04321
04322
04323
04324
04325
04326
04327
04328
04329
04330
04331
04332
04333
04334
04335
04336
04337
04338
04339
04340
04341
04342
04343
04344
04345
04346
04347
04348
04349
04350
04351
04352
04353
04354
04355
04356
04357
04358
04359
04360
04361
04362
04363
04364
04365
04366
04367
04368
04369
04370
04371
04372
04373
04374
04375
04376
04377
04378
04379
04380
04381
04382
04383
04384
04385
04386
04387
04388
04389
04390
04391
04392
04393
04394
04395
04396
04397
04398
04399
04400
04401
04402
04403
04404
04405
04406
04407
04408
04409
04410
04411
04412
04413
04414
04415
04416
04417
04418
04419
04420
04421
04422
04423
04424
04425
04426
04427
04428
04429
04430
04431
04432
04433
04434
04435
04436
04437
04438
04439
04440
04441
04442
04443
04444
04445
04446
04447
04448
04449
04450
04451
04452
04453
04454
04455
04456
04457
04458
04459
04460
04461
04462
04463
04464
04465
04466
04467
04468
04469
04470
04471
04472
04473
04474
04475
04476
04477
04478
04479
04480
04481
04482
04483
04484
04485
04486
04487
04488
04489
04490
04491
04492
04493
04494
04495
04496
04497
04498
04499
04500
04501
04502
04503
04504
04505
04506
04507
04508
04509
04510
04511
04512
04513
04514
04515
04516
04517
04518
04519
04520
04521
04522
04523
04524
04525
04526
04527
04528
04529
04530
04531
04532
04533
04534
04535
04536
04537
04538
04539
04540
04541
04542
04543
04544
04545
04546
04547
04548
04549
04550
04551
04552
04553
04554
04555
04556
04557
04558
04559
04560
04561
04562
04563
04564
04565
04566
04567
04568
04569
04570
04571
04572
04573
04574
04575
04576
04577
04578
04579
04580
04581
04582
04583
04584
04585
04586
04587
04588
04589
04590
04591
04592
04593
04594
04595
04596
04597
04598
04599
04600
04601
04602
04603
04604
04605
04606
04607
04608
04609
04610
04611
04612
04613
04614
04615
04616
04617
04618
04619
04620
04621
04622
04623
04624
04625
04626
04627
04628
04629
04630
04631
04632
04633
04634
04635
04636
04637
04638
04639
04640
04641
04642
04643
04644
04645
04646
04647
04648
04649
04650
04651
04652
04653
04654
04655
04656
04657
04658
04659
04660
04661
04662
04663
04664
04665
04666
04667
04668
04669
04670
04671
04672
04673
04674
04675
04676
04677
04678
04679
04680
04681
04682
04683
04684
04685
04686
04687
04688
04689
04690
04691
04692
04693
04694
04695
04696
04697
04698
04699
04700
04701
04702
04703
04704
04705
04706
04707
04708
04709
04710
04711
04712
04713
04714
04715
04716
04717
04718
04719
04720
04721
04722
04723
04724
04725
04726
04727
04728
04729
04730
04731
04732
04733
04734
04735
04736
04737
04738
04739
04740
04741
04742
04743
04744
04745
04746
04747
04748
04749
04750
04751
04752
04753
04754
04755
04756
04757
04758
04759
04760
04761
04762
04763
04764
04765
04766
04767
04768
04769
04770
04771
04772
04773
04774
04775
04776
04777
04778
04779
04780
04781
04782
04783
04784
04785
04786
04787
04788
04789
04790
04791
04792
04793
04794
04795
04796
04797
04798
04799
04800
04801
04802
04803
04804
04805
04806
04807
04808
04809
04810
04811
04812
04813
04814
04815
04816
04817
04818
04819
04820
04821
04822
04823
04824
04825
04826
04827
04828
04829
04830
04831
04832
04833
04834
04835
04836
04837
04838
04839
04840
04841
04842
04843
04844
04845
04846
04847
04848
04849
04850
04851
04852
04853
04854
04855
04856
04857
04858
04859
04860
04861
04862
04863
04864
04865
04866
04867
04868
04869
04870
04871
04872
04873
04874
04875
04876
04877
04878
04879
04880
04881
04882
04883
04884
04885
04886
04887
04888
04889
04890
04891
04892
04893
04894
04895
04896
04897
04898
04899
04900
04901
04902
04903
04904
04905
04906
04907
04908
04909
04910
04911
04912
04913
04914
04915
04916
04917
04918
04919
04920
04921
04922
04923
04924
04925
04926
04927
04928
04929
04930
04931
04932
04933
04934
04935
04936
04937
04938
04939
04940
04941
04942
04943
04944
04945
04946
04947
04948
04949
04950
04951
04952
04953
04954
04955
04956
04957
04958
04959
04960
04961
04962
04963
04964
04965
04966
04967
04968
04969
04970
04971
04972
04973
04974
04975
04976
04977
04978
04979
04980
04981
04982
04983
04984
04985
04986
04987
04988
04989
04990
04991
04992
04993
04994
04995
04996
04997
04998
04999
05000
05001
05002
05003
05004
05005
05006
05007
05008
05009
05010
05011
05012
05013
05014
05015
05016
05017
05018
05019
05020
05021
05022
05023
05024
05025
05026
05027
05028
05029
05030
05031
05032
05033
05034
05035
05036
05037
05038
05039
05040
05041
05042
05043
05044
05045
05046
05047
05048
05049
05050
05051
05052
05053
05054
05055
05056
05057
05058
05059
05060
05061
05062
05063
05064
05065
05066
05067
05068
05069
05070
05071
05072
05073
05074
05075
05076
05077
05078
05079
05080
05081
05082
05083
05084
05085
05086
05087
05088
05089
05090
05091
05092
05093
05094
05095
05096
05097
05098
05099
05100
05101
05102
05103
05104
05105
05106
05107
05108
05109
05110
05111
05112
05113
05114
05115
05116
05117
05118
05119
05120
05121
05122
05123
05124
05125
05126
05127
05128
05129
05130
05131
05132
05133
05134
05135
05136
05137
05138
05139
05140
05141
05142
05143
05144
05145
05146
05147
05148
05149
05150
05151
05152
05153
05154
05155
05156
05157
05158
05159
05160
05161
05162
05163
05164
05165
05166
05167
05168
05169
05170
05171
05172
05173
05174
05175
05176
05177
05178
05179
05180
05181
05182
05183
05184
05185
05186
05187
05188
05189
05190
05191
05192
05193
05194
05195
05196
05197
05198
05199
05200
05201
05202
05203
05204
05205
05206
05207
05208
05209
05210
05211
05212
05213
05214
05215
05216
05217
05218
05219
05220
05221
05222
05223
05224
05225
05226
05227
05228
05229
05230
05231
05232
05233
05234
05235
05236
05237
05238
05239
05240
05241
05242
05243
05244
05245
05246
05247
05248
05249
05250
05251
05252
05253
05254
05255
05256
05257
05258
05259
05260
05261
05262
05263
05264
05265
05266
05267
05268
05269
05270
05271
05272
05273
05274
05275
05276
05277
05278
05279
05280
05281
05282
05283
05284
05285
05286
05287
05288
05289
05290
05291
05292
05293
05294
05295
05296
05297
05298
05299
05300
05301
05302
05303
05304
05305
05306
05307
05308
05309
05310
05311
05312
05313
05314
05315
05316
05317
05318
05319
05320
05321
05322
05323
05324
05325
05326
05327
05328
05329
05330
05331
05332
05333
05334
05335
05336
05337
05338
05339
05340
05341
05342
05343
05344
05345
05346
05347
05348
05349
05350
05351
05352
05353
05354
05355
05356
05357
05358
05359
05360
05361
05362
05363
05364
05365
05366
05367
05368
05369
05370
05371
05372
05373
05374
05375
05376
05377
05378
05379
05380
05381
05382
05383
05384
05385
05386
05387
05388
05389
05390
05391
05392
05393
05394
05395
05396
05397
05398
05399
05400
05401
05402
05403
05404
05405
05406
05407
05408
05409
05410
05411
05412
05413
05414
05415
05416
05417
05418
05419
05420
05421
05422
05423
05424
05425
05426
05427
05428
05429
05430
05431
05432
05433
05434
05435
05436
05437
05438
05439
05440
05441
05442
05443
05444
05445
05446
05447
05448
05449
05450
05451
05452
05453
05454
05455
05456
05457
05458
05459
05460
05461
05462
05463
05464
05465
05466
05467
05468
05469
05470
05471
05472
05473
05474
05475
05476
05477
05478
05479
05480
05481
05482
05483
05484
05485
05486
05487
05488
05489
05490
05491
05492
05493
05494
05495
05496
05497
05498
05499
05500
05501
05502
05503
05504
05505
05506
05507
05508
05509
05510
05511
05512
05513
05514
05515
05516
05517
05518
05519
05520
05521
05522
05523
05524
05525
05526
05527
05528
05529
05530
05531
05532
05533
05534
05535
05536
05537
05538
05539
05540
05541
05542
05543
05544
05545
05546
05547
05548
05549
05550
05551
05552
05553
05554
05555
05556
05557
05558
05559
05560
05561
05562
05563
05564
05565
05566
05567
05568
05569
05570
05571
05572
05573
05574
05575
05576
05577
05578
05579
05580
05581
05582
05583
05584
05585
05586
05587
05588
05589
05590
05591
05592
05593
05594
05595
05596
05597
05598
05599
05600
05601
05602
05603
05604
05605
05606
05607
05608
05609
05610
05611
05612
05613
05614
05615
05616
05617
05618
05619
05620
05621
05622
05623
05624
05625
05626
05627
05628
05629
05630
05631
05632
05633
05634
05635
05636
05637
05638
05639
05640
05641
05642
05643
05644
05645
05646
05647
05648
05649
05650
05651
05652
05653
05654
05655
05656
05657
05658
05659
05660
05661
05662
05663
05664
05665
05666
05667
05668
05669
05670
05671
05672
05673
05674
05675
05676
05677
05678
05679
05680
05681
05682
05683
05684
05685
05686
05687
05688
05689
05690
05691
05692
05693
05694
05695
05696
05697
05698
05699
05700
05701
05702
05703
05704
05705
05706
05707
05708
05709
05710
05711
05712
05713
05714
05715
05716
05717
05718
05719
05720
05721
05722
05723
05724
05725
05726
05727
05728
05729
05730
05731
05732
05733
05734
05735
05736
05737
05738
05739
05740
05741
05742
05743
05744
05745
05746
05747
05748
05749
05750
05751
05752
05753
05754
05755
05756
05757
05758
05759
05760
05761
05762
05763
05764
05765
05766
05767
05768
05769
05770
05771
05772
05773
05774
05775
05776
05777
05778
05779
05780
05781
05782
05783
05784
05785
05786
05787
05788
05789
05790
05791
05792
05793
05794
05795
05796
05797
05798
05799
05800
05801
05802
05803
05804
05805
05806
05807
05808
05809
05810
05811
05812
05813
05814
05815
05816
05817
05818
05819
05820
05821
05822
05823
05824
05825
05826
05827
05828
05829
05830
05831
05832
05833
05834
05835
05836
05837
05838
05839
05840
05841
05842
05843
05844
05845
05846
05847
05848
05849
05850
05851
05852
05853
05854
05855
05856
05857
05858
05859
05860
05861
05862
05863
05864
05865
05866
05867
05868
05869
05870
05871
05872
05873
05874
05875
05876
05877
05878
05879
05880
05881
05882
05883
05884
05885
05886
05887
05888
05889
05890
05891
05892
05893
05894
05895
05896
05897
05898
05899
05900
05901
05902
05903
05904
05905
05906
05907
05908
05909
05910
05911
05912
05913
05914
05915
05916
05917
05918
05919
05920
05921
05922
05923
05924
05925
05926
05927
05928
05929
05930
05931
05932
05933
05934
05935
05936
05937
05938
05939
05940
05941
05942
05943
05944
05945
05946
05947
05948
05949
05950
05951
05952
05953
05954
05955
05956
05957
05958
05959
05960
05961
05962
05963
05964
05965
05966
05967
05968
05969
05970
05971
05972
05973
05974
05975
05976
05977
05978
05979
05980
05981
05982
05983
05984
05985
05986
05987
05988
05989
05990
05991
05992
05993
05994
05995
05996
05997
05998
05999
06000
06001
06002
06003
06004
06005
06006
06007
06008
06009
06010
06011
06012
06013
06014
06015
06016
06017
06018
06019
06020
06021
06022
06023
06024
06025
06026
06027
06028
06029
06030
06031
06032
06033
06034
06035
06036
06037
06038
06039
06040
06041
06042
06043
06044
06045
06046
06047
06048
06049
06050
06051
06052
06053
06054
06055
06056
06057
06058
06059
06060
06061
06062
06063
06064
06065
06066
06067
06068
06069
06070
06071
06072
06073
06074
06075
06076
06077
06078
06079
06080
06081
06082
06083
06084
06085
06086
06087
06088
06089
06090
06091
06092
06093
06094
06095
06096
06097
06098
06099
06100
06101
06102
06103
06104
06105
06106
06107
06108
06109
06110
06111
06112
06113
06114
06115
06116
06117
06118
06119
06120
06121
06122
06123
06124
06125
06126
06127
06128
06129
06130
06131
06132
06133
06134
06135
06136
06137
06138
06139
06140
06141
06142
06143
06144
06145
06146
06147
06148
06149
06150
06151
06152
06153
06154
06155
06156
06157
06158
06159
06160
06161
06162
06163
06164
06165
06166
06167
06168
06169
06170
06171
06172
06173
06174
06175
06176
06177
06178
06179
06180
06181
06182
06183
06184
06185
06186
06187
06188
06189
06190
06191
06192
06193
06194
06195
06196
06197
06198
06199
06200
06201
06202
06203
06204
06205
06206
06207
06208
06209
06210
06211
06212
06213
06214
06215
06216
06217
06218
06219
06220
06221
06222
06223
06224
06225
06226
06227
06228
06229
06230
06231
06232
06233
06234
06235
06236
06237
06238
06239
06240
06241
06242
06243
06244
06245
06246
06247
06248
06249
06250
06251
06252
06253
06254
06255
06256
06257
06258
06259
06260
06261
06262
06263
06264
06265
06266
06267
06268
06269
06270
06271
06272
06273
06274
06275
06276
06277
06278
06279
06280
06281
06282
06283
06284
06285
06286
06287
06288
06289
06290
06291
06292
06293
06294
06295
06296
06297
06298
06299
06300
06301
06302
06303
06304
06305
06306
06307
06308
06309
06310
06311
06312
06313
06314
06315
06316
06317
06318
06319
06320
06321
06322
06323
06324
06325
06326
06327
06328
06329
06330
06331
06332
06333
06334
06335
06336
06337
06338
06339
06340
06341
06342
06343
06344
06345
06346
06347
06348
06349
06350
06351
06352
06353
06354
06355
06356
06357
06358
06359
06360
06361
06362
06363
06364
06365
06366
06367
06368
06369
06370
06371
06372
06373
06374
06375
06376
06377
06378
06379
06380
06381
06382
06383
06384
06385
06386
06387
06388
06389
06390
06391
06392
06393
06394
06395
06396
06397
06398
06399
06400
06401
06402
06403
06404
06405
06406
06407
06408
06409
06410
06411
06412
06413
06414
06415
06416
06417
06418
06419
06420
06421
06422
06423
06424
06425
06426
06427
06428
06429
06430
06431
06432
06433
06434
06435
06436
06437
06438
06439
06440
06441
06442
06443
06444
06445
06446
06447
06448
06449
06450
06451
06452
06453
06454
06455
06456
06457
06458
06459
06460
06461
06462
06463
06464
06465
06466
06467
06468
06469
06470
06471
06472
06473
06474
06475
06476
06477
06478
06479
06480
06481
06482
06483
06484
06485
06486
06487
06488
06489
06490
06491
06492
06493
06494
06495
06496
06497
06498
06499
06500
06501
06502
06503
06504
06505
06506
06507
06508
06509
06510
06511
06512
06513
06514
06515
06516
06517
06518
06519
06520
06521
06522
06523
06524
06525
06526
06527
06528
06529
06530
06531
06532
06533
06534
06535
06536
06537
06538
06539
06540
06541
06542
06543
06544
06545
06546
06547
06548
06549
06550
06551
06552
06553
06554
06555
06556
06557
06558
06559
06560
06561
06562
06563
06564
06565
06566
06567
06568
06569
06570
06571
06572
06573
06574
06575
06576
06577
06578
06579
06580
06581
06582
06583
06584
06585
06586
06587
06588
06589
06590
06591
06592
06593
06594
06595
06596
06597
06598
06599
06600
06601
06602
06603
06604
06605
06606
06607
06608
06609
06610
06611
06612
06613
06614
06615
06616
06617
06618
06619
06620
06621
06622
06623
06624
06625
06626
06627
06628
06629
06630
06631
06632
06633
06634
06635
06636
06637
06638
06639
06640
06641
06642
06643
06644
06645
06646
06647
06648
06649
06650
06651
06652
06653
06654
06655
06656
06657
06658
06659
06660
06661
06662
06663
06664
06665
06666
06667
06668
06669
06670
06671
06672
06673
06674
06675
06676
06677
06678
06679
06680
06681
06682
06683
06684
06685
06686
06687
06688
06689
06690
06691
06692
06693
06694
06695
06696
06697
06698
06699
06700
06701
06702
06703
06704
06705
06706
06707
06708
06709
06710
06711
06712
06713
06714
06715
06716
06717
06718
06719
06720
06721
06722
06723
06724
06725
06726
06727
06728
06729
06730
06731
06732
06733
06734
06735
06736
06737
06738
06739
06740
06741
06742
06743
06744
06745
06746
06747
06748
06749
06750
06751
06752
06753
06754
06755
06756
06757
06758
06759
06760
06761
06762
06763
06764
06765
06766
06767
06768
06769
06770
06771
06772
06773
06774
06775
06776
06777
06778
06779
06780
06781
06782
06783
06784
06785
06786
06787
06788
06789
06790
06791
06792
06793
06794
06795
06796
06797
06798
06799
06800
06801
06802
06803
06804
06805
06806
06807
06808
06809
06810
06811
06812
06813
06814
06815
06816
06817
06818
06819
06820
06821
06822
06823
06824
06825
06826
06827
06828
06829
06830
06831
06832
06833
06834
06835
06836
06837
06838
06839
06840
06841
06842
06843
06844
06845
06846
06847
06848
06849
06850
06851
06852
06853
06854
06855
06856
06857
06858
06859
06860
06861
06862
06863
06864
06865
06866
06867
06868
06869
06870
06871
06872
06873
06874
06875
06876
06877
06878
06879
06880
06881
06882
06883
06884
06885
06886
06887
06888
06889
06890
06891
06892
06893
06894
06895
06896
06897
06898
06899
06900
06901
06902
06903
06904
06905
06906
06907
06908
06909
06910
06911
06912
06913
06914
06915
06916
06917
06918
06919
06920
06921
06922
06923
06924
06925
06926
06927
//=============================================================================
// ROHud
//=============================================================================
// New HUD for Red Orchestra
//=============================================================================
// Red Orchestra Source
// Copyright (C) 2003-2004 Erik Christensen
//=============================================================================

class ROHud extends HudBase;

//=============================================================================
// Execs
//=============================================================================

//#exec OBJ LOAD FILE=ROInterfaceArt.utx
//#exec OBJ LOAD FILE=..\textures\InterfaceArt2_tex.utx

//=============================================================================
// Variables
//=============================================================================

var	rotator				NorthDirection;

// Config
var globalconfig bool           bShowCompass;
var globalconfig bool           bShowMapUpdatedText;

// Text
var		localized	string		ReinforcementText;
var		localized	string		TimeRemainingText;
var		localized	string		IPText;
var		localized	string		TimeText;
var		localized	string		ViewingText;
var		localized	string		NoReinforcementsText;
var		localized	string		TeamMessagePrefix;
var		localized	string		ObjectivesText;
var		localized	string		PlayersNeededText;
var		localized	string		SpectateInstructionText1;
var		localized	string		SpectateInstructionText2;
var		localized	string		SpectateInstructionText3;
var		localized	string		SpectateInstructionText4;
var		localized	string		NeedAmmoText;
var     localized   string      CanResupplyText;
var     localized   string      OpenMapText;
var     localized   string      SituationMapInstructionsText;
var                 string      SpacingText;

var     localized   string      MapCoordTextX[9], MapCoordTextY[9];

var     localized   string      LegendAxisObjectiveText;
var     localized   string      LegendAlliesObjectiveText;
var     localized   string      LegendNeutralObjectiveText;
var     localized   string      LegendArtilleryRadioText;
var     localized   string      LegendResupplyAreaText;
var     localized   string      LegendRallyPointText;
var     localized   string      LegendSavedArtilleryText;
var     localized   string      LegendOrderTargetText;
var     localized   string      LegendArtyStrikeText;
var     localized   string      LegendHelpRequestText;
var     localized   string      LegendDestroyableItemText;
var     localized   string      LegendDestroyedItemText;
var     localized   string      LegendMGResupplyText;
var     localized   string      LegendVehResupplyAreaText;
var     localized   string      LegendATGunText;


// Fonts
var		localized	string		SmallFontArrayNames[9];
var		Font					SmallFontArrayFonts[9];
var		localized	string		MenuFontArrayNames[5];
var		Font					MenuFontArrayFonts[5];
var     localized   string      CriticalMsgFontArrayNames[9];
var     Font                    CriticalMsgFontArrayFonts[9];

var		color					SideColors[2];

// General
var		DigitSet				Digits;					// Digit set for RO
var(ROHud) SpriteWidget         HealthFigure;			// Create widgets for all the HUD elements
var(ROHud) SpriteWidget         HealthFigureBackground;
var(ROHud) SpriteWidget         HealthFigureStamina;
var(ROHud) SpriteWidget         StanceIcon;
var(ROHud) NumericWidget        AmmoCount;
var(ROHud) SpriteWidget         AmmoIcon;
var(ROHud) SpriteWidget         AutoFireIcon;
var(ROHud) SpriteWidget         SemiFireIcon;
var(ROHud) SpriteWidget         MGDeployIcon;
var(ROHud) SpriteWidget         ResupplyZoneNormalPlayerIcon,
                                ResupplyZoneNormalVehicleIcon,
                                ResupplyZoneResupplyingPlayerIcon,
                                ResupplyZoneResupplyingVehicleIcon;
var(ROHud) SpriteWidget         WeaponCanRestIcon;
var(ROHud) SpriteWidget         WeaponRestingIcon;
var(ROHud) SpriteWidget         CompassBase;
var(ROHud) SpriteWidget         CompassNeedle;
var(ROHud) SpriteWidget         CompassIcons;

var     color                   WeaponReloadingColor;

var		Material				NationHealthFigures[2];	// FIXME: Need to move this over to RORoleInfo in some fashion.  It's hard-coded now. :/ - Erik
var		Material				NationHealthFiguresBackground[2];
var		Material				NationHealthFiguresStamina[2];
var		Material				NationHealthFiguresStaminaCritical[2];
//var		Material				NationClockBases[2];
//var		Material				NationClockHands[2];
var     Material                StanceStanding, StanceCrouch, StanceProne;
var     Material                PlayerArrowTexture;

var		bool					bShowObjectives;
/*var		Material				HeaderImage;
var		Material				NationIcons[2];
var		Material				NeutralIcon;
var		Material				ArtilleryIcon;    // The icon for a saved artillery strike location
var		Material				RallyPointIcon;    // The icon for a saved artillery strike location
var		Material				RadioIcon;        // The icon for a radio/phone station
var     Material                ResupplyIcon;
var     Material                HelpRequestIcon;
var     Material                MGResupplyRequestIcon;*/



var		Pawn					NamedPlayer;
var		float					NameTime;

// Debugging
var     bool                    bShowDebugInfoOnMap;
var     bool                    bShowRelevancyDebugOnMap;
var     bool                    bShowRelevancyDebugOverlay;

enum ENetDebugMode
{
	ND_PawnsOnly,		// Show debug info for pawns only (vehicles, players, etc)
	ND_VehiclesOnly,	// Show debug info for vehicles only
	ND_PlayersOnly,		// Show debug info for infantry players only
	ND_All,			    // Show Debug Info for all actors
	ND_AllWithText,     // Show Debug Info for all actors and their name
};

var ENetDebugMode	NetDebugMode;			// net debugging mode


struct TextWidget
{
	// Font must be set before calling DrawTextWidgetClipped()

	// String must left blank in default properties (for localization)
	var localized string text;

	var ERenderStyle RenderStyle;

	var EDrawPivot DrawPivot;
	var float PosX, PosY;
	var float WrapWidth, WrapHeight;
	var int OffsetX, OffsetY;

	var bool bDrawShadow;

	var color Tints[2];
};

// for drawing widgets on specific areas of the hud
struct AbsoluteCoordsInfo
{
	var float PosX, PosY;
	var float width, height;
};
struct RelativeCoordsInfo
{
	var float X, Y;   // 0-1 values
	var float XL, YL; // 0-1 values
};

// Death messages
struct Obituary
{
	var	string				KillerName;
	var	string				VictimName;
	var	Color				KillerColor;
	var	Color				VictimColor;
	var	class<DamageType>	DamageType;
	var	float				EndOfLife;
};

var		Obituary				Obituaries[4];
var		float					ObituaryLifeSpan;
var		int						ObituaryCount;

var		float					FadeTime;
var		color					FadeColor;
var     float                   WhiteFlashTime;

// for situation map icon
var(ROHud) SpriteWidget         MapUpdatedIcon;
var(ROHud) TextWidget           MapUpdatedText;
var     Material                MapIconsFlash, MapIconsFastFlash;
var     Material                MapIconsAltFlash, MapIconsAltFastFlash; // These are out of phase


// for situation map stuff
var     bool                        bShowMapUpdatedIcon;
var     float                       MapUpdatedIconTime;
var     float                       MaxMapUpdatedIconDisplayTime;
var     float                       MapLastRallyPointAssignTime;
var     sound                       AssignOKSound, AssignFailedSound;
var     bool                        bAnimateMapIn, bAnimateMapOut;
var     float                       AnimateMapCurrentPosition;
var     float                       AnimateMapSpeed;
var(ROHud)     bool                 bShowAllItemsInMapLegend;
var(ROHud)     SpriteWidget         MapBackground;
//var(ROHud)     SpriteWidget         MapLevelBounds; // Used to calculate where to draw level image
var(ROHud)     RelativeCoordsInfo   MapLegendImageCoords;
var(ROHud)     SpriteWidget         MapLevelImage; // Used to draw level image
var(ROHud)     TextWidget           MapTexts; // Used to render text on the level image
var(ROHud)     SpriteWidget         MapPlayerIcon; // Used to render player arrow on the level image
var(ROHud)     TextWidget           MapCoordTextXWidget, MapCoordTextYWidget;
var     int                         LegendItemsIndex;   // Holds current index of legend element (to figure where to draw)
var     float                       CurrentTime; // Contains remaining time for this round

// Used to render icons on the level image
var(ROHud)     SpriteWidget         MapIconTeam[2];
var(ROHud)     SpriteWidget         MapIconDispute[2];
var(ROHud)     SpriteWidget         MapIconNeutral;
var(ROHud)     SpriteWidget         MapIconRadio;
var(ROHud)     SpriteWidget         MapIconRally[2];
var(ROHud)     SpriteWidget         MapIconResupply;
var(ROHud)     SpriteWidget         MapIconVehicleResupply;
var(ROHud)     SpriteWidget         MapIconHelpRequest;
var(ROHud)     SpriteWidget         MapIconMGResupplyRequest[2];
var(ROHud)     SpriteWidget         MapIconAttackDefendRequest;
var(ROHud)     SpriteWidget         MapIconArtyStrike;
var(ROHud)     SpriteWidget         MapIconDestroyableItem;
var(ROHud)     SpriteWidget         MapIconDestroyedItem;
var(ROHud)     SpriteWidget         MapIconATGun;

var(ROHud)     TextWidget           MapTimerTitle;
var(ROHud)     TextWidget           MapTimerTexts[4];

var(ROHud)     RelativeCoordsInfo   MapLegendCoords;
var(ROHud)     SpriteWidget         MapLegend;
var(ROHud)     SpriteWidget         MapLegendIcons;
var(ROHud)     TextWidget           MapLegendTitle;
var(ROHud)     TextWidget           MapLegendTexts;

var(ROHud)     RelativeCoordsInfo   MapObjectivesCoords;
//var(ROHud)     SpriteWidget         MapObjectives;
var(ROHud)     TextWidget           MapObjectivesTitle;
var(ROHud)     TextWidget           MapRequiredObjectivesTitle;
var(ROHud)     TextWidget           MapSecondaryObjectivesTitle;
var(ROHud)     TextWidget           MapObjectivesTexts;

//var(ROHud)	   SpriteWidget			ClockBase;
//var(ROHud)	   SpriteWidget			ClockHand;


// Used for figuring where the player clicked on the situation map
var            AbsoluteCoordsInfo   MapLevelImageCoordinates;

// Player portraits
//var Material Portrait;
var             float               PortraitTime;
var             float               PortraitX;
var(ROHud)      SpriteWidget        PortraitIcon;
var(ROHud)      TextWidget          PortraitText[2];

var(ROHud) float MapScale;

// debugging
var bool bDebugDriverCollision;
var bool bDebugPlayerCollision;
var bool bDebugDrawHudBounds;

// Voice meter
var     	TexRotator          NeedleRotator; 			// The texture for the VU Meter needle
var			Texture			    VoiceMeterBackground;   // Background texture for the voice meter
var()   	float               VoiceMeterX;    		// Voice meter X position
var()   	float               VoiceMeterY;    		// Voice meter Y position
var()       float               VoiceMeterSize;         // Size of the voice meter icon

// for local messages
struct HudLocalizedMessageExtra
{
	// The following block of variables are cached on first render:
	var array<string> lines;
	var float y_offset;    // tells the renderer how much space to put between ROCriticalMessages
	var int background_type;
};
var() transient HudLocalizedMessageExtra LocalMessagesExtra[8];

// For compass
var         float           compassCurrentRotation;    // 0-65535
var         float           compassStabilizationConstant;
var         float           compassIconsOpacity; // 0-1 value
var         float           compassIconsFadeSpeed; // higher == icons dissapears faster
var         float           compassIconsRefreshSpeed;  // higher == icons reappear faster
var         float           compassIconsPositionRadius; // 0-1 value
//var         float           compassIconsUUDistance; // distance in UU at which icons start movign toward center of compass
var         vector          compassIconsTargets[8];
var         byte            compassIconsTargetsActive[8];
var         IntBox          compassIconsTargetsWidgetCoords[8];
//var         color           compassIconsTargetsColor[8];
/*var         color           compassIconsColorsAxis,
							compassIconsColorsAllies,
							compassIconsColorsNeutral,
							compassIconsColorsHelpRequests,
							compassIconsColorsMGResupply,
							compassIconsColorsRally;*/
//var         TexRotator      compassIconsRotators[8];

var         Material        locationHitAxisImages[15];
var         Material        locationHitAlliesImages[15];
var         float           locationHitAlphas[15];
var         bool            bDrawHits;  // Set to true when at least one of the location hit images needs
										// to be drawn

// General hud
var         float           hudLastRenderTime;

// For mouse interface
var         bool            bCapturingMouse;
var         vector          MouseCurrentPos;
var         int             LastHUDSizeX, LastHUDSizeY;
var         bool            bHaveAtLeastOneValidMouseUpdate;
var(ROHud)  SpriteWidget    MouseInterfaceIcon;

// For vehicle icon
var(ROHud)  RelativeCoordsInfo  VehicleIconCoords;
var(ROHud)  SpriteWidget        VehicleIcon, VehicleIconAlt;
var(ROHud)  SpriteWidget        VehicleThreads[2];
var(ROHud)  SpriteWidget        VehicleEngine;
var(ROHud)  SpriteWidget        VehicleOccupants;
var(ROHud)  TextWidget          VehicleOccupantsText;
var         color               VehicleNormalColor,
								VehicleDamagedColor,
								VehicleCriticalColor;
var         color               VehiclePositionIsPlayerColor,
								VehiclePositionIsOccupiedColor,
								VehiclePositionIsVacantColor;
var         Material            VehicleEngineDamagedTexture,
								VehicleEngineCriticalTexture;
var(ROHud)  SpriteWidget        VehicleAmmoIcon;
var(ROHud)  SpriteWidget        VehicleAmmoReloadIcon;
var(ROHud)  NumericWidget       VehicleAmmoAmount;
var(ROHud)  TextWidget          VehicleAmmoTypeText;
var         float               VehicleOccupantsTextOffset; // This offset is used when ammo is drawn
var(ROHud)  SpriteWidget        VehicleAltAmmoIcon;
var(ROHud)  NumericWidget       VehicleAltAmmoAmount;
var         float               VehicleAltAmmoOccupantsTextOffset; // Vertical offset
var(ROHud)  SpriteWidget        VehicleMGAmmoIcon;
var(ROHud)  NumericWidget       VehicleMGAmmoAmount;

var         Material            VehicleRPMTextures[2],
                                VehicleRPMNeedlesTextures[2],
                                VehicleSpeedTextures[2],
                                VehicleSpeedNeedlesTextures[2];
var(ROHud)  SpriteWidget        VehicleSpeedIndicator;
var(ROHud)  SpriteWidget        VehicleRPMIndicator;
var(ROHud)  SpriteWidget        VehicleThrottleIndicatorTop, VehicleThrottleIndicatorBottom,
                                VehicleThrottleIndicatorBackground,
                                VehicleThrottleIndicatorForeground,
                                VehicleThrottleIndicatorLever;
var         float               VehicleRPMZeroPosition[2], VehicleRPMScale[2];
var         float               VehicleSpeedZeroPosition[2], VehicleSpeedScale[2];
var         float               VehicleThrottleTopZeroPosition, VehicleThrottleTopMaxPosition;
var         float               VehicleThrottleBottomZeroPosition, VehicleThrottleBottomMaxPosition;
var         float               VehicleGaugesOccupantsTextOffset;
var         float               VehicleGaugesNoThrottleOccupantsTextOffset;

var         float               VehicleLastSpeedRotation, // Speed displayed on speed needle last time
                                VehicleLastRPMRotation; // RPM displayed on RPM needle last time
var         float               VehicleNeedlesRotationSpeed;
var         float               VehicleNeedlesLastRenderTime;

// for capture bar
var(ROHud)  SpriteWidget        CaptureBarBackground;
var(ROHud)  SpriteWidget        CaptureBarOutline;
var(ROHud)  SpriteWidget        CaptureBarAttacker;
var(ROHud)  SpriteWidget        CaptureBarDefender;
var(ROHud)  SpriteWidget        CaptureBarAttackerRatio;
var(ROHud)  SpriteWidget        CaptureBarDefenderRatio;
var(ROHud)  SpriteWidget        CaptureBarIcons[2];
var         Material            CaptureBarTeamIcons[2];
var         color               CaptureBarTeamColors[2];
var         bool                bDrawingCaptureBar;

// for hints
var         bool                bDrawHint;
var         bool                bFirstHintRender; // Used to only calculate hint sizing constants once
var(ROHud)  float               HintFadeTime; // How long it takes to fade in/out
var         float               HintRemainingTime;
var(ROHud)  float               HintLifetime;
var(ROHud)  float               HintDesiredAspectRatio; // Aspect ratio used to wrap hint data
var         string              HintTitle, HintText; // This is localized in ROHintManager
var         array<string>       HintWrappedText;
var(ROHud)  SpriteWidget        HintBackground;
var(ROHud)  TextWidget          HintTitleWidget;
var(ROHud)  TextWidget          HintTextWidget;
var(ROHud)  RelativeCoordsInfo  HintCoords; // default properties of this are used when rendering, XL and YL are used to pivot around the X and Y pos

// for fading to & from black
var         bool                bFadeToBlack;
var         float               FadeToBlackTime;
var         float               FadeToBlackStartTime;
var         bool                bFadeToBlackInvert;

var			bool				bUsingVOIP; // Player is using VOIP
//=============================================================================
// Functions
//=============================================================================

exec function ShowDebug()
{
	if( Level.NetMode != NM_Standalone && !class'ROEngine.ROLevelInfo'.static.RODebugMode() )
		return;

    bShowDebugInfo = !bShowDebugInfo;
}

simulated function SetNetDebugMode(int NewMode)
{
    if( ENetDebugMode(NewMode) != NetDebugMode)
        NetDebugMode = ENetDebugMode(NewMode);
}

//-----------------------------------------------------------------------------
// UpdatePrecacheMaterials
//-----------------------------------------------------------------------------

simulated function UpdatePrecacheMaterials()
{
/*	Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Rupperleg');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Lupperarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Rupperarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Llowerleg');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Rlowerleg');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Llowerarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Rlowerarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Lhand');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Rhand');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Lfoot');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.rus_hit_Rfoot');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_head');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_torso');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Pelvis');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Lupperleg');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Rupperleg');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Lupperarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Rupperarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Llowerleg');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Rlowerleg');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Llowerarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Rlowerarm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Lhand');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Rhand');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Lfoot');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Player_hits.ger_hit_Rfoot');

    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.HUD.MGDeploy');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.HUD.Compass2_main');
    Level.AddPrecacheMaterial(TexRotator'InterfaceArt_tex.HUD.TexRotator0');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.OverheadMap.overheadmap_background');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.HUD.VUMeter');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Cursors.Pointer');
    Level.AddPrecacheMaterial(TexRotator'InterfaceArt_tex.HUD.Needle_rot');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Menu.SectionHeader_captionbar');

    Level.AddPrecacheMaterial(FinalBlend'InterfaceArt_tex.OverheadMap.arrowhead_final');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.OverheadMap.overheadmap_Icons');
    Level.AddPrecacheMaterial(Material'InterfaceArt2_tex.overheadmaps.overheadmap_IconsB');

    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.numbers');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.situation_map_icon');

    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.ger_player');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.ger_player_background');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.ger_player_Stamina');
    Level.AddPrecacheMaterial(FinalBlend'InterfaceArt_tex.HUD.ger_player_Stamina_critical');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.rus_player');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.rus_player_background');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.rus_player_Stamina');
    Level.AddPrecacheMaterial(FinalBlend'InterfaceArt_tex.HUD.rus_player_Stamina_critical');

    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.stance_stand');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.stance_crouch');
    Level.AddPrecacheMaterial(Material'InterfaceArt_tex.HUD.stance_prone');


    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.throttle_background2');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.throttle_background2_bottom');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.throttle_background');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.throttle_main');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.throttle_lever');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.Ger_RPM');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.Rus_RPM');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.Ger_Speedometer');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.Tank_Hud.Rus_Speedometer');
    Level.AddPrecacheMaterial(TexRotator'InterfaceArt_tex.Tank_Hud.Ger_needle_rot');
    Level.AddPrecacheMaterial(TexRotator'InterfaceArt_tex.Tank_Hud.Rus_needle_rot');
    Level.AddPrecacheMaterial(TexRotator'InterfaceArt_tex.Tank_Hud.Ger_needle_rpm_rot');
    Level.AddPrecacheMaterial(TexRotator'InterfaceArt_tex.Tank_Hud.Rus_needle_rpm_rot');

    // Damage icons
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.artkill');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.satchel');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.Strike');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.Generic');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.b792mm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.buttsmack');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.knife');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.b762mm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.rusgrenade');
    Level.AddPrecacheMaterial(Texture'InterfaceArt2_tex.deathicons.sniperkill');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.b9mm');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.germgrenade');
    Level.AddPrecacheMaterial(Texture'InterfaceArt2_tex.deathicons.faustkill');
    Level.AddPrecacheMaterial(Texture'InterfaceArt_tex.deathicons.mine');
*/}

simulated event PostBeginPlay()
{
    Super.PostBeginPlay();

    // hax! modify existing compass texture to use new texture instead of old one
//    TexRotator'InterfaceArt_tex.HUD.TexRotator0'.Material = Texture'InterfaceArt_tex.HUD.Compass2_background';
 //   TexRotator'InterfaceArt_tex.HUD.TexRotator0'.UOffset = 128;
   // TexRotator'InterfaceArt_tex.HUD.TexRotator0'.VOffset = 128;
}

// FIXME: Ummm.... PostNETBeginPlay?  On the HUD?  Why is this here?  There is no replication
// that takes place with the HUD, so it's likely not even called. - Erik
simulated function PostNetBeginPlay()
{
	super.PostNetBeginPlay();

	if( (Level.NetMode != NM_DedicatedServer) && (ROPlayer(PlayerOwner) != none) )
	{
		ROPlayer(PlayerOwner).GetNorthDirection();
	}
}

//function DrawDamageIndicators(Canvas C);


function DrawDamageIndicators(Canvas C)
{
	if ( DamageTime[0] > 0 )
	{
		C.SetPos(0,0);
		C.DrawColor = DamageFlash[0];
		C.DrawColor.A = DamageTime[0];
//		if ( Emphasized[0] == 1 )
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', C.ClipX, 0.15*C.ClipY, 0, 64, 32, -14);
//		else
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', C.ClipX, 0.05*C.ClipY, 0, 64, 32, -14);
	}
	else
		Emphasized[0] = 0;

	if ( DamageTime[1] > 0 )
	{
		C.DrawColor = DamageFlash[1];
		C.DrawColor.A = DamageTime[1];
		if ( Emphasized[1] == 1 )
		{
			C.SetPos(0,0.85*C.ClipY);
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', C.ClipX, 0.15*C.ClipY, 0, 50, 32, 14);
		}
		else
		{
			C.SetPos(0,0.9*C.ClipY);
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', C.ClipX, 0.1*C.ClipY, 0, 50, 32, 14);
		}
	}
	else
		Emphasized[1] = 0;

	if ( DamageTime[2] > 0 )
	{
		C.SetPos(0,0);
		C.DrawColor = DamageFlash[2];
		C.DrawColor.A = DamageTime[2];
//		if ( Emphasized[2] == 1 )
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', 0.15*C.ClipX, C.ClipY, 16, 0, 14, 32);
//		else
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', 0.05*C.ClipX, C.ClipY, 16, 0, 14, 32);
	}
	else
		Emphasized[2] = 0;

	if ( DamageTime[3] > 0 )
	{
		C.DrawColor = DamageFlash[3];
		C.DrawColor.A = DamageTime[3];
		if ( Emphasized[3] == 1 )
		{
			C.SetPos(0.85*C.ClipX,0);
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', 0.15*C.ClipX, C.ClipY, 30, 0, -14, 32);
		}
		else
		{
			C.SetPos(0.95*C.ClipX,0);
//			C.DrawTile( Texture'InterfaceArt_tex.HUD.damage_indicators', 0.05*C.ClipX, C.ClipY, 30, 0, -14, 32);
		}
	}
	else
		Emphasized[3] = 0;
}

/*
we want to do a few things here:
1.) check to see if a player is on our side, if not then return out
2.) trace to see if they are visible, otherwise return out
3.) make sure they're within X units or return out

TODO - Change the font on the names to use a RO font
TODO - Figure out something new for DrawPlayerNames
*/
function DrawCustomBeacon(Canvas C, Pawn P, float ScreenLocX, float ScreenLocY)
{
	local float XL,YL;
	local PlayerReplicationInfo PRI;
	local int PlayerDist;
//	local Actor Hit;

	log("Are we even getting here?");

	PRI = P.PlayerReplicationInfo;

	if( (PRI == none) || (PRI.Team == none) )
		return;

	if( (PlayerOwner == none) || (PlayerOwner.PlayerReplicationInfo == none)
		|| (PlayerOwner.PlayerReplicationInfo.Team == none )
		|| (PlayerOwner.Pawn == none) )
	{
		return;
	}

	if( (PlayerOwner.PlayerReplicationInfo.Team.TeamIndex != PRI.Team.TeamIndex) )
		return;

	PlayerDist = VSize(P.Location - PlayerOwner.Pawn.Location);

	if( PlayerDist > 1600 )
	{
		return;
	}

	if( !FastTrace( P.Location, PlayerOwner.Pawn.Location ) )
	{
		    log("Fasttrace from "$P$" to "$PlayerOwner.Pawn$" Failed ");
	    return;
	}

	if ( PRI.Team != None )
		C.DrawColor = GetTeamColor(PRI.Team.TeamIndex);
	else
		C.DrawColor = GetTeamColor(0);
		//C.DrawColor = class'PlayerController'.Default.TeamBeaconTeamColors[0];

	C.Font = GetConsoleFont(C);
	//C.TextSize(PRI.PlayerName, strX, strY);
	C.StrLen(PRI.PlayerName, XL, YL);
	C.SetPos(ScreenLocX - 0.5*XL , ScreenLocY - YL);
	C.DrawText(PRI.PlayerName,true);

	C.SetPos(ScreenLocX, ScreenLocY);
}

//-----------------------------------------------------------------------------
// StartFadeEffect - Used to initiate a screen fade to black upon player death
//-----------------------------------------------------------------------------

function StartFadeEffect()
{
	FadeColor.R = 255;
	FadeColor.G = 255;
	FadeColor.B = 255;
	FadeColor.A = 0;
	FadeTime = Level.TimeSeconds + 5.0 + WhiteFlashTime * 2;
}

//-----------------------------------------------------------------------------
// ForceFadeEffect - Used to force a screen blacked out effect
//-----------------------------------------------------------------------------

function ForceFadeEffect()
{
	FadeColor.R = 0;
	FadeColor.G = 0;
	FadeColor.B = 0;
	FadeColor.A = 255;
	FadeTime = 0;
}


//-----------------------------------------------------------------------------
// StopFadeEffect - Kills off the fade effect
//-----------------------------------------------------------------------------

function StopFadeEffect()
{
	FadeTime = -1;
}

//-----------------------------------------------------------------------------
// DrawFadeEffect - Called to draw the fade effect to the screen
//-----------------------------------------------------------------------------

simulated function DrawFadeEffect(Canvas C)
{
	if (FadeTime < 0)
		return;

	if (FadeTime - Level.TimeSeconds - 5 - WhiteFlashTime > 0)
	{
   	    FadeColor.R = 255;
	    FadeColor.G = 255;
	    FadeColor.B = 255;
	    FadeColor.A = 64 * (1 - (FMax(FadeTime - Level.TimeSeconds - 5 - WhiteFlashTime, 0.0) / WhiteFlashTime));
	    C.DrawColor = FadeColor;
	}
	else if (FadeTime - Level.TimeSeconds - 5 > 0)
	{
   	    FadeColor.R = 255;
	    FadeColor.G = 255;
	    FadeColor.B = 255;
		FadeColor.A = 64 * (FMax(FadeTime - Level.TimeSeconds - 5, 0.0) / WhiteFlashTime);
	    C.DrawColor = FadeColor;
	}
	else
	{
   	    FadeColor.R = 0;
	    FadeColor.G = 0;
	    FadeColor.B = 0;
	    FadeColor.A = 255 * (1 - FMax(FadeTime - Level.TimeSeconds, 0.0) * 0.2);
	    C.DrawColor = FadeColor;
	}
	C.SetPos(0, 0);
	C.DrawTileStretched(Material'Engine.WhiteSquareTexture', C.ClipX, C.ClipY);
	C.DrawColor = WhiteColor;
}

function ShowMapUpdatedIcon()
{
	if (!bShowObjectives && !bAnimateMapIn && ! bAnimateMapOut)
	{
		MapUpdatedIconTime = Level.TimeSeconds;
		bShowMapUpdatedIcon = true;
	}
}

//-----------------------------------------------------------------------------
// AddDeathMessage - Adds a death message to the HUD
//-----------------------------------------------------------------------------

function AddDeathMessage(PlayerReplicationInfo Killer, PlayerReplicationInfo Victim, class<DamageType> DamageType)
{
	local int i;

	if (Victim == None)
		return;

	if (ObituaryCount == ArrayCount(Obituaries))
	{
		for (i = 1; i < ArrayCount(Obituaries); i++)
			Obituaries[i - 1] = Obituaries[i];

		ObituaryCount--;
		Obituaries[ObituaryCount].KillerName = "";
	}

	if (Killer != None && Killer != Victim)
	{
		Obituaries[ObituaryCount].KillerName = Killer.PlayerName;
		Obituaries[ObituaryCount].KillerColor = GetTeamColor(Killer.Team.TeamIndex);
	}

	Obituaries[ObituaryCount].VictimName = Victim.PlayerName;
	Obituaries[ObituaryCount].VictimColor = GetTeamColor(Victim.Team.TeamIndex);
	Obituaries[ObituaryCount].DamageType = DamageType;
	Obituaries[ObituaryCount].EndOfLife = Level.TimeSeconds + ObituaryLifeSpan;

    // Making the player's name show up in white in the kill list
    if ( PlayerOwner != none && Killer != none)
	{
	     if ( PlayerOwner.PlayerReplicationInfo != none )
	      {
              // When the player kills someone
              if ( PlayerOwner.PlayerReplicationInfo.PlayerName == Killer.PlayerName )
	          {
                   Obituaries[ObituaryCount].KillerColor = WhiteColor;
              }
          }
	}

	ObituaryCount++;
}

//-----------------------------------------------------------------------------
// GetDamageIcon
//-----------------------------------------------------------------------------

function Material GetDamageIcon(class<DamageType> DamType)
{
	if (class<ROWeaponDamageType>(DamType) != None)
		return class<ROWeaponDamageType>(DamType).default.HUDIcon;
	else if (class<ROVehicleDamageType>(DamType) != None)
		return class<ROVehicleDamageType>(DamType).default.HUDIcon;
//	else if (class<ROSuicided>(DamType) != None)
//		return Texture'InterfaceArt_tex.deathicons.mine';

//	return Texture'InterfaceArt_tex.deathicons.mine';
}

//-----------------------------------------------------------------------------
// DisplayMessages - Added death messages
//-----------------------------------------------------------------------------

function DisplayMessages(Canvas C)
{
	local int i;
	local float X, Y, XL, YL, Scale;

	Super.DisplayMessages(C);

	while (Obituaries[0].VictimName != "" && Obituaries[0].EndOfLife < Level.TimeSeconds)
	{
		for (i = 1; i < ObituaryCount; i++)
			Obituaries[i - 1] = Obituaries[i];

		ObituaryCount--;
		Obituaries[ObituaryCount].VictimName = "";
		Obituaries[ObituaryCount].KillerName = "";
	}

	Scale = C.ClipX / 1600.0;

	C.Font = GetConsoleFont(C);

	Y = 8 * Scale;

	// Offset death msgs if we're displaying a hint
	if (bDrawHint)
		Y += 2 * Y + (HintCoords.Y + HintCoords.YL) * C.ClipY;

	for (i = 0; i < ObituaryCount; i++)
	{
		C.TextSize(Obituaries[i].VictimName, XL, YL);

		X = C.ClipX - 8 * Scale - XL;

		C.SetPos(X, Y + 20 * Scale - YL * 0.5);
		C.DrawColor = Obituaries[i].VictimColor;
		C.DrawTextClipped(Obituaries[i].VictimName);

		X -= 48 * Scale;

		C.SetPos(X, Y);
		C.DrawColor = WhiteColor;
		C.DrawTileScaled(GetDamageIcon(Obituaries[i].DamageType), Scale * 1.25, Scale * 1.25);

		if (Obituaries[i].KillerName != "")
		{
			C.TextSize(Obituaries[i].KillerName, XL, YL);
			X -= 8 * Scale + XL;

			C.SetPos(X, Y + 20 * Scale - YL * 0.5);
			C.DrawColor = Obituaries[i].KillerColor;
			C.DrawTextClipped(Obituaries[i].KillerName);
		}

		Y += 44 * Scale;
	}
}

//-----------------------------------------------------------------------------
// GetTeamColor - Returns the appropriate team color
//-----------------------------------------------------------------------------

static function color GetTeamColor(byte Team)
{
	return default.SideColors[Team];
}

//-----------------------------------------------------------------------------
// ShowObjectives - Enables or disables the objectives display
//-----------------------------------------------------------------------------

exec function ShowObjectives()
{
	bShowObjectives = !bShowObjectives;
	bShowMapUpdatedIcon = false;

	if (bShowObjectives)
	{
	    // Open fake menu to capture mouse clicks
	    //PlayerOwner.ClientOpenMenu("ROInterface.ROSituationMapMenu");
	    MouseInterfaceStartCapturing();
	    bAnimateMapIn = true; bAnimateMapOut = false;

	    // Check for hints
	    if (ROPlayer(PlayerOwner) != none)
	        ROPlayer(PlayerOwner).CheckForHint(14);
	}
	else
	    HideObjectives();
}

simulated function HideObjectives()
{
	bAnimateMapIn = false; bAnimateMapOut = true;
	MouseInterfaceStopCapturing();
	bShowObjectives = false;
}

simulated function ShowHint(string title, string text)
{
	bFirstHintRender = true;
	HintWrappedText.Length = 0;
	HintRemainingTime = HintLifetime + HintFadeTime * 2;
	HintTitle = title;

	// Parse keybinds
	if (PlayerOwner != none)
		HintText = class'ROTeamGame'.static.ParseLoadingHintNoColor(text, PlayerOwner);
	else
		HintText = text;
	bDrawHint = true;
}

// not used
/*simulated function DrawObjectiveLocationIcons(Canvas C)
{
	local ROGameReplicationInfo GRI;
	local int 		i;
	local vector  	ScreenPos,
				  	TargetLocation;

	if ( PlayerOwner.Player.GUIController.bActive )
		return;

	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

	// this is test code for objective stuff
	if( GRI != none )
	{
		for( i = 0; i < 4; i++ )
		{
			if( GRI.Objectives[i] != none )
			{
				TargetLocation = GRI.Objectives[i].Location;

				ScreenPos = C.WorldToScreen(TargetLocation);

				if (ScreenPos.X >= 0 || ScreenPos.X <= C.ClipX || ScreenPos.Y >= 0 || ScreenPos.Y <= C.ClipY)
				{
					C.SetPos(ScreenPos.X, ScreenPos.Y);
					C.DrawTileStretched(Material'ROInterfaceArt.ObjectiveIcon', 16, 16);
				}
			}
		}

	}
}*/

simulated function UpdateHud()
{
	local ROGameReplicationInfo GRI;
	local class<Ammunition> AmmoClass;
	local Weapon W;
	//local float Time;
	local byte Nation;
	local ROPawn P;

	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

	if (PawnOwnerPRI != None)
	{
	    if (PawnOwner != none)
		{
			// Set pawn color
			// Took this out for now. Since one or two shots kills you, and
			// the colors look kinda funny on the hud, This probably isn't
			// needed. Add it back in if we decide otherwise - Ramm
			//if (PawnOwner.Health > 50)
				HealthFigure.Tints[0] = WhiteColor;
			//else if (PawnOwner.Health > 25)
			//	HealthFigure.Tints[0] = GoldColor;
			//else
			//	HealthFigure.Tints[0] = RedColor;

			P = ROPawn(PawnOwner);
			if (P != none)
			{
			    // Set stamina info
		        HealthFigureStamina.scale = 1 - P.Stamina / P.default.Stamina;
		        HealthFigureStamina.Tints[0].G = 255 - HealthFigureStamina.scale * 255;
		        HealthFigureStamina.Tints[1].G = 255 - HealthFigureStamina.scale * 255;
		        HealthFigureStamina.Tints[0].B = 255 - HealthFigureStamina.scale * 255;
		        HealthFigureStamina.Tints[1].B = 255 - HealthFigureStamina.scale * 255;

		        // Set stance info
		        if (P.bIsCrouched)
					StanceIcon.WidgetTexture = StanceCrouch;
				else if (P.bIsCrawling)
					StanceIcon.WidgetTexture = StanceProne;
				else
					StanceIcon.WidgetTexture = StanceStanding;
			}
		}

		if (PawnOwnerPRI.Team != None && GRI != None)
		{
			Nation = GRI.NationIndex[PawnOwnerPRI.Team.TeamIndex];
			HealthFigure.WidgetTexture = NationHealthFigures[Nation];
			HealthFigureBackground.WidgetTexture = NationHealthFiguresBackground[Nation];
			if (HealthFigureStamina.scale > 0.9)
			{
			    HealthFigureStamina.WidgetTexture = NationHealthFiguresStaminaCritical[Nation];
			    HealthFigureStamina.Tints[0].G = 255; HealthFigureStamina.Tints[1].G = 255;
		        HealthFigureStamina.Tints[0].B = 255; HealthFigureStamina.Tints[1].B = 255;
			}
			else
				HealthFigureStamina.WidgetTexture = NationHealthFiguresStamina[Nation];
			//ClockBase.WidgetTexture = NationClockBases[Nation];
			//ClockHand.WidgetTexture = NationClockHands[Nation];
		}
	}

	AmmoIcon.WidgetTexture = none; // This is so we don't show icon on binocs or when we have no weapon

	if (PawnOwner == None)
		return;

	W = PawnOwner.Weapon;
	if( W == none )
		return;

	AmmoClass = W.GetAmmoClass(0);

	if( AmmoClass == none )
		return;

	AmmoIcon.WidgetTexture = AmmoClass.default.IconMaterial;
	AmmoCount.Value = W.GetHudAmmoCount();

/*	if (ROWeapon(W) != none && ROWeapon(W).bShowMagazineIcon )
	{
		AmmoIcon.WidgetTexture = AmmoClass.default.IconMaterial;
		AmmoCount.Value = ROWeapon(W).GetROHudDisplayMagazines();
	}
	else if (ROWeapon(W) != none && ROWeapon(W).bShowMagazineCount)
	{
		AmmoIcon.WidgetTexture = AmmoClass.default.IconMaterial;
		AmmoCount.Value = W.AmmoAmount(0);
	}*/

}

//-----------------------------------------------------------------------------
// DrawHudPassA - Draw local messages
//-----------------------------------------------------------------------------

simulated function DrawHudPassA(Canvas C)
{
	DisplayLocalMessages(C);

	if( Level.TimeSeconds - LastVoiceGainTime < 0.333 )
	{
		if ( !bUsingVOIP && PlayerOwner != None && PlayerOwner.ActiveRoom != None &&
			PlayerOwner.ActiveRoom.GetTitle() == "Team")
		{
			bUsingVOIP = true;
			PlayerOwner.NotifySpeakingInTeamChannel();
		}
	}
	else
	{
		if( bUsingVOIP )
		{
			bUsingVOIP = false;
		}
	}

	if( Level.TimeSeconds - LastVoiceGainTime < 0.333 )
		DisplayVoiceGain(C);
}

//-----------------------------------------------------------------------------
// DisplayVoiceGain - Draw the voice meter and needle
//-----------------------------------------------------------------------------
function DisplayVoiceGain(Canvas C)
{
	local float VoiceGain;
	local float PosY, PosX, XL, YL;
	local string ActiveName;
	local float IconSize, scale, YOffset;
	local color SavedColor;

	scale = C.SizeY / 1200.0 * HudScale;

	SavedColor = C.DrawColor;
	C.DrawColor = WhiteColor;
	C.Style = ERenderStyle.STY_Alpha;

	VoiceGain = (1 - 3 * Min( Level.TimeSeconds - LastVoiceGainTime, 0.3333 )) * LastVoiceGain;

	YOffset = 12 * scale;
	IconSize = VoiceMeterSize * Scale;

	PosY = VoiceMeterY * C.ClipY - IconSize - YOffset;
	PosX = VoiceMeterX * C.ClipX;
	C.SetPos( PosX, PosY );

	C.DrawTile( VoiceMeterBackground, IconSize, IconSize, 0, 0, VoiceMeterBackground.USize, VoiceMeterBackground.VSize );

	NeedleRotator.Rotation.Yaw = -1 * ((20000 * VoiceGain) + 55000);

	C.SetPos( PosX, PosY );
	C.DrawTileScaled(NeedleRotator, scale * VoiceMeterSize / 128.0, scale * VoiceMeterSize / 128.0);

	// Display name of currently active channel
	if ( PlayerOwner != None && PlayerOwner.ActiveRoom != None )
		ActiveName = PlayerOwner.ActiveRoom.GetTitle();

	// Remove for release
	if(ActiveName == "")
		ActiveName = "No Channel Selected!";

	if ( ActiveName != "" )
	{
	    C.SetPos(0, 0);
		ActiveName = "(" @ ActiveName @ ")";
		C.Font = GetFontSizeIndex(C,-2);
		C.StrLen(ActiveName,XL,YL);

		if ( XL > 0.125 * C.ClipY )
		{
			C.Font = GetFontSizeIndex(C,-4);
			C.StrLen(ActiveName,XL,YL);
		}

		C.SetPos( PosX + ((IconSize/2) - (XL/2)), PosY - YL);
		C.DrawColor = C.MakeColor(160,160,160);
		if ( PlayerOwner != None && PlayerOwner.PlayerReplicationInfo != None )
		{
			if ( PlayerOwner.PlayerReplicationInfo.Team != None )
			{
				if ( PlayerOwner.PlayerReplicationInfo.Team.TeamIndex == 0 )
					C.DrawColor = RedColor;
				else
					C.DrawColor = TurqColor;
			}
		}

		C.DrawText( ActiveName );
	}

	C.DrawColor = SavedColor;
}


//-----------------------------------------------------------------------------
// DrawHudPassC - Draw all the widgets here
//-----------------------------------------------------------------------------

simulated function DrawHudPassC(Canvas C)
{
	local VoiceChatRoom VCR;
	//local float PortraitWidth,PortraitHeight, Abbrev, SmallH, NameWidth;
	//local string PortraitString;

	local ROPawn ROP;
	local ROGameReplicationInfo GRI;
	//local int i;
	//local float X, Y, XL, YL, alpha;
	local float Y, XL, YL, alpha;
	local string S;
	local color myColor;
	local AbsoluteCoordsInfo coords;
	local ROWeapon myweapon;

	// Set coordinates to use whole screen
	coords.width = C.ClipX; coords.height = C.ClipY;


	ROP = ROPawn(PawnOwner);
	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

	// Don't draw the healthfigure when in a vehicle
	if (bShowPersonalInfo && ROP != None)
	{
		DrawSpriteWidget(C, HealthFigureBackground);
		DrawSpriteWidget(C, HealthFigureStamina);
		DrawSpriteWidget(C, HealthFigure);

		DrawSpriteWidget(C, StanceIcon);

		DrawLocationHits(C, ROP);
	}

	// Show MG deploy icon if the weapon can be deployed
	if (PawnOwner != None && PawnOwner.bCanBipodDeploy)
		DrawSpriteWidget(C, MGDeployIcon);

	// Draw the icon for weapon resting
	if (PawnOwner != None)
	{
		if (PawnOwner.bRestingWeapon)
		{
			DrawSpriteWidget(C, WeaponRestingIcon);
		}
		else if (PawnOwner.bCanRestWeapon)
		{
			DrawSpriteWidget(C, WeaponCanRestIcon);
		}
	}

	// Resupply icon
	if (PawnOwner != None && PawnOwner.bTouchingResupply)
	{
	    if (Vehicle(PawnOwner) != none)
		{
	        if (Level.TimeSeconds - PawnOwner.LastResupplyTime <=  1.5)
    			DrawSpriteWidget(C, ResupplyZoneResupplyingVehicleIcon);
    		else
    			DrawSpriteWidget(C, ResupplyZoneNormalVehicleIcon);
		}
		else
		{
    		if (Level.TimeSeconds - PawnOwner.LastResupplyTime <=  1.5)
    			DrawSpriteWidget(C, ResupplyZoneResupplyingPlayerIcon);
    		else
    			DrawSpriteWidget(C, ResupplyZoneNormalPlayerIcon);
		}
	}

	// Show weapon info
	if (bShowWeaponInfo && PawnOwner.Weapon != none && AmmoIcon.WidgetTexture != none )
	{
	    myweapon = ROWeapon(PawnOwner.Weapon);

	    if ( myweapon != none )
	    {
	        if ( myweapon.bWaitingToBolt || myweapon.AmmoAmount(0) <= 0 )
	        {
	            AmmoIcon.Tints[TeamIndex] = WeaponReloadingColor;
	            AmmoCount.Tints[TeamIndex] = WeaponReloadingColor;
	            AutoFireIcon.Tints[TeamIndex] = WeaponReloadingColor;
	            SemiFireIcon.Tints[TeamIndex] = WeaponReloadingColor;
	        }
	        else
	        {
	            AmmoIcon.Tints[TeamIndex] = default.AmmoIcon.Tints[TeamIndex];
	            AmmoCount.Tints[TeamIndex] = default.AmmoCount.Tints[TeamIndex];
	            AutoFireIcon.Tints[TeamIndex] = default.AutoFireIcon.Tints[TeamIndex];
	            SemiFireIcon.Tints[TeamIndex] = default.SemiFireIcon.Tints[TeamIndex];
	        }
		   	DrawSpriteWidget(C, AmmoIcon);
			DrawNumericWidget(C, AmmoCount, Digits);

			if( myweapon.bHasSelectFire )
			{
				if( myweapon.UsingAutoFire() )
				{
					DrawSpriteWidget(C, AutoFireIcon);
				}
				else
				{
					DrawSpriteWidget(C, SemiFireIcon);
				}
	        }
		}
	}

	DrawCaptureBar(C);

	// Draw Compass
	if (bShowCompass)
		DrawCompass(C);

   	// Draw the 'map updated' icon
	if (bShowMapUpdatedIcon)
	{
		alpha = (Level.TimeSeconds - MapUpdatedIconTime) % 2;
		if (alpha < 0.5)
			alpha = 1 - alpha / 0.5;
		else if (alpha < 1)
			alpha = (alpha - 0.5) / 0.5;
		else
			alpha = 1;
		myColor.R = 255;
		myColor.G = 255;
		myColor.B = 255;
		myColor.A = alpha * 255;

		if (myColor.A != 0)
		{
			// Set different position if not showing compass
			if (!bShowCompass)
			{
			    MapUpdatedText.PosX = 0.95;
			    MapUpdatedIcon.PosX = 0.95;
			}
			else
			{
			    MapUpdatedText.PosX = default.MapUpdatedText.PosX;
			    MapUpdatedIcon.PosX = default.MapUpdatedIcon.PosX;
			}

			XL = 0; YL = 0; Y = 0;

			if (bShowMapUpdatedText)
			{
				// Check width & height of text label
				S = class'ROTeamGame'.static.ParseLoadingHintNoColor(OpenMapText, PlayerController(Owner));
				C.Font = getSmallMenuFont(C);
				//C.TextSize(S, XL, YL);

				// Draw text
				MapUpdatedText.text = S;
				MapUpdatedText.Tints[0] = myColor; MapUpdatedText.Tints[1] = myColor;
				MapUpdatedText.OffsetY = default.MapUpdatedText.OffsetY * MapUpdatedIcon.TextureScale;
			    DrawTextWidgetClipped(C, MapUpdatedText, coords, XL, YL, Y);

		   	    // Offset icon by text height
			    MapUpdatedIcon.OffsetY = MapUpdatedText.OffsetY - YL - Y / 2;
			}
			else
			{
			    // Offset icon by text height
			    MapUpdatedIcon.OffsetY = default.MapUpdatedText.OffsetY * MapUpdatedIcon.TextureScale;
			}


		    // Draw icon
	  		MapUpdatedIcon.Tints[0] = myColor; MapUpdatedIcon.Tints[1] = myColor;
		    DrawSpriteWidgetClipped(C, MapUpdatedIcon, coords, true, XL, YL, true, true, true);

		    // Check if we should stop showing the icon
			if (Level.TimeSeconds - MapUpdatedIconTime > MaxMapUpdatedIconDisplayTime)
			    bShowMapUpdatedIcon = false;
	    }
	}

	//if (!bNoEnemyNames)
		DrawPlayerNames(C);

    if((Level.NetMode == NM_Standalone || GRI.bAllowNetDebug) && bShowRelevancyDebugOverlay)
	   DrawNetworkActors(C);

	// Comment Out for Release
	//if( Level.NetMode == NM_StandAlone )
	//	DrawCrosshair(C);

	// portrait
	if ( (bShowPortrait || (bShowPortraitVC && Level.TimeSeconds - LastPlayerIDTalkingTime < 2.0)) )
	{
	    // Start by updating current portrait PRI
	    if ( (Level.TimeSeconds - LastPlayerIDTalkingTime < 0.1) && (PlayerOwner.GameReplicationInfo != None) )
		{
			if ( (PortraitPRI == None) || (PortraitPRI.PlayerID != LastPlayerIDTalking) )
			{
			    if (PortraitPRI == none)
			        PortraitX = 1;
				PortraitPRI = PlayerOwner.GameReplicationInfo.FindPlayerByID(LastPlayerIDTalking);
				if ( PortraitPRI != None )
				    PortraitTime = Level.TimeSeconds + 3;
			}
			else
				PortraitTime = Level.TimeSeconds + 0.2;
		}
		else
			LastPlayerIDTalking = 0;

		// Update portrait alpha value (fade in & fade out)
		if ( PortraitTime - Level.TimeSeconds > 0 )
			PortraitX = FMax(0, PortraitX - 3 * (Level.TimeSeconds - hudLastRenderTime));
		else if ( PortraitPRI != None )
		{
			PortraitX = FMin(1, PortraitX + 3 * (Level.TimeSeconds - hudLastRenderTime));
			if ( PortraitX == 1 )
			{
				//Portrait = None;
				PortraitPRI = None;
			}
		}

	    // Draw portrait if needed
	    if (PortraitPRI != none)
	    {
		    if (PortraitPRI.Team != none)
			{
				if (PortraitPRI.Team.TeamIndex == 0)
				{
					PortraitIcon.WidgetTexture = CaptureBarTeamIcons[0];
					PortraitText[0].Tints[TeamIndex] = SideColors[0];
				}
				else if (PortraitPRI.Team.TeamIndex == 1)
				{
					PortraitIcon.WidgetTexture = CaptureBarTeamIcons[1];
					PortraitText[0].Tints[TeamIndex] = SideColors[1];
				}
				else
				{
					PortraitIcon.WidgetTexture = CaptureBarTeamIcons[0];
					PortraitText[0].Tints[TeamIndex] = default.PortraitText[0].Tints[TeamIndex];
				}
			}

			// PortraitX goes from 0 to 1 -- we'll use that as alpha
			PortraitIcon.Tints[TeamIndex].A = 255 * (1 - PortraitX);
			PortraitText[0].Tints[TeamIndex].A = PortraitIcon.Tints[TeamIndex].A;

			XL = 0;
			DrawSpriteWidgetClipped(C, PortraitIcon, coords, true, XL, YL, false, true);

			// Draw first line of text
			PortraitText[0].OffsetX = PortraitIcon.OffsetX * PortraitIcon.TextureScale + XL * 1.1;
			PortraitText[0].text = PortraitPRI.PlayerName;
			C.Font = GetFontSizeIndex(C,-2);
			DrawTextWidgetClipped(C, PortraitText[0], coords);

			// Draw second line of text
			VCR = PlayerOwner.VoiceReplicationInfo.GetChannelAt(PortraitPRI.ActiveChannel);
			if (VCR != none)
				PortraitText[1].text = "(" @ VCR.GetTitle() @ ")";
			else
				PortraitText[1].text = "( ? )";
			PortraitText[1].OffsetX = PortraitText[0].OffsetX;
			PortraitText[1].Tints[TeamIndex] = PortraitText[0].Tints[TeamIndex];
			DrawTextWidgetClipped(C, PortraitText[1], coords);

		}

		/*
		PortraitWidth = 0.125 * C.ClipY;
		PortraitHeight = 1.5 * PortraitWidth;
		C.DrawColor = WhiteColor;

		C.SetPos(-PortraitWidth*PortraitX + 0.025*PortraitWidth,0.5*(C.ClipY-PortraitHeight) + 0.025*PortraitHeight);
		C.DrawTile( Portrait, PortraitWidth, PortraitHeight, 0, 0, 256, 384);

		C.SetPos(-PortraitWidth*PortraitX,0.5*(C.ClipY-PortraitHeight));
		C.Font = GetFontSizeIndex(C,-2);
		PortraitString = PortraitPRI.PlayerName;
		C.StrLen(PortraitString,XL,YL);
		if ( XL > PortraitWidth )
		{
			C.Font = GetFontSizeIndex(C,-4);
			C.StrLen(PortraitString,XL,YL);
			if ( XL > PortraitWidth )
			{
				Abbrev = float(len(PortraitString)) * PortraitWidth/XL;
				PortraitString = left(PortraitString,Abbrev);
				C.StrLen(PortraitString,XL,YL);
			}
		}

		// Merge - Don't think we need this
//		C.DrawColor = C.static.MakeColor(160,160,160);
//		C.SetPos(-PortraitWidth*PortraitX + 0.025*PortraitWidth,0.5*(C.ClipY-PortraitHeight) + 0.025*PortraitHeight);
//		C.DrawTile( Material'XGameShaders.ModuNoise', PortraitWidth, PortraitHeight, 0.0, 0.0, 512, 512 );

		C.DrawColor = WhiteColor;
		C.SetPos(-PortraitWidth*PortraitX,0.5*(C.ClipY-PortraitHeight));
		//C.DrawTileStretched(texture 'InterfaceContent.Menu.BorderBoxA1', 1.05 * PortraitWidth, 1.05*PortraitHeight);
		C.DrawTileStretched(Texture'InterfaceArt_tex.Menu.RODisplay', 1.05 * PortraitWidth, 1.05*PortraitHeight);

		C.DrawColor = WhiteColor;

		X = C.ClipY/256-PortraitWidth*PortraitX;
		Y = 0.5*(C.ClipY+PortraitHeight) + 0.06*PortraitHeight;
		C.SetPos( X + 0.5 * (PortraitWidth - XL), Y );

		if ( PortraitPRI != None )
		{
			if ( PortraitPRI.Team != None )
			{
				if ( PortraitPRI.Team.TeamIndex == 0 )
					C.DrawColor = RedColor;
				else
					C.DrawColor = TurqColor;
			}

			C.DrawText(PortraitString,true);

			if ( Level.TimeSeconds - LastPlayerIDTalkingTime < 2.0
				&& PortraitPRI.ActiveChannel != -1
				&& PlayerOwner.VoiceReplicationInfo != None )
			{
				VCR = PlayerOwner.VoiceReplicationInfo.GetChannelAt(PortraitPRI.ActiveChannel);
				if ( VCR != None )
				{
					PortraitString = "(" @ VCR.GetTitle() @ ")";
					C.StrLen( PortraitString, XL, YL );
					if ( PortraitX == 0 )
						C.SetPos( Max(0, X + 0.5 * (PortraitWidth - XL)), Y + YL );
					else C.SetPos( X + 0.5 * (PortraitWidth - XL), Y + YL );
					C.DrawText( PortraitString );
				}
			}
		}*/
	}
	if( bShowWeaponInfo && (PawnOwner != None) && (PawnOwner.Weapon != None) )
		PawnOwner.Weapon.NewDrawWeaponInfo(C, 0.86 * C.ClipY);

	// Slow, for debugging only
	if( bDebugDriverCollision && class'ROEngine.ROLevelInfo'.static.RODebugMode() )
	{
		DrawVehiclePointSphere();
	}

	// Slow, for debugging only
	if( bDebugPlayerCollision && class'ROEngine.ROLevelInfo'.static.RODebugMode() )
	{
		DrawPointSphere();
	}

}

simulated function DrawPointSphere()
{
	local coords CO;
	local ROPawn P;
	local vector HeadLoc;
	local int i;

	foreach DynamicActors(class'ROPawn', P)
	{
		if (P != none /*&& P != PawnOwner*/)
		{
			for(i=0; i<P.Hitpoints.Length; i++)
			{
				if( P.Hitpoints[i].PointBone != '' )
				{
					CO = P.GetBoneCoords(P.Hitpoints[i].PointBone);
					HeadLoc = CO.Origin;// + (P.Hitpoints[i].PointHeight * P.Hitpoints[i].PointScale * CO.XAxis);
					HeadLoc = HeadLoc + (P.Hitpoints[i].PointOffset >> P.GetBoneRotation(P.Hitpoints[i].PointBone)/*P.Rotation*/);
					//P.DrawDebugSphere(HeadLoc, P.Hitpoints[i].PointHeight * P.Hitpoints[i].PointScale, 10, 0, 255, 0);
					if( i == MAINCOLLISIONINDEX )
					{
						DrawDebugCylinder(HeadLoc,CO.XAxis,CO.YAxis,CO.ZAxis,P.Hitpoints[i].PointRadius * P.Hitpoints[i].PointScale,P.Hitpoints[i].PointHeight * P.Hitpoints[i].PointScale,10,0, 255, 0);
					}
					else
					{
						DrawDebugCylinder(HeadLoc,CO.ZAxis,CO.YAxis,CO.XAxis,P.Hitpoints[i].PointRadius * P.Hitpoints[i].PointScale,P.Hitpoints[i].PointHeight * P.Hitpoints[i].PointScale,10,0, 255, 0);
					}
				}
			}
		}
	}
}


simulated function DrawVehiclePointSphere()
{

	local coords CO;
	local ROVehicle P;
	local ROVehicleWeapon V;
	local vector HeadLoc;
	local int i;

	foreach DynamicActors(class'ROVehicle', P)
	{
		if (P != None)
		{
			for(i=0; i<P.VehHitpoints.Length; i++)
			{
				if( P.VehHitpoints[i].PointBone != '' )
				{
					CO = P.GetBoneCoords(P.VehHitpoints[i].PointBone);
					HeadLoc = CO.Origin + (P.VehHitpoints[i].PointHeight * P.VehHitpoints[i].PointScale * CO.XAxis);
					HeadLoc = HeadLoc + (P.VehHitpoints[i].PointOffset >> P.Rotation);
					P.DrawDebugSphere(HeadLoc, P.VehHitpoints[i].PointRadius * P.VehHitpoints[i].PointScale, 10, 0, 255, 0);
				}
			}
		}
	}


	foreach DynamicActors(class'ROVehicleWeapon', V)
	{
		if (V != None)
		{
			for(i=0; i<V.VehHitpoints.Length; i++)
			{
				if( V.VehHitpoints[i].PointBone != '' )
				{
					CO = V.GetBoneCoords(V.VehHitpoints[i].PointBone);
					HeadLoc = CO.Origin + (V.VehHitpoints[i].PointHeight * V.VehHitpoints[i].PointScale * CO.XAxis);
					HeadLoc = HeadLoc + (V.VehHitpoints[i].PointOffset >> Rotator(CO.Xaxis));
					V.DrawDebugSphere(HeadLoc, V.VehHitpoints[i].PointRadius * V.VehHitpoints[i].PointScale, 10, 0, 255, 0);
				}
			}
		}
	}
}


// Draw a debugging cylinder
function DrawDebugCylinder(vector Base,vector X, vector Y,vector Z, FLOAT Radius,float HalfHeight,int NumSides, byte R, byte G, byte B)
{
	local float AngleDelta;
	local vector LastVertex, Vertex;
	local int SideIndex;
	//Color = Color.RenderColor();

	AngleDelta = 2.0f * PI / NumSides;
	LastVertex = Base + X * Radius;

	for(SideIndex = 0;SideIndex < NumSides;SideIndex++)
	{
		Vertex = Base + (X * Cos(AngleDelta * (SideIndex + 1)) + Y * Sin(AngleDelta * (SideIndex + 1))) * Radius;

		DrawDebugLine(LastVertex - Z * HalfHeight,Vertex - Z * HalfHeight,R,G,B);
		DrawDebugLine(LastVertex + Z * HalfHeight,Vertex + Z * HalfHeight,R,G,B);
		DrawDebugLine(LastVertex - Z * HalfHeight,LastVertex + Z * HalfHeight,R,G,B);

		LastVertex = Vertex;
	}
}

//-----------------------------------------------------------------------------
// DrawPlayerNames - Draws identify info for friendlies
//-----------------------------------------------------------------------------

function DrawPlayerNames(Canvas C)
{
	local actor HitActor;
	local vector HitLocation, HitNormal, ViewPos;
	local Vector ScreenPos, Loc, X, Y, Z, Dir;
	local float strX, strY;
	local string display;
	local float distance;

	if (PawnOwner == none || PawnOwner.Controller == None)
		return;

	ViewPos = PawnOwner.Location + PawnOwner.BaseEyeHeight * vect(0,0,1);
	HitActor = trace(HitLocation,HitNormal,ViewPos+/*512*/1600*vector(PawnOwner.Controller.Rotation),ViewPos,true);

	if ( (Pawn(HitActor) != None) && (Pawn(HitActor).PlayerReplicationInfo != None)
		&& ( (PawnOwner.PlayerReplicationInfo.Team == None) || (PawnOwner.PlayerReplicationInfo.Team == Pawn(HitActor).PlayerReplicationInfo.Team)) )
	{
		if ( (NamedPlayer != HitActor) || (Level.TimeSeconds - NameTime > 0.5) )
		{
			//PlayerOwner.ReceiveLocalizedMessage(class'ROPlayerNameMessage',0,Pawn(HitActor).PlayerReplicationInfo);
			NameTime = Level.TimeSeconds;
		}

		NamedPlayer = Pawn(HitActor);
	}

	if (NamedPlayer != None && NamedPlayer.PlayerReplicationInfo != None && Level.TimeSeconds - NameTime < 1.0)
	{
		GetAxes(PlayerOwner.Rotation, X, Y, Z);
		Dir = Normal(NamedPlayer.Location - PawnOwner.Location);

		if (Dir dot X > 0.0)
		{
			C.DrawColor = GetTeamColor(NamedPlayer.PlayerReplicationInfo.Team.TeamIndex);
			C.Font = GetConsoleFont(C);

			if( ROPawn(PawnOwner)!= none && !NamedPlayer.IsA('Vehicle') && !ROPawn(PawnOwner).bUsedCarriedMGAmmo
				&& ROPawn(NamedPlayer).bWeaponCanBeResupplied && ROPawn(NamedPlayer).bWeaponNeedsResupply)
			{
				// Draw player name
				Loc = NamedPlayer.Location;
				Loc.Z += NamedPlayer.CollisionHeight + 8;
				ScreenPos = C.WorldToScreen(Loc);
				C.TextSize(NamedPlayer.PlayerReplicationInfo.PlayerName, strX, strY);
			    C.SetPos(ScreenPos.X - strX * 0.5, ScreenPos.Y - strY * 2.0);
				display = NamedPlayer.PlayerReplicationInfo.PlayerName;
				C.DrawTextClipped(display);

				distance = VSizeSquared(Loc - PawnOwner.Location);

				if( distance < 14400.0 ) // 2 Meters
				{
					ROPawn(PawnOwner).bCanResupply = true;
					display = class'ROTeamGame'.static.ParseLoadingHintNoColor(CanResupplyText, PlayerController(Owner));
				}
				else
				{
					if( ROPawn(PawnOwner).bCanResupply )
						ROPawn(PawnOwner).bCanResupply = false;
					display = NeedAmmoText;
				}

				// Draw text under player's name (need ammo or press x to resupply)
				C.DrawColor = WhiteColor;
			    C.SetPos(ScreenPos.X - strX * 0.5, ScreenPos.Y - strY * 1.0);
				C.DrawTextClipped(display);
			}
			else
			{
				if( ROPawn(PawnOwner)!= none && ROPawn(PawnOwner).bCanResupply )
					ROPawn(PawnOwner).bCanResupply = false;

				C.TextSize(NamedPlayer.PlayerReplicationInfo.PlayerName, strX, strY);
				Loc = NamedPlayer.Location;
				Loc.Z += NamedPlayer.CollisionHeight + 8;
				ScreenPos = C.WorldToScreen(Loc);
			    C.SetPos(ScreenPos.X - strX * 0.5, ScreenPos.Y - strY * 0.5);

				display = NamedPlayer.PlayerReplicationInfo.PlayerName;
				C.DrawTextClipped(display);
			}
		}
	}
}

// Draw actors on the hud to help debugging network relevancy in network games
function DrawNetworkActors(Canvas C)
{
	local Vector ScreenPos, X, Y, Z, Dir;
	local float strX, strY;
	local string display;
	local Actor TestActor;
	local int Pos;

	if (PawnOwner == none || PawnOwner.Controller == none )
		return;

    if( Level.NetMode != NM_Standalone && !ROGameReplicationInfo(PlayerOwner.GameReplicationInfo).bAllowNetDebug)
        return;

	foreach DynamicActors(class'Actor', TestActor)
	{
		if (TestActor != none && TestActor.IsA('Pawn'))
		{
		    GetAxes(PlayerOwner.Rotation, X, Y, Z);
            Dir = Normal(TestActor.Location - PawnOwner.Location);

    		if (Dir dot X > 0.0)
    		{
    			C.DrawColor = WhiteColor;
    			C.Font = GetConsoleFont(C);
    			display = ""$TestActor;

                // Remove the package name, if it exists
            	Pos = InStr(display, ".");
            	if ( Pos != -1 )
            		display = Mid(display, Pos + 1);

				C.TextSize(display, strX, strY);
				//Loc = NamedPlayer.Location;
				//Loc.Z += NamedPlayer.CollisionHeight + 8;
				ScreenPos = C.WorldToScreen(TestActor.Location);
			    C.SetPos(ScreenPos.X - strX * 0.5, ScreenPos.Y - strY * 0.5);

				//display = NamedPlayer.PlayerReplicationInfo.PlayerName;
				C.DrawTextClipped(display);
    		}
		}
	}
}


//-----------------------------------------------------------------------------
// DrawObjectives - Renders the objectives on the HUD similar to the scoreboard
//-----------------------------------------------------------------------------

simulated function DrawObjectives(Canvas C)
{
	local ROGameReplicationInfo GRI;
	local int i, OwnerTeam, objCount, SecondaryObjCount;
	local AbsoluteCoordsInfo MapCoords, subCoords;
	local bool bShowRally, bShowArtillery, bShowResupply, bShowArtyCoords,
		bShowNeutralObj, bShowMGResupplyRequest, bShowHelpRequest, bShowAttackDefendRequest,
        bShowArtyStrike, bShowDestroyableItems, bShowDestroyedItems, bShowVehicleResupply,
		bHasSecondaryObjectives;
	local float myMapScale, XL, YL, YL_one, time;
	local vector temp, MapCenter;
	local SpriteWidget  widget;
	local Actor A;
	local ROPlayer player;
	local Controller P;
	// PSYONIX: DEBUG
	local Vehicle V;
	local float pawnRotation;
	local ROVehicleWeaponPawn myVehicleWeaponPawn;
	local float X, Y, strX, strY;
	local string S;
	// Net debug
	local Actor NetActor;
	local Pawn NetPawn;
	local ROPawn ROP;
	local int Pos;
	// AT Gun
	local bool bShowATGun;

	// Get GRI
	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);
	if (GRI == none)
		return;

    // Update time
	if (GRI != None)
	{
		if (!GRI.bMatchHasBegun)
			CurrentTime = FMax(0.0, GRI.RoundStartTime + GRI.PreStartTime - GRI.ElapsedTime);
		else
			CurrentTime = FMax(0.0, GRI.RoundStartTime + GRI.RoundDuration - GRI.ElapsedTime);
	}

	// Get player
	player = ROPlayer(PlayerOwner);

	// Get player team -- if none, we won't draw team-specific information on the map
	if (PlayerOwner != none )
		OwnerTeam = PlayerOwner.GetTeamNum();
	else
		OwnerTeam = 255;

	// Set map coords based on resolution
	// We want to keep a 4:3 aspect ratio for the map
	MapCoords.height = C.ClipY * 0.9;
	MapCoords.PosY = C.ClipY * 0.05;
	MapCoords.width = MapCoords.height * 4 / 3;
	MapCoords.PosX = (C.ClipX - MapCoords.width) / 2;

	// Calculate map offset (for animation)
	if (bAnimateMapIn)
	{
		AnimateMapCurrentPosition -= (Level.TimeSeconds - hudLastRenderTime) / AnimateMapSpeed;
		if (AnimateMapCurrentPosition <= 0)
		{
			AnimateMapCurrentPosition = 0;
			bAnimateMapIn = false;
		}
	}
	else if (bAnimateMapOut)
	{
		AnimateMapCurrentPosition += (Level.TimeSeconds - hudLastRenderTime) / AnimateMapSpeed;
		if (AnimateMapCurrentPosition >= default.AnimateMapCurrentPosition)
		{
			AnimateMapCurrentPosition = default.AnimateMapCurrentPosition;
			bAnimateMapOut = false;
		}
	}
	MapCoords.PosX += C.ClipX * AnimateMapCurrentPosition;

	// Draw map background
	DrawSpriteWidgetClipped(C, MapBackground, MapCoords, true);

	// Calculate absolute coordinates of level map
	GetAbsoluteCoordinatesAlt(MapCoords, MapLegendImageCoords, subCoords);
	//subCoords.PosX = MapCoords.PosX + MapCoords.width * MapLevelBounds.PosX;
	//subCoords.PosY = MapCoords.PosY + MapCoords.height * MapLevelBounds.PosY;
	//subCoords.height = MapCoords.height * MapLevelBounds.TextureScale;
	//subCoords.width = subCoords.height; // We want to show a square map, so force coords to be square

	// Save coordinates for use in menu page
	MapLevelImageCoordinates = subCoords;

	// Draw coordinates text on sides of the map
	for (i = 0; i < 9; i++)
	{
		MapCoordTextXWidget.PosX = (float(i) + 0.5) / 9;
		MapCoordTextXWidget.text = MapCoordTextX[i];
		DrawTextWidgetClipped(C, MapCoordTextXWidget, subCoords);

		MapCoordTextYWidget.PosY = MapCoordTextXWidget.PosX;
		MapCoordTextYWidget.text = MapCoordTextY[i];
		DrawTextWidgetClipped(C, MapCoordTextYWidget, subCoords);
	}

	// Draw level map
	MapLevelImage.WidgetTexture = GRI.MapImage;
	DrawSpriteWidgetClipped(C, MapLevelImage, subCoords, true);

	// Calculate level map constants
	temp = GRI.SouthWestBounds - GRI.NorthEastBounds;
	MapCenter =  temp/2 + GRI.NorthEastBounds;
	myMapScale = abs(temp.x);
	if (myMapScale ~= 0)
		myMapScale = 1; // just so we never get divisions by 0

	// Set the font to be used to draw objective text
	C.Font = GetSmallMenuFont(C);

	// Draw resupply areas
    for (i = 0; i < ArrayCount(GRI.ResupplyAreas); i++)
	{
		if (!GRI.ResupplyAreas[i].bActive ||
            (GRI.ResupplyAreas[i].Team != OwnerTeam && GRI.ResupplyAreas[i].Team != NEUTRAL_TEAM_INDEX))
        {
			continue;
		}

        if (GRI.ResupplyAreas[i].ResupplyType == 1)
        {
            // Tank resupply icon
    		bShowVehicleResupply = true;
    		DrawIconOnMap(C, subCoords, MapIconVehicleResupply, myMapScale, GRI.ResupplyAreas[i].ResupplyVolumeLocation, MapCenter);
        }
        else
        {
            // Player resupply icon
    		bShowResupply = true;
    		DrawIconOnMap(C, subCoords, MapIconResupply, myMapScale, GRI.ResupplyAreas[i].ResupplyVolumeLocation, MapCenter);
		}
	}

	// Draw AT-Guns
    for (i = 0; i < ArrayCount(GRI.ATCannons); i++)
	{
		if ( GRI.ATCannons[i].ATCannonLocation != vect(0,0,0) && GRI.ATCannons[i].Team == PlayerOwner.GetTeamNum())
        {
            if( GRI.ATCannons[i].ATCannonLocation.Z > 0 )  // ATCannon is active is the Z location is greater than 0
            {
                bShowATGun = true;

                // AT-Gun icon
                MapIconATGun.Tints[0] = WhiteColor;
                MapIconATGun.Tints[1] = WhiteColor;
                DrawIconOnMap(C, subCoords, MapIconATGun, myMapScale, GRI.ATCannons[i].ATCannonLocation, MapCenter);
            }
//            else
//            {
//    			MapIconATGun.Tints[0] = GrayColor;
//                MapIconATGun.Tints[1] = GrayColor;
//    			MapIconATGun.Tints[0].A = 125;
//                MapIconATGun.Tints[1].A = 125;
//            }
        }
	}

	if (Level.NetMode == NM_Standalone && bShowDebugInfoOnMap)
	{
		// PSYONIX: DEBUG - Show all vehicles on map who have no driver
		foreach DynamicActors(Class'Vehicle',V)
		{
				widget = MapIconRally[V.GetTeamNum()];
				widget.TextureScale = 0.04f;
				if (V.health <= 0)
					widget.RenderStyle = STY_Translucent;
				else
					widget.RenderStyle = STY_Normal;
				// Empty Vehicle
				if (Bot(V.Controller) == none && (ROWheeledVehicle(V) != none && V.NumPassengers() == 0) )
					DrawDebugIconOnMap(C, subCoords, widget, myMapScale, V.Location, MapCenter, "");
				// VehicleWeapon
//				else if (Bot(V.Controller) != none && VehicleWeaponPawn(V) != none)
//					DrawDebugIconOnMap(C, subCoords, widget, myMapScale, V.Location + Vect(0,25,0), MapCenter, Left(Bot(V.Controller).Squad.GetOrders(),1)$" P");
				// Vehicle
				else if ( VehicleWeaponPawn(V) == none && V.Controller != None )
					DrawDebugIconOnMap(C, subCoords, widget, myMapScale, V.Location, MapCenter, Left(Bot(V.Controller).Squad.GetOrders(),1)$" "$V.NumPassengers());
		}
		// PSYONIX: DEBUG - Show all players on map and indicate orders
		for (P = Level.ControllerList; P != None; P = P.NextController)
		{
			if (Bot(P) != None && P.Pawn != None && ROVehicle(P.Pawn) == None)
			{
				widget = MapIconTeam[P.GetTeamNum()];
				widget.TextureScale = 0.025f;

				DrawDebugIconOnMap(C, subCoords, widget, myMapScale, P.Pawn.Location, MapCenter, Left(Bot(P).Squad.GetOrders(),1));
			}
		}
	}

	if ((Level.NetMode == NM_Standalone || GRI.bAllowNetDebug) && bShowRelevancyDebugOnMap)
	{
        if( NetDebugMode == ND_All )
        {
    		foreach DynamicActors(Class'Actor',NetActor)
    		{

                if(!NetActor.bStatic && !NetActor.bNoDelete)
                {
            		widget = MapIconNeutral;
    				widget.TextureScale = 0.04f;
    				widget.RenderStyle = STY_Normal;
    				DrawDebugIconOnMap(C, subCoords, widget, myMapScale, NetActor.Location, MapCenter, "");
				}
    		}
        }
        else if( NetDebugMode == ND_VehiclesOnly )
        {
    		// PSYONIX: DEBUG - Show all vehicles on map who have no driver
    		foreach DynamicActors(Class'Vehicle',V)
    		{
				widget = MapIconRally[V.GetTeamNum()];
				widget.TextureScale = 0.04f;
				widget.RenderStyle = STY_Normal;
				if (ROWheeledVehicle(V) != none)
					DrawDebugIconOnMap(C, subCoords, widget, myMapScale, V.Location, MapCenter, "");
    		}
        }
        else if( NetDebugMode == ND_PlayersOnly )
        {
    		foreach DynamicActors(Class'ROPawn',ROP)
    		{
				widget = MapIconTeam[ROP.GetTeamNum()];
				widget.TextureScale = 0.04f;
				widget.RenderStyle = STY_Normal;
				DrawDebugIconOnMap(C, subCoords, widget, myMapScale, ROP.Location, MapCenter, "");
    		}
        }
        else if( NetDebugMode == ND_PawnsOnly )
        {
    		foreach DynamicActors(Class'Pawn',NetPawn)
    		{
				if( Vehicle(NetPawn) != none)
				{
    				widget = MapIconRally[V.GetTeamNum()];
				}
				else if( ROPawn(NetPawn) != none )
				{
				    widget = MapIconTeam[NetPawn.GetTeamNum()];
				}
				else
				{
				    widget = MapIconNeutral;
				}

				widget.TextureScale = 0.04f;
				widget.RenderStyle = STY_Normal;
				DrawDebugIconOnMap(C, subCoords, widget, myMapScale, NetPawn.Location, MapCenter, "");
    		}
        }
        if( NetDebugMode == ND_AllWithText )
        {
    		foreach DynamicActors(Class'Actor',NetActor)
    		{

                if(!NetActor.bStatic && !NetActor.bNoDelete)
                {
            		widget = MapIconNeutral;
    				widget.TextureScale = 0.04f;
    				widget.RenderStyle = STY_Normal;

        			S = ""$NetActor;

                    // Remove the package name, if it exists
                	Pos = InStr(S, ".");
                	if ( Pos != -1 )
                		S = Mid(S, Pos + 1);

    				DrawDebugIconOnMap(C, subCoords, widget, myMapScale, NetActor.Location, MapCenter, S);
				}
    		}
        }
	}

	if (player != none)
	{
		// Draw the marked arty strike
		temp = player.SavedArtilleryCoords;
		if (temp != vect(0,0,0))
		{
		    bShowArtyCoords = true;
		    widget = MapIconArtyStrike;
		    widget.Tints[0].A = 125; widget.Tints[1].A = 125;
			DrawIconOnMap(C, subCoords, widget, myMapScale, temp, MapCenter);
		}

		// Draw the destroyable/destroyed targets
	    if (player.Destroyables.length != 0)
	    {
			for (i = 0; i < player.Destroyables.length; i++)
			{
				//if (player.Destroyables[i].GetStateName() == 'Broken')
				if (player.Destroyables[i].bHidden || player.Destroyables[i].bDamaged)
				{
					DrawIconOnMap(C, subCoords, MapIconDestroyedItem, myMapScale,
						player.Destroyables[i].Location, MapCenter);
					bShowDestroyedItems = true;
				}
				else
				{
					DrawIconOnMap(C, subCoords, MapIconDestroyableItem, myMapScale,
						player.Destroyables[i].Location, MapCenter);
					bShowDestroyableItems = true;
				}
			}
	    }
	}

	if ( OwnerTeam != 255 )
	{
	    // Draw the in-progress arty strikes
	    if (OwnerTeam == AXIS_TEAM_INDEX || OwnerTeam == ALLIES_TEAM_INDEX)
	       if (GRI.ArtyStrikeLocation[OwnerTeam] != vect(0,0,0))
	       {
	           DrawIconOnMap(C, subCoords, MapIconArtyStrike, myMapScale, GRI.ArtyStrikeLocation[OwnerTeam], MapCenter);
	           bShowArtyStrike = true;
	       }

		// Draw the rally points
	 	for (i = 0; i < ArrayCount(GRI.AxisRallyPoints); i++)
		{
			if ( OwnerTeam == AXIS_TEAM_INDEX )
				temp = GRI.AxisRallyPoints[i].RallyPointLocation;
			else if ( OwnerTeam == ALLIES_TEAM_INDEX )
				temp = GRI.AlliedRallyPoints[i].RallyPointLocation;

			// Draw the marked rally point
			if (temp != vect(0,0,0))
			{
			    bShowRally = true;
			    DrawIconOnMap(C, subCoords, MapIconRally[OwnerTeam], myMapScale, temp, MapCenter);
		    }
		}

		// Draw Artillery Radio Icons
		if ( OwnerTeam == AXIS_TEAM_INDEX )
		{
		    for ( i = 0; i < ArrayCount(GRI.AxisRadios); i++)
			{
				if(GRI.AxisRadios[i] == none)
					continue;

			    bShowArtillery = true;
		        DrawIconOnMap(C, subCoords, MapIconRadio, myMapScale, GRI.AxisRadios[i].Location, MapCenter);
			}
		}
		else if ( OwnerTeam == ALLIES_TEAM_INDEX )
		{
			for ( i = 0; i < ArrayCount(GRI.AlliedRadios); i++)
			{
				if(GRI.AlliedRadios[i] == none)
					continue;

			    bShowArtillery = true;
		        DrawIconOnMap(C, subCoords, MapIconRadio, myMapScale, GRI.AlliedRadios[i].Location, MapCenter);
			}
		}

		// Draw help requests
		if ( OwnerTeam == AXIS_TEAM_INDEX )
		{
		    for ( i = 0; i < ArrayCount(GRI.AxisHelpRequests); i++)
			{
				if (GRI.AxisHelpRequests[i].requestType == 255)
					continue;

				switch (GRI.AxisHelpRequests[i].requestType)
				{
					case 0: // help request at objective
						bShowHelpRequest = true;
						widget = MapIconHelpRequest;
						widget.Tints[0].A = 125; widget.Tints[1].A = 125;
						DrawIconOnMap(C, subCoords, widget, myMapScale,
							GRI.Objectives[GRI.AxisHelpRequests[i].objectiveID].Location, MapCenter);
						break;

					case 1: // attack request
					case 2: // defend request
						bShowAttackDefendRequest = true;
						DrawIconOnMap(C, subCoords, MapIconAttackDefendRequest, myMapScale,
							GRI.Objectives[GRI.AxisHelpRequests[i].objectiveID].Location, MapCenter);
						break;

					case 3: // mg resupply requests
						bShowMGResupplyRequest = true;
						DrawIconOnMap(C, subCoords, MapIconMGResupplyRequest[AXIS_TEAM_INDEX], myMapScale, GRI.AxisHelpRequestsLocs[i], MapCenter);
						break;

					case 4: // help request at coords
						bShowHelpRequest = true;
						DrawIconOnMap(C, subCoords, MapIconHelpRequest, myMapScale, GRI.AxisHelpRequestsLocs[i], MapCenter);
						break;

					default:
						log("Unknown requestType found in AxisHelpRequests[i]: " $ GRI.AxisHelpRequests[i].requestType);
				}
			}
		}
		else if ( OwnerTeam == ALLIES_TEAM_INDEX )
		{
		    for ( i = 0; i < ArrayCount(GRI.AlliedHelpRequests); i++)
			{
				if(GRI.AlliedHelpRequests[i].requestType == 255)
					continue;

				switch (GRI.AlliedHelpRequests[i].requestType)
				{
					case 0: // help request at objective
						bShowHelpRequest = true;
						widget = MapIconHelpRequest;
						widget.Tints[0].A = 125; widget.Tints[1].A = 125;
						DrawIconOnMap(C, subCoords, widget, myMapScale,
							GRI.Objectives[GRI.AlliedHelpRequests[i].objectiveID].Location, MapCenter);
						break;

					case 1: // attack request
					case 2: // defend request
						bShowAttackDefendRequest = true;
						DrawIconOnMap(C, subCoords, MapIconAttackDefendRequest, myMapScale,
							GRI.Objectives[GRI.AlliedHelpRequests[i].objectiveID].Location, MapCenter);
						break;

					case 3: // mg resupply requests
						bShowMGResupplyRequest = true;
						DrawIconOnMap(C, subCoords, MapIconMGResupplyRequest[ALLIES_TEAM_INDEX], myMapScale, GRI.AlliedHelpRequestsLocs[i], MapCenter);
						break;

					case 4: // help request at coords
						bShowHelpRequest = true;
						DrawIconOnMap(C, subCoords, MapIconHelpRequest, myMapScale, GRI.AlliedHelpRequestsLocs[i], MapCenter);
						break;

					default:
						log("Unknown requestType found in AlliedHelpRequests[i]: " $ GRI.AlliedHelpRequests[i].requestType);
				}
			}
		}
	}

	// Draw objectives
  	for (i = 0; i < ArrayCount(GRI.Objectives); i++)
	{
		if (GRI.Objectives[i] == None)
			continue;

		// Setup icon info
		if (GRI.Objectives[i].ObjState == OBJ_Axis)
			widget = MapIconTeam[AXIS_TEAM_INDEX];
		else if (GRI.Objectives[i].ObjState == OBJ_Allies)
			widget = MapIconTeam[ALLIES_TEAM_INDEX];
		else
		{
		    bShowNeutralObj = true;
			widget = MapIconNeutral;
		}
		if (!GRI.Objectives[i].bActive)
		{
			widget.Tints[0] = GrayColor; widget.Tints[1] = GrayColor;
			widget.Tints[0].A = 125; widget.Tints[1].A = 125;
		}
		else
		{
			widget.Tints[0] = WhiteColor; widget.Tints[1] = WhiteColor;
		}

		// Draw flashing icon if objective is disputed
		if (GRI.Objectives[i].CompressedCapProgress != 0 && GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
		{
			if (GRI.Objectives[i].CompressedCapProgress == 1 || GRI.Objectives[i].CompressedCapProgress == 2)
                DrawIconOnMap(C, subCoords, widget, myMapScale, GRI.Objectives[i].Location, MapCenter, 2, GRI.Objectives[i].ObjName, GRI, i);
			else if (GRI.Objectives[i].CompressedCapProgress == 3 || GRI.Objectives[i].CompressedCapProgress == 4)
                DrawIconOnMap(C, subCoords, widget, myMapScale, GRI.Objectives[i].Location, MapCenter, 3, GRI.Objectives[i].ObjName, GRI, i);
			else
                DrawIconOnMap(C, subCoords, widget, myMapScale, GRI.Objectives[i].Location, MapCenter, 1, GRI.Objectives[i].ObjName, GRI, i);
		}
		else
            DrawIconOnMap(C, subCoords, widget, myMapScale, GRI.Objectives[i].Location, MapCenter, 1, GRI.Objectives[i].ObjName, GRI, i);


		// If the objective isn't completely captured, overlay a flashing icon from other team
		if (GRI.Objectives[i].CompressedCapProgress != 0 && GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
		{
			if (GRI.Objectives[i].CurrentCapTeam == ALLIES_TEAM_INDEX)
				widget = MapIconDispute[ALLIES_TEAM_INDEX];
			else
				widget = MapIconDispute[AXIS_TEAM_INDEX];
			if (GRI.Objectives[i].CompressedCapProgress == 1 || GRI.Objectives[i].CompressedCapProgress == 2)
				DrawIconOnMap(C, subCoords, widget, myMapScale, GRI.Objectives[i].Location, MapCenter, 4);
			else if (GRI.Objectives[i].CompressedCapProgress == 3 || GRI.Objectives[i].CompressedCapProgress == 4)
				DrawIconOnMap(C, subCoords, widget, myMapScale, GRI.Objectives[i].Location, MapCenter, 5);
		}
	}

	// Get player actor
	if (PawnOwner != None)
		A = PawnOwner;
	else if (PlayerOwner.IsInState('Spectating'))
		A = PlayerOwner;
	else if (PlayerOwner.Pawn != None)
		A = PlayerOwner.Pawn;

	// Fix for frelled rotation on weapon pawns
	myVehicleWeaponPawn = ROVehicleWeaponPawn(A);
	if (myVehicleWeaponPawn != none)
	{
	   player = ROPlayer(myVehicleWeaponPawn.Controller);
	   if (player != none && myVehicleWeaponPawn.VehicleBase != none)
	       pawnRotation = -player.CalcViewRotation.Yaw;
	   else if (myVehicleWeaponPawn.VehicleBase != none)
	       pawnRotation = -myVehicleWeaponPawn.VehicleBase.Rotation.Yaw;
	   else
	       pawnRotation = -A.Rotation.Yaw;
	}
	else if (A != none)
	   pawnRotation = -A.Rotation.Yaw;

	// Draw player icon
	if (A != none)
	{
		// Set proper icon rotation
		if ( GRI.OverheadOffset == 90 )
		 	TexRotator(FinalBlend(MapPlayerIcon.WidgetTexture).Material).Rotation.Yaw = pawnRotation - 32768;
		else if( GRI.OverheadOffset == 180 )
		 	TexRotator(FinalBlend(MapPlayerIcon.WidgetTexture).Material).Rotation.Yaw = pawnRotation - 49152;
		else if( GRI.OverheadOffset == 270 )
		 	TexRotator(FinalBlend(MapPlayerIcon.WidgetTexture).Material).Rotation.Yaw = pawnRotation;
		else
		 	TexRotator(FinalBlend(MapPlayerIcon.WidgetTexture).Material).Rotation.Yaw = pawnRotation - 16384;

		// Draw the player icon
		DrawIconOnMap(C, subCoords, MapPlayerIcon, myMapScale, A.Location, MapCenter);
	}

	// Overhead map debugging
	if (Level.NetMode == NM_Standalone && ROTeamGame(Level.Game).LevelInfo.bDebugOverhead)
	{
		DrawIconOnMap(C, subCoords, MapIconTeam[ALLIES_TEAM_INDEX], myMapScale, GRI.NorthEastBounds, MapCenter);
		DrawIconOnMap(C, subCoords, MapIconTeam[AXIS_TEAM_INDEX], myMapScale, GRI.SouthWestBounds, MapCenter);
	}

	// Draw timer
	DrawTextWidgetClipped(C, MapTimerTitle, MapCoords, XL, YL, YL_one);

	// Calculate seconds & minutes
	time = CurrentTime;
	MapTimerTexts[3].text = string(int(time % 10));
	time /= 10;
	MapTimerTexts[2].text = string(int(time % 6));
	time /= 6;
	MapTimerTexts[1].text = string(int(time % 10));
	time /= 10;
	MapTimerTexts[0].text = string(int(time));

	// Draw timer values
	C.Font = GetFontSizeIndex(C, -2);
	for (i = 0; i < 4; i++)
	   DrawTextWidgetClipped(C, MapTimerTexts[i], MapCoords, XL, YL, YL_one);
	C.Font = GetSmallMenuFont(C);

	// Calc legend coords
	GetAbsoluteCoordinatesAlt(MapCoords, MapLegendCoords, subCoords);

	// Draw legend background
	//DrawSpriteWidgetClipped(C, MapLegend, subCoords, true);

	// Draw legend title
	DrawTextWidgetClipped(C, MapLegendTitle, subCoords, XL, YL, YL_one);

	// Set initial icon + text values
	//MapLegendIcons.OffsetY = 0;
	//MapLegendTexts.OffsetY = 0;

	// Draw legend elements
	LegendItemsIndex = 2; // no item at position #0 and #1 (reserved for title)
	DrawLegendElement(C, subCoords, MapIconTeam[AXIS_TEAM_INDEX], LegendAxisObjectiveText);
	DrawLegendElement(C, subCoords, MapIconTeam[ALLIES_TEAM_INDEX], LegendAlliesObjectiveText);
	if (bShowNeutralObj || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconNeutral, LegendNeutralObjectiveText);
	if (bShowArtillery || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconRadio, LegendArtilleryRadioText);
	if (bShowResupply || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconResupply, LegendResupplyAreaText);
    if (bShowVehicleResupply)
        DrawLegendElement(C, subCoords, MapIconVehicleResupply, LegendResupplyAreaText);
	if (bShowRally || bShowAllItemsInMapLegend)
		if (OwnerTeam != 255)
			DrawLegendElement(C, subCoords, MapIconRally[OwnerTeam], LegendRallyPointText);
	if (bShowArtyCoords || bShowAllItemsInMapLegend)
	{
		widget = MapIconArtyStrike;
		widget.Tints[TeamIndex].A = 64;
		DrawLegendElement(C, subCoords, widget, LegendSavedArtilleryText);
		widget.Tints[TeamIndex].A = 255;
	}
	if (bShowArtyStrike || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconArtyStrike, LegendArtyStrikeText);
	if (bShowMGResupplyRequest || bShowAllItemsInMapLegend)
		if (OwnerTeam != 255)
			DrawLegendElement(C, subCoords, MapIconMGResupplyRequest[OwnerTeam], LegendMGResupplyText);
	if (bShowHelpRequest || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconHelpRequest, LegendHelpRequestText);
	if (bShowAttackDefendRequest || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconAttackDefendRequest, LegendOrderTargetText);
	if (bShowDestroyableItems || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconDestroyableItem, LegendDestroyableItemText);
	if (bShowDestroyedItems || bShowAllItemsInMapLegend)
		DrawLegendElement(C, subCoords, MapIconDestroyedItem, LegendDestroyedItemText);
	if (bShowATGun)
		DrawLegendElement(C, subCoords, MapIconATGun, LegendATGunText);

	// Calc objective text box coords
	GetAbsoluteCoordinatesAlt(MapCoords, MapObjectivesCoords, subCoords);

	// See if there are any secondary objectives
	for (i = 0; i < ArrayCount(GRI.Objectives); i++)
	{
		if (GRI.Objectives[i] == none || !GRI.Objectives[i].bActive )
			continue;

		if( !GRI.Objectives[i].bRequired )
		{
			bHasSecondaryObjectives=true;
			break;
		}
	}

	// Draw objective text box header
	if( bHasSecondaryObjectives )
	{
		DrawTextWidgetClipped(C, MapRequiredObjectivesTitle, subCoords, XL, YL, YL_one);
	}
	else
	{
		DrawTextWidgetClipped(C, MapObjectivesTitle, subCoords, XL, YL, YL_one);
	}
	MapObjectivesTexts.OffsetY = 0;

	// Draw objective texts
	objCount = 1;
	C.Font = GetSmallMenuFont(C);
	for (i = 0; i < ArrayCount(GRI.Objectives); i++)
	{
		if (GRI.Objectives[i] == none || !GRI.Objectives[i].bActive || !GRI.Objectives[i].bRequired)
			continue;

		if (GRI.Objectives[i].ObjState != OwnerTeam)
			MapObjectivesTexts.text = objCount $ ". " $ GRI.Objectives[i].AttackerDescription;
		else
			MapObjectivesTexts.text = objCount $ ". " $ GRI.Objectives[i].DefenderDescription;

		DrawTextWidgetClipped(C, MapObjectivesTexts, subCoords, XL, YL, YL_one);
		MapObjectivesTexts.OffsetY += YL + YL_one * 0.5;
		objCount++;
	}

	if( bHasSecondaryObjectives )
	{
		MapObjectivesTexts.OffsetY += YL + YL_one * 0.5;
		MapObjectivesTexts.OffsetY += YL + YL_one * 0.5;
		MapSecondaryObjectivesTitle.OffsetY = MapObjectivesTexts.OffsetY;
		DrawTextWidgetClipped(C, MapSecondaryObjectivesTitle, subCoords, XL, YL, YL_one);

		for (i = 0; i < ArrayCount(GRI.Objectives); i++)
		{
			if (GRI.Objectives[i] == none || !GRI.Objectives[i].bActive|| GRI.Objectives[i].bRequired)
				continue;

			if (GRI.Objectives[i].ObjState != OwnerTeam)
				MapObjectivesTexts.text = (SecondaryObjCount + 1) $ ". " $ GRI.Objectives[i].AttackerDescription;
			else
				MapObjectivesTexts.text = (SecondaryObjCount + 1) $ ". " $ GRI.Objectives[i].DefenderDescription;

			DrawTextWidgetClipped(C, MapObjectivesTexts, subCoords, XL, YL, YL_one);
			MapObjectivesTexts.OffsetY += YL + YL_one * 0.5;
			SecondaryObjCount++;
		}
	}

	// Draw 'objectives missing' if no objectives found -- for debug only
	if (objCount == 1)
	{
		MapObjectivesTexts.text = "(OBJECTIVES MISSING)";
		DrawTextWidgetClipped(C, MapObjectivesTexts, subCoords, XL, YL, YL_one);
	}

	// Draw timer
	//DrawSpriteWidgetClipped(C, ClockBase, MapCoords, true, XL, YL, false, true);
	//DrawSpriteWidgetClipped(C, ClockHand, MapCoords, true, XL, YL, false, true);

	// Draw the instruction header
	S = class'ROTeamGame'.static.ParseLoadingHintNoColor(SituationMapInstructionsText, PlayerController(Owner));
	C.DrawColor = WhiteColor;
	C.Font = GetLargeMenuFont(C);

	X = C.ClipX * 0.5;
	Y = C.ClipY * 0.01;

	C.TextSize(S, strX, strY);
	C.SetPos(X - strX / 2, Y);
	C.DrawTextClipped(S);
}

// Draw debugging info on the overhead map
function DrawDebugIconOnMap(Canvas C, AbsoluteCoordsInfo levelCoords, SpriteWidget icon, float myMapScale, vector location, vector MapCenter, optional string title)
{
    local vector HUDLocation;
    local float XL, YL;
    local SpriteWidget myIcon;

    // Calculate proper position
    HUDLocation = location - MapCenter;
    HUDLocation.Z = 0;
    HUDLocation = GetAdjustedHudLocation(HUDLocation);

    myIcon = icon;

    myIcon.PosX = HUDLocation.X / myMapScale + 0.5;
    myIcon.PosY = HUDLocation.Y / myMapScale + 0.5;

    // Bound the values between 0 and 1
    myIcon.PosX = fmax(0.0, fmin(1.0, myIcon.PosX));
    myIcon.PosY = fmax(0.0, fmin(1.0, myIcon.PosY));

    // Draw icon!
    DrawSpriteWidgetClipped(C, myIcon, levelCoords, true, XL, YL, true);

    if (title != "")
    {
        // Setup text info
        MapTexts.text = title;
        MapTexts.PosX = myIcon.PosX;
        MapTexts.PosY = myIcon.PosY;
        MapTexts.OffsetY = YL * 0.6;

        // Draw text
        DrawTextWidgetClipped(C, MapTexts, levelCoords);
    }
}

simulated function DrawRoute()
{
    local Controller C;
    local Bot B, M;
    local vector End;

	Super.DrawRoute();

	// PSYONIX: draw the squads
	C = Pawn(PlayerOwner.ViewTarget).Controller;
    if ( C == None )
        return;
    B = Bot(C);

    if ( B == None )
        return;

    if (B.Squad.SquadLeader.Pawn == None)
    	return;

    End = B.Squad.SquadLeader.Pawn.Location;

    for (M=B.Squad.SquadMembers; M!=None; M=M.NextSquadMember)
    {
    	if (M.Pawn != None && M != M.Squad.SquadLeader)
			Draw3DLine(M.Pawn.Location + (M.Pawn.BaseEyeHeight * vect(0,0,1)),End,Class'Canvas'.Static.MakeColor(70,131,244));
	}
}

// valid flash modes:
// 0 - just draw using assigned texture
// 1 - draw using normal map icon texture
// 2 - draw using flashing map icon texture
// 3 - draw using fast-flashing map icon texture
// 4 - draw using flashing map icon texture (out of phase)
// 5 - draw using fast-flashing map icon texture (out of phase)
function DrawIconOnMap(Canvas C, AbsoluteCoordsInfo levelCoords, SpriteWidget icon, float myMapScale, vector location, vector MapCenter, optional int flashMode, optional string title, optional ROGameReplicationInfo GRI, optional int objective_index)
{
	local vector HUDLocation;
    local float XL, YL, YL_one;
	local SpriteWidget myIcon;
    local FloatBox label_coords;

	// Calculate proper position
	HUDLocation = location - MapCenter;
	HUDLocation.Z = 0;
	HUDLocation = GetAdjustedHudLocation(HUDLocation);

	myIcon = icon;

	myIcon.PosX = HUDLocation.X / myMapScale + 0.5;
	myIcon.PosY = HUDLocation.Y / myMapScale + 0.5;

	// Bound the values between 0 and 1
	myIcon.PosX = fmax(0.0, fmin(1.0, myIcon.PosX));
	myIcon.PosY = fmax(0.0, fmin(1.0, myIcon.PosY));

	// Set flashing texture if needed

	if (flashMode != 0)
	{
		if (flashMode == 2)
			myIcon.WidgetTexture = MapIconsFlash;
		else if (flashMode == 3)
			myIcon.WidgetTexture = MapIconsFastFlash;
		else if (flashMode == 4)
			myIcon.WidgetTexture = MapIconsAltFlash;
		else if (flashMode == 5)
			myIcon.WidgetTexture = MapIconsAltFastFlash;

		//else if (flashMode == 1)
		//  myIcon.WidgetTexture = icon.WidgetTexture; // not needed
	}

	// Draw icon!
	DrawSpriteWidgetClipped(C, myIcon, levelCoords, true, XL, YL, true);

    if (title != "" && !GRI.Objectives[objective_index].bDoNotDisplayTitleOnSituationMap)
	{
		// Setup text info
		MapTexts.text = title;
		MapTexts.PosX = myIcon.PosX;
		MapTexts.PosY = myIcon.PosY;
		MapTexts.Tints[TeamIndex].A = myIcon.Tints[TeamIndex].A;
        MapTexts.OffsetY = YL * 0.3;

        // Fake render to get desired label pos
        DrawTextWidgetClipped(C, MapTexts, levelCoords, XL, YL, YL_one, true);

        // Update objective floatbox info with desired coords
        label_coords.X1 = levelCoords.width * MapTexts.PosX - XL/2;
        label_coords.Y1 = levelCoords.height * MapTexts.PosY;
        label_coords.X2 = label_coords.X1 + XL;
        label_coords.Y2 = label_coords.Y1 + YL;

        // Iterate through objectives list and check if we should offset label
        UpdateMapIconLabelCoords(label_coords, GRI, objective_index);

        // Update Y offset
        MapTexts.OffsetY += GRI.Objectives[objective_index].LabelCoords.Y1 - label_coords.Y1;

		// Draw text
		DrawTextWidgetClipped(C, MapTexts, levelCoords);
	}
}

simulated function UpdateMapIconLabelCoords(FloatBox label_coords, ROGameReplicationInfo GRI, int current_obj)
{
    local int i, count;
    local float new_y;

    // Do not update label coords if it's disabled in the objective
    if (GRI.Objectives[current_obj].bDoNotUseLabelShiftingOnSituationMap)
    {
        GRI.Objectives[current_obj].LabelCoords = label_coords;
        return;
    }

    if (current_obj == 0)
    {
        // Set label position to be same as tested position
        GRI.Objectives[0].LabelCoords = label_coords;

        return;
    }

    for (i = 0; i < current_obj; i++)
    {
        // Check if there's overlap in the X axis
        if (!(label_coords.X2 <= GRI.Objectives[i].LabelCoords.X1 ||
              label_coords.X1 >= GRI.Objectives[i].LabelCoords.X2))
        {
            // There's overlap! Check if there's overlap in the Y axis
            if (!(label_coords.Y2 <= GRI.Objectives[i].LabelCoords.Y1 ||
                  label_coords.Y1 >= GRI.Objectives[i].LabelCoords.Y2))
            {
                // There's overlap on both axis: the label overlaps.
                // Update the position of the label
                new_y = GRI.Objectives[i].LabelCoords.Y2 - (label_coords.Y2 - label_coords.Y1) * 0.00;
                label_coords.Y2 = new_y + label_coords.Y2 - label_coords.Y1;
                label_coords.Y1 = new_y;

                //if (i != 0)
                    i = -1; // This is to force rechecking of all possible overlaps
                            // to ensure that no other label overlaps with this

                // Safety
                count++;
                if (count > current_obj * 5)
                    break;
            }
        }

    }

    // Set new label position
    GRI.Objectives[current_obj].LabelCoords = label_coords;
}

simulated function DrawLegendElement(Canvas C, AbsoluteCoordsInfo coords, SpriteWidget icon, string text)
{
	local float X, Y, XL, YL, YL2;

	// We'll have four columns of 4 items
	MapLegendIcons.PosX = (float(LegendItemsIndex / 4) + 0.05) / 4;
	MapLegendIcons.PosY = (LegendItemsIndex % 4 + 0.5) / 4;

	MapLegendIcons.WidgetTexture = icon.WidgetTexture;
	MapLegendIcons.Tints[TeamIndex] = icon.Tints[TeamIndex];
	MapLegendIcons.TextureCoords = icon.TextureCoords;
	DrawSpriteWidgetClipped(C, MapLegendIcons, coords, true, XL, YL, true, true);

	// Same data for text
	MapLegendTexts.text = text;
	MapLegendTexts.PosX = MapLegendIcons.PosX;
	MapLegendTexts.PosY = MapLegendIcons.PosY;
	MapLegendTexts.offsetX = XL * 1.05;

	DrawTextWidgetClipped(C, MapLegendTexts, coords, X, Y, YL2);
	//MapLegendIcons.OffsetY += max(YL, Y) + YL2 * 0.5;
	//MapLegendTexts.OffsetY = MapLegendIcons.OffsetY;

	LegendItemsIndex++;
}

// returns true if click was out of level image bounds, meaning
// that menu should close
simulated function bool HandleLevelMapClick(float X, float Y)
{
	local float mapX, mapY, myMapScale;
	local vector temp, MapCenter, real;
	local ROGameReplicationInfo GRI;
	local ROLevelInfo levelinfo;
	local float minTimeBetweenRallyAssign;

	// Calculate 0-1 value
	mapX = (X - MapLevelImageCoordinates.PosX) / MapLevelImageCoordinates.width;
	mapY = (Y - MapLevelImageCoordinates.PosY) / MapLevelImageCoordinates.height;

	if (mapX < 0 || mapX > 1 || mapY < 0 || mapY > 1)
		return true;

	// Get GRI
	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);
	if (GRI == none)
		return false;

	// Calculate map image constants
	temp = GRI.SouthWestBounds - GRI.NorthEastBounds;
	MapCenter =  temp/2 + GRI.NorthEastBounds;
	myMapScale = abs(temp.x);

	// Modify MapX and MapY to compensate for map rotation
	real.X = MapX - 0.5;
	real.Y = MapY - 0.5;
	real = GetAdjustedHudLocation(real, true);
	MapX = real.X + 0.5;
	MapY = real.Y + 0.5;

	// Do inverse transform to find out coordinates to put rally point at
	real = MapCenter;
	real.X += (mapX - 0.5) * myMapScale;
	real.Y += (mapY - 0.5) * myMapScale;

	// Find levelinfo & assign minimum time between rally set
   	foreach AllActors(class'ROLevelInfo', levelinfo)
	   break;
	minTimeBetweenRallyAssign = 0.5;
	if (levelinfo != none)
	    minTimeBetweenRallyAssign = levelinfo.RallyPointInterval;

	// Check if we're allowed to set a rally point
	if (MapLastRallyPointAssignTime + minTimeBetweenRallyAssign * 1.05 < Level.TimeSeconds)
	{
		MapLastRallyPointAssignTime = Level.TimeSeconds;
		ROPlayer(PlayerOwner).ServerSaveRallyPointFromHud(real);
		PlayAssignSound(true);
	}
	else
		PlayAssignSound(false);

	return false;
}

function PlayAssignSound(bool bSuccessfull)
{
	if (PlayerOwner != none && PlayerOwner.ViewTarget != None )
	{
		if (bSuccessfull)
		    PlayerOwner.ViewTarget.PlaySound(AssignOKSound, SLOT_None,,,,,false);
		else
		    PlayerOwner.ViewTarget.PlaySound(AssignFailedSound, SLOT_None,,,,,false);
	}
}

/*simulated function OldDrawObjectives(Canvas C)
{
	local float X, Y, XL, YL, MapX, MapY, Scale;
	local ROGameReplicationInfo GRI;
	local int i, OwnerTeam;
	local string S;   // Ramm map stuff
	local vector HUDLocation, MapCenter;
		local float	CenterPosX, CenterPosY, Radarwidth, RadarHeight;
   	local float PlayerIconSize;
	local FinalBlend PlayerIcon;
	local Actor A;
	local vector Temp, MyArtyCoords, RallyPointCoords;
	local Material OverheadMap;
	local float	SavedOpacity;
	local Color OldDrawColor;

	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

	if (GRI == None)
		return;

	// Avoid multiple checks for this
	if( PlayerOwner != none )
	{
		OwnerTeam = PlayerOwner.GetTeamNum();
	}

	// store old opacity and set to 1.0 for map overlay rendering
	SavedOpacity = C.ColorModulate.W;
	C.ColorModulate.W = 1.0;

	scale = C.SizeX / 1600.0;

	C.Style = ERenderStyle.STY_Alpha;
	C.SetDrawColor(0,0,0,128);
	C.SetPos(0,0);
	C.DrawRect(Material'Engine.WhiteSquareTexture', C.ClipX, C.ClipY);

	C.SetPos(0, 0.025 * C.ClipY);
	C.SetDrawColor(255,255,255,255);
	C.DrawTile(HeaderImage, C.ClipX, 0.05 * C.ClipY, 0, 0, 2048, 64);

	C.SetDrawColor(0,0,0,255);
	C.Font = GetLargeMenuFont(C);
	C.DrawTextJustified(ObjectivesText, 1, 0, 0, C.ClipX, 0.10 * C.ClipY);

	C.Font = GetSmallMenuFont(C);
	C.DrawColor = WhiteColor;

	MapX = 0.45 * C.ClipX;
	MapY = 0.15 * C.ClipY;

	// Ramm map code

	Temp = GRI.SouthWestBounds - GRI.NorthEastBounds;
	MapScale = (GRI.MapImage.MaterialUSize() * Scale)/abs(Temp.X);
	MapCenter =  Temp/2 + GRI.NorthEastBounds;

	MapScale *= 1.5;

	RadarWidth = 0.5 * GRI.MapImage.MaterialUSize() * scale * 1.5;
	RadarHeight = 0.5 * GRI.MapImage.MaterialVSize() * scale * 1.5;
	CenterPosX = MapX + RadarWidth;
	CenterPosY = MapY + RadarHeight;

	// Draw the overhead map
	C.SetPos(MapX, MapY);
	if (GRI.MapImage != None)
	{
		OverheadMap = GRI.MapImage;
		C.DrawTileScaled(OverheadMap, scale * 1.5 , scale * 1.5 );
	}

	X = 0.05 * C.ClipX;
	Y = 0.15 * C.ClipY;

	// Draw resupply zones
	for (i = 0; i < ArrayCount(GRI.ResupplyAreas); i++)
	{
		if (!GRI.ResupplyAreas[i].bActive)
			continue;

		OldDrawColor = C.DrawColor;

		C.DrawColor.r=0; C.DrawColor.g=0; C.DrawColor.b=0; C.DrawColor.a=200;

		//TODO: REPLACE THIS CRAP WITH TEAM AMMO ICONS   (justinh)
		// Questionable whether we should allow players to see where the other teams ammo supply is
		if (GRI.ResupplyAreas[i].Team == AXIS_TEAM_INDEX)
			C.DrawColor.b=200;
		else if (GRI.ResupplyAreas[i].Team == ALLIES_TEAM_INDEX)
			C.DrawColor.r=200;
		else
		{
			C.DrawColor.r=200;
			C.DrawColor.g=200;
			C.DrawColor.b=200;
		}

		HUDLocation = GRI.ResupplyAreas[i].ResupplyVolumeLocation - MapCenter;
		HUDLocation.Z = 0;
		HUDLocation = GetAdjustedHudLocation(HUDLocation);

	   	C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
				  CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );

		C.DrawTileScaled(Texture'ROInterfaceArt.HUD.hud_mg42', Scale/4, Scale/4);

		C.DrawColor = OldDrawColor;
	}

	// Draw the objectives
	for (i = 0; i < ArrayCount(GRI.Objectives); i++)
	{
		if (GRI.Objectives[i] == None)
			continue;

		//S = "OBJ" $ (i + 1) $ ": ObjState ="@GRI.Objectives[i].ObjState@"bActive ="@GRI.Objectives[i].bObjActive@"CurNum[AXIS_TEAM_INDEX] ="@GRI.Objectives[i].CurNum[AXIS_TEAM_INDEX]@"CurNum[ALLIES_TEAM_INDEX] ="@GRI.Objectives[i].CurNum[ALLIES_TEAM_INDEX]@"CapturePercentage ="@GRI.Objectives[i].CapturePercentage@"DisputedCapturePercentage ="@GRI.Objectives[i].DisputedCapturePercentage;;

		if (GRI.Objectives[i].bActive) //bObjActive
		{
			S = "OBJ" $ (i + 1) $ ": ";

			if (GRI.Objectives[i].ObjState != PlayerOwner.PlayerReplicationInfo.Team.TeamIndex)
				S = S $ GRI.Objectives[i].AttackerDescription;
			else
			S = S $ GRI.Objectives[i].DefenderDescription;

			C.SetPos(X, Y);
			C.StrLen(S, XL, YL);
			//C.DrawTextClipped(S);
			C.DrawTextJustified(S, 2, X, Y, 0.4 * C.ClipX, Y + YL);

		/*if (!GRI.Objectives[i].bActive)   //bObjActive
		{
			if (GRI.Objectives[i].ObjState != PlayerOwner.PlayerReplicationInfo.Team.TeamIndex)
			{
				C.DrawColor = RedColor;
				C.DrawText("  " $ ObjFailedText);
			}
			else
			{
				C.DrawColor = GreenColor;
				C.DrawText("  " $ ObjCompleteText);
			}
		}*/

			Y += YL * 2;
		}

		HUDLocation = GRI.Objectives[i].Location - MapCenter;
		HUDLocation.Z = 0;

		HUDLocation = GetAdjustedHudLocation(HUDLocation);

		C.StrLen(GRI.Objectives[i].ObjName, XL, YL);
	    C.SetPos((CenterPosX + HUDLocation.X * MapScale) - XL / 2, (CenterPosY + HUDLocation.Y * MapScale) - YL - 16 * Scale);

		/*if (GRI.Objectives[i].ObjState == OBJ_German)
			C.DrawColor = GermanColor;
		else if (GRI.Objectives[i].ObjState == OBJ_Russian)
			C.DrawColor = RussianColor;
		else*/


		if (!GRI.Objectives[i].bActive) //bObjActive
		{
			C.DrawColor = GrayColor;
			C.DrawColor.A = 125;
		}
		else
		{
			C.DrawColor = WhiteColor;
		}
		C.DrawTextClipped(GRI.Objectives[i].ObjName);


	   	C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
				  CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );

		if (GRI.Objectives[i].ObjState == OBJ_Axis)
			C.DrawTileScaled(NationIcons[GRI.NationIndex[AXIS_TEAM_INDEX]], Scale, Scale);
		else if (GRI.Objectives[i].ObjState == OBJ_Allies)
			C.DrawTileScaled(NationIcons[GRI.NationIndex[ALLIES_TEAM_INDEX]], Scale, Scale);
		else
			C.DrawTileScaled(NeutralIcon, Scale, Scale);

		C.DrawColor = WhiteColor;
	}

	// Draw the legend - Raw but functional - Ramm
		X = 0.45 * C.ClipX;
	Y = 0.81 * C.ClipY;

  	C.SetPos(X,Y);
		C.DrawTileScaled(ArtilleryIcon, Scale, Scale);

	X = 0.48 * C.ClipX;
	Y = 0.81 * C.ClipY;
	C.SetPos(X , Y );
	C.DrawTextClipped("Artillery Coordinates");

		X = 0.45 * C.ClipX;
	Y = 0.86 * C.ClipY;
  	C.SetPos(X,Y);
		C.DrawTileScaled(RadioIcon, Scale, Scale);

	X = 0.48 * C.ClipX;
	Y = 0.86 * C.ClipY;
	C.SetPos(X , Y );
	C.DrawTextClipped("Artillery Radios");

		X = 0.45 * C.ClipX;
	Y = 0.91 * C.ClipY;
  	C.SetPos(X,Y);
		C.DrawTileScaled(RallyPointIcon, Scale, Scale);

	X = 0.48 * C.ClipX;
	Y = 0.91 * C.ClipY;
	C.SetPos(X , Y );
	C.DrawTextClipped("Rally Points");


		MyArtyCoords = ROPlayer(PlayerOwner).SavedArtilleryCoords;

	// Draw the marked arty strike
	if (MyArtyCoords != vect(0,0,0))
	{

		HUDLocation = MyArtyCoords - MapCenter;
		HUDLocation.Z = 0;

		HUDLocation = GetAdjustedHudLocation(HUDLocation);

		C.DrawColor = WhiteColor;

	   	C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
				  CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );

	    	C.DrawTileScaled(ArtilleryIcon, Scale, Scale);
	}

	// The coordinates for the rally point

	if ( OwnerTeam != 255 )
	{
	 	for (i = 0; i < ArrayCount(GRI.AxisRallyPoints); i++)
		{
			if ( OwnerTeam == AXIS_TEAM_INDEX )
			{
				RallyPointCoords = GRI.AxisRallyPoints[i].RallyPointLocation;
			}
			else if ( OwnerTeam == ALLIES_TEAM_INDEX )
			{
				RallyPointCoords = GRI.AlliedRallyPoints[i].RallyPointLocation;
			}

			// Draw the marked rally point
			if (RallyPointCoords != vect(0,0,0))
			{

				HUDLocation = RallyPointCoords - MapCenter;
				HUDLocation.Z = 0;

		          HUDLocation = GetAdjustedHudLocation(HUDLocation);

				// Don't let rally point be drawn off the map
				if (abs(HUDLocation.X * MapScale) < (RadarWidth) && abs(HUDLocation.Y  * MapScale) < (RadarHeight))
				{
					C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
					        CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );

					C.DrawColor = WhiteColor;
					C.DrawTileScaled(RallyPointIcon, Scale, Scale);
			    }
			}
		}

		// Draw Artillery Radio Icons
		if ( OwnerTeam == AXIS_TEAM_INDEX )
		{
			for ( i = 0; i < ArrayCount(GRI.AxisRadios); i++)
			{
				if(GRI.AxisRadios[i] == none)
					continue;

				HUDLocation = GRI.AxisRadios[i].Location - MapCenter;
				HUDLocation.Z = 0;

				HUDLocation = GetAdjustedHudLocation(HUDLocation);

				C.DrawColor = WhiteColor;

				C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
				CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );

				C.DrawTileScaled(RadioIcon, Scale, Scale);
			}
		}
		else if ( OwnerTeam == ALLIES_TEAM_INDEX )
		{
			for ( i = 0; i < ArrayCount(GRI.AlliedRadios); i++)
			{
				if(GRI.AlliedRadios[i] == none)
					continue;

				HUDLocation = GRI.AlliedRadios[i].Location - MapCenter;
				HUDLocation.Z = 0;

				HUDLocation = GetAdjustedHudLocation(HUDLocation);

				C.DrawColor = WhiteColor;

				C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
				CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );

				C.DrawTileScaled(RadioIcon, Scale, Scale);
			}
		}
	}


	// Draw PlayerIcon
	// I'm not sure relying on a state is necessary or appropriate in this instance - Erik
	// Well Epic sure thought it was appropriate when they used it for thier onslaught overheads - Ramm
	// See ONSHUDOnslaught.uc for more details.
	// Move this down here so the player location is rendered on top of everything
	if (PawnOwner != None)
			A = PawnOwner;
		else if (PlayerOwner.IsInState('Spectating'))
			A = PlayerOwner;
		else if (PlayerOwner.Pawn != None)
			A = PlayerOwner.Pawn;

	 PlayerIconSize = 32* Scale;

	if (A != None)
	{
// MergeTODO: Add this back in
		PlayerIcon = PlayerArrowTexture;
	   	HUDLocation = A.Location - MapCenter;
	   	HUDLocation.Z = 0;

		HUDLocation = GetAdjustedHudLocation(HUDLocation);

		//modding
		if ( GRI.OverheadOffset == 90 )
		{
		 	TexRotator(PlayerIcon.Material).Rotation.Yaw = -A.Rotation.Yaw - 32768;
		}
		else if( GRI.OverheadOffset == 180 )
		{
		 	TexRotator(PlayerIcon.Material).Rotation.Yaw = -A.Rotation.Yaw - 49152;
		}
		else if( GRI.OverheadOffset == 270 )
		{
		 	TexRotator(PlayerIcon.Material).Rotation.Yaw = -A.Rotation.Yaw;
		}
		else
		{
		 	TexRotator(PlayerIcon.Material).Rotation.Yaw = -A.Rotation.Yaw - 16384;
		}

		// Uncomment this if you don't want the player drawn off the map - Ramm
		//if (abs(HUDLocation.X * MapScale) < (RadarWidth) && abs(HUDLocation.Y  * MapScale) < (RadarHeight))
		//{
		C.SetPos( CenterPosX + HUDLocation.X * MapScale - PlayerIconSize * 0.5,
		               CenterPosY + HUDLocation.Y * MapScale - PlayerIconSize * 0.5 );

		  C.DrawColor = C.MakeColor(255,0,0);
		  C.DrawTile(PlayerIcon/*PlayerIcon*/, PlayerIconSize, PlayerIconSize, 0, 0, 64, 64);
		  C.DrawColor = WhiteColor;
		//}
		//else
		//{
		//log("We are drawing off the map");
		//}
	}

		// Overhead map debugging
	if (Level.NetMode == NM_Standalone && ROTeamGame(Level.Game).LevelInfo.bDebugOverhead)
	{
		// Corner debugging
		HUDLocation = GRI.NorthEastBounds - MapCenter;
		HUDLocation.Z = 0;

		HUDLocation = GetAdjustedHudLocation(HUDLocation);

		C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
		         CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );
		C.DrawTileScaled(NationIcons[GRI.NationIndex[ALLIES_TEAM_INDEX]], Scale, Scale);

		HUDLocation = GRI.SouthWestBounds - MapCenter;
		HUDLocation.Z = 0;

		HUDLocation = GetAdjustedHudLocation(HUDLocation);

		C.SetPos( CenterPosX + HUDLocation.X * MapScale - 16 * 0.5,
		   CenterPosY + HUDLocation.Y * MapScale - 16 * 0.5 );
		C.DrawTileScaled(NationIcons[GRI.NationIndex[AXIS_TEAM_INDEX]], Scale, Scale);
	}
	// reset hud opacity back to original value
	C.ColorModulate.W = SavedOpacity;
}*/

// This function will adjust a hud map location based on the rotation offset of the overhead map
simulated function vector GetAdjustedHudLocation(vector HudLoc, optional bool bInvert)
{
	local float SwapX, SwapY;
	local ROGameReplicationInfo GRI;
	local int OverheadOffset;

	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);
	OverheadOffset = GRI.OverheadOffset;

	if (bInvert)
	{
	    if (OverheadOffset == 90)
	       OverheadOffset = 270;
	    else if (OverheadOffset == 270)
	       OverheadOffset = 90;
	}

	//modding
	if (OverheadOffset  == 90 )
	{
		SwapX = HudLoc.Y * -1;
		SwapY = HudLoc.X ;
		HudLoc.X = SwapX;
		HudLoc.Y = SwapY;
	}
	else if( OverheadOffset == 180 )
	{
		SwapX = HudLoc.X * -1;
		SwapY = HudLoc.Y * -1;
		HudLoc.X = SwapX;
		HudLoc.Y = SwapY;
	}
	else if( OverheadOffset == 270 )
	{
		SwapX = HudLoc.Y;
		SwapY = HudLoc.X * -1;
		HudLoc.X = SwapX;
		HudLoc.Y = SwapY;
	}

	return HudLoc;
}

simulated function DrawCompass(Canvas C)
{
	local float XL, YL, playerRot, compensation;
	local actor A;
	local AbsoluteCoordsInfo GlobalCoors;
	local ROGameReplicationInfo GRI;
	local int OverheadOffset;
	local float pawnRotation;
	local ROPlayer player;
	local ROVehicleWeaponPawn myVehicleWeaponPawn;

	// Setup constants
	GlobalCoors.width = C.ClipX;
	GlobalCoors.height = C.ClipY;
	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);
	OverheadOffset = GRI.OverheadOffset;

	// Get player actor
	if (PawnOwner != None)
		A = PawnOwner;
	else if (PlayerOwner.IsInState('Spectating'))
		A = PlayerOwner;
	else if (PlayerOwner.Pawn != None)
		A = PlayerOwner.Pawn;

	// Fix for frelled rotation on weapon pawns
	myVehicleWeaponPawn = ROVehicleWeaponPawn(A);
	if (myVehicleWeaponPawn != none)
	{
	   player = ROPlayer(myVehicleWeaponPawn.Controller);
	   if (player != none && myVehicleWeaponPawn.VehicleBase != none)
	       pawnRotation = player.CalcViewRotation.Yaw;
	   else if (myVehicleWeaponPawn.VehicleBase != none)
	       pawnRotation = myVehicleWeaponPawn.VehicleBase.Rotation.Yaw;
	   else
	       pawnRotation = A.Rotation.Yaw;
	}
	else if (A != none)
	   pawnRotation = A.Rotation.Yaw;

	// Compensate for map rotation
	compensation = float(OverheadOffset) / 90 * 16384 + 16384;

	// Figure which direction we're pointing
	if (A != none)
	   playerRot = pawnRotation + compensation;
	else // shouldn't ever happen but better safe than log-spammy
	   playerRot = compassCurrentRotation;

	// Pre-bind compass rotation to a -32000 to 32000 range relative to playerRot
	while (compassCurrentRotation - playerRot > 32768)
		compassCurrentRotation -= 65536;
	while (compassCurrentRotation - playerRot < -32768)
		compassCurrentRotation += 65536;

	// Update compass rotation
	compassCurrentRotation = compassCurrentRotation + compassStabilizationConstant * (playerRot - compassCurrentRotation) * (Level.TimeSeconds - hudLastRenderTime);

	// Update needle rotation
	TexRotator(CompassNeedle.WidgetTexture).Rotation.Yaw = compassCurrentRotation;

	// Draw compass base (fake, only to get sizes)
	DrawSpriteWidgetClipped(C, CompassBase, GlobalCoors, true, XL, YL, true, true, true);

	// Calculate needle screen offset
	CompassNeedle.OffsetX = (GlobalCoors.Width * -0.005) + default.CompassNeedle.OffsetX +//default.CompassNeedle.OffsetX * CompassBase.TextureScale +
		CompassBase.OffsetX - XL / HudScale / 2;
	CompassNeedle.OffsetY = default.CompassNeedle.OffsetY +//default.CompassNeedle.OffsetY * CompassBase.TextureScale +
		CompassBase.OffsetY - YL / HudScale  / 2;
	//CompassXL = abs(CompassNeedle.OffsetX - XL / 2);
	//CompassYL = abs(CompassNeedle.OffsetY - YL / 2);

	// Draw the compass needle
	DrawSpriteWidgetClipped(C, CompassNeedle, GlobalCoors, true, XL, YL, true, true, true);

	// Draw compass base
	DrawSpriteWidgetClipped(C, CompassBase, GlobalCoors, true, XL, YL, true, true, true);

	// Draw icons
	if (CompassIconsOpacity > 0 || bShowObjectives)
		DrawCompassIcons(C, CompassNeedle.OffsetX, CompassNeedle.OffsetY,
						XL / HudScale / 2 * compassIconsPositionRadius, -(A.Rotation.Yaw + 16384), A, GlobalCoors);
}

// Draw the required icons on the compass
simulated function DrawCompassIcons(Canvas C, float CenterX, float CenterY, float Radius,
									float rotationCompensation, actor viewer, AbsoluteCoordsInfo GlobalCoords)
{
	local vector target, current;
	local int i, team, id, count, temp_team;
	local ROGameReplicationInfo GRI;
	local float angle, XL, YL;
	local rotator rotAngle;

	// Decrement opacity if needed, increment if needed
	if (bShowObjectives)
		compassIconsOpacity = fmin(1.0, compassIconsOpacity + compassIconsRefreshSpeed * (Level.TimeSeconds - hudLastRenderTime));
	else
		compassIconsOpacity -= compassIconsFadeSpeed * (Level.TimeSeconds - hudLastRenderTime);

	// Get user's team & position
	if (Pawn(viewer) != none)
	{
		if (Pawn(viewer).Controller != none)
			team = Pawn(viewer).Controller.PlayerReplicationInfo.Team.TeamIndex;
		else
			team = 255;
	}
	else
	{
		if (Controller(viewer) != none)
			team = Controller(viewer).PlayerReplicationInfo.Team.TeamIndex;
		else
			team = 255;
	}
	current = viewer.location;

	// Get GRI
	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);
	if (GRI == none)
		return;

	// Update waypoints array if needed
	if (bShowObjectives)
	{
		temp_team = max(0, min(1, team));

		count = 0;
		// Clear old array
		for (i = 0; i < arraycount(compassIconsTargetsActive); i++)
			compassIconsTargetsActive[i] = 0;

		if (team == AXIS_TEAM_INDEX || team == ALLIES_TEAM_INDEX)
		{
			// Add under-attack objectives (territory objs only)
			/*for (i = 0; i < ArrayCount(GRI.Objectives); i++)
			{
				if (GRI.Objectives[i] == none || GRI.Objectives[i].CompressedCapProgress == 0
					|| GRI.Objectives[i].CurrentCapTeam == NEUTRAL_TEAM_INDEX)
				{
				    continue;
				}

				// if array is full, stop adding waypoints
				if (count >= arraycount(compassIconsTargetsActive))
				    break;
				compassIconsTargetsActive[count] = 1;

				if (GRI.Objectives[i].ObjState == OBJ_Axis)
				    compassIconsTargetsColor[count] = compassIconsColorsAxis;
				else if (GRI.Objectives[i].ObjState == OBJ_Allies)
					compassIconsTargetsColor[count] = compassIconsColorsAllies;
				else
				    compassIconsTargetsColor[count] = compassIconsColorsNeutral;

				compassIconsTargets[count] = GRI.Objectives[i].location;

				count++;
			}*/

			// Add all rally points
			for (i = 0; i < ArrayCount(GRI.AxisRallyPoints); i++)
			{
				// if array is full, stop adding waypoints
				if (count >= arraycount(compassIconsTargetsActive))
				    break;
				//compassIconsTargetsColor[count] = compassIconsColorsRally;

				if (team == AXIS_TEAM_INDEX)
					target = GRI.AxisRallyPoints[i].RallyPointLocation;
				else
					target = GRI.AlliedRallyPoints[i].RallyPointLocation;
				compassIconsTargetsWidgetCoords[count] = MapIconRally[temp_team].TextureCoords;

				if (target != vect(0,0,0))
				{
					compassIconsTargets[count] =  target;
		   			compassIconsTargetsActive[count] = 1;
					count++;
				}

			}

			// Add all help requests
			for (i = 0; i < ArrayCount(GRI.AxisHelpRequests); i++)
			{
				// if array is full, stop adding waypoints
				if (count >= arraycount(compassIconsTargetsActive))
				    break;

				if (team == AXIS_TEAM_INDEX)
				{
					target = GRI.AxisHelpRequestsLocs[i];
					id = GRI.AxisHelpRequests[i].requestType;
				}
				else
				{
					target = GRI.AlliedHelpRequestsLocs[i];
					id = GRI.AlliedHelpRequests[i].requestType;
				}

				if (id != 255)
				{
					if (id == 3) // MG resupply
						compassIconsTargetsWidgetCoords[count] = MapIconMGResupplyRequest[temp_team].TextureCoords;
						//compassIconsTargetsColor[count] = compassIconsColorsMGResupply;
					else if (id == 0 || id == 4) // Help request at coords or at obj
						compassIconsTargetsWidgetCoords[count] = MapIconHelpRequest.TextureCoords;
						//compassIconsTargetsColor[count] = compassIconsColorsHelpRequests;
					else if (id == 1 || id == 2) // Attack/defend obj
						compassIconsTargetsWidgetCoords[count] = MapIconAttackDefendRequest.TextureCoords;
						//compassIconsTargetsColor[count] = compassIconsColorsHelpRequests;
					else
						continue;

					compassIconsTargets[count] =  target;
		   			compassIconsTargetsActive[count] = 1;
					count++;
				}
			}

		}
	}

	// Go through waypoint array and draw the icons
	for (i = 0; i < ArrayCount(compassIconsTargetsActive); i++)
	{
		if (compassIconsTargetsActive[i] == 1)
		{
			// Update widget color & texture
			//CompassIcons.Tints[TeamIndex] = compassIconsTargetsColor[i];
			//CompassIcons.Tints[TeamIndex].A = float(compassIconsTargetsColor[i].A) * compassIconsOpacity;
			//CompassIcons.WidgetTexture = compassIconsRotators[i];
			CompassIcons.TextureCoords = compassIconsTargetsWidgetCoords[i];
			CompassIcons.Tints[TeamIndex].A = float(default.CompassIcons.Tints[TeamIndex].A) * compassIconsOpacity;

			// Calculate rotation
			rotAngle = rotator(compassIconsTargets[i] - current);
			angle = (rotAngle.Yaw + rotationCompensation) * PI / 32768;

			// Update texrotator rotation
			//compassIconsRotators[i].Rotation.yaw = -rotAngle.Yaw - rotationCompensation - 8192;

			// Update widget offset
			CompassIcons.OffsetX = CenterX + Radius * cos(angle);
			CompassIcons.OffsetY = CenterY + Radius * sin(angle);

			// Draw waypoint image
			DrawSpriteWidgetClipped(C, CompassIcons, GlobalCoords, true, XL, YL, true, true, true);
		}
	}

}

// Draw a single icon on the compass
simulated function DrawCompassIcon(Canvas C, AbsoluteCoordsInfo G, float radius, float rotComp, vector diff, float X, float Y)
{
	local float angle, XL, YL;
	local rotator rotAngle;

	rotAngle = rotator(diff);
	//angle = (rotAngle.Yaw + rotComp - 16384) * PI / 32768; // non-rotating icons
	angle = (rotAngle.Yaw + rotComp) * PI / 32768; // icons rotating with player

	diff.Z = 0;
	XL = radius; //* fmin(1, VSize(diff)/compassIconsUUDistance);

	CompassIcons.OffsetX = X + XL * cos(angle);
	CompassIcons.OffsetY = Y + XL * sin(angle);
	DrawSpriteWidgetClipped(C, CompassIcons, G, true, XL, YL, true, true, true);
}

simulated function DrawLocationHits(Canvas C, ROPawn P)
{
	local int i;
	local bool bNewDrawHits;
	local SpriteWidget widget;

	for (i = 0; i < arraycount(P.DamageList); i++)
	{
		if (P.DamageList[i] > 0)
		{
			// Draw hit
			widget = HealthFigure;
			if (TeamIndex == AXIS_TEAM_INDEX)
				widget.WidgetTexture = locationHitAxisImages[i];
			else if (TeamIndex == AXIS_TEAM_INDEX)
				widget.WidgetTexture = locationHitAlliesImages[i];
			else
				continue;

			DrawSpriteWidget(C, widget);

			if (locationHitAlphas[i] > 0)
				bNewDrawHits = true;
		}
	}

	bDrawHits = bNewDrawHits;
}

simulated function DrawCaptureBar(Canvas Canvas)
{
	local ROGameReplicationInfo GRI;
	local ROPawn p;
	local ROVehicle veh;
	local ROVehicleWeaponPawn pveh;
	local int team;
	local byte CurrentCapArea, CurrentCapProgress, CurrentCapAxisCappers, CurrentCapAlliesCappers;
	local float axis_progress, allies_progress;
	local float attackers_progress, attackers_ratio, defenders_progress, defenders_ratio;
	local float XL, YL, Y_pos;
	local string s;

	bDrawingCaptureBar = false;

	// Don't draw if we have no associated pawn!
	if (PawnOwner == none)
		return;

	// Get capture info from associated pawn
	p = ROPawn(PawnOwner);
	if (p != none)
	{
		CurrentCapArea = p.CurrentCapArea;
		CurrentCapProgress = p.CurrentCapProgress;
		CurrentCapAxisCappers = p.CurrentCapAxisCappers;
		CurrentCapAlliesCappers = p.CurrentCapAlliesCappers;
	}
	else
	{
		// Not a ROPawn, check if current pawn is a vehicle
		veh = ROVehicle(PawnOwner);
		if (veh != none)
		{
			CurrentCapArea = veh.CurrentCapArea;
			CurrentCapProgress = veh.CurrentCapProgress;
			CurrentCapAxisCappers = veh.CurrentCapAxisCappers;
			CurrentCapAlliesCappers = veh.CurrentCapAlliesCappers;
		}
		else
		{
			// Not a ROVehicle, check if current pawn is a ROVehicleWeaponPawn
			pveh = ROVehicleWeaponPawn(PawnOwner);
			if (pveh != none)
			{
				CurrentCapArea = pveh.CurrentCapArea;
				CurrentCapProgress = pveh.CurrentCapProgress;
				CurrentCapAxisCappers = pveh.CurrentCapAxisCappers;
				CurrentCapAlliesCappers = pveh.CurrentCapAlliesCappers;
			}
			else
			{
				// Unsupported pawn type, return.
				return;
			}
		}
	}

	// Don't render if we're not in a capture zone
	if (CurrentCapArea == 255)
		return;

	// Get GRI
	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);
	if (GRI == none)
		return; // Can't draw without a gri!

	// Get current team
	if (PawnOwner.PlayerReplicationInfo != none && PawnOwner.PlayerReplicationInfo.Team != none)
		team = PawnOwner.PlayerReplicationInfo.Team.TeamIndex;
	else
		team = 0;

	// Get current cap progress on a 0-1 scale for each team
	if (CurrentCapProgress == 0)
	{
		if (GRI.Objectives[CurrentCapArea].ObjState == NEUTRAL_TEAM_INDEX)
		{
			allies_progress = 0;
			axis_progress = 0;
		}
		else if (GRI.Objectives[CurrentCapArea].ObjState == AXIS_TEAM_INDEX)
		{
			allies_progress = 0;
			axis_progress = 1;
		}
		else
		{
			allies_progress = 1;
			axis_progress = 0;
		}
	}
	else if (CurrentCapProgress > 100)
	{
		allies_progress = float(CurrentCapProgress - 100) / 100.0;
		if (GRI.Objectives[CurrentCapArea].ObjState != NEUTRAL_TEAM_INDEX)
			axis_progress = 1 - allies_progress;
	}
	else
	{
		axis_progress = float(CurrentCapProgress) / 100.0;
		if (GRI.Objectives[CurrentCapArea].ObjState != NEUTRAL_TEAM_INDEX)
			allies_progress = 1 - axis_progress;
	}

	// Assign those progress to defender or attacker, depending on current team
	if (team == AXIS_TEAM_INDEX)
	{
		attackers_progress = axis_progress;
		defenders_progress = allies_progress;
		CaptureBarAttacker.Tints[TeamIndex] = CaptureBarTeamColors[AXIS_TEAM_INDEX];
		CaptureBarAttackerRatio.Tints[TeamIndex] = CaptureBarTeamColors[AXIS_TEAM_INDEX];
		CaptureBarDefender.Tints[TeamIndex] = CaptureBarTeamColors[ALLIES_TEAM_INDEX];
		CaptureBarDefenderRatio.Tints[TeamIndex] = CaptureBarTeamColors[ALLIES_TEAM_INDEX];
		CaptureBarIcons[0].WidgetTexture = CaptureBarTeamIcons[AXIS_TEAM_INDEX];
		CaptureBarIcons[1].WidgetTexture = CaptureBarTeamIcons[ALLIES_TEAM_INDEX];

		// Figure ratios
		if (CurrentCapAlliesCappers == 0)
			attackers_ratio = 1;
		else if (CurrentCapAxisCappers == 0)
			attackers_ratio = 0;
		else
			attackers_ratio = float(CurrentCapAxisCappers) / (CurrentCapAxisCappers + CurrentCapAlliesCappers);
		defenders_ratio = 1 - attackers_ratio;
	}
	else
	{
		attackers_progress = allies_progress;
		defenders_progress = axis_progress;
		CaptureBarAttacker.Tints[TeamIndex] = CaptureBarTeamColors[ALLIES_TEAM_INDEX];
		CaptureBarAttackerRatio.Tints[TeamIndex] = CaptureBarTeamColors[ALLIES_TEAM_INDEX];
		CaptureBarDefender.Tints[TeamIndex] = CaptureBarTeamColors[AXIS_TEAM_INDEX];
		CaptureBarDefenderRatio.Tints[TeamIndex] = CaptureBarTeamColors[AXIS_TEAM_INDEX];
		CaptureBarIcons[0].WidgetTexture = CaptureBarTeamIcons[ALLIES_TEAM_INDEX];
		CaptureBarIcons[1].WidgetTexture = CaptureBarTeamIcons[AXIS_TEAM_INDEX];

		// Figure ratios
		if (CurrentCapAxisCappers == 0)
			attackers_ratio = 1;
		else if (CurrentCapAlliesCappers == 0)
			attackers_ratio = 0;
		else
			attackers_ratio = float(CurrentCapAlliesCappers) / (CurrentCapAxisCappers + CurrentCapAlliesCappers);
		defenders_ratio = 1 - attackers_ratio;
	}

	// test0r
	//Canvas.Font = GetConsoleFont(Canvas);
	//Canvas.SetPos(Canvas.ClipX * 0.1, Canvas.clipy * 0.2);
	//Canvas.DrawText("attackers_ratio = " $ attackers_ratio $ ", defenders_ratio = " $ defenders_ratio);
	//Canvas.SetPos(Canvas.ClipX * 0.1, Canvas.clipy * 0.25);
	//Canvas.DrawText("CurrentCapAlliesCappers = " $ CurrentCapAlliesCappers $ ", CurrentCapAxisCappers = " $ CurrentCapAxisCappers);

	// Draw capture bar at 50% faded if we're at a stalemate
	if (CurrentCapAxisCappers == CurrentCapAlliesCappers)
	{
		CaptureBarAttacker.Tints[TeamIndex].A /= 2;
		CaptureBarDefender.Tints[TeamIndex].A /= 2;
	}

	// Convert attacker/defender progress to widget scale
	// (bar goes from 53 to 203, total width of texture is 256)
	CaptureBarAttacker.Scale = 150.0 / 256.0 * attackers_progress + 53.0 / 256.0;
	CaptureBarDefender.Scale = 150.0 / 256.0 * defenders_progress + 53.0 / 256.0;

	// Convert attacker/defender ratios to widget scale
	// (bar goes from 63 to 193, total width of texture is 256)
	CaptureBarAttackerRatio.Scale = 130.0 / 256.0 * attackers_ratio + 63.0 / 256.0;
	CaptureBarDefenderRatio.Scale = 130.0 / 256.0 * defenders_ratio + 63.0 / 256.0;

	// Check which icon to show on right side
	if (attackers_progress ~= 1.0)
		CaptureBarIcons[1].WidgetTexture = CaptureBarIcons[0].WidgetTexture;

	// Draw everything.
	DrawSpriteWidget(Canvas, CaptureBarBackground);
	DrawSpriteWidget(Canvas, CaptureBarAttacker);
	DrawSpriteWidget(Canvas, CaptureBarDefender);
	DrawSpriteWidget(Canvas, CaptureBarAttackerRatio);
	DrawSpriteWidget(Canvas, CaptureBarDefenderRatio);
	DrawSpriteWidget(Canvas, CaptureBarOutline);

	// Draw the left icon
	DrawSpriteWidget(Canvas, CaptureBarIcons[0]);

	// Only draw right icon if objective is capped already
	if ( !(defenders_progress ~= 0.0) || (attackers_progress ~= 1.0) )
		DrawSpriteWidget(Canvas, CaptureBarIcons[1]);

	// Draw the objective name
	Y_pos = Canvas.ClipY * CaptureBarBackground.PosY
		- (CaptureBarBackground.TextureCoords.Y2 + 1 + 4)
			* CaptureBarBackground.TextureScale * HudScale * ResScaleY;
	s = GRI.Objectives[CurrentCapArea].ObjName;
	Canvas.Font = GetConsoleFont(Canvas);
	Canvas.TextSize(s, XL, YL);
	Canvas.DrawColor = WhiteColor;
	Canvas.SetPos(Canvas.ClipX * CaptureBarBackground.PosX - XL / 2.0, Y_pos - YL);
	Canvas.DrawText(s);

	// Add signal so that vehicle passenger list knows to shift text up
	bDrawingCaptureBar = true;
}

// This function draws a hint on the hud. The hint to be drawn
// is set by calling ShowHint().
function DrawHint(Canvas Canvas)
{
	local float alpha; // 0 - 1
	local float XL, YL;
	local AbsoluteCoordsInfo coords;
	local color DrawColor;
	local float backgroundOffset;
	local int i;

	// Calculate wrapping width & draw coords if needed
	if (bFirstHintRender)
	{
		CalculateHintWrappingData(Canvas);
		bFirstHintRender = false;
	}

	// Calculate alpha value
	if (HintRemainingTime > HintLifetime + HintFadeTime) // Fade in
	{
		alpha = 1 - (HintRemainingTime - HintLifetime - HintFadeTime) / HintFadeTime;
	}
	else if (HintRemainingTime < HintFadeTime) // Fade out
	{
		alpha = HintRemainingTime / HintFadeTime;
	}
	else
		alpha = 1.0;

	// Decrement remaining time if needed
	if (PlayerOwner.Player != none &&
		GUIController(PlayerOwner.Player.GUIController) != none &&
		GUIController(PlayerOwner.Player.GUIController).ActivePage != none) // don't decrement if menu is open
	{
	}
	else
		HintRemainingTime -= Level.TimeSeconds - hudLastRenderTime;

	// Calculate rendering color
	DrawColor = HintBackground.Tints[TeamIndex];
	DrawColor.A = float(DrawColor.A) * alpha;

	// Don't draw if alpha is 0 (0 == 255 for some reason)
	if (DrawColor.A != 0)
	{
		// Set proper rendering style
		Canvas.Style = ERenderStyle.STY_Alpha;

		// Calculate background offset in relation to text
		backgroundOffset = HintBackground.PosY * Canvas.ClipY;

		// Calculate absolute drawing coordinates (mostly for text widget)
		coords.PosX = HintCoords.X * Canvas.ClipX;
		coords.PosY = HintCoords.Y * Canvas.ClipY;
		coords.width = HintCoords.XL * Canvas.ClipX;
		coords.height = HintCoords.YL * Canvas.ClipY;

		// Draw the background
		Canvas.DrawColor = DrawColor;
		Canvas.SetPos(coords.PosX - backgroundOffset, coords.PosY - backgroundOffset);
		Canvas.DrawTileStretched(HintBackground.WidgetTexture, coords.width + backgroundOffset * 2,
			coords.height + backgroundOffset * 2);

		// Draw title
		Canvas.Font = GetFontSizeIndex(Canvas,-2);
		HintTitleWidget.text = HintTitle;
		HintTitleWidget.Tints[TeamIndex].A = float(default.HintTitleWidget.Tints[TeamIndex].A) * alpha;
		DrawTextWidgetClipped(Canvas, HintTitleWidget, coords, XL, YL);

		// Draw each line individually
		HintTextWidget.OffsetY = YL * 1.5;
		Canvas.Font = getSmallMenuFont(Canvas);
		HintTextWidget.Tints[TeamIndex].A = float(default.HintTextWidget.Tints[TeamIndex].A) * alpha;
		YL = 0;
		for (i = 0; i < HintWrappedText.Length; i++)
		{
			HintTextWidget.text = HintWrappedText[i];
			if (HintWrappedText[i] != "")
				DrawTextWidgetClipped(Canvas, HintTextWidget, coords, XL, YL);
			else
				YL /= 2;
			HintTextWidget.OffsetY += YL;
		}
	}

	// Stop rendering hint if needed (and notify hint manager)
	if (HintRemainingTime <= 0)
	{
		bDrawHint = false;
		if (ROPlayer(PlayerOwner) != none)
			ROPlayer(PlayerOwner).NotifyHintRenderingDone();
	}
}

// This function is used to calculate how the hint data should
// be wrapped.
function CalculateHintWrappingData(Canvas Canvas)
{
	local float XL, YL, XL2, YL2;
	local float minWidth, wrapWidth, totalYL;
	local int i, count;

	// First calculate minimum message width (e.g. the width of the
	// title string)
	Canvas.Font = GetFontSizeIndex(Canvas,-2);
	Canvas.SetPos(0, 0);
	Canvas.TextSize(HintTitle, minWidth, totalYL);
	if (minWidth < 10.0)
		minWidth = 10.0;
	totalYL += totalYL / 2;

	// Calculate max width of text string (or perhaps we should just use full screen width?)
	Canvas.Font = getSmallMenuFont(Canvas);
	Canvas.TextSize(HintText, XL, YL);

	// Starting with full string width, progressively reduce width until the ratio of the height
	// to the width is smaller than HintDesiredAspectRatio
	wrapWidth = XL;
	for (count = 0; count < 25; count++) // max 25 iterations
	{
		// Wrap text
		HintWrappedText.Length = 0;
		Canvas.WrapStringToArray(HintText, HintWrappedText, wrapWidth, "|");

		// Calculate current width & height
		XL = 0; YL = 0;
		XL2 = 0; YL2 = 0;
		for (i = 0; i < HintWrappedText.Length; i++)
		{
			if (HintWrappedText[i] != "")
				Canvas.TextSize(HintWrappedText[i], XL, YL);
			else
				YL /= 2;
			if (XL > XL2)
				XL2 = XL;
			YL2 += YL;
		}

		// Check if current width is too small
		if (XL2 < minWidth)
		{
			wrapWidth = minWidth;
			break;
		}

		// Calculate ratio
		if (YL2 < 1)
			YL = 1;
		else
			YL = XL2 / YL2;

		// Check if we should accept this wrap width
		if (YL < HintDesiredAspectRatio)
		{
			wrapWidth = XL2;
			break;
		}

		// Else, reduce currentWidth and try again.
		wrapWidth *= 0.80;
	}

	// Wrap text to array
	HintWrappedText.Length = 0;
	Canvas.SetPos(0, 0);
	Canvas.WrapStringToArray(HintText, HintWrappedText, wrapWidth, "|");

	// Calculate total width and height
	wrapWidth = minWidth;
	XL = 0; YL = 0;
	for (i = 0; i < HintWrappedText.Length; i++)
	{
		Canvas.SetPos(0, 0);
		if (HintWrappedText[i] != "")
			Canvas.TextSize(HintWrappedText[i], XL, YL);
		else
			YL /= 2;
		if (XL > wrapWidth)
			wrapWidth = XL;
		totalYL += YL;
		//log("Wrapped line #" $ i $ ": '" $ HintWrappedText[i] $"'");
	}

	// for safety
	if (wrapWidth < 10)
		wrapWidth = 10;
	if (totalYL < 10)
		totalYL = 10;

	// Calculate target relative coordinates
	HintCoords.XL = wrapWidth / Canvas.ClipX;
	HintCoords.YL = totalYL / Canvas.ClipY;
	HintCoords.X = default.HintCoords.X + HintCoords.XL * default.HintCoords.XL;
	HintCoords.Y = default.HintCoords.Y + HintCoords.YL * default.HintCoords.YL;
}

simulated function DrawPaused(Canvas Canvas)
{
	local float XL, YL;

	Canvas.Font = GetFontSizeIndex(Canvas, 5);
	Canvas.TextSize(LevelActionPaused, XL, YL);
	Canvas.SetPos(Canvas.SizeX * 0.5 - XL / 2, Canvas.SizeY * 0.4 - YL / 2);
	Canvas.DrawColor = WhiteColor;
	Canvas.DrawText(LevelActionPaused);
}

//-----------------------------------------------------------------------------
// PostRender - Added objectives rendering
//-----------------------------------------------------------------------------

simulated event PostRender( canvas Canvas )
{
	local float XPos, YPos;
	local plane OldModulate,OM;
	local color OldColor;
	local int i;

	BuildMOTD();

	OldModulate = Canvas.ColorModulate;
	OldColor = Canvas.DrawColor;

	Canvas.ColorModulate.X = 1;
	Canvas.ColorModulate.Y = 1;
	Canvas.ColorModulate.Z = 1;
	Canvas.ColorModulate.W = HudOpacity/255;

	LinkActors();

	ResScaleX = Canvas.SizeX / 640.0;
	ResScaleY = Canvas.SizeY / 480.0;

	CheckCountDown(PlayerOwner.GameReplicationInfo);

	if (bFadeToBlack)
	    DrawFadeToBlack(Canvas);

	if ( PawnOwner != None && PawnOwner.bSpecialHUD )
		PawnOwner.DrawHud(Canvas);

	if ( bShowDebugInfo )
	{
		Canvas.Font = GetConsoleFont(Canvas);
		Canvas.Style = ERenderStyle.STY_Alpha;
		Canvas.DrawColor = ConsoleColor;

		PlayerOwner.ViewTarget.DisplayDebug(Canvas, XPos, YPos);
		if (PlayerOwner.ViewTarget != PlayerOwner && (Pawn(PlayerOwner.ViewTarget) == None || Pawn(PlayerOwner.ViewTarget).Controller == None))
		{
			YPos += XPos * 2;
			Canvas.SetPos(4, YPos);
			Canvas.DrawText("----- VIEWER INFO -----");
			YPos += XPos;
			Canvas.SetPos(4, YPos);
			PlayerOwner.DisplayDebug(Canvas, XPos, YPos);
		}
	}
	else if( !bHideHud )
	{
	   /* if ( bShowLocalStats )
		{
			if ( LocalStatsScreen == None )
				GetLocalStatsScreen();
			if ( LocalStatsScreen != None )
			{
				OM = Canvas.ColorModulate;
				Canvas.ColorModulate = OldModulate;
				LocalStatsScreen.DrawScoreboard(Canvas);
				DisplayMessages(Canvas);
				Canvas.ColorModulate = OM;
			}
		}
		else*/
		if (bShowScoreBoard)
		{
	        DrawFadeEffect(Canvas);
			if (ScoreBoard != None)
			{
				OM = Canvas.ColorModulate;
				Canvas.ColorModulate = OldModulate;
				ScoreBoard.DrawScoreboard(Canvas);
				if ( Scoreboard.bDisplayMessages )
					DisplayMessages(Canvas);
				Canvas.ColorModulate = OM;
			}
		}
		else
		{
			if ( (PlayerOwner == None) || (PawnOwner == None) || (PawnOwnerPRI == None) || PlayerOwner.IsSpectating() )
				DrawSpectatingHud(Canvas);
			else if( !PawnOwner.bHideRegularHUD )
				DrawHud(Canvas);

			for (i = 0; i < Overlays.length; i++)
				Overlays[i].Render(Canvas);

			if (!DrawLevelAction (Canvas))
			{
				if (PlayerOwner!=None)
				{
					if (PlayerOwner.ProgressTimeOut > Level.TimeSeconds)
					{
	                    DisplayProgressMessages (Canvas);
					}
					else if (MOTDState==1)
						MOTDState=2;
				}
		   }

			if (bShowBadConnectionAlert)
				DisplayBadConnectionAlert (Canvas);
			DisplayMessages(Canvas);

		}

        if( bShowVoteMenu && VoteMenu!=None )
            VoteMenu.RenderOverlays(Canvas);
    }
    else if ( PawnOwner != None )
        DrawInstructionGfx(Canvas);


	// Draw fade effects even if the hud is hidden so poeple can't just turn off thier hud
	if( bHideHud )
	{
    	Canvas.Style = ERenderStyle.STY_Alpha;
    	DrawFadeEffect(Canvas);
	}

	// Render situation map on top of everything (so that
	// it can anim in/out without looking like ass)
	if (bShowObjectives || bAnimateMapIn || bAnimateMapOut)
	{
		DrawObjectives(Canvas);
	}

	PlayerOwner.RenderOverlays(Canvas);

	if (PlayerOwner.bViewingMatineeCinematic)
	DrawCinematicHUD(Canvas);

	if (bDrawHint && !bHideHud)
	    DrawHint(Canvas);

	if (Level.Pauser != none)
	    DrawPaused(Canvas);

	if ((PlayerConsole != None) && PlayerConsole.bTyping)
		DrawTypingPrompt(Canvas, PlayerConsole.TypedStr, PlayerConsole.TypedStrPos);

	if (bCapturingMouse)
		MouseInterfaceDrawCursor(Canvas);

	Canvas.ColorModulate=OldModulate;
	Canvas.DrawColor = OldColor;

	hudLastRenderTime = Level.TimeSeconds;

	if (GUIController(PlayerOwner.Player.GUIController).bLCDAvailable() )
	{
		if (Level.TimeSeconds  - LastLCDUpdateTime > LCDUpdateFreq)
		{
			LastLCDUpdateTime = Level.TimeSeconds;
			DrawLCDUpdate(Canvas);
		}
	}
}

//-----------------------------------------------------------------------------
// CanvasDrawActors - Always set opacity to 1.0 before calling Weapon's PostRender
//-----------------------------------------------------------------------------

function CanvasDrawActors( Canvas C, bool bClearedZBuffer )
{
	local float SavedOpacity;

   // log("PawnOwner = "$PawnOwner$" PawnOwner.Weapon = "$PawnOwner.Weapon);

	if ( !PlayerOwner.bBehindView && PawnOwner.Weapon != None )
	{
		if ( !bClearedZBuffer)
			C.DrawActor(None, false, true); // Clear the z-buffer here

		SavedOpacity = C.ColorModulate.W;
		C.ColorModulate.W = 1.0;
		PawnOwner.Weapon.RenderOverlays( C );
		C.ColorModulate.W = SavedOpacity;
	}
}

//==================================================================
// DisplayProgressMessages(UT) - Had to overload this to function to
//	change the position of the ProgressMessages so they wouldn't be
//	in the middle of the iron sights
//==================================================================

simulated function DisplayProgressMessages (Canvas C)
{
	local int i, LineCount;
	local GameReplicationInfo GRI;
	local float FontDX, FontDY;
	local float X, Y;
	local int Alpha;
	local float TimeLeft;

	TimeLeft = PlayerOwner.ProgressTimeOut - Level.TimeSeconds;

	if( TimeLeft >= ProgressFadeTime )
		Alpha = 255;
	else
		Alpha = (255 * TimeLeft) / ProgressFadeTime;

	GRI = PlayerOwner.GameReplicationInfo;

	LineCount = 0;

	for (i = 0; i < ArrayCount (PlayerOwner.ProgressMessage); i++)
	{
		if (PlayerOwner.ProgressMessage[i] == "")
			continue;

		LineCount++;
	}

	if (bBuiltMOTD && MOTDState<2)
	{
		if (MOTD[0] != "") LineCount++;
		if (MOTD[1] != "") LineCount++;
		if (MOTD[2] != "") LineCount++;
		if (MOTD[3] != "") LineCount++;
	}


	C.Font = LoadProgressFont();

	C.Style = ERenderStyle.STY_Alpha;

	C.TextSize ("A", FontDX, FontDY);

	X = (0.5 * HudCanvasScale * C.SizeX) + (((1.0 - HudCanvasScale) / 2.0) * C.SizeX);
	// changed the Y scale to move the message up
	Y = (0.42 * HudCanvasScale * C.SizeY) + (((1.0 - HudCanvasScale) / 2.0) * C.SizeY);

	Y -= FontDY * (float (LineCount) / 2.0);

	for (i = 0; i < ArrayCount (PlayerOwner.ProgressMessage); i++)
	{
		if (PlayerOwner.ProgressMessage[i] == "")
			continue;

		C.DrawColor = PlayerOwner.ProgressColor[i];
		C.DrawColor.A = Alpha;

		C.TextSize (PlayerOwner.ProgressMessage[i], FontDX, FontDY);
		C.SetPos (X - (FontDX / 2.0), Y);
		C.DrawText (PlayerOwner.ProgressMessage[i]);

		Y += FontDY;
	}

	if( (GRI != None) && (Level.NetMode != NM_StandAlone) && (MOTDState<2) )
	{
		MOTDState=1;
		C.DrawColor = MOTDColor;
		C.DrawColor.A = Alpha;

		for (i=0;i<4;i++)
		{
			C.TextSize (MOTD[i], FontDX, FontDY);
			C.SetPos (X - (FontDX / 2.0), Y);
			C.DrawText (MOTD[i]);
			Y += FontDY;
		}

	}
}


//-----------------------------------------------------------------------------
// DisplayLocalMessage - Adds a fix for non-fade local messages staying on screen
//-----------------------------------------------------------------------------

simulated function DisplayLocalMessages( Canvas C )
{
	local float PosX, PosY, DY, DX;
	local int i, j;
	local float FadeValue;
	local Plane OldCM;

	OldCM=C.ColorModulate;
	C.Reset();
	C.ColorModulate = OldCM;

	// Pass 1: Layout anything that needs it and cull dead stuff.

	for( i = 0; i < ArrayCount(LocalMessages); i++ )
	{
		if( LocalMessages[i].Message == none )
			break;

		LocalMessages[i].Drawn = false;

		if( LocalMessages[i].StringFont == none )
		{
			LayoutMessage( LocalMessages[i], C );
			ExtraLayoutMessage( LocalMessages[i], LocalMessagesExtra[i], C );
		}

		if( LocalMessages[i].StringFont == none )
		{
			log( "LayoutMessage("$LocalMessages[i].Message$") failed!", 'Error' );

			for( j = i; j < ArrayCount(LocalMessages) - 1; j++ )
			{
				LocalMessages[j] = LocalMessages[j+1];
				LocalMessagesExtra[j] = LocalMessagesExtra[j+1];
			}
			ClearMessage( LocalMessages[j] );
			i--;
			continue;
		}

		if( LocalMessages[i].Message.default.bFadeMessage )
		{
			FadeValue = (LocalMessages[i].EndOfLife - Level.TimeSeconds);

			if( FadeValue <= 0.0 )
			{
				for( j = i; j < ArrayCount(LocalMessages) - 1; j++ )
				{
					LocalMessages[j] = LocalMessages[j+1];
					LocalMessagesExtra[j] = LocalMessagesExtra[j+1];
				}
				ClearMessage( LocalMessages[j] );
				i--;
				continue;
			}
		}
		// Fix non-fade messages from staying on screen - butto 7/13/03
		else if (Level.TimeSeconds > LocalMessages[i].EndOfLife)
		{
			for( j = i; j < ArrayCount(LocalMessages) - 1; j++ )
			{
				LocalMessages[j] = LocalMessages[j+1];
				LocalMessagesExtra[j] = LocalMessagesExtra[j+1];
			}
			ClearMessage( LocalMessages[j] );
			i--;
			continue;
		}
	}

	// Pass 2: Go through the list and draw each stack:

	for( i = 0; i < ArrayCount(LocalMessages); i++ )
	{
		if( LocalMessages[i].Message == none )
			break;

		if( LocalMessages[i].Drawn )
			continue;

		if( class'Object'.static.ClassIsChildOf(LocalMessages[i].Message, class'ROCriticalMessage'))
		    continue;

		PosX = LocalMessages[i].PosX;
		PosY = LocalMessages[i].PosY;

		if( LocalMessages[i].StackMode == SM_None )
		{
			DrawMessage( C, i, PosX, PosY, DX, DY );
			continue;
		}

		for( j = i; j < ArrayCount(LocalMessages); j++ )
		{
			if( LocalMessages[j].Drawn )
				continue;

			if( LocalMessages[i].PosX != LocalMessages[j].PosX )
				continue;

			if( LocalMessages[i].PosY != LocalMessages[j].PosY )
				continue;

			if( LocalMessages[i].DrawPivot != LocalMessages[j].DrawPivot )
				continue;

			if( LocalMessages[i].StackMode != LocalMessages[j].StackMode )
				continue;

			DrawMessage( C, j, PosX, PosY, DX, DY );

			switch( LocalMessages[j].StackMode )
			{
				case SM_Up:
					PosY -= DY;
					break;

				case SM_Down:
					PosY += DY;
					break;
			}
		}
	}

	// Part 3: go through list in reverse to display ROCriticalMessages in proper order
	for (i = ArrayCount(LocalMessages) - 1; i >= 0; i--)
	{
		if( LocalMessages[i].Drawn )
			continue;

		if( LocalMessages[i].Message == none )
			continue;

		PosX = LocalMessages[i].PosX;
		PosY = LocalMessages[i].PosY;

		if( LocalMessages[i].StackMode == SM_None )
		{
			DrawMessage( C, i, PosX, PosY, DX, DY );
			continue;
		}

		for( j = i; j >= 0 ; j-- )
		{
			if( LocalMessages[j].Drawn )
				continue;

			if( LocalMessages[i].PosX != LocalMessages[j].PosX )
				continue;

			if( LocalMessages[i].PosY != LocalMessages[j].PosY )
				continue;

			if( LocalMessages[i].DrawPivot != LocalMessages[j].DrawPivot )
				continue;

			if( LocalMessages[i].StackMode != LocalMessages[j].StackMode )
				continue;

			DrawMessage( C, j, PosX, PosY, DX, DY );

			switch( LocalMessages[j].StackMode )
			{
				case SM_Up:
					PosY -= DY;
					break;

				case SM_Down:
					// hackish for critical messages
					if (class'Object'.static.ClassIsChildOf(LocalMessages[j].Message, class'ROCriticalMessage'))
					{
					    PosY += LocalMessagesExtra[j].y_offset;
					}
					else
					    PosY += DY;

					break;
			}
		}
	}
}

simulated function LocalizedMessage( class<LocalMessage> Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject, optional String CriticalString)
{
	local int i, count;
	local PlayerReplicationInfo HUDPRI;

	if( Message == none )
		return;

	if( bIsCinematic && !ClassIsChildOf(Message,class'ActionMessage') )
		return;

	if( CriticalString == "" )
	{
		if ( (PawnOwner != None) && (PawnOwner.PlayerReplicationInfo != None) )
			HUDPRI = PawnOwner.PlayerReplicationInfo;
		else
			HUDPRI = PlayerOwner.PlayerReplicationInfo;
		if ( HUDPRI == RelatedPRI_1 )
			CriticalString = Message.static.GetRelatedString( Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
		else
			CriticalString = Message.static.GetString( Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject );
	}

	if( bMessageBeep && Message.default.bBeep )
		PlayerOwner.PlayBeepSound();

	if( !Message.default.bIsSpecial )
	{
		if ( PlayerOwner.bDemoOwner )
		{
			for( i=0; i<ConsoleMessageCount; i++ )
				if ( i >= ArrayCount(TextMessages) || TextMessages[i].Text == "" )
					break;

			if ( i > 0 && TextMessages[i-1].Text == CriticalString )
				return;
		}
	    AddTextMessage( CriticalString, Message,RelatedPRI_1 );
		return;
	}

	if (class'Object'.static.ClassIsChildOf(Message, class'ROCriticalMessage') &&
		class'ROCriticalMessage'.default.maxMessagesOnScreen > 0)
	{
		// Check if we have too many critical messages in stack
		count = 0;
		for (i = 0; i < ArrayCount(LocalMessages); i++)
			if (class'Object'.static.ClassIsChildOf(LocalMessages[i].Message, class'ROCriticalMessage'))
				count++;

		if (count >= class'ROCriticalMessage'.default.maxMessagesOnScreen)
		{
			// We have too many critical message -- delete oldest one
			for (i = 0; i < ArrayCount(LocalMessages); i++)
				if (class'Object'.static.ClassIsChildOf(LocalMessages[i].Message, class'ROCriticalMessage'))
					break;
			for (i = i; i < ArrayCount(LocalMessages) - 1; i++)
	        {
		        LocalMessages[i] = LocalMessages[i+1];
		        LocalMessagesExtra[i] = LocalMessagesExtra[i+1];
		    }
	        ClearMessage(LocalMessages[i+1]);
		}
	}

	i = ArrayCount(LocalMessages);
	if( Message.default.bIsUnique )
	{
		for( i = 0; i < ArrayCount(LocalMessages); i++ )
		{
		    if( LocalMessages[i].Message == None )
				continue;

		    if( LocalMessages[i].Message == Message )
				break;
		}
	}
	else if ( Message.default.bIsPartiallyUnique || PlayerOwner.bDemoOwner )
	{
		for( i = 0; i < ArrayCount(LocalMessages); i++ )
		{
		    if( LocalMessages[i].Message == none )
				continue;

		    if( ( LocalMessages[i].Message == Message ) && ( LocalMessages[i].Switch == Switch ) )
				break;
		}
	}

	if( i == ArrayCount(LocalMessages) )
	{
	    for( i = 0; i < ArrayCount(LocalMessages); i++ )
	    {
		    if( LocalMessages[i].Message == none )
				break;
	    }
	}

	if( i == ArrayCount(LocalMessages) )
	{
	    for( i = 0; i < ArrayCount(LocalMessages) - 1; i++ )
	    {
		    LocalMessages[i] = LocalMessages[i+1];
		    LocalMessagesExtra[i] = LocalMessagesExtra[i+1];
		}
	}

	ClearMessage( LocalMessages[i] );

	LocalMessages[i].Message = Message;
	LocalMessages[i].Switch = Switch;
	LocalMessages[i].RelatedPRI = RelatedPRI_1;
	LocalMessages[i].RelatedPRI2 = RelatedPRI_2;
	LocalMessages[i].OptionalObject = OptionalObject;

	// Hackish for ROCriticalMessages
	if (class'Object'.static.ClassIsChildOf(Message, class'ROCriticalMessage') &&
		class<ROCriticalMessage>(Message).default.bQuickFade)
	{
		 LocalMessages[i].LifeTime = Message.static.GetLifetime(Switch) +
			class<ROCriticalMessage>(Message).default.quickFadeTime;
	     LocalMessages[i].EndOfLife = LocalMessages[i].LifeTime + Level.TimeSeconds;

	     // Mild hax: used to show hints when an obj is captured
	     // This was simpliest way of doing it without having server call another
	     // server-to-client function
	     if (class'Object'.static.ClassIsChildOf(Message, class'ROObjectiveMsg') &&
	         (switch == 0 || switch == 1) )
	     {
	         if (ROPlayer(PlayerOwner) != none)
	             ROPlayer(PlayerOwner).CheckForHint(17);
	     }

	}
	else
	{
	     LocalMessages[i].EndOfLife = Message.static.GetLifetime(Switch) + Level.TimeSeconds;
	     LocalMessages[i].LifeTime = Message.static.GetLifetime(Switch);
	}
	LocalMessages[i].StringMessage = CriticalString;
}

simulated function LayoutMessage( out HudLocalizedMessage Message, Canvas C )
{
	local int FontSize;

	FontSize = Message.Message.static.GetFontSize( Message.Switch, Message.RelatedPRI, Message.RelatedPRI2, PlayerOwner.PlayerReplicationInfo );
	FontSize += MessageFontOffset;

	if (class'Object'.static.ClassIsChildOf(Message.Message, class'ROCriticalMessage'))
	    Message.StringFont = GetCriticalMsgFontSizeIndex(C,FontSize);
    else
        Message.StringFont = GetFontSizeIndex(C,FontSize);

	Message.DrawColor = Message.Message.static.GetColor( Message.Switch, Message.RelatedPRI, Message.RelatedPRI2 );
	Message.Message.static.GetPos( Message.Switch, Message.DrawPivot, Message.StackMode, Message.PosX, Message.PosY );
	C.Font = Message.StringFont;
	C.TextSize( Message.StringMessage, Message.DX, Message.DY );
}

simulated function ExtraLayoutMessage( out HudLocalizedMessage Message, out HudLocalizedMessageExtra MessageExtra, Canvas C)
{
	local array<string> lines;
	local float tempXL, tempYL, initialXL, XL, YL;
	local int i, initialNumLines, j;

	//log("Setting layout for string: " $ MEssage.StringMessage);

	// Hackish for ROCriticalMessages
	if (class'Object'.static.ClassIsChildOf(Message.Message, class'ROCriticalMessage'))
	{
		// Set a random background type
		MessageExtra.background_type = rand(4);

		// Figure what width to use to break the string at
		initialXL = Message.DX;
		tempXL = min(initialXL, C.SizeX * class'ROCriticalMessage'.default.maxMessageWidth);
		if (tempXL < Message.DY * 8) // only wrap if we have enough text
		{
			MessageExtra.lines.length = 1;
			MessageExtra.lines[0] = Message.StringMessage;
		}
		else
		{
			lines.Length = 0;
			C.WrapStringToArray(Message.StringMessage, lines, tempXL);
			initialNumLines = lines.length;

			for (i = 0; i < 20; i++)
			{
				tempXL *= 0.8;
				lines.Length = 0;
				C.WrapStringToArray(Message.StringMessage, lines, tempXL);
				//log("Testing with width of " $ tempXL);
				//log("Number of resulting lines: " $ lines.Length);
				if (lines.Length > initialNumLines)
				{
					// If we're getting more than initialNumLines lines, it means we
					// should use the previously calculated width
					lines.Length = 0;
					C.WrapStringToArray(Message.StringMessage, lines, Message.DX);
					//log("Wrapping using previous width gives us: " $ lines.Length $ " lines.");

					// Save strings to message array + calculate resulting XL/YL
					MessageExtra.lines.Length = lines.Length;
					C.Font = Message.StringFont;
					XL = 0;
					YL = 0;
					for (j = 0; j < lines.Length; j++)
					{
						//log("Line #" $ j $ " = " $ lines[j]);
						MessageExtra.lines[j] = lines[j];
						C.TextSize(lines[j], tempXL, tempYL);
						XL = max(tempXL, XL);
						YL += tempYL;
					}

					Message.DX = XL;
					Message.DY = YL;

					break;
				}
				Message.DX = tempXL; // store temporarily
			}
		}
	}
}

function Font GetCriticalMsgFontSizeIndex(Canvas C, int FontSize)
{
    if ( C.ClipX >= 512 )
		FontSize++;
	if ( C.ClipX >= 640 )
		FontSize++;
	if ( C.ClipX >= 800 )
		FontSize++;
	if ( C.ClipX >= 1024 )
		FontSize++;
	if ( C.ClipX >= 1280 )
		FontSize++;
	if ( C.ClipX >= 1600 )
		FontSize++;

	return LoadCriticalMsgFont(Clamp( 8-FontSize, 0, 8));
}

simulated function Font LoadCriticalMsgFont(int i)
{
	if ( CriticalMsgFontArrayFonts[i] == none )
	{
		CriticalMsgFontArrayFonts[i] = Font(DynamicLoadObject(CriticalMsgFontArrayNames[i], class'Font'));
		if( CriticalMsgFontArrayFonts[i] == none )
			Log("Warning: "$Self$" Couldn't dynamically load font "$CriticalMsgFontArrayNames[i]);
	}
	return CriticalMsgFontArrayFonts[i];
}

simulated function DrawMessage( Canvas C, int i, float PosX, float PosY, out float DX, out float DY )
{
	local float FadeValue;
	local float ScreenX, ScreenY;

	if ( !LocalMessages[i].Message.default.bFadeMessage )
		C.DrawColor = LocalMessages[i].DrawColor;
	else if (class'Object'.static.ClassIsChildOf(LocalMessages[i].Message, class'ROCriticalMessage') &&
		class<ROCriticalMessage>(LocalMessages[i].Message).default.bQuickFade)
	{
	    FadeValue = (LocalMessages[i].EndOfLife - Level.TimeSeconds) /
			class<ROCriticalMessage>(LocalMessages[i].Message).default.quickFadeTime;
		if (FadeValue > 1)
			FadeValue = 1;
		C.DrawColor = LocalMessages[i].DrawColor;
		C.DrawColor.A = LocalMessages[i].DrawColor.A * FadeValue;
	}
	else
	{
		FadeValue = (LocalMessages[i].EndOfLife - Level.TimeSeconds);
		C.DrawColor = LocalMessages[i].DrawColor;
		C.DrawColor.A = LocalMessages[i].DrawColor.A * (FadeValue/LocalMessages[i].LifeTime);
	}

	C.Font = LocalMessages[i].StringFont;
	GetScreenCoords( PosX, PosY, ScreenX, ScreenY, LocalMessages[i], C );
	C.SetPos( ScreenX, ScreenY );
	DX = LocalMessages[i].DX / C.ClipX;
	DY = LocalMessages[i].DY / C.ClipY;

	if ( class'Object'.static.ClassIsChildOf(LocalMessages[i].Message, class'ROCriticalMessage') )
	{
	    class<ROCriticalMessage>(LocalMessages[i].Message).static.RenderComplexMessageExtra(
			C, LocalMessages[i].DX, LocalMessages[i].DY, LocalMessagesExtra[i].y_offset,
			LocalMessages[i].Switch, LocalMessages[i].RelatedPRI,
			LocalMessages[i].RelatedPRI2, LocalMessages[i].OptionalObject,
			LocalMessagesExtra[i].lines, LocalMessagesExtra[i].background_type );
	}
	else if ( LocalMessages[i].Message.default.bComplexString )
	{
		LocalMessages[i].Message.static.RenderComplexMessage( C, LocalMessages[i].DX, LocalMessages[i].DY,
			LocalMessages[i].StringMessage, LocalMessages[i].Switch, LocalMessages[i].RelatedPRI,
			LocalMessages[i].RelatedPRI2, LocalMessages[i].OptionalObject );
	}
	else
	{
		C.DrawTextClipped( LocalMessages[i].StringMessage, false );
	}

	LocalMessages[i].Drawn = true;
}

//-----------------------------------------------------------------------------
// DrawSpectatingHud - Display messages and timer
//-----------------------------------------------------------------------------

simulated function DrawSpectatingHud(Canvas C)
{
	local ROGameReplicationInfo GRI;
	local float Time, strX, strY, X, Y, Scale;
	local string S;
	local ROPlayer Playa;
	local float SmallH, NameWidth;
	local float XL;

	// Draw fade effects
	C.Style = ERenderStyle.STY_Alpha;
	DrawFadeEffect(C);

	Scale = C.ClipX / 1600.0;

	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

	if (GRI != None)
	{
		// Update round timer
		if (!GRI.bMatchHasBegun)
			CurrentTime = GRI.RoundStartTime + GRI.PreStartTime - GRI.ElapsedTime;
		else
			CurrentTime = GRI.RoundStartTime + GRI.RoundDuration - GRI.ElapsedTime;

		S = default.TimeRemainingText $ GetTimeString(CurrentTime);

		X = 8 * Scale;
		Y = 8 * Scale;

		C.DrawColor = WhiteColor;
		C.Font = GetConsoleFont(C);
		C.TextSize(S, strX, strY);
		C.SetPos(X, Y);
		C.DrawTextClipped(S);

		if (GRI.bMatchHasBegun && ROPlayer(PlayerOwner) != None && ROPlayer(PlayerOwner).CanRestartPlayer()
			&& PlayerOwner.PlayerReplicationInfo.Team != none && GRI.bReinforcementsComing[PlayerOwner.PlayerReplicationInfo.Team.TeamIndex] == 1)
		{
			Time = GRI.LastReinforcementTime[PlayerOwner.PlayerReplicationInfo.Team.TeamIndex] + GRI.ReinforcementInterval[PlayerOwner.PlayerReplicationInfo.Team.TeamIndex] - GRI.ElapsedTime;
			S = default.ReinforcementText $ GetTimeString(Time);

			Y += 4 * Scale + strY;
			//C.TextSize(S, strX, strY);
			C.SetPos(X, Y);
			C.DrawTextClipped(S);
		}
	}

	if (PlayerOwner.ViewTarget != PlayerOwner.Pawn && PawnOwner != None && PawnOwner.PlayerReplicationInfo != None)
	{
		S = ViewingText $ PawnOwner.PlayerReplicationInfo.PlayerName;
		C.DrawColor = WhiteColor;
		C.Font = GetConsoleFont(C);
		C.TextSize(S, strX, strY);
		C.SetPos(C.ClipX / 2 - strX / 2, C.ClipY - 8 * scale - strY);
		C.DrawTextClipped(S);
	}

	Playa = ROPlayer(PlayerOwner);

	// Rough spectate hud stuff. TODO: Refine this so its not so plane
	if( Playa != none )
	{
		S = Playa.GetSpecModeDescription();
		C.DrawColor = WhiteColor;
		C.Font = GetLargeMenuFont(C);

		X = C.ClipX * 0.5;
		Y = C.ClipY * 0.1;

		C.TextSize(S, strX, strY);
		C.SetPos(X - strX / 2, Y  - strY);
		C.DrawTextClipped(S);

		// Draw line 1
		S = SpectateInstructionText1;
		C.Font = GetConsoleFont(C);

		X = C.ClipX * 0.5;
		Y = C.ClipY * 0.90;

		C.TextSize(S, strX, strY);
		C.SetPos(X - strX / 2, Y  - strY);
		C.DrawTextClipped(S);

		// Draw line 2
		S = SpectateInstructionText2;
		X = C.ClipX * 0.5;
		Y += strY + (3 * scale);

		C.TextSize(S, strX, strY);
		C.SetPos(X - strX / 2, Y  - strY);
		C.DrawTextClipped(S);

		// Draw line 3
		S = SpectateInstructionText3;
		X = C.ClipX * 0.5;
		Y += strY + (3 * scale);

		C.TextSize(S, strX, strY);
		C.SetPos(X - strX / 2, Y  - strY);
		C.DrawTextClipped(S);

		// Draw line 4
		S = SpectateInstructionText4;
		X = C.ClipX * 0.5;
		Y += strY + (3 * scale);

		C.TextSize(S, strX, strY);
		C.SetPos(X - strX / 2, Y  - strY);
		C.DrawTextClipped(S);
	}

    // Draw the players name large if thier are viewing someone else in first person
    if ( (PawnOwner != None) && (PawnOwner != PlayerOwner.Pawn)
		&& (PawnOwner.PlayerReplicationInfo != None) && !PlayerOwner.bBehindView)
	{
		// draw viewed player name
	    C.Font = GetMediumFontFor(C);
		C.SetDrawColor(255,255,0,255);
		C.StrLen(PawnOwner.PlayerReplicationInfo.PlayerName,NameWidth,SmallH);
		NameWidth = FMax(NameWidth, 0.15 * C.ClipX);
		if ( C.ClipX >= 640 )
		{
			C.Font = GetConsoleFont(C);
			C.StrLen("W",XL,SmallH);
			C.SetPos(79*C.ClipX/80 - NameWidth,C.ClipY * 0.68);
			C.DrawText(NowViewing,false);
		}

		C.Font = GetMediumFontFor(C);
		C.SetPos(79*C.ClipX/80 - NameWidth,C.ClipY * 0.68 + SmallH);
		C.DrawText(PawnOwner.PlayerReplicationInfo.PlayerName,false);
	}

	// Draw hints
	if (bDrawHint)
		DrawHint(C);

	DisplayLocalMessages(C);
}

//-----------------------------------------------------------------------------
// GetTimeString
//-----------------------------------------------------------------------------

static function string GetTimeString(float Time)
{
	local string S;

	Time = FMax(0.0, Time);

	S = int(Time / 60) $ ":";

	Time = Time % 60;

	if (Time < 10)
		S = S $ "0" $ int(Time);
	else
		S = S $ int(Time);

	return S;
}

//-----------------------------------------------------------------------------
// DrawTimer - Draws the clock
//-----------------------------------------------------------------------------

simulated function DrawTimer(Canvas C)
{
	//DrawSpriteWidget(C, ClockBase);
	//DrawSpriteWidget(C, ClockHand);
}

//-----------------------------------------------------------------------------
// GetConsoleFont - Use the small font array
//-----------------------------------------------------------------------------

static function font GetConsoleFont(Canvas C)
{
	local int FontSize;

	FontSize = Default.ConsoleFontSize;
	if ( C.ClipX < 640 )
		FontSize++;
	if ( C.ClipX < 800 )
		FontSize++;
	if ( C.ClipX < 1024 )
		FontSize++;
	if ( C.ClipX < 1280 )
		FontSize++;
	if ( C.ClipX < 1600 )
		FontSize++;
	return LoadSmallFontStatic(Min(8,FontSize));
}

//-----------------------------------------------------------------------------
// GetLargeMenuFont - Gets a large menu font
//-----------------------------------------------------------------------------

static function font GetLargeMenuFont(Canvas C)
{
	local int FontSize;

	//FontSize = Default.ConsoleFontSize;
//	if ( C.ClipX < 640 )
//		FontSize = 0;
	if ( C.ClipX < 800 )
		FontSize = 5;
	else if ( C.ClipX < 1024 )
		FontSize = 4;
	else if ( C.ClipX < 1280 )
		FontSize = 3;
	else if ( C.ClipX < 1600 )
		FontSize = 2;
	else
		FontSize = 1;

	return LoadFontStatic(Min(8,FontSize));
}

//-----------------------------------------------------------------------------
// GetSmallMenuFont - Gets a large menu font
//-----------------------------------------------------------------------------

static function font GetSmallMenuFont(Canvas C)
{
	local int FontSize;

	//FontSize = Default.ConsoleFontSize;
//	if ( C.ClipX < 640 )
//		FontSize = 0;
	if ( C.ClipX < 800 )
		FontSize = 4;
	else if ( C.ClipX < 1024 )
		FontSize = 3;
	else if ( C.ClipX < 1280 )
		FontSize = 2;
	else if ( C.ClipX < 1600 )
		FontSize = 1;
	else
		FontSize = 0;

	return LoadMenuFontStatic(FontSize);
}

static function font GetSmallerMenuFont(Canvas C)
{
	local int FontSize;

	//FontSize = Default.ConsoleFontSize;
//	if ( C.ClipX < 640 )
//		FontSize = 0;
	if ( C.ClipX < 800 )
//		FontSize = 5;
		FontSize = 4;
	else if ( C.ClipX < 1024 )
		FontSize = 4;
	else if ( C.ClipX < 1280 )
		FontSize = 3;
	else if ( C.ClipX < 1600 )
		FontSize = 2;
	else
		FontSize = 1;

	return LoadMenuFontStatic(FontSize);
}

//-----------------------------------------------------------------------------
// LoadSmallFontStatic - Loads from the new small font array
//-----------------------------------------------------------------------------

static function Font LoadSmallFontStatic(int i)
{
	if( default.SmallFontArrayFonts[i] == None )
	{
		default.SmallFontArrayFonts[i] = Font(DynamicLoadObject(default.SmallFontArrayNames[i], class'Font'));
		if( default.SmallFontArrayFonts[i] == none )
			Log("Warning: "$default.Class$" Couldn't dynamically load font "$default.SmallFontArrayNames[i]);
	}

	return default.SmallFontArrayFonts[i];
}

//-----------------------------------------------------------------------------
// LoadMenuFontStatic - Loads from the new small font array
//-----------------------------------------------------------------------------

static function Font LoadMenuFontStatic(int i)
{
	if( default.MenuFontArrayFonts[i] == None )
	{
		default.MenuFontArrayFonts[i] = Font(DynamicLoadObject(default.MenuFontArrayNames[i], class'Font'));
		if( default.MenuFontArrayFonts[i] == None )
			Log("Warning: "$default.Class$" Couldn't dynamically load font "$default.MenuFontArrayNames[i]);
	}

	return default.MenuFontArrayFonts[i];
}

//-----------------------------------------------------------------------------
// Message - Changed message classes
//-----------------------------------------------------------------------------

simulated function Message( PlayerReplicationInfo PRI, coerce string Msg, name MsgType )
{
	local Class<LocalMessage> MessageClassType;

	switch( MsgType )
	{
		case 'Say':
			Msg = PRI.PlayerName$": "$Msg;
			MessageClassType = class'ROSayMessage';
			break;
		case 'TeamSay':
			/*if (PRI.GetLocationName() == "")
				Msg = TeamMessagePrefix$PRI.PlayerName$": "$Msg;
			else
				Msg = TeamMessagePrefix$PRI.PlayerName$" ("$PRI.GetLocationName()$"): "$Msg;*/
			MessageClassType = class'ROTeamSayMessage';
			Msg = MessageClassType.static.AssembleString(self,, PRI, Msg);
			break;
		case 'SayDead':
			//Msg = PRI.PlayerName$": "$Msg;
			MessageClassType = class'ROSayDeadMessage';
			Msg = MessageClassType.static.AssembleString(self,, PRI, Msg);
			break;
		case 'TeamSayDead':
			/*if (PRI.GetLocationName() == "")
				Msg = TeamMessagePrefix$PRI.PlayerName$": "$Msg;
			else
				Msg = TeamMessagePrefix$PRI.PlayerName$" ("$PRI.GetLocationName()$"): "$Msg;*/
			MessageClassType = class'ROTeamSayDeadMessage';
			Msg = MessageClassType.static.AssembleString(self,, PRI, Msg);
			break;
		case 'VehicleSay':
			MessageClassType = class'ROVehicleSayMessage';
			Msg = MessageClassType.static.AssembleString(self,, PRI, Msg);
			break;
		case 'CriticalEvent':
			MessageClassType = class'CriticalEventPlus';
			LocalizedMessage( MessageClassType, 0, None, None, None, Msg );
			return;
		case 'DeathMessage':
			return;
			//MessageClassType = class'RODeathMessage';
			//break;
		default:
			MessageClassType = class'ROStringMessage';
			break;
	}

	AddTextMessage(Msg,MessageClassType,PRI);
}

//====================================================================
// DrawWeaponName(UT) - Antarian 10/11/03 - Overloaded to fix the RO weapon
//	names from showing up with ut colors, font and font size
//====================================================================
simulated function DrawWeaponName(Canvas C)
{
	local string CurWeaponName;
	local float XL,YL, Fade;

	if (bHideWeaponName)
		return;

// THINK ABOUT A FUTURE OPTION TO LET PEOPLE DISABLE MESSAGES
// OR MAKE THE MESSAGE SIZE SMALLER
	if (WeaponDrawTimer>Level.TimeSeconds)
	{
		C.DrawColor = WhiteColor;
		C.Font = GetMediumFontFor(C);
		C.TextSize(CurWeaponName, XL, YL);

		Fade = WeaponDrawTimer - Level.TimeSeconds;

		if (Fade<=1)
			C.DrawColor.A = 255 * Fade;


		C.Strlen(LastWeaponName,XL,YL);
		C.SetPos( (C.ClipX/2) - (XL/2), C.ClipY*0.8-YL);
		C.DrawText(LastWeaponName);
	}

	if (  PawnOwner==None || PawnOwner.PendingWeapon==None )
		return;

	CurWeaponName = PawnOwner.PendingWeapon.GetHumanReadableName();
	if (CurWeaponName!=LastWeaponName)
	{
		WeaponDrawTimer = Level.TimeSeconds+1.5;
		WeaponDrawColor = PawnOwner.PendingWeapon.HudColor;
	}

   	LastWeaponName = CurWeaponName;
}

// show full screen red flash
// this Overrides the HudBase definition, where the hit indicators are shown
function DisplayHit(vector HitDir, int Damage, class<DamageType> damageType)
{
	if ( Damage > 1 )
	{
		PlayerOwner.ClientFlash(DamageType.Default.FlashScale,DamageType.Default.FlashFog);
	}
}


// Comment Out for Release
simulated function DrawCrosshair (Canvas C)
{
	/*local float NormalScale;
	local int i, CurrentCrosshair;
	local float OldScale,OldW, CurrentCrosshairScale;
	local color CurrentCrosshairColor;
	local SpriteWidget CHtexture;

	if (!bCrosshairShow || !class'ROEngine.ROLevelInfo'.static.RODebugMode() )
		return;

	if ( (PawnOwner != None) && (PawnOwner.Weapon != None) && (PawnOwner.Weapon.CustomCrosshair >= 0) )
	{
		CurrentCrosshairColor = PawnOwner.Weapon.CustomCrosshairColor;
		CurrentCrosshair = PawnOwner.Weapon.CustomCrosshair;
		CurrentCrosshairScale = PawnOwner.Weapon.CustomCrosshairScale;
		if ( PawnOwner.Weapon.CustomCrosshairTextureName != "" )
		{
			if ( PawnOwner.Weapon.CustomCrosshairTexture == None )
			{
				PawnOwner.Weapon.CustomCrosshairTexture = Texture(DynamicLoadObject(PawnOwner.Weapon.CustomCrosshairTextureName,class'Texture'));
				if ( PawnOwner.Weapon.CustomCrosshairTexture == None )
				{
					log(PawnOwner.Weapon$" custom crosshair texture not found!");
					PawnOwner.Weapon.CustomCrosshairTextureName = "";
				}
			}
			CHTexture = Crosshairs[0];
			CHTexture.WidgetTexture = PawnOwner.Weapon.CustomCrosshairTexture;
		}
	}
	else
	{
		CurrentCrosshair = CrosshairStyle;
		CurrentCrosshairColor = CrosshairColor;
		CurrentCrosshairScale = CrosshairScale;
	}

	CurrentCrosshair = Clamp(CurrentCrosshair, 0, Crosshairs.Length - 1);

	NormalScale = Crosshairs[CurrentCrosshair].TextureScale;
	if ( CHTexture.WidgetTexture == None )
		CHTexture = Crosshairs[CurrentCrosshair];
	CHTexture.TextureScale *= CurrentCrosshairScale;

	for( i = 0; i < ArrayCount(CHTexture.Tints); i++ )
		CHTexture.Tints[i] = CurrentCrossHairColor;

	OldScale = HudScale;
	HudScale=1;
	OldW = C.ColorModulate.W;
	C.ColorModulate.W = 1;
	DrawSpriteWidget (C, CHTexture);
	C.ColorModulate.W = OldW;
	HudScale=OldScale;
	CHTexture.TextureScale = NormalScale;*/

	//DrawEnemyName(C);
}

// FIXME: We need to look at something a lot better than using UT2004 portraits.  Really kills the atmosphere.
/*simulated function Tick(float deltaTime)
{
	//local Material NewPortrait;

	Super.Tick(deltaTime);

	// Setup the player portrait to display an incoming voice chat message
	if ( (Level.TimeSeconds - LastPlayerIDTalkingTime < 0.1) && (PlayerOwner.GameReplicationInfo != None) )
	{
		if ( (PortraitPRI == None) || (PortraitPRI.PlayerID != LastPlayerIDTalking) )
		{
		    if (PortraitPRI == none)
		        PortraitX = 1;
			PortraitPRI = PlayerOwner.GameReplicationInfo.FindPlayerByID(LastPlayerIDTalking);
			if ( PortraitPRI != None )
			{
			    PortraitTime = Level.TimeSeconds + 3;
				//NewPortrait = PortraitPRI.GetPortrait();
				//if ( NewPortrait != None )
				//{
				//	if ( Portrait == None )
				//		PortraitX = 1;
				//	Portrait = NewPortrait;
				//	PortraitTime = Level.TimeSeconds + 3;
				//}
			}
		}
		else
			PortraitTime = Level.TimeSeconds + 0.2;
	}
	else
		LastPlayerIDTalking = 0;

	if ( PortraitTime - Level.TimeSeconds > 0 )
		PortraitX = FMax(0,PortraitX-3*deltaTime);
	else if ( PortraitPRI != None )
	{
		PortraitX = FMin(1,PortraitX+3*deltaTime);
		if ( PortraitX == 1 )
		{
			//Portrait = None;
			PortraitPRI = None;
		}
	}
}*/

function DisplayPortrait(PlayerReplicationInfo PRI)
{
	//local Material NewPortrait;

	if ( LastPlayerIDTalking > 0 )
		return;

	if (PRI == none)
		return;

	//NewPortrait = PRI.GetPortrait();
	//if ( NewPortrait == None )
	//	return;
	//if ( Portrait == None )
	//	PortraitX = 1;
	if (PortraitPRI == none)
	    PortraitX = 1;
	//Portrait = NewPortrait;
	PortraitTime = Level.TimeSeconds + 3;
	PortraitPRI = PRI;
}

// Test0r! find a random player and display a portrait for him
/*
exec function testPortrait()
{
	local controller c;
	for (c = level.ControllerList; c != none; c = c.nextController)
	{
		if (c.PlayerReplicationInfo != none && c != PlayerOwner)
		{
			DisplayPortrait(c.PlayerReplicationInfo);
			break;
		}
	}
}*/

// test0r! sends a local message for 'weapon shot out of hands'
/*exec function testMessage()
{
	ROPlayer(PawnOwner.Controller).ReceiveLocalizedMessage(class'ROWeaponLostMessage');
	//ROPlayer(PawnOwner.Controller).ReceiveLocalizedMessage(LocalMessage(DynamicLoadObject("ROWeaponLostMessage", class'LocalMessage')));

	ROPlayer(PawnOwner.Controller).ReceiveLocalizedMessage(class'ROTestCriticalMessage', Rand(4));
}*/

/*
// test0r! this function dumps the content of the helprequests, rally points, etc arrays
exec function testReplication()
{
	local ROGameReplicationInfo GRI;
	local int i;
	local string s;
	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

	log("Dumping content of rally points arrays...");
	for (i = 0; i < arraycount(GRI.AlliedRallyPoints); i++)
	{
		if (GRI.AlliedRallyPoints[i].RallyPointLocation != vect(0,0,0))
		{
			s = "AlliedRallyPoints[" $ i $ "].RallyPointLocation = " $ GRI.AlliedRallyPoints[i].RallyPointLocation;
			log(s); Message(PlayerOwner.PlayerReplicationInfo, s, 'TEAM');
		}
		if (GRI.AxisRallyPoints[i].RallyPointLocation != vect(0,0,0))
		{
			s = "AxisRallyPoints[" $ i $ "].RallyPointLocation = " $ GRI.AxisRallyPoints[i].RallyPointLocation;
			log(s); Message(PlayerOwner.PlayerReplicationInfo, s, 'TEAM');
		}
	}

	log("Dumping content of help requests arrays...");
	for (i = 0; i < arraycount(GRI.AlliedHelpRequests); i++)
	{
		if (GRI.AlliedHelpRequests[i].requestType != 255)
		{
			s = "AlliedHelpRequests[" $ i $ "].requestType = " $ GRI.AlliedHelpRequests[i].requestType;
			s = s $ ", .objectiveID = " $ GRI.AlliedHelpRequests[i].objectiveID;
			s = s $ ", .reqLoc = " $ GRI.AlliedHelpRequestsLocs[i];
			log(s); Message(PlayerOwner.PlayerReplicationInfo, s, 'TEAM');
		}
		if (GRI.AxisHelpRequests[i].requestType != 255)
		{
			s = "AxisHelpRequests[" $ i $ "].requestType = " $ GRI.AxisHelpRequests[i].requestType;
			s = s $ ", .objectiveID = " $ GRI.AxisHelpRequests[i].objectiveID;
			s = s $ ", .reqLoc = " $ GRI.AxisHelpRequestsLocs[i];
			log(s); Message(PlayerOwner.PlayerReplicationInfo, s, 'TEAM');
		}
	}
}*/

// Test0r! Tests a body hit, number = body part id (-1 == all)
/*exec function testHits(byte num)
{
	if( ROPawn(PawnOwner) != none )
	{
		ROPawn(PawnOwner).ClientUpdateDamageList(num);
	}
}

// Test0r! test menu.
exec function testMenu(optional string menu)
{
	if (menu == "")
		PlayerOwner.ClientOpenMenu("ROInterface.ROTestMenu");
	else
		PlayerOwner.ClientOpenMenu(menu);
}*/

// Functions used to draw widgets inside a certain region
function DrawSpriteWidgetClipped(Canvas C, SpriteWidget widget, AbsoluteCoordsInfo coords, optional bool bUseTexScaleAsScreenScale, optional out float XL, optional out float YL, optional bool bUseAbsoluteOffsets, optional bool bKeepAspectRatio, optional bool bUseHUDScaling, optional bool bGetSizesOnly)
{
	local float ScreenX, ScreenY, ScreenXL, ScreenYL;
	local float TexX,TexY, TexXL, TexYL;
	local float ScaleModifier;

	// Figure where we want to draw
	ScreenX = coords.width * widget.PosX;
	ScreenY = coords.height * widget.PosY;

	if (bUseHUDScaling)
		ScaleModifier = HudScale;
	else
		ScaleModifier = 1.0;

	// Figure offset
	if (bUseAbsoluteOffsets)
	{
		ScreenX += widget.OffsetX * ScaleModifier;
		ScreenY += widget.OffsetY * ScaleModifier;
	}
	else
	{
		ScreenX += widget.OffsetX * widget.TextureScale * ScaleModifier;
		ScreenY += widget.OffsetY * widget.TextureScale * ScaleModifier;
	}

	// Figure texture source coords
	TexX = widget.TextureCoords.X1;
	TexY = widget.TextureCoords.Y1;
	TexXL = widget.TextureCoords.X2 - widget.TextureCoords.X1 + 1;
	TexYL = widget.TextureCoords.Y2 - widget.TextureCoords.Y1 + 1;

	// Figure screen width & height
	if (bUseTexScaleAsScreenScale)
	{
		ScreenYL = coords.height * widget.TextureScale;
		if (bKeepAspectRatio)
			ScreenXL = ScreenYL * TexXL / TexYL;
		else
			ScreenXL = coords.width * widget.TextureScale;
	}
	else
	{
		ScreenYL = abs(TexYL) * widget.TextureScale;
		if (bKeepAspectRatio)
			ScreenXL = ScreenYL * TexXL / TexYL;
		else
			ScreenXL = abs(TexXL) * widget.TextureScale;
	}
	ScreenXL *= ScaleModifier;
	ScreenYL *= ScaleModifier;
	XL = ScreenXL; YL = ScreenYL;

	// Offset depending on pivot type
	CalcPivotCoords(widget.DrawPivot, ScreenX, ScreenY, ScreenXL, ScreenYL);

	// Offset by wanted coordinates
	ScreenX += coords.PosX;
	ScreenY += coords.PosY;

    // Set scale
    switch (widget.ScaleMode)
    {
        case SM_None:
            break;

        case SM_Up:
            ScreenY += (1.0 - widget.Scale) * ScreenYL;
            ScreenYL *= widget.Scale;
            TexY += (1.0 - widget.Scale) * TexYL;
            TexYL *= widget.Scale;
            break;

        case SM_Down:
            ScreenYL *= widget.Scale;
            TexYL *= widget.Scale;
            break;

        case SM_Left:
            ScreenX += (1.0 - widget.Scale) * ScreenXL;
            ScreenXL *= widget.Scale;
            TexX += (1.0 - widget.Scale) * TexXL;
            TexXL *= widget.Scale;
            break;

        case SM_Right:
            ScreenXL *= widget.Scale;
            TexXL *= widget.Scale;
            break;
    }

	if (!bGetSizesOnly)
	{
    	// Set canvas info
    	C.CurX = ScreenX;
    	C.CurY = ScreenY;
    	C.DrawColor = widget.Tints[TeamIndex];
    	C.Style = widget.RenderStyle;

    	// Render!
        C.DrawTile(widget.WidgetTexture, ScreenXL, ScreenYL, TexX, TexY, TexXL, TexYL);
    }
}

function CalcPivotCoords(EDrawPivot DrawPivot, out float ScreenX, out float ScreenY, float ScreenXL, float ScreenYL)
{
	switch (DrawPivot)
	{
		case DP_UpperLeft:
			break;

		case DP_UpperMiddle:
			ScreenX -= ScreenXL * 0.5;
			break;

		case DP_UpperRight:
			ScreenX -= ScreenXL;
			break;

		case DP_MiddleRight:
			ScreenX -= ScreenXL;
			ScreenY -= ScreenYL * 0.5;
			break;

		case DP_LowerRight:
			ScreenX -= ScreenXL;
			ScreenY -= ScreenYL;
			break;

		case DP_LowerMiddle:
			ScreenX -= ScreenXL * 0.5;
			ScreenY -= ScreenYL;
			break;

		case DP_LowerLeft:
			ScreenY -= ScreenYL;
			break;

		case DP_MiddleLeft:
			ScreenY -= ScreenYL * 0.5;
			break;

		case DP_MiddleMiddle:
			ScreenX -= ScreenXL * 0.5;
			ScreenY -= ScreenYL * 0.5;
			break;

		default:
			break;
	}
}

function DrawTextWidgetClipped(Canvas C, TextWidget widget, AbsoluteCoordsInfo coords, optional out float XL, optional out float YL, optional out float YL_oneline, optional bool bNoRender)
{
	local float ScreenX, ScreenY, ScreenXL, ScreenYL;
	local float oldClipX, oldClipY, oldOrgX, oldOrgY, myXL, myYL;

	// Calculate where we want to write
	ScreenX = coords.width * widget.PosX;
	ScreenY = coords.height * widget.PosY;

	// Save old canvas settings
	oldClipX = C.ClipX; oldClipY = C.ClipY;
	oldOrgX = C.OrgX; oldOrgY = C.OrgY;

	// Check if we should wrap
	if (widget.WrapWidth ~= 0)
	{
		// Calculate text size
		C.TextSize(widget.text, ScreenXL, ScreenYL);
		YL_oneline = ScreenYL;
		XL = ScreenXL; YL = ScreenYL;
	}
	else
	{
		// Calculate text size
		ScreenXL = coords.width * widget.WrapWidth;
		C.ClipX = ScreenXL;
		C.TextSize(widget.text, myXL, YL_oneline); // only used to fill YL_oneline variable
		C.StrLen(widget.text, myXL, myYL);
		XL = myXL; YL = myYL;
		ScreenYL = myYL;
	}

	// Calculate offsets
	ScreenX += widget.OffsetX + coords.PosX;
	ScreenY += widget.OffsetY + coords.PosY;

	CalcPivotCoords(widget.DrawPivot, ScreenX, ScreenY, ScreenXL, ScreenYL);

	//log("ScreenX = " $ ScreenX $ ", ScreenY = " $ ScreenY $ ", ScreenXL = " $ ScreenXL $ ", ScreenYL = " $ ScreenYL);
	//log("C.OrgX = " $ C.OrgX $ ", C.OrgY = " $ C.OrgY);

	// Draw bounding box if needed
	if (bDebugDrawHudBounds)
	{
		C.SetPos(ScreenX + C.OrgX, ScreenY + C.OrgY);
		C.DrawColor = RedColor;
//		c.DrawTileStretched(Material'InterfaceArt_tex.HUD.white_border_alpha', ScreenXL, ScreenYL);
		C.DrawColor = widget.Tints[TeamIndex];
	}


	// Draw the text
	C.DrawColor = widget.Tints[TeamIndex];
	C.Style = widget.RenderStyle;
	C.SetOrigin(ScreenX + C.OrgX, ScreenY + C.OrgY);
	C.SetClip(ScreenXL, ScreenYL);
	C.SetPos(0,0);

    if (widget.bDrawShadow && !bNoRender)
	{
		C.DrawColor.R = 0;
		C.DrawColor.G = 0;
		C.DrawColor.B = 0;
		C.SetOrigin(C.OrgX + 1, C.OrgY + 1);
		C.SetPos(0,0);
		C.DrawText(widget.text);
		C.SetOrigin(C.OrgX - 1, C.OrgY - 1);
		C.SetPos(0,0);
		C.DrawColor = widget.Tints[TeamIndex];
	}

    if (!bNoRender)
	C.DrawText(widget.text);

	// Restore old canvas settings
	C.SetOrigin(oldOrgX, oldOrgY);
	C.SetClip(oldClipX, oldClipY);
}

// Transform from one set of absolute coordinate into another
// X, Y, XL and YL are in the 0-1 range.
function GetAbsoluteCoordinates(AbsoluteCoordsInfo reference, float X, float Y, float XL, float YL, out AbsoluteCoordsInfo coords)
{
	coords.PosX = reference.PosX + X * reference.width;
	coords.PosY = reference.PosY + Y * reference.height;
	coords.width = reference.width * XL;
	coords.height = reference.height * YL;
}

// Transform from one set of absolute coordinate into another
// using a set of relative coordinates
function GetAbsoluteCoordinatesAlt(AbsoluteCoordsInfo reference, RelativeCoordsInfo relative, out AbsoluteCoordsInfo coords)
{
	coords.PosX = reference.PosX + relative.X * reference.width;
	coords.PosY = reference.PosY + relative.Y * reference.height;
	coords.width = reference.width * relative.XL;
	coords.height = reference.height * relative.YL;
}

function MouseInterfaceStartCapturing()
{
	bCapturingMouse = true;
	bHaveAtLeastOneValidMouseUpdate = false;
	ROPlayer(PlayerOwner).bHudCapturesMouseInputs = true;
}

function MouseInterfaceStopCapturing()
{
	ROPlayer(PlayerOwner).bHudCapturesMouseInputs = false;
	bCapturingMouse = false;
	MouseInterfaceUnlockPlayerRotation();
}

function MouseInterfaceUpdatePosition(vector newPos)
{
	local float PosX, PosY;

	MouseCurrentPos = newPos;
	bHaveAtLeastOneValidMouseUpdate = true;

	if (bShowObjectives)
	{
		PosX = MouseCurrentPos.X + LastHUDSizeX * 0.5;
		PosY = MouseCurrentPos.Y + LastHUDSizeY * 0.5;

		if (PosX > MapLevelImageCoordinates.PosX &&
			PosY > MapLevelImageCoordinates.PosY &&
			PosX < MapLevelImageCoordinates.width + MapLevelImageCoordinates.PosX &&
			PosY < MapLevelImageCoordinates.height + MapLevelImageCoordinates.PosY)
		{
			MouseInterfaceLockPlayerRotation();
		}
		else
			MouseInterfaceUnlockPlayerRotation();
	}
	else
		MouseInterfaceUnlockPlayerRotation();
}

function MouseInterfaceClick()
{
	if (bShowObjectives)
	{
		if (HandleLevelMapClick(MouseCurrentPos.X + LastHUDSizeX * 0.5, MouseCurrentPos.Y + LastHUDSizeY * 0.5))
			HideObjectives();
	}
	else // Safeguard
		MouseInterfaceStopCapturing();
}

function MouseInterfaceDrawCursor(Canvas C)
{
	local float PosX, PosY;
	local vector newMousePos;

	if (!bHaveAtLeastOneValidMouseUpdate)
		return;

	newMousePos = MouseCurrentPos;

	PosX = newMousePos.X + C.SizeX * 0.5;
	PosY = newMousePos.Y + C.SizeY * 0.5;

	if (PosX < 0)
	{
		newMousePos.X -= PosX;
		PosX = 0;
	}
	else if (PosX >= C.ClipX)
	{
		newMousePos.X -= (PosX - C.SizeX);
		PosX = C.SizeX - 1;
	}

	if (PosY < 0)
	{
		newMousePos.Y -= PosY;
		PosY = 0;
	}
	else if (PosY >= C.ClipY)
	{
		newMousePos.Y -= (PosY - C.SizeY);
		PosY = C.SizeY - 1;
	}

	if (newMousePos != MousecurrentPos)
		ROPlayer(PlayerOwner).MouseInterfaceSetMousePos(newMousePos);

	//log("newMousePos.X = " $ newMousePos.X);
	//log("newMousePos.Y = " $ newMousePos.Y);

	MouseInterfaceIcon.PosX = PosX / C.ClipX;
	MouseInterfaceIcon.PosY = PosY / C.ClipY;

	LastHUDSizeX = C.ClipX;
	LastHUDSizeY = C.ClipY;

	//log("Drawing to " $ MouseInterfaceIcon.PosX $ "," $ MouseInterfaceIcon.PosY);

	DrawSpriteWidget(C, MouseInterfaceIcon);
}

function MouseInterfaceLockPlayerRotation()
{
	if (ROPlayer(PlayerOwner) != none)
		ROPlayer(PlayerOwner).MouseInterfaceSetRotationLock(true);
}

function MouseInterfaceUnlockPlayerRotation()
{
	if (ROPlayer(PlayerOwner) != none)
		ROPlayer(PlayerOwner).MouseInterfaceSetRotationLock(false);
}

function DrawVehicleIcon(Canvas Canvas, ROVehicle vehicle, optional ROVehicleWeaponPawn passenger)
{
    local AbsoluteCoordsInfo coords, coords2;
    local rotator myRot;
    local ROTreadCraft threadCraft;
    local SpriteWidget widget;
    local color vehicleColor;
    local float f;
    local int i, current, pending;
    local ROVehicleWeaponPawn wpawn;
    local float XL, YL, Y_one;
    local array<string> lines;
    local PlayerReplicationInfo PRI;
    local ROTankCannon cannon;
    local ROVehicleWeapon weapon;
    local float myScale;
    local float modifiedVehicleOccupantsTextYOffset; // Used to offset text vertically when drawing coaxial ammo info
    local ROWheeledVehicle wheeled_vehicle;

    if (bHideHud)
        return;

    // Debug: draw tank name
    //canvas.setpos(0, canvas.clipY * 0.75);
    //canvas.DrawText(vehicle.class);

    //////////////////////////////////////
    // Draw vehicle icon
    //////////////////////////////////////

    // Figure what the scale is
    myScale = HudScale; // * ResScaleY;

    // Figure where to draw
    coords.PosX = Canvas.ClipX * VehicleIconCoords.X;
    coords.height = Canvas.ClipY * VehicleIconCoords.YL * myScale;
    coords.PosY = Canvas.ClipY * VehicleIconCoords.Y - coords.height;
    coords.width = coords.height;

    // Compute whole-screen coords
    coords2.PosX = 0; coords2.PosY = 0;
    coords2.width = Canvas.ClipX; coords2.height = canvas.ClipY;

    // Set initial passenger PosX (shifted if we're drawing ammo info,
    // else it's draw closer to the tank icon)
    VehicleOccupantsText.PosX = default.VehicleOccupantsText.PosX;

    // The IS2 is so frelling huge that it needs to use larger textures
    if (vehicle.bVehicleHudUsesLargeTexture)
        widget = VehicleIconAlt;
    else
        widget = VehicleIcon;

    // Figure what color to draw in
    f = vehicle.Health / vehicle.HealthMax;
    if (f > 0.75)
        vehicleColor = VehicleNormalColor;
    else if (f > 0.35)
        vehicleColor = VehicleDamagedColor;
    else
        vehicleColor = VehicleCriticalColor;
    widget.Tints[0] = vehicleColor;
    widget.Tints[1] = vehicleColor;

    // Draw vehicle icon
    widget.WidgetTexture = vehicle.VehicleHudImage;
    DrawSpriteWidgetClipped(Canvas, widget, coords, true);

    // Draw engine (if needed)
    f = vehicle.EngineHealth / vehicle.Default.EngineHealth;
    if (f < 0.95)
    {
        if (f < 0.35)
            VehicleEngine.WidgetTexture = VehicleEngineCriticalTexture;
        else
            VehicleEngine.WidgetTexture = VehicleEngineDamagedTexture;

        VehicleEngine.PosX = vehicle.VehicleHudEngineX;
        VehicleEngine.PosY = vehicle.VehicleHudEngineY;
        DrawSpriteWidgetClipped(Canvas, VehicleEngine, coords, true);
    }

    // Draw treaded vehicle specific stuff
    threadCraft = ROTreadCraft(vehicle);
    if (threadCraft != none)
    {
        // Update turret references
        if (threadCraft.CannonTurret == none)
            threadCraft.UpdateTurretReferences();

        // Draw threads (if needed)
        if (threadCraft.bLeftTrackDamaged)
        {
            VehicleThreads[0].TextureScale = threadCraft.VehicleHudThreadsScale;
            VehicleThreads[0].PosX = threadCraft.VehicleHudThreadsPosX[0];
            VehicleThreads[0].PosY = threadCraft.VehicleHudThreadsPosY;
            DrawSpriteWidgetClipped(Canvas, VehicleThreads[0], coords, true, XL, YL, false, true);
        }
        if (threadCraft.bRightTrackDamaged)
        {
            VehicleThreads[1].TextureScale = threadCraft.VehicleHudThreadsScale;
            VehicleThreads[1].PosX = threadCraft.VehicleHudThreadsPosX[1];
            VehicleThreads[1].PosY = threadCraft.VehicleHudThreadsPosY;
            DrawSpriteWidgetClipped(Canvas, VehicleThreads[1], coords, true, XL, YL, false, true);
        }

        // Update & draw look turret (if needed)
        if (passenger != none && passenger.IsA('ROTankCannonPawn'))
        {
            threadCraft.VehicleHudTurretLook.Rotation.Yaw =
                vehicle.Rotation.Yaw - passenger.CustomAim.Yaw;
            widget.WidgetTexture = threadCraft.VehicleHudTurretLook;
            widget.Tints[0].A /= 2;
            widget.Tints[1].A /= 2;
            DrawSpriteWidgetClipped(Canvas, widget, coords, true);
            widget.Tints[0] = vehicleColor;
            widget.Tints[1] = vehicleColor;

            // Draw ammo count since we're a gunner
            if (bShowWeaponInfo)
            {
                // Shift passengers list farther to the right
                VehicleOccupantsText.PosX = VehicleOccupantsTextOffset;

                // Draw icon
                VehicleAmmoIcon.WidgetTexture = passenger.AmmoShellTexture;
                DrawSpriteWidget(Canvas, VehicleAmmoIcon);

                // Draw reload state icon (if needed)
                VehicleAmmoReloadIcon.WidgetTexture = passenger.AmmoShellReloadTexture;
                VehicleAmmoReloadIcon.Scale = passenger.getAmmoReloadState();
                DrawSpriteWidget(Canvas, VehicleAmmoReloadIcon);

                // Draw ammo count

                if( Passenger != none && passenger.Gun != none )
                {
                	VehicleAmmoAmount.Value = passenger.Gun.PrimaryAmmoCount();//999;
                }
                DrawNumericWidget(Canvas, VehicleAmmoAmount, Digits);

                // Draw ammo type
                cannon = ROTankCannon(passenger.Gun);
                if (cannon != none && cannon.bMultipleRoundTypes)
                {
                    // Get ammo types
                    current = cannon.GetRoundsDescription(lines);
                    pending = cannon.GetPendingRoundIndex();

                    VehicleAmmoTypeText.OffsetY = default.VehicleAmmoTypeText.OffsetY * myScale;
                    if (myScale < 0.85)
                        Canvas.Font = GetConsoleFont(Canvas);
                    else
                        Canvas.Font = GetSmallMenuFont(Canvas);

                    i = (current + 1) % lines.length;
                    while (true)
                    {
                        if (i == pending)
                        	VehicleAmmoTypeText.text = lines[i]$"<-";
                        else
                        	VehicleAmmoTypeText.text = lines[i];

                        if (i == current)
                            VehicleAmmoTypeText.Tints[TeamIndex].A = 255;
                        else
                            VehicleAmmoTypeText.Tints[TeamIndex].A = 128;



                        DrawTextWidgetClipped(Canvas, VehicleAmmoTypeText, coords2, XL, YL, Y_one);
                        VehicleAmmoTypeText.OffsetY -= YL;

                        i = (i + 1) % lines.length;
                        if (i == (current + 1) % lines.length)
                            break;
                    }
                }
                if (cannon != none)
                {
                    // Draw coaxial gun ammo info if needed
                    if (cannon.AltFireProjectileClass != none)
                    {
                        // Draw coaxial gun ammo icon
                        VehicleAltAmmoIcon.WidgetTexture = cannon.hudAltAmmoIcon;
                        DrawSpriteWidget(Canvas, VehicleAltAmmoIcon);

                        // Draw coaxial gun ammo ammount
                        VehicleAltAmmoAmount.Value = cannon.getNumMags();//999;
                        DrawNumericWidget(Canvas, VehicleAltAmmoAmount, Digits);

                        // Shift occupants list position to accomodate coaxial gun ammo info
                        modifiedVehicleOccupantsTextYOffset = VehicleAltAmmoOccupantsTextOffset * myScale;
                    }
                }
            }
        }

        // Update & draw turret
        if (threadCraft.CannonTurret != none)
        {
            myRot = rotator(vector(threadCraft.CannonTurret.CurrentAim) >> threadCraft.CannonTurret.Rotation);
            threadCraft.VehicleHudTurret.Rotation.Yaw = vehicle.Rotation.Yaw - myRot.Yaw;
            widget.WidgetTexture = threadCraft.VehicleHudTurret;
            DrawSpriteWidgetClipped(Canvas, widget, coords, true);
        }
    }

    // Draw MG ammo info (if needed)
    if (bShowWeaponInfo && passenger != none && passenger.bIsMountedTankMG)
    {
        weapon = ROVehicleWeapon(passenger.Gun);
        if (weapon != none)
        {
            // Offset vehicle passenger names
            VehicleOccupantsText.PosX = VehicleOccupantsTextOffset;

            // Draw ammo icon
            VehicleMGAmmoIcon.WidgetTexture = weapon.hudAltAmmoIcon;
            DrawSpriteWidget(Canvas, VehicleMGAmmoIcon);

            // Draw ammo count
            VehicleMGAmmoAmount.Value = weapon.getNumMags();
            DrawNumericWidget(Canvas, VehicleMGAmmoAmount, Digits);
        }
    }

    // Draw rpm/speed/throttle gauges if we're the driver
    if (passenger == none)
    {
        wheeled_vehicle = ROWheeledVehicle(vehicle);
        if (wheeled_vehicle != none)
        {
            // Get team index
            if (vehicle.Controller != none && vehicle.Controller.PlayerReplicationInfo != none &&
                vehicle.Controller.PlayerReplicationInfo.Team != none)
            {
                if (vehicle.Controller.PlayerReplicationInfo.Team.TeamIndex == AXIS_TEAM_INDEX)
                    i = AXIS_TEAM_INDEX;
                else
                    i = ALLIES_TEAM_INDEX;
            }
            else
                i = AXIS_TEAM_INDEX;

            // Update textures for backgrounds
            VehicleSpeedIndicator.WidgetTexture = VehicleSpeedTextures[i];
            VehicleRPMIndicator.WidgetTexture = VehicleRPMTextures[i];

            // Draw backgrounds
            DrawSpriteWidgetClipped(Canvas, VehicleSpeedIndicator, coords, true, XL, YL, false, true);
            DrawSpriteWidgetClipped(Canvas, VehicleRPMIndicator, coords, true, XL, YL, false, true);

            // Get speed value & update rotator
            f = (((VSize(wheeled_vehicle.Velocity) * 3600)/60.35)/1000);
            //f = 100;
            f *= VehicleSpeedScale[i];
            f += VehicleSpeedZeroPosition[i];

            // Check if we should reset needles rotation
            if (VehicleNeedlesLastRenderTime < Level.TimeSeconds - 0.5)
               f = VehicleLastSpeedRotation;

            // Calculate modified rotation (to limit rotation speed)
            if (f < VehicleLastSpeedRotation)
                VehicleLastSpeedRotation = max(f, VehicleLastSpeedRotation -
                    (Level.TimeSeconds - VehicleNeedlesLastRenderTime) * VehicleNeedlesRotationSpeed);
            else
                VehicleLastSpeedRotation = min(f, VehicleLastSpeedRotation +
                    (Level.TimeSeconds - VehicleNeedlesLastRenderTime) * VehicleNeedlesRotationSpeed);
            TexRotator(VehicleSpeedNeedlesTextures[i]).Rotation.Yaw = VehicleLastSpeedRotation;

            // Get RPM value & update rotator
            f = wheeled_vehicle.EngineRPM / 100;
            //f = 35;
            f *= VehicleRPMScale[i];
            f += VehicleRPMZeroPosition[i];

            // Check if we should reset needles rotation
            if (VehicleNeedlesLastRenderTime < Level.TimeSeconds - 0.5)
               f = VehicleLastSpeedRotation;

            // Calculate modified rotation (to limit rotation speed)
            if (f < VehicleLastRPMRotation)
                VehicleLastRPMRotation = max(f, VehicleLastRPMRotation -
                    (Level.TimeSeconds - VehicleNeedlesLastRenderTime) * VehicleNeedlesRotationSpeed);
            else
                VehicleLastRPMRotation = min(f, VehicleLastRPMRotation +
                    (Level.TimeSeconds - VehicleNeedlesLastRenderTime) * VehicleNeedlesRotationSpeed);
            TexRotator(VehicleRPMNeedlesTextures[i]).Rotation.Yaw = VehicleLastRPMRotation;

            // Save last updated time
            VehicleNeedlesLastRenderTime = Level.TimeSeconds;

            // Update textures for needles
            VehicleSpeedIndicator.WidgetTexture = VehicleSpeedNeedlesTextures[i];
            VehicleRPMIndicator.WidgetTexture = VehicleRPMNeedlesTextures[i];

            // Draw needles
            DrawSpriteWidgetClipped(Canvas, VehicleSpeedIndicator, coords, true, XL, YL, false, true);
            DrawSpriteWidgetClipped(Canvas, VehicleRPMIndicator, coords, true, XL, YL, false, true);

            // Check if we should draw throttle
            if (ROPlayer(vehicle.Controller) != none
                && ( (ROPlayer(vehicle.Controller).bInterpolatedTankThrottle && threadCraft != none) ||
                     (ROPlayer(vehicle.Controller).bInterpolatedVehicleThrottle && threadCraft == none) ))
            {
                // Draw throttle background
                DrawSpriteWidgetClipped(Canvas, VehicleThrottleIndicatorBackground, coords, true, XL, YL, false, true);

                // Save YL for use later
                Y_one = YL;

                // Check which throttle variable we should use
                if (PlayerOwner != vehicle.Controller)
                {
                    // Is spectator
                    if (wheeled_vehicle.ThrottleRep <= 100)
                        f = (wheeled_vehicle.ThrottleRep * -1.0) / 100.0;
                    else
                        f = float(wheeled_vehicle.ThrottleRep - 101) / 100.0;
                }
                else
                    f = wheeled_vehicle.Throttle;

                // Figure which part to draw (top or bottom) depending if throttle is positive or negative,
                // updated the scale value and draw the widget
                if (f ~= 0)
                {
                }
                else if (f > 0)
                {
                    VehicleThrottleIndicatorTop.Scale = VehicleThrottleTopZeroPosition
                        + f * (VehicleThrottleTopMaxPosition - VehicleThrottleTopZeroPosition);
                    DrawSpriteWidgetClipped(Canvas, VehicleThrottleIndicatorTop, coords, true, XL, YL, false, true);
                }
                else
                {
                    VehicleThrottleIndicatorBottom.Scale = VehicleThrottleBottomZeroPosition
                        - f * (VehicleThrottleBottomMaxPosition - VehicleThrottleBottomZeroPosition);
                    DrawSpriteWidgetClipped(Canvas, VehicleThrottleIndicatorBottom, coords, true, XL, YL, false, true);
                }

                // Draw throttle foreground
                DrawSpriteWidgetClipped(Canvas, VehicleThrottleIndicatorForeground, coords, true, XL, YL, false, true);

                // Draw the lever thingy
                if (f ~= 0)
                {
                    VehicleThrottleIndicatorLever.OffsetY =
                        default.VehicleThrottleIndicatorLever.OffsetY -
                        Y_one * VehicleThrottleTopZeroPosition;
                }
                else if (f > 0)
                {
                    VehicleThrottleIndicatorLever.OffsetY =
                        default.VehicleThrottleIndicatorLever.OffsetY -
                        Y_one * VehicleThrottleIndicatorTop.scale;
                }
                else
                {
                    VehicleThrottleIndicatorLever.OffsetY =
                        default.VehicleThrottleIndicatorLever.OffsetY -
                        Y_one * (1 - VehicleThrottleIndicatorBottom.Scale);
                }
                DrawSpriteWidgetClipped(Canvas, VehicleThrottleIndicatorLever, coords, true, XL, YL, true, true);

                // Shift passengers list farther to the right
                VehicleOccupantsText.PosX = VehicleGaugesOccupantsTextOffset;
            }
            else
            {
                // Shift passengers list farther to the right
                VehicleOccupantsText.PosX = VehicleGaugesNoThrottleOccupantsTextOffset;
            }

            // hax to get proper x offset on non-4:3 screens
            VehicleOccupantsText.PosX *= Canvas.ClipY / Canvas.ClipX * 4 / 3;
        }
    }

    // Draw occupant dots
    for (i = 0; i < vehicle.VehicleHudOccupantsX.Length; i++)
    {
        if (vehicle.VehicleHudOccupantsX[i] ~= 0)
            continue;

        if (i == 0)
        {
            // Draw driver
            if (passenger == none) // we're the driver
                VehicleOccupants.Tints[TeamIndex] = VehiclePositionIsPlayerColor;
            else if (vehicle.Driver != none)
                VehicleOccupants.Tints[TeamIndex] = VehiclePositionIsOccupiedColor;
            else
                VehicleOccupants.Tints[TeamIndex] = VehiclePositionIsVacantColor;

            VehicleOccupants.PosX = vehicle.VehicleHudOccupantsX[0];
            VehicleOccupants.PosY = vehicle.VehicleHudOccupantsY[0];
            DrawSpriteWidgetClipped(Canvas, VehicleOccupants, coords, true);
        }
        else
        {
            if (i - 1 >= vehicle.WeaponPawns.Length)
            {
                warn("VehicleHudOccupantsX[" $ i $ "] causes out-of-bounds access in vehicle.WeaponPawns[] (lenght is " $ vehicle.WeaponPawns.Length $ ")");
                continue;
            }
            else if (vehicle.WeaponPawns[i-1] == passenger && passenger != none)
                VehicleOccupants.Tints[TeamIndex] = VehiclePositionIsPlayerColor;
            else if (vehicle.WeaponPawns[i-1].PlayerReplicationInfo != none)
            {
                if (passenger != none &&
                    passenger.PlayerReplicationInfo != none &&
                    vehicle.WeaponPawns[i-1].PlayerReplicationInfo == passenger.PlayerReplicationInfo)
                {
                    VehicleOccupants.Tints[TeamIndex] = VehiclePositionIsPlayerColor;
                }
                else
                    VehicleOccupants.Tints[TeamIndex] = VehiclePositionIsOccupiedColor;
            }
            else
                VehicleOccupants.Tints[TeamIndex] = VehiclePositionIsVacantColor;

            // Check to make sure replicated array index doesn'T cause out of bounds access
            current = vehicle.WeaponPawns[i-1].PositionInArray;
            if (current >= vehicle.VehicleHudOccupantsX.Length - 1 ||
                current < 0)
            {
                warn("vehicle.WeaponPawns[" $ (i-1) $ "].PositionInArray "$current$" causes out-of-bounds access in vehicle.VehicleHudOccupantsX[] (lenght is " $ vehicle.VehicleHudOccupantsX.Length $ ")");
            }
            else
            {
                VehicleOccupants.PosX = vehicle.VehicleHudOccupantsX[current + 1];
                VehicleOccupants.PosY = vehicle.VehicleHudOccupantsY[current + 1];
                DrawSpriteWidgetClipped(Canvas, VehicleOccupants, coords, true);
            }
        }
    }


    //////////////////////////////////////
    // Draw passenger names
    //////////////////////////////////////

    // Get self's PRI
    if (passenger != none)
        PRI = passenger.PlayerReplicationInfo;
    else
        PRI = vehicle.PlayerReplicationInfo;

    // Clear lines array
    lines.length = 0;

    // Shift text up some more if we're the driver and we're displaying capture bar
    if (bDrawingCaptureBar && vehicle.PlayerReplicationInfo == PRI)
       modifiedVehicleOccupantsTextYOffset -= 0.12 * Canvas.SizeY * myScale;

    // Driver's name
    if (vehicle.PlayerReplicationInfo != none)
        if (vehicle.PlayerReplicationInfo != PRI) // don't draw our own name!
            lines[lines.length] = class'ROVehicleWeaponPawn'.default.DriverHudName $ ": " $
                vehicle.PlayerReplicationInfo.PlayerName;

    // Passengers' names
    for (i = 0; i < vehicle.WeaponPawns.Length; i++)
    {
        wpawn = ROVehicleWeaponPawn(vehicle.WeaponPawns[i]);
        if (wpawn != none && wpawn.PlayerReplicationInfo != none)
            if (wpawn.PlayerReplicationInfo != PRI) // don't draw our own name!
                lines[lines.length] = wpawn.HudName $ ": " $
                    wpawn.PlayerReplicationInfo.PlayerName;
    }

    // Draw the lines
    if (lines.Length > 0)
    {
        VehicleOccupantsText.OffsetY = default.VehicleOccupantsText.OffsetY * myScale;
        VehicleOccupantsText.OffsetY += modifiedVehicleOccupantsTextYOffset;
        Canvas.Font = GetSmallMenuFont(Canvas);

        for (i = lines.Length - 1; i >= 0 ; i--)
        {
            VehicleOccupantsText.text = lines[i];
            DrawTextWidgetClipped(Canvas, VehicleOccupantsText, coords2, XL, YL, Y_one);
            VehicleOccupantsText.OffsetY -= YL;
        }
    }

}

// test0r!
/*exec function testHint(string text)
{
	ShowHint("My Test Title", text);
}
exec function testHint2()
{
	ShowHint("Welcome", "Welcome to Red Orchestra!||These hint messages will show up periodically in the game to help you survive. They can be disabled from the HUD tab in the configuration menu. (You can open that menu by hitting %SHOWMENU%)");
}
exec function testHint3()
{
	ShowHint("Leaning", "Press %LeanRight% or %LeanLeft% to lean around corners.||Leaning lets you peak around corners without showing as large a target as you would by simply walking around that corner.");
}
exec function testHint4()
{
	ShowHint("Weak Points", "Every tank has its weak points. Try targetting the driver's window or the turret/body seam.");
}*/

simulated function FadeToBlack(float fadeTime, optional bool bInvertFadeDirection)
{
	FadeToBlackTime = fadeTime;
	FadeToBlackStartTime = Level.TimeSeconds;
	bFadeToBlackInvert = bInvertFadeDirection;
	bFadeToBlack = true;
}

simulated function DrawFadeToBlack(Canvas Canvas)
{
	local float alpha;

	if (FadeToBlackTime ~= 0)
		alpha = 0.0;
	else
		alpha = (FadeToBlackTime - Level.TimeSeconds + FadeToBlackStartTime) / FadeToBlackTime;

	if (alpha <= 0)
		alpha = 0.0;
	else if (alpha > 1)
		alpha = 1.0;

	if (!bFadeToBlackInvert)
		alpha = 1.0 - alpha;

	if (alpha ~= 0)
	{
		bFadeToBlack = false;
		return;
	}

	Canvas.SetPos(0, 0);
	Canvas.Style = ERenderStyle.STY_Alpha;
	Canvas.DrawColor = BlackColor;
	Canvas.DrawColor.A = alpha * 255;
	Canvas.DrawTile(Texture'Engine.WhiteTexture', Canvas.ClipX, Canvas.ClipY, 0, 0, 4, 4);
}

/*
exec function testFade1()
{
	FadeToBlack(4.0);
}

exec function testFade2()
{
	FadeToBlack(4.0, true);
}

exec function testFade3()
{
	FadeToBlack(0, true);
}*/

simulated function DrawLCDPlayerStatus(Canvas C, GUIController GC)
{
	local int row,x,xl,yl;
	local int Amount;
	local string WName;
	local weapon w;
	local string s;
	local int PawnHealth, Enginehealth;
	local ROPawn ROP;
	local ROGameReplicationInfo GRI;
	local float RoundTime, RespawnTime;
	local ROVehicle ROV;
	local ROVehicleWeaponPawn ROVWP;

	GC.LCDCls();

	if( PawnOwner == none )
	{
		GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

		if (GRI != None)
		{
			if(PlayerOwner.IsInState('Dead') || PlayerOwner.IsInState('DeadSpectating') )
			{
				GC.LCDDrawText("Dead",0,10*row, GC.LCDMedFont);
			}
			else
			{
				GC.LCDDrawText("Waiting To Spawn",0,10*row, GC.LCDMedFont);
			}
			row++;

            GC.LCDDrawTile(Texture'engine.WhiteSquareTexture',0,16*row,160,1,0,0,1,1);

			// Update round timer
			if (!GRI.bMatchHasBegun)
				RoundTime = GRI.RoundStartTime + GRI.PreStartTime - GRI.ElapsedTime;
			else
				RoundTime = GRI.RoundStartTime + GRI.RoundDuration - GRI.ElapsedTime;

			S = default.TimeRemainingText $ GetTimeString(RoundTime);
			GC.LCDDrawText(s,0,20*row, GC.LCDTinyFont);
			row++;

			if (GRI.bMatchHasBegun && ROPlayer(PlayerOwner) != None && ROPlayer(PlayerOwner).CanRestartPlayer()
				&& PlayerOwner.PlayerReplicationInfo.Team != none && GRI.bReinforcementsComing[PlayerOwner.PlayerReplicationInfo.Team.TeamIndex] == 1)
			{
				RespawnTime = GRI.LastReinforcementTime[PlayerOwner.PlayerReplicationInfo.Team.TeamIndex] + GRI.ReinforcementInterval[PlayerOwner.PlayerReplicationInfo.Team.TeamIndex] - GRI.ElapsedTime;
				S = default.ReinforcementText $ GetTimeString(RespawnTime);

				GC.LCDDrawText(s,0,15*row, GC.LCDTinyFont);
				row++;
			}
		}
	}
	else
	{
    	ROP = ROPawn(PawnOwner);
    	ROV = ROVehicle(PawnOwner);
    	ROVWP = ROVehicleWeaponPawn(PawnOwner);

		w = PawnOwner.Weapon;
		if (W!=none)
		{
			Amount = w.GetHudAmmoCount();
			WName = w.ItemName;
		}

		// Draw health info
		if( ROP != none )
		{
			PawnHealth = int((float(PawnOwner.Health)/float(PawnOwner.Default.Health))*100);

			if( PawnHealth == 100 )
			{
			 	s = "No Injuries";
			}
			else if( PawnHealth < 25 )
			{
				s = "Near Death";
			}
			else if( PawnHealth < 50 )
			{
				s = "Seriously Injured";
			}
			else if( PawnHealth < 100 )
			{
				s = "Injured";
			}

			GC.LCDDrawText("Health: "$s,0,10*row, GC.LCDTinyFont);
			row++;
		}
		else if ( Vehicle(PawnOwner) != none )
		{
			if( ROVWP != none )
			{
				PawnHealth = int((float(ROVWP.VehicleBase.Health)/float(ROVWP.VehicleBase.Default.Health))*100);
				Enginehealth = int((float(ROVWP.VehicleBase.EngineHealth)/float(ROVWP.VehicleBase.Default.EngineHealth))*100);
			}
			else
			{
				PawnHealth = int((float(PawnOwner.Health)/float(PawnOwner.Default.Health))*100);
				Enginehealth = int((float(ROVehicle(PawnOwner).EngineHealth)/float(ROVehicle(PawnOwner).Default.EngineHealth))*100);
			}

			if( PawnHealth == 100 )
			{
			 	s = "No Damage";
			}
			else if( PawnHealth < 25 )
			{
				s = "Failure Imminent";
			}
			else if( PawnHealth < 50 )
			{
				s = "Heavy Damage";
			}
			else if( PawnHealth < 100 )
			{
				s = "Damaged";
			}

			GC.LCDDrawText("Vehicle: "$s,0,10*row, GC.LCDTinyFont);
			row++;

			if( Enginehealth == 100 )
			{
			 	s = "No Damage";
			}
			else if( Enginehealth < 25 )
			{
				s = "Failure Imminent";
			}
			else if( Enginehealth < 50 )
			{
				s = "Heavy Damage";
			}
			else if( Enginehealth < 100 )
			{
				s = "Damaged";
			}

			GC.LCDDrawText("Engine : "$s,0,10*row, GC.LCDTinyFont);
			row++;

			if( ROVWP != none )
			{
				if( ROVWP.Gun.ProjectileClass != none )
				{
					if( ROTankCannon(ROVWP.Gun) != none)
					{
						GC.LCDDrawText("Primary Ammo Count : "$ROVWP.Gun.PrimaryAmmoCount(),0,10*row, GC.LCDTinyFont);
					}
					else
					{
						GC.LCDDrawText("Primary Ammo Count : "$ROVehicleWeapon(ROVWP.Gun).getNumMags(),0,10*row, GC.LCDTinyFont);
					}
					row++;
				}
				if( ROVWP.Gun.AltFireProjectileClass != none )
				{
					GC.LCDDrawText("Secondary Ammo Count : "$ROVehicleWeapon(ROVWP.Gun).getNumMags(),0,10*row, GC.LCDTinyFont);
					row++;
				}
			}
		}

    	if(ROP != none)
    	{
			// Stamina
			GC.LCDDrawText("Stamina: ",X,10*row, GC.LCDTinyFont);
			s = int((ROP.Stamina/ROP.Default.Stamina)*100)@"%";
			GC.LCDStrLen(s,GC.LCDTinyFont,xl,yl);
			GC.LCDDrawText(s,100-5-xl,10*row,GC.LCDTinyFont);
			row++;

	    	// Weapon info
			if(W != none)
	    	{
				if(WName != "")
				{
					GC.LCDDrawText(WName,0,10*row, GC.LCDTinyFont);
					row++;

					if(!w.IsA('BinocularsItem'))
					{
						if( w.IsA('MG42Weapon' ) )
						{
						  	s = "MG Belts: "@Amount;
						}
						else if( w.IsA('MG34Weapon' ) )
						{
						 	s = "MG Drums: "@Amount;
						}
						else
						{
							s = w.FireModeClass[0].default.AmmoClass.default.ItemName$": "@Amount;
						}
						GC.LCDDrawText(s,0,10*row,GC.LCDTinyFont);
						row++;
					}
				}
			}
    	}
	}

	GC.LCDRepaint();
}

// Draw objective information on the G15 LCD
simulated function DrawLCDObjectives(Canvas C, GUIController GC)
{
	local ROGameReplicationInfo GRI;
	local int i, objCount, row;
	local string s;
	local bool bHasSecondaryObjectives;

	GRI = ROGameReplicationInfo(PlayerOwner.GameReplicationInfo);

	// Draw objective texts
	objCount = 1;

    GC.LCDCls();

	// See if there are any secondary objectives
	for (i = 0; i < ArrayCount(GRI.Objectives); i++)
	{
		if (GRI.Objectives[i] == none || !GRI.Objectives[i].bActive )
			continue;

		if( !GRI.Objectives[i].bRequired )
		{
			bHasSecondaryObjectives=true;
			break;
		}
	}

	if( LCDPage == 0 || !bHasSecondaryObjectives )
	{
	    GC.LCDDrawText(MapRequiredObjectivesTitle.text$" Status:",0,0, GC.LCDTinyFont);
	    row++;

		for (i = 0; i < ArrayCount(GRI.Objectives); i++)
		{
			if (GRI.Objectives[i] == none || !GRI.Objectives[i].bActive || !GRI.Objectives[i].bRequired)
				continue;

	        if (GRI.Objectives[i].ObjState == OBJ_Allies)
	        {
		        if (GRI.Objectives[i].CompressedCapProgress != 0 && GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
				{
					s = objCount $ "." $ "Allies"$"-" $ "Under Attack" ;
				}
				else
				{
					s = objCount $ "." $ "Allies"$"-" $ "Captured" ;
				}
	        }
	        else if (GRI.Objectives[i].ObjState == OBJ_Axis)
	        {
	        	if (GRI.Objectives[i].CompressedCapProgress != 0 && GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
				{
					s = objCount $ "." $ "Axis"$"-" $ "Under Attack" ;
				}
				else
				{
					s = objCount $ "." $ "Axis"$"-" $ "Captured" ;
				}
	        }
	        else
	        {
				if (GRI.Objectives[i].CompressedCapProgress != 0 )
				{
					if(GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
					{
			        	if (GRI.Objectives[i].CurrentCapTeam == ALLIES_TEAM_INDEX)
							s = objCount $ "." $ "Neutral"$"-" $ "Allies Attacking";
						else
							s = objCount $ "." $ "Neutral"$"-" $ "Axis Attacking";
					}
					else
					{
						s = objCount $ "." $ "Neutral"$"-" $ "Under Attack";
					}
				}
				else
				{
					s = objCount $ "." $ "Neutral";
				}
	        }

	        GC.LCDDrawText(s,0,8*row + 2, GC.LCDTinyFont);

	        row++;
			objCount++;
		}
	}
	if( LCDPage == 1 && bHasSecondaryObjectives )
	{
	    GC.LCDDrawText(MapSecondaryObjectivesTitle.text$" Status:",0,0, GC.LCDTinyFont);
	    row++;

		for (i = 0; i < ArrayCount(GRI.Objectives); i++)
		{
			if (GRI.Objectives[i] == none || !GRI.Objectives[i].bActive || GRI.Objectives[i].bRequired)
				continue;

	        if (GRI.Objectives[i].ObjState == OBJ_Allies)
	        {
		        if (GRI.Objectives[i].CompressedCapProgress != 0 && GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
				{
					s = objCount $ "." $ "Allies"$"-" $ "Under Attack" ;
				}
				else
				{
					s = objCount $ "." $ "Allies"$"-" $ "Captured" ;
				}
	        }
	        else if (GRI.Objectives[i].ObjState == OBJ_Axis)
	        {
	        	if (GRI.Objectives[i].CompressedCapProgress != 0 && GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
				{
					s = objCount $ "." $ "Axis"$"-" $ "Under Attack" ;
				}
				else
				{
					s = objCount $ "." $ "Axis"$"-" $ "Captured" ;
				}
	        }
	        else
	        {
				if (GRI.Objectives[i].CompressedCapProgress != 0 )
				{
					if(GRI.Objectives[i].CurrentCapTeam != NEUTRAL_TEAM_INDEX)
					{
			        	if (GRI.Objectives[i].CurrentCapTeam == ALLIES_TEAM_INDEX)
							s = objCount $ "." $ "Neutral"$"-" $ "Allies Attacking";
						else
							s = objCount $ "." $ "Neutral"$"-" $ "Axis Attacking";
					}
					else
					{
						s = objCount $ "." $ "Neutral"$"-" $ "Under Attack";
					}
				}
				else
				{
					s = objCount $ "." $ "Neutral";
				}
	        }

	        GC.LCDDrawText(s,0,8*row, GC.LCDTinyFont);

	        row++;
			objCount++;
		}
	}

	GC.LCDRepaint();
}

simulated function string GetScoreTitle()
{
	return "Points";
}

//=============================================================================
// defaultproperties
//=============================================================================

defaultproperties
{
     bShowCompass=True
     bShowMapUpdatedText=True
     ReinforcementText="Reinforcements: "
     TimeRemainingText="Time Remaining: "
     IPText="IP: "
     TimeText="Time: "
     ViewingText="Viewing: "
     NoReinforcementsText="No reinforcements available"
     TeamMessagePrefix="*PLATOON* "
     ObjectivesText="OBJECTIVES"
     PlayersNeededText="Need: "
     SpectateInstructionText1="Press Fire to switch Viewpoint/Players"
     SpectateInstructionText2="Press Alt-Fire to switch Spectating Modes"
     SpectateInstructionText3="Press Ironsights to toggle First/Third Person View"
     SpectateInstructionText4="Press Jump to return to viewing yourself"
     NeedAmmoText="Needs ammo"
     CanResupplyText="Press %THROWMGAMMO% to resupply"
     OpenMapText="%SHOWOBJECTIVES% to open"
     SituationMapInstructionsText="Press %SHOWOBJECTIVES% to Close/Open Situation Map"
     SpacingText="            "
     MapCoordTextX(0)="1"
     MapCoordTextX(1)="2"
     MapCoordTextX(2)="3"
     MapCoordTextX(3)="4"
     MapCoordTextX(4)="5"
     MapCoordTextX(5)="6"
     MapCoordTextX(6)="7"
     MapCoordTextX(7)="8"
     MapCoordTextX(8)="9"
     MapCoordTextY(0)="A"
     MapCoordTextY(1)="B"
     MapCoordTextY(2)="C"
     MapCoordTextY(3)="D"
     MapCoordTextY(4)="E"
     MapCoordTextY(5)="F"
     MapCoordTextY(6)="G"
     MapCoordTextY(7)="H"
     MapCoordTextY(8)="I"
     LegendAxisObjectiveText="Axis-controlled obj."
     LegendAlliesObjectiveText="Allies-controlled obj."
     LegendNeutralObjectiveText="Neutral objective"
     LegendArtilleryRadioText="Artillery radio"
     LegendResupplyAreaText="Resupply area"
     LegendRallyPointText="Rally point"
     LegendSavedArtilleryText="Saved artillery coords."
     LegendOrderTargetText="Ordered target obj."
     LegendArtyStrikeText="Artillery strike"
     LegendHelpRequestText="Help requested at obj."
     LegendDestroyableItemText="Destroyable target"
     LegendDestroyedItemText="Destroyed target"
     LegendMGResupplyText="MG requesting resupply"
     LegendVehResupplyAreaText="Vehicle resupply area"
     LegendATGunText="Anti Tank Gun"
     SmallFontArrayNames(0)="ROFontsTwo.ROArial24DS"
     SmallFontArrayNames(1)="ROFontsTwo.ROArial24DS"
     SmallFontArrayNames(2)="ROFontsTwo.ROArial22DS"
     SmallFontArrayNames(3)="ROFontsTwo.ROArial22DS"
     SmallFontArrayNames(4)="ROFontsTwo.ROArial18DS"
     SmallFontArrayNames(5)="ROFontsTwo.ROArial14DS"
     SmallFontArrayNames(6)="ROFontsTwo.ROArial12DS"
     SmallFontArrayNames(7)="ROFontsTwo.ROArial9DS"
     SmallFontArrayNames(8)="ROFontsTwo.ROArial7DS"
     MenuFontArrayNames(0)="ROFonts.ROBtsrmVr18"
     MenuFontArrayNames(1)="ROFonts.ROBtsrmVr14"
     MenuFontArrayNames(2)="ROFonts.ROBtsrmVr12"
     MenuFontArrayNames(3)="ROFonts.ROBtsrmVr9"
     MenuFontArrayNames(4)="ROFonts.ROBtsrmVr7"
     CriticalMsgFontArrayNames(0)="ROFonts.ROArial28"
     CriticalMsgFontArrayNames(1)="ROFonts.ROArial26"
     CriticalMsgFontArrayNames(2)="ROFonts.ROArial24"
     CriticalMsgFontArrayNames(3)="ROFonts.ROArial22"
     CriticalMsgFontArrayNames(4)="ROFonts.ROArial18"
     CriticalMsgFontArrayNames(5)="ROFonts.ROArial16"
     CriticalMsgFontArrayNames(6)="ROFonts.ROArial14"
     CriticalMsgFontArrayNames(7)="ROFonts.ROArial12"
     CriticalMsgFontArrayNames(8)="ROFonts.ROArial9"
     SideColors(0)=(B=128,G=128,R=64,A=255)
     SideColors(1)=(B=64,G=64,R=192,A=255)
     Digits=(DigitTexture=Texture'InterfaceArt_tex.HUD.numbers',TextureCoords[0]=(X1=15,X2=47,Y2=63),TextureCoords[1]=(X1=79,X2=111,Y2=63),TextureCoords[2]=(X1=143,X2=175,Y2=63),TextureCoords[3]=(X1=207,X2=239,Y2=63),TextureCoords[4]=(X1=15,Y1=64,X2=47,Y2=127),TextureCoords[5]=(X1=79,Y1=64,X2=111,Y2=127),TextureCoords[6]=(X1=143,Y1=64,X2=175,Y2=127),TextureCoords[7]=(X1=207,Y1=64,X2=239,Y2=127),TextureCoords[8]=(X1=15,Y1=128,X2=47,Y2=191),TextureCoords[9]=(X1=79,Y1=128,X2=111,Y2=191),TextureCoords[10]=(X1=143,Y1=128,X2=175,Y2=191))
     HealthFigure=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=255),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=8,OffsetY=-8,ScaleMode=SM_Up,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     HealthFigureBackground=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=255),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=8,OffsetY=-8,ScaleMode=SM_Up,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     HealthFigureStamina=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=255),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=8,OffsetY=-8,ScaleMode=SM_Up,Scale=1.000000,Tints[0]=(R=255,A=255),Tints[1]=(R=255,A=255))
     StanceIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=127),TextureScale=0.250000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=155,OffsetY=-15,ScaleMode=SM_Right,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     AmmoCount=(RenderStyle=STY_Alpha,MinDigitCount=1,TextureScale=0.250000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=440,OffsetY=-55,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     AmmoIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=127),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=240,OffsetY=-7,ScaleMode=SM_Right,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     AutoFireIcon=(WidgetTexture=Texture'InterfaceArt2_tex.HUD.firemode_auto',RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=31),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=275,OffsetY=-140,ScaleMode=SM_Right,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     SemiFireIcon=(WidgetTexture=Texture'InterfaceArt2_tex.HUD.firemode_semi',RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=31),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosY=1.000000,OffsetX=275,OffsetY=-140,ScaleMode=SM_Right,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MGDeployIcon=(WidgetTexture=Texture'InterfaceArt_tex.HUD.MGDeploy',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.450000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-8,OffsetY=-144,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     ResupplyZoneNormalPlayerIcon=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=192,Y1=192,X2=255,Y2=255),TextureScale=0.450000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-8,OffsetY=-200,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=128,G=128,R=255,A=128),Tints[1]=(B=128,G=128,R=255,A=128))
     ResupplyZoneNormalVehicleIcon=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=128,Y1=64,X2=191,Y2=127),TextureScale=0.450000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-8,OffsetY=-144,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=128,G=128,R=255,A=128),Tints[1]=(B=128,G=128,R=255,A=128))
     ResupplyZoneResupplyingPlayerIcon=(WidgetTexture=FinalBlend'InterfaceArt_tex.OverheadMap.overheadmap_icons_fast_flash',RenderStyle=STY_Alpha,TextureCoords=(X1=192,Y1=192,X2=255,Y2=255),TextureScale=0.450000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-8,OffsetY=-200,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     ResupplyZoneResupplyingVehicleIcon=(WidgetTexture=FinalBlend'InterfaceArt_tex.OverheadMap.overheadmap_icons_fast_flash',RenderStyle=STY_Alpha,TextureCoords=(X1=128,Y1=64,X2=191,Y2=127),TextureScale=0.450000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-8,OffsetY=-144,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     WeaponCanRestIcon=(WidgetTexture=Texture'InterfaceArt_tex.HUD.MGDeploy',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.450000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-8,OffsetY=-144,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=100,G=100,R=100,A=255),Tints[1]=(B=100,G=100,R=100,A=255))
     WeaponRestingIcon=(WidgetTexture=Texture'InterfaceArt_tex.HUD.MGDeploy',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.450000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-8,OffsetY=-144,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CompassBase=(WidgetTexture=Texture'InterfaceArt_tex.HUD.Compass2_main',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=255),TextureScale=0.150000,DrawPivot=DP_LowerRight,PosX=1.000000,PosY=1.000000,OffsetX=-3,OffsetY=3,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CompassNeedle=(WidgetTexture=TexRotator'InterfaceArt_tex.HUD.TexRotator0',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=255),TextureScale=0.155000,DrawPivot=DP_MiddleMiddle,PosX=1.000000,PosY=1.000000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CompassIcons=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X2=31,Y2=31),TextureScale=0.030000,DrawPivot=DP_MiddleMiddle,PosX=1.000000,PosY=1.000000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     WeaponReloadingColor=(B=128,G=128,R=128,A=128)
     NationHealthFigures(0)=Texture'InterfaceArt_tex.HUD.ger_player'
     NationHealthFigures(1)=Texture'InterfaceArt_tex.HUD.rus_player'
     NationHealthFiguresBackground(0)=Texture'InterfaceArt_tex.HUD.ger_player_background'
     NationHealthFiguresBackground(1)=Texture'InterfaceArt_tex.HUD.rus_player_background'
     NationHealthFiguresStamina(0)=Texture'InterfaceArt_tex.HUD.ger_player_Stamina'
     NationHealthFiguresStamina(1)=Texture'InterfaceArt_tex.HUD.rus_player_Stamina'
     NationHealthFiguresStaminaCritical(0)=FinalBlend'InterfaceArt_tex.HUD.ger_player_Stamina_critical'
     NationHealthFiguresStaminaCritical(1)=FinalBlend'InterfaceArt_tex.HUD.rus_player_Stamina_critical'
     StanceStanding=Texture'InterfaceArt_tex.HUD.stance_stand'
     StanceCrouch=Texture'InterfaceArt_tex.HUD.stance_crouch'
     StanceProne=Texture'InterfaceArt_tex.HUD.stance_prone'
     PlayerArrowTexture=FinalBlend'InterfaceArt_tex.OverheadMap.arrowhead_final'
     ObituaryLifeSpan=8.000000
     FadeTime=-1.000000
     WhiteFlashTime=0.500000
     MapUpdatedIcon=(WidgetTexture=Texture'InterfaceArt_tex.HUD.situation_map_icon',RenderStyle=STY_Alpha,TextureCoords=(X2=64,Y2=64),TextureScale=0.050000,DrawPivot=DP_LowerMiddle,PosX=0.850000,PosY=1.000000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapUpdatedText=(RenderStyle=STY_Alpha,DrawPivot=DP_LowerMiddle,PosX=0.850000,PosY=1.000000,WrapHeight=1.000000,OffsetY=-80,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconsFlash=FinalBlend'InterfaceArt_tex.OverheadMap.overheadmap_Icons_flashing'
     MapIconsFastFlash=FinalBlend'InterfaceArt_tex.OverheadMap.overheadmap_icons_fast_flash'
     MapIconsAltFlash=FinalBlend'InterfaceArt_tex.OverheadMap.overheadmap_icons_alt_flashing'
     MapIconsAltFastFlash=FinalBlend'InterfaceArt_tex.OverheadMap.overheadmap_icons_alt_fast_flash'
     MaxMapUpdatedIconDisplayTime=8.000000
     AnimateMapCurrentPosition=1.000000
     AnimateMapSpeed=0.300000
     MapBackground=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_background',RenderStyle=STY_Alpha,TextureCoords=(X2=1023,Y2=1023),TextureScale=1.000000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=128,G=128,R=128,A=255),Tints[1]=(B=128,G=128,R=128,A=255))
     MapLegendImageCoords=(X=0.040000,Y=0.070000,XL=0.555000,YL=0.705000)
     MapLevelImage=(RenderStyle=STY_Alpha,TextureCoords=(X2=511,Y2=511),TextureScale=1.000000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapTexts=(RenderStyle=STY_Alpha,DrawPivot=DP_UpperMiddle,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapPlayerIcon=(WidgetTexture=FinalBlend'InterfaceArt_tex.OverheadMap.arrowhead_final',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(R=255,A=255),Tints[1]=(B=255,A=255))
     MapCoordTextXWidget=(RenderStyle=STY_Alpha,DrawPivot=DP_MiddleLeft,PosY=-0.022000,WrapWidth=0.100000,WrapHeight=1.000000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=128),Tints[1]=(B=255,G=255,R=255,A=128))
     MapCoordTextYWidget=(RenderStyle=STY_Alpha,DrawPivot=DP_MiddleLeft,PosX=-0.035000,WrapWidth=0.100000,WrapHeight=1.000000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=128),Tints[1]=(B=255,G=255,R=255,A=128))
     MapIconTeam(0)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=192,X2=255,Y2=63),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconTeam(1)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=128,X2=191,Y2=63),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconDispute(0)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=128,Y1=192,X2=191,Y2=255),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconDispute(1)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(Y1=192,X2=63,Y2=255),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconNeutral=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=64,X2=127,Y2=63),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconRadio=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=64,Y1=192,X2=127,Y2=255),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconRally(0)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=64,Y1=128,X2=127,Y2=191),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconRally(1)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(Y1=128,X2=63,Y2=191),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconResupply=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=192,Y1=192,X2=255,Y2=255),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconVehicleResupply=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=128,Y1=64,X2=191,Y2=127),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconHelpRequest=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=192,Y1=64,X2=255,Y2=127),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconMGResupplyRequest(0)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=192,Y1=128,X2=255,Y2=191),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconMGResupplyRequest(1)=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=128,Y1=128,X2=191,Y2=191),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconAttackDefendRequest=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconArtyStrike=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(Y1=64,X2=63,Y2=127),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapIconDestroyableItem=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=64,Y1=64,X2=127,Y2=127),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(R=255,A=255),Tints[1]=(R=255,A=255))
     MapIconDestroyedItem=(WidgetTexture=Texture'InterfaceArt_tex.OverheadMap.overheadmap_Icons',RenderStyle=STY_Alpha,TextureCoords=(X1=64,Y1=64,X2=127,Y2=127),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=128,G=128,R=128,A=128),Tints[1]=(B=128,G=128,R=128,A=128))
     MapIconATGun=(WidgetTexture=Texture'InterfaceArt2_tex.overheadmaps.overheadmap_IconsB',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.050000,DrawPivot=DP_MiddleMiddle,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(R=255,A=255),Tints[1]=(R=255,A=255))
     MapTimerTitle=(Text="Time Remaining",RenderStyle=STY_Alpha,DrawPivot=DP_MiddleMiddle,PosX=0.810000,PosY=0.055000,WrapHeight=1.000000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapTimerTexts(0)=(RenderStyle=STY_Alpha,DrawPivot=DP_MiddleMiddle,PosX=0.748000,PosY=0.115000,WrapHeight=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapTimerTexts(1)=(RenderStyle=STY_Alpha,DrawPivot=DP_MiddleMiddle,PosX=0.785000,PosY=0.115000,WrapHeight=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapTimerTexts(2)=(RenderStyle=STY_Alpha,DrawPivot=DP_MiddleMiddle,PosX=0.832000,PosY=0.115000,WrapHeight=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapTimerTexts(3)=(RenderStyle=STY_Alpha,DrawPivot=DP_MiddleMiddle,PosX=0.870000,PosY=0.115000,WrapHeight=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapLegendCoords=(X=0.015000,Y=0.850000,XL=0.970000,YL=0.110000)
     MapLegend=(WidgetTexture=Texture'Engine.WhiteSquareTexture',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=1.000000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=64),Tints[1]=(B=255,G=255,R=255,A=64))
     MapLegendIcons=(RenderStyle=STY_Alpha,TextureCoords=(X2=31,Y2=31),TextureScale=0.300000,DrawPivot=DP_MiddleLeft,PosX=0.050000,PosY=0.100000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     MapLegendTitle=(Text="Legend",RenderStyle=STY_Alpha,DrawPivot=DP_MiddleLeft,PosX=0.007000,PosY=0.150000,WrapWidth=0.900000,WrapHeight=0.100000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapLegendTexts=(RenderStyle=STY_Alpha,DrawPivot=DP_MiddleLeft,PosX=0.150000,PosY=0.100000,WrapWidth=0.800000,WrapHeight=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapObjectivesCoords=(X=0.640000,Y=0.165000,XL=0.345000,YL=0.640000)
     MapObjectivesTitle=(Text="Objectives",RenderStyle=STY_Alpha,DrawPivot=DP_MiddleLeft,PosX=0.025000,PosY=0.026000,WrapWidth=0.500000,WrapHeight=0.100000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapRequiredObjectivesTitle=(Text="Required Objectives",RenderStyle=STY_Alpha,DrawPivot=DP_MiddleLeft,PosX=0.025000,PosY=0.026000,WrapWidth=0.500000,WrapHeight=0.100000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapSecondaryObjectivesTitle=(Text="Secondary Objectives",RenderStyle=STY_Alpha,PosX=0.025000,PosY=0.026000,WrapWidth=0.900000,WrapHeight=1.000000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     MapObjectivesTexts=(RenderStyle=STY_Alpha,PosX=0.050000,PosY=0.100000,WrapWidth=0.900000,WrapHeight=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     PortraitIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.060000,DrawPivot=DP_MiddleLeft,PosY=0.500000,OffsetX=80,ScaleMode=SM_Right,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     PortraitText(0)=(RenderStyle=STY_Alpha,DrawPivot=DP_LowerLeft,PosY=0.500000,OffsetX=8,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     PortraitText(1)=(RenderStyle=STY_Alpha,PosY=0.500000,OffsetX=8,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     NeedleRotator=TexRotator'InterfaceArt_tex.HUD.Needle_rot'
     VoiceMeterBackground=Texture'InterfaceArt_tex.HUD.VUMeter'
     VoiceMeterX=0.725000
     VoiceMeterY=1.000000
     VoiceMeterSize=100.000000
     compassStabilizationConstant=2.000000
     compassIconsFadeSpeed=0.150000
     compassIconsRefreshSpeed=0.700000
     compassIconsPositionRadius=0.800000
     locationHitAxisImages(0)=Texture'InterfaceArt_tex.Player_hits.ger_hit_head'
     locationHitAxisImages(1)=Texture'InterfaceArt_tex.Player_hits.ger_hit_torso'
     locationHitAxisImages(2)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Pelvis'
     locationHitAxisImages(3)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Lupperleg'
     locationHitAxisImages(4)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Rupperleg'
     locationHitAxisImages(5)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Lupperarm'
     locationHitAxisImages(6)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Rupperarm'
     locationHitAxisImages(7)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Llowerleg'
     locationHitAxisImages(8)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Rlowerleg'
     locationHitAxisImages(9)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Llowerarm'
     locationHitAxisImages(10)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Rlowerarm'
     locationHitAxisImages(11)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Lhand'
     locationHitAxisImages(12)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Rhand'
     locationHitAxisImages(13)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Lfoot'
     locationHitAxisImages(14)=Texture'InterfaceArt_tex.Player_hits.ger_hit_Rfoot'
     locationHitAlliesImages(0)=Texture'InterfaceArt_tex.Player_hits.rus_hit_head'
     locationHitAlliesImages(1)=Texture'InterfaceArt_tex.Player_hits.rus_hit_torso'
     locationHitAlliesImages(2)=Texture'InterfaceArt_tex.Player_hits.rus_hit_pelvis'
     locationHitAlliesImages(3)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Lupperleg'
     locationHitAlliesImages(4)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Rupperleg'
     locationHitAlliesImages(5)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Lupperarm'
     locationHitAlliesImages(6)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Rupperarm'
     locationHitAlliesImages(7)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Llowerleg'
     locationHitAlliesImages(8)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Rlowerleg'
     locationHitAlliesImages(9)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Llowerarm'
     locationHitAlliesImages(10)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Rlowerarm'
     locationHitAlliesImages(11)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Lhand'
     locationHitAlliesImages(12)=Texture'InterfaceArt_tex.Player_hits.rus_hit_Rhand'
     locationHitAlliesImages(13)=Texture'InterfaceArt_tex.Player_hits.rus_hit_LFoot'
     locationHitAlliesImages(14)=Texture'InterfaceArt_tex.Player_hits.rus_hit_RFoot'
     MouseInterfaceIcon=(WidgetTexture=Texture'InterfaceArt_tex.Cursors.Pointer',RenderStyle=STY_Alpha,TextureCoords=(X2=31,Y2=31),TextureScale=1.000000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleIconCoords=(Y=1.000000,YL=0.200000)
     VehicleIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=255),TextureScale=1.000000,DrawPivot=DP_MiddleMiddle,PosX=0.500000,PosY=0.500000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleIconAlt=(RenderStyle=STY_Alpha,TextureCoords=(X2=511,Y2=511),TextureScale=2.000000,DrawPivot=DP_MiddleMiddle,PosX=0.500000,PosY=0.500000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleThreads(0)=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.tread_left',RenderStyle=STY_Alpha,TextureCoords=(X1=23,Y1=2,X2=37,Y2=125),TextureScale=1.000000,DrawPivot=DP_MiddleMiddle,PosX=0.500000,PosY=0.500000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(R=255,A=128),Tints[1]=(R=255,A=128))
     VehicleThreads(1)=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.tread_left',RenderStyle=STY_Alpha,TextureCoords=(X1=25,Y1=2,X2=40,Y2=125),TextureScale=1.000000,DrawPivot=DP_MiddleMiddle,PosX=0.500000,PosY=0.500000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(R=255,A=128),Tints[1]=(R=255,A=128))
     VehicleEngine=(RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.220000,DrawPivot=DP_MiddleMiddle,PosX=0.500000,PosY=0.500000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(R=255,A=255),Tints[1]=(R=255,A=255))
     vehicleOccupants=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.RedDot',RenderStyle=STY_Alpha,TextureCoords=(X2=31,Y2=31),TextureScale=0.120000,DrawPivot=DP_MiddleMiddle,PosX=0.500000,PosY=0.500000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleOccupantsText=(RenderStyle=STY_Alpha,DrawPivot=DP_LowerLeft,PosX=0.150000,PosY=1.000000,WrapHeight=1.000000,OffsetX=8,OffsetY=-4,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleNormalColor=(B=255,G=255,R=255,A=255)
     VehicleDamagedColor=(G=222,R=255,A=255)
     VehicleCriticalColor=(R=154,A=255)
     VehiclePositionIsPlayerColor=(R=255,A=255)
     VehiclePositionIsOccupiedColor=(R=255,A=128)
     VehiclePositionIsVacantColor=(A=128)
     VehicleEngineDamagedTexture=Texture'InterfaceArt_tex.Tank_Hud.engine_hud'
     VehicleEngineCriticalTexture=FinalBlend'InterfaceArt_tex.Tank_Hud.engine_hud_final'
     VehicleAmmoIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=255),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosX=0.150000,PosY=1.000000,OffsetY=-8,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleAmmoReloadIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=255),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosX=0.150000,PosY=1.000000,OffsetY=-8,ScaleMode=SM_Up,Scale=0.750000,Tints[0]=(R=255,A=128),Tints[1]=(R=255,A=128))
     VehicleAmmoAmount=(RenderStyle=STY_Alpha,MinDigitCount=1,TextureScale=0.250000,DrawPivot=DP_LowerLeft,PosX=0.150000,PosY=1.000000,OffsetX=135,OffsetY=-130,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleAmmoTypeText=(RenderStyle=STY_Alpha,DrawPivot=DP_LowerLeft,PosX=0.190000,PosY=1.000000,WrapHeight=1.000000,OffsetX=8,OffsetY=-4,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleOccupantsTextOffset=0.242000
     VehicleAltAmmoIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=127),TextureScale=0.200000,DrawPivot=DP_LowerLeft,PosX=0.250000,PosY=1.000000,OffsetY=-8,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleAltAmmoAmount=(RenderStyle=STY_Alpha,MinDigitCount=1,TextureScale=0.200000,DrawPivot=DP_LowerLeft,PosX=0.250000,PosY=1.000000,OffsetX=135,OffsetY=-40,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleAltAmmoOccupantsTextOffset=-35.000000
     VehicleMGAmmoIcon=(RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=127),TextureScale=0.300000,DrawPivot=DP_LowerLeft,PosX=0.150000,PosY=1.000000,OffsetY=-8,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleMGAmmoAmount=(RenderStyle=STY_Alpha,MinDigitCount=1,TextureScale=0.250000,DrawPivot=DP_LowerLeft,PosX=0.150000,PosY=1.000000,OffsetX=145,OffsetY=-60,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleRPMTextures(0)=Texture'InterfaceArt_tex.Tank_Hud.Ger_RPM'
     VehicleRPMTextures(1)=Texture'InterfaceArt_tex.Tank_Hud.Rus_RPM'
     VehicleRPMNeedlesTextures(0)=TexRotator'InterfaceArt_tex.Tank_Hud.Ger_needle_rpm_rot'
     VehicleRPMNeedlesTextures(1)=TexRotator'InterfaceArt_tex.Tank_Hud.Rus_needle_rpm_rot'
     VehicleSpeedTextures(0)=Texture'InterfaceArt_tex.Tank_Hud.Ger_Speedometer'
     VehicleSpeedTextures(1)=Texture'InterfaceArt_tex.Tank_Hud.Rus_Speedometer'
     VehicleSpeedNeedlesTextures(0)=TexRotator'InterfaceArt_tex.Tank_Hud.Ger_needle_rot'
     VehicleSpeedNeedlesTextures(1)=TexRotator'InterfaceArt_tex.Tank_Hud.Rus_needle_rot'
     VehicleSpeedIndicator=(RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=255),TextureScale=0.800000,DrawPivot=DP_LowerLeft,PosX=1.000000,PosY=1.000000,OffsetY=-4,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleRPMIndicator=(RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=255),TextureScale=0.600000,DrawPivot=DP_LowerLeft,PosX=1.810000,PosY=1.000000,OffsetY=-7,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleThrottleIndicatorTop=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.throttle_background2',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=255),TextureScale=0.600000,DrawPivot=DP_LowerMiddle,PosX=2.570000,PosY=1.000000,OffsetY=-7,ScaleMode=SM_Up,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleThrottleIndicatorBottom=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.throttle_background2_bottom',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=255),TextureScale=0.600000,DrawPivot=DP_LowerMiddle,PosX=2.570000,PosY=1.000000,OffsetY=-7,ScaleMode=SM_Down,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleThrottleIndicatorBackground=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.throttle_background',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=255),TextureScale=0.600000,DrawPivot=DP_LowerMiddle,PosX=2.570000,PosY=1.000000,OffsetY=-7,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     VehicleThrottleIndicatorForeground=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.throttle_main',RenderStyle=STY_Alpha,TextureCoords=(X2=127,Y2=255),TextureScale=0.600000,DrawPivot=DP_LowerMiddle,PosX=2.570000,PosY=1.000000,OffsetY=-7,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleThrottleIndicatorLever=(WidgetTexture=Texture'InterfaceArt_tex.Tank_Hud.throttle_lever',RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.200000,DrawPivot=DP_MiddleRight,PosX=2.720000,PosY=1.000000,OffsetY=-7,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     VehicleRPMZeroPosition(0)=26000.000000
     VehicleRPMZeroPosition(1)=26000.000000
     VehicleRPMScale(0)=-1300.000000
     VehicleRPMScale(1)=-1300.000000
     VehicleSpeedZeroPosition(0)=-5500.000000
     VehicleSpeedZeroPosition(1)=26000.000000
     VehicleSpeedScale(0)=-545.000000
     VehicleSpeedScale(1)=-430.000000
     VehicleThrottleTopZeroPosition=0.310000
     VehicleThrottleTopMaxPosition=0.890000
     VehicleThrottleBottomZeroPosition=0.700000
     VehicleThrottleBottomMaxPosition=0.880000
     VehicleGaugesOccupantsTextOffset=0.400000
     VehicleGaugesNoThrottleOccupantsTextOffset=0.360000
     VehicleNeedlesRotationSpeed=30000.000000
     CaptureBarBackground=(WidgetTexture=Texture'InterfaceArt_tex.HUD.capbar_filled',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=63),TextureScale=0.500000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarOutline=(WidgetTexture=Texture'InterfaceArt_tex.HUD.capbar_outline',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=63),TextureScale=0.500000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarAttacker=(WidgetTexture=Texture'InterfaceArt_tex.HUD.capbar_bar',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=63),TextureScale=0.500000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,ScaleMode=SM_Right,Scale=0.450000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarDefender=(WidgetTexture=Texture'InterfaceArt_tex.HUD.capbar_bar',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=63),TextureScale=0.500000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,ScaleMode=SM_Left,Scale=0.550000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarAttackerRatio=(WidgetTexture=Texture'InterfaceArt_tex.HUD.capbar_bar2',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=63),TextureScale=0.500000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,ScaleMode=SM_Right,Scale=0.450000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarDefenderRatio=(WidgetTexture=Texture'InterfaceArt_tex.HUD.capbar_bar2',RenderStyle=STY_Alpha,TextureCoords=(X2=255,Y2=63),TextureScale=0.500000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,ScaleMode=SM_Left,Scale=0.550000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarIcons(0)=(RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.230000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,OffsetX=-216,OffsetY=-38,ScaleMode=SM_Right,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarIcons(1)=(RenderStyle=STY_Alpha,TextureCoords=(X2=63,Y2=63),TextureScale=0.230000,DrawPivot=DP_LowerMiddle,PosX=0.500000,PosY=0.980000,OffsetX=216,OffsetY=-38,ScaleMode=SM_Right,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     CaptureBarTeamIcons(0)=Texture'InterfaceArt_tex.HUD.ironcross'
     CaptureBarTeamIcons(1)=Texture'InterfaceArt_tex.HUD.russtar'
     CaptureBarTeamColors(0)=(A=255)
     CaptureBarTeamColors(1)=(R=255,A=255)
     HintFadeTime=0.500000
     HintLifetime=12.000000
     HintDesiredAspectRatio=10.000000
     HintBackground=(WidgetTexture=Texture'InterfaceArt_tex.Menu.SectionHeader_captionbar',RenderStyle=STY_Alpha,DrawPivot=DP_MiddleMiddle,PosY=0.020000,ScaleMode=SM_Left,Scale=1.000000,Tints[0]=(B=255,G=255,R=255,A=192),Tints[1]=(B=255,G=255,R=255,A=192))
     HintTitleWidget=(RenderStyle=STY_Alpha,WrapHeight=1.000000,bDrawShadow=True,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     HintTextWidget=(RenderStyle=STY_Alpha,WrapHeight=1.000000,Tints[0]=(B=255,G=255,R=255,A=255),Tints[1]=(B=255,G=255,R=255,A=255))
     HintCoords=(X=0.980000,Y=0.030000,XL=-1.000000)
     ConsoleColor=(B=255,G=255,R=255)
     ConsoleMessagePosX=0.010000
     ConsoleMessagePosY=0.800000
     FontArrayNames(0)="ROFonts.ROBtsrmVr28"
     FontArrayNames(1)="ROFonts.ROBtsrmVr26"
     FontArrayNames(5)="ROFonts.ROBtsrmVr16"
     FontArrayNames(6)="ROFonts.ROBtsrmVr14"
     FontArrayNames(7)="ROFonts.ROBtsrmVr12"
     FontArrayNames(8)="ROFonts.ROBtsrmVr9"
     bBlockHitPointTraces=False
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fri 13-10-2023 03:17:28.000 - Creation time: Fri 13-10-2023 03:19:07.092 - Created with UnCodeX