mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Seems like it's working
This commit is contained in:
parent
32f67487b5
commit
d31c19c3eb
@ -2,14 +2,16 @@ class CfgVehicles {
|
|||||||
class Man;
|
class Man;
|
||||||
class CAManBase: Man {
|
class CAManBase: Man {
|
||||||
class ACE_Actions {
|
class ACE_Actions {
|
||||||
class ACE_Disarm {
|
class ACE_MainActions {
|
||||||
displayName = "Disarm";
|
class ACE_DisarmInventory {
|
||||||
distance = 3;
|
displayName = "Open Inventory";
|
||||||
condition = QUOTE([_target] call FUNC(canDisarm));
|
distance = 4;
|
||||||
statement = "";
|
condition = QUOTE([_target] call FUNC(canDisarm));
|
||||||
showDisabled = 0;
|
statement = QUOTE([ARR_2(_player,_target)] call FUNC(openDisarmDialog));
|
||||||
priority = 3.2;
|
icon = "\a3\Modules_F_Curator\Data\portraitRespawnInventory_ca.paa"; //todo
|
||||||
enableInside = 0;
|
selection = "spine3";
|
||||||
|
exceptions[] = {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
["DisarmStart", {_this call FUNC(startDisarmTarget)}] call EFUNC(common,addEventHandler);
|
["DisarmDropItems", {_this call FUNC(eventTargetStart)}] call EFUNC(common,addEventHandler);
|
||||||
["DisarmDebugCallback", {_this call FUNC(eventCallerFinish)}] call EFUNC(common,addEventHandler);
|
["DisarmDebugCallback", {_this call FUNC(eventCallerFinish)}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -66,7 +66,7 @@ if (_holder getVariable [QGVAR(holderInUse), false]) exitWith {
|
|||||||
systemChat format ["Debug: %1 - Ground Container In Use, waiting until free", time];
|
systemChat format ["Debug: %1 - Ground Container In Use, waiting until free", time];
|
||||||
[{
|
[{
|
||||||
_this call FUNC(disarmDropItems);
|
_this call FUNC(disarmDropItems);
|
||||||
}, 0.05, 0.05, _this] call EFUNC(common,waitAndExecute);
|
}, _this, 0.05, 0.05] call EFUNC(common,waitAndExecute);
|
||||||
};
|
};
|
||||||
_holder setVariable [QGVAR(holderInUse), true];
|
_holder setVariable [QGVAR(holderInUse), true];
|
||||||
|
|
||||||
@ -100,7 +100,10 @@ if (((count _targetMagazinesStart) - (count _targetMagazinesEnd)) != ((count _ho
|
|||||||
|
|
||||||
//Remove Items, Assigned Items and NVG
|
//Remove Items, Assigned Items and NVG
|
||||||
_holderItemsStart = getitemCargo _holder;
|
_holderItemsStart = getitemCargo _holder;
|
||||||
_targetItemsStart = ((assignedItems _target) + (items _target) + [headgear _target]);
|
_targetItemsStart = (assignedItems _target) + (items _target);
|
||||||
|
if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);};
|
||||||
|
if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);};
|
||||||
|
|
||||||
|
|
||||||
_addToCrateClassnames = [];
|
_addToCrateClassnames = [];
|
||||||
_addToCrateCount = [];
|
_addToCrateCount = [];
|
||||||
@ -127,11 +130,13 @@ _addToCrateCount = [];
|
|||||||
} forEach _addToCrateClassnames;
|
} forEach _addToCrateClassnames;
|
||||||
|
|
||||||
_holderItemsEnd = getitemCargo _holder;
|
_holderItemsEnd = getitemCargo _holder;
|
||||||
_targetItemsEnd = ((assignedItems _target) + (items _target) + [headgear _target]);
|
_targetItemsEnd = (assignedItems _target) + (items _target);
|
||||||
|
if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);};
|
||||||
|
if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);};
|
||||||
|
|
||||||
//Verify Items Added (lazy count)
|
//Verify Items Added (lazy count)
|
||||||
if (((count _targetItemsStart) - (count _targetItemsEnd)) != ([_addToCrateCount] call _fncSumArray)) exitWith {
|
if (((count _targetItemsStart) - (count _targetItemsEnd)) != ([_addToCrateCount] call _fncSumArray)) exitWith {
|
||||||
|
ERR = [_targetItemsStart, _targetItemsEnd, _addToCrateClassnames, _addToCrateCount];
|
||||||
_holder setVariable [QGVAR(holderInUse), false];
|
_holder setVariable [QGVAR(holderInUse), false];
|
||||||
[_caller, _target, "Debug: Items Not Removed From Player"] call FUNC(eventTargetFinish);
|
[_caller, _target, "Debug: Items Not Removed From Player"] call FUNC(eventTargetFinish);
|
||||||
};
|
};
|
||||||
@ -144,7 +149,7 @@ if ((([_holderItemsEnd select 1] call _fncSumArray) - ([_holderItemsStart select
|
|||||||
|
|
||||||
//If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place
|
//If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place
|
||||||
//So add a dummy item and just remove at the end
|
//So add a dummy item and just remove at the end
|
||||||
_holderIsEmpty = (([_holderItemsEnd select 1] call _fncSumArray) + (count _holderMagazinesEnd)) == 0;
|
_holderIsEmpty = ([_holder] call FUNC(getAllGearContainer)) isEqualTo [[],[]];
|
||||||
if (_holderIsEmpty) then {
|
if (_holderIsEmpty) then {
|
||||||
systemChat "Debug: making dummy";
|
systemChat "Debug: making dummy";
|
||||||
_holder addItemCargoGlobal [DUMMY_ITEM, 1];
|
_holder addItemCargoGlobal [DUMMY_ITEM, 1];
|
||||||
@ -248,7 +253,7 @@ systemChat format ["PFEh start %1", time];
|
|||||||
};
|
};
|
||||||
|
|
||||||
_holder setVariable [QGVAR(holderInUse), false];
|
_holder setVariable [QGVAR(holderInUse), false];
|
||||||
[_caller, _target, "Debug: Victory!!!"] call FUNC(eventTargetFinish);
|
[_caller, _target, ""] call FUNC(eventTargetFinish);
|
||||||
};
|
};
|
||||||
|
|
||||||
}, 0.0, [_caller,_target, _listOfItemsToRemove, _holder, _holderIsEmpty, (time + TIME_MAX_WAIT), _doNotDropAmmo, _targetMagazinesEnd]] call CBA_fnc_addPerFrameHandler;
|
}, 0.0, [_caller,_target, _listOfItemsToRemove, _holder, _holderIsEmpty, (time + TIME_MAX_WAIT), _doNotDropAmmo, _targetMagazinesEnd]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
@ -22,3 +22,4 @@ PARAMS_3(_caller,_target,_errorMsg);
|
|||||||
if (_caller != ACE_player) exitWith {};
|
if (_caller != ACE_player) exitWith {};
|
||||||
|
|
||||||
systemChat format ["Debug-Caller: Disarm finished from [%1] with code [%2]", _target, _errorMsg];
|
systemChat format ["Debug-Caller: Disarm finished from [%1] with code [%2]", _target, _errorMsg];
|
||||||
|
[format ["Problem Removing Item<br/>%1", _errorMsg]] call EFUNC(common,displayTextStructured);
|
@ -11,7 +11,7 @@
|
|||||||
* Nothing
|
* Nothing
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* finishDisarmTarget
|
* eventTargetStart
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
@ -19,4 +19,20 @@
|
|||||||
|
|
||||||
PARAMS_3(_caller,_target,_listOfObjectsToRemove);
|
PARAMS_3(_caller,_target,_listOfObjectsToRemove);
|
||||||
|
|
||||||
|
_itemsToAdd = [];
|
||||||
|
{
|
||||||
|
if (_x == (uniform _target)) then {
|
||||||
|
_itemsToAdd = _itemsToAdd + (uniformItems _target);
|
||||||
|
};
|
||||||
|
if (_x == (vest _target)) then {
|
||||||
|
_itemsToAdd = _itemsToAdd + (vestItems _target);
|
||||||
|
};
|
||||||
|
} forEach _listOfObjectsToRemove;
|
||||||
|
|
||||||
|
{
|
||||||
|
if (!(_x in _listOfObjectsToRemove)) then {
|
||||||
|
_listOfObjectsToRemove pushBack _x;
|
||||||
|
};
|
||||||
|
} forEach _itemsToAdd;
|
||||||
|
|
||||||
[_caller, _target, _listOfObjectsToRemove] call FUNC(disarmDropItems);
|
[_caller, _target, _listOfObjectsToRemove] call FUNC(disarmDropItems);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
//openDisarmDialog
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_2(_caller,_target);
|
PARAMS_2(_caller,_target);
|
||||||
@ -23,9 +25,12 @@ GVAR(disarmTarget) = _target;
|
|||||||
PARAMS_5(_ctrl,_xPos,_yPos,_idc,_itemInfo);
|
PARAMS_5(_ctrl,_xPos,_yPos,_idc,_itemInfo);
|
||||||
EXPLODE_3_PVT((_itemInfo select 0),_displayText,_value,_data);
|
EXPLODE_3_PVT((_itemInfo select 0),_displayText,_value,_data);
|
||||||
|
|
||||||
|
if (isNull GVAR(disarmTarget)) exitWith {ERROR("disarmTarget is null");};
|
||||||
|
|
||||||
systemChat format ["Debug: Droping %1 from %2", _data, GVAR(disarmTarget)];
|
systemChat format ["Debug: Droping %1 from %2", _data, GVAR(disarmTarget)];
|
||||||
[ACE_player, GVAR(disarmTarget), [_data]] call FUNC(disarmDropItems);
|
["DisarmDropItems", [GVAR(disarmTarget)], [ACE_player, GVAR(disarmTarget), [_data]]] call EFUNC(common,targetEvent);
|
||||||
false
|
|
||||||
|
false //not sure what this does
|
||||||
}];
|
}];
|
||||||
|
|
||||||
//Setup PFEH
|
//Setup PFEH
|
||||||
|
@ -39,8 +39,8 @@ PARAMS_2(_listBoxCtrl,_itemsCountArray);
|
|||||||
_picture = getText (configFile >> "CfgVehicles" >> _x >> "picture");
|
_picture = getText (configFile >> "CfgVehicles" >> _x >> "picture");
|
||||||
};
|
};
|
||||||
case (isClass (configFile >> "CfgGlasses" >> _x)): {
|
case (isClass (configFile >> "CfgGlasses" >> _x)): {
|
||||||
_displayName = getText (configFile >> "CfgGoggles" >> _x >> "displayName");
|
_displayName = getText (configFile >> "CfgGlasses" >> _x >> "displayName");
|
||||||
_picture = getText (configFile >> "CfgGoggles" >> _x >> "picture");
|
_picture = getText (configFile >> "CfgGlasses" >> _x >> "picture");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user