Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to show all items in the staging arsenal #1132

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = GETVAR(player,EGVAR(Player,ArsenalWhitelist), []);
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 = GETVAR(player,EGVAR(Player,ArsenalWhitelist), []);
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
16 changes: 14 additions & 2 deletions cScripts/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,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 Expand Up @@ -326,4 +338,4 @@ private _cScriptSettings = "cScripts Mission Settings";
true,
{},
true
] call CBA_fnc_addSetting;
] call CBA_fnc_addSetting;