More Work

This commit is contained in:
PabstMirror 2015-02-27 16:16:35 -06:00
parent d55aed0813
commit 32f67487b5
8 changed files with 24 additions and 32 deletions

View File

@ -1,4 +1,4 @@
#include "script_component.hpp"
["Disarm", {_this call FUNC(startDisarmTarget)}] call EFUNC(common,addEventHandler);
["DisarmFinished", {_this call FUNC(eventCallerFinish)}] call EFUNC(common,addEventHandler);
["DisarmStart", {_this call FUNC(startDisarmTarget)}] call EFUNC(common,addEventHandler);
["DisarmDebugCallback", {_this call FUNC(eventCallerFinish)}] call EFUNC(common,addEventHandler);

View File

@ -3,13 +3,13 @@
ADDON = false;
PREP(canDisarm);
PREP(canFrisk2);
PREP(disarmDropItems);
PREP(doFrisk2);
PREP(finishDisarmCaller);
PREP(finishDisarmTarget);
PREP(getAllGear);
PREP(startDisarmCaller);
PREP(startDisarmTarget);
PREP(eventCallerFinish);
PREP(eventTargetFinish);
PREP(eventTargetStart);
PREP(getAllGearContainer);
PREP(getAllGearUnit);
PREP(openDisarmDialog);
PREP(showItemsInListbox);
ADDON = true;

View File

@ -46,13 +46,14 @@ if (!_doNotDropAmmo) then {
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
_holder = _x;
};
} forEach ((getpos _target) nearObjects ["WeaponHolderSimulated", 3]);
} forEach ((getpos _target) nearObjects ["GroundWeaponHolder", 3]);
};
if (isNull _holder) then {
_dropPos = _target modelToWorld [-0.75, 0.75, 0];
_dropPos set [2, 0];
_holder = createVehicle ["WeaponHolderSimulated", _dropPos, [], 0, "CAN_COLLIDE"];
// _holder = createVehicle ["WeaponHolderSimulated", _dropPos, [], 0, "CAN_COLLIDE"];
_holder = createVehicle ["GroundWeaponHolder", _dropPos, [], 0, "CAN_COLLIDE"];
_holder setVariable [QGVAR(disarmUnit), _target];
};

View File

@ -19,6 +19,8 @@
PARAMS_3(_caller,_target,_errorMsg);
_target setVariable [QGVAR(disarmInProgress), false];
["DisarmFinished", [_caller], [_caller, _target, _errorMsg]] call EFUNC(common,targetEvent);
if (_errorMsg != "") then {
systemChat _errorMsg;
["DisarmDebugCallback", [_caller], [_caller, _target, _errorMsg]] call EFUNC(common,targetEvent);
};

View File

@ -19,16 +19,4 @@
PARAMS_3(_caller,_target,_listOfObjectsToRemove);
[{
PARAMS_2(_args,_pfID);
EXPLODE_3_PVT(_args,_caller,_target,_listOfObjectsToRemove);
if (!([_target] call FUNC(canDisarm))) exitWith {
[_pfID] call CBA_fnc_removePerFrameHandler;
}:
if (!(_target getVariable [QGVAR(disarmInProgress), false])) then {
[_pfID] call CBA_fnc_removePerFrameHandler;
_args call FUNC(disarmDropItems);
};
}, 0, _this] call CBA_fnc_addPerFrameHandler;
[_caller, _target, _listOfObjectsToRemove] call FUNC(disarmDropItems);

View File

@ -9,3 +9,5 @@ _allGear = [[],[]];
_allGear set [0, (_allGear select 0) + (_x select 0)];
_allGear set [1, (_allGear select 1) + (_x select 1)];
} forEach [(getWeaponCargo _target), (getItemCargo _target), (getMagazineCargo _target), (getBackpackCargo _target)];
_allGear

View File

@ -35,7 +35,7 @@ GVAR(disarmTarget) = _target;
EXPLODE_3_PVT(_args,_player,_target,_display);
if ((!([_target] call FUNC(unitCanBeDisarmed))) ||
if ((!([_target] call FUNC(canDisarm))) ||
{isNull _display} ||
{_player != ACE_player} ||
{!([] call EGVAR(common,canInteract))}) then {
@ -64,13 +64,11 @@ GVAR(disarmTarget) = _target;
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
_holder = _x;
};
} forEach ((getpos _target) nearObjects ["WeaponHolderSimulated", 3]);
} forEach ((getpos _target) nearObjects ["GroundWeaponHolder", 3]);
if (!isNull _holder) then {
_targetUniqueItems = [_holder] call FUNC(getAllGearContainer);
[_groundContainer, _targetUniqueItems] call FUNC(showItemsInListbox);
_holderUniqueItems = [_holder] call FUNC(getAllGearContainer);
[_groundContainer, _holderUniqueItems] call FUNC(showItemsInListbox);
};
};

View File

@ -19,6 +19,7 @@
disableSerialization;
PARAMS_2(_listBoxCtrl,_itemsCountArray);
{
_displayName = "";
_picture = "";