mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
drag boxes
This commit is contained in:
parent
1117942c7a
commit
efb3657da3
@ -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));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -2,7 +2,9 @@
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(canDrag);
|
||||
PREP(initObject);
|
||||
PREP(setDraggable);
|
||||
PREP(startDrag);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -0,0 +1 @@
|
||||
true
|
@ -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);
|
||||
|
@ -0,0 +1,2 @@
|
||||
|
||||
hint str _target
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user