DragandDrop Frisking WIP

This commit is contained in:
PabstMirror 2015-02-22 18:44:33 -06:00
parent 444f88eb05
commit 744f37d18a
7 changed files with 175 additions and 0 deletions

View File

@ -56,6 +56,13 @@ class CfgVehicles {
priority = 80080;
};
class ACE_openFrisk2: ACE_primaryweapononly {
displayName = "Frisk2";
condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFrisk2));
statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFrisk2));
priority = 80078;
};
};
};
};

View File

@ -3,9 +3,12 @@
ADDON = false;
PREP(canDisarm);
PREP(canFrisk2);
PREP(disarmDropItems);
PREP(doFrisk2);
PREP(finishDisarmCaller);
PREP(finishDisarmTarget);
PREP(getAllGear);
PREP(startDisarmCaller);
PREP(startDisarmTarget);

View File

@ -16,3 +16,4 @@ class CfgPatches {
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "gui_disarm.hpp"

View File

@ -0,0 +1,8 @@
#include "script_component.hpp"
PARAMS_2(_caller,_target);
(_target getVariable ["ACE_isUnconscious", false]) ||
{_target getVariable [QEGVAR(captives,isHandcuffed), false]} ||
{_target getVariable [QEGVAR(captives,isSurrendering), false]}

View File

@ -0,0 +1,68 @@
#include "script_component.hpp"
PARAMS_2(_caller,_target);
closeDialog 0;
createDialog "ace_disarming_friskInventory";
disableSerialization;
_display = uiNamespace getVariable ['PABST_friskInventory', displayNull];
_pc = _display displayCtrl 633;
_pc ctrlAddEventHandler ["LBDrop", {
x2 = _this;
systemChat format ["LBDrop pc %1", _this];
// PARAMS_5(_ctrl,_xPos,_yPos,_idc,_itemInfo);
// EXPLODE_PVT_3((_itemInfo select 0),_displayText,_value,_data);
// _ctrl lbAdd _data;
(x2 select 0) lbAdd (((x2 select 4) select 0) select 2);
}];
_gc = _display displayCtrl 632;
// _gc ctrlAddEventHandler ["LBDrag", {x1 = _this;systemChat format ["LBDrag %1", _this]}];
// _gc ctrlAddEventHandler ["LBDragging", {systemChat format ["LBDragging %1", _this]}];
// _gc ctrlAddEventHandler ["LBDrop", {systemChat format ["LBDrop gc %1", _this]}];
// _gc ctrlSetActiveColor [0,0,0,1];
_uniqueItems = [player] call ace_disarming_fnc_getAllGear;
{
_displayName = "";
_picture = "";
_count = (_uniqueItems select 1) select _forEachIndex;
switch (true) do {
case (isClass (configFile >> "CfgWeapons" >> _x)): {
_displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName");
_picture = getText (configFile >> "CfgWeapons" >> _x >> "picture");
};
case (isClass (configFile >> "CfgMagazines" >> _x)): {
_displayName = getText (configFile >> "CfgMagazines" >> _x >> "displayName");
_picture = getText (configFile >> "CfgMagazines" >> _x >> "picture");
};
case (isClass (configFile >> "CfgVehicles" >> _x)): {
_displayName = getText (configFile >> "CfgVehicles" >> _x >> "displayName");
_picture = getText (configFile >> "CfgVehicles" >> _x >> "picture");
};
case (isClass (configFile >> "CfgGlasses" >> _x)): {
_displayName = getText (configFile >> "CfgGoggles" >> _x >> "displayName");
_picture = getText (configFile >> "CfgGoggles" >> _x >> "picture");
};
};
_gc lbAdd format ["1x %2", _count, _displayName];
_gc lbSetData [_forEachIndex, _x];
_gc lbSetPicture [_forEachIndex, _picture];
} forEach (_uniqueItems select 0);

View File

@ -0,0 +1,33 @@
#include "script_component.hpp"
PARAMS_1(_target);
_allItems = ((weapons _target) + (magazines _target) + (items _target) + (assignedItems _target));
if ((backpack _target) != "") then {
_allItems pushBack (backpack _target);
};
if ((vest _target) != "") then {
_allItems pushBack (vest _target);
};
if ((uniform _target) != "") then {
_allItems pushBack (uniform _target);
};
if ((headgear _target) != "") then {
_allItems pushBack (headgear _target);
};
_uniqueClassnames = [];
_classnamesCount = [];
//Filter unique and count
{
_index = _uniqueClassnames find _x;
if (_index != -1) then {
_classnamesCount set [_index, ((_classnamesCount select _index) + 1)];
} else {
_uniqueClassnames pushBack _x;
_classnamesCount pushBack 1;
};
} forEach _allItems;
[_uniqueClassnames, _classnamesCount]

View File

@ -0,0 +1,55 @@
class RscText;
class RscListBox;
class GVAR(friskInventory) {
idd = -1;
movingEnable = 0;
enableSimulation = 1;
enableDisplay = 1;
onLoad = "uiNamespace setVariable ['PABST_friskInventory', _this select 0];";
duration = 2147483647;
fadein = 0;
fadeout = 0;
class controlsBackground {};
class controls {
class CA_ContainerBackground: RscText {
idc = -1;
x = "7.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "12 * (safeZoneH / 40)";
h = "22.5 * ((safeZoneH / 1.2) / 25)";
colorBackground[] = {0.05,0.05,0.05,0.7};
};
class CA_ContainerBackground2: CA_ContainerBackground {
idc = -1;
x = "20.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
};
class GroundContainer: RscListBox {
idc = 632;
sizeEx = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
sizeEx2 = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
rowHeight = "1.1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
canDrag = 1;
colorText[] = {1,1,1,1};
colorBackground[] = {0,0,0,0};
itemBackground[] = {1,1,1,0.1};
itemSpacing = 0.001;
x = "8 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)";
w = "11 * (safeZoneH / 40)";
h = "21.5 * ((safeZoneH / 1.2) / 25)";
};
class TargetContainer: GroundContainer {
idc = 633;
canDrag = 0;
x = "21 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)";
};
};
};