Skip to content

Commit 2e5c69b

Browse files
committed
Tech Check Mission
1 parent 7f9c43b commit 2e5c69b

170 files changed

Lines changed: 27344 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
private _dialog = findDisplay 221901;
2+
private _boxList = _dialog displayCtrl 220911;
3+
private _currentBoxIndex = lbCurSel _boxList;
4+
5+
if (_currentBoxIndex == -1) exitWith {hint "No crate selected!";};
6+
7+
private _crate = _boxList lbData _currentBoxIndex;
8+
_crate = objectFromNetId _crate;
9+
10+
if (!isNull _crate) then {
11+
// Delete from game world
12+
deleteVehicle _crate;
13+
14+
// Delete from list
15+
_boxList lbDelete _currentBoxIndex;
16+
17+
lbSort [_boxList, "ASC"];
18+
19+
// Clear selection
20+
_boxList lbSetCurSel -1;
21+
22+
hint "Crate deleted!";
23+
} else {
24+
hint "Crate no longer exists!";
25+
};
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
private _dialog = findDisplay 221901;
2+
private _ctlrProgress = _dialog displayCtrl 220915;
3+
private _object = uiNamespace getVariable "IGC_CE_SelectedInventory";
4+
5+
private _load = 0;
6+
private _maxLoad = 0;
7+
8+
if (isNull _object) exitWith {
9+
_ctlrProgress progressSetPosition 0;
10+
};
11+
12+
// Define cargo processors with type-specific mass handling
13+
private _cargoProcessors = [
14+
[
15+
{getItemCargo _this},
16+
{
17+
params ["_className", "_configPath"];
18+
private _mass = if (_configPath == "CfgWeapons") then {
19+
getNumber (configFile >> _configPath >> _className >> "ItemInfo" >> "mass")
20+
} else {
21+
getNumber (configFile >> _configPath >> _className >> "mass")
22+
};
23+
if (_mass == 0) then {getNumber (configFile >> _configPath >> _className >> "mass")} else {_mass}
24+
}
25+
],
26+
[
27+
{getWeaponCargo _this},
28+
{
29+
params ["_className", "_configPath"];
30+
private _mass = getNumber (configFile >> _configPath >> _className >> "WeaponSlotsInfo" >> "mass");
31+
if (_mass == 0) then {getNumber (configFile >> _configPath >> _className >> "ItemInfo" >> "mass")} else {_mass}
32+
}
33+
],
34+
[
35+
{getBackpackCargo _this},
36+
{getNumber (configFile >> ([_this#0] call IGC_common_fnc_getConfigPath) >> _this#0 >> "mass")}
37+
],
38+
[
39+
{getMagazineCargo _this},
40+
{getNumber (configFile >> ([_this#0] call IGC_common_fnc_getConfigPath) >> _this#0 >> "mass")}
41+
]
42+
];
43+
44+
{
45+
_x params ["_cargoFn", "_massFn"];
46+
private _content = _object call _cargoFn;
47+
{
48+
private _className = _x;
49+
private _quantity = (_content#1) select _forEachIndex;
50+
private _configPath = [_className] call IGC_common_fnc_getConfigPath;
51+
52+
private _itemMass = [_className, _configPath] call _massFn;
53+
_load = _load + (_itemMass * _quantity);
54+
} forEach (_content#0);
55+
} forEach _cargoProcessors;
56+
57+
// Get container capacity
58+
private _objectClass = typeOf _object;
59+
private _objectConfigPath = [_objectClass] call IGC_common_fnc_getConfigPath;
60+
_maxLoad = getNumber (configFile >> _objectConfigPath >> _objectClass >> "maximumLoad");
61+
62+
// Update progress bar with safe limits
63+
_ctlrProgress progressSetPosition (_load / _maxLoad max 0 min 1);
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
params ["_object", "_radius"];
3+
4+
5+
uiNamespace setVariable ["currentSupplyObject", _object];
6+
uiNamespace setVariable ["currentRadius", _radius];
7+
8+
createDialog "IGC_CE_dialog";
9+
10+
private _dialog = findDisplay 221901;
11+
private _listInventories = _dialog displayCtrl 220911;
12+
13+
private _supplyCategories = _dialog displayCtrl 220914;
14+
15+
private _arsenalPath = limapfad + "limaSupplyPoint_Itemlist.sqf";
16+
if !(fileExists _arsenalPath) exitWith {
17+
systemChat "Arsenal config file missing!";
18+
diag_log "ERROR: Arsenal config file not found!";
19+
};
20+
21+
private _arsenalData = call compile preprocessFileLineNumbers _arsenalPath;
22+
if !(_arsenalData isEqualType []) exitWith {
23+
systemChat "Invalid arsenal config format!";
24+
diag_log "ERROR: Arsenal data is not an array!";
25+
};
26+
27+
// Store in UI namespace with validation
28+
uiNamespace setVariable ["arsenalData", _arsenalData];
29+
diag_log format["Arsenal Data Loaded: %1 categories", count _arsenalData];
30+
31+
// Get combo reference
32+
private _categoryCombo = _dialog displayCtrl 220914;
33+
lbClear _categoryCombo;
34+
35+
// Populate categories with validation
36+
if (_arsenalData isEqualTo []) exitWith {
37+
systemChat "Arsenal config is empty!";
38+
diag_log "ERROR: Arsenal config contains no categories!";
39+
};
40+
41+
{
42+
_x params ["_categoryName", "_classNames"];
43+
private _index = _categoryCombo lbAdd _categoryName;
44+
_categoryCombo lbSetData [_index, str(_x)]; // Store entire category array
45+
} forEach (uiNamespace getVariable "arsenalData");
46+
47+
// Set initial selection and trigger update
48+
_categoryCombo lbSetCurSel 0;
49+
[_categoryCombo, 0] call IGC_CF_fnc_onSupplyCatChange;
50+
51+
52+
_listInventories ctrlAddEventHandler ["LBSelChanged", {
53+
_this call IGC_CE_fnc_onInventorySelect;
54+
}];
55+
56+
(_dialog displayCtrl 220916) ctrlAddEventHandler ["ButtonClick", {
57+
_this call IGC_CE_fnc_deleteCrate;
58+
}];
59+
60+
[] call IGC_CE_fnc_updateNearObjects;
61+
62+
[] call IGC_CE_monitorInventories;
63+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Remove existing PFH if any
2+
if (!isNil "IGC_CE_inventoryPFH") then {
3+
[IGC_CE_inventoryPFH] call CBA_fnc_removePerFrameHandler;
4+
};
5+
6+
// Create new PFH
7+
IGC_CE_inventoryPFH = [{
8+
private _lastUpdate = uiNamespace getVariable ["IGC_CE_lastInventoryCheck", 0];
9+
if (diag_tickTime - _lastUpdate > 1) then {
10+
[] call IGC_CE_fnc_updateNearObjects;
11+
uiNamespace setVariable ["IGC_CE_lastInventoryCheck", diag_tickTime];
12+
};
13+
}, 0.5] call CBA_fnc_addPerFrameHandler;
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
private _dialog = findDisplay 221901;
2+
private _ctrlSupplyList = _dialog displayCtrl 220913;
3+
private _supplyBox = uiNamespace getVariable "IGC_CE_SelectedInventory";
4+
5+
private _boxList = _dialog displayCtrl 220911;
6+
private _currentBoxIndex = lbCurSel _boxList;
7+
// Get and validate quantity
8+
private _quantity = 1;
9+
10+
private _selectedItemIndex = lbCurSel _ctrlSupplyList;
11+
if (_selectedItemIndex == -1 || isNull _supplyBox) exitWith {
12+
hint "Select an item and inventory first!";
13+
};
14+
15+
private _class = _ctrlSupplyList lbData _selectedItemIndex;
16+
17+
private _pathToConfig = [_class] call IGC_common_fnc_getConfigPath;
18+
// Add items based on type
19+
switch (_pathToConfig) do {
20+
case ("CfgWeapons"): {
21+
private _isToolOrMedItem = getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem") + getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem");
22+
if (_isToolOrMedItem == 0) then
23+
{
24+
if (_class isKindOf "Rifle_Base_F" || _class isKindOf "Pistol_Base_F" || _class isKindOf "Launcher_Base_F") then {
25+
_supplyBox addWeaponCargoGlobal [_class, _quantity];
26+
} else {
27+
_supplyBox addItemCargoGlobal [_class, _quantity];
28+
};
29+
} else
30+
{
31+
_supplyBox addItemCargoGlobal [_class, _quantity];
32+
}
33+
};
34+
case ("CfgMagazines"): {
35+
private _isToolOrMedItem = getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem") + getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem");
36+
if (_isToolOrMedItem == 0) then
37+
{
38+
_supplyBox addMagazineCargoGlobal [_class, _quantity];
39+
} else
40+
{
41+
_supplyBox addItemCargoGlobal [_class, _quantity];
42+
}
43+
};
44+
case ("CfgVehicles"): {
45+
_supplyBox addBackpackCargoGlobal [_class, _quantity];
46+
};
47+
case ("CfgGlasses"): {
48+
_supplyBox addItemCargoGlobal [_class, _quantity];
49+
};
50+
default {
51+
systemChat format["[ERROR] Invalid class: %1", _class];
52+
};
53+
};
54+
55+
[_dialog displayCtrl 220911, _currentBoxIndex] call IGC_CE_fnc_onInventorySelect;
56+
[] call IGC_CE_fnc_getLoadFactor;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
params ["_amount"];
3+
private _dialog = findDisplay 221901;
4+
private _ctrlItemList = _dialog displayCtrl 220912;
5+
private _supplyBox = uiNamespace getVariable "IGC_CE_SelectedInventory";
6+
7+
private _boxList = _dialog displayCtrl 220911;
8+
private _currentBoxIndex = lbCurSel _boxList;
9+
// Get and validate quantity
10+
private _quantity = _amount max 1;
11+
12+
private _selectedItemIndex = lbCurSel _ctrlItemList;
13+
if (_selectedItemIndex == -1 || isNull _supplyBox) exitWith {
14+
hint "Select an item and inventory first!";
15+
};
16+
17+
private _class = _ctrlItemList lbData _selectedItemIndex;
18+
19+
private _pathToConfig = [_class] call IGC_common_fnc_getConfigPath;
20+
// Add items based on type
21+
switch (_pathToConfig) do {
22+
case ("CfgWeapons"): {
23+
private _isToolOrMedItem = getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem") + getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem");
24+
if (_isToolOrMedItem == 0) then
25+
{
26+
if (_class isKindOf "Rifle_Base_F" || _class isKindOf "Pistol_Base_F" || _class isKindOf "Launcher_Base_F") then {
27+
_supplyBox addWeaponCargoGlobal [_class, _quantity];
28+
} else {
29+
_supplyBox addItemCargoGlobal [_class, _quantity];
30+
};
31+
} else
32+
{
33+
_supplyBox addItemCargoGlobal [_class, _quantity];
34+
}
35+
};
36+
case ("CfgMagazines"): {
37+
private _isToolOrMedItem = getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem") + getNumber(configFile >> "CfgWeapons" >> _class >> "ACE_isMedicalItem");
38+
if (_isToolOrMedItem == 0) then
39+
{
40+
_supplyBox addMagazineCargoGlobal [_class, _quantity];
41+
} else
42+
{
43+
_supplyBox addItemCargoGlobal [_class, _quantity];
44+
}
45+
};
46+
case ("CfgVehicles"): {
47+
_supplyBox addBackpackCargoGlobal [_class, _quantity];
48+
};
49+
case ("CfgGlasses"): {
50+
_supplyBox addItemCargoGlobal [_class, _quantity];
51+
};
52+
default {
53+
systemChat format["[ERROR] Invalid class: %1", _class];
54+
};
55+
};
56+
57+
[_dialog displayCtrl 220911, _currentBoxIndex] call IGC_CE_fnc_onInventorySelect;
58+
[] call IGC_CE_fnc_getLoadFactor;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
private _dialog = findDisplay 221901;
3+
private _ctrlInventoryContent = _dialog displayCtrl 220912;
4+
private _object = uiNamespace getVariable "IGC_CE_SelectedInventory";
5+
6+
private _boxList = _dialog displayCtrl 220911;
7+
private _currentBoxIndex = lbCurSel _boxList;
8+
9+
// Clear inventory
10+
clearItemCargoGlobal _object;
11+
clearWeaponCargoGlobal _object;
12+
clearMagazineCargoGlobal _object;
13+
clearBackpackCargoGlobal _object;
14+
15+
[_dialog displayCtrl 220911, _currentBoxIndex] call IGC_CE_fnc_onInventorySelect;
16+
[] call IGC_CE_fnc_getLoadFactor;

0 commit comments

Comments
 (0)