Replaced spawn and sleep commands with PFHs

This commit is contained in:
ulteq 2015-04-06 14:20:31 +02:00
parent c1aad2a0f5
commit 31b6c97cbe
2 changed files with 79 additions and 77 deletions

View File

@ -15,13 +15,19 @@ if (weaponLowered ACE_player) exitWith { true };
if (vehicle ACE_player != ACE_player) exitWith { true }; if (vehicle ACE_player != ACE_player) exitWith { true };
if (currentWeapon ACE_player != primaryWeapon ACE_player) exitWith { true }; if (currentWeapon ACE_player != primaryWeapon ACE_player) exitWith { true };
[] spawn {
2 cutText ["", "PLAIN"]; 2 cutText ["", "PLAIN"];
GVAR(WindInfo) = false; GVAR(WindInfo) = false;
0 cutText ["", "PLAIN"]; 0 cutText ["", "PLAIN"];
GVAR(Protractor) = true; GVAR(Protractor) = true;
while {GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player} do { [{
// abort condition
if (!(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player)) exitWith {
GVAR(Protractor) = false;
1 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
_refPosition = [SafeZoneX + 0.001, SafeZoneY + 0.001, 0.2, 0.2 * 4/3]; _refPosition = [SafeZoneX + 0.001, SafeZoneY + 0.001, 0.2, 0.2 * 4/3];
_inclinationAngle = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2); _inclinationAngle = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2);
@ -40,11 +46,6 @@ if (currentWeapon ACE_player != primaryWeapon ACE_player) exitWith { true };
__ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa)); __ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa));
__ctrl2 ctrlSetTextColor [1, 1, 1, 1]; __ctrl2 ctrlSetTextColor [1, 1, 1, 1];
sleep 0.1; }, 0.1, _this select 0] call CBA_fnc_addPerFrameHandler;
};
GVAR(Protractor) = false;
1 cutText ["", "PLAIN"];
};
true true

View File

@ -13,13 +13,19 @@ if (GVAR(WindInfo)) exitWith {
if (underwater ACE_player) exitWith { true }; if (underwater ACE_player) exitWith { true };
if (vehicle ACE_player != ACE_player) exitWith { true }; if (vehicle ACE_player != ACE_player) exitWith { true };
[] spawn {
2 cutText ["", "PLAIN"]; 2 cutText ["", "PLAIN"];
GVAR(Protractor) = false; GVAR(Protractor) = false;
1 cutText ["", "PLAIN"]; 1 cutText ["", "PLAIN"];
GVAR(WindInfo) = true; GVAR(WindInfo) = true;
while {GVAR(WindInfo) && !(underwater ACE_player) && vehicle ACE_player == ACE_player} do { [{
// abort condition
if (!(GVAR(WindInfo) && !(underwater ACE_player) && vehicle ACE_player == ACE_player)) exitWith {
GVAR(WindInfo) = false;
0 cutText ["", "PLAIN"];
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
_windIndex = 12; _windIndex = 12;
_windColor = [1, 1, 1, 1]; _windColor = [1, 1, 1, 1];
@ -54,11 +60,6 @@ if (vehicle ACE_player != ACE_player) exitWith { true };
__ctrl ctrlSetText format[QUOTE(PATHTOF(UI\wind%1.paa)), _windIndex]; __ctrl ctrlSetText format[QUOTE(PATHTOF(UI\wind%1.paa)), _windIndex];
__ctrl ctrlSetTextColor _windColor; __ctrl ctrlSetTextColor _windColor;
sleep 0.5; }, 0.5, _this select 0] call CBA_fnc_addPerFrameHandler;
};
GVAR(WindInfo) = false;
0 cutText ["", "PLAIN"];
};
true true