-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arsenal - Native baseWeapon support for CBA items (#9799)
Co-authored-by: johnb432 <[email protected]>
- Loading branch information
1 parent
2036c83
commit 64538f2
Showing
11 changed files
with
203 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Jonpas, LinkIsGrim | ||
* Returns base attachment for CBA scripted attachment | ||
* Adapted from CBA_fnc_switchableAttachments | ||
* | ||
* Arguments: | ||
* 0: Attachment <STRING> | ||
* | ||
* Return Value: | ||
* Base attachment <STRING> | ||
* | ||
* Example: | ||
* "ACE_acc_pointer_green_IR" call ace_arsenal_fnc_baseAttachment | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_item", "", [""]]]; | ||
|
||
TRACE_1("looking up base attachment",_item); | ||
|
||
private _switchableClasses = []; | ||
|
||
private _cfgWeapons = configfile >> "CfgWeapons"; | ||
private _config = _cfgWeapons >> _item; | ||
_item = configName _config; | ||
|
||
while { | ||
_config = _cfgWeapons >> getText (_config >> "MRT_SwitchItemNextClass"); | ||
isClass _config && {_switchableClasses pushBackUnique configName _config != -1} | ||
} do {}; | ||
|
||
_config = _cfgWeapons >> _item; | ||
private _backward = []; | ||
while { | ||
_config = _cfgWeapons >> getText (_config >> "MRT_SwitchItemPrevClass"); | ||
isClass _config && {_backward pushBackUnique configName _config != -1} | ||
} do {}; | ||
|
||
_switchableClasses append _backward; | ||
_switchableClasses = _switchableClasses arrayIntersect _switchableClasses; | ||
|
||
{ | ||
if (getNumber (_cfgWeapons >> _x >> "scope") == 2) exitWith { | ||
TRACE_2("found class",_item,_x); | ||
_item = _x; | ||
}; | ||
} forEach _switchableClasses; | ||
|
||
_item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Jonpas, LinkIsGrim | ||
* Returns base optic for CBA scripted optics (PIP and 2D) | ||
* | ||
* Arguments: | ||
* 0: Optic <STRING> | ||
* | ||
* Return Value: | ||
* Base optic <STRING> | ||
* | ||
* Example: | ||
* "CUP_optic_Elcan_SpecterDR_black_PIP" call ace_arsenal_fnc_baseOptic | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_optic", "", [""]]]; | ||
|
||
// PIP | ||
private _baseClasses = configProperties [configFile >> "CBA_PIPItems", "getText _x == _optic"]; | ||
|
||
// Carry Handle | ||
{ | ||
_baseClasses append (configProperties [_x, "getText _x == _optic"]); | ||
} forEach configProperties [configFile >> "CBA_CarryHandleTypes"]; | ||
|
||
if (_baseClasses isNotEqualTo []) then { | ||
_optic = configName (_baseClasses select 0); | ||
}; | ||
|
||
_optic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters