1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
|
// TODO:
// Model tracking and save/Clear functions are temp. We already update the client knowledge of loadouts. Derive from that.
// Move the struct off the player?
//#if CLIENT && MP
untyped
//#endif //client && MP
#if CLIENT
const float CARD_TAG_SCALE = 0.0 // update to match same const in hud_defs.rui
const DEFAULT_FOV = 50.0
const DEFAULT_DOF_NEAR_START = 7.5
const DEFAULT_DOF_NEAR_END = 7.7
const DEFAULT_DOF_FAR_START = 200.0
const DEFAULT_DOF_FAR_END = 300.0
const TRANSITION_DURATION = 0.25
const DEFAULT_MAX_TURN_SPEED = 270.0
const PILOT_MAX_TURN_SPEED = 270.0
const TITAN_MAX_TURN_SPEED = 100.0
const MENU_COLOR_CORRECTION = "materials/correction/menu.raw"
const MENU_TEST_EFFECT = $"P_menu_motes"
const vector WEAPON_DLIGHT_COLOR = <0.65, 0.75, 1.0>
global struct MenuCharacterDef
{
asset bodyModel = $""
int camoIndex = -1
int skinIndex = 0
int decalIndex = -1
int loadoutIndex = 0
string idleAnim
string weapon
array<string> mods
asset weaponModel = $""
int weaponCamoIndex = -1
int weaponSkinIndex = -1
int showArmBadge = 0
asset armBadgeModel = $""
int armBadgeBodyGroupIndex = 0
bool isPrime = false
}
struct CharacterData
{
entity mover
entity body
entity weapon
entity prop
entity armBadge
string attachName
string bodyAnim
float[2] rotationDelta
float fovScale = 1.0
float maxTurnSpeed = DEFAULT_MAX_TURN_SPEED
}
struct PresentationDef
{
CharacterData ornull characterData = null
float maxTurnDegrees = 360.0
float maxPitchDegrees = 0.0
bool useRollAxis = true
string sceneAnim
float fov = DEFAULT_FOV
float dofNearStart = DEFAULT_DOF_NEAR_START
float dofNearEnd = DEFAULT_DOF_NEAR_END
float dofFarStart = DEFAULT_DOF_FAR_START
float dofFarEnd = DEFAULT_DOF_FAR_END
float csmTexelScale1 = 1.0
float csmTexelScale2 = 1.0
float csmStartDistance = 0.0
string pilotAnimType
string titanAnimType
bool showCallsign = false
bool showStoreBG = false
bool showStorePrimeBG = false
bool showMiscModel = false
bool showWeaponModel = false
bool showTitanModel = true // false would be a better default, but the hiding/showing of this stuff needs be done in a more general/flexible way, so leaving this for now
void functionref() activateFunc
}
struct
{
entity sceneRef
entity cameraTarget
float[2] mouseRotateDelta
CharacterData menuPilot
CharacterData menuTitan
CharacterData menuFaction
CharacterData menuMiscModel
CharacterData menuWeaponModel
CharacterData ornull activeCharacter = null
var menuCallsignRui
var menuCallsignTopo
var menuStoreBackground
var menuStorePrimeBg
var menuStorePrimeBgRui
var menuStorePrimeBgCreated
entity weaponDLight
float lastZoomTime
int presentationType = ePresentationType.INACTIVE
bool presentationTypeInitialized = false
PresentationDef[ePresentationType.COUNT] presentationData
table< string, table<string, table<int,string> > > pilotAnims
table< string, table<string, string> > titanAnims
int menuColorCorrection = -1
} file
global function MenuModels_Init
global function MenuMapEntitiesExist
#endif //CLIENT
#if CLIENT && MP
global function SetPresentationType
global function UpdatePilotModel
global function UpdateTitanModel
global function UpdateFactionModel
global function UpdateBoostModel
global function UpdateStoreBackground
global function UpdateStorePrimeBg
global function UpdateCallsignCard
global function UpdateCallsignIcon
global function UpdateCallsign
global function SetEditingPilotLoadoutIndex
global function ClearEditingPilotLoadoutIndex
global function SetHeldPilotWeaponType
global function SetEditingTitanLoadoutIndex
global function ClearEditingTitanLoadoutIndex
global function PreviewPilotCharacter
global function SavePilotCharacterPreview
global function PreviewPilotWeapon
global function SavePilotWeaponPreview
global function PreviewPilotWeaponCamoChange
global function PreviewPilotWeaponSkinChange
global function ClearAllPilotPreview
global function PreviewPilotWeaponMod
global function SavePilotWeaponModPreview
global function PreviewPilotCamoChange
//global function SavePilotCamoPreview
global function PreviewTitanCamoChange
global function SaveTitanCamoPreview
global function ClearTitanCamoPreview
global function PreviewTitanSkinChange
global function SaveTitanSkinPreview
global function ClearTitanSkinPreview
global function PreviewTitanDecalChange
global function SaveTitanDecalPreview
global function ClearTitanDecalPreview
global function PreviewTitanCombinedChange
global function SaveTitanCombinedPreview
global function ClearTitanCombinedPreview
global function PreviewTitanWeaponCamoChange
global function ClearAllTitanPreview
global function SetMenuOpenState
// Only these 2 functions are run from the server and they may not be needed. Remove server updates if possible.
global function ServerCallback_UpdatePilotModel
global function ServerCallback_UpdateTitanModel
global function GetMenuPilotBody
global function GetCallsignTopo
global function GetFactionModel
global function GetFactionModelSkin
global function UpdateStoreWeaponModelSkin
global function UpdateStoreWeaponModelZoom
global function UpdateMouseRotateDelta
global function GetMenuMiscModel // TODO: Remove when done testing
global function UpdateMenuToHarvester
global function GetDLightEntity
#endif // CLIENT && MP
#if UI
global function UpdateUIMapSupportsMenuModels
global function RunMenuClientFunction
global function UI_SetPresentationType
#endif // UI
global const STORE_BG_DEFAULT = 0
global const STORE_BG_BUNDLE1 = 1
global const STORE_BG_BUNDLE2 = 2
global const STORE_BG_BUNDLE3 = 3
global const STORE_BG_BUNDLE4 = 4
global const STORE_BG_BUNDLE5 = 5
global const STORE_BG_BUNDLE6 = 6
#if CLIENT
var function GetCallsignTopo()
{
return file.menuCallsignTopo
}
entity function GetMenuPilotBody()
{
return file.menuPilot.body
}
void function MenuModels_Init()
{
if ( IsMultiplayer() && MenuMapEntitiesExist() )
clGlobal.mapSupportsMenuModels = true
RunUIScript( "UpdateUIMapSupportsMenuModels", clGlobal.mapSupportsMenuModels )
if ( !clGlobal.mapSupportsMenuModels )
return
#if MP
PrecacheParticleSystem( MENU_TEST_EFFECT )
file.menuColorCorrection = ColorCorrection_Register( MENU_COLOR_CORRECTION )
InitPresentationData()
InitMenuModelAnims()
thread InitMenuEntities( GetLocalClientPlayer() )
thread ModelRotationThread()
AddCallback_OnClientScriptInit( OnClientScriptInit )
#endif // MP
RegisterSignal( "UpdateCallsign" )
}
bool function MenuMapEntitiesExist()
{
array<string> entNames =
[
"menu_scene_ref",
"menu_camera_target"
]
foreach ( name in entNames )
{
if ( GetEntArrayByScriptName( name ).len() != 1 )
return false
}
return true
}
#endif // CLIENT
#if UI
void function UpdateUIMapSupportsMenuModels( bool value )
{
uiGlobal.mapSupportsMenuModels = value
uiGlobal.mapSupportsMenuModelsUpdated = true
printt( Time(), "uiGlobal.mapSupportsMenuModelsUpdated set to: true" )
}
#endif // UI
#if CLIENT && MP
void function InitPresentationData()
{
// TODO: Rework so scenes can be defined in a more flexible way (what entities get created, shown, hidden, animated)
// TODO: Need anims happening a bit differently for transition support
// Interruptable function that plays intro anim and then idle if intro completes uninterrupted
// Outro anims should work the same
int presentationType = ePresentationType.INACTIVE
file.presentationData[ presentationType ].sceneAnim = "camera_menu_main_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
presentationType = ePresentationType.DEFAULT
file.presentationData[ presentationType ].sceneAnim = "camera_menu_main_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Show spawn models
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
file.presentationData[ presentationType ].showCallsign = true
presentationType = ePresentationType.STORE_CAMO_PACKS
file.presentationData[ presentationType ].sceneAnim = "camera_menu_main_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Show spawn models
file.presentationData[ presentationType ].dofFarStart = 200.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.STORE_FRONT
file.presentationData[ presentationType ].sceneAnim = "camera_menu_settings_idle"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 2300.0
file.presentationData[ presentationType ].dofFarEnd = 3000.0
file.presentationData[ presentationType ].showStoreBG = true
presentationType = ePresentationType.STORE_PRIME_TITANS
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_loadout_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 4000.0
file.presentationData[ presentationType ].dofFarEnd = 5000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
file.presentationData[ presentationType ].showStorePrimeBG = true
presentationType = ePresentationType.STORE_WEAPON_SKINS
file.presentationData[ presentationType ].characterData = file.menuWeaponModel
file.presentationData[ presentationType ].sceneAnim = "camera_menu_weapon_idle"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].maxPitchDegrees = 90
file.presentationData[ presentationType ].dofFarStart = 4000.0
file.presentationData[ presentationType ].dofFarEnd = 5000.0
file.presentationData[ presentationType ].showWeaponModel = true
file.presentationData[ presentationType ].showTitanModel = false
//file.presentationData[ presentationType ].useRollAxis = true
presentationType = ePresentationType.SEARCH
file.presentationData[ presentationType ].sceneAnim = "camera_menu_main_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Show spawn models
file.presentationData[ presentationType ].fov = DEFAULT_FOV + 10
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
file.presentationData[ presentationType ].showCallsign = true
presentationType = ePresentationType.CALLSIGN
file.presentationData[ presentationType ].sceneAnim = "camera_menu_main_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Show spawn models
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.KNOWLEDGEBASE_MAIN
file.presentationData[ presentationType ].sceneAnim = "camera_menu_loadout_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "weapon_inspect_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].fov = DEFAULT_FOV - 25
file.presentationData[ presentationType ].dofFarStart = 30.0
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.KNOWLEDGEBASE_SUB
file.presentationData[ presentationType ].sceneAnim = "camera_menu_loadout_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "weapon_inspect_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].fov = DEFAULT_FOV - 28
file.presentationData[ presentationType ].dofFarStart = 30.0
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.PVE_MAIN
file.presentationData[ presentationType ].sceneAnim = "camera_menu_loadout_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "weapon_inspect_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].fov = DEFAULT_FOV - 25
file.presentationData[ presentationType ].dofFarStart = 30.0
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.PILOT
file.presentationData[ presentationType ].characterData = file.menuPilot
file.presentationData[ presentationType ].sceneAnim = "camera_menu_loadout_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "focused_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 200.0
file.presentationData[ presentationType ].dofFarEnd = 300.0
file.presentationData[ presentationType ].csmTexelScale1 = 0.4
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.PILOT_LOADOUT_EDIT
file.presentationData[ presentationType ].characterData = file.menuPilot
file.presentationData[ presentationType ].sceneAnim = "camera_menu_loadout_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "focused_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].dofFarStart = 200.0
file.presentationData[ presentationType ].dofFarEnd = 300.0
file.presentationData[ presentationType ].csmTexelScale1 = 0.4
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.PILOT_CHARACTER
file.presentationData[ presentationType ].characterData = file.menuPilot
file.presentationData[ presentationType ].sceneAnim = "camera_menu_loadout_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "focused_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 200.0
file.presentationData[ presentationType ].dofFarEnd = 300.0
file.presentationData[ presentationType ].csmTexelScale1 = 0.4
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.PILOT_WEAPON
file.presentationData[ presentationType ].characterData = file.menuPilot
file.presentationData[ presentationType ].sceneAnim = "camera_menu_loadout_edit_idle_01"
file.presentationData[ presentationType ].pilotAnimType = "weapon_inspect_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].csmTexelScale1 = 0.22
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 40.0
presentationType = ePresentationType.TITAN
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_loadout_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_LOADOUT_EDIT
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_loadout_edit"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "editing_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_SKIN_EDIT
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_loadout_edit"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "editing_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_ARMBADGE
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_loadout_edit"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "editing_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_WEAPON
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_loadout_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "editing_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_NOSE_ART
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_menu_noseart_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "nose_art_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Titan animation change
file.presentationData[ presentationType ].maxTurnDegrees = 100.0
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.NO_MODELS
file.presentationData[ presentationType ].sceneAnim = "camera_menu_settings_idle"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
presentationType = ePresentationType.FACTIONS
file.presentationData[ presentationType ].characterData = file.menuFaction
file.presentationData[ presentationType ].sceneAnim = "camera_menu_faction_idle"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].csmTexelScale1 = 0.4
file.presentationData[ presentationType ].csmTexelScale2 = 0.55
file.presentationData[ presentationType ].csmStartDistance = 70.0
presentationType = ePresentationType.BOOSTS
file.presentationData[ presentationType ].characterData = file.menuMiscModel
file.presentationData[ presentationType ].sceneAnim = "camera_menu_burncard_idle"
file.presentationData[ presentationType ].pilotAnimType = "main_idle"
file.presentationData[ presentationType ].titanAnimType = "background_idle"
file.presentationData[ presentationType ].showMiscModel = true
presentationType = ePresentationType.TITAN_CENTER
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_frontierdefense_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_CENTER_SELECTED
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_frontierdefense_idle_selected"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "editing_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels
file.presentationData[ presentationType ].fov = DEFAULT_FOV - 10
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_LEFT
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_left_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.TITAN_RIGHT
file.presentationData[ presentationType ].characterData = file.menuTitan
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_right_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
presentationType = ePresentationType.FD_MAIN
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_frontierdefense_idle"
file.presentationData[ presentationType ].pilotAnimType = "hidden_from_main"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
file.presentationData[ presentationType ].showCallsign = true
file.presentationData[ presentationType ].showMiscModel = true
presentationType = ePresentationType.FD_SEARCH
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_frontierdefense_idle"
file.presentationData[ presentationType ].pilotAnimType = "hidden_from_main"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].fov = DEFAULT_FOV + 10
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
file.presentationData[ presentationType ].showCallsign = true
file.presentationData[ presentationType ].showMiscModel = true
presentationType = ePresentationType.FD_FIND_GAME
file.presentationData[ presentationType ].sceneAnim = "camera_titan_menu_loadout_idle"
file.presentationData[ presentationType ].pilotAnimType = "background_idle"
file.presentationData[ presentationType ].titanAnimType = "focused_idle"
file.presentationData[ presentationType ].activateFunc = UpdateBothModels // Animation change
file.presentationData[ presentationType ].fov = DEFAULT_FOV + 10
file.presentationData[ presentationType ].dofFarStart = 500.0
file.presentationData[ presentationType ].dofFarEnd = 1000.0
file.presentationData[ presentationType ].csmStartDistance = 200.0
file.presentationData[ presentationType ].showCallsign = true
file.presentationData[ presentationType ].showMiscModel = true
}
void function UpdateBothModels()
{
entity player = GetLocalClientPlayer()
int loadoutIndex
if ( clGlobal.editingPilotLoadoutIndex != -1 )
loadoutIndex = clGlobal.editingPilotLoadoutIndex
else
loadoutIndex = GetPersistentSpawnLoadoutIndex( player, "pilot" )
UpdatePilotModel( player, loadoutIndex )
if ( clGlobal.editingTitanLoadoutIndex != -1 )
loadoutIndex = clGlobal.editingTitanLoadoutIndex
else
loadoutIndex = GetPersistentSpawnLoadoutIndex( player, "titan" )
UpdateTitanModel( player, loadoutIndex )
}
void function OnClientScriptInit( entity player )
{
UpdateCallsign( player )
}
void function InitMenuModelAnims()
{
string animType = "main_idle"
file.pilotAnims[ animType ] <- {}
string bodyType = "light"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_main_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_main_idle_01"
bodyType = "medium"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_main_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_main_idle_01"
bodyType = "heavy"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_main_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_main_idle_01"
bodyType = "nomad"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_main_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_main_idle_01"
bodyType = "stalker"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_main_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_main_idle_01"
bodyType = "geist"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_main_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_main_idle_01"
bodyType = "grapple"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_main_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_main_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_main_idle_01"
animType = "background_idle"
file.pilotAnims[ animType ] <- {}
bodyType = "light"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "medium"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "heavy"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "nomad"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "stalker"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "geist"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "grapple"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
animType = "focused_idle"
file.pilotAnims[ animType ] <- {}
bodyType = "light"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_idle_01"
bodyType = "medium"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_idle_01"
bodyType = "heavy"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_idle_01"
bodyType = "nomad"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_idle_01"
bodyType = "stalker"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_idle_01"
bodyType = "geist"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_idle_01"
bodyType = "grapple"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_idle_01"
animType = "weapon_inspect_idle"
file.pilotAnims[ animType ] <- {}
bodyType = "light"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_edit_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_edit_idle_03"
bodyType = "medium"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_edit_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_edit_idle_03"
bodyType = "heavy"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_edit_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_edit_idle_03"
bodyType = "nomad"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_edit_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_edit_idle_03"
bodyType = "stalker"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_edit_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_edit_idle_03"
bodyType = "geist"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_edit_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_edit_idle_03"
bodyType = "grapple"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_menu_loadout_edit_idle_02"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_menu_loadout_edit_idle_01"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_menu_loadout_edit_idle_03"
animType = "hidden_from_main"
file.pilotAnims[ animType ] <- {}
bodyType = "light"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "medium"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "heavy"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "nomad"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "stalker"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "geist"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
bodyType = "grapple"
file.pilotAnims[ animType ][ bodyType ] <- {}
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.SMALL ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.MEDIUM ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.LARGE ] <- "pt_titan_menu_loadout_idle"
file.pilotAnims[ animType ][ bodyType ][ eMenuAnimClass.CUSTOM ] <- "pt_titan_menu_loadout_idle"
animType = "background_idle"
file.titanAnims[ animType ] <- {}
file.titanAnims[ animType ][ "titan_stryder_arc" ] <- "titan_light_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_stryder_leadwall" ] <- "titan_light_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_stryder_sniper" ] <- "titan_light_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_stryder_northstar_prime" ] <- "titan_light_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_stryder_ronin_prime" ] <- "titan_light_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_atlas_tracker" ] <- "titan_medium_menu_main_idle_01_TONE"
file.titanAnims[ animType ][ "titan_atlas_vanguard" ] <- "titan_medium_menu_main_idle_01_MONARCH"
file.titanAnims[ animType ][ "titan_atlas_stickybomb" ] <- "titan_medium_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_atlas_ion_prime" ] <- "titan_medium_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_atlas_tone_prime" ] <- "titan_medium_menu_main_idle_01_TONE"
file.titanAnims[ animType ][ "titan_ogre_meteor" ] <- "titan_heavy_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_ogre_scorch_prime" ] <- "titan_heavy_menu_main_idle_01"
file.titanAnims[ animType ][ "titan_ogre_minigun" ] <- "titan_heavy_menu_main_idle_01_LEGION"
file.titanAnims[ animType ][ "titan_ogre_legion_prime" ] <- "titan_heavy_menu_main_idle_01_LEGION"
file.titanAnims[ animType ][ "titan_ogre_fighter" ] <- "titan_heavy_menu_main_idle_01"
animType = "focused_idle"
file.titanAnims[ animType ] <- {}
file.titanAnims[ animType ][ "titan_stryder_arc" ] <- "titan_light_menu_loadout_idle"
file.titanAnims[ animType ][ "titan_stryder_leadwall" ] <- "titan_light_menu_loadout_idle"
file.titanAnims[ animType ][ "titan_stryder_sniper" ] <- "titan_light_menu_loadout_idle_NSTAR"
file.titanAnims[ animType ][ "titan_stryder_northstar_prime" ] <- "titan_light_menu_loadout_idle_NSTAR"
file.titanAnims[ animType ][ "titan_stryder_ronin_prime" ] <- "titan_light_menu_loadout_idle"
file.titanAnims[ animType ][ "titan_atlas_tracker" ] <- "titan_medium_menu_loadout_idle"
file.titanAnims[ animType ][ "titan_atlas_vanguard" ] <- "titan_medium_menu_loadout_idle_MONARCH"
file.titanAnims[ animType ][ "titan_atlas_stickybomb" ] <- "titan_medium_menu_loadout_idle_ION"
file.titanAnims[ animType ][ "titan_atlas_ion_prime" ] <- "titan_medium_menu_loadout_idle_ION"
file.titanAnims[ animType ][ "titan_atlas_tone_prime" ] <- "titan_medium_menu_loadout_idle"
file.titanAnims[ animType ][ "titan_ogre_meteor" ] <- "titan_heavy_menu_loadout_idle_SCORCH"
file.titanAnims[ animType ][ "titan_ogre_scorch_prime" ] <- "titan_heavy_menu_loadout_idle_SCORCH"
file.titanAnims[ animType ][ "titan_ogre_minigun" ] <- "titan_heavy_menu_loadout_idle_LEGION"
file.titanAnims[ animType ][ "titan_ogre_legion_prime" ] <- "titan_heavy_menu_loadout_idle_LEGION"
file.titanAnims[ animType ][ "titan_ogre_fighter" ] <- "titan_heavy_menu_loadout_idle"
animType = "editing_idle"
file.titanAnims[ animType ] <- {}
file.titanAnims[ animType ][ "titan_stryder_arc" ] <- "titan_light_menu_loadout_idle_edit_NSTAR"
file.titanAnims[ animType ][ "titan_stryder_leadwall" ] <- "titan_light_menu_loadout_idle_edit_RONIN"
file.titanAnims[ animType ][ "titan_stryder_sniper" ] <- "titan_light_menu_loadout_idle_edit_NSTAR"
file.titanAnims[ animType ][ "titan_stryder_northstar_prime" ] <- "titan_light_menu_loadout_idle_edit_NSTAR"
file.titanAnims[ animType ][ "titan_stryder_ronin_prime" ] <- "titan_light_menu_loadout_idle_edit_RONIN"
file.titanAnims[ animType ][ "titan_atlas_tracker" ] <- "titan_medium_menu_loadout_idle_edit_TONE"
file.titanAnims[ animType ][ "titan_atlas_vanguard" ] <- "titan_medium_menu_loadout_idle_edit_MONARCH"
file.titanAnims[ animType ][ "titan_atlas_stickybomb" ] <- "titan_medium_menu_loadout_idle_edit_ION"
file.titanAnims[ animType ][ "titan_atlas_ion_prime" ] <- "titan_medium_menu_loadout_idle_edit_ION"
file.titanAnims[ animType ][ "titan_atlas_tone_prime" ] <- "titan_medium_menu_loadout_idle_edit_TONE"
file.titanAnims[ animType ][ "titan_ogre_meteor" ] <- "titan_heavy_menu_loadout_idle_edit_SCORCH"
file.titanAnims[ animType ][ "titan_ogre_scorch_prime" ] <- "titan_heavy_menu_loadout_idle_edit_SCORCH"
file.titanAnims[ animType ][ "titan_ogre_minigun" ] <- "titan_heavy_menu_loadout_idle_edit_LEGION"
file.titanAnims[ animType ][ "titan_ogre_legion_prime" ] <- "titan_heavy_menu_loadout_idle_edit_LEGION"
file.titanAnims[ animType ][ "titan_ogre_fighter" ] <- "titan_heavy_menu_loadout_idle_edit_LEGION"
animType = "nose_art_idle"
file.titanAnims[ animType ] <- {}
file.titanAnims[ animType ][ "titan_stryder_arc" ] <- "titan_light_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_stryder_leadwall" ] <- "titan_light_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_stryder_sniper" ] <- "titan_light_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_stryder_northstar_prime" ] <- "titan_light_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_stryder_ronin_prime" ] <- "titan_light_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_atlas_tracker" ] <- "titan_medium_menu_noseart_idle_TONE"
file.titanAnims[ animType ][ "titan_atlas_vanguard" ] <- "titan_medium_menu_noseart_idle_MONARCH"
file.titanAnims[ animType ][ "titan_atlas_stickybomb" ] <- "titan_medium_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_atlas_ion_prime" ] <- "titan_medium_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_atlas_tone_prime" ] <- "titan_medium_menu_noseart_idle_TONE"
file.titanAnims[ animType ][ "titan_ogre_meteor" ] <- "titan_heavy_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_ogre_scorch_prime" ] <- "titan_heavy_menu_noseart_idle"
file.titanAnims[ animType ][ "titan_ogre_minigun" ] <- "titan_heavy_menu_noseart_idle_LEGION"
file.titanAnims[ animType ][ "titan_ogre_legion_prime" ] <- "titan_heavy_menu_noseart_idle_LEGION"
file.titanAnims[ animType ][ "titan_ogre_fighter" ] <- "titan_heavy_menu_noseart_idle"
animType = "fd_idle"
file.titanAnims[ animType ] <- {}
file.titanAnims[ animType ][ "titan_stryder_leadwall" ] <- "titan_light_menu_FD_idle_RONIN"
file.titanAnims[ animType ][ "titan_stryder_sniper" ] <- "titan_light_menu_FD_idle_NSTAR"
file.titanAnims[ animType ][ "titan_stryder_northstar_prime" ] <- "titan_light_menu_FD_idle_NSTAR"
file.titanAnims[ animType ][ "titan_stryder_ronin_prime" ] <- "titan_light_menu_FD_idle_RONIN"
file.titanAnims[ animType ][ "titan_atlas_tracker" ] <- "titan_medium_menu_FD_idle_TONE"
file.titanAnims[ animType ][ "titan_atlas_vanguard" ] <- "titan_medium_menu_FD_idle_MONARCH"
file.titanAnims[ animType ][ "titan_atlas_stickybomb" ] <- "titan_medium_menu_FD_idle_ION"
file.titanAnims[ animType ][ "titan_atlas_ion_prime" ] <- "titan_medium_menu_FD_idle_ION"
file.titanAnims[ animType ][ "titan_atlas_tone_prime" ] <- "titan_medium_menu_FD_idle_TONE"
file.titanAnims[ animType ][ "titan_ogre_meteor" ] <- "titan_heavy_menu_FD_idle_SCORCH"
file.titanAnims[ animType ][ "titan_ogre_scorch_prime" ] <- "titan_heavy_menu_FD_idle_SCORCH"
file.titanAnims[ animType ][ "titan_ogre_minigun" ] <- "titan_heavy_menu_FD_idle_LEGION"
file.titanAnims[ animType ][ "titan_ogre_legion_prime" ] <- "titan_heavy_menu_FD_idle_LEGION"
file.titanAnims[ animType ][ "titan_stryder_arc" ] <- "titan_light_menu_FD_idle_RONIN"
file.titanAnims[ animType ][ "titan_ogre_fighter" ] <- "titan_heavy_menu_FD_idle_SCORCH"
}
string function GetPilotAnimType()
{
return file.presentationData[ file.presentationType ].pilotAnimType
}
string function GetTitanAnimType()
{
return file.presentationData[ file.presentationType ].titanAnimType
}
string function GetMenuPilotAnim( string animType, string bodyType, int menuAnimClass )
{
Assert( animType in file.pilotAnims )
Assert( bodyType in file.pilotAnims[ animType ] )
Assert( menuAnimClass in file.pilotAnims[ animType ][ bodyType ] )
return file.pilotAnims[ animType ][ bodyType ][ menuAnimClass ]
}
string function GetMenuTitanAnim( string anim, string setFile )
{
Assert( anim in file.titanAnims )
Assert( setFile in file.titanAnims[ anim ] )
return file.titanAnims[ anim ][ setFile ]
}
void function InitMenuEntities( entity player )
{
file.sceneRef = GetEntByScriptName( "menu_scene_ref" )
vector refOrigin = file.sceneRef.GetOrigin()
vector refAngles = file.sceneRef.GetAngles()
entity environmentModel = CreateClientSidePropDynamic( refOrigin, refAngles, DEFAULT_MENU_ENVIRONMENT_MODEL )
environmentModel.kv.solid = 0
environmentModel.kv.disableshadows = 1
environmentModel.MakeSafeForUIScriptHack()
#if DEV
if ( BuildingCubeMaps() )
return
#endif
file.cameraTarget = GetEntByScriptName( "menu_camera_target" )
clGlobal.menuCamera = CreateClientSidePointCamera( <0, 0, 0>, <0, 0, 0>, DEFAULT_FOV )
CreateMenuFX( environmentModel )
// Create scene model
clGlobal.menuSceneModel = CreateClientSidePropDynamic( refOrigin, refAngles, GetSetFileModel( DEFAULT_PILOT_SETTINGS ) )
clGlobal.menuSceneModel.Hide()
clGlobal.menuSceneModel.MakeSafeForUIScriptHack()
file.cameraTarget.SetParent( clGlobal.menuSceneModel, "VDU", false, 0.0 )
// Create movers
CreateMover( file.menuPilot, "ORIGIN", PILOT_MAX_TURN_SPEED )
CreateMover( file.menuTitan, "PROPGUN", TITAN_MAX_TURN_SPEED )
CreateMover( file.menuFaction, "CHESTFOCUS" )
CreateMover( file.menuMiscModel, "HEADFOCUS" )
CreateMover( file.menuWeaponModel, "HEADFOCUS" )
/*{
vector origin = clGlobal.menuSceneModel.GetAttachmentOrigin( clGlobal.menuSceneModel.LookupAttachment( "HEADFOCUS" ) )
file.menuWeaponModel.mover.ClearParent()
file.menuWeaponModel.mover.SetOrigin( origin + <16, -3, 4> )
file.menuWeaponModel.mover.SetParent( clGlobal.menuSceneModel, "HEADFOCUS", true, 0.0 )
file.weaponDLight = CreateClientSideDynamicLight( origin, <0,0,0>, <0, 0, 0>, 512.0 )
}*/
//thread DrawTag( clGlobal.menuSceneModel, "ORIGIN" )
//thread DrawTag( clGlobal.menuSceneModel, "PROPGUN" )
//thread DrawTag( clGlobal.menuSceneModel, "CHESTFOCUS" )
//thread DrawTag( clGlobal.menuSceneModel, "HEADFOCUS" )
//thread DrawOrg( file.menuPilot.mover )
//thread DrawOrg( file.menuTitan.mover )
//thread DrawOrg( file.menuFaction.mover )
//thread DrawOrg( file.menuMiscModel.mover )
//thread DrawOrg( file.menuWeaponModel.mover )
WaitSignal( level, "CachedLoadoutsReady" )
CreatePilotModel( player, file.menuPilot.mover )
CreateTitanModel( player, file.menuTitan.mover )
CreateFactionModel( player, file.menuFaction.mover )
CreateMiscModel( player, file.menuMiscModel.mover )
file.menuWeaponModel.body = CreateModelForMover( player, file.menuWeaponModel.mover )
#if HAS_WORLD_CALLSIGN
CreateCallsign( player, clGlobal.menuSceneModel )
#endif
CreateStoreBackground( player )
clGlobal.initializedMenuModels = true
UpdateCallsign( player )
}
entity function GetDLightEntity()
{
// return file.weaponDLight
return file.menuWeaponModel.body
}
void function CreateMover( CharacterData character, string attachName, float maxTurnSpeed = DEFAULT_MAX_TURN_SPEED )
{
character.mover = CreateClientsideScriptMover( $"models/dev/empty_model.mdl", <0, 0, 0>, <0, 0, 0> )
character.mover.SetParent( clGlobal.menuSceneModel, attachName, false, 0.0 )
character.attachName = attachName
character.maxTurnSpeed = maxTurnSpeed
}
void function CreatePilotModel( entity player, entity mover )
{
int team = player.GetTeam()
int loadoutIndex = GetPersistentSpawnLoadoutIndex( player, "pilot" )
string suit = GetPilotLoadoutSuit( loadoutIndex )
string genderRace = GetPilotLoadoutGenderRace( loadoutIndex )
string setFile = GetSuitAndGenderBasedSetFile( suit, genderRace )
asset bodyModel = GetSetFileModel( setFile )
vector refOrigin = mover.GetOrigin()
vector refAngles = mover.GetAngles()
if ( DREW_MODE == 1 ) // TEMPHACK
{
refOrigin = refOrigin + <0, 0, -1000>
}
else if ( DREW_MODE == 2 )
{
entity greenScreenEnt = CreateClientSidePropDynamic( <0, 0, 0>, <0, 0, 0>, GREEN_SCREEN_MODEL )
greenScreenEnt.MakeSafeForUIScriptHack()
greenScreenEnt.kv.disableshadows = 1
}
entity bodyEnt = CreateClientSidePropDynamic( refOrigin, refAngles, bodyModel )
bodyEnt.SetParent( mover )
bodyEnt.SetAlive( true )
bodyEnt.SetVisibleForLocalPlayer( 0 )
bodyEnt.MakeSafeForUIScriptHack()
SetTeam( bodyEnt, team )
file.menuPilot.body = bodyEnt
string attachName = "PROPGUN"
int attachIndex = bodyEnt.LookupAttachment( attachName )
vector origin = bodyEnt.GetAttachmentOrigin( attachIndex )
vector angles = bodyEnt.GetAttachmentAngles( attachIndex )
string weapon = GetPilotLoadoutWeapon( loadoutIndex, clGlobal.heldPilotWeaponType )
entity weaponEnt = CreateWeaponModel( weapon, origin, angles )
weaponEnt.SetParent( bodyEnt, attachName, false, 0.0 )
bodyEnt.SetIKWeapon( weaponEnt )
file.menuPilot.weapon = weaponEnt
}
var function CreateCallsignTopology( vector org, vector ang, float width, float height )
{
// adjust so the RUI is drawn with the org as its center point
org += ( (AnglesToRight( ang )*-1) * (width*0.5) )
org += ( AnglesToUp( ang ) * (height*0.5) )
// right and down vectors that get added to base org to create the display size
vector right = ( AnglesToRight( ang ) * width )
vector down = ( (AnglesToUp( ang )*-1) * height )
return RuiTopology_CreatePlane( org, right, down, true )
}
void function CreateCallsign( entity player, entity mover )
{
//var topo = CreateCallsignTopology( GetMenuPilotBody().GetOrigin() + <110, 32, 100>, < 0, 45, 6 >, 32 * 1.25, 17 * 1.25 )
//var topo = CreateCallsignTopology( GetMenuPilotBody().GetOrigin() + <98, 16, 92>, < 0, 45, 6 >, 32 * 1.15, 17 * 1.15 )
var topo = CreateCallsignTopology( < -32, 50, 67 >, <0, 165, 6>, 28, 15 + (28 * CARD_TAG_SCALE) )
RuiTopology_SetParent( topo, mover, "ORIGIN" )
var rui = RuiCreate( $"ui/callsign_basic.rpak", topo, RUI_DRAW_WORLD, 0 )
file.menuCallsignRui = rui
file.menuCallsignTopo = topo
UpdateCallsign( player )
}
void function CreateStoreBackground( entity player )
{
file.menuStoreBackground = CreateClientSidePropDynamic( <68.1134, 377.554, -21.029>, <0.0, 225.0, 0.0>, $"models/test/brad/store_card.mdl" )
}
void function UpdateStoreBackground( entity player, int storeBgIndex )
{
switch ( storeBgIndex )
{
case STORE_BG_DEFAULT:
file.menuStoreBackground.SetModel( $"models/test/brad/store_card.mdl" )
file.menuStoreBackground.SetOrigin( <68.1134, 377.554, -18.25> )
break
case STORE_BG_BUNDLE1:
file.menuStoreBackground.SetModel( $"models/test/brad/store_card_angel_city.mdl" )
file.menuStoreBackground.SetOrigin( <68.1134, 377.554, -18.25> )
break
case STORE_BG_BUNDLE2:
file.menuStoreBackground.SetModel( $"models/test/brad/store_card_colony.mdl" )
file.menuStoreBackground.SetOrigin( <68.1134, 377.554, -18.25> )
break
case STORE_BG_BUNDLE3:
file.menuStoreBackground.SetModel( $"models/test/brad/store_card_relic.mdl" )
file.menuStoreBackground.SetOrigin( <68.1134, 377.554, -18.25> )
break
case STORE_BG_BUNDLE4:
file.menuStoreBackground.SetModel( $"models/test/brad/store_card_prime_bundle.mdl" )
file.menuStoreBackground.SetOrigin( <68.1134, 377.554, -18.25> )
break
case STORE_BG_BUNDLE5:
file.menuStoreBackground.SetModel( $"models/test/brad/store_weapon_warpaint_bundle.mdl" )
file.menuStoreBackground.SetOrigin( <68.1134, 377.554, -18.25> )
break
case STORE_BG_BUNDLE6:
file.menuStoreBackground.SetModel( $"models/test/brad/jump_start.mdl" )
file.menuStoreBackground.SetOrigin( <68.1134, 377.554, -18.25> )
break
}
}
void function UpdateStorePrimeBg( entity player, int loadoutIndex )
{
switch ( loadoutIndex )
{
case 0:
RuiSetImage( file.menuStorePrimeBgRui, "bgImage", $"rui/menu/store/prime_ion_bg" )
break
case 1:
RuiSetImage( file.menuStorePrimeBgRui, "bgImage", $"rui/menu/store/prime_scorch_bg" )
break
case 2:
RuiSetImage( file.menuStorePrimeBgRui, "bgImage", $"rui/menu/store/prime_northstar_bg" )
break
case 3:
RuiSetImage( file.menuStorePrimeBgRui, "bgImage", $"rui/menu/store/prime_ronin_bg" )
break
case 4:
RuiSetImage( file.menuStorePrimeBgRui, "bgImage", $"rui/menu/store/prime_tone_bg" )
break
case 5:
RuiSetImage( file.menuStorePrimeBgRui, "bgImage", $"rui/menu/store/prime_legion_bg" )
break
case 6:
RuiSetImage( file.menuStorePrimeBgRui, "bgImage", $"rui/menu/store/prime_vanguard_bg" )
break
}
}
void function UpdateCallsign( entity player )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
#if HAS_WORLD_CALLSIGN
CallingCard callingCard = PlayerCallingCard_GetActive( player )
CallsignIcon callsignIcon = PlayerCallsignIcon_GetActive( player )
RuiSetImage( file.menuCallsignRui, "cardImage", callingCard.image )
RuiSetInt( file.menuCallsignRui, "layoutType", callingCard.layoutType )
RuiSetImage( file.menuCallsignRui, "iconImage", callsignIcon.image )
RuiSetString( file.menuCallsignRui, "playerLevel", PlayerXPDisplayGenAndLevel( player.GetGen(), player.GetLevel() ) )
RuiSetString( file.menuCallsignRui, "playerName", player.GetPlayerName() )
RuiSetImage( file.menuCallsignRui, "cardGenImage", PlayerXPGetGenIcon( player ) ) //Commented Out Temporarily to Fix Blocker Bug: 220132
RuiSetBool( file.menuCallsignRui, "isLobbyCard", true )
thread KeepCallsignUpToDate( player )
#endif
}
void function KeepCallsignUpToDate( entity player )
{
#if HAS_WORLD_CALLSIGN
player.Signal( "UpdateCallsign" )
player.EndSignal( "UpdateCallsign" )
while ( IsValid( player ) )
{
CallingCard callingCard = PlayerCallingCard_GetActive( player )
CallsignIcon callsignIcon = PlayerCallsignIcon_GetActive( player )
RuiSetString( file.menuCallsignRui, "playerName", player.GetPlayerName() )
RuiSetString( file.menuCallsignRui, "playerLevel", PlayerXPDisplayGenAndLevel( player.GetGen(), player.GetLevel() ) )
RuiSetImage( file.menuCallsignRui, "cardImage", callingCard.image )
RuiSetImage( file.menuCallsignRui, "iconImage", callsignIcon.image )
RuiSetImage( file.menuCallsignRui, "cardGenImage", PlayerXPGetGenIcon( player ) ) //Commented Out Temporarily to Fix Blocker Bug: 220132
RuiSetInt( file.menuCallsignRui, "layoutType", callingCard.layoutType )
wait 0.5
}
#endif
}
entity function CreateWeaponModel( string weapon, vector origin, vector angles )
{
entity weaponEnt = CreateClientSidePropDynamic( origin, angles, GetWeaponModel( weapon ) )
weaponEnt.MakeSafeForUIScriptHack()
return weaponEnt
}
void function CreateTitanModel( entity player, entity mover )
{
int team = player.GetTeam()
int loadoutIndex = GetPersistentSpawnLoadoutIndex( player, "titan" )
string setFile = GetTitanLoadoutSetFile( loadoutIndex )
asset chassisModel = GetSetFileModel( setFile )
vector refOrigin = mover.GetOrigin()
vector refAngles = mover.GetAngles()
if ( DREW_MODE == 1 ) // TEMPHACK
refOrigin = refOrigin + < 0, 0, -1000 >
entity chassisEnt = CreateClientSidePropDynamic( refOrigin, refAngles, chassisModel )
chassisEnt.SetParent( mover )
chassisEnt.SetAlive( true )
chassisEnt.SetVisibleForLocalPlayer( 0 )
chassisEnt.MakeSafeForUIScriptHack()
SetTeam( chassisEnt, team )
file.menuTitan.body = chassisEnt
int attachIndex = chassisEnt.LookupAttachment( "PROPGUN" )
vector origin = chassisEnt.GetAttachmentOrigin( attachIndex )
vector angles = chassisEnt.GetAttachmentAngles( attachIndex )
string weapon = GetTitanLoadoutPrimary( loadoutIndex )
asset weaponModel = GetWeaponModel( weapon )
entity weaponEnt = CreateClientSidePropDynamic( origin, angles, weaponModel )
weaponEnt.SetParent( chassisEnt, "PROPGUN", false, 0.0 )
weaponEnt.MakeSafeForUIScriptHack()
file.menuTitan.weapon = weaponEnt
}
void function CreateFactionModel( entity player, entity mover )
{
int team = player.GetTeam()
string ref = GetFactionChoice( player )
asset bodyModel = GetFactionModel( ref )
int skin = GetFactionModelSkin( ref )
vector refOrigin = mover.GetOrigin()
vector refAngles = mover.GetAngles()
entity bodyEnt = CreateClientSidePropDynamic( refOrigin, refAngles, bodyModel )
bodyEnt.SetParent( mover )
bodyEnt.SetAlive( true )
bodyEnt.SetVisibleForLocalPlayer( 0 )
bodyEnt.MakeSafeForUIScriptHack()
bodyEnt.SetSkin( skin )
SetTeam( bodyEnt, team )
file.menuFaction.body = bodyEnt
entity propEnt = CreateFactionPropModel( bodyEnt, ref )
if ( IsValid( file.menuFaction.weapon ) )
file.menuFaction.weapon.Destroy()
file.menuFaction.weapon = propEnt
}
entity function CreateFactionPropModel( entity baseEnt, string ref )
{
string attachName = GetFactionPropAttachment( ref )
if ( attachName == "" )
return null
int attachIndex = baseEnt.LookupAttachment( attachName )
vector origin = baseEnt.GetAttachmentOrigin( attachIndex )
vector angles = baseEnt.GetAttachmentAngles( attachIndex )
asset propModel = GetFactionPropModel( ref )
entity propEnt = CreateClientSidePropDynamic( origin, angles, propModel )
propEnt.SetParent( baseEnt, attachName, false, 0.0 )
propEnt.MakeSafeForUIScriptHack()
return propEnt
}
void function CreateMiscModel( entity player, entity mover )
{
entity modelEnt = CreateClientSidePropDynamic( mover.GetOrigin(), mover.GetAngles(), $"models/dev/empty_model.mdl" )
modelEnt.SetParent( mover )
modelEnt.SetVisibleForLocalPlayer( 0 )
modelEnt.MakeSafeForUIScriptHack()
file.menuMiscModel.body = modelEnt
}
entity function CreateModelForMover( entity player, entity mover )
{
entity modelEnt = CreateClientSidePropDynamic( mover.GetOrigin(), mover.GetAngles(), $"models/dev/empty_model.mdl" )
modelEnt.SetParent( mover )
modelEnt.SetVisibleForLocalPlayer( 0 )
modelEnt.MakeSafeForUIScriptHack()
return modelEnt
}
entity function CreateAttachedModel( entity baseEnt, asset model, string attachName )
{
int attachIndex = baseEnt.LookupAttachment( attachName )
vector origin = baseEnt.GetAttachmentOrigin( attachIndex )
vector angles = baseEnt.GetAttachmentAngles( attachIndex )
entity propEnt = CreateClientSidePropDynamic( origin, angles, model )
propEnt.SetParent( baseEnt, attachName, false, 0.0 )
propEnt.MakeSafeForUIScriptHack()
return propEnt
}
void function CreateMenuFX( entity model )
{
int index = GetParticleSystemIndex( MENU_TEST_EFFECT )
int attachID = model.LookupAttachment( "ORIGIN" )
printt( index )
printt( model )
printt( attachID )
int fxID = StartParticleEffectOnEntity( model, index, FX_PATTACH_POINT_FOLLOW, attachID )
EffectSetDontKillForReplay( fxID )
}
void function ServerCallback_UpdatePilotModel( int loadoutIndex )
{
if ( !clGlobal.mapSupportsMenuModels )
return
entity player = GetLocalClientPlayer()
UpdatePilotModel( player, loadoutIndex )
}
void function UpdatePilotModel( entity player, int loadoutIndex )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
string genderRace = GetPilotLoadoutGenderRace( loadoutIndex )
string suit = GetPilotLoadoutSuit( loadoutIndex )
string setFile = GetSuitAndGenderBasedSetFile( suit, genderRace )
string weapon = GetPilotLoadoutWeapon( loadoutIndex, clGlobal.heldPilotWeaponType )
array<string> mods = GetPilotLoadoutWeaponMods( loadoutIndex, clGlobal.heldPilotWeaponType )
mods.removebyvalue( "" )
mods.removebyvalue( "none" )
asset bodyModel = GetSetFileModel( setFile )
asset weaponModel = GetWeaponModel( weapon )
string idleAnim = GetMenuPilotAnim( GetPilotAnimType(), suit, GetItemMenuAnimClass( weapon ) )
int camoIndex = GetPilotCamoIndex( loadoutIndex )
int weaponSkinIndex = GetPilotLoadoutWeaponSkinIndex( loadoutIndex, clGlobal.heldPilotWeaponType )
int weaponCamoIndex = GetPilotLoadoutWeaponCamoIndex( loadoutIndex, clGlobal.heldPilotWeaponType )
clGlobal.currentMenuPilotModels.loadoutIndex = loadoutIndex
clGlobal.currentMenuPilotModels.bodyModel = bodyModel
clGlobal.currentMenuPilotModels.camoIndex = camoIndex
clGlobal.currentMenuPilotModels.idleAnim = idleAnim
clGlobal.currentMenuPilotModels.weapon = weapon
clGlobal.currentMenuPilotModels.weaponModel = weaponModel
clGlobal.currentMenuPilotModels.weaponSkinIndex = weaponSkinIndex
clGlobal.currentMenuPilotModels.weaponCamoIndex = weaponCamoIndex
clGlobal.currentMenuPilotModels.mods = mods
UpdatePilotModelDisplay( player )
}
void function ServerCallback_UpdateTitanModel( int loadoutIndex, int flags = 0 )
{
if ( !clGlobal.mapSupportsMenuModels )
return
entity player = GetLocalClientPlayer()
UpdateTitanModel( player, loadoutIndex, flags )
}
void function UpdateTitanModel( entity player, int loadoutIndex, int flags = 0 )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
if ( loadoutIndex == -1 )
{
file.menuTitan.body.Hide()
file.menuTitan.weapon.Hide()
return
}
file.menuTitan.body.Show()
file.menuTitan.weapon.Show()
TitanLoadoutDef cachedLoadout = GetCachedTitanLoadout( loadoutIndex )
string setFile
if ( flags & TITANMENU_FORCE_NON_PRIME )
setFile = GetSetFileForTitanClassAndPrimeStatus( cachedLoadout.titanClass, false )
else if ( flags & TITANMENU_FORCE_PRIME )
setFile = GetSetFileForTitanClassAndPrimeStatus( cachedLoadout.titanClass, true )
else
setFile = GetTitanLoadoutSetFile( loadoutIndex )
string weapon = GetTitanLoadoutPrimary( loadoutIndex )
asset chassisModel = GetSetFileModel( setFile )
asset weaponModel = GetWeaponModel( weapon )
string idleAnim = GetMenuTitanAnim( GetTitanAnimType(), setFile )
int camoIndex
int skinIndex
int decalIndex
int weaponCamoIndex
int showArmBadge
if ( !( flags & TITANMENU_NO_CUSTOMIZATION ) )
{
camoIndex = GetTitanCamoIndex( loadoutIndex )
skinIndex = GetTitanSkinIndex( loadoutIndex )
decalIndex = GetTitanDecalIndex( loadoutIndex )
weaponCamoIndex = cachedLoadout.primaryCamoIndex
showArmBadge = GetTitanLoadoutArmBadgeState( loadoutIndex )
}
clGlobal.currentMenuTitanModels.isPrime = Dev_GetPlayerSettingByKeyField_Global( setFile, "isPrime" ) == 1
clGlobal.currentMenuTitanModels.loadoutIndex = loadoutIndex
clGlobal.currentMenuTitanModels.bodyModel = chassisModel
clGlobal.currentMenuTitanModels.camoIndex = camoIndex
clGlobal.currentMenuTitanModels.skinIndex = skinIndex
clGlobal.currentMenuTitanModels.decalIndex = decalIndex
clGlobal.currentMenuTitanModels.idleAnim = idleAnim
clGlobal.currentMenuTitanModels.weaponModel = weaponModel
clGlobal.currentMenuTitanModels.weaponCamoIndex = weaponCamoIndex
asset armBadgeModel = GetTitanLoadoutArmBadge( loadoutIndex )
clGlobal.currentMenuTitanModels.armBadgeModel = armBadgeModel
clGlobal.currentMenuTitanModels.armBadgeBodyGroupIndex = armBadgeModel != $"" ? 0 : 0
clGlobal.currentMenuTitanModels.showArmBadge = showArmBadge
UpdateTitanModelDisplay( player )
}
void function UpdatePilotModelDisplay( entity player )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
asset bodyModel = clGlobal.previewMenuPilotModels.bodyModel
if ( bodyModel == $"" )
bodyModel = clGlobal.currentMenuPilotModels.bodyModel
string idleAnim = clGlobal.previewMenuPilotModels.idleAnim
if ( idleAnim == "" )
idleAnim = clGlobal.currentMenuPilotModels.idleAnim
bool playIdle = false
if ( file.menuPilot.body.GetModelName() != bodyModel || idleAnim != file.menuPilot.bodyAnim ) // Model has changed or anim has changed
playIdle = true
file.menuPilot.body.SetModel( bodyModel )
int camoIndex = clGlobal.previewMenuPilotModels.camoIndex
if ( camoIndex == -1 )
camoIndex = clGlobal.currentMenuPilotModels.camoIndex
if ( camoIndex > 0 )
{
file.menuPilot.body.SetSkin( PILOT_SKIN_INDEX_CAMO )
file.menuPilot.body.SetCamo( camoIndex )
}
else
{
file.menuPilot.body.SetSkin( 0 )
file.menuPilot.body.SetCamo( -1 )
}
if ( playIdle )
{
PlayMenuAnim( file.menuPilot.body, idleAnim )
file.menuPilot.bodyAnim = idleAnim
}
string weapon = clGlobal.previewMenuPilotModels.weapon
if ( weapon == "" )
weapon = clGlobal.currentMenuPilotModels.weapon
asset weaponModel = clGlobal.previewMenuPilotModels.weaponModel
if ( weaponModel == $"" )
weaponModel = clGlobal.currentMenuPilotModels.weaponModel
file.menuPilot.weapon.SetSkin( WEAPON_SKIN_INDEX_DEFAULT ) // Lame that we need this, but this avoids invalid skin errors when the model changes and the currently shown skin index doesn't exist for the new model
file.menuPilot.weapon.SetModel( weaponModel )
bool isPreviewingWeaponNotMatchingCurrent = clGlobal.previewMenuPilotModels.weaponModel != $"" && clGlobal.previewMenuPilotModels.weaponModel != clGlobal.currentMenuPilotModels.weaponModel
array<string> mods = clGlobal.previewMenuPilotModels.mods
if ( mods.len() == 0 )
{
// Don't show mods if previewing a weapon that isn't already equipped
if ( isPreviewingWeaponNotMatchingCurrent )
mods = []
else
mods = clGlobal.currentMenuPilotModels.mods
}
SetBodyGroupsForWeaponConfig( file.menuPilot.weapon, weapon, mods )
int weaponCamoIndex
int weaponSkinIndex
if ( isPreviewingWeaponNotMatchingCurrent )
{
weaponCamoIndex = 0
weaponSkinIndex = 0
}
else
{
// Skin or camo preview is active so use preview values for both
if ( clGlobal.previewMenuPilotModels.weaponSkinIndex != -1 || clGlobal.previewMenuPilotModels.weaponCamoIndex != -1 )
{
weaponSkinIndex = clGlobal.previewMenuPilotModels.weaponSkinIndex
weaponCamoIndex = clGlobal.previewMenuPilotModels.weaponCamoIndex
}
else // no preview active, show current for both
{
weaponSkinIndex = clGlobal.currentMenuPilotModels.weaponSkinIndex
weaponCamoIndex = clGlobal.currentMenuPilotModels.weaponCamoIndex
}
}
if ( weaponCamoIndex > 0 )
weaponSkinIndex = WEAPON_SKIN_INDEX_CAMO
else
weaponCamoIndex = -1
file.menuPilot.weapon.SetSkin( weaponSkinIndex )
//printt( "Set pilot weapon skin to:", weaponSkinIndex )
file.menuPilot.weapon.SetCamo( weaponCamoIndex )
//printt( "Set pilot weapon camo to:", weaponCamoIndex )
}
void function UpdateTitanModelDisplay( entity player )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
asset bodyModel = clGlobal.previewMenuTitanModels.bodyModel
if ( bodyModel == $"" )
bodyModel = clGlobal.currentMenuTitanModels.bodyModel
string idleAnim = clGlobal.previewMenuTitanModels.idleAnim
if ( idleAnim == "" )
idleAnim = clGlobal.currentMenuTitanModels.idleAnim
bool playIdle = false
if ( file.menuTitan.body.GetModelName() != bodyModel || idleAnim != file.menuTitan.bodyAnim ) // Model has changed or anim has changed
playIdle = true
if ( file.menuTitan.body.GetModelName() != bodyModel )
{
file.menuTitan.body.SetSkin( 0 ) //First reset skin and decal to default to avoid code error message when changing models, if the new models don't have the same skins supported
file.menuTitan.body.SetCamo( -1 )
file.menuTitan.body.SetModel( bodyModel )
}
int camoIndex = clGlobal.previewMenuTitanModels.camoIndex
int skinIndex = clGlobal.previewMenuTitanModels.skinIndex
bool usedCurrentValues = false
if ( camoIndex == -1 && skinIndex == 0 )
{
camoIndex = clGlobal.currentMenuTitanModels.camoIndex
skinIndex = clGlobal.currentMenuTitanModels.skinIndex
usedCurrentValues = true
}
else
{
camoIndex = clGlobal.previewMenuTitanModels.camoIndex
skinIndex = clGlobal.previewMenuTitanModels.skinIndex
}
if ( camoIndex > 0 )
{
skinIndex = TITAN_SKIN_INDEX_CAMO
}
else
{
camoIndex = -1
}
file.menuTitan.body.SetSkin( skinIndex )
file.menuTitan.body.SetCamo( camoIndex )
int decalIndex = clGlobal.previewMenuTitanModels.decalIndex
if ( decalIndex == -1 )
decalIndex = clGlobal.currentMenuTitanModels.decalIndex
file.menuTitan.body.SetDecal( decalIndex )
//printt( "Set titan decal to:", decalIndex )
if ( playIdle )
{
PlayMenuAnim( file.menuTitan.body, idleAnim )
file.menuTitan.bodyAnim = idleAnim
}
asset weaponModel = clGlobal.previewMenuTitanModels.weaponModel
if ( weaponModel == $"" )
weaponModel = clGlobal.currentMenuTitanModels.weaponModel
file.menuTitan.weapon.SetModel( weaponModel )
int weaponCamoIndex = clGlobal.previewMenuTitanModels.weaponCamoIndex
if ( weaponCamoIndex == -1 )
weaponCamoIndex = clGlobal.currentMenuTitanModels.weaponCamoIndex
//printt( "clGlobal.previewMenuTitanModels.weaponCamoIndex:", clGlobal.previewMenuTitanModels.weaponCamoIndex )
//printt( "clGlobal.currentMenuTitanModels.weaponCamoIndex:", clGlobal.currentMenuTitanModels.weaponCamoIndex )
//printt( "weaponCamoIndex:", weaponCamoIndex )
if ( weaponCamoIndex > 0 )
{
file.menuTitan.weapon.SetSkin( WEAPON_SKIN_INDEX_CAMO )
//printt( "Set titan weapon skin to:", WEAPON_SKIN_INDEX_CAMO )
file.menuTitan.weapon.SetCamo( weaponCamoIndex )
//printt( "Set titan weapon camo to:", weaponCamoIndex )
}
else
{
file.menuTitan.weapon.SetSkin( 0 )
//printt( "Set titan weapon skin to:", 0 )
file.menuTitan.weapon.SetCamo( -1 )
//printt( "Set titan weapon camo to:", -1 )
}
if ( IsValid( file.menuTitan.prop ) )
file.menuTitan.prop.Destroy()
if ( bodyModel == $"models/titans/light/titan_light_locust.mdl" )
file.menuTitan.prop = CreateAttachedModel( file.menuTitan.body, $"models/weapons/titan_sword/w_titan_sword.mdl", "SIDEARM_HOLSTER" )
else if ( bodyModel == $"models/titans/light/titan_light_ronin_prime.mdl" )
file.menuTitan.prop = CreateAttachedModel( file.menuTitan.body, $"models/weapons/titan_sword/w_titan_sword_prime.mdl", "SIDEARM_HOLSTER" )
if ( IsValid( file.menuTitan.armBadge ) )
file.menuTitan.armBadge.Destroy()
UpdatePreviewTitanArmBadge( player, skinIndex, camoIndex, clGlobal.currentMenuTitanModels.loadoutIndex )
asset armBadgeModel = clGlobal.previewMenuTitanModels.armBadgeModel
int armBadgeBodyGroupIndex = clGlobal.previewMenuTitanModels.armBadgeBodyGroupIndex
if ( usedCurrentValues )
{
UpdateMenuTitanArmBadge( player, skinIndex, camoIndex, clGlobal.currentMenuTitanModels.loadoutIndex )
armBadgeModel = clGlobal.currentMenuTitanModels.armBadgeModel
armBadgeBodyGroupIndex = clGlobal.currentMenuTitanModels.armBadgeBodyGroupIndex
}
if ( armBadgeBodyGroupIndex != -1 && armBadgeModel != $"" )
{
file.menuTitan.armBadge = CreateAttachedModel( file.menuTitan.body, armBadgeModel, TITAN_ARM_BADGE_ATTACHMENT )
file.menuTitan.armBadge.SetBodygroup( 0, armBadgeBodyGroupIndex )
}
}
void function SetEditingPilotLoadoutIndex( entity player, int loadoutIndex )
{
clGlobal.editingPilotLoadoutIndex = loadoutIndex
}
void function ClearEditingPilotLoadoutIndex( entity player )
{
clGlobal.editingPilotLoadoutIndex = -1
}
void function SetHeldPilotWeaponType( entity player, int itemType )
{
clGlobal.heldPilotWeaponType = itemType
}
void function SetEditingTitanLoadoutIndex( entity player, int loadoutIndex )
{
clGlobal.editingTitanLoadoutIndex = loadoutIndex
}
void function ClearEditingTitanLoadoutIndex( entity player )
{
clGlobal.editingTitanLoadoutIndex = -1
}
void function PreviewPilotCharacter( entity player, int itemIndex )
{
Assert( clGlobal.editingPilotLoadoutIndex != -1 )
array<ItemDisplayData> items = GetVisibleItemsOfType( eItemTypes.PILOT_SUIT )
string animType = "focused_idle"
string suit = items[ itemIndex ].ref
string weapon = GetPilotLoadoutWeapon( clGlobal.editingPilotLoadoutIndex, clGlobal.heldPilotWeaponType )
string idleAnim = GetMenuPilotAnim( animType, suit, GetItemMenuAnimClass( weapon ) )
string genderRace = GetPilotLoadoutGenderRace( clGlobal.editingPilotLoadoutIndex )
string setFile = GetSuitAndGenderBasedSetFile( suit, genderRace )
asset bodyModel = GetSetFileModel( setFile )
clGlobal.previewMenuPilotModels.bodyModel = bodyModel
clGlobal.previewMenuPilotModels.idleAnim = idleAnim
UpdatePilotModelDisplay( player )
}
void function PreviewPilotWeapon( entity player, int itemType, int itemIndex, int weaponCategory )
{
Assert( itemType == eItemTypes.PILOT_PRIMARY || itemType == eItemTypes.PILOT_SECONDARY )
Assert( clGlobal.editingPilotLoadoutIndex != -1 )
array<ItemDisplayData> items
if ( weaponCategory != -1 )
items = GetVisibleItemsOfTypeForCategory( itemType, weaponCategory )
else
items = GetVisibleItemsOfType( itemType )
string weapon = items[ itemIndex ].ref
asset weaponModel = GetWeaponModel( weapon )
string animType = "weapon_inspect_idle"
string suit = GetPilotLoadoutSuit( clGlobal.editingPilotLoadoutIndex )
string idleAnim = GetMenuPilotAnim( animType, suit, GetItemMenuAnimClass( weapon ) )
int weaponSkinIndex = GetPilotLoadoutWeaponSkinIndex( clGlobal.editingPilotLoadoutIndex, itemType )
int weaponCamoIndex = GetPilotLoadoutWeaponCamoIndex( clGlobal.editingPilotLoadoutIndex, itemType )
clGlobal.previewMenuPilotModels.idleAnim = idleAnim
clGlobal.previewMenuPilotModels.weapon = weapon
clGlobal.previewMenuPilotModels.weaponModel = weaponModel
clGlobal.previewMenuPilotModels.weaponSkinIndex = weaponSkinIndex
clGlobal.previewMenuPilotModels.weaponCamoIndex = weaponCamoIndex
clGlobal.previewMenuPilotModels.mods = []
UpdatePilotModelDisplay( player )
}
void function PreviewPilotWeaponMod( entity player, int modIndex, string modRef )
{
Assert( clGlobal.editingPilotLoadoutIndex != -1 )
array<string> mods = GetPilotLoadoutWeaponMods( clGlobal.editingPilotLoadoutIndex, clGlobal.heldPilotWeaponType )
mods[ modIndex ] = modRef
mods.removebyvalue( "" )
mods.removebyvalue( "none" )
clGlobal.previewMenuPilotModels.mods = mods
UpdatePilotModelDisplay( player )
}
void function PreviewPilotCamoChange( entity player, int camoIndex )
{
clGlobal.previewMenuPilotModels.camoIndex = camoIndex
UpdatePilotModelDisplay( player )
}
void function PreviewPilotWeaponCamoChange( entity player, int camoIndex )
{
if ( camoIndex == 0 ) // Special case for factory issue. Should make factory issue work as any other weapon skin item in the future.
{
clGlobal.previewMenuPilotModels.weaponSkinIndex = WEAPON_SKIN_INDEX_DEFAULT
clGlobal.previewMenuPilotModels.weaponCamoIndex = -1
}
else
{
clGlobal.previewMenuPilotModels.weaponSkinIndex = WEAPON_SKIN_INDEX_CAMO
clGlobal.previewMenuPilotModels.weaponCamoIndex = camoIndex
}
printt( "PreviewPilotWeaponCamoChange", clGlobal.previewMenuPilotModels.weaponSkinIndex, clGlobal.previewMenuPilotModels.weaponCamoIndex )
UpdatePilotModelDisplay( player )
}
void function PrintWeaponModelData()
{
printt( "clGlobal.previewMenuPilotModels.weaponSkinIndex:", clGlobal.previewMenuPilotModels.weaponSkinIndex, "clGlobal.currentMenuPilotModels.weaponSkinIndex:", clGlobal.currentMenuPilotModels.weaponSkinIndex )
printt( "clGlobal.previewMenuPilotModels.weaponCamoIndex:", clGlobal.previewMenuPilotModels.weaponCamoIndex, "clGlobal.currentMenuPilotModels.weaponCamoIndex:", clGlobal.currentMenuPilotModels.weaponCamoIndex )
}
void function PreviewPilotWeaponSkinChange( entity player, int skinIndex )
{
clGlobal.previewMenuPilotModels.weaponSkinIndex = skinIndex
clGlobal.previewMenuPilotModels.weaponCamoIndex = -1
printt( "PreviewPilotWeaponSkinChange", clGlobal.previewMenuPilotModels.weaponSkinIndex, clGlobal.previewMenuPilotModels.weaponCamoIndex )
UpdatePilotModelDisplay( player )
}
void function PreviewTitanDecalChange( entity player, int decalIndex )
{
clGlobal.previewMenuTitanModels.decalIndex = decalIndex
UpdateTitanModelDisplay( player )
}
void function PreviewTitanCamoChange( entity player, int camoIndex )
{
clGlobal.previewMenuTitanModels.camoIndex = camoIndex
clGlobal.previewMenuTitanModels.skinIndex = camoIndex > 0 ? TITAN_SKIN_INDEX_CAMO : 0
// clGlobal.previewMenuTitanModels.armBadgeModel = $""
// clGlobal.previewMenuTitanModels.armBadgeBodyGroupIndex = 0
printt( "PreviewTitanCamoChange", clGlobal.previewMenuTitanModels.skinIndex, clGlobal.previewMenuTitanModels.camoIndex )
UpdateTitanModelDisplay( player )
}
void function PreviewTitanSkinChange( entity player, int skinIndex )
{
clGlobal.previewMenuTitanModels.camoIndex = -1
clGlobal.previewMenuTitanModels.skinIndex = skinIndex
printt( "PreviewTitanSkinChange", clGlobal.previewMenuTitanModels.skinIndex, clGlobal.previewMenuTitanModels.camoIndex )
UpdateTitanModelDisplay( player )
}
void function PreviewTitanCombinedChange( entity player, int skinIndex, int camoIndex, int loadoutIndex )
{
clGlobal.previewMenuTitanModels.camoIndex = camoIndex
clGlobal.previewMenuTitanModels.skinIndex = skinIndex
clGlobal.previewMenuTitanModels.loadoutIndex = loadoutIndex
UpdatePreviewTitanArmBadge( player, skinIndex, camoIndex, loadoutIndex )
printt( "PreviewTitanCombinedChange", clGlobal.previewMenuTitanModels.skinIndex, clGlobal.previewMenuTitanModels.camoIndex )
UpdateTitanModelDisplay( player )
}
void function UpdatePreviewTitanArmBadge( entity player, int skinIndex, int camoIndex, int loadoutIndex )
{
UpdateMenuDefArmBadge( clGlobal.previewMenuTitanModels, player, skinIndex, camoIndex, loadoutIndex )
}
void function UpdateMenuTitanArmBadge( entity player, int skinIndex, int camoIndex, int loadoutIndex )
{
UpdateMenuDefArmBadge( clGlobal.currentMenuTitanModels, player, skinIndex, camoIndex, loadoutIndex )
}
void function UpdateMenuDefArmBadge( MenuCharacterDef charDef, entity player, int skinIndex, int camoIndex, int loadoutIndex )
{
if ( !IsConnected() ) //Defensive fix for persistence not being loaded when disconnecting or connecting into a match.
return
TitanLoadoutDef loadout = clone GetCachedTitanLoadout( loadoutIndex )
asset armBadgeModel = GetTitanArmBadgeFromLoadoutAndSkinIndex( loadout, skinIndex )
int armBadgeBodyGroupIndex = -1
if ( armBadgeModel != $"" )
{
int difficulty = FD_GetHighestDifficultyForTitan( player, loadout.titanClass )
switch ( difficulty )
{
case eFDDifficultyLevel.HARD:
armBadgeBodyGroupIndex = 1
break
case eFDDifficultyLevel.MASTER:
armBadgeBodyGroupIndex = 2
break
case eFDDifficultyLevel.INSANE:
armBadgeBodyGroupIndex = 3
break
default:
armBadgeBodyGroupIndex = 0
break
}
}
charDef.armBadgeModel = armBadgeModel
charDef.armBadgeBodyGroupIndex = armBadgeBodyGroupIndex
}
void function PreviewTitanWeaponCamoChange( entity player, int camoIndex )
{
clGlobal.previewMenuTitanModels.weaponCamoIndex = camoIndex
UpdateTitanModelDisplay( player )
}
void function UpdateFactionModel( entity player, int itemIndex )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
array<ItemDisplayData> items = GetVisibleItemsOfType( eItemTypes.FACTION )
string ref = items[ itemIndex ].ref
asset model = GetFactionModel( ref )
int skinIndex = GetFactionModelSkin( ref )
asset propModel = GetFactionPropModel( ref )
string idleAnim = GetFactionIdleAnim( ref )
//bool playIdle = false
//if ( file.menuFaction.body.GetModelName() != model || idleAnim != file.menuFaction.bodyAnim ) // Model has changed or anim has changed
// playIdle = true
file.menuFaction.body.SetSkin( 0 )
file.menuFaction.body.SetModel( model )
file.menuFaction.body.SetSkin( skinIndex )
entity propEnt = CreateFactionPropModel( file.menuFaction.body, ref )
if ( IsValid( file.menuFaction.weapon ) )
file.menuFaction.weapon.Destroy()
file.menuFaction.weapon = propEnt
//if ( playIdle )
//{
PlayMenuAnim( file.menuFaction.body, idleAnim )
file.menuFaction.bodyAnim = idleAnim
//}
}
void function UpdateMenuToHarvester()
{
thread SpawnHarvester()
}
void function SpawnHarvester()
{
EndSignal( level, "EndSetPresentationType" )
while ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
WaitFrame()
vector originOffset = < 450, -700, 0 >
vector angleOffset = <0, 0, 0>
file.menuMiscModel.body.SetLocalOrigin( originOffset )
file.menuMiscModel.body.SetLocalAngles( angleOffset )
bool success = file.menuMiscModel.body.SetModel( MODEL_HARVESTER_TOWER )
if ( !success )
return
entity harvester = file.menuMiscModel.body
int attachID = harvester.LookupAttachment( "ref" )
vector attachOrg = harvester.GetAttachmentOrigin( attachID )
vector attachAng = harvester.GetAttachmentAngles( attachID )
entity ringEnt = CreateClientSidePropDynamic( attachOrg, attachAng, MODEL_HARVESTER_TOWER_RINGS )
ringEnt.SetParent( harvester )
ringEnt.Anim_Play( "generator_cycle_fast" )
int harvesterBeamFX = StartParticleEffectOnEntity( harvester, GetParticleSystemIndex( FX_HARVESTER_BEAM ), FX_PATTACH_ABSORIGIN_FOLLOW, -1 )
EffectSetControlPointVector( harvesterBeamFX, 1, < 126.0, 188.0, 236.0 > )
OnThreadEnd(
function() : ( ringEnt, harvesterBeamFX )
{
ringEnt.Destroy()
EffectStop( harvesterBeamFX, true, true )
}
)
WaitForever()
}
void function UpdateBoostModel( entity player, int itemIndex )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
array<ItemDisplayData> items = GetVisibleItemsOfType( eItemTypes.BURN_METER_REWARD )
string ref = items[ itemIndex ].ref
asset model = GetBoostModel( ref )
int skinIndex = GetBoostSkin( ref )
vector originOffset = <0, 0, 0>
vector angleOffset = <0, 0, 90>
file.menuMiscModel.body.SetLocalOrigin( originOffset )
file.menuMiscModel.body.SetLocalAngles( angleOffset )
file.menuMiscModel.body.SetModel( model )
file.menuMiscModel.body.SetSkin( skinIndex )
}
vector function GetWeaponModelOffset( string weaponRef )
{
vector vec = <0, 0, 0>
switch ( weaponRef )
{
case "mp_weapon_sniper":
vec = <27.5, -2.55, 1.2>
break
}
return vec
}
void function UpdateStoreWeaponModelSkin( entity player, string weaponRef, int skinIndex )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
printt( "skinIndex:", skinIndex )
vector moverOffset = GetWeaponModelOffset( weaponRef )
file.menuWeaponModel.mover.SetLocalOrigin( moverOffset )
asset model = GetWeaponViewmodel( weaponRef )
file.menuWeaponModel.body.SetSkin( 0 ) // Lame, but without this the game can complain that the skin is invalid when the model or skin is changed, regardless of which happens first
file.menuWeaponModel.body.SetModel( model )
file.menuWeaponModel.body.SetSkin( skinIndex )
vector angleOffset = <0, 60, 0>
string attachmentName = "MENU_ROTATE"
vector originOffset = GetAttachmentOriginOffset( file.menuWeaponModel.body, attachmentName, angleOffset )
file.menuWeaponModel.body.SetLocalOrigin( originOffset )
file.menuWeaponModel.body.SetLocalAngles( angleOffset )
file.menuWeaponModel.body.Anim_SetPaused( true )
}
void function UpdateStoreWeaponModelZoom( entity player, float zoomFrac )
{
if ( file.activeCharacter == null )
return
if ( Time() - file.lastZoomTime < 0.1 )
return
CharacterData character = expect CharacterData( file.activeCharacter )
if ( zoomFrac == 0 )
character.fovScale = character.fovScale < 1.0 ? 1.0 : 0.0
else if ( zoomFrac > 0 )
character.fovScale = 1.0
else
character.fovScale = 0.0
file.lastZoomTime = Time()
}
vector function GetAttachmentOriginOffset( entity ent, string attachName, vector angles )
{
int attachIndex = ent.LookupAttachment( attachName )
ent.SetAngles( angles )
vector worldOrigin = ent.GetAttachmentOrigin( attachIndex )
vector localOffset = ent.GetOrigin() - worldOrigin
return localOffset
}
vector function GetWorldSpaceCenterOffset( entity ent, vector angles )
{
ent.SetAngles( angles )
vector worldOrigin = ent.GetWorldSpaceCenter()
vector localOffset = ent.GetOrigin() - worldOrigin
return localOffset
}
entity function GetMenuMiscModel()
{
return file.menuMiscModel.body
}
void function UpdateCallsignCard( entity player, int itemIndex )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
#if HAS_WORLD_CALLSIGN
CallingCard callsignCard = CallingCard_GetByIndex( itemIndex )
RuiSetImage( file.menuCallsignRui, "cardImage", callsignCard.image )
RuiSetInt( file.menuCallsignRui, "layoutType", callsignCard.layoutType )
RuiSetImage( file.menuCallsignRui, "cardGenImage", PlayerXPGetGenIcon( player ) )
#endif
}
void function UpdateCallsignIcon( entity player, int itemIndex )
{
if ( !clGlobal.initializedMenuModels ) // Handle early calls that UI script can trigger before client is ready
return
#if HAS_WORLD_CALLSIGN
CallsignIcon callsignIcon = CallsignIcon_GetByIndex( itemIndex )
RuiSetImage( file.menuCallsignRui, "iconImage", callsignIcon.image )
#endif
}
// TODO: Do we need to account for model strings sometimes having a skin specified by appending ":0", ":1", etc?
asset function GetSetFileModel( string setFile )
{
return GetPlayerSettingsAssetForClassName( setFile, "bodymodel" )
}
string function GetPilotLoadoutGenderRace( int loadoutIndex )
{
return GetCachedPilotLoadout( loadoutIndex ).race
}
string function GetPilotLoadoutSuit( int loadoutIndex )
{
return GetCachedPilotLoadout( loadoutIndex ).suit
}
int function GetPilotCamoIndex( int loadoutIndex )
{
return GetCachedPilotLoadout( loadoutIndex ).camoIndex
}
string function GetPilotLoadoutWeapon( int loadoutIndex, int weaponItemType )
{
string ref
if ( weaponItemType == eItemTypes.PILOT_PRIMARY )
ref = GetCachedPilotLoadout( loadoutIndex ).primary
else if ( weaponItemType == eItemTypes.PILOT_SECONDARY )
ref = GetCachedPilotLoadout( loadoutIndex ).secondary
else if ( weaponItemType == eItemTypes.PILOT_WEAPON3 )
ref = GetCachedPilotLoadout( loadoutIndex ).weapon3
else
Assert( false )
return ref
}
array<string> function GetPilotLoadoutWeaponMods( int loadoutIndex, int weaponItemType )
{
array<string> mods
if ( weaponItemType == eItemTypes.PILOT_PRIMARY )
{
mods.append( GetCachedPilotLoadout( loadoutIndex ).primaryMod1 )
mods.append( GetCachedPilotLoadout( loadoutIndex ).primaryMod2 )
mods.append( GetCachedPilotLoadout( loadoutIndex ).primaryMod3 )
mods.append( GetCachedPilotLoadout( loadoutIndex ).primaryAttachment )
}
else if ( weaponItemType == eItemTypes.PILOT_SECONDARY )
{
mods.append( GetCachedPilotLoadout( loadoutIndex ).secondaryMod1 )
mods.append( GetCachedPilotLoadout( loadoutIndex ).secondaryMod2 )
mods.append( GetCachedPilotLoadout( loadoutIndex ).secondaryMod3 )
}
else if ( weaponItemType == eItemTypes.PILOT_WEAPON3 )
{
mods.append( GetCachedPilotLoadout( loadoutIndex ).weapon3Mod1 )
mods.append( GetCachedPilotLoadout( loadoutIndex ).weapon3Mod2 )
mods.append( GetCachedPilotLoadout( loadoutIndex ).weapon3Mod3 )
}
else
{
Assert( false )
}
return mods
}
int function GetPilotLoadoutWeaponCamoIndex( int loadoutIndex, int weaponItemType )
{
int camoIndex = -1
if ( weaponItemType == eItemTypes.PILOT_PRIMARY )
camoIndex = GetCachedPilotLoadout( loadoutIndex ).primaryCamoIndex
else if ( weaponItemType == eItemTypes.PILOT_SECONDARY )
camoIndex = GetCachedPilotLoadout( loadoutIndex ).secondaryCamoIndex
else if ( weaponItemType == eItemTypes.PILOT_WEAPON3 )
camoIndex = GetCachedPilotLoadout( loadoutIndex ).weapon3CamoIndex
else
Assert( false )
return camoIndex
}
int function GetPilotLoadoutWeaponSkinIndex( int loadoutIndex, int weaponItemType )
{
int skinIndex = 0
if ( weaponItemType == eItemTypes.PILOT_PRIMARY )
skinIndex = GetCachedPilotLoadout( loadoutIndex ).primarySkinIndex
else if ( weaponItemType == eItemTypes.PILOT_SECONDARY )
skinIndex = GetCachedPilotLoadout( loadoutIndex ).secondarySkinIndex
else if ( weaponItemType == eItemTypes.PILOT_WEAPON3 )
skinIndex = GetCachedPilotLoadout( loadoutIndex ).weapon3SkinIndex
else
Assert( false )
return skinIndex
}
string function GetTitanLoadoutSetFile( int loadoutIndex )
{
return GetCachedTitanLoadout( loadoutIndex ).setFile
}
string function GetTitanLoadoutPrimary( int loadoutIndex )
{
return GetCachedTitanLoadout( loadoutIndex ).primary
}
int function GetTitanCamoIndex( int loadoutIndex )
{
return GetCachedTitanLoadoutCamoIndex( loadoutIndex )
}
int function GetTitanSkinIndex( int loadoutIndex )
{
return GetCachedTitanLoadoutSkinIndex( loadoutIndex )
}
int function GetTitanDecalIndex( int loadoutIndex )
{
return GetCachedTitanLoadoutDecalIndex( loadoutIndex )
}
asset function GetTitanLoadoutArmBadge( int loadoutIndex )
{
return GetCachedTitanLoadoutArmBadge( loadoutIndex )
}
int function GetTitanLoadoutArmBadgeState( int loadoutIndex )
{
return GetCachedTitanArmBadgeState( loadoutIndex )
}
asset function GetFactionModel( string ref )
{
var dataTable = GetDataTable( $"datatable/faction_leaders.rpak" )
int row = GetDataTableRowMatchingStringValue( dataTable, GetDataTableColumnByName( dataTable, "persistenceRef" ), ref )
asset model = GetDataTableAsset( dataTable, row, GetDataTableColumnByName( dataTable, "modelName" ) )
return model
}
int function GetFactionModelSkin( string ref )
{
var dataTable = GetDataTable( $"datatable/faction_leaders.rpak" )
int row = GetDataTableRowMatchingStringValue( dataTable, GetDataTableColumnByName( dataTable, "persistenceRef" ), ref )
int skin = GetDataTableInt( dataTable, row, GetDataTableColumnByName( dataTable, "skinIndex" ) )
return skin
}
string function GetFactionPropAttachment( string ref )
{
var dataTable = GetDataTable( $"datatable/faction_leaders.rpak" )
int row = GetDataTableRowMatchingStringValue( dataTable, GetDataTableColumnByName( dataTable, "persistenceRef" ), ref )
string attachment = GetDataTableString( dataTable, row, GetDataTableColumnByName( dataTable, "propAttachment" ) )
return attachment
}
asset function GetFactionPropModel( string ref )
{
var dataTable = GetDataTable( $"datatable/faction_leaders.rpak" )
int row = GetDataTableRowMatchingStringValue( dataTable, GetDataTableColumnByName( dataTable, "persistenceRef" ), ref )
asset model = GetDataTableAsset( dataTable, row, GetDataTableColumnByName( dataTable, "propModelName" ) )
return model
}
string function GetFactionIdleAnim( string ref )
{
var dataTable = GetDataTable( $"datatable/faction_leaders.rpak" )
int row = GetDataTableRowMatchingStringValue( dataTable, GetDataTableColumnByName( dataTable, "persistenceRef" ), ref )
string anim = GetDataTableString( dataTable, row, GetDataTableColumnByName( dataTable, "menuIdleAnim" ) )
return anim
}
asset function GetBoostModel( string ref )
{
var dataTable = GetDataTable( $"datatable/burn_meter_rewards.rpak" )
int row = GetDataTableRowMatchingStringValue( dataTable, GetDataTableColumnByName( dataTable, "itemRef" ), ref )
asset model = GetDataTableAsset( dataTable, row, GetDataTableColumnByName( dataTable, "model" ) )
return model
}
void function SavePilotCharacterPreview( entity player )
{
clGlobal.currentMenuPilotModels.bodyModel = clGlobal.previewMenuPilotModels.bodyModel
clGlobal.previewMenuPilotModels.bodyModel = $""
clGlobal.previewMenuPilotModels.idleAnim = ""
UpdatePilotModelDisplay( player )
}
void function SavePilotWeaponPreview( entity player )
{
clGlobal.currentMenuPilotModels.idleAnim = clGlobal.previewMenuPilotModels.idleAnim
clGlobal.previewMenuPilotModels.idleAnim = ""
clGlobal.currentMenuPilotModels.weapon = clGlobal.previewMenuPilotModels.weapon
clGlobal.previewMenuPilotModels.weapon = ""
clGlobal.currentMenuPilotModels.weaponModel = clGlobal.previewMenuPilotModels.weaponModel
clGlobal.previewMenuPilotModels.weaponModel = $""
clGlobal.previewMenuPilotModels.weaponCamoIndex = -1
clGlobal.previewMenuPilotModels.weaponSkinIndex = -1
clGlobal.currentMenuPilotModels.mods = []
UpdatePilotModelDisplay( player )
}
void function SavePilotWeaponModPreview( entity player )
{
clGlobal.currentMenuPilotModels.mods = clGlobal.previewMenuPilotModels.mods
clGlobal.previewMenuPilotModels.mods = []
UpdatePilotModelDisplay( player )
}
//void function SavePilotCamoPreview( entity player )
//{
// clGlobal.currentMenuPilotModels.camoIndex = clGlobal.previewMenuPilotModels.camoIndex
// clGlobal.previewMenuPilotModels.camoIndex = -1
// UpdatePilotModelDisplay( player )
//}
void function ClearAllPilotPreview( entity player )
{
clGlobal.previewMenuPilotModels.bodyModel = $""
clGlobal.previewMenuPilotModels.camoIndex = -1
clGlobal.previewMenuPilotModels.weapon = ""
clGlobal.previewMenuPilotModels.weaponModel = $""
clGlobal.previewMenuPilotModels.weaponCamoIndex = -1
clGlobal.previewMenuPilotModels.weaponSkinIndex = -1
clGlobal.previewMenuPilotModels.mods = []
clGlobal.previewMenuPilotModels.idleAnim = ""
UpdatePilotModelDisplay( player )
}
void function SaveTitanDecalPreview( entity player )
{
clGlobal.currentMenuTitanModels.decalIndex = clGlobal.previewMenuTitanModels.decalIndex
clGlobal.previewMenuTitanModels.decalIndex = -1
UpdateTitanModelDisplay( player )
}
void function ClearTitanDecalPreview( entity player )
{
clGlobal.previewMenuTitanModels.decalIndex = -1
UpdateTitanModelDisplay( player )
}
void function SaveTitanCamoPreview( entity player )
{
clGlobal.currentMenuTitanModels.camoIndex = clGlobal.previewMenuTitanModels.camoIndex
clGlobal.previewMenuTitanModels.camoIndex = -1
clGlobal.currentMenuTitanModels.skinIndex = clGlobal.previewMenuTitanModels.skinIndex
clGlobal.previewMenuTitanModels.skinIndex = 0
UpdateTitanModelDisplay( player )
}
void function ClearTitanCamoPreview( entity player )
{
clGlobal.previewMenuTitanModels.camoIndex = -1
clGlobal.previewMenuTitanModels.skinIndex = 0
UpdateTitanModelDisplay( player )
}
void function ClearTitanCombinedPreview( entity player )
{
clGlobal.previewMenuTitanModels.camoIndex = -1
clGlobal.previewMenuTitanModels.skinIndex = 0
clGlobal.previewMenuTitanModels.armBadgeBodyGroupIndex = -1
clGlobal.previewMenuTitanModels.armBadgeModel = $""
UpdateTitanModelDisplay( player )
}
void function SaveTitanSkinPreview( entity player )
{
clGlobal.currentMenuTitanModels.skinIndex = clGlobal.previewMenuTitanModels.skinIndex
clGlobal.previewMenuTitanModels.skinIndex = 0
clGlobal.currentMenuTitanModels.camoIndex = clGlobal.previewMenuTitanModels.camoIndex
clGlobal.previewMenuTitanModels.camoIndex = -1
UpdateTitanModelDisplay( player )
}
void function SaveTitanCombinedPreview( entity player )
{
clGlobal.currentMenuTitanModels.skinIndex = clGlobal.previewMenuTitanModels.skinIndex
clGlobal.previewMenuTitanModels.skinIndex = 0
clGlobal.currentMenuTitanModels.camoIndex = clGlobal.previewMenuTitanModels.camoIndex
clGlobal.previewMenuTitanModels.camoIndex = -1
clGlobal.currentMenuTitanModels.armBadgeModel = clGlobal.previewMenuTitanModels.armBadgeModel
clGlobal.previewMenuTitanModels.armBadgeModel = $""
clGlobal.currentMenuTitanModels.armBadgeBodyGroupIndex = clGlobal.previewMenuTitanModels.armBadgeBodyGroupIndex
clGlobal.previewMenuTitanModels.armBadgeBodyGroupIndex = -1
UpdateTitanModelDisplay( player )
}
void function ClearTitanSkinPreview( entity player )
{
clGlobal.previewMenuTitanModels.camoIndex = -1
clGlobal.previewMenuTitanModels.skinIndex = 0
UpdateTitanModelDisplay( player )
}
void function ClearAllTitanPreview( entity player )
{
clGlobal.previewMenuTitanModels.bodyModel = $""
clGlobal.previewMenuTitanModels.camoIndex = -1
clGlobal.previewMenuTitanModels.skinIndex = 0
clGlobal.previewMenuTitanModels.decalIndex = -1
//clGlobal.previewMenuTitanModels.armBadgeModel = $"" // Not sure why these aren't in here. These should be uncommented when we're sure it's safe to.
//clGlobal.previewMenuTitanModels.armBadgeBodyGroupIndex = -1
clGlobal.previewMenuTitanModels.weaponModel = $""
clGlobal.previewMenuTitanModels.weaponCamoIndex = -1
clGlobal.previewMenuTitanModels.idleAnim = ""
UpdateTitanModelDisplay( player )
}
void function PlayMenuAnim( entity model, string anim )
{
float animCycle = model.GetCycle()
//printt( "PlayMenuAnim(", model, ",", anim, ")" )
model.Anim_NonScriptedPlay( anim )
model.SetCycle( animCycle )
}
void function SetPresentationType( entity player, int presentationType, bool interpolate )
{
thread SetPresentationTypeThread( player, presentationType, interpolate )
}
void function SetPresentationTypeThread( entity player, int presentationType, bool interpolate )
{
Signal( level, "EndSetPresentationType" )
EndSignal( level, "EndSetPresentationType" )
while ( !clGlobal.initializedMenuModels )
WaitFrame()
// setting menu camera while our viewentity isn't player will crash
// unfortunately no way to close menu if we get our viewentity set while menu is open atm
while ( IsValid( GetViewEntity() ) && GetViewEntity().GetClassName() == "class C_BaseEntity" )
WaitFrame()
if ( file.presentationTypeInitialized && presentationType == file.presentationType )
return
file.presentationType = presentationType
if ( !file.presentationTypeInitialized )
file.presentationTypeInitialized = true
if ( file.presentationData[ presentationType ].activateFunc != null )
file.presentationData[ presentationType ].activateFunc()
if ( IsValid( player ) )
SetMenuCamera( player, presentationType, interpolate )
CharacterData ornull lastActiveCharacter = file.activeCharacter
file.activeCharacter = file.presentationData[ presentationType ].characterData
#if HAS_WORLD_CALLSIGN
if ( !file.presentationData[ presentationType ].showCallsign )
{
RuiSetFloat( file.menuCallsignRui, "cardAlpha", 0.0 )
}
else
{
RuiSetFloat( file.menuCallsignRui, "cardAlpha", 1.0 )
}
#endif
if ( !file.presentationData[ presentationType ].showStoreBG )
file.menuStoreBackground.Hide()
else
file.menuStoreBackground.Show()
if ( !file.presentationData[ presentationType ].showStorePrimeBG )
{
if ( file.menuStorePrimeBgCreated )
{
file.menuStorePrimeBgCreated = false
RuiTopology_Destroy( file.menuStorePrimeBg )
RuiDestroy( file.menuStorePrimeBgRui )
}
}
else
{
file.menuStorePrimeBgCreated = true
file.menuStorePrimeBg = RuiTopology_CreatePlane( < -91.6658, 453.079, 463.765>, <399.802, -12.5803, 0.000155184>, <3.28334, 104.34, -386.138>, false )
file.menuStorePrimeBgRui = RuiCreate( $"ui/prime_titan_bg.rpak", file.menuStorePrimeBg, RUI_DRAW_WORLD, 0 )
}
if ( file.presentationData[ presentationType ].showMiscModel )
file.menuMiscModel.body.Show()
else
file.menuMiscModel.body.Hide()
if ( file.presentationData[ presentationType ].showWeaponModel )
{
//file.weaponDLight.SetLightColor( WEAPON_DLIGHT_COLOR )
file.menuWeaponModel.body.Show()
}
else
{
//file.weaponDLight.SetLightColor( <0, 0, 0> )
file.menuWeaponModel.body.Hide()
}
if ( file.presentationData[ presentationType ].showTitanModel )
{
file.menuTitan.body.Show()
file.menuTitan.weapon.Show()
if ( IsValid( file.menuTitan.prop ) )
file.menuTitan.prop.Show()
if ( IsValid( file.menuTitan.armBadge ) )
file.menuTitan.armBadge.Show()
}
else
{
file.menuTitan.body.Hide()
file.menuTitan.weapon.Hide()
if ( IsValid( file.menuTitan.prop ) )
file.menuTitan.prop.Hide()
if ( IsValid( file.menuTitan.armBadge ) )
file.menuTitan.armBadge.Hide()
}
if ( lastActiveCharacter != null )
ResetCharacterRotation( expect CharacterData( lastActiveCharacter ) )
}
void function SetMenuCamera( entity player, int presentationType, bool interpolate )
{
string sceneAnim = file.presentationData[ presentationType ].sceneAnim
clGlobal.menuSceneModel.Anim_PlayWithRefPoint( sceneAnim, file.sceneRef.GetOrigin(), file.sceneRef.GetAngles() + <0, -90, 0>, 0 )
if ( !interpolate )
clGlobal.menuSceneModel.Anim_SetStartTime( 1.0 )
if ( presentationType == ePresentationType.INACTIVE )
{
SetMapSetting_CsmTexelScale( 1.0, 1.0 )
SetMapSetting_CsmStartDistance( 0.0 )
player.ClearMenuCameraEntity()
printt( "Clearing menu camera" )
player.SetScriptMenuOff()
return
}
player.SetScriptMenuOn()
float fov = file.presentationData[ presentationType ].fov
player.SetMenuCameraEntity( clGlobal.menuCamera )
clGlobal.menuCamera.SetTarget( file.cameraTarget, fov, interpolate, EASING_CUBIC_INOUT, TRANSITION_DURATION )
//EASING_LINEAR
//EASING_SINE_IN
//EASING_SINE_OUT
//EASING_SINE_INOUT
//EASING_CIRC_IN
//EASING_CIRC_OUT
//EASING_CIRC_INOUT
//EASING_CUBIC_IN
//EASING_CUBIC_OUT
//EASING_CUBIC_INOUT
//EASING_BACK_IN
//EASING_BACK_OUT
//EASING_BACK_INOUT
float dofNearStart = file.presentationData[ presentationType ].dofNearStart
float dofNearEnd = file.presentationData[ presentationType ].dofNearEnd
float dofFarStart = file.presentationData[ presentationType ].dofFarStart
float dofFarEnd = file.presentationData[ presentationType ].dofFarEnd
if ( interpolate )
printt( "Interpolating menu camera to:", Dev_GetEnumString( ePresentationType, presentationType ) )
else
printt( "Snapping menu camera to:", Dev_GetEnumString( ePresentationType, presentationType ) )
if ( interpolate )
{
DoF_LerpNearDepth( dofNearStart, dofNearEnd, TRANSITION_DURATION )
DoF_LerpFarDepth( dofFarStart, dofFarEnd, TRANSITION_DURATION )
}
else
{
DoF_SetNearDepth( dofNearStart, dofNearEnd )
DoF_SetFarDepth( dofFarStart, dofFarEnd )
}
DoFSetDilateInfocus( true ) // We want to reduce DoF aliasing around bright edges in the menus.
#if CONSOLE_PROG
const float texelNorm = 2.0
#else
const float texelNorm = 1.0
#endif
float csmTexelScale1 = file.presentationData[ presentationType ].csmTexelScale1 * texelNorm
float csmTexelScale2 = file.presentationData[ presentationType ].csmTexelScale2 * texelNorm
float csmStartDistance = file.presentationData[ presentationType ].csmStartDistance
// Tweaks in order to maximize the shadow space usage for the pilot and/or the titan.
// Used the convar csm_debug_2d to find the best values on PC.
SetMapSetting_CsmTexelScale( csmTexelScale1, csmTexelScale2 )
SetMapSetting_CsmStartDistance( csmStartDistance )
}
void function ModelRotationThread()
{
for ( ;; )
{
WaitFrame()
if ( file.activeCharacter == null )
continue
CharacterData character = expect CharacterData( file.activeCharacter )
float[2] rotationDelta
if ( IsControllerModeActive() )
{
const float STICK_DEADZONE = 0.05
float stickXRaw = clamp( InputGetAxis( ANALOG_RIGHT_X ), -1.0, 1.0 )
float stickXRemappedAbs = (fabs( stickXRaw ) < STICK_DEADZONE) ? 0.0 : ((fabs( stickXRaw ) - STICK_DEADZONE) / (1.0 - STICK_DEADZONE))
float stickX = EaseIn( stickXRemappedAbs ) * (stickXRaw < 0.0 ? -1.0 : 1.0)
rotationDelta[0] = ((character.rotationDelta[0] + stickX * character.maxTurnSpeed * FrameTime()) % 360.0)
float stickYRaw = clamp( InputGetAxis( ANALOG_RIGHT_Y ), -1.0, 1.0 )
float stickYRemappedAbs = (fabs( stickYRaw ) < STICK_DEADZONE) ? 0.0 : ((fabs( stickYRaw ) - STICK_DEADZONE) / (1.0 - STICK_DEADZONE))
float stickY = EaseIn( stickYRemappedAbs ) * (stickYRaw < 0.0 ? -1.0 : 1.0)
rotationDelta[1] = ((character.rotationDelta[1] + stickY * character.maxTurnSpeed * FrameTime()) % 360.0)
}
else
{
rotationDelta[0] = ((character.rotationDelta[0] + file.mouseRotateDelta[0] * FrameTime()) % 360.0)
file.mouseRotateDelta[0] = 0 // clear because otherwise it would keep spinning
rotationDelta[1] = ((character.rotationDelta[1] + file.mouseRotateDelta[1] * FrameTime()) % 360.0)
file.mouseRotateDelta[1] = 0 // clear because otherwise it would keep spinning
}
float maxTurnDegrees = file.presentationData[ file.presentationType ].maxTurnDegrees
if ( maxTurnDegrees < 360.0 )
{
float minRotationDelta = 0 - (maxTurnDegrees / 2)
float maxRotationDelta = maxTurnDegrees / 2
rotationDelta[0] = clamp( rotationDelta[0], minRotationDelta, maxRotationDelta )
}
float maxPitchDegrees = file.presentationData[ file.presentationType ].maxPitchDegrees
if ( maxPitchDegrees < 360.0 )
{
float minRotationDelta = 0 - (maxPitchDegrees / 2)
float maxRotationDelta = maxPitchDegrees / 2
rotationDelta[1] = clamp( rotationDelta[1], minRotationDelta, maxRotationDelta )
}
character.rotationDelta[0] = rotationDelta[0]
character.rotationDelta[1] = rotationDelta[1]
vector defaultAngles = clGlobal.menuSceneModel.GetAttachmentAngles( clGlobal.menuSceneModel.LookupAttachment( character.attachName ) )
vector newAng
/*
if ( file.presentationData[ file.presentationType ].useRollAxis )
newAng = <defaultAngles.x, defaultAngles.y + character.rotationDelta[0], defaultAngles.z + character.rotationDelta[1]>
else
newAng = <defaultAngles.x + character.rotationDelta[1], defaultAngles.y + character.rotationDelta[0], defaultAngles.z>
*/
vector pitchTowardCamera = < -rotationDelta[1], 0, 0> //AnglesCompose( <0, -90, 0>, AnglesCompose( <rotationDelta[1], 0, 0>, <0, 90, 0> ) )
// newAng = <defaultAngles.x, defaultAngles.y + character.rotationDelta[0], defaultAngles.z>
newAng = AnglesCompose( defaultAngles, pitchTowardCamera )
newAng = AnglesCompose( newAng, <0, character.rotationDelta[0], 0> )
float fov = file.presentationData[ file.presentationType ].fov
float finalFOV = GraphCapped( character.fovScale, 0.0, 1.0, fov * 0.6, fov )
clGlobal.menuCamera.SetTarget( file.cameraTarget, finalFOV, true, EASING_CUBIC_INOUT, 0.05 )
character.mover.SetAngles( newAng )
}
}
void function ResetCharacterRotation( CharacterData character )
{
entity mover = character.mover
vector defaultAngles = clGlobal.menuSceneModel.GetAttachmentAngles( clGlobal.menuSceneModel.LookupAttachment( character.attachName ) )
vector currentAngles = mover.GetAngles()
character.rotationDelta[0] = 0.0
character.rotationDelta[1] = 0.0
character.fovScale = 1.0
if ( currentAngles == defaultAngles )
return
// Get the reset time for the degrees we need to turn to get back to defaultAngles based on a maxDuration time for the worst case which is 180 degrees
float absNormDeg = fabs( currentAngles.y - defaultAngles.y % 360.0 )
float diffDeg = min( 360.0 - absNormDeg, absNormDeg )
float maxDuration = 0.5
float duration = diffDeg * (maxDuration / 180)
float easeTime = duration / 3
if ( duration > 0 )
mover.NonPhysicsRotateTo( defaultAngles, duration, easeTime, easeTime )
else
mover.SetAngles( defaultAngles )
}
void function SetMenuOpenState( entity player, int state )
{
bool wasSoloDialogMenuOpen = clGlobal.isSoloDialogMenuOpen
clGlobal.isMenuOpen = (state == 1)
clGlobal.isSoloDialogMenuOpen = (state == 2);
if ( clGlobal.isSoloDialogMenuOpen != wasSoloDialogMenuOpen )
UpdateMainHudVisibility( player )
if ( clGlobal.mapSupportsMenuModels && IsMultiplayer() && !IsLobby() )
{
if ( clGlobal.isMenuOpen )
{
ColorCorrection_SetExclusive( file.menuColorCorrection, true )
ColorCorrection_SetWeight( file.menuColorCorrection, 1.0 )
SetMapSetting_FogEnabled( false )
}
else
{
DoF_SetNearDepthToDefault()
DoF_SetFarDepthToDefault()
DoFSetDilateInfocus( false );
ColorCorrection_SetWeight( file.menuColorCorrection, 0.0 )
ColorCorrection_SetExclusive( file.menuColorCorrection, false )
SetMapSetting_FogEnabled( true )
}
}
}
void function UpdateMouseRotateDelta( entity player, float deltaX, float deltaY )
{
file.mouseRotateDelta[0] = deltaX
file.mouseRotateDelta[1] = deltaY
}
#endif // CLIENT
#if UI
void function RunMenuClientFunction( string func, var arg1 = null, var arg2 = null, var arg3 = null )
{
if ( !CanRunClientScript() || !uiGlobal.mapSupportsMenuModels )
return
if ( arg1 == null )
RunClientScript( func, GetLocalClientPlayer() )
else if ( arg2 == null )
RunClientScript( func, GetLocalClientPlayer(), arg1 )
else if ( arg3 == null )
RunClientScript( func, GetLocalClientPlayer(), arg1, arg2 )
else
RunClientScript( func, GetLocalClientPlayer(), arg1, arg2, arg3 )
}
void function UI_SetPresentationType( int newPresentationType )
{
if ( IsFullyConnected() && uiGlobal.mapSupportsMenuModels )
{
if ( uiGlobal.activePresentationType == ePresentationType.NO_MODELS || newPresentationType == ePresentationType.NO_MODELS ||
uiGlobal.activePresentationType == ePresentationType.FACTIONS || newPresentationType == ePresentationType.FACTIONS ||
uiGlobal.activePresentationType == ePresentationType.BOOSTS || newPresentationType == ePresentationType.BOOSTS ||
uiGlobal.activePresentationType == ePresentationType.STORE_FRONT || newPresentationType == ePresentationType.STORE_FRONT ||
uiGlobal.activePresentationType == ePresentationType.PVE_MAIN || newPresentationType == ePresentationType.PVE_MAIN ||
uiGlobal.activePresentationType == ePresentationType.DEFAULT && newPresentationType == ePresentationType.STORE_WEAPON_SKINS ||
uiGlobal.activePresentationType == ePresentationType.STORE_WEAPON_SKINS && newPresentationType == ePresentationType.DEFAULT ||
uiGlobal.activePresentationType == ePresentationType.PILOT_WEAPON && newPresentationType == ePresentationType.STORE_WEAPON_SKINS ||
uiGlobal.activePresentationType == ePresentationType.STORE_WEAPON_SKINS && newPresentationType == ePresentationType.PILOT_WEAPON ||
uiGlobal.activePresentationType == ePresentationType.INACTIVE )
{
uiGlobal.interpolateCameraMoves = false
}
else
{
uiGlobal.interpolateCameraMoves = true
}
// When loading the lobby we don't want any interpolation
if ( uiGlobal.lobbyFromLoadingScreen )
{
uiGlobal.interpolateCameraMoves = false
uiGlobal.lobbyFromLoadingScreen = false
}
RunClientScript( "SetPresentationType", GetLocalClientPlayer(), newPresentationType, uiGlobal.interpolateCameraMoves )
uiGlobal.activePresentationType = newPresentationType
if ( newPresentationType == ePresentationType.FD_MAIN ||
newPresentationType == ePresentationType.FD_FIND_GAME
)
RunClientScript( "UpdateMenuToHarvester" )
}
}
#endif // UI
|