-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathM9SD_fnc_initAIOArsenal_module.SQF
559 lines (559 loc) · 22.4 KB
/
M9SD_fnc_initAIOArsenal_module.SQF
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
comment
"
AIO Arsenal Init Script
Branch: Official Zeus Compatible (Module)
Usage: Place this composition on top of
an object in the zeus interface. It will
add the arsenal actions to that object.
";
comment "Run from zeus interface!";
deleteVehicle this;
M9SD_fnc_initAIOArsenal_module =
{
M9SD_fnc_errorMessage_AIOArsenal =
{
params [['_message', '']];
playSound ['addItemFailed', false];
private _header = 'AIO Arsenal';
private _showOkBtn = true;
private _showCnclBtn = false;
private _parentDisplay = if (isNull findDisplay 312) then {if (isNull findDisplay 49) then {findDisplay 46} else {findDisplay 49}} else {findDisplay 312};
private _useParentBox = true;
private _pauseGame = false;
private _fullMessage = format ["<t align='center'>Error:<br/><br/>%1<t/>", _message];
[_fullMessage, _header, _showOkBtn, _showCnclBtn, _parentDisplay, _useParentBox, _pauseGame] spawn BIS_fnc_guiMessage;
};
if (isNull findDisplay 312) exitWith
{
0 = ['Must be ran from display 312 (zeus interface)'] spawn M9SD_fnc_errorMessage_AIOArsenal;
};
private _zeusLogic = objNull;
_zeusLogic = getAssignedCuratorLogic player;
if (isNull _zeusLogic) exitWith {0 = ['No zeus logic found / assigned to player'] spawn M9SD_fnc_errorMessage_AIOArsenal;};
private _targetObjArray = curatorMouseOver;
if ((_targetObjArray isEqualTo []) or (_targetObjArray isEqualTo [''])) exitWith {0 = ['No object was detected.<br/>(curatorMouseOver array is empty)<br/><br/>Make sure you place the module<br/>on top of an editable object.<br/> '] spawn M9SD_fnc_errorMessage_AIOArsenal;};
private _targetObj = objNull;
_targetObj = _targetObjArray select 1;
if (isNull _targetObj) exitWith {0 = ['No object found (target object is null)'] spawn M9SD_fnc_errorMessage_AIOArsenal;};
["AmmoboxInit",[_targetObj,true]] call BIS_fnc_arsenal;
M9SD_fnc_addSmallArsenalActions =
{
params [['_supplyCrate', objNull]];
if (isNull _supplyCrate) exitWith {0 = ['null supply crate'] spawn M9SD_fnc_errorMessage_AIOArsenal;};
if (_supplyCrate getVariable ['M9SD_hasArsenalActions', false]) exitWith {0 = ['Object already has AIO Arsenal actions enabled.'] spawn M9SD_fnc_errorMessage_AIOArsenal;};
_supplyCrate setVariable ['M9SD_hasArsenalActions', true, true];
if (isNil 'M9SD_AIOArsenal_JIPCount') then
{
M9SD_AIOArsenal_JIPCount = 0;
};
M9SD_AIOArsenal_JIPCount = M9SD_AIOArsenal_JIPCount + 1;
publicVariable 'M9SD_AIOArsenal_JIPCount';
private _uniqueJIP = format ['M9SD_JIP_AIOArsenalActions_%1', M9SD_AIOArsenal_JIPCount];
[[_supplyCrate, _uniqueJIP],
{
if (!hasInterface) exitWith {};
params [['_supplyCrate', objNull], ['_uniqueJIP', '']];
if (isNull _supplyCrate) exitWith {remoteExec ['', _uniqueJIP]};
_supplyCrate addAction
[
"<t color='#FFFFFF' size='1.4'><img image='a3\ui_f\data\logos\a_64_ca.paa'></img><t color='#ffd700' size='1.4' font='puristaBold'> Full Arsenal</t>",
{
playSound ['beep_target', true];
playSound ['beep_target', false];
['Preload'] call BIS_fnc_arsenal;
comment "['Open', [true]] call BIS_fnc_arsenal; <-- WTF IS THE DIFFERENCE?";
['Open', true] spawn BIS_fnc_arsenal;
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification1' cutText ["<br/><t color='#ffd700' size='2.1' shadow='2' font='puristaMedium'>AIO Arsenal</t>", "PLAIN DOWN", -1, true, true];
uiSleep 1;
if !(isNull findDisplay -1) then
{
'arsenalNotification2' cutFadeOut 0;
'arsenalNotification2' cutText ["<br/><br/><br/><t color='#00a6ff' size='1.4' shadow='2' font='puristaSemiBold'>by <t color='#00c9ff'>M9-SD</t>", "PLAIN DOWN", -1, true, true];
};
uiSleep 7;
'arsenalNotification1' cutFadeOut 2.1;
'arsenalNotification2' cutFadeOut 2.1;
};
private _arsenalAnims =
[
{player playActionNow "Salute";},
{[player, 'acts_civilidle_1'] remoteExec ['switchMove'];},
{[player, 'acts_civilListening_2'] remoteExec ['switchMove'];},
{[player, 'acts_commenting_on_fight_loop'] remoteExec ['switchMove'];},
{[player, 'acts_gallery_visitor_01'] remoteExec ['switchMove'];},
{[player, 'acts_gallery_visitor_02'] remoteExec ['switchMove'];},
{[player, 'acts_hilltop_calibration_loop'] remoteExec ['switchMove'];},
{[player, 'acts_kore_talkingoverradio_loop'] remoteExec ['switchMove'];},
{[player, 'acts_staticPose_photo'] remoteExec ['switchMove'];},
{player playActionNow 'gear';},
{[player, 'Acts_Taking_Cover_From_Jets'] remoteExec ['switchMove'];},
{[player, 'Acts_standingSpeakingUnarmed'] remoteExec ['switchMove'];},
{player playMoveNow 'acts_Mentor_Freeing_Player';},
{[player, 'acts_kore_talkingOverRadio_In'] remoteExec ['switchMove'];},
{[player, 'acts_kore_idleNoWeapon_In'] remoteExec ['switchMove'];},
{[player, 'Acts_JetsOfficerSpilling'] remoteExec ['switchMove'];},
{player playMoveNow 'Acts_Hilltop_Calibration_Pointing_Left';},
{player playMoveNow 'Acts_Hilltop_Calibration_Pointing_Right';},
{[player, 'Acts_Grieving'] remoteExec ['switchMove'];}
];
private _arsenalAnimsAdd = switch (currentWeapon player) do
{
case '': {[]};
case (primaryWeapon player):
{
[
{[player, 'acts_briefing_SA_loop'] remoteExec ['switchMove'];},
{[player, 'acts_getAttention_loop'] remoteExec ['switchMove'];},
{[player, 'acts_millerIdle'] remoteExec ['switchMove'];},
{player playMoveNow 'Acts_SupportTeam_Right_ToKneelLoop';},
{player playMoveNow 'Acts_SupportTeam_Left_ToKneelLoop';},
{player playMoveNow 'Acts_SupportTeam_Front_ToKneelLoop';},
{player playMoveNow 'Acts_SupportTeam_Back_ToKneelLoop';},
{[player, 'Acts_starGazer'] remoteExec ['switchMove'];},
{player playMoveNow 'acts_RU_briefing_Turn';},
{player playMoveNow 'acts_RU_briefing_point';},
{player playMoveNow 'acts_RU_briefing_point_tl';},
{player playMoveNow 'acts_RU_briefing_move';},
{[player, 'acts_rifle_operations_zeroing'] remoteExec ['switchMove'];},
{player playMoveNow 'acts_rifle_operations_right';},
{player playMoveNow 'acts_rifle_operations_left';},
{player playMoveNow 'acts_rifle_operations_front';},
{player playMoveNow 'acts_rifle_operations_checking_chamber';},
{player playMoveNow 'acts_rifle_operations_barrel';},
{player playMoveNow 'acts_rifle_operations_back';},
{player playMoveNow 'acts_pointing_up';},
{player playMoveNow 'acts_pointing_down';},
{player playMoveNow 'acts_peering_up';},
{player playMoveNow 'acts_peering_down';},
{player playMoveNow 'acts_peering_front';},
{[player, 'Acts_Helping_Wake_Up_1'] remoteExec ['switchMove'];}
]
};
case (handgunWeapon player):
{
[
{[player, 'acts_examining_device_player'] remoteExec ['switchMove'];},
{[player, 'acts_executioner_standingloop'] remoteExec ['switchMove'];},
{player playMoveNow 'Acts_ViperMeeting_A_End';},
{player playMoveNow 'Acts_UGV_Jamming_Loop';},
{player playMoveNow 'Acts_starterPistol_Fire';}
]
};
default {[]};
};
_arsenalAnims = _arsenalAnims + _arsenalAnimsAdd;
private _playAnim = selectRandom _arsenalAnims;
call _playAnim;
if !(isNil "M9SD_EH_ResetPlayerAnimsOnArsenalClosed") then
{
(findDisplay 46) displayRemoveEventHandler ['keyDown', M9SD_EH_ResetPlayerAnimsOnArsenalClosed];
};
M9SD_EH_ResetPlayerAnimsOnArsenalClosed = (findDisplay 46) displayAddEventHandler ['keyDown',
{
params ["_displayOrControl", "_key", "_shift", "_ctrl", "_alt"];
private _w = 17;
private _a = 30;
private _s = 31;
private _d = 32;
private _keys = [_w, _a, _s, _d];
if (_key in _keys) then
{
comment
"
playSound ['addItemOK', true];
playSound ['addItemOK', false];
";
if !(isNil "M9SD_EH_ResetPlayerAnimsOnArsenalClosed") then
{
(findDisplay 46) displayRemoveEventHandler ['keyDown', M9SD_EH_ResetPlayerAnimsOnArsenalClosed];
};
player enableSimulation true;
player playActionNow '';
player playMoveNow '';
player switchMove '';
if (isMultiplayer) then {[player, ''] remoteExec ['switchMove']};
'arsenalNotification1' cutFadeOut 0;
'arsenalNotification2' cutFadeOut 0;
comment
"
playSound ['hintCollapse', true];
playSound ['hintCollapse', false];
";
};
}];
playSound ['hintExpand', true];
playSound ['hintExpand', false];
}, nil, 7777, true, true, "", "(_this == vehicle _this)", 7
];
_supplyCrate addAction
[
"<t color='#FFFFFF' size='1.4'><img image='\A3\ui_f\data\map\diary\icons\taskCustom_ca.paa'></img><t color='#ffd700' size='1.4' font='puristaBold'> Copy Loadout</t>",
{
playSound ['beep_target', true];
playSound ['beep_target', false];
player playmovenow 'AinvPknlMstpSnonWnonDnon_1';
private _nearMen = nearestObjects [player, ['Man'], 21];
if ((count _nearMen) <= 1) exitWith
{
playSound ['AddItemFailed', true];
playSound ['AddItemFailed', false];
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification8' cutFadeOut 0;
'arsenalNotification8' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>ERROR:<br/>No unit is close enough.</t>", "PLAIN DOWN", -1, true, true];
uiSleep 3.5;
'arsenalNotification8' cutFadeOut 0.35;
};
};
private _nearestMan = _nearMen # 1;
private _loadout = getUnitLoadout _nearestMan;
player setUnitLoadout _loadout;
private _unitName = name _nearestMan;
private _notifText = format ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>Nearest unit’s loadout copied:<br/><br/><t color='#FFFFFF' font='puristaSemiBold'>“%1”</t>", _unitName];
0 = _notifText spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification8' cutFadeOut 0;
'arsenalNotification8' cutText [_this, "PLAIN DOWN", -1, true, true];
uiSleep 3.5;
'arsenalNotification8' cutFadeOut 0.35;
};
playSound ['hintExpand', true];
playSound ['hintExpand', false];
}, nil, 7777, true, true, "", "(_this == vehicle _this)", 7
];
_supplyCrate addAction
[
"<t color='#FFFFFF' size='1.4'><img image='a3\ui_f\data\igui\cfg\actions\obsolete\ui_action_gear_ca.paa'></img><t color='#ffd700' size='1.4' font='puristaBold'> Empty Loadout</t>",
{
playSound ['beep_target', true];
playSound ['beep_target', false];
player playmovenow 'AinvPknlMstpSnonWnonDnon_1';
removeAllWeapons player;
removeAllItems player;
removeAllAssignedItems player;
removeUniform player;
removeVest player;
removeBackpack player;
removeHeadgear player;
removeGoggles player;
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification4' cutFadeOut 0;
'arsenalNotification4' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>Loadout removed.</t>", "PLAIN DOWN", -1, true, true];
uiSleep 3.5;
'arsenalNotification4' cutFadeOut 0.35;
};
playSound ['hintExpand', true];
playSound ['hintExpand', false];
}, nil, 7777, true, true, "", "(_this == vehicle _this)", 7
];
_supplyCrate addAction
[
"<t color='#FFFFFF' size='1.4'><img image='a3\3den\data\displays\Display3DEN\ToolBar\save_ca.paa'></img><t color='#ffd700' size='1.4' font='puristaBold'> Save Respawn Loadout</t>",
{
playSound ['beep_target', true];
playSound ['beep_target', false];
player playActionNow 'putdown';
[player, [missionnamespace, "M9SD_arsenalRespawnLoadout"]] call BIS_fnc_saveInventory;
if (!isNil "M9SD_EH_arsenalRespawnLoadout") then
{
player removeEventHandler ["Respawn", M9SD_EH_arsenalRespawnLoadout];
};
M9SD_EH_arsenalRespawnLoadout = player addEventHandler
[
"Respawn",
{
0 = [] spawn
{
waitUntil {(alive player)};
sleep 0.07;
[player, [missionnamespace, "M9SD_arsenalRespawnLoadout"]] call BIS_fnc_loadInventory;
};
}
];
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification6' cutFadeOut 0;
'arsenalNotification6' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>Respawn loadout set.</t>", "PLAIN DOWN", -1, true, true];
uiSleep 3.5;
'arsenalNotification6' cutFadeOut 0.35;
};
playSound ['hintExpand', true];
playSound ['hintExpand', false];
}, nil, 7777, true, true, "", "(_this == vehicle _this)", 7
];
_supplyCrate addAction
[
"<t color='#FFFFFF' size='1.4'><img image='a3\3den\data\displays\Display3DEN\ToolBar\open_ca.paa'></img><t color='#ffd700' size='1.4' font='puristaBold'> Load Respawn Loadout</t>",
{
playSound ['beep_target', true];
playSound ['beep_target', false];
player playActionNow 'putdown';
if (isNil 'M9SD_EH_arsenalRespawnLoadout') then
{
playSound ['AddItemFailed', true];
playSound ['AddItemFailed', false];
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification12' cutFadeOut 0;
'arsenalNotification12' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>ERROR:<br/>No respawn loadout saved.</t>", "PLAIN DOWN", -1, true, true];
uiSleep 3.5;
'arsenalNotification12' cutFadeOut 0.35;
};
} else
{
[player, [missionnamespace, "M9SD_arsenalRespawnLoadout"]] call BIS_fnc_loadInventory;
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification12' cutFadeOut 0;
'arsenalNotification12' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>Respawn loadout applied.</t>", "PLAIN DOWN", -1, true, true];
uiSleep 3.5;
'arsenalNotification12' cutFadeOut 0.35;
};
playSound ['hintExpand', true];
playSound ['hintExpand', false];
};
}, nil, 7777, true, true, "", "(_this == vehicle _this)", 7
];
_supplyCrate addAction
[
"<t color='#FFFFFF' size='1.4'><img image='\a3\3den\data\Cfg3DEN\History\deleteItems_ca.paa'></img><t color='#ffd700' size='1.4' font='puristaBold'> Delete Respawn Loadout</t>",
{
playSound ['beep_target', true];
playSound ['beep_target', false];
player playActionNow 'putdown';
if (!isNil "M9SD_EH_arsenalRespawnLoadout") then
{
player removeEventHandler ["Respawn", M9SD_EH_arsenalRespawnLoadout];
};
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification5' cutFadeOut 0;
'arsenalNotification5' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>Respawn loadout disabled.</t>", "PLAIN DOWN", -1, true, true];
uiSleep 3.5;
'arsenalNotification5' cutFadeOut 0.35;
};
playSound ['hintExpand', true];
playSound ['hintExpand', false];
}, nil, 7777, true, true, "", "(_this == vehicle _this)", 7
];
_supplyCrate addAction
[
"<t color='#FFFFFF' size='1.4'><img image='\A3\ui_f\data\IGUI\Cfg\simpleTasks\types\heal_ca.paa'></img><t color='#ffd700' size='1.4' font='puristaBold'> Heal</t>",
{
playSound ['beep_target', true];
playSound ['beep_target', false];
player playActionNow 'Medic';
[player] call BIS_fnc_reviveEhRespawn;
player setDamage 0;
player setUnconscious false;
player setCaptive false;
0 = [] spawn
{
for '_i' from 1 to 12 do
{
(format ['arsenalNotification%1', _i]) cutFadeOut 0;
};
'arsenalNotification3' cutFadeOut 0;
'arsenalNotification3' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>Healing...</t>", "PLAIN DOWN", -1, true, true];
uiSleep 6.33;
playSound ['hintCollapse', true];
playSound ['hintCollapse', false];
'arsenalNotification3' cutFadeOut 0;
'arsenalNotification3' cutText ["<t color='#ffd700' font='puristaMedium' shadow='2' size='1.4'>Healed.</t>", "PLAIN DOWN", -1, true, true];
uiSleep 3.33;
'arsenalNotification3' cutFadeOut 0.35;
};
playSound ['hintExpand', true];
playSound ['hintExpand', false];
}, nil, 7777, true, true, "", "(_this == vehicle _this)", 7
];
}] remoteExec ['spawn', 0, _uniqueJIP];
};
[_targetObj] call M9SD_fnc_addSmallArsenalActions;
M9SD_fnc_smallArsenalMarkers =
{
params [['_supplyCrate', objNull]];
if (isNull _supplyCrate) exitWith {0 = ['null supply crate'] spawn M9SD_fnc_errorMessage_AIOArsenal;};
if (_supplyCrate getVariable ['M9SD_hasMarkers', false]) exitWith {0 = ['Object already has AIO Arsenal markers enabled.'] spawn M9SD_fnc_errorMessage_AIOArsenal;};
_supplyCrate setVariable ['M9SD_hasMarkers', true, true];
if (isNil 'M9SD_smallArsenals') then
{
M9SD_smallArsenals = [];
};
M9SD_smallArsenals pushBackUnique _supplyCrate;
publicVariable 'M9SD_smallArsenals';
[M9SD_smallArsenals,
{
if (!hasInterface) exitWith {};
waitUntil { !isNil { player } && { !isNull player } };
waitUntil { !isNull (findDisplay 46) };
if (isNil 'M9SD_smallArsenals') then
{
M9SD_smallArsenals = _this;
};
M9SD_smallArsenalIcons_texture = '\a3\3den\data\displays\display3den\entitymenu\arsenal_ca.paa';
M9SD_smallArsenalIcons_width = 0.7;
M9SD_smallArsenalIcons_height = 0.7;
M9SD_smallArsenalIcons_angle = 0;
M9SD_smallArsenalIcons_text = 'Virtual Arsenal';
M9SD_smallArsenalIcons_shadow = 2;
M9SD_smallArsenalIcons_textSize = 0.04;
M9SD_smallArsenalIcons_font = 'PuristaSemiBold';
M9SD_smallArsenalIcons_textAlign = 'center';
M9SD_smallArsenalIcons_drawSideArrows = false;
M9SD_smallArsenalIcons_offsetX = 0;
M9SD_smallArsenalIcons_offsetY = -0.07;
M9SD_smallArsenalIcons_offset = 2.1;
if (not (isNil 'M9SD_EH_drawSmallArsenal3D')) then
{
removeMissionEventHandler ['Draw3D', M9SD_EH_drawSmallArsenal3D];
};
M9SD_EH_drawSmallArsenal3D = addMissionEventHandler ['Draw3D',
{
if (count M9SD_smallArsenals == 0) exitWith {};
{
if (!isNull _x) then
{
if (_x in [cursorTarget, cursorObject]) then
{
if ((_x distance (vehicle player)) <= 28) then
{
private _position = getPos _x;
_position set [2, (_position # 2) + M9SD_smallArsenalIcons_offset];
drawIcon3D
[
M9SD_smallArsenalIcons_texture,
[1,1,1,1],
_position,
M9SD_smallArsenalIcons_width,
M9SD_smallArsenalIcons_height,
M9SD_smallArsenalIcons_angle,
'',
M9SD_smallArsenalIcons_shadow,
M9SD_smallArsenalIcons_textSize,
M9SD_smallArsenalIcons_font,
M9SD_smallArsenalIcons_textAlign,
M9SD_smallArsenalIcons_drawSideArrows,
M9SD_smallArsenalIcons_offsetX,
M9SD_smallArsenalIcons_offsetY
];
drawIcon3D
[
'',
[1,0.9,0,1],
_position,
M9SD_smallArsenalIcons_width,
M9SD_smallArsenalIcons_height,
M9SD_smallArsenalIcons_angle,
M9SD_smallArsenalIcons_text,
M9SD_smallArsenalIcons_shadow,
M9SD_smallArsenalIcons_textSize,
M9SD_smallArsenalIcons_font,
M9SD_smallArsenalIcons_textAlign,
M9SD_smallArsenalIcons_drawSideArrows,
M9SD_smallArsenalIcons_offsetX,
M9SD_smallArsenalIcons_offsetY
];
};
};
};
} forEach M9SD_smallArsenals;
}];
waitUntil {!isNull (findDisplay 12 displayCtrl 51)};
if (!isNil "M9SD_EH_drawSmallArsenal2D") then
{
(findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", M9SD_EH_drawSmallArsenal2D];
};
M9SD_EH_drawSmallArsenal2D = (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",
{
if (count M9SD_smallArsenals == 0) exitWith {};
{
if (!isNull _x) then
{
private _iconPath = 'a3\ui_f\data\logos\a_64_ca.paa';
private _pos = _x modelToWorldVisual [0,0,0];
private _color = [1, 0.9, 0, 1];
_iconText = if ((((_this select 0) ctrlMapWorldToScreen (_x modelToWorldVisual [0,0,0])) distance2D getMousePosition) > 0.02) then {""} else {'Virtual Arsenal'};
_this select 0 drawIcon
[
_iconPath,
_color,
_pos,
20,
20,
0,
_iconText,
1,
0.05,
"PuristaBold",
"left"
];
_color = [1,1,1,1];
_this select 0 drawIcon
[
_iconPath,
_color,
_pos,
20,
20,
0,
'',
1,
0.05,
"PuristaSemiBold",
"left"
];
};
} foreach M9SD_smallArsenals;
}];
}] remoteExec ['spawn', 0, 'M9SD_JIP_smallArsenalIcons'];
comment "
M9SD_smallArsenals = [];
publicVariable 'M9SD_smallArsenals';
remoteExec ['', 'M9SD_JIP_smallArsenalIcons'];
";
};
[_targetObj] call M9SD_fnc_smallArsenalMarkers;
private _objType = typeOf _targetObj;
private _objName = if (isPlayer _targetObj) then {name _targetObj} else {getText (configFile >> 'cfgVehicles' >> _objType >> 'displayName')};
if (_objName == '') then {_objName = _objType;};
private _feebackMsg = format ["AIO Arsenal applied to %1", _objName];
[_zeusLogic, _feebackMsg] call BIS_fnc_showCuratorFeedbackMessage;
playSound ['addItemOk', false];
};
call M9SD_fnc_initAIOArsenal_module;