forked from zen-mod/ZEN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitKeybinds.sqf
141 lines (114 loc) · 6.83 KB
/
initKeybinds.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[ELSTRING(main,DisplayName), QGVAR(toggleIncludeCrew), LSTRING(ToggleIncludeCrew), {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
GVAR(includeCrew) = !GVAR(includeCrew);
private _ctrlIncludeCrew = findDisplay IDD_RSCDISPLAYCURATOR displayCtrl IDC_INCLUDE_CREW;
_ctrlIncludeCrew cbSetChecked GVAR(includeCrew);
};
}, {}, [DIK_B, [false, false, false]]] call CBA_fnc_addKeybind; // Default: B
[ELSTRING(main,DisplayName), QGVAR(deployCountermeasures), [LSTRING(DeployCountermeasures), LSTRING(DeployCountermeasures_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
{
[_x] call EFUNC(common,deployCountermeasures);
} forEach SELECTED_OBJECTS;
true // handled
};
}, {}, [DIK_C, [true, false, false]]] call CBA_fnc_addKeybind; // Default: SHIFT + C
[ELSTRING(main,DisplayName), QGVAR(ejectPassengers), [LSTRING(EjectPassengers), LSTRING(EjectPassengers_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
{
[_x] call EFUNC(common,ejectPassengers);
} forEach SELECTED_OBJECTS;
true // handled, prevents vanilla eject
};
}, {}, [DIK_G, [false, true, false]]] call CBA_fnc_addKeybind; // Default: CTRL + G
[ELSTRING(main,DisplayName), QGVAR(deepCopy), [LSTRING(DeepCopy), LSTRING(DeepCopy_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
private _position = [nil, false] call EFUNC(common,getPosFromScreen);
GVAR(clipboard) = [SELECTED_OBJECTS, _position, true] call EFUNC(common,serializeObjects);
playSound ["RscDisplayCurator_error01", true];
true // handled, prevents vanilla copy
};
}, {}, [DIK_C, [true, true, false]]] call CBA_fnc_addKeybind; // Default: CTRL + SHIFT + C
[ELSTRING(main,DisplayName), QGVAR(deepPaste), [LSTRING(DeepPaste), LSTRING(DeepPaste_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
private _position = [nil, false] call EFUNC(common,getPosFromScreen);
[QEGVAR(common,deserializeObjects), [GVAR(clipboard), _position, true, GVAR(randomizeCopyPaste)]] call CBA_fnc_serverEvent;
playSound ["RscDisplayCurator_error01", true];
true // handled, prevents vanilla paste
};
}, {}, [DIK_V, [true, true, false]]] call CBA_fnc_addKeybind; // Default: CTRL + SHIFT + V
[ELSTRING(main,DisplayName), QGVAR(focusSearchBar), [LSTRING(FocusSearchBar), LSTRING(FocusSearchBar_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
private _searchIDC = [IDC_RSCDISPLAYCURATOR_CREATE_SEARCH, IDC_SEARCH_CUSTOM] select GVAR(disableLiveSearch);
private _ctrlSearch = findDisplay IDD_RSCDISPLAYCURATOR displayCtrl _searchIDC;
ctrlSetFocus _ctrlSearch;
};
}, {}, [DIK_F, [false, true, true]]] call CBA_fnc_addKeybind; // Default: CTRL + ALT + F
[ELSTRING(main,DisplayName), QGVAR(orientTerrainNormal), ["str_3den_display3den_entitymenu_setatl_text", LSTRING(OrientTerrainNormal_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
{
if (!isPlayer _x) then {
[QEGVAR(common,setVectorUp), [_x, surfaceNormal getPos _x], _x] call CBA_fnc_targetEvent;
};
} forEach SELECTED_OBJECTS;
true // handled
};
}, {}, [DIK_X, [false, true, false]]] call CBA_fnc_addKeybind; // Default: CTRL + X
[ELSTRING(main,DisplayName), QGVAR(toggleIcons), [LSTRING(ToggleIcons), LSTRING(ToggleIcons_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
GVAR(iconsVisible) = !GVAR(iconsVisible);
private _ctrlEntites = findDisplay IDD_RSCDISPLAYCURATOR displayCtrl IDC_RSCDISPLAYCURATOR_ENTITIES;
if (GVAR(iconsVisible)) then {
tvExpandAll _ctrlEntites;
} else {
_ctrlEntites call EFUNC(common,collapseTree);
};
};
}, {}, [0, [false, false, false]]] call CBA_fnc_addKeybind; // Default: Unbound
[ELSTRING(main,DisplayName), QGVAR(watchCursor), [LSTRING(WatchCursor), LSTRING(WatchCursor_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
curatorMouseOver params ["_type", "_entity", "_index"];
private _isCancelling = (_type == "OBJECT") && {_entity in SELECTED_OBJECTS};
private _gunners = (SELECTED_OBJECTS apply {gunner vehicle _x}) - [objNull];
private _cursorPosASL = call EFUNC(common,getCursorPosition);
{
[QEGVAR(common,doWatch), [_x, [ASLToAGL _cursorPosASL, objNull] select _isCancelling], _x] call CBA_fnc_targetEvent;
} forEach _gunners;
true // handled, prevents vanilla eject
};
}, {}, [0, [false, false, false]]] call CBA_fnc_addKeybind; // Default: Unbound
[ELSTRING(main,DisplayName), QGVAR(moveToCursor), [LSTRING(MoveToCursor), LSTRING(MoveToCursor_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
private _cursorPosASL = call EFUNC(common,getCursorPosition);
{
if (!isNull driver _x) then {
[QEGVAR(common,doMove), [_x, ASLToAGL _cursorPosASL], _x] call CBA_fnc_targetEvent;
};
} forEach SELECTED_OBJECTS;
true // handled, prevents vanilla eject
};
}, {}, [0, [false, false, false]]] call CBA_fnc_addKeybind; // Default: Unbound
[ELSTRING(main,DisplayName), QGVAR(toggleAIPATH), [LSTRING(ToggleAIPATH), LSTRING(ToggleAIPATH_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false) && {count SELECTED_OBJECTS > 0}}) then {
private _disabled = 0;
private _enabled = 0;
private _drivers = (SELECTED_OBJECTS apply {driver vehicle _x}) - [objNull];
_drivers = _drivers arrayIntersect _drivers;
{
private _isAIEnalbedPATH = _x getVariable [QEGVAR(common,isAIEnalbedPATH), true];
private _AIEvent = [QEGVAR(common,enableAI), QEGVAR(common,disableAI)] select _isAIEnalbedPATH;
[_AIEvent, [_x, "PATH"], _x] call CBA_fnc_targetEvent;
_x setVariable [QEGVAR(common,isAIEnalbedPATH), !_isAIEnalbedPATH, true];
if (_isAIEnalbedPATH) then {
_disabled = _disabled + 1;
} else {;
_enabled = _enabled + 1;
};
} forEach _drivers;
private _message = "PATH " +
(["", format [" - disabled: %1", _disabled]] select (_disabled > 0)) +
(["", format [" - enabled: %1", _enabled]] select (_enabled > 0));
[_message] call EFUNC(common,showMessage);
true // handled, prevents vanilla eject
};
}, {}, [0, [false, false, false]]] call CBA_fnc_addKeybind; // Default: Unbound