Skip to content

Commit

Permalink
Added ability to show all items in the staging arsenal
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBrostrom committed Jan 29, 2024
1 parent 5ee3e06 commit 2d544aa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
14 changes: 13 additions & 1 deletion cScripts/cScripts_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,19 @@ private _cScriptSettings = "cScripts Mission Settings";
},
false
] call CBA_fnc_addSetting;

[ // Use Filtered Arsenal
QEGVAR(Settings,useFilteredArsenal),
"CHECKBOX",
["Use Filtered Arsenal","Use a filtered or show all items in the staging arsenal."],
[_cScriptSettings, "4; Staging"],
false,
true,
{
params ["_value"];
{ EGVAR(Staging,showAllLoadouts) = _value; } remoteExecCall ["call"];
},
false
] call CBA_fnc_addSetting;

// 5; Vehicle
[ // Enable
Expand Down
24 changes: 14 additions & 10 deletions cScripts/functions/systems/fn_addArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ private _arsenalStatement = {
call FUNC(addDefaultArsenalLoadout);
waitUntil { count ace_arsenal_defaultLoadoutsList != 0 };

private _items = call FUNC(getArsenalWhitelist);
INFO_3("Staging Arsenal", "Whitleist containing %1 items added to %2 (%3)", count _items, player, typeOf player);
if (count _items == 0) exitWith {
[
[],
["Arsenal is not avalible for your class."],
[""],
[""]
] call CBA_fnc_notify;
if (EGVAR(Settings,useFilteredArsenal)) then {
private _items = call FUNC(getArsenalWhitelist);
INFO_3("Staging Arsenal", "Whitleist containing %1 items added to %2 (%3)", count _items, player, typeOf player);
if (count _items == 0) exitWith {
[
[],
["Arsenal is not avalible for your class."],
[""],
[""]
] call CBA_fnc_notify;
};
[player, _items] call ace_arsenal_fnc_addVirtualItems;
} else {
[player, true] call ace_arsenal_fnc_addVirtualItems;
};

[player, _items] call ace_arsenal_fnc_addVirtualItems;

[{
INFO_2("Staging Arsenal", "Opening Staging Arsenal for %1 (%2)", player, typeOf player);
Expand Down

0 comments on commit 2d544aa

Please sign in to comment.