mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Gunbag - Add BI Arsenal Compatibility (#7887)
* Initial Commit * Remove development components * Adapt to ACE_player & resolve returned assignment * Update addons/gunbag/functions/fnc_BIArsenalClose.sqf Co-authored-by: commy2 <commy-2@gmx.de> Co-authored-by: commy2 <commy-2@gmx.de>
This commit is contained in:
parent
78c307196d
commit
2220822d30
@ -10,3 +10,19 @@ class Extended_PreInit_EventHandlers {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
//EH must be loaded this way to get ace_gunbag_gunbagWeapon before it is deleted upon opening the BI arsenal. May cause instability with other mods.
|
||||
class RscPicture;
|
||||
class RscDisplayArsenal {
|
||||
class Controls {
|
||||
class IconBackgroundPrimaryWeapon: RscPicture {
|
||||
onLoad = QUOTE([ACE_player] call FUNC(BIArsenalOpen));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_DisplayUnload_EventHandlers {
|
||||
class RscDisplayArsenal {
|
||||
ADDON = QUOTE([ACE_player] call FUNC(BIArsenalClose));
|
||||
};
|
||||
};
|
||||
|
@ -10,3 +10,5 @@ PREP(canInteract);
|
||||
PREP(calculateMass);
|
||||
PREP(hasGunbag);
|
||||
PREP(isMachineGun);
|
||||
PREP(BIArsenalClose);
|
||||
PREP(BIArsenalOpen);
|
||||
|
26
addons/gunbag/functions/fnc_BIArsenalClose.sqf
Normal file
26
addons/gunbag/functions/fnc_BIArsenalClose.sqf
Normal file
@ -0,0 +1,26 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: mjc4wilton
|
||||
* Handle BI arsenal closing
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_gunbag_fnc_BIArsenalClose
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if (!isNil QGVAR(arsenalCache)) then {
|
||||
backpackContainer _unit setVariable [QGVAR(gunbagWeapon), GVAR(arsenalCache), true];
|
||||
};
|
||||
|
||||
GVAR(arsenalCache) = nil;
|
||||
|
||||
nil
|
22
addons/gunbag/functions/fnc_BIArsenalOpen.sqf
Normal file
22
addons/gunbag/functions/fnc_BIArsenalOpen.sqf
Normal file
@ -0,0 +1,22 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: mjc4wilton
|
||||
* Handle BI arsenal opening
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_gunbag_fnc_BIArsenalOpen
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
if ([_unit] call FUNC(hasGunBag)) then {
|
||||
GVAR(arsenalCache) = backpackContainer _unit getVariable [QGVAR(gunbagWeapon), []];
|
||||
};
|
Loading…
Reference in New Issue
Block a user