forked from FatLurch/Turret_Enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.cpp
528 lines (491 loc) · 12.2 KB
/
config.cpp
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
/*
Last edited 2019-02-03 by Erik Kofahl for TSOG
2019-02-03 - Adding CBA settings interface to turn off GUI + CBA XEH to init
2019-02-03 - Adding CBA Keybinds
2019-02-14 - Moving displayed coordinates so they fit in the RHS A-10 "TV" in 10 digit mode
2019-11-30 - Adding Azimuth and Elevation Indicators
2020-08-24 - Adding altitude command
*/
#include "dialogs\changeAltitude.h"
#include "dialogs\changeLoiter.h"
class CfgPatches
{
class UAV_Turret_Markers
{
units[] = {"Helicopter", "UAV"};
weapons[] = {};
requiredVersion = 1.8;
requiredAddons[] = {"A3_Data_F_Sams_LoadOrder","cba_main"};
version = "0.1";
author = "Fat_Lurch";
};
};
class Extended_PreInit_EventHandlers
{
class My_pre_init_event
{
init = "call compile preprocessFileLineNumbers 'Turret_Enhanced\XEH_preInit.sqf'";
};
};
class CfgFunctions
{
class fatLurch
{
class Lurch_Functions2
{
class MPaddaction
{
file = "Turret_Enhanced\functions\MPaddaction.sqf";
};
class North_Ind
{
file = "Turret_Enhanced\functions\North_Ind.sqf";
};
class isViewISR
{
file = "Turret_Enhanced\functions\isViewISR.sqf";
};
class addMarkerBlk
{
file = "Turret_Enhanced\functions\createMarkerBlack.sqf";
};
class addMarkerBlu
{
file = "Turret_Enhanced\functions\createMarkerBlue.sqf";
};
class addMarkerRed
{
file = "Turret_Enhanced\functions\createMarkerRed.sqf";
};
class turretAzEl
{
file = "Turret_Enhanced\functions\turretAzEl.sqf";
};
class hasOpticsIn
{
file = "Turret_Enhanced\functions\hasOpticsIn.sqf";
//Usage: [_player, _vehicle]call fatLurch_fnc_hasOpticsIn;
};
class changeAltitude
{
file = "Turret_Enhanced\functions\changeAltitude.sqf";
};
class altitudeDialogClose
{
file = "Turret_Enhanced\functions\altitudeDialogClose.sqf";
};
class blacklistGUI
{
file = "Turret_Enhanced\functions\blacklistGUI.sqf";
};
class getTurretIndex
{
file = "Turret_Enhanced\functions\getTurretIndex.sqf";
};
class mapSlew
{
file = "Turret_Enhanced\functions\mapSlew.sqf";
};
class inputGrid
{
file = "Turret_Enhanced\functions\inputGrid.sqf";
};
class measDistance
{
file = "Turret_Enhanced\functions\measDistance.sqf";
};
class getPylonAmmo
{
file = "Turret_Enhanced\functions\getPylonAmmo.sqf";
};
class weaponReport
{
file = "Turret_Enhanced\functions\weaponReport.sqf";
};
class resetUAV
{
file = "Turret_Enhanced\functions\resetUAV.sqf";
};
class changeLoiter
{
file = "Turret_Enhanced\functions\changeLoiter.sqf";
};
class loiterDialogClose
{
file = "Turret_Enhanced\functions\loiterDialogClose.sqf";
};
class getISRparams
{
file = "Turret_Enhanced\functions\getISRParams.sqf";
};
class H60check
{
file = "Turret_Enhanced\functions\h60check.sqf";
};
/*
class blacklistActions
{
file = "Turret_Enhanced\functions\blacklistActions.sqf";
};
*/
};
};
};
class Extended_Init_EventHandlers
{
class air;
class plane:air
{
class Fat_Lurch_plane_eh
{
init = "(_this select 0) spawn fatLurch_fnc_MPaddaction";
};
};
class Helicopter:air
{
class Fat_Lurch_Helicopter_eh
{
init = "(_this select 0) spawn fatLurch_fnc_MPaddaction";
};
};
};
class RscTitles
{
class North
{
idd = 710;
fadein = 0;
fadeout = 0;
duration = .1;
//onLoad = "_this call onRscLoad"; //UI event handler
//onLoad = "uiNameSpace setVariable ['myUI_LevelTitle', (_this select 0) displayCtrl 654];";
onLoad = "uiNameSpace setVariable ['myUI_LevelTitle', (_this select 0) displayCtrl 654];";
class controls
{
class ExampleControl
{
idc = 709;
type = 0; //Keep this (single line text)
style = 2; //-2 is center aligned text
x = "uiNamespace getVariable 'newPosition' select 0";
y = "uiNamespace getVariable 'newPosition' select 1";
w = 1;
h = 1;
font = "EtelkaNarrowMediumPro";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text = "N";
};
class ExampleControl654
{
idc = 654;
type = 0;
style = 0;
x = .845; //Was 0.9. Updated to fit in RHS A-10 display
y = .6;
w = 1;
h = 1;
font = "RobotoCondensedLight";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
//text = "uiNamespace getVariable 'newPosition' select 2";
text="";
};
};
};
class El
{
//Series of elevation controls relating to the vehicle turret. Controlled by CBA setting Fat_Lurch_ShowEl in CBA
idd = 709;
fadein = 0;
fadeout = 0;
duration = .1;
//onLoad = "_this call onRscLoad"; //UI event handler
//onLoad = "uiNameSpace setVariable ['myUI_LevelTitle', (_this select 0) displayCtrl 654];";
onLoad = "uiNameSpace setVariable ['guiEl', (_this select 0) displayCtrl 655];";
class controls
{
class elControl655
{
//Moving Elevation indicator
idc = 655;
type = 0;
style = ST_CENTER;
x = -0.1;
y = "uiNamespace getVariable 'guiElPos'"; //calculated in North_Ind.sqf
//y = 0;//0 = CL, - above CL, + below CL?
w = 1;
h = 1;
font = "RobotoCondensedLight";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text="";
};
class elevation
{
//Static Elevation scale image
idc = 660;
type = 0;
style=2096;
x = -0.32;
y = 0.35; //Updated from 0.25 to attempt to work better with USAF MQ-9
w = 0.7;
h = 0.55;
font = "RobotoCondensedLight";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text="Turret_Enhanced\images\Elevation.paa";
};
};
};
class Az
{
//Series of Azimuth controls relating to the vehicle turret. Controlled by CBA setting Fat_Lurch_ShowAz in CBA
idd = 708;
fadein = 0;
fadeout = 0;
duration = .1;
//onLoad = "_this call onRscLoad"; //UI event handler
//onLoad = "uiNameSpace setVariable ['myUI_LevelTitle', (_this select 0) displayCtrl 654];";
onLoad = "uiNameSpace setVariable ['guiAz', (_this select 0) displayCtrl 656]; uiNameSpace setVariable ['guiHdg', (_this select 0) displayCtrl 657];";
class controls
{
//Shit goes here
class azControl656
{
//Moving Az indicator for turret (-180 (Full left) to 180 (Full right)
idc = 656;
type = 0;
style = 2;
x = "uiNamespace getVariable 'guiAzPos'";
y = -0.46;//0 = CL, - above CL, + below CL?
w = 0.1;
h = 1;
font = "RobotoCondensedLight";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text="";
};
class headingControl657
{
//Current Vehicle Heading. Static, centered above compass
idc = 657;
type = 0;
style=162;
x = 0.46; //(0.5 = center - Width of control (0.08))
y = -0.09;//0 = CL, - above CL, + below CL?
w = 0.08;
h = 0.05;
font = "RobotoCondensedLight";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text="";
};
class compass
{
//Static Compass image
idc = 658;
type = 0;
style=2096;
x = 0.35;
y = -0.125;//0 = CL, - above CL, + below CL?
w = .3;
h = .2;
font = "RobotoCondensedLight";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text="Turret_Enhanced\images\Compass.paa";
};
class compassArrow
{
//Moving Compass arrow that follows the Az indicator
idc = 659;
type = 0;
style=2096;
x = "(uiNamespace getVariable 'guiAzPos')+0.0375";
y = -0.005;//0 = CL, - above CL, + below CL?
w = .025;
h = .025;
font = "RobotoCondensedLight";
sizeEx = 0.05;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
text="Turret_Enhanced\images\CompassArrow.paa";
};
};
};
};
class inputCoords
{
idd = 585;
fadein = 0;
fadeout = 0;
duration = 1e11;
//onUnload = "uiNamespace setVariable [""someDialog"", nil];";
onUnload = "uiNamespace setVariable [""coordReturn"", (_this select 1)];";
class controls
{
class RscText
{
idc = 1000;
type=0;
style=16;
text = "Input Target Grid"; //--- ToDo: Localize;
x = 0.446146 * safezoneW + safezoneX;
y = 0.649667 * safezoneH + safezoneY;
w = 0.0670312 * safezoneW;
h = 0.022 * safezoneH;
font = "PuristaMedium";
lineSpacing=1;
sizeEx = 0.03;
colorSelection[] = {-1,-1,-1,-1};
colorText[] = {1,1,1,1};
colorDisabled[] = {-1,-1,-1,-1};
colorBackground[] = {0,0,0,0.7};
};
class RscEdit
{
idc = 1400;
maxChars=10;
//forceDrawCaret = true;
type = 2;
style=16;
x = 0.446374 * safezoneW + safezoneX;
y = 0.676 * safezoneH + safezoneY;
w = 0.0670312 * safezoneW;
h = 0.022 * safezoneH;
font = "PuristaMedium";
autoComplete="";
sizeEx = 0.03;
colorSelection[] = {-1,-1,-1,-1};
colorText[] = {1,1,1,1};
colorDisabled[] = {-1,-1,-1,-1};
colorBackground[] = {0,0,0,0.7};
text="";
};
class RscButton
{
idc = 1600;
type=1;
style=16;
action="closeDialog 1;_ctrl=(findDisplay 585) displayCtrl 1400;coords = ctrlText _ctrl;_ctrl ctrlSetText '';";
text = "ENTER"; //--- ToDo: Localize;
x = 0.517532 * safezoneW + safezoneX;
y = 0.6496 * safezoneH + safezoneY;
w = 0.0309375 * safezoneW;
h = 0.044 * safezoneH;
font = "PuristaMedium";
sizeEx = 0.03;
colorSelection[] = {-1,-1,-1,-1};
colorText[] = {1,1,1,1};
colorDisabled[] = {-1,-1,-1,-1};
colorBackground[] = {0,0,0,0.7};
soundEnter[] = {"",0.1,1};
soundPush[] = {"",0.1,1};
soundClick[] = {"",0.1,1};
soundEscape[] = {"",0.1,1};
colorBackgroundDisabled[] = {0.6,0.6,0.6,1};
colorBackgroundActive[] = {1,0.5,0,1};
colorFocused[] = {0,0,0,1};
colorShadow[] = {0,0,0,1};
offsetX = 0.004;
offsetY = 0.004;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
borderSize = 0.008;
colorBorder[] = {0,0,0,1};
tooltip="Enter on numpad to commit. Escape key to cancel";
};
};
};
/*
class changeAltitude
{
idd = 586;
fadein = 0;
fadeout = 0;
duration = 1e11;
onUnload = "uiNamespace setVariable [""coordReturn"", (_this select 1)];"; //TODO
class controls
{
class RscText
{
idc = 1000;
type=0;
style=16;
text = "Input New Altitude (Meters)"; //--- ToDo: Localize;
x = 0.446146 * safezoneW + safezoneX;
y = 0.649667 * safezoneH + safezoneY;
w = 0.0670312 * safezoneW;
h = 0.022 * safezoneH;
font = "PuristaMedium";
lineSpacing=1;
sizeEx = 0.03;
colorSelection[] = {-1,-1,-1,-1};
colorText[] = {1,1,1,1};
colorDisabled[] = {-1,-1,-1,-1};
colorBackground[] = {0,0,0,0.7};
};
class RscEdit
{
idc = 1400;
maxChars=10;
//forceDrawCaret = true;
type = 2;
style=16;
x = 0.446374 * safezoneW + safezoneX;
y = 0.676 * safezoneH + safezoneY;
w = 0.0670312 * safezoneW;
h = 0.022 * safezoneH;
font = "PuristaMedium";
autoComplete="";
sizeEx = 0.03;
colorSelection[] = {-1,-1,-1,-1};
colorText[] = {1,1,1,1};
colorDisabled[] = {-1,-1,-1,-1};
colorBackground[] = {0,0,0,0.7};
text="";
};
class RscButton
{
idc = 1600;
type=1;
style=16;
action="closeDialog 1;_ctrl=(findDisplay 586) displayCtrl 1400;coords = ctrlText _ctrl;_ctrl ctrlSetText '';"; //TODO
text = "ENTER"; //--- ToDo: Localize;
x = 0.517532 * safezoneW + safezoneX;
y = 0.6496 * safezoneH + safezoneY;
w = 0.0309375 * safezoneW;
h = 0.044 * safezoneH;
font = "PuristaMedium";
sizeEx = 0.03;
colorSelection[] = {-1,-1,-1,-1};
colorText[] = {1,1,1,1};
colorDisabled[] = {-1,-1,-1,-1};
colorBackground[] = {0,0,0,0.7};
soundEnter[] = {"",0.1,1};
soundPush[] = {"",0.1,1};
soundClick[] = {"",0.1,1};
soundEscape[] = {"",0.1,1};
colorBackgroundDisabled[] = {0.6,0.6,0.6,1};
colorBackgroundActive[] = {1,0.5,0,1};
colorFocused[] = {0,0,0,1};
colorShadow[] = {0,0,0,1};
offsetX = 0.004;
offsetY = 0.004;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
borderSize = 0.008;
colorBorder[] = {0,0,0,1};
tooltip="Enter on numpad to commit. Escape key to cancel";
};
};
};
*/