ready for dedi -- improvements to resupply, triageIcons too

This commit is contained in:
2024-02-06 17:36:01 -08:00
parent 0a64d9e170
commit 91b982e06e
44 changed files with 586 additions and 354 deletions

View File

@@ -16,11 +16,29 @@ private _supplyCrateTypesCfgs = _supplyCratesCfg call BIS_fnc_returnChildren;
{
// add scroll wheel action to spawn different supply box types
private _arsenalBox = _x;
// always remove old actions if they exist
private _actionIDs = _arsenalBox getVariable [QGVAR(supplyCrateActionIDs), []];
{
_arsenalBox removeAction _x;
} forEach _actionIDs;
_arsenalBox setVariable [QGVAR(supplyCrateActionIDs), []];
// if setting disabled, skip adding actions
if (not (
[QGVAR(setting_allowSupplyBoxScrollWheelSpawning)] call CBA_settings_fnc_get
)) then {continue};
{ // add an action for each supply crate type
private _cfg = _x;
private _supplyCrateDisplayName = (_cfg >> "displayName") call BIS_fnc_getCfgData;
_arsenalBox addAction [format ["<t color='#ffffff'>Spawn %1</t>", _supplyCrateDisplayName], {
private _actionID = _arsenalBox addAction [format ["<t color='#ffffff'>Spawn %1</t>", _supplyCrateDisplayName], {
params ["_target", "_caller", "_actionId", "_arguments"];
_arguments params ["_supplyCrateCfg"];
[
@@ -29,5 +47,6 @@ private _supplyCrateTypesCfgs = _supplyCratesCfg call BIS_fnc_returnChildren;
getPos _target
] call FUNC(createBox);
}, [_cfg], 0, false, true, "", ""];
(_arsenalBox getVariable [QGVAR(supplyCrateActionIDs), []]) pushBack _actionID;
} forEach _supplyCrateTypesCfgs;
} forEach _arsenalBoxes;