mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add zeus support for arsenal rewrite, fix openBox camera check
This commit is contained in:
@ -35,4 +35,3 @@ if (_global && {isMultiplayer} && {{_object in _x} count GVAR(EHIDArray) == 0})
|
||||
[_object, _items, false] call FUNC(addVirtualItems);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -9,7 +9,7 @@ if (isNil {_object getVariable [QGVAR(virtualItems), nil]} && {!_mode}) exitWith
|
||||
private _displayToUse = [findDisplay 46, findDIsplay 312] select (!isNull findDisplay 312);
|
||||
_displayToUse = [_displayToUse, findDisplay 313] select (is3DEN);
|
||||
|
||||
if (isNil "_displayToUse" || {!isnull GVAR(camera)}) exitWith {
|
||||
if (isNil "_displayToUse" || {!isnil QGVAR(camera)}) exitWith {
|
||||
hint "No display or arsenal already opened"; // TBR
|
||||
};
|
||||
|
||||
|
@ -245,4 +245,7 @@ class CfgVehicles {
|
||||
displayName = CSTRING(ModuleRemoveArsenal_DisplayName);
|
||||
function = QFUNC(moduleRemoveArsenal);
|
||||
};
|
||||
class ModuleArsenal_F: Module_F {
|
||||
function=QFUNC(bi_moduleArsenal);
|
||||
};
|
||||
};
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
PREP(addObjectToCurator);
|
||||
PREP(bi_moduleArsenal);
|
||||
PREP(bi_moduleCurator);
|
||||
PREP(bi_moduleMine);
|
||||
PREP(bi_moduleProjectile);
|
||||
|
62
addons/zeus/functions/fnc_bi_moduleArsenal.sqf
Normal file
62
addons/zeus/functions/fnc_bi_moduleArsenal.sqf
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Author: Bohemia Interactive
|
||||
* Module function to open a full arsenal on a unit
|
||||
* Edited to use ACE arsenal when present, moved isPlayer check
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: Not used
|
||||
* 2: activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [LOGIC, nil, true] call ace_zeus_fnc_bi_moduleArsenal
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic", "", "_activated"];
|
||||
|
||||
if (_activated && local _logic) then {
|
||||
_unit = _logic getvariable ["bis_fnc_curatorAttachObject_object",objnull];
|
||||
|
||||
//--- Check if the unit is suitable
|
||||
_error = "";
|
||||
switch true do {
|
||||
case (isnull _unit): {_error = localize "str_a3_BIS_fnc_showCuratorFeedbackMessage_506";};
|
||||
case !(alive _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorDead";};
|
||||
case (isnull group _unit || !(side group _unit in [east,west,resistance,civilian])): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorBrain";};
|
||||
case (vehicle _unit != _unit || effectivecommander _unit != _unit): {_error = localize "str_a3_BIS_fnc_moduleArsenal_errorVehicle";};
|
||||
};
|
||||
|
||||
if (_error == "") then {
|
||||
|
||||
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {
|
||||
|
||||
[{
|
||||
params ["_unit"];
|
||||
|
||||
[_unit, _unit, true] call EFUNC(arsenal,openBox);
|
||||
}, [_unit]] call CBA_fnc_directCall;
|
||||
} else {
|
||||
if !(isPlayer _unit) then {
|
||||
|
||||
([] call bis_fnc_rscLayer) cuttext ["","black out",0.5];
|
||||
["#(argb,8,8,3)color(0,0,0,1)",false,nil,0,[0.5,0]] call bis_fnc_textTiles;
|
||||
["Open",[true,nil,_unit]] call bis_fnc_arsenal;
|
||||
([] call bis_fnc_rscLayer) cuttext ["","plain"];
|
||||
} else {
|
||||
|
||||
[objNull, localize "str_a3_BIS_fnc_moduleArsenal_errorDead"] call bis_fnc_showCuratorFeedbackMessage;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
|
||||
[objNull,_error] call bis_fnc_showCuratorFeedbackMessage;
|
||||
};
|
||||
deleteVehicle _logic;
|
||||
};
|
@ -29,9 +29,15 @@ switch (true) do {
|
||||
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
||||
};
|
||||
default {
|
||||
TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object);
|
||||
// Global Effects: "Action to access the Arsenal will be added automatically on all clients."
|
||||
["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal;
|
||||
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {
|
||||
|
||||
[_object, true, true] call EFUNC(arsenal,initBox);
|
||||
} else {
|
||||
|
||||
TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object);
|
||||
// Global Effects: "Action to access the Arsenal will be added automatically on all clients."
|
||||
["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -30,11 +30,18 @@ switch (true) do {
|
||||
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
||||
};
|
||||
default {
|
||||
TRACE_1("Calling removeVirtualXXXCargo functions",_object);
|
||||
[_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo;
|
||||
[_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo;
|
||||
[_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo;
|
||||
[_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo;
|
||||
|
||||
if (["ACE_Arsenal"] call EFUNC(common,isModLoaded)) then {
|
||||
|
||||
[_object, true, true] call EFUNC(arsenal,removeBox);
|
||||
} else {
|
||||
|
||||
TRACE_1("Calling removeVirtualXXXCargo functions",_object);
|
||||
[_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo;
|
||||
[_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo;
|
||||
[_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo;
|
||||
[_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user