-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepomix-output.txt
932 lines (819 loc) · 29.3 KB
/
repomix-output.txt
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
This file is a merged representation of the entire codebase, combining all repository files into a single document.
Generated by Repomix on: 2025-01-15T17:17:58.121Z
================================================================
File Summary
================================================================
Purpose:
--------
This file contains a packed representation of the entire repository's contents.
It is designed to be easily consumable by AI systems for analysis, code review,
or other automated processes.
File Format:
------------
The content is organized as follows:
1. This summary section
2. Repository information
3. Directory structure
4. Multiple file entries, each consisting of:
a. A separator line (================)
b. The file path (File: path/to/file)
c. Another separator line
d. The full contents of the file
e. A blank line
Usage Guidelines:
-----------------
- This file should be treated as read-only. Any changes should be made to the
original repository files, not this packed version.
- When processing this file, use the file path to distinguish
between different files in the repository.
- Be aware that this file may contain sensitive information. Handle it with
the same level of security as you would the original repository.
Notes:
------
- Some files may have been excluded based on .gitignore rules and Repomix's
configuration.
- Binary files are not included in this packed representation. Please refer to
the Repository Structure section for a complete list of file paths, including
binary files.
Additional Info:
----------------
================================================================
Directory Structure
================================================================
description.ext
functions/medical/fn_addDeathHandler.sqf
functions/medical/fn_addLoadAction.sqf
functions/medical/fn_addLoadBodyAction.sqf
functions/medical/fn_addReviveAction.sqf
functions/medical/fn_addUnitTraumaStatus.sqf
functions/medical/fn_addUnloadBodyAction.sqf
functions/medical/fn_checkUnitTraumaStatus.sqf
functions/medical/fn_handleUnitDeath.sqf
functions/medical/fn_initMedicalSystems.sqf
functions/medical/fn_loadCasualtyAction.sqf
functions/medical/fn_startSurgeryAmbientAnim.sqf
initPlatoonGroups.sqf
ui/controls.hpp
ui/dialogs/artillery_dialog.hpp
================================================================
Files
================================================================
================
File: description.ext
================
// Import base UI classes
#include "\a3\ui_f\hpp\defineCommonGrids.inc"
#include "\a3\ui_f\hpp\defineCommonColors.inc"
#include "\a3\ui_f\hpp\defineCommonGrids.inc"
#include "\a3\ui_f\hpp\defineCommonColors.inc"
#include "ui\dialogs\artillery_dialog.hpp"
class CfgConstants
{
// General Mission Settings
class DPCS_CONFIG {
MISSION_NAME = "DPCS: Dynamic Platoon Command System";
MISSION_AUTHOR = "Dylan Britz";
ENABLED = 1; // Enable the DPCS system
DEBUG = 1; // Enable debug mode
DPCS_MEDICAL = 1; // Enable the medical system
DPCS_FIRE_SUPPORT = 1; // Enable the fire support system
DPCS_SUPPLY = 1; // Enable the supply system
DPCS_TRANSPORT = 1; // Enable the transport system
}
// Resupply unit constants
class SupplyPool {
TRACKED_VEHICLE_POOL = 1;
MRAP_VEHICLE_POOL = 15;
HMG_VEHICLE_POOL = 10;
GMG_VEHICLE_POOL = 7;
QUAD_POOL = 20;
AMMO_TRUCK_POOL = 25;
MED_TRUCK_POOL = 5;
REPAIR_TRUCK_POOL = 5;
FUEL_TRUCK_POOL = 12;
HMG_TURRET_POOL = 55;
GMG_TURRET_POOL = 25;
AT_TURRET_POOL = 15;
MORTAR_TURRET_POOL = 15;
};
};
class CfgFunctions
{
class DPC
{
tag = "DPC";
class Medical
{
file = "functions\medical";
class addDeathHandler {};
class addLoadAction {};
class addLoadBodyAction {};
class addReviveAction {};
class addUnitTraumaStatus {};
class addUnloadBodyAction {};
class checkUnitTraumaStatus {};
class handleUnitDeath {};
class initMedicalSystems {
postInit = 1;
};
class loadCasualtyAction {};
class startSurgeryAmbientAnim {};
};
// class FireSupport
// {
// file = "functions\fire_support";
// class initArtillerySystem {
// postInit = 1;
// };
// class openArtilleryMenu {};
// class updateArtilleryAmmoUI {};
// class getArtilleryAmmo {};
// class onAmmoSelect {};
// class openMapForTarget {};
// };
};
};
================
File: functions/medical/fn_addDeathHandler.sqf
================
// Add death handlers to all existing units on the players side
private _eligibleUnits = allUnits select {
private _isValidUnit =
alive _x &&
{!isPlayer _x} &&
{side _x == playerSide} &&
{!(_x getVariable ["DPC_SYSMED_EXCLUDE", false])} &&
{isNil {_x getVariable "DPC_SYSMED_TRAUMA_HANDLER"}};
if (!_isValidUnit) then {
diag_log format ["[DPC: SYSMED] Warning: Invalid unit found: %1", _x];
};
_isValidUnit
};
{
private _handlerId = _x addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage"];
if (_damage >= 0.9) then {
[_unit] call DPC_fnc_handleUnitDeath;
};
}];
_x setVariable ["DPC_SYSMED_TRAUMA_HANDLER", _handlerId];
} forEach _eligibleUnits;
================
File: functions/medical/fn_addLoadAction.sqf
================
// Add load actions to appropriate vehicles
{
if (_x isKindOf "Car" || _x isKindOf "Tank" || _x isKindOf "Air") then {
[_x] call DPC_fnc_addLoadBodyAction;
};
} forEach vehicles;
================
File: functions/medical/fn_addLoadBodyAction.sqf
================
// File: functions\medical\fn_addLoadBodyAction.sqf
params ["_vehicle"];
private _conditionStr = "
private _nearbyUnits = nearestObjects [_target, ['Man'], DPCS_SYSMED_MAX_CASEVAC_DISTANCE];
private _loadableCasualties = count (_nearbyUnits select {
_x in DPCS_SYSMED_TRAUMA_UNITS &&
!(_x in (crew _target)) &&
isNil {_x getVariable 'DPCS_SYSMED_REVIVE_PROGRESS'}
}) > 0;
_loadableCasualties && {_target emptyPositions 'cargo' > 0}
";
_vehicle addAction [
"Load Casualty",
DPC_fnc_loadCasualtyAction,
nil,
1.5,
true,
true,
"",
_conditionStr
];
================
File: functions/medical/fn_addReviveAction.sqf
================
// File: functions\medical\fn_addReviveAction.sqf
params ["_building"];
_building addAction [
"Begin Medical Treatment",
{
params ["_building", "_caller", "_actionId"];
// Count current treatments
private _currentTreatments = count ((nearestObjects [_building, ["Man"], DPCS_SYSMED_MAX_REVIVE_DISTANCE]) select {
!isNil {_x getVariable "DPCS_SYSMED_REVIVE_PROGRESS"}
});
// Get all dead units near building not already being treated
private _nearbyDead = (nearestObjects [_building, ["Man"], DPCS_SYSMED_MAX_REVIVE_DISTANCE]) select {
_x in (DPCS_SYSMED_TRAUMA_UNITS) &&
isNil {_x getVariable "DPCS_SYSMED_REVIVE_PROGRESS"}
};
// Calculate how many more we can treat
private _availableSlots = DPCS_SYSMED_MAX_MEDICAL_FACILITY_CAPACITY - _currentTreatments;
if (_availableSlots <= 0) exitWith {
systemChat format ["Medical facility at maximum capacity (%1 patients)", DPCS_SYSMED_MAX_MEDICAL_FACILITY_CAPACITY];
};
if (count _nearbyDead > 0) then {
// Limit number of new treatments to available slots
private _unitsToTreat = _nearbyDead select [0, _availableSlots];
// Start revival process for each dead unit
{
private _deadUnit = _x;
// Start revival process and pass the needed variables
[_deadUnit, _building] spawn {
params ["_unit", "_building"];
private _startTime = time;
// Create progress tracking variable
_unit hideObject true;
_unit enableSimulation false;
_unit setVariable ["DPCS_SYSMED_REVIVE_PROGRESS", 0, true];
// Progress loop
while {time - _startTime < DPCS_SYSMED_REVIVE_TIME} do {
// Update progress
private _progress = ((time - _startTime) / DPCS_SYSMED_REVIVE_TIME) * 100;
_unit setVariable ["DPCS_SYSMED_REVIVE_PROGRESS", _progress, true];
// Display progress for each unit
systemChat format ["%1 Treatment Progress: %2%3", name _unit, floor _progress, "%"];
sleep 5; // Update every 5 seconds
};
DPCS_SYSMED_TRAUMA_UNITS = DPCS_SYSMED_TRAUMA_UNITS - [_unit];
_unit setDamage 0;
_unit setUnconscious false;
_unit allowDamage true;
_unit switchMove ""; // Reset animation
_unit enableAI "ALL"; // Re-enable AI
_unit enableSimulation true;
_unit hideObject false;
{_unit removeAction _x} forEach (actionIDs _unit); // Remove all actions
_unit setSkill ((skill _unit) - DPCS_SYSMED_SKILL_PENALTY);
_unit setVariable ["DPCS_SYSMED_TRAUMA_START", nil, true];
systemChat format ["%1 has been revived", name _unit];
_unit setVariable ["DPCS_SYSMED_REVIVE_PROGRESS", nil, true];
};
} forEach _unitsToTreat;
systemChat format ["Beginning treatment of %1 casualties", count _unitsToTreat];
} else {
systemChat "No casualties within range of medical facility";
};
},
[],
1.5,
true,
true,
"",
// Condition: Check for any nearby dead units not being treated AND facility not at capacity
"
private _nearbyUnits = nearestObjects [_target, ['Man'], DPCS_SYSMED_MAX_REVIVE_DISTANCE];
private _currentTreatments = count (_nearbyUnits select {!isNil {_x getVariable 'DPCS_SYSMED_REVIVE_PROGRESS'}});
private _hasUntreatedCasualties = count (_nearbyUnits select {
_x in DPCS_SYSMED_TRAUMA_UNITS &&
isNil {_x getVariable 'DPCS_SYSMED_REVIVE_PROGRESS'}
}) > 0;
_currentTreatments < DPCS_SYSMED_MAX_MEDICAL_FACILITY_CAPACITY && _hasUntreatedCasualties
"
];
================
File: functions/medical/fn_addUnitTraumaStatus.sqf
================
params ["_unit", "_reviveTimeLimit"];
private _traumaStart = _unit getVariable "DPCS_SYSMED_TRAUMA_START";
waitUntil {
sleep 1;
if (!isNil "_traumaStart" &&
(time - _traumaStart >= _reviveTimeLimit)) then {
DPCS_SYSMED_TRAUMA_UNITS = DPCS_SYSMED_TRAUMA_UNITS - [_unit];
{_unit removeAction _x} forEach (actionIDs _unit); // Remove all actions
_unit enableAI "ALL";
_unit setDamage 1;
_unit setVariable ["DPCS_SYSMED_TRAUMA_START", nil];
_unit setVariable ["DPCS_SYSMED_REVIVE_PROGRESS", nil];
true
} else {
false
};
};
================
File: functions/medical/fn_addUnloadBodyAction.sqf
================
params ["_unit"];
_unit addEventHandler ["GetOutMan", {
params ["_unit", "_role", "_vehicle", "_turret"];
_vehicle lockCargo false;
}];
================
File: functions/medical/fn_checkUnitTraumaStatus.sqf
================
params ["_target", "_caller", "_id", "_arguments"];
private _traumaStart = _target getVariable "DPCS_SYSMED_TRAUMA_START"; // 5
private _traumaTime = time - _traumaStart; // 15 - 5 = 10
private _traumaTimeLeft = (DPCS_SYSMED_REVIVE_TIME_LIMIT - _traumaTime) max 0;
// Format time with leading zeros
private _minutes = floor(_traumaTimeLeft / 60); // 205 / 60 = 3
private _seconds = floor(_traumaTimeLeft % 60); // 205 % 60 = 25
private _timeStr = format ["%1:%2", _minutes,_seconds]; // 3:25
// Find nearest medical vehicle/facility
private _nearestMedical = trauma_unit;
private _medicalDist = if (!isNull _nearestMedical) then {
round(_target distance _nearestMedical)
} else {
"NO MEDICAL FACILITY NEARBY"
};
hint parseText format [
"<t size='1.2' color='#ff0000'>URGENT CASUALTY STATUS</t><br/><br/>" +
"Time Until Critical: %1<br/>" +
"Distance to FOB: %2m<br/>" +
"Status: URGENT - Immediate CASEVAC Required",
_timeStr,
_medicalDist
];
================
File: functions/medical/fn_handleUnitDeath.sqf
================
// File: functions\medical\fn_handleUnitDeath.sqf
params ["_unit"];
_reviveTimeLimit = DPCS_SYSMED_REVIVE_TIME_LIMIT;
if (!isPlayer _unit) then {
// Create radio message based on unit's role and squad
private _radioMsg = format [
"Fuck I'm hit!",
"ACTUAL"];
// Send radio message using the reporter
[_unit, _radioMsg] spawn {
params ["_speaker", "_msg"];
_speaker sideChat _msg;
};
// Optional: Add visual radio effect
private _reporterPos = getPosATL _unit;
private _radioObj = "Land_HelipadEmpty_F" createVehicle _reporterPos;
_radioObj say3D ["radioreport", 100]; // You'll need to define this sound
deleteVehicle _radioObj;
_unit setVariable ["DPCS_SYSMED_TRAUMA_START", time]; // 5
_unit allowDamage false;
_unit setUnconscious true;
_unit disableAI "ALL";
_unit enableAI "ANIM";
DPCS_SYSMED_TRAUMA_UNITS pushBack _unit;
// add action to view trauma status
_unit addAction [
"<t color='#ff0000'>Check URGENT Casualty</t>",
DPC_fnc_checkUnitTraumaStatus,
nil,
10,
false,
true,
"",
"_this distance _target < 2"
];
[_unit, DPCS_SYSMED_REVIVE_TIME_LIMIT] spawn {
params ["_unit", "_reviveTimeLimit"];
[_unit, _reviveTimeLimit] call DPC_fnc_addUnitTraumaStatus;
};
};
================
File: functions/medical/fn_initMedicalSystems.sqf
================
// File: functions\medical\fn_initMedicalSystem.sqf
private _isEnabled = getNumber (missionConfigFile >> "CfgConstants" >> "DPCS_CONFIG" >> "ENABLED");
private _isDebug = getNumber (missionConfigFile >> "CfgConstants" >> "DPCS_CONFIG" >> "DEBUG");
private _isMedicalEnabled = getNumber (missionConfigFile >> "CfgConstants" >> "DPCS_CONFIG" >> "DPCS_MEDICAL");
if(_isEnabled == 1 && _isMedicalEnabled == 1) then {
// Initialize medical system constants
DPCS_SYSMED_TRAUMA_UNITS = [];
DPCS_SYSMED_MEDICAL_FACILITIES = [trauma_unit];
DPCS_SYSMED_REVIVE_TIME_LIMIT = 600;
DPCS_SYSMED_REVIVE_TIME = 60;
DPCS_SYSMED_MAX_REVIVE_DISTANCE = 20;
DPCS_SYSMED_SKILL_PENALTY = 0.1;
DPCS_SYSMED_MAX_CASEVAC_DISTANCE = 15;
DPCS_SYSMED_MAX_MEDICAL_FACILITY_CAPACITY = 2;
{
publicVariable _x
} forEach [
"DPCS_SYSMED_TRAUMA_UNITS",
"DPCS_SYSMED_MEDICAL_FACILITIES",
"DPCS_SYSMED_REVIVE_TIME_LIMIT",
"DPCS_SYSMED_REVIVE_TIME",
"DPCS_SYSMED_MAX_REVIVE_DISTANCE",
"DPCS_SYSMED_SKILL_PENALTY",
"DPCS_SYSMED_MAX_CASEVAC_DISTANCE",
"DPCS_SYSMED_MAX_MEDICAL_FACILITY_CAPACITY"
];
[] call DPC_fnc_addDeathHandler;
[] call DPC_fnc_addLoadAction;
{
[_x] call DPC_fnc_addReviveAction;
} forEach DPCS_SYSMED_MEDICAL_FACILITIES;
[true] call DPC_fnc_startSurgeryAmbientAnim;
};
if(_isDebug == 1) then {
systemChat "Medical system initialized";
player addAction [
"Debug: Add Casualty",
{
// log all allVariables
private _text = "";
private _varNames = [
"TRAUMA_UNITS: ",
"MEDICAL_FACILITIES: ",
"REVIVE_TIME_LIMIT: ",
"REVIVE_TIME: ",
"MAX_REVIVE_DISTANCE: ",
"SKILL_PENALTY: ",
"MAX_CASEVAC_DISTANCE: ",
"MAX_MEDICAL_FACILITY_CAPACITY: "
];
private _vars = [
DPCS_SYSMED_TRAUMA_UNITS,
DPCS_SYSMED_MEDICAL_FACILITIES,
DPCS_SYSMED_REVIVE_TIME_LIMIT,
DPCS_SYSMED_REVIVE_TIME,
DPCS_SYSMED_MAX_REVIVE_DISTANCE,
DPCS_SYSMED_SKILL_PENALTY,
DPCS_SYSMED_MAX_CASEVAC_DISTANCE,
DPCS_SYSMED_MAX_MEDICAL_FACILITY_CAPACITY
];
{
_text = _text + format ["%1%2\n", _varNames select _forEachIndex, _x];
} forEach _vars;
copyToClipboard _text;
systemChat "Debug: All Medical variables copied to clipboard";
}
];
};
================
File: functions/medical/fn_loadCasualtyAction.sqf
================
params ["_vehicle", "_caller", "_actionId", "_deadUnit"];
private _traumaUnits = DPCS_SYSMED_TRAUMA_UNITS;
private _nearestDead = objNull;
if (isNil "_traumaUnits" || {count _traumaUnits == 0}) exitWith {
systemChat "No casualties to load";
};
if (_vehicle emptyPositions "cargo" == 0) exitWith {
systemChat "Vehicle cargo is full!";
};
{
if (_x distance _vehicle < DPCS_SYSMED_MAX_CASEVAC_DISTANCE &&
{!(_x in (crew _vehicle))} &&
{isNil { _x getVariable "DPCS_SYSMED_REVIVE_PROGRESS"}} &&
{_x getVariable ["DPCS_SYSMED_TRAUMA_START", -1] != -1}) exitWith {
_nearestDead = _x;
};
} forEach _traumaUnits;
if (!isNull _nearestDead) then {
_nearestDead moveInCargo _vehicle;
_nearestDead switchMove "KIA_passenger_boat_holdleft";
_cargoIndex = _vehicle getCargoIndex _nearestDead;
_vehicle lockCargo [_cargoIndex, true];
[_nearestDead] call DPC_fnc_addUnloadBodyAction;
systemChat format ["Vehicle now has %1 passenger seats remaining",
(_vehicle emptyPositions "cargo")];
if (_vehicle emptyPositions "cargo" == 0) then {
_vehicle removeAction _actionId;
};
};
================
File: functions/medical/fn_startSurgeryAmbientAnim.sqf
================
params ["_show"];
surgeon hideObject true;
surgeon enableSimulation false;
patient hideObject true;
patient enableSimulation false;
surgeon disableAI "ANIM";
surgeon disableAI "MOVE";
surgeon disableAI "PATH";
surgeon disableAI "TARGET";
surgeon disableAI "FSM";
surgeon switchMove "AinvPknlMstpSnonWnonDr_medic0";
patient disableAI "ANIM"; // Prevent AI from changing animations
patient disableAI "MOVE"; // Prevent AI from moving
patient disableAI "PATH"; // Prevent AI from pathfinding
patient disableAI "TARGET"; // Prevent AI from targeting
patient disableAI "FSM"; // Prevent AI behavior scriptssurgeon
patient switchMove "ainjppnemstpsnonwnondnon_rolltoback";
================
File: initPlatoonGroups.sqf
================
// // File: functions\config\fn_initPlatoonGroups.sqf
// /*
// Author: Your Name
// Description: Initializes or replenishes a NATO infantry platoon
// Parameters:
// _spawnPos: Array/Object - Position to spawn units [x,y,z] or object
// _replenish: Boolean - True to check and replenish existing groups
// Returns: Array of groups created/replenished
// Example:
// [getMarkerPos "platoon_start", false] call DPC_fnc_initPlatoonGroups;
// */
// params [
// ["_spawnPos", [0,0,0], [[],objNull]],
// ["_replenish", false, [false]]
// ];
// // NATO Infantry unit types
// #define UNIT_OFFICER "B_officer_F"
// #define UNIT_SQL "B_Soldier_SL_F"
// #define UNIT_TL "B_Soldier_TL_F"
// #define UNIT_MEDIC "B_medic_F"
// #define UNIT_AR "B_soldier_AR_F"
// #define UNIT_GREN "B_Soldier_GL_F"
// #define UNIT_LAT "B_soldier_LAT_F"
// #define UNIT_RADIO "B_Soldier_lite_F"
// // Platoon structure definitions
// private _platoonStructure = [
// // HQ Squad - 4 men
// [
// "HQ", [
// [UNIT_OFFICER, "Platoon Commander"],
// [UNIT_MEDIC, "Platoon Medic"],
// [UNIT_RADIO, "Platoon RTO"],
// [UNIT_TL, "Platoon Sergeant"]
// ]
// ],
// // Three identical infantry squads - 8 men each
// [
// "Alpha", [
// [UNIT_SQL, "Squad Leader"],
// [UNIT_TL, "Team Leader"],
// [UNIT_AR, "Automatic Rifleman"],
// [UNIT_GREN, "Grenadier"],
// [UNIT_LAT, "AT Specialist"],
// [UNIT_TL, "Team Leader"],
// [UNIT_AR, "Automatic Rifleman"],
// [UNIT_MEDIC, "Squad Medic"]
// ]
// ],
// [
// "Bravo", [
// [UNIT_SQL, "Squad Leader"],
// [UNIT_TL, "Team Leader"],
// [UNIT_AR, "Automatic Rifleman"],
// [UNIT_GREN, "Grenadier"],
// [UNIT_LAT, "AT Specialist"],
// [UNIT_TL, "Team Leader"],
// [UNIT_AR, "Automatic Rifleman"],
// [UNIT_MEDIC, "Squad Medic"]
// ]
// ],
// [
// "Charlie", [
// [UNIT_SQL, "Squad Leader"],
// [UNIT_TL, "Team Leader"],
// [UNIT_AR, "Automatic Rifleman"],
// [UNIT_GREN, "Grenadier"],
// [UNIT_LAT, "AT Specialist"],
// [UNIT_TL, "Team Leader"],
// [UNIT_AR, "Automatic Rifleman"],
// [UNIT_MEDIC, "Squad Medic"]
// ]
// ]
// ];
// // Convert spawn position
// _spawnPos = if (_spawnPos isEqualType objNull) then {
// getPos _spawnPos
// } else {
// _spawnPos
// };
// // Initialize platoon groups array if needed
// if (isNil "PLATOON_GROUPS" && !_replenish) then {
// PLATOON_GROUPS = [];
// };
// // Function to create a single unit
// private _fnc_createUnit = {
// params ["_type", "_role", "_group", "_pos"];
// private _unit = _group createUnit [_type, _pos, [], 5, "NONE"];
// _unit setRank "PRIVATE";
// _unit setVariable ["DPC_Role", _role, true]; // Added true for global broadcast
// // Set ranks based on role
// switch (toLower _role) do {
// case "platoon commander": { _unit setRank "LIEUTENANT" };
// case "platoon sergeant": { _unit setRank "SERGEANT" };
// case "squad leader": { _unit setRank "SERGEANT" };
// case "team leader": { _unit setRank "CORPORAL" };
// default { _unit setRank "PRIVATE" };
// };
// _unit
// };
// // Process each squad in the platoon structure
// {
// _x params ["_squadName", "_composition"];
// private "_group";
// // Check if group exists when replenishing
// if (_replenish) then {
// {
// if ((_x getVariable ["DPC_SquadName", ""]) == _squadName) exitWith {
// _group = _x;
// };
// } forEach PLATOON_GROUPS;
// };
// // Create new group if needed
// if (isNil "_group" || {isNull _group}) then {
// _group = createGroup [west, true];
// _group setVariable ["DPC_SquadName", _squadName, true]; // Added true for global broadcast
// PLATOON_GROUPS pushBack _group;
// };
// // Create or replenish units
// {
// _x params ["_type", "_role"];
// // Check if we need this role when replenishing
// private _needUnit = true;
// if (_replenish) then {
// {
// if (alive _x && {_x getVariable ["DPC_Role", ""] == _role}) exitWith {
// _needUnit = false;
// };
// } forEach (units _group);
// };
// // Create unit if needed
// if (_needUnit) then {
// [_type, _role, _group, _spawnPos] call _fnc_createUnit;
// };
// } forEach _composition;
// // Basic group settings
// _group enableDynamicSimulation true;
// _group setFormation "WEDGE";
// } forEach _platoonStructure;
// // Return the groups array
// PLATOON_GROUPS
================
File: ui/controls.hpp
================
// File: ui/controls.hpp
class RscText {
type = 0;
idc = -1;
style = 0;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
font = "RobotoCondensed";
sizeEx = 0.032;
h = 0.05;
text = "";
};
class RscButton {
type = 1;
style = 2;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
shadow = 2;
font = "RobotoCondensed";
sizeEx = 0.032;
colorText[] = {1,1,1,1};
colorDisabled[] = {0.4,0.4,0.4,1};
colorBackground[] = {0.4,0.4,0.4,1};
colorBackgroundDisabled[] = {0.3,0.3,0.3,1};
colorBackgroundActive[] = {0.5,0.5,0.5,1};
offsetX = 0.003;
offsetY = 0.003;
offsetPressedX = 0.002;
offsetPressedY = 0.002;
colorFocused[] = {0.5,0.5,0.5,1};
colorShadow[] = {0,0,0,1};
colorBorder[] = {0,0,0,1};
borderSize = 0.0;
soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
};
class RscListBox {
type = 5;
style = 16;
font = "RobotoCondensed";
sizeEx = 0.032;
rowHeight = 0.03;
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
colorScrollbar[] = {1,0,0,0};
colorSelect[] = {0,0,0,1};
colorSelect2[] = {0,0,0,1};
colorSelectBackground[] = {0.95,0.95,0.95,1};
colorSelectBackground2[] = {1,1,1,0.5};
colorBackground[] = {0,0,0,0.3};
maxHistoryDelay = 1;
soundSelect[] = {"",0.1,1};
period = 1;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
shadow = 0;
class ListScrollBar {
color[] = {1,1,1,0.6};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "#(argb,8,8,3)color(1,1,1,1)";
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
border = "#(argb,8,8,3)color(1,1,1,1)";
};
};
class RscEdit {
type = 2;
style = 0x00 + 0x40;
font = "RobotoCondensed";
shadow = 2;
sizeEx = 0.032;
colorBackground[] = {0,0,0,0.3};
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
colorSelection[] = {0,0,0,0.25};
autocomplete = "";
text = "";
size = 0.2;
canModify = 1;
};
================
File: ui/dialogs/artillery_dialog.hpp
================
// File: ui/dialogs/artillery_dialog.hpp
#include "..\controls.hpp"
class DPC_Artillery_Dialog {
idd = 9000;
movingEnable = true;
class Controls {
class Background: RscText {
idc = -1;
x = 0.3 * safezoneW + safezoneX;
y = 0.25 * safezoneH + safezoneY;
w = 0.4 * safezoneW;
h = 0.5 * safezoneH;
colorBackground[] = {0,0,0,0.8};
};
class Title: RscText {
idc = -1;
text = "Artillery Support";
x = 0.3 * safezoneW + safezoneX;
y = 0.25 * safezoneH + safezoneY;
w = 0.4 * safezoneW;
h = 0.04 * safezoneH;
colorBackground[] = {0.4,0,0,1};
style = ST_CENTER;
};
class AmmoList: RscListBox {
idc = 9001;
x = 0.31 * safezoneW + safezoneX;
y = 0.31 * safezoneH + safezoneY;
w = 0.15 * safezoneW;
h = 0.35 * safezoneH;
onLBSelChanged = "_this call DPC_fnc_onAmmoSelect;";
};
class SelectTargetBtn: RscButton {
idc = 9002;
text = "SELECT TARGET";
x = 0.47 * safezoneW + safezoneX;
y = 0.35 * safezoneH + safezoneY;
w = 0.15 * safezoneW;
h = 0.04 * safezoneH;
colorBackground[] = {0.4,0,0,1};
onButtonClick = "[] call DPC_fnc_openMapForTarget;";
};
class SelectedTargetText: RscText {
idc = 9005;
text = "Grid: N/A";
x = 0.47 * safezoneW + safezoneX;
y = 0.4 * safezoneH + safezoneY;
w = 0.15 * safezoneW;
h = 0.03 * safezoneH;
};
class RoundsLabel: RscText {
idc = -1;
text = "Number of Rounds:";
x = 0.47 * safezoneW + safezoneX;
y = 0.48 * safezoneH + safezoneY;
w = 0.15 * safezoneW;
h = 0.03 * safezoneH;
};
class RoundsInput: RscEdit {
idc = 9003;
x = 0.47 * safezoneW + safezoneX;
y = 0.52 * safezoneH + safezoneY;
w = 0.15 * safezoneW;
h = 0.03 * safezoneH;
text = "1";
};
class FireButton: RscButton {
idc = 9004;
text = "REQUEST FIRE";
x = 0.47 * safezoneW + safezoneX;
y = 0.6 * safezoneH + safezoneY;
w = 0.15 * safezoneW;
h = 0.04 * safezoneH;
colorBackground[] = {0.4,0,0,1};
onButtonClick = "_this call DPC_fnc_requestArtilleryFire;";
};
class CloseButton: RscButton {
idc = -1;
text = "CLOSE";
x = 0.31 * safezoneW + safezoneX;
y = 0.6 * safezoneH + safezoneY;
w = 0.15 * safezoneW;
h = 0.04 * safezoneH;
onButtonClick = "closeDialog 0;";
};
};
};