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

V0.96.8 CBA Optics and Accessories support #840

Merged
merged 3 commits into from
Mar 11, 2024
Merged
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
31 changes: 30 additions & 1 deletion Missionframework/scripts/client/misc/fn_initArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
File: fn_initArsenal.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2020-05-11
Last Update: 2020-09-16
Last Update: 2020-09-26
License: MIT License - http://www.opensource.org/licenses/MIT

Description:
Expand Down Expand Up @@ -81,6 +81,35 @@ if (KPLIB_param_useArsenalPreset) then {
KPLIB_arsenalAllowed append _disposableLaunchers;
};

{
// Handle CBA optics, https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics
if (missionNamespace getVariable ["CBA_optics", false]) then {
private _pipOptic = CBA_optics_PIPOptics getVariable _x;
if (!isNil "_pipOptic") then {
KPLIB_arsenalAllowedExtension pushBackUnique _pipOptic;
};

private _nonPipOptic = CBA_optics_NonPIPOptics getVariable _x;
if (!isNil "_nonPipOptic") then {
KPLIB_arsenalAllowedExtension pushBackUnique _nonPipOptic;
};
};

// Handle CBA (MRT) Accessories, https://github.com/CBATeam/CBA_A3/wiki/Accessory-Functions
private _itemCfg = configFile >> "CfgWeapons" >> _x;
if (!isNull _itemCfg) then {
private _nextItem = getText (_cfg >> "MRT_SwitchItemPrevClass");
if (_nextItem != "") then {
KPLIB_arsenalAllowedExtension pushBackUnique _nextItem;
};

private _prevItem = getText (_cfg >> "MRT_SwitchItemNextClass");
if (_prevItem != "") then {
KPLIB_arsenalAllowedExtension pushBackUnique _prevItem;
};
};
} forEach KPLIB_arsenalAllowed;

KPLIB_arsenalAllowed append KPLIB_arsenalAllowedExtension;
if (KPLIB_ace && KPLIB_param_arsenalType) then {[player, KPLIB_arsenalAllowed, false] call ace_arsenal_fnc_addVirtualItems;};

Expand Down