drag boxes

This commit is contained in:
commy2 2015-03-16 14:31:16 +01:00
parent 1117942c7a
commit efb3657da3
8 changed files with 14 additions and 9 deletions

View File

@ -12,9 +12,9 @@ class Extended_PostInit_EventHandlers {
};
class Extended_Init_EventHandlers {
class ThingX {
class ReammoBox_F {
class ADDON {
init = QUOTE(if (local (_this select 0)) then {_this call DFUNC(initObject)};);
init = QUOTE(_this call DFUNC(initObject));
};
};
};

View File

@ -2,6 +2,7 @@
class CfgVehicles {
class ThingX;
class ReammoBox_F: ThingX {
XEH_ENABLED;
GVAR(canDrag) = 0;
GVAR(dragPosition[]) = {0,1,1};
GVAR(dragDirection) = 0;

View File

@ -2,7 +2,9 @@
ADDON = false;
PREP(canDrag);
PREP(initObject);
PREP(setDraggable);
PREP(startDrag);
ADDON = true;

View File

@ -0,0 +1 @@
true

View File

@ -32,9 +32,9 @@ if (isNil "_direction") then {
};
// update variables
_object setVariable [QGVAR(canDrag), _enableDrag, true];
_object setVariable [QGVAR(dragPosition), _position, true];
_object setVariable [QGVAR(dragDirection), _direction, true];
_object setVariable [QGVAR(canDrag), _enableDrag];
_object setVariable [QGVAR(dragPosition), _position];
_object setVariable [QGVAR(dragDirection), _direction];
// add action to class if it is not already present
private ["_type", "_initializedClasses"];
@ -49,7 +49,5 @@ private ["_name", "_icon", "_selection", "_statement", "_condition"];
_name = "drag";
_icon = "";
_selection = "";
_statement = {hint str _target};
_condition = {true};
[_type, 0, [_name], _name, _icon, _selection, _statement, _condition, 2] call EFUNC(interact_menu,addClassAction);
[_type, 0, [_name], _name, _icon, _selection, FUNC(startDrag), FUNC(canDrag), 2] call EFUNC(interact_menu,addClassAction);

View File

@ -0,0 +1,2 @@
hint str _target

View File

@ -18,7 +18,7 @@ private ["_objectType","_actionsVarName"];
_objectType = _target;
if (typeName _target == "OBJECT") then {
_objectType = typeOf _target;
};
};systemChat _objectType;
_actionsVarName = format [QGVAR(Act_%1), _objectType];
// Exit if the action menu is already compiled for this class

View File

@ -1,4 +1,5 @@
#include "\x\cba\addons\main\script_macros_common.hpp"
#include "\x\cba\addons\xeh\script_xeh.hpp"
// Default versioning level
#define DEFAULT_VERSIONING_LEVEL 2