Skip to content

Commit

Permalink
Small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeno69 committed Jul 11, 2020
1 parent 625083f commit 09614b8
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 22 deletions.
18 changes: 10 additions & 8 deletions co30_Domination.Altis/ar/fn_Client_Rappel_From_Heli.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,22 @@ if (local _player) then {
_player setVariable ["AR_RANDOM_DECEND_SPEED_ADJUSTMENT", 0];

_ropeKeyDownHandler = (findDisplay 46) displayAddEventHandler ["KeyDown", {
if (_this select 1 in (actionKeys "MoveBack")) then {
if ((_this # 1) in (actionKeys "MoveBack")) then {
player setVariable ["AR_DECEND_PRESSED", true];
};
if (_this select 1 in (actionKeys "Turbo")) then {
player setVariable ["AR_FAST_DECEND_PRESSED", true];
} else {
if ((_this # 1) in (actionKeys "Turbo")) then {
player setVariable ["AR_FAST_DECEND_PRESSED", true];
};
};
}];

_ropeKeyUpHandler = (findDisplay 46) displayAddEventHandler ["KeyUp", {
if (_this select 1 in (actionKeys "MoveBack")) then {
if ((_this # 1) in (actionKeys "MoveBack")) then {
player setVariable ["AR_DECEND_PRESSED", false];
};
if (_this select 1 in (actionKeys "Turbo")) then {
player setVariable ["AR_FAST_DECEND_PRESSED", false];
} else {
if ((_this # 1) in (actionKeys "Turbo")) then {
player setVariable ["AR_FAST_DECEND_PRESSED", false];
};
};
}];
} else {
Expand Down
2 changes: 1 addition & 1 deletion co30_Domination.Altis/client/fn_earplugs.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define THIS_FILE "fn_earplugs.sqf"
#include "..\x_setup.sqf"

if ((_this select 1) in actionKeys d_earplugs_userakey_str && {alive player && {!(player getVariable "xr_pluncon") && {!(player getVariable ["ace_isunconscious", false]) && {!(_this select 2) && {!(_this select 3) && {!(_this select 4)}}}}}}) then {
if ((_this # 1) in actionKeys d_earplugs_userakey_str && {alive player && {!(player getVariable "xr_pluncon") && {!(player getVariable ["ace_isunconscious", false]) && {!(_this # 2) && {!(_this # 3) && {!(_this # 4)}}}}}}) then {
if (d_earplugs_fitted) then {
d_earplugs_fitted = false;
2 fadeSound 1;
Expand Down
2 changes: 1 addition & 1 deletion co30_Domination.Altis/client/fn_jail.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (_enhmm) then {
d_usactckey append (actionKeys format ["User%1", _i]);
};
_keyeh = (findDisplay 46) displayAddEventHandler ["KeyDown", {
((_this select 1) in d_usactckey)
((_this # 1) in d_usactckey)
}];
};

Expand Down
2 changes: 1 addition & 1 deletion co30_Domination.Altis/client/fn_jumpover.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define THIS_FILE "fn_jumpover.sqf"
#include "..\x_setup.sqf"

if ((_this select 1) in actionKeys "GetOver" && {alive player && {currentWeapon player == primaryWeapon player && {currentWeapon player != "" && {isNull objectParent player && {speed player > 11 && {stance player == "STAND" && {getFatigue player < 0.5 && {isTouchingGround (vehicle player) && {!(player getVariable ["xr_pluncon", false]) && {!(player getVariable ["ace_isunconscious", false]) && {!d_p_isju}}}}}}}}}}}) then {
if ((_this # 1) in actionKeys "GetOver" && {alive player && {currentWeapon player == primaryWeapon player && {currentWeapon player != "" && {isNull objectParent player && {speed player > 11 && {stance player == "STAND" && {getFatigue player < 0.5 && {isTouchingGround (vehicle player) && {!(player getVariable ["xr_pluncon", false]) && {!(player getVariable ["ace_isunconscious", false]) && {!d_p_isju}}}}}}}}}}}) then {
d_p_isju = true;
0 spawn {
scriptName "spawn jumpover";
Expand Down
2 changes: 1 addition & 1 deletion co30_Domination.Altis/client/fn_keydown_dyng.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__TRACE_1("","_this")

if ((_this select 1) in (actionKeys "TeamSwitch") && {!(_this select 2) && {!(_this select 3) && {!(_this select 4) && {alive player && {!(player getVariable "xr_pluncon") && {!(player getVariable ["ace_isunconscious", false])}}}}}}) then {
if ((_this # 1) in (actionKeys "TeamSwitch") && {!(_this # 2) && {!(_this # 3) && {!(_this # 4) && {alive player && {!(player getVariable "xr_pluncon") && {!(player getVariable ["ace_isunconscious", false])}}}}}}) then {
[0, _this] call d_fnc_KeyDownCommandingMenu;
true
} else {
Expand Down
2 changes: 1 addition & 1 deletion co30_Domination.Altis/client/fn_keyup_dyng.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define THIS_FILE "fn_keyup_dyng.sqf"
#include "..\x_setup.sqf"

if ((_this select 1) in (actionKeys "TeamSwitch") && {!(_this select 2) && {!(_this select 3) && {!(_this select 4)}}}) then {
if ((_this # 1) in (actionKeys "TeamSwitch") && {!(_this # 2) && {!(_this # 3) && {!(_this # 4)}}}) then {
[1, _this] call d_fnc_KeyDownCommandingMenu;
true
} else {
Expand Down
2 changes: 1 addition & 1 deletion co30_Domination.Altis/client/fn_ropekeyb.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#define THIS_FILE "fn_ropekeyb.sqf"
#include "..\x_setup.sqf"

((_this select 1) in actionKeys "HeliRopeAction" || {(_this select 1) in actionKeys "HeliSlingLoadManager" || {inputAction "HeliRopeAction" > 0 || {inputAction "HeliSlingLoadManager" > 0}}})
((_this # 1) in actionKeys "HeliRopeAction" || {(_this # 1) in actionKeys "HeliSlingLoadManager" || {inputAction "HeliRopeAction" > 0 || {inputAction "HeliSlingLoadManager" > 0}}})
2 changes: 1 addition & 1 deletion co30_Domination.Altis/client/fn_toggle3dm.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define THIS_FILE "fn_toggle3dm.sqf"
#include "..\x_setup.sqf"

if ((_this select 1) in actionKeys d_3dmarker_userakey_str && {alive player && {!(player getVariable "xr_pluncon") && {!(player getVariable ["ace_isunconscious", false]) && {!(_this select 2) && {!(_this select 3) && {!(_this select 4)}}}}}}) then {
if ((_this # 1) in actionKeys d_3dmarker_userakey_str && {alive player && {!(player getVariable "xr_pluncon") && {!(player getVariable ["ace_isunconscious", false]) && {!(_this # 2) && {!(_this # 3) && {!(_this # 4)}}}}}}) then {
d_showallnearusermarkers = !d_showallnearusermarkers;
if (d_showallnearusermarkers) then {
"d_usermarkers" cutText ["<br/><br/><t color='#339933' size='2'font='PuristaBold'>" + localize "STR_DOM_MISSIONSTRING_1946" + "</t>", "PLAIN DOWN", -1, true, true];
Expand Down
4 changes: 2 additions & 2 deletions co30_Domination.Altis/clientui/fn_draw3dstuff.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private _d3d_locs4a = d_d3d_locs4a;
} else {
drawIcon3D [_tex, [0, 0, 1, 1 - (_distp / 200)], ASLToAGL ((getPosASL _obj) vectorAdd [0, 0, (_x # 2) + (_distp * 0.05)]), 1, 1, 0, format [_d3d_locs4a, round (_cwt - serverTime)], 1, 0.033 - (_distp / 9000), "RobotoCondensed"];
};
} forEach (_d_3draw_ar select {alive (_x select 0) && {_pos_cam distance2D (_x select 0) < 250}});
} forEach (_d_3draw_ar select {alive (_x # 0) && {_pos_cam distance2D (_x # 0) < 250}});

private _d_all_p_a_boxes = d_all_p_a_boxes;
{
Expand All @@ -49,7 +49,7 @@ private _d_all_p_a_boxes = d_all_p_a_boxes;
} else {
drawIcon3D ["#(argb,8,8,3)color(0,0,0,0)", _col, ASLToAGL ((getPosASL _box) vectorAdd [0, 0, 1.5 + (_distp * 0.05)]), 1, 1, 0, _txt, 1, 0.033 - (_distp / 9000), "RobotoCondensed"];
};
} forEach (_d_all_p_a_boxes select {!isNull (_x select 0) && {_pos_cam distance2D (_x select 0) < 80}});
} forEach (_d_all_p_a_boxes select {!isNull (_x # 0) && {_pos_cam distance2D (_x # 0) < 80}});

if (d_with_ai) then {
private _d_allai_recruit_objs = d_allai_recruit_objs;
Expand Down
Binary file modified co30_Domination.Altis/mission.sqm
Binary file not shown.
4 changes: 2 additions & 2 deletions co30_Domination.Altis/revive/fn_dragkeydown.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

#include "\a3\editor_f\Data\Scripts\dikCodes.h"

if (!(_this select 2) && {!(_this select 3) && {!(_this select 4)}}) then {
(_this select 1) in xr_drag_keys_ar
if (!(_this # 2) && {!(_this # 3) && {!(_this # 4)}}) then {
(_this # 1) in xr_drag_keys_ar
}
6 changes: 3 additions & 3 deletions co30_Domination.Altis/revive/fn_spectkeyeh.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
__TRACE_1("","_this")

private _res = false;
if (_this select 1 == DIK_N) then {
if ((_this # 1) == DIK_N) then {
if (!xr_camnvgon) then {
camUseNVG true;
xr_camnvgon = true;
Expand All @@ -20,7 +20,7 @@ if (_this select 1 == DIK_N) then {
};
_res = true;
} else {
if (_this select 1 == DIK_M) then {
if ((_this # 1) == DIK_M) then {
__TRACE("DIK M")
if (ctrlShown ((uiNamespace getVariable "XR_SpectDlg") displayCtrl 1000)) then {
__TRACE("1000 shown")
Expand All @@ -40,7 +40,7 @@ if (_this select 1 == DIK_N) then {
};
_res = true;
} else {
if (_this select 1 == DIK_P) then {
if ((_this # 1) == DIK_P) then {
__TRACE("DIK P")
if (ctrlShown ((uiNamespace getVariable "XR_SpectDlg") displayCtrl 3000)) then {
ctrlShow [3000, false];
Expand Down

0 comments on commit 09614b8

Please sign in to comment.