Fixed several syntax errors in fnc_buttonPressed.sqf

This commit is contained in:
ulteq 2015-04-07 19:20:38 +02:00
parent b62827c050
commit f73bdfa148
3 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@
switch (_this) do {
case 0: { // Enter
if (!GVAR(Kestrel4500_MinAvgMAx) && (GVAR(Kestrel4500_Menu) == 2 || GVAR(Kestrel4500_Menu) == 3)) then {
Kestrel4500_RefHeading = getDir ACE_player;
GVAR(Kestrel4500_RefHeading) = getDir ACE_player;
};
if (GVAR(Kestrel4500_MinAvgMAx) && GVAR(Kestrel4500_Menu) > 0 && GVAR(Kestrel4500_Menu) < 4) then {
if (GVAR(Kestrel4500_MinAvgMAxMode) != 1) then {
@ -29,14 +29,14 @@ switch (_this) do {
GVAR(Kestrel4500_ENTRIES) set [_x, 0];
} forEach [1, 2, 3];
};
GVAR(Kestrel4500_MinAvgMaxMode = (GVAR(Kestrel4500_MinAvgMaxMode + 1) % 3;
GVAR(Kestrel4500_MinAvgMaxMode) = GVAR(Kestrel4500_MinAvgMaxMode + 1) % 3;
};
};
case 1: { // Top
GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) - 1 + (count GVAR(Kestrel4500_Menu)s)) % (count GVAR(Kestrel4500_Menu)s);
GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) - 1 + (count GVAR(Kestrel4500_Menus))) % (count GVAR(Kestrel4500_Menus));
};
case 2: { // Bottom
GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) + 1 + (count GVAR(Kestrel4500_Menu)s)) % (count GVAR(Kestrel4500_Menu)s);
GVAR(Kestrel4500_Menu) = (GVAR(Kestrel4500_Menu) + 1 + (count GVAR(Kestrel4500_Menus))) % (count GVAR(Kestrel4500_Menus));
};
case 3: { // Left
GVAR(Kestrel4500_MinAvgMaxMode) = !GVAR(Kestrel4500_MinAvgMaxMode);

View File

@ -57,13 +57,13 @@ if (GVAR(Kestrel4500_MinAvgMaxMode) == 1) then {
GVAR(Kestrel4500_TOTAL) set [1, (GVAR(Kestrel4500_TOTAL) select 1) + abs(_windSpeed)];
// CROSSWIND
_crosswind = abs(sin(Kestrel4500_RefHeading - _playerDir) * _windSpeed);
_crosswind = abs(sin(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed);
GVAR(Kestrel4500_MIN) set [2, (GVAR(Kestrel4500_MIN) select 2) min _crosswind];
GVAR(Kestrel4500_MAX) set [2, _crosswind max (GVAR(Kestrel4500_MAX) select 2)];
GVAR(Kestrel4500_TOTAL) set [2, (GVAR(Kestrel4500_TOTAL) select 2) + _crosswind];
// HEADWIND
_headwind = abs(cos(Kestrel4500_RefHeading - _playerDir) * _windSpeed);
_headwind = abs(cos(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed);
GVAR(Kestrel4500_MIN) set [3, (GVAR(Kestrel4500_MIN) select 3) min _headwind];
GVAR(Kestrel4500_MAX) set [3, _headwind max (GVAR(Kestrel4500_MAX) select 3)];
GVAR(Kestrel4500_TOTAL) set [3, (GVAR(Kestrel4500_TOTAL) select 3) + _headwind];

View File

@ -94,7 +94,7 @@ switch (GVAR(Kestrel4500_Menu)) do {
};
case 2: { // CROSSWIND
if (!GVAR(Kestrel4500_MinAvgMax)) then {
_textCenterBig = Str(round(abs(sin(Kestrel4500_RefHeading - _playerDir) * _windSpeed) * 10) / 10);
_textCenterBig = Str(round(abs(sin(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed) * 10) / 10);
_textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)];
_textInfoLine2 = "- set heading";
} else {
@ -121,7 +121,7 @@ switch (GVAR(Kestrel4500_Menu)) do {
};
case 3: { // HEADWIND
if (!GVAR(Kestrel4500_MinAvgMax)) then {
_textCenterBig = Str(round(abs(cos(Kestrel4500_RefHeading - _playerDir) * _windSpeed) * 10) / 10);
_textCenterBig = Str(round(abs(cos(GVAR(Kestrel4500_RefHeading) - _playerDir) * _windSpeed) * 10) / 10);
_textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)];
_textInfoLine2 = "- set heading";
} else {