From b1f9e17ab01be6be62734f224697cf2f51919a0a Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Tue, 4 Aug 2015 02:11:24 +0200 Subject: [PATCH 001/311] Updated parameterization in Weather module. --- addons/weather/functions/fnc_calculateAirDensity.sqf | 4 ++-- .../weather/functions/fnc_calculateBarometricPressure.sqf | 4 ++-- addons/weather/functions/fnc_calculateDewPoint.sqf | 4 ++-- addons/weather/functions/fnc_calculateHeatIndex.sqf | 6 +++--- addons/weather/functions/fnc_calculateRoughnessLength.sqf | 4 ++-- .../weather/functions/fnc_calculateTemperatureAtHeight.sqf | 4 ++-- addons/weather/functions/fnc_calculateWetBulb.sqf | 4 ++-- addons/weather/functions/fnc_calculateWindChill.sqf | 6 +++--- addons/weather/functions/fnc_calculateWindSpeed.sqf | 4 ++-- addons/weather/functions/fnc_getWind.sqf | 5 +++-- addons/weather/functions/fnc_initModuleSettings.sqf | 7 +++---- addons/weather/functions/fnc_updateRain.sqf | 4 ++-- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/addons/weather/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf index 921bff3bf3..f3de65f99d 100644 --- a/addons/weather/functions/fnc_calculateAirDensity.sqf +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -9,14 +9,14 @@ * 2: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: density of air - kg * m^(-3) + * density of air - kg * m^(-3) * * Return value: * None */ #include "script_component.hpp" -PARAMS_3(_temperature,_pressure,_relativeHumidity); +params ["_temperature", "_pressure", "_relativeHumidity"]; _pressure = _pressure * 100; // hPa to Pa diff --git a/addons/weather/functions/fnc_calculateBarometricPressure.sqf b/addons/weather/functions/fnc_calculateBarometricPressure.sqf index 869deb93cb..134a741127 100644 --- a/addons/weather/functions/fnc_calculateBarometricPressure.sqf +++ b/addons/weather/functions/fnc_calculateBarometricPressure.sqf @@ -4,10 +4,10 @@ * Calculates the barometric pressure based on altitude and weather * * Arguments: - * 0: altitude - meters + * altitude - meters * * Return Value: - * 0: barometric pressure - hPA + * barometric pressure - hPA * * Return value: * None diff --git a/addons/weather/functions/fnc_calculateDewPoint.sqf b/addons/weather/functions/fnc_calculateDewPoint.sqf index 76656b1f55..cbfc606054 100644 --- a/addons/weather/functions/fnc_calculateDewPoint.sqf +++ b/addons/weather/functions/fnc_calculateDewPoint.sqf @@ -8,7 +8,7 @@ * 2: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: dew point + * dew point * * Return value: * None @@ -18,7 +18,7 @@ #define __b 17.67 #define __c 243.5 -PARAMS_2(_t,_rh); +params ["_t", "_rh"]; if (_rh == 0) exitWith { CELSIUS(0) }; diff --git a/addons/weather/functions/fnc_calculateHeatIndex.sqf b/addons/weather/functions/fnc_calculateHeatIndex.sqf index 473360c867..057c13d7ad 100644 --- a/addons/weather/functions/fnc_calculateHeatIndex.sqf +++ b/addons/weather/functions/fnc_calculateHeatIndex.sqf @@ -5,10 +5,10 @@ * * Arguments: * 0: temperature - degrees celcius - * 2: relativeHumidity - value between 0.0 and 1.0 + * 1: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: heat index + * heat index * * Return value: * None @@ -24,7 +24,7 @@ #define __C7 0.000687678 #define __C8 0.000274954 -PARAMS_2(_t,_rh); +params ["_t", "_rh"]; // Source: https://en.wikipedia.org/wiki/Heat_index diff --git a/addons/weather/functions/fnc_calculateRoughnessLength.sqf b/addons/weather/functions/fnc_calculateRoughnessLength.sqf index 08ae44cc74..4fd0d18fb3 100644 --- a/addons/weather/functions/fnc_calculateRoughnessLength.sqf +++ b/addons/weather/functions/fnc_calculateRoughnessLength.sqf @@ -4,10 +4,10 @@ * Calculates the terrain roughness length at a given world position * * Arguments: - * 0: _this - world position + * world position * * Return Value: - * 0: roughness length + * roughness length * * Public: No */ diff --git a/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf b/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf index dd31dfe05e..5e02795d59 100644 --- a/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf +++ b/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf @@ -4,10 +4,10 @@ * Calculates the temperature based on altitude and weather * * Arguments: - * 0: height - meters + * height - meters * * Return Value: - * 0: temperature - degrees celsius + * temperature - degrees celsius * * Return value: * None diff --git a/addons/weather/functions/fnc_calculateWetBulb.sqf b/addons/weather/functions/fnc_calculateWetBulb.sqf index c180cf8384..94e96cd11b 100644 --- a/addons/weather/functions/fnc_calculateWetBulb.sqf +++ b/addons/weather/functions/fnc_calculateWetBulb.sqf @@ -9,7 +9,7 @@ * 2: relativeHumidity - value between 0.0 and 1.0 * * Return Value: - * 0: wet bulb + * wet bulb * * Return value: * None @@ -18,7 +18,7 @@ private ["_es", "_e", "_eDiff", "_eGuessPrev", "_cTempDelta", "_twGuess", "_eguess"]; -PARAMS_3(_temperature,_pressure,_relativeHumidity); +params ["_temperature", "_pressure", "_relativeHumidity"]; // Source: http://cosmoquest.org/forum/showthread.php?155366-Calculating-Wet-Bulb-Temperature-from-RH-amp-Dry-Bulb _es = 6.112 * exp((17.67 * _temperature) / (_temperature + 243.5)); diff --git a/addons/weather/functions/fnc_calculateWindChill.sqf b/addons/weather/functions/fnc_calculateWindChill.sqf index 021d2f8b99..ee3a20283b 100644 --- a/addons/weather/functions/fnc_calculateWindChill.sqf +++ b/addons/weather/functions/fnc_calculateWindChill.sqf @@ -5,16 +5,16 @@ * * Arguments: * 0: temperature - degrees celcius - * 2: wind speed - m/s + * 1: wind speed - m/s * * Return Value: - * 0: wind chill + * wind chill * * Public: No */ #include "script_component.hpp" -PARAMS_2(_t,_v); +params ["_t", "_v"]; // Source: https://en.wikipedia.org/wiki/Wind_chill diff --git a/addons/weather/functions/fnc_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf index d991897b97..fc1ac81a57 100644 --- a/addons/weather/functions/fnc_calculateWindSpeed.sqf +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -10,7 +10,7 @@ * 3: Account for obstacles * * Return Value: - * 0: wind speed - m/s + * wind speed - m/s * * Public: No */ @@ -18,7 +18,7 @@ private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; -PARAMS_4(_position,_windGradientEnabled,_terrainEffectEnabled,_obstacleEffectEnabled); +params ["_position", "_windGradientEnabled", "_terrainEffectEnabled", "_obstacleEffectEnabled"]; fnc_polar2vect = { private ["_mag2D"]; diff --git a/addons/weather/functions/fnc_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf index 5b123afaa0..7e133896a6 100644 --- a/addons/weather/functions/fnc_getWind.sqf +++ b/addons/weather/functions/fnc_getWind.sqf @@ -11,11 +11,12 @@ */ #include "script_component.hpp" +private ["_periodPercent", "_periodPosition"]; + if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] }; -EXPLODE_5_PVT(ACE_WIND_PARAMS,_dir,_dirChange,_spd,_spdChange,_period); +ACE_WIND_PARAMS params ["_dir", "_dirChange", "_spd", "_spdChange", "_period"]; -private ["_periodPercent", "_periodPosition"]; _periodPosition = (ACE_time - GVAR(wind_period_start_time)) min _period; _periodPercent = _periodPosition / _period; diff --git a/addons/weather/functions/fnc_initModuleSettings.sqf b/addons/weather/functions/fnc_initModuleSettings.sqf index eb0eaafc31..e6977f01f9 100644 --- a/addons/weather/functions/fnc_initModuleSettings.sqf +++ b/addons/weather/functions/fnc_initModuleSettings.sqf @@ -16,9 +16,8 @@ #include "script_component.hpp" private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; + +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; @@ -36,4 +35,4 @@ if !(_activated) exitWith {}; // Server weather update interval [_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule); -GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; \ No newline at end of file +GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; diff --git a/addons/weather/functions/fnc_updateRain.sqf b/addons/weather/functions/fnc_updateRain.sqf index ced8641f61..6c4c829747 100644 --- a/addons/weather/functions/fnc_updateRain.sqf +++ b/addons/weather/functions/fnc_updateRain.sqf @@ -14,8 +14,8 @@ if (!GVAR(syncRain)) exitWith {}; if (!isNil "ACE_RAIN_PARAMS") then { - EXPLODE_3_PVT(ACE_RAIN_PARAMS,_oldRain,_newRain,_period); - + ACE_RAIN_PARAMS params ["_oldRain", "_newRain", "_period"]; + private ["_periodPosition", "_periodPercent"]; _periodPosition = (ACE_time - GVAR(rain_period_start_time)) min _period; _periodPercent = (_periodPosition / _period) min 1; From 95f055f5a499c478c637efcd05044b0dd1aca075 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Wed, 5 Aug 2015 00:14:50 +0200 Subject: [PATCH 002/311] Small correction --- addons/weather/functions/fnc_initModuleSettings.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/weather/functions/fnc_initModuleSettings.sqf b/addons/weather/functions/fnc_initModuleSettings.sqf index e6977f01f9..034612ab58 100644 --- a/addons/weather/functions/fnc_initModuleSettings.sqf +++ b/addons/weather/functions/fnc_initModuleSettings.sqf @@ -15,8 +15,6 @@ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; - params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; From 83e13e3cd3a417904343c874d6a60c5584b17a9a Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Wed, 5 Aug 2015 01:53:11 +0200 Subject: [PATCH 003/311] Fixed non-private function and slightly improved performance --- .../functions/fnc_calculateWindSpeed.sqf | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/addons/weather/functions/fnc_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf index fc1ac81a57..87c6c49d42 100644 --- a/addons/weather/functions/fnc_calculateWindSpeed.sqf +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -16,18 +16,20 @@ */ #include "script_component.hpp" -private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; +private ["_fnc_polar2vect", "_windSpeed", "_windDir", "_windDirAdjusted", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; params ["_position", "_windGradientEnabled", "_terrainEffectEnabled", "_obstacleEffectEnabled"]; -fnc_polar2vect = { +_fnc_polar2vect = { private ["_mag2D"]; - _mag2D = (_this select 0) * cos((_this select 2)); - [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; + params ["_x", "_y", "_z"]; + _mag2D = _x * cos(_z); + [_mag2D * sin(_y), _mag2D * cos(_y), _x * sin(_z)]; }; _windSpeed = vectorMagnitude ACE_wind; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); +_windDirAdjusted = _windDir + 180; // Wind gradient if (_windGradientEnabled) then { @@ -46,19 +48,19 @@ if (_terrainEffectEnabled) then { if (_windSpeed > 0.05) then { _newWindSpeed = 0; { - _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; + _windSource = [100, _windDirAdjusted, _x] call _fnc_polar2vect; if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 9) * _windSpeed; }; - _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; + _windSource = [100, _windDirAdjusted + _x, 0] call _fnc_polar2vect; if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 9) * _windSpeed; }; - _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; + _windSource = [100, _windDirAdjusted - _x, 0] call _fnc_polar2vect; if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 9) * _windSpeed; }; - } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + } count [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; _windSpeed = _newWindSpeed; }; }; @@ -68,19 +70,19 @@ if (_obstacleEffectEnabled) then { if (_windSpeed > 0.05) then { _newWindSpeed = 0; { - _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; + _windSource = [20, _windDirAdjusted, _x] call _fnc_polar2vect; if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 2) * _windSpeed; }; - _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; + _windSource = [20, _windDirAdjusted + _x, 0] call _fnc_polar2vect; if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 2) * _windSpeed; }; - _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; + _windSource = [20, _windDirAdjusted - _x, 0] call _fnc_polar2vect; if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { _newWindSpeed = cos(_x * 2) * _windSpeed; }; - } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; + } count [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; _windSpeed = _newWindSpeed; }; }; From 7bdfe03c922fcd92a306871b5a7a59ec476af640 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sun, 9 Aug 2015 02:19:34 +0200 Subject: [PATCH 004/311] Code cleanup of Concertina_wire module --- addons/concertina_wire/XEH_init.sqf | 5 ++- .../concertina_wire/functions/fnc_deploy.sqf | 35 ++++++++++--------- .../functions/fnc_dismount.sqf | 8 ++--- .../functions/fnc_dismountSuccess.sqf | 22 ++++++------ .../functions/fnc_handleDamage.sqf | 9 ++--- .../functions/fnc_handleKilled.sqf | 8 ++--- .../functions/fnc_vehicleDamage.sqf | 12 +++---- 7 files changed, 45 insertions(+), 54 deletions(-) diff --git a/addons/concertina_wire/XEH_init.sqf b/addons/concertina_wire/XEH_init.sqf index dbce4a9b92..dc6424f172 100644 --- a/addons/concertina_wire/XEH_init.sqf +++ b/addons/concertina_wire/XEH_init.sqf @@ -1,4 +1,3 @@ #include "script_component.hpp" - -PARAMS_1(_wire); -_wire addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; \ No newline at end of file +params ["_wire"]; +_wire addEventHandler ["HandleDamage", FUNC(handleDamage)]; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index 5548cad649..aedc8b9608 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -8,10 +8,9 @@ * 1: unit * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -22,7 +21,7 @@ private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"]; _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; { _wireNoGeo animate [_x, 1]; -} foreach WIRE_FAST; +} count WIRE_FAST; GVAR(placer) = _unit; _dir = getDir _unit; @@ -37,8 +36,9 @@ deleteVehicle _wirecoil; _unit setVariable [QGVAR(wireDeployed), false]; GVAR(deployPFH) = [{ - EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit); - + params ["_args", "_idPFH"]; + _args params ["_wireNoGeo", "_wireNoGeoPos", "_unit"]; + private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); _posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit); @@ -46,37 +46,38 @@ GVAR(deployPFH) = [{ _dir = _dirVect call CBA_fnc_vectDir; _range = vectorMagnitude _dirVect; _anim = 0 max (1 - (_range / 12)); - + if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith { _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; { _wire animate [_x, _anim]; - } foreach WIRE_FAST; - + } count WIRE_FAST; + [{ - EXPLODE_5_PVT(_this select 0,_wireNoGeo,_wire,_anim,_dir,_wireNoGeoPos); + params ["_args", "_idPFH"]; + _args params ["_wireNoGeo", "_wire", "_anim", "_dir", "_wireNoGeoPos"]; if (_wire animationPhase "wire_2" == _anim) then { deleteVehicle _wireNoGeo; _wire setDir _dir; _wire setPosASL _wireNoGeoPos; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler; - + [_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); call EFUNC(interaction,hideMouseHint); - - [_this select 1] call CBA_fnc_removePerFrameHandler; + + [_idPFH] call CBA_fnc_removePerFrameHandler; }; - + _wireNoGeo setDir _dir; { _wireNoGeo animate [_x, _anim]; - } foreach WIRE_FAST; + } count WIRE_FAST; }, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler; [localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); - + GVAR(placer) setVariable [QGVAR(Deploy), [GVAR(placer), "DefaultAction", {GVAR(deployPFH) != -1}, diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf index c9a5d1f9ff..c7ba3f50b1 100644 --- a/addons/concertina_wire/functions/fnc_dismount.sqf +++ b/addons/concertina_wire/functions/fnc_dismount.sqf @@ -8,10 +8,9 @@ * 1: unit * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -21,8 +20,7 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit _this call FUNC(dismount); }, _this] call EFUNC(common,execNextFrame); }; - -PARAMS_2(_wire,_unit); +params ["_wire", "_unit"]; private ["_config", "_delay"]; _config = (configFile >> "CfgVehicles" >> typeOf _unit); diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf index a6e34fe44f..a3f5081271 100644 --- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -7,10 +7,9 @@ * 0: wire * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -18,25 +17,26 @@ PARAMS_1(_wire); { _wire animate [_x, 1]; -} foreach WIRE_FAST; +} count WIRE_FAST; [{ - EXPLODE_1_PVT(_this select 0,_wire); - + params ["_args", "_idPFH"]; + _args params ["_wire"]; + if (_wire animationPhase "wire_2" == 1) then { private ["_dir", "_pos", "_wirecoil"]; - + _dir = getDir _wire; _pos = getPosASL _wire; - + _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; deleteVehicle _wire; - + _wirecoil setDir _dir; _wirecoil setPosASL _pos; _wirecoil setVelocity [0, 0, 0]; - - [_this select 1] call CBA_fnc_removePerFrameHandler; + + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 0, [_wire]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/concertina_wire/functions/fnc_handleDamage.sqf b/addons/concertina_wire/functions/fnc_handleDamage.sqf index 61cd1c4e7c..43a04641dd 100644 --- a/addons/concertina_wire/functions/fnc_handleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_handleDamage.sqf @@ -11,15 +11,12 @@ * 4: projectile * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" - -PARAMS_5(_wire,_selectionName,_damage,_source,_projectile); - +params ["_wire", "", "_damage", "_source", ""]; if (_damage < 0.5) exitWith { 0 }; if (!(isNull _source)) then { diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf index f5f84a6afa..ac59798d10 100644 --- a/addons/concertina_wire/functions/fnc_handleKilled.sqf +++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf @@ -8,14 +8,12 @@ * 1: killer (vehicle) * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" - -PARAMS_2(_wire,_killer); +params ["_wire", "_killer"]; private ["_distance", "_vehicle"]; diff --git a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf index e7dff30000..41050eb9b9 100644 --- a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf @@ -7,14 +7,12 @@ * 1: vehicle * * Return Value: - * Nothing - * - * Return value: * None + * + * Public: No */ #include "script_component.hpp" - -PARAMS_2(_wire,_vehicle); +params ["_wire", "_vehicle"]; private ["_type", "_mode", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w"]; @@ -43,8 +41,8 @@ _dir_w = getDir _wire; if (_mode == 0) then { private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"]; - _x = _pos_w select 0; - _y = _pos_w select 1; + _pos_w params ["_x","_y"]; + // Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle) _wireCheckPosAr = [ [_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)], From a38cdda8e36da5737946f11f4b474e74e2498d98 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Sat, 8 Aug 2015 08:26:15 +0200 Subject: [PATCH 005/311] First iteration on implementing Dslyecxi's ST Map Gestures --- addons/map_gestures/$PBOPREFIX$ | 1 + addons/map_gestures/ACE_Settings.hpp | 50 ++++++++++ addons/map_gestures/CfgEventHandlers.hpp | 11 +++ addons/map_gestures/CfgVehicles.hpp | 64 +++++++++++++ addons/map_gestures/XEH_postInit.sqf | 16 ++++ addons/map_gestures/XEH_preInit.sqf | 17 ++++ addons/map_gestures/config.cpp | 17 ++++ .../functions/fnc_assignClientIDOnServer.sqf | 24 +++++ .../functions/fnc_drawMapGestures.sqf | 48 ++++++++++ .../functions/fnc_endTransmit.sqf | 21 ++++ .../functions/fnc_getProximityPlayers.sqf | 23 +++++ .../functions/fnc_initTransmit.sqf | 21 ++++ .../functions/fnc_moduleGroupSettings.sqf | 53 +++++++++++ .../functions/fnc_moduleSettings.sqf | 35 +++++++ .../functions/fnc_receiverInit.sqf | 32 +++++++ .../functions/fnc_sanitizeName.sqf | 30 ++++++ .../map_gestures/functions/fnc_transmit.sqf | 42 ++++++++ .../functions/fnc_transmitterInit.sqf | 59 ++++++++++++ .../functions/script_component.hpp | 1 + addons/map_gestures/script_component.hpp | 12 +++ addons/map_gestures/stringtable.xml | 95 +++++++++++++++++++ 21 files changed, 672 insertions(+) create mode 100644 addons/map_gestures/$PBOPREFIX$ create mode 100644 addons/map_gestures/ACE_Settings.hpp create mode 100644 addons/map_gestures/CfgEventHandlers.hpp create mode 100644 addons/map_gestures/CfgVehicles.hpp create mode 100644 addons/map_gestures/XEH_postInit.sqf create mode 100644 addons/map_gestures/XEH_preInit.sqf create mode 100644 addons/map_gestures/config.cpp create mode 100644 addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf create mode 100644 addons/map_gestures/functions/fnc_drawMapGestures.sqf create mode 100644 addons/map_gestures/functions/fnc_endTransmit.sqf create mode 100644 addons/map_gestures/functions/fnc_getProximityPlayers.sqf create mode 100644 addons/map_gestures/functions/fnc_initTransmit.sqf create mode 100644 addons/map_gestures/functions/fnc_moduleGroupSettings.sqf create mode 100644 addons/map_gestures/functions/fnc_moduleSettings.sqf create mode 100644 addons/map_gestures/functions/fnc_receiverInit.sqf create mode 100644 addons/map_gestures/functions/fnc_sanitizeName.sqf create mode 100644 addons/map_gestures/functions/fnc_transmit.sqf create mode 100644 addons/map_gestures/functions/fnc_transmitterInit.sqf create mode 100644 addons/map_gestures/functions/script_component.hpp create mode 100644 addons/map_gestures/script_component.hpp create mode 100644 addons/map_gestures/stringtable.xml diff --git a/addons/map_gestures/$PBOPREFIX$ b/addons/map_gestures/$PBOPREFIX$ new file mode 100644 index 0000000000..8672ea58f4 --- /dev/null +++ b/addons/map_gestures/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\map_gestures diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp new file mode 100644 index 0000000000..c7b9a8b2ed --- /dev/null +++ b/addons/map_gestures/ACE_Settings.hpp @@ -0,0 +1,50 @@ +class ACE_Settings { + class GVAR(enabled) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(enabled_displayName); + description = CSTRING(enabled_description); + }; + class GVAR(maxRange) { + value = 7; + typeName = "SCALAR"; + displayName = CSTRING(maxRange_displayName); + description = CSTRING(maxRange_description); + }; + class GVAR(interval) { + value = 0.03; + typeName = "SCALAR"; + displayName = CSTRING(interval_displayName); + description = CSTRING(interval_description); + }; + class GVAR(defaultLeadColor) { + value[] = {1, 0.88, 0, 0.95}; + typeName = "COLOR"; + displayName = CSTRING(defaultLeadColor_displayName); + description = CSTRING(defaultLeadColor_description); + }; + class GVAR(defaultColor) { + value[] = {1, 0.88, 0, 0.7}; + typeName = "COLOR"; + displayName = CSTRING(defaultColor_displayName); + description = CSTRING(defaultColor_description); + }; + class GVAR(GroupColorConfigurations) { + value[] = {}; + typeName = "ARRAY"; + displayName = CSTRING(GroupColorConfigurations_displayName); + description = CSTRING(GroupColorConfigurations_description); + }; + class GVAR(GroupColorConfigurationsGroups) { + value[] = {}; + typeName = "ARRAY"; + displayName = CSTRING(GroupColorConfigurationsGroups_displayName); + description = CSTRING(GroupColorConfigurationsGroups_description); + }; + class GVAR(GroupColorConfigurationsGroupIndex) { + value[] = {}; + typeName = "ARRAY"; + displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName); + description = CSTRING(GroupColorConfigurationsGroupIndex_description); + }; +}; diff --git a/addons/map_gestures/CfgEventHandlers.hpp b/addons/map_gestures/CfgEventHandlers.hpp new file mode 100644 index 0000000000..e75956f440 --- /dev/null +++ b/addons/map_gestures/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/map_gestures/CfgVehicles.hpp b/addons/map_gestures/CfgVehicles.hpp new file mode 100644 index 0000000000..30204629a8 --- /dev/null +++ b/addons/map_gestures/CfgVehicles.hpp @@ -0,0 +1,64 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(moduleSettings): ACE_Module { + scope = 2; + category = "ACE"; + displayName = CSTRING(moduleSettings_displayName); + function = QFUNC(moduleSettings); + isGlobal = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class enabled { + displayName = CSTRING(enabled_DisplayName); + typeName = "BOOL"; + defaultValue = 1; + }; + class maxRange { + displayName = CSTRING(maxRange_displayName); + description = CSTRING(maxRange_description); + typeName = "NUMBER"; + defaultValue = 4; + }; + class interval { + displayName = CSTRING(interval_displayName); + description = CSTRING(interval_description); + typeName = "NUMBER"; + defaultValue = 0.03; + }; + class defaultLeadColor { + displayName = CSTRING(defaultLeadColor_displayName); + description = CSTRING(defaultLeadColor_description); + typeName = "STRING"; + defaultValue = "0,0,0,0"; + }; + class defaultColor { + displayName = CSTRING(defaultColor_displayName); + description = CSTRING(defaultColor_description); + typeName = "STRING"; + defaultValue = "0,0,0,0"; + }; + }; + }; + class GVAR(moduleGroupSettings): ACE_Module { + scope = 2; + category = "ACE"; + displayName = CSTRING(moduleGroupSettings_displayName); + function = QFUNC(moduleGroupSettings); + isGlobal = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class leadColor { + displayName = CSTRING(leadColor_displayName); + description = CSTRING(leadColor_description); + typeName = "STRING"; + defaultValue = "0,0,0,0"; + }; + class color { + displayName = CSTRING(color_displayName); + description = CSTRING(color_description); + typeName = "STRING"; + defaultValue = "0,0,0,0"; + }; + }; + }; +}; diff --git a/addons/map_gestures/XEH_postInit.sqf b/addons/map_gestures/XEH_postInit.sqf new file mode 100644 index 0000000000..777463e86a --- /dev/null +++ b/addons/map_gestures/XEH_postInit.sqf @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["SettingsInitialized", { + [{ + if (isNull (findDisplay 12)) exitWith {}; + + params ["", "_pfhId"]; + + call FUNC(receiverInit); + call FUNC(transmitterInit); + + [_pfhId] call CBA_fnc_removePerFrameHandler; + }, 1, []] call CBA_fnc_addPerFrameHandler; +}] call EFUNC(common,addEventHandler); diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf new file mode 100644 index 0000000000..08159aa972 --- /dev/null +++ b/addons/map_gestures/XEH_preInit.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(assignClientIDOnServer); +PREP(drawMapGestures); +PREP(endTransmit); +PREP(getProximityPlayers); +PREP(initTransmit); +PREP(moduleGroupSettings); +PREP(moduleSettings); +PREP(receiverInit); +PREP(sanitizeName); +PREP(transmit); +PREP(transmitterInit); + +ADDON = true; diff --git a/addons/map_gestures/config.cpp b/addons/map_gestures/config.cpp new file mode 100644 index 0000000000..72e7f82078 --- /dev/null +++ b/addons/map_gestures/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Dslyecxi", "MikeMatrix"}; + authorUrl = "https://github.com/MikeMatrix"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf new file mode 100644 index 0000000000..129c5066e1 --- /dev/null +++ b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf @@ -0,0 +1,24 @@ +/* + * Author: MikeMatrix + * Assign readable client ID to unit on the server. + * + * Arguments: + * 0: Unit name + * + * Return Value: + * None + * + * Example: + * ["MikeMatrix"] call ace_map_gestures_fnc_assignClientIDOnServer + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unitName"]; + +{ + if (name _x == _unitName) then { + _x setVariable [QGVAR(owner_id), owner _x, true]; + }; +} count playableUnits; diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf new file mode 100644 index 0000000000..0b352418af --- /dev/null +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -0,0 +1,48 @@ +/* + * Author: MikeMatrix + * Receives and draws map gestures from nearby players. + * + * Arguments: + * 0: Map Handle + * + * Return Value: + * None + * + * Example: + * [findDisplay 12 displayCtrl 51] call ace_map_gesutres_fnc_drawMapGestures + * + * Public: No + */ +#include "script_component.hpp" + +if (!GVAR(enabled)) exitWith {}; +if (!visibleMap) exitWith {}; + +params ["_mapHandle"]; + +_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); +{ + _nameSane = [name _x] call FUNC(sanitizeName); + _drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane]; + if (!isNil _drawPosVariableName) then { + _pos = call compile _drawPosVariableName; + if (alive _x && + (_pos distance [0, 0, 0]) > 50 && + {_x getVariable QGVAR(Transmit)}) then { + _group = group _x; + _grpName = groupID _group; + + _color = [1, 1, 1, 1]; + if (_grpName in GVAR(GroupColorConfigurationsGroups)) then { + _grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName; + _color = (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group); + } else { + _color = if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)}; + }; + + _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, 55, 55, 0, "", 1, 0.030, "PuristaBold", "left"]; + _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, 20, 20, 0, name _x, 0, 0.030, "PuristaBold", "left"]; + }; + }; + nil +} count _nearDudes; diff --git a/addons/map_gestures/functions/fnc_endTransmit.sqf b/addons/map_gestures/functions/fnc_endTransmit.sqf new file mode 100644 index 0000000000..0db082aa65 --- /dev/null +++ b/addons/map_gestures/functions/fnc_endTransmit.sqf @@ -0,0 +1,21 @@ +/* + * Author: MikeMatrix + * Ensure that all variables used to indicate transmission are disabled. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_map_gestures_fnc_endTransmit + * + * Public: No + */ +#include "script_component.hpp" + +if (!GVAR(enabled)) exitWith {}; + +ACE_player setVariable [QGVAR(Transmit), false, true]; +GVAR(EnableTransmit) = false; diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf new file mode 100644 index 0000000000..eb1b609778 --- /dev/null +++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf @@ -0,0 +1,23 @@ +/* + * Author: MikeMatrix + * Returns all players in a given range and in the units vehicle. + * + * Arguments: + * 0: Unit + * 1: Range + * + * Return Value: + * All units in proximity + * + * Example: + * ["example value"] call ace_module_fnc_functionName + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_range"]; + +_proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range]; +_proximityPlayers = _proximityPlayers - [_unit]; +(_proximityPlayers + (crew vehicle _unit)) diff --git a/addons/map_gestures/functions/fnc_initTransmit.sqf b/addons/map_gestures/functions/fnc_initTransmit.sqf new file mode 100644 index 0000000000..546e5d3c3b --- /dev/null +++ b/addons/map_gestures/functions/fnc_initTransmit.sqf @@ -0,0 +1,21 @@ +/* + * Author: MikeMatrix + * Initializes transmitting map gestures. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_map_gestures_fnc_initTransmit + * + * Public: No + */ +#include "script_component.hpp" + +if (!GVAR(enabled)) exitWith {}; + +GVAR(EnableTransmit) = true; +[FUNC(transmit), GVAR(interval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf new file mode 100644 index 0000000000..b51f4b99b4 --- /dev/null +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -0,0 +1,53 @@ +/* + * Author: MikeMatrix + * Initializes Settings for the groups modules and transcodes settings to a useable format. + * + * Arguments: + * 0: Logic + * 1: Units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [module, [player], true] call ace_map_gestures_fnc_moduleGroupSettings + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if (!_activated) exitWith {}; +if (!isServer) exitWith {}; + +_leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]"); +if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {}; +_color = call compile ("[" + (_logic getVariable ["color", ""]) + "]"); +if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {}; + +_configurations = +GVAR(GroupColorConfigurations); +if (isNil "_configurations") then {_configurations = []}; +_configurationIndex = _configurations pushBack [_leadColor, _color]; + +_configurationGroups = +GVAR(GroupColorConfigurationsGroups); +_configurationGroupsIndex = +GVAR(GroupColorConfigurationsGroupIndex); + +if (isNil "_configurationGroups") then {_configurationGroups = [];}; +if (isNil "_configurationGroupsIndex") then {_configurationGroupsIndex = [];}; +_completedGroups = []; +{ + private "_group"; + _group = groupID (group _x); + if (!(_group in _completedGroups)) then { + _index = if (_group in _configurationGroups) then {_configurationGroups find _group} else {_configurationGroups pushBack _group}; + _configurationGroupsIndex set [_index, _configurationIndex]; + _completedGroups pushBack _group; + }; + nil +} count _units; + +[QGVAR(GroupColorConfigurations), _configurations, true, true] call EFUNC(common,setSetting); +[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, true, true] call EFUNC(common,setSetting); +[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, true, true] call EFUNC(common,setSetting); diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf new file mode 100644 index 0000000000..d53e118b46 --- /dev/null +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -0,0 +1,35 @@ +/* + * Author: MikeMatrix + * Initializes Settings for the module and transcodes settings to a useable format. + * + * Arguments: + * 0: Logic + * 1: Units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [module, [player], true] call ace_map_gestures_fnc_moduleGroupSettings + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if (!_activated) exitWith {}; +if (!isServer) exitWith {}; + +[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(interval), "interval"] call EFUNC(common,readSettingFromModule); + +_defaultLeadColor = call compile ("[" + (_logic getVariable ["defaultLeadColor", ""]) + "]"); +if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {}; +[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting); + +_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]"); +if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {}; +[QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting); diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf new file mode 100644 index 0000000000..44b5bada47 --- /dev/null +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -0,0 +1,32 @@ +/* + * Author: MikeMatrix + * Initializes the receiver and hooks it to the Draw event of the map. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_map_gestures_fnc_receiverInit + * + * Public: No + */ +#include "script_component.hpp" + +{ + if (isPlayer _x) then { + _nameSane = [name _x] call FUNC(sanitizeName); + call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane]; + }; + nil +} count allUnits; + +ACE_player setVariable [QGVAR(Transmit), false, true]; +GVAR(EnableTransmit) = false; + +if (!isNil QGVAR(DrawMapHandlerID)) then { + (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; GVAR(DrawMapHandlerID) = nil; +}; +GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", FUNC(drawMapGestures)]; diff --git a/addons/map_gestures/functions/fnc_sanitizeName.sqf b/addons/map_gestures/functions/fnc_sanitizeName.sqf new file mode 100644 index 0000000000..bafe9d3052 --- /dev/null +++ b/addons/map_gestures/functions/fnc_sanitizeName.sqf @@ -0,0 +1,30 @@ +/* + * Author: MikeMatrix + * Cleans up unit names to be usable within variable names. + * + * Arguments: + * 0: Name + * + * Return Value: + * Sanitized name + * + * Example: + * ["I am a non valid variable name"] call ace_map_gestures_fnc_sanitizeName + * + * Public: No + */ +#include "script_component.hpp" + +private ["_alphabet", "_nameSanitized"]; + +params ["_name"]; + +_alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; + +_nameSanitized = []; +{ + if (toString [_x] in _alphabet) then {_nameSanitized pushBack _x}; + nil +} count (toArray _name); + +toString _nameSanitized diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf new file mode 100644 index 0000000000..9defec2fd8 --- /dev/null +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -0,0 +1,42 @@ +/* + * Author: MikeMatrix + * Transmit PFH + * + * Arguments: + * 0: Arguments + * 1: PFH ID + * + * Return Value: + * Return description + * + * Example: + * [[], 2] call ace_map_gestures_fnc_transmit + * + * Public: No + */ +#include "script_component.hpp" + +private ["_nearDudes", "_ownerID", "_nameSane"]; + +params ["", "_pfhId"]; + +if (!GVAR(EnableTransmit) || !visibleMap) exitWith { + call FUNC(endTransmit); + [_pfhId] call CBA_fnc_removePerFrameHandler; +}; + +_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); +TRACE_1("Near",_nearDudes) + +{ + _ownerID = _x getVariable QGVAR(owner_id); + if (isNil _ownerID) exitWith { + [0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute; + }; + _ownerID = _x getVariable QGVAR(owner_id); + + if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then { + _nameSane = [name ACE_player] call FUNC(sanitizeName); + _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane]; + }; +} count _nearDudes; diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf new file mode 100644 index 0000000000..3c0cfa7c10 --- /dev/null +++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf @@ -0,0 +1,59 @@ +/* + * Author: MikeMatrix + * Initializes the transmitting event handlers. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_map_gestures_fnc_transmitterInit + * + * Public: No + */ +#include "script_component.hpp" + +private ["_mapCtrl", "_nameSane"]; + +disableSerialization; + +_mapCtrl = findDisplay 12 displayCtrl 51; + +// MouseMoving EH. +if (!isNil QGVAR(MouseMoveHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; GVAR(MouseMoveHandlerID) = nil;}; +GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", { + if (EGVAR(maptools,drawing_isDrawing)) exitWith {}; + if (EGVAR(maptools,mapTool_isDragging)) exitWith {}; + if (EGVAR(maptools,mapTool_isRotating)) exitWith {}; + + params ["_control", "_posX", "_posY"]; + + if (GVAR(EnableTransmit)) then { + if (!(ACE_player getVariable QGVAR(Transmit))) then { + ACE_player setVariable [QGVAR(Transmit), true, true]; + }; + + _nameSane = [name ACE_player] call FUNC(sanitizeName); + call compile format [QUOTE(GVAR(%1_DrawPos) = %2), _nameSane, _control ctrlMapScreenToWorld [_posX, _posY]]; + }; +}]; + +// MouseDown EH +if (!isNil QGVAR(MouseDownHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)]; GVAR(MouseDownHandlerID) = nil;}; +GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", { + if (!GVAR(enabled)) exitWith {}; + + params ["", "_button"]; + + if (_button == 0) then {call FUNC(initTransmit);}; +}]; + +// MouseUp EH +if (!isNil QGVAR(MouseUpHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; GVAR(MouseUpHandlerID) = nil;}; +GVAR(MouseUpHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonUp", { + params ["", "_button"]; + + if (_button == 0) then {call FUNC(endTransmit);}; +}]; diff --git a/addons/map_gestures/functions/script_component.hpp b/addons/map_gestures/functions/script_component.hpp new file mode 100644 index 0000000000..65841c15f9 --- /dev/null +++ b/addons/map_gestures/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\map_gestures\script_component.hpp" diff --git a/addons/map_gestures/script_component.hpp b/addons/map_gestures/script_component.hpp new file mode 100644 index 0000000000..7c6f3a5b2f --- /dev/null +++ b/addons/map_gestures/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT map_gestures +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MAP_GESTURES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MAP_GESTURES + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP_GESTURES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml new file mode 100644 index 0000000000..324e9f92e7 --- /dev/null +++ b/addons/map_gestures/stringtable.xml @@ -0,0 +1,95 @@ + + + + + Map Gestures + + + Enabled + + + Map Gesture Max Range + + + Max range between players to show the map gesture indicator [default: 7 meters] + + + Lead Default Alpha + + + Fallback Alpha value for group leaders. + + + Default Alpha + + + Fallback Alpha value. + + + Lead Default Color + + + Fallback Color value for group leaders. + + + Default Color + + + Fallback Color value. + + + Lead Alpha + + + Alpha value for group leaders of groups synced with this module. + + + Alpha + + + Alpha value for group members of groups synced with this module. + + + Lead Color + + + Color value for group leaders of groups synced with this module. + + + Color + + + Color value for group members of groups synced with this module. + + + Map Gestures - Group Settings + + + Update Interval + + + Time between data updates. + + + Group color configurations + + + Group color configuration containing arrays of color pairs ([leadColor, color]). + + + Group color group name index, containing names of groups with configurations attached to them. + + + Group color group name index + + + Group color group name mapping index + + + Group color group name mapping index, mapping the GroupColorConfigurationsGroups to the GroupColorConfigurations. + + + Enables the Map Gestures. + + + From 90e4d005ee663e8976a5ffed1b02c1c11934851c Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 10 Aug 2015 08:45:43 +0200 Subject: [PATCH 006/311] Give credit where credit is due --- AUTHORS.txt | 5 +++-- addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf | 2 +- addons/map_gestures/functions/fnc_drawMapGestures.sqf | 2 +- addons/map_gestures/functions/fnc_endTransmit.sqf | 2 +- addons/map_gestures/functions/fnc_getProximityPlayers.sqf | 2 +- addons/map_gestures/functions/fnc_initTransmit.sqf | 2 +- addons/map_gestures/functions/fnc_moduleGroupSettings.sqf | 2 +- addons/map_gestures/functions/fnc_moduleSettings.sqf | 2 +- addons/map_gestures/functions/fnc_receiverInit.sqf | 2 +- addons/map_gestures/functions/fnc_sanitizeName.sqf | 2 +- addons/map_gestures/functions/fnc_transmit.sqf | 2 +- addons/map_gestures/functions/fnc_transmitterInit.sqf | 2 +- 12 files changed, 14 insertions(+), 13 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 62329d7c1d..711ed6f687 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -50,6 +50,8 @@ Coren Crusty Dharma Bellamkonda Dimaslg +Drill +Dslyecxi eRazeri evromalarkey F3 Project @@ -81,6 +83,7 @@ Macusercom MarcBook meat Michail Nikolaev +MikeMatrix nic547 nikolauska nomisum @@ -106,5 +109,3 @@ Valentin Torikian VyMajoris(W-Cephei) Winter zGuba -Drill -MikeMatrix diff --git a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf index 129c5066e1..c686c17b79 100644 --- a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf +++ b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Assign readable client ID to unit on the server. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 0b352418af..b270e3d073 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Receives and draws map gestures from nearby players. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_endTransmit.sqf b/addons/map_gestures/functions/fnc_endTransmit.sqf index 0db082aa65..fc3e0e81e1 100644 --- a/addons/map_gestures/functions/fnc_endTransmit.sqf +++ b/addons/map_gestures/functions/fnc_endTransmit.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Ensure that all variables used to indicate transmission are disabled. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf index eb1b609778..3ac8803a70 100644 --- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf +++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Returns all players in a given range and in the units vehicle. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_initTransmit.sqf b/addons/map_gestures/functions/fnc_initTransmit.sqf index 546e5d3c3b..604bf9e233 100644 --- a/addons/map_gestures/functions/fnc_initTransmit.sqf +++ b/addons/map_gestures/functions/fnc_initTransmit.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Initializes transmitting map gestures. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index b51f4b99b4..569bdd687a 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Initializes Settings for the groups modules and transcodes settings to a useable format. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf index d53e118b46..00cfc7288c 100644 --- a/addons/map_gestures/functions/fnc_moduleSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Initializes Settings for the module and transcodes settings to a useable format. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf index 44b5bada47..8dfc7de51c 100644 --- a/addons/map_gestures/functions/fnc_receiverInit.sqf +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Initializes the receiver and hooks it to the Draw event of the map. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_sanitizeName.sqf b/addons/map_gestures/functions/fnc_sanitizeName.sqf index bafe9d3052..f36e626102 100644 --- a/addons/map_gestures/functions/fnc_sanitizeName.sqf +++ b/addons/map_gestures/functions/fnc_sanitizeName.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Cleans up unit names to be usable within variable names. * * Arguments: diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index 9defec2fd8..880b21f36e 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Transmit PFH * * Arguments: diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf index 3c0cfa7c10..6ba6d0881e 100644 --- a/addons/map_gestures/functions/fnc_transmitterInit.sqf +++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf @@ -1,5 +1,5 @@ /* - * Author: MikeMatrix + * Author: Dslyecxi, MikeMatrix * Initializes the transmitting event handlers. * * Arguments: From b1d3654a97324644b6ac40b2c53a4359a7e1ad21 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 10 Aug 2015 14:54:28 +0200 Subject: [PATCH 007/311] Fixed owner id not getting assigned in map gestures --- addons/map_gestures/functions/fnc_transmit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index 880b21f36e..a87be445bf 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -30,7 +30,7 @@ TRACE_1("Near",_nearDudes) { _ownerID = _x getVariable QGVAR(owner_id); - if (isNil _ownerID) exitWith { + if (isNil "_ownerID") exitWith { [0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute; }; _ownerID = _x getVariable QGVAR(owner_id); From 5788705821442e4cee027664ddac05dad415647b Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 10 Aug 2015 15:24:57 +0200 Subject: [PATCH 008/311] Fixed code style issues and added missing variable initialization in map_gestures --- .../map_gestures/functions/fnc_drawMapGestures.sqf | 13 ++++++------- .../functions/fnc_moduleGroupSettings.sqf | 7 +------ addons/map_gestures/functions/fnc_receiverInit.sqf | 4 ++-- addons/map_gestures/functions/fnc_transmit.sqf | 8 ++++---- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index b270e3d073..05afa9bf0e 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -20,24 +20,23 @@ if (!visibleMap) exitWith {}; params ["_mapHandle"]; -_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); +_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); { _nameSane = [name _x] call FUNC(sanitizeName); _drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane]; if (!isNil _drawPosVariableName) then { + if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];} _pos = call compile _drawPosVariableName; if (alive _x && - (_pos distance [0, 0, 0]) > 50 && {_x getVariable QGVAR(Transmit)}) then { _group = group _x; _grpName = groupID _group; - _color = [1, 1, 1, 1]; - if (_grpName in GVAR(GroupColorConfigurationsGroups)) then { + _color = if (_grpName in GVAR(GroupColorConfigurationsGroups)) then { _grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName; - _color = (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group); + (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group) } else { - _color = if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)}; + if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)}; }; _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, 55, 55, 0, "", 1, 0.030, "PuristaBold", "left"]; @@ -45,4 +44,4 @@ _nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); }; }; nil -} count _nearDudes; +} count _proximityPlayers; diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index 569bdd687a..c0158d90c7 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -27,12 +27,7 @@ if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _ _color = call compile ("[" + (_logic getVariable ["color", ""]) + "]"); if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {}; -_configurations = +GVAR(GroupColorConfigurations); -if (isNil "_configurations") then {_configurations = []}; -_configurationIndex = _configurations pushBack [_leadColor, _color]; - -_configurationGroups = +GVAR(GroupColorConfigurationsGroups); -_configurationGroupsIndex = +GVAR(GroupColorConfigurationsGroupIndex); +_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups) then { [] } else { +GVAR(GroupColorConfigurationsGroups) }; if (isNil "_configurationGroups") then {_configurationGroups = [];}; if (isNil "_configurationGroupsIndex") then {_configurationGroupsIndex = [];}; diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf index 8dfc7de51c..482572c19e 100644 --- a/addons/map_gestures/functions/fnc_receiverInit.sqf +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -17,8 +17,8 @@ { if (isPlayer _x) then { - _nameSane = [name _x] call FUNC(sanitizeName); - call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane]; + _nameSane = [name _x] call FUNC(sanitizeName); + call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane]; }; nil } count allUnits; diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index a87be445bf..a0ab7bf0bf 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_nearDudes", "_ownerID", "_nameSane"]; +private ["_proximityPlayers", "_ownerID", "_nameSane"]; params ["", "_pfhId"]; @@ -25,8 +25,8 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith { [_pfhId] call CBA_fnc_removePerFrameHandler; }; -_nearDudes = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); -TRACE_1("Near",_nearDudes) +_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); +TRACE_1("Near",_proximityPlayers) { _ownerID = _x getVariable QGVAR(owner_id); @@ -39,4 +39,4 @@ TRACE_1("Near",_nearDudes) _nameSane = [name ACE_player] call FUNC(sanitizeName); _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane]; }; -} count _nearDudes; +} count _proximityPlayers; From 5e4316d0e214150facde679f52c24149169bef4c Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 10 Aug 2015 16:43:33 +0200 Subject: [PATCH 009/311] Fixed missing semi-colon --- addons/map_gestures/functions/fnc_drawMapGestures.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 05afa9bf0e..877b503b38 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -25,7 +25,7 @@ _proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); _nameSane = [name _x] call FUNC(sanitizeName); _drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane]; if (!isNil _drawPosVariableName) then { - if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];} + if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];}; _pos = call compile _drawPosVariableName; if (alive _x && {_x getVariable QGVAR(Transmit)}) then { From 5287455c0b5860fa9bdb67502347326273510629 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 10 Aug 2015 17:07:01 +0200 Subject: [PATCH 010/311] Fixed aborting data transmission on no owner id encounter --- addons/map_gestures/functions/fnc_transmit.sqf | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index a0ab7bf0bf..4d99caa160 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -30,13 +30,12 @@ TRACE_1("Near",_proximityPlayers) { _ownerID = _x getVariable QGVAR(owner_id); - if (isNil "_ownerID") exitWith { + if (isNil "_ownerID") then { [0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute; - }; - _ownerID = _x getVariable QGVAR(owner_id); - - if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then { - _nameSane = [name ACE_player] call FUNC(sanitizeName); - _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane]; + } else { + if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then { + _nameSane = [name ACE_player] call FUNC(sanitizeName); + _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane]; + }; }; } count _proximityPlayers; From 3e82391a369894f10e6cfa1dad24959ae6f7ae1b Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 10 Aug 2015 19:04:49 +0200 Subject: [PATCH 011/311] Added validation and various fixes --- addons/map_gestures/XEH_preInit.sqf | 1 + .../functions/fnc_isValidColorArray.sqf | 28 +++++++++++++++++++ .../functions/fnc_moduleGroupSettings.sqf | 13 +++++---- .../functions/fnc_moduleSettings.sqf | 7 +++-- 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 addons/map_gestures/functions/fnc_isValidColorArray.sqf diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf index 08159aa972..ad4da44998 100644 --- a/addons/map_gestures/XEH_preInit.sqf +++ b/addons/map_gestures/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(drawMapGestures); PREP(endTransmit); PREP(getProximityPlayers); PREP(initTransmit); +PREP(isValidColorArray); PREP(moduleGroupSettings); PREP(moduleSettings); PREP(receiverInit); diff --git a/addons/map_gestures/functions/fnc_isValidColorArray.sqf b/addons/map_gestures/functions/fnc_isValidColorArray.sqf new file mode 100644 index 0000000000..a64cf249eb --- /dev/null +++ b/addons/map_gestures/functions/fnc_isValidColorArray.sqf @@ -0,0 +1,28 @@ +/* + * Author: MikeMatrix + * Validate if an array is in the propper color format. + * + * Arguments: + * 0: Color Array + * + * Return Value: + * Is valid Color Array + * + * Example: + * [[1, 0.2, 1, 0.5]] call ace_map_gestures_fnc_isValidColorArray + * + * Public: No + */ +#include "script_component.hpp" + +params ["_colorArray"]; + +if (isNil "_colorArray") exitWith {false}; +if ((typeName _colorArray) != "ARRAY") exitWith {false}; +if (count _colorArray != 4) exitWith {false}; + +{ + if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false}; +} count _colorArray; + +true diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index c0158d90c7..32f7e73143 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -19,19 +19,22 @@ params ["_logic", "_units", "_activated"]; +diag_log "Running"; + if (!_activated) exitWith {}; if (!isServer) exitWith {}; _leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]"); -if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {}; +if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; _color = call compile ("[" + (_logic getVariable ["color", ""]) + "]"); -if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {}; +if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; -_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups) then { [] } else { +GVAR(GroupColorConfigurationsGroups) }; +_configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) }; +_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups)) then { [] } else { +GVAR(GroupColorConfigurationsGroups) }; +_configurationGroupsIndex = if (isNil QGVAR(GroupColorConfigurationsGroupIndex)) then { [] } else { +GVAR(GroupColorConfigurationsGroupIndex) }; -if (isNil "_configurationGroups") then {_configurationGroups = [];}; -if (isNil "_configurationGroupsIndex") then {_configurationGroupsIndex = [];}; _completedGroups = []; +_configurationIndex = _configurations pushBack [_leadColor, _color]; { private "_group"; _group = groupID (group _x); diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf index 00cfc7288c..6b21db8588 100644 --- a/addons/map_gestures/functions/fnc_moduleSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -27,9 +27,10 @@ if (!isServer) exitWith {}; [_logic, QGVAR(interval), "interval"] call EFUNC(common,readSettingFromModule); _defaultLeadColor = call compile ("[" + (_logic getVariable ["defaultLeadColor", ""]) + "]"); -if (isNil "_leadColor" || !((typeName _leadColor) isEqualTo "ARRAY") || {count _leadColor != 4}) exitWith {}; -[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting); +if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")}; _defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]"); -if (isNil "_color" || !((typeName _color) isEqualTo "ARRAY") || {count _color != 4}) exitWith {}; +if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")}; + +[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting); [QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting); From a315596c5a83d461aa9da5bbd85876c72ea8fbf1 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 10 Aug 2015 20:32:26 +0200 Subject: [PATCH 012/311] Fixed isValidColorArray returning true when array had the right size, but wrong datatypes/value ranges --- addons/map_gestures/functions/fnc_isValidColorArray.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/map_gestures/functions/fnc_isValidColorArray.sqf b/addons/map_gestures/functions/fnc_isValidColorArray.sqf index a64cf249eb..809bbaf117 100644 --- a/addons/map_gestures/functions/fnc_isValidColorArray.sqf +++ b/addons/map_gestures/functions/fnc_isValidColorArray.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +scopeName "main"; + params ["_colorArray"]; if (isNil "_colorArray") exitWith {false}; @@ -22,7 +24,7 @@ if ((typeName _colorArray) != "ARRAY") exitWith {false}; if (count _colorArray != 4) exitWith {false}; { - if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false}; + if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false breakOut "main"}; } count _colorArray; true From 183aac191117d762983d251346d7854693696ee7 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 14 Aug 2015 01:55:54 +0200 Subject: [PATCH 013/311] Code cleanup of Kestrel 4500 module. --- addons/kestrel4500/XEH_preInit.sqf | 18 ++++ .../functions/fnc_buttonPressed.sqf | 4 +- addons/kestrel4500/functions/fnc_canShow.sqf | 6 +- .../kestrel4500/functions/fnc_collectData.sqf | 33 +++----- .../functions/fnc_createKestrelDialog.sqf | 4 +- .../functions/fnc_displayKestrel.sqf | 84 +++++++++++-------- .../functions/fnc_generateOutputData.sqf | 40 +++++---- .../functions/fnc_measureWindSpeed.sqf | 3 +- .../functions/fnc_onCloseDialog.sqf | 15 ++++ .../functions/fnc_onCloseDisplay.sqf | 15 ++++ .../functions/fnc_restoreUserData.sqf | 2 +- .../functions/fnc_storeUserData.sqf | 4 +- .../functions/fnc_updateDisplay.sqf | 30 ++----- .../functions/fnc_updateImpellerState.sqf | 4 +- 14 files changed, 150 insertions(+), 112 deletions(-) diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf index 7b36167a16..b7d66cbb94 100644 --- a/addons/kestrel4500/XEH_preInit.sqf +++ b/addons/kestrel4500/XEH_preInit.sqf @@ -17,3 +17,21 @@ PREP(updateDisplay); PREP(updateImpellerState); ADDON = true; + +FUNC(updateMemory) = { + params ["_slot", "_value"]; + GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value]; + GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)]; + GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value]; +}; + +FUNC(dayOfWeek) = { + private "_table"; + params ["_year", "_month", "_day"]; + + _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; + if (_month < 3) then { + _year = _year - 1; + }; + (_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7 +}; diff --git a/addons/kestrel4500/functions/fnc_buttonPressed.sqf b/addons/kestrel4500/functions/fnc_buttonPressed.sqf index 8f38568462..83c471092a 100644 --- a/addons/kestrel4500/functions/fnc_buttonPressed.sqf +++ b/addons/kestrel4500/functions/fnc_buttonPressed.sqf @@ -3,10 +3,10 @@ * Handles the Kestrel 4500 dialog button actions * * Arguments: - * buttonID + * button ID * * Return Value: - * Nothing + * None * * Example: * 2 call ace_kestrel4500_fnc_buttonPressed diff --git a/addons/kestrel4500/functions/fnc_canShow.sqf b/addons/kestrel4500/functions/fnc_canShow.sqf index 0c9e29f9bc..f563138f5c 100644 --- a/addons/kestrel4500/functions/fnc_canShow.sqf +++ b/addons/kestrel4500/functions/fnc_canShow.sqf @@ -3,13 +3,13 @@ * Tests if the Kestrel 4500 can be shown * * Arguments: - * Nothing + * None * * Return Value: - * canShow (bool) + * canShow * * Example: - * [mode] call ace_kestrel4500_fnc_canShow + * call ace_kestrel4500_fnc_canShow * * Public: No */ diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf index 244e719b37..2e25fbcf60 100644 --- a/addons/kestrel4500/functions/fnc_collectData.sqf +++ b/addons/kestrel4500/functions/fnc_collectData.sqf @@ -3,18 +3,19 @@ * Gathers the weather data for the Kestrel 4500 * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: + * call ace_kestrel4500_fnc_collectData * * Public: No */ #include "script_component.hpp" -private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_altitude", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_fnc_updateMemory", "_windSpeed", "_crosswind", "_headwind"]; +private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_altitude", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_windSpeed", "_crosswind", "_headwind"]; _playerDir = getDir ACE_player; _playerAltitude = (getPosASL ACE_player) select 2; _temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); @@ -35,25 +36,19 @@ if (isNil QGVAR(MIN) || isNil QGVAR(MAX)) then { { GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1]; -} forEach [1, 5, 6, 7, 8, 9, 10, 11, 12, 13]; +} count [1, 5, 6, 7, 8, 9, 10, 11, 12, 13]; -_fnc_updateMemory = { - PARAMS_2(_slot,_value); - GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value]; - GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)]; - GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value]; -}; -[0, _playerDir] call _fnc_updateMemory; +[0, _playerDir] call FUNC(updateMemory); if (GVAR(MinAvgMaxMode) == 1) then { { GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1]; - } forEach [2, 3, 4]; + } count [2, 3, 4]; // Wind SPD _windSpeed = call FUNC(measureWindSpeed); - [2, _windSpeed] call _fnc_updateMemory; + [2, _windSpeed] call FUNC(updateMemory); // CROSSWIND _crosswind = 0; @@ -62,7 +57,7 @@ if (GVAR(MinAvgMaxMode) == 1) then { } else { _crosswind = abs(sin(GVAR(RefHeading)) * _windSpeed); }; - [3, _crosswind] call _fnc_updateMemory; + [3, _crosswind] call FUNC(updateMemory); // HEADWIND _headwind = 0; @@ -80,12 +75,4 @@ if (GVAR(MinAvgMaxMode) == 1) then { GVAR(TOTAL) set [4, (GVAR(TOTAL) select 4) + _headwind]; }; -[5, _temperature] call _fnc_updateMemory; -[6, _chill] call _fnc_updateMemory; -[7, _humidity] call _fnc_updateMemory; -[8, _heatIndex] call _fnc_updateMemory; -[9, _dewPoint] call _fnc_updateMemory; -[10, _wetBulb] call _fnc_updateMemory; -[11, _barometricPressure] call _fnc_updateMemory; -[12, _altitude] call _fnc_updateMemory; -[13, _densityAltitude] call _fnc_updateMemory; +{ _x call FUNC(updateMemory); true } count [[5, _temperature],[6, _chill],[7, _humidity],[8, _heatIndex],[9, _dewPoint],[10, _wetBulb],[11, _barometricPressure],[12, _altitude],[13, _densityAltitude]]; diff --git a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf index 289d0825fc..23ca70543b 100644 --- a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf +++ b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf @@ -3,7 +3,7 @@ * Opens the Kestrel 4500 dialog * * Arguments: - * Nothing + * None * * Return Value: * Nothing @@ -29,7 +29,7 @@ createDialog 'Kestrel4500_Display'; GVAR(Kestrel4500) = false; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + [] call FUNC(updateDisplay); }, 1, _this select 0] call CBA_fnc_addPerFrameHandler; diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf index 679ecce6af..63a162a7b0 100644 --- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf +++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf @@ -3,12 +3,13 @@ * Shows the Kestrel 4500 as rsc title * * Arguments: - * Nothing + * None * * Return Value: * Nothing * * Example: + * call ace_kestrel4500_fnc_displayKestrell * * Public: No */ @@ -50,49 +51,66 @@ if (GVAR(Kestrel4500) && dialog) then { GVAR(Overlay) = true; -[{ +[{ // abort condition if (!GVAR(Overlay) || {!(("ACE_Kestrel4500" in (uniformItems ACE_player)) || ("ACE_Kestrel4500" in (vestItems ACE_player)))}) exitWith { GVAR(Overlay) = false; 3 cutText ["", "PLAIN"]; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + if (ACE_diagTime > GVAR(updateTimer)) then { GVAR(updateTimer) = ACE_diagTime + 1; - + private ["_outputData"]; _outputData = [] call FUNC(generateOutputData); - + 3 cutRsc ["RscKestrel4500", "PLAIN", 1, false]; - - __ctrlTop ctrlSetText (_outputData select 0); - __ctrlCenterBig ctrlSetText (_outputData select 1); - - __ctrlTop ctrlSetText (_outputData select 0); - __ctrlCenterBig ctrlSetText (_outputData select 1); - __ctrlCenter ctrlSetText (_outputData select 2); - - __ctrlCenterLine1Left ctrlSetText (_outputData select 3); - __ctrlCenterLine2Left ctrlSetText (_outputData select 4); - __ctrlCenterLine3Left ctrlSetText (_outputData select 5); + _outputData params [ + "_ctrlTop", + "_ctrlCenterBig", + "_ctrlCenter", + "_ctrlCenterLine1Left", + "_ctrlCenterLine2Left", + "_ctrlCenterLine3Left", + "_ctrlCenterLine1Right", + "_ctrlCenterLine2Right", + "_ctrlCenterLine3Right", + "_ctrlInfoLine1", + "_ctrlInfoLine2", + "_ctrlBottomBig", + "_ctrlCenterLine1", + "_ctrlCenterLine2", + "_ctrlCenterLine3", + "_ctrlCenterLine4", + "_ctrlCenterLine5", + "_ctrlCenterLine6" + ]; - __ctrlCenterLine1Right ctrlSetText (_outputData select 6); - __ctrlCenterLine2Right ctrlSetText (_outputData select 7); - __ctrlCenterLine3Right ctrlSetText (_outputData select 8); + __ctrlTop ctrlSetText _ctrlTop; + __ctrlCenterBig ctrlSetText _ctrlCenterBig; + __ctrlCenter ctrlSetText _ctrlCenter; + + __ctrlCenterLine1Left ctrlSetText _ctrlCenterLine1Left; + __ctrlCenterLine2Left ctrlSetText _ctrlCenterLine2Left; + __ctrlCenterLine3Left ctrlSetText _ctrlCenterLine3Left; + + __ctrlCenterLine1Right ctrlSetText _ctrlCenterLine1Right; + __ctrlCenterLine2Right ctrlSetText _ctrlCenterLine2Right; + __ctrlCenterLine3Right ctrlSetText _ctrlCenterLine3Right; + + __ctrlInfoLine1 ctrlSetText _ctrlInfoLine1; + __ctrlInfoLine2 ctrlSetText _ctrlInfoLine2; + + __ctrlBottomBig ctrlSetText _ctrlBottomBig ; + + __ctrlCenterLine1 ctrlSetText _ctrlCenterLine1; + __ctrlCenterLine2 ctrlSetText _ctrlCenterLine2; + __ctrlCenterLine3 ctrlSetText _ctrlCenterLine3; + __ctrlCenterLine4 ctrlSetText _ctrlCenterLine4; + __ctrlCenterLine5 ctrlSetText _ctrlCenterLine5; + __ctrlCenterLine6 ctrlSetText _ctrlCenterLine6; - __ctrlInfoLine1 ctrlSetText (_outputData select 9); - __ctrlInfoLine2 ctrlSetText (_outputData select 10); - - __ctrlBottomBig ctrlSetText (_outputData select 11); - - __ctrlCenterLine1 ctrlSetText (_outputData select 12); - __ctrlCenterLine2 ctrlSetText (_outputData select 13); - __ctrlCenterLine3 ctrlSetText (_outputData select 14); - __ctrlCenterLine4 ctrlSetText (_outputData select 15); - __ctrlCenterLine5 ctrlSetText (_outputData select 16); - __ctrlCenterLine6 ctrlSetText (_outputData select 17); - if (GVAR(referenceHeadingMenu) == 1) then { if (GVAR(referenceHeadingAutoSet)) then { __ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 0.6]; @@ -106,10 +124,10 @@ GVAR(Overlay) = true; __ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 1.0]; }; }; - + call FUNC(updateImpellerState); __ctrlKestrel4500 ctrlSetText format [QUOTE(PATHTOF(UI\Kestrel4500_%1.paa)), floor(GVAR(ImpellerState) % 7)]; - + }, 0.01, []] call CBA_fnc_addPerFrameHandler; true diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index d61a1f48e4..de62da31ff 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -3,12 +3,29 @@ * Generates the Kestrel 4500 output text. * * Arguments: - * Nothing + * None * * Return Value: - * [top , centerBig , CenterLine1Left , CenterLine2Left , CenterLine3Left , CenterLine1Right , CenterLine2Right , CenterLine3Right , InfoLine1 , InfoLine2 ] + * 0: top + * 1: centerBig + * 2: CenterLine1Left + * 3: CenterLine2Left + * 4: CenterLine3Left + * 5: CenterLine1Right + * 6: CenterLine2Right + * 7: CenterLine3Right + * 8: InfoLine1 + * 9: InfoLine2 + * 10: Bottom Big + * 11: Center Line 1 + * 11: Center Line 2 + * 12: Center Line 3 + * 13: Center Line 4 + * 14: Center Line 5 + * 15: Center Line 6 * * Example: + * _var = call ace_kestrell4500_fnc_generateOutputData * * Public: No */ @@ -16,7 +33,7 @@ if (ACE_diagTime - GVAR(headingSetDisplayTimer) < 0.8) exitWith {["", "", " Heading Set", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]}; -private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_fnc_dayOfWeek", "_dayString", "_monthString", "_windSpeed", "_windDir", "_textTop", "_textCenterBig", "_textCenter", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_textBottomBig", "_textCenterLine1", "_textCenterLine2", "_textCenterLine3", "_textCenterLine4", "_textCenterLine5", "_textCenterLine6"]; +private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_dayString", "_monthString", "_windSpeed", "_windDir", "_textTop", "_textCenterBig", "_textCenter", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_textBottomBig", "_textCenterLine1", "_textCenterLine2", "_textCenterLine3", "_textCenterLine4", "_textCenterLine5", "_textCenterLine6"]; [] call FUNC(collectData); @@ -59,19 +76,6 @@ _heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex); _dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint); _wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb); -_fnc_dayOfWeek = { - private ["_year", "_month", "_day", "_table"]; - _year = _this select 0; - _month = _this select 1; - _day = _this select 2; - - _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; - if (_month < 3) then { - _year = _year - 1; - }; - (_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7 -}; - GVAR(Direction) = 4 * floor(_playerDir / 90); if (_playerDir % 90 > 10) then { GVAR(Direction) = GVAR(Direction) + 1}; if (_playerDir % 90 > 35) then { GVAR(Direction) = GVAR(Direction) + 1}; @@ -82,8 +86,8 @@ GVAR(Direction) = GVAR(Direction) % 16; if (GVAR(referenceHeadingMenu) == 0) then { switch (GVAR(Menu)) do { case 0: { // Date - EXPLODE_3_PVT(date,_year,_month,_day); - _dayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] select (date call _fnc_dayOfWeek); + date params ["_year", "_month", "_day"]; + _dayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] select (date call FUNC(dayOfWeek)); _monthString = localize (["str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (_month - 1)); _textTop = _dayString; _textCenter = format["%1 %2 %3", _day, _monthString, _year]; diff --git a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf index 73b4e228d6..2a8a4bbbb3 100644 --- a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf +++ b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf @@ -3,12 +3,13 @@ * Measures the wind speed, stores the information in GVAR(MeasuredWindSpeed) and updates GVAR(ImpellerState) * * Arguments: - * Nothing + * None * * Return Value: * wind speed * * Example: + * call ace_kestrel4500_fnc_canShow * * Public: No */ diff --git a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf index a45a9decc3..11fa76ff18 100644 --- a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf +++ b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf @@ -1,3 +1,18 @@ +/* + * Author: Ruthberg + * Called if Kestrell Dialog is closed + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_kestrel4500_fnc_onCloseDialog + * + * Public: No + */ #include "script_component.hpp" uiNamespace setVariable ['Kestrel4500_Display', nil]; diff --git a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf index efb60b322a..9228aedcef 100644 --- a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf +++ b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf @@ -1,3 +1,18 @@ +/* + * Author: Ruthberg + * Called if Kestrell Display is closed + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_kestrel4500_fnc_onCloseDisplay + * + * Public: No + */ #include "script_component.hpp" uiNamespace setVariable ['RscKestrel4500', nil]; diff --git a/addons/kestrel4500/functions/fnc_restoreUserData.sqf b/addons/kestrel4500/functions/fnc_restoreUserData.sqf index 0ce463ad67..c1d9c0ebb3 100644 --- a/addons/kestrel4500/functions/fnc_restoreUserData.sqf +++ b/addons/kestrel4500/functions/fnc_restoreUserData.sqf @@ -6,7 +6,7 @@ * Nothing * * Return Value: - * Nothing + * None * * Example: * call ace_kestrel4500_fnc_restore_user_data diff --git a/addons/kestrel4500/functions/fnc_storeUserData.sqf b/addons/kestrel4500/functions/fnc_storeUserData.sqf index a5d069b31d..80fa219a3c 100644 --- a/addons/kestrel4500/functions/fnc_storeUserData.sqf +++ b/addons/kestrel4500/functions/fnc_storeUserData.sqf @@ -3,10 +3,10 @@ * Saves user data into profileNamespace * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * call ace_kestrel4500_fnc_store_user_data diff --git a/addons/kestrel4500/functions/fnc_updateDisplay.sqf b/addons/kestrel4500/functions/fnc_updateDisplay.sqf index 90f77f5f6a..e63b18bcfc 100644 --- a/addons/kestrel4500/functions/fnc_updateDisplay.sqf +++ b/addons/kestrel4500/functions/fnc_updateDisplay.sqf @@ -3,10 +3,10 @@ * Updates the Kestrel 4500 dialog text boxes. * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * @@ -22,29 +22,9 @@ private ["_outputData"]; _outputData = [] call FUNC(generateOutputData); -ctrlSetText [74100, _outputData select 0]; -ctrlSetText [74200, _outputData select 1]; -ctrlSetText [74201, _outputData select 2]; - -ctrlSetText [74300, _outputData select 3]; -ctrlSetText [74301, _outputData select 4]; -ctrlSetText [74302, _outputData select 5]; - -ctrlSetText [74303, _outputData select 6]; -ctrlSetText [74304, _outputData select 7]; -ctrlSetText [74305, _outputData select 8]; - -ctrlSetText [74400, _outputData select 9]; -ctrlSetText [74401, _outputData select 10]; - -ctrlSetText [74500, _outputData select 11]; - -ctrlSetText [74600, _outputData select 12]; -ctrlSetText [74601, _outputData select 13]; -ctrlSetText [74602, _outputData select 14]; -ctrlSetText [74603, _outputData select 15]; -ctrlSetText [74604, _outputData select 16]; -ctrlSetText [74605, _outputData select 17]; +{ + ctrlSetText [_x , _outputData select _foreachindex]; +} forEach [74100, 74200, 74201, 74300, 74301, 74302, 74303, 74304, 74305, 74400, 74401, 74500, 74600, 74601, 74602, 74603, 74604, 74605]; if (GVAR(referenceHeadingMenu) == 1) then { if (GVAR(referenceHeadingAutoSet)) then { diff --git a/addons/kestrel4500/functions/fnc_updateImpellerState.sqf b/addons/kestrel4500/functions/fnc_updateImpellerState.sqf index 075ed80080..75a0d10f4c 100644 --- a/addons/kestrel4500/functions/fnc_updateImpellerState.sqf +++ b/addons/kestrel4500/functions/fnc_updateImpellerState.sqf @@ -3,10 +3,10 @@ * Updates the Kestrel 4500 Impeller state * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * From 84685f4a84d22a130f5d583ef24eabe7a36f5055 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 14 Aug 2015 02:22:15 +0200 Subject: [PATCH 014/311] add dayOfWeek and updateMemory to Own File Update some Comments Fixing Spelling Issue --- addons/kestrel4500/XEH_preInit.sqf | 21 ++-------------- .../functions/fnc_createKestrelDialog.sqf | 3 ++- .../kestrel4500/functions/fnc_dayOfWeek.sqf | 25 +++++++++++++++++++ .../functions/fnc_displayKestrel.sqf | 4 +-- .../functions/fnc_generateOutputData.sqf | 2 +- .../functions/fnc_onCloseDialog.sqf | 2 +- .../functions/fnc_onCloseDisplay.sqf | 2 +- .../functions/fnc_updateMemory.sqf | 20 +++++++++++++++ .../functions/script_component.hpp | 2 +- 9 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 addons/kestrel4500/functions/fnc_dayOfWeek.sqf create mode 100644 addons/kestrel4500/functions/fnc_updateMemory.sqf diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf index b7d66cbb94..b89f07173f 100644 --- a/addons/kestrel4500/XEH_preInit.sqf +++ b/addons/kestrel4500/XEH_preInit.sqf @@ -15,23 +15,6 @@ PREP(restoreUserData); PREP(storeUserData); PREP(updateDisplay); PREP(updateImpellerState); - +PREP(updateMemory); +PREP(dayOfWeek) ADDON = true; - -FUNC(updateMemory) = { - params ["_slot", "_value"]; - GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value]; - GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)]; - GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value]; -}; - -FUNC(dayOfWeek) = { - private "_table"; - params ["_year", "_month", "_day"]; - - _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; - if (_month < 3) then { - _year = _year - 1; - }; - (_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7 -}; diff --git a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf index 23ca70543b..a11982968c 100644 --- a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf +++ b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf @@ -6,9 +6,10 @@ * None * * Return Value: - * Nothing + * None * * Example: + * call ace_kestrel4500_fnc_createKestrelDialog * * Public: No */ diff --git a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf new file mode 100644 index 0000000000..9e142f661c --- /dev/null +++ b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Calculate Current Day in the Week + * + * Arguments: + * 0: Year + * 1: Month + * 2: Day + * + * Return Value: + * Day of The Week + * + * Example: + * [1995, 10, 21] call ace_kestrel4500_fnc_buttonPressed + * + * Public: No + */ +private "_table"; +params ["_year", "_month", "_day"]; + +_table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; +if (_month < 3) then { + _year = _year - 1; +}; +(_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7 diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf index 63a162a7b0..770347ec71 100644 --- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf +++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf @@ -6,10 +6,10 @@ * None * * Return Value: - * Nothing + * None * * Example: - * call ace_kestrel4500_fnc_displayKestrell + * call ace_kestrel4500_fnc_displayKestrel * * Public: No */ diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index de62da31ff..016baebef7 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -25,7 +25,7 @@ * 15: Center Line 6 * * Example: - * _var = call ace_kestrell4500_fnc_generateOutputData + * _var = call ace_kestrel4500_fnc_generateOutputData * * Public: No */ diff --git a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf index 11fa76ff18..2474f30d94 100644 --- a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf +++ b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf @@ -1,6 +1,6 @@ /* * Author: Ruthberg - * Called if Kestrell Dialog is closed + * Called if Kestrel Dialog is closed * * Arguments: * None diff --git a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf index 9228aedcef..bdc701ddb1 100644 --- a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf +++ b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf @@ -1,6 +1,6 @@ /* * Author: Ruthberg - * Called if Kestrell Display is closed + * Called if Kestrel Display is closed * * Arguments: * None diff --git a/addons/kestrel4500/functions/fnc_updateMemory.sqf b/addons/kestrel4500/functions/fnc_updateMemory.sqf new file mode 100644 index 0000000000..f38e9ee6df --- /dev/null +++ b/addons/kestrel4500/functions/fnc_updateMemory.sqf @@ -0,0 +1,20 @@ +/* + * Author: Ruthberg + * Update Memory of Kestrel + * + * Arguments: + * 0: Slot + * 1: Value + * + * Return Value: + * None + * + * Example: + * [1, "test"] call ace_kestrel4500_fnc_updateMemory + * + * Public: No + */ +params ["_slot", "_value"]; +GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value]; +GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)]; +GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value]; diff --git a/addons/kestrel4500/functions/script_component.hpp b/addons/kestrel4500/functions/script_component.hpp index 32c774cd89..bc42218de7 100644 --- a/addons/kestrel4500/functions/script_component.hpp +++ b/addons/kestrel4500/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\ace\addons\kestrel4500\script_component.hpp" \ No newline at end of file +#include "\z\ace\addons\kestrel4500\script_component.hpp" From c3c39150a303299f4f6cfdbccbb1130d2ce4f6f2 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Sat, 15 Aug 2015 12:12:41 +0200 Subject: [PATCH 015/311] Improved handling of accessing dynamic variable names --- addons/map_gestures/functions/fnc_drawMapGestures.sqf | 4 ++-- addons/map_gestures/functions/fnc_receiverInit.sqf | 2 +- addons/map_gestures/functions/fnc_transmitterInit.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 877b503b38..54efd878ce 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -25,8 +25,8 @@ _proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); _nameSane = [name _x] call FUNC(sanitizeName); _drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane]; if (!isNil _drawPosVariableName) then { - if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];}; - _pos = call compile _drawPosVariableName; + if (isNil {missionNamespace getVariable _drawPosVariableName}) then {missionNamespace setVariable [_drawPosVariableName, [1, 1, 1]];}; + _pos = missionNamespace getVariable _drawPosVariableName; if (alive _x && {_x getVariable QGVAR(Transmit)}) then { _group = group _x; diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf index 482572c19e..719e5a727b 100644 --- a/addons/map_gestures/functions/fnc_receiverInit.sqf +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -18,7 +18,7 @@ { if (isPlayer _x) then { _nameSane = [name _x] call FUNC(sanitizeName); - call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane]; + missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], [1, 1, 1]]; }; nil } count allUnits; diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf index 6ba6d0881e..828261e017 100644 --- a/addons/map_gestures/functions/fnc_transmitterInit.sqf +++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf @@ -36,7 +36,7 @@ GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", { }; _nameSane = [name ACE_player] call FUNC(sanitizeName); - call compile format [QUOTE(GVAR(%1_DrawPos) = %2), _nameSane, _control ctrlMapScreenToWorld [_posX, _posY]]; + missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], _control ctrlMapScreenToWorld [_posX, _posY]]; }; }]; From 3646654ff3b4bac29d137cb7fd733e9370ddb2ea Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Sat, 15 Aug 2015 12:21:40 +0200 Subject: [PATCH 016/311] Added module icons --- addons/map_gestures/CfgVehicles.hpp | 2 ++ .../ui/icon_module_map_gestures_ca.paa | Bin 0 -> 5625 bytes 2 files changed, 2 insertions(+) create mode 100644 addons/map_gestures/ui/icon_module_map_gestures_ca.paa diff --git a/addons/map_gestures/CfgVehicles.hpp b/addons/map_gestures/CfgVehicles.hpp index 30204629a8..f5c2ae8f38 100644 --- a/addons/map_gestures/CfgVehicles.hpp +++ b/addons/map_gestures/CfgVehicles.hpp @@ -7,6 +7,7 @@ class CfgVehicles { function = QFUNC(moduleSettings); isGlobal = 0; author = ECSTRING(common,ACETeam); + icon = PATHTOF(ui\icon_module_map_gestures_ca.paa); class Arguments { class enabled { displayName = CSTRING(enabled_DisplayName); @@ -46,6 +47,7 @@ class CfgVehicles { function = QFUNC(moduleGroupSettings); isGlobal = 0; author = ECSTRING(common,ACETeam); + icon = PATHTOF(ui\icon_module_map_gestures_ca.paa); class Arguments { class leadColor { displayName = CSTRING(leadColor_displayName); diff --git a/addons/map_gestures/ui/icon_module_map_gestures_ca.paa b/addons/map_gestures/ui/icon_module_map_gestures_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..2d2bcbdf07e0bd88e5158a22bdccdbca6a570df1 GIT binary patch literal 5625 zcmd^@eN0nV6u=Lq4jD?Ba~emTb=0^;jL9&?=^PJdpcRnm3^Un?QekWwL6?QNIoHQD zVU9%@NN@(k!5<`=$Vax9Y|gc^{jsP+Bz~ZE>gJ3(tW;n{S?k-qub%r}AEAW|{+Tar z(qHen=j)z(-+6C>n3|fr=C#zUWGw&;4i3IA@!I4J$|AWarzWSTP!1zs%5S8kWOC#; zPrfBF0DGnaR6PT5nS4igaliq@5JUcH)FA!!U)itCAHZ1X6M@qh$%pv|k>&Kmc#Qog z>Ug91Q-wV!H(DwJSZgWQ4rf1P{6ruyo}u~!?Qs=>tco8%V;~>&M{Pe84_R+8Yv>%* zCxS)Il1etN%D>v)Q2l}Hsg@7LqI&)P6IlFycgmIPMI?f-%K!0Se-c0Oh~*DRafRYw z_3vN*Kz(G%0`v!Enm}cKNb#HHdZ(lGQs^ru^*?NW{nAQ#`p@w4q1TJni|o&%^&i%L zXnksbNdAN7=l?#g&d1}$G+KILefw$ToZvQXoaeFj;e3}T%uRpOOVaC7ou4Z1b~`g^e6pB(!G;OUI(&yh1u#9Han4BAk^-9 zu;pvyxXU$rV{)yf$n!fZa-F+sW004gfx>Q+H4a&S$L5=E>(56X>v%@1ub`U*f2Hst z`m?k{=WT2BT||y*5c1+u3SUKDb$8OoU9ECH)b?JuZrw=YU4Zh2mV_xszkPW-a_OMW zohlC0A?xVIp){O>3AB&JPQxGZcyUB5 zDP|#O3F_bd;Fl(^_bNqczt_XI`nhRs?EVyaHp|*$dM6gg|A1=EWydP!uMaGzmPc)E zz;Q!<voi_8*XoA>&7*xs&NzR{G$o_)i%fmh5#yTD@_bW-ju0ulGv_gq*j8_gMU5 zL%5OG#2e85axk|V(`A33mezM4Ti-eTS4z%DIS!+IZ0AbH$;O$iUS_;)&Q+cl8X(OG zDRGq7b)IN?cuU9j+seDeGcPv!F5&oi#~MEnC#_c$bu2ztk0p@Zx%Y#PtL4=!zFw*9*Q#7e}Giy8b#~^oJ7Vkj)bB;fCaGGE}ioEFht^5NWQLi9t zrDJU5ZAzphFSiAY?kxHB^syRNpWnfuxc-v;;i&(4yRczN$02s?8a`8KD{H+jtx@EYLz3y*pXqJYYZo@=CD<$4f3w0?qem2!Ob-z77po)q<|?8T5* zf#fA4M;0_Evo{Cb=IsNvx`C}p$OhilI$NlWM<(*KoS9Qt8aPLB7+9=Md3-Br@aic_ zVQ`M!q!N1VGLt>4kXLtucZ_+b9xmQlgYtjD2UXABK9h~Sn1+#|Sk_$7^5o>eaos@i zo19{sL=WtY;uXC9aC3&U#mD3)!bJL7^k)3p*;(zIbg1Sxu77{ijwnfvBps%GRg_nq la*pjrV`b^Fwte14l-H6ImE<%1$nMXJu6(fu|E5y`{sk(+gCGC^ literal 0 HcmV?d00001 From 7217d5ec10ffdf14fb08d1b305b86793ca98477e Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 24 Aug 2015 17:03:47 +0200 Subject: [PATCH 017/311] Various code cleanups and switch to player UIDs instead of sanitized names --- addons/map_gestures/CfgEventHandlers.hpp | 1 + addons/map_gestures/XEH_preInit.sqf | 1 - addons/map_gestures/XEH_serverPostInit.sqf | 3 ++ .../functions/fnc_assignClientIDOnServer.sqf | 2 +- .../functions/fnc_drawMapGestures.sqf | 35 +++++++++++++------ .../functions/fnc_getProximityPlayers.sqf | 5 +-- .../functions/fnc_moduleGroupSettings.sqf | 12 ++++--- .../functions/fnc_receiverInit.sqf | 8 ----- .../functions/fnc_sanitizeName.sqf | 30 ---------------- .../map_gestures/functions/fnc_transmit.sqf | 24 +++++++------ .../functions/fnc_transmitterInit.sqf | 22 ++++++------ addons/map_gestures/script_component.hpp | 2 ++ 12 files changed, 67 insertions(+), 78 deletions(-) create mode 100644 addons/map_gestures/XEH_serverPostInit.sqf delete mode 100644 addons/map_gestures/functions/fnc_sanitizeName.sqf diff --git a/addons/map_gestures/CfgEventHandlers.hpp b/addons/map_gestures/CfgEventHandlers.hpp index e75956f440..7e0c8d2ce3 100644 --- a/addons/map_gestures/CfgEventHandlers.hpp +++ b/addons/map_gestures/CfgEventHandlers.hpp @@ -7,5 +7,6 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_postInit)); + serverInit = QUOTE(call COMPILE_FILE(XEH_serverPostInit)); }; }; diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf index ad4da44998..8154106fd6 100644 --- a/addons/map_gestures/XEH_preInit.sqf +++ b/addons/map_gestures/XEH_preInit.sqf @@ -11,7 +11,6 @@ PREP(isValidColorArray); PREP(moduleGroupSettings); PREP(moduleSettings); PREP(receiverInit); -PREP(sanitizeName); PREP(transmit); PREP(transmitterInit); diff --git a/addons/map_gestures/XEH_serverPostInit.sqf b/addons/map_gestures/XEH_serverPostInit.sqf new file mode 100644 index 0000000000..9bbf84911e --- /dev/null +++ b/addons/map_gestures/XEH_serverPostInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +[MAP_GESTURES_NO_OWNER_ID_EVENT, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler) diff --git a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf index c686c17b79..92b1e95ab5 100644 --- a/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf +++ b/addons/map_gestures/functions/fnc_assignClientIDOnServer.sqf @@ -18,7 +18,7 @@ params ["_unitName"]; { - if (name _x == _unitName) then { + if (name _x == _unitName) exitWith { _x setVariable [QGVAR(owner_id), owner _x, true]; }; } count playableUnits; diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 54efd878ce..31c41ca995 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -15,23 +15,35 @@ */ #include "script_component.hpp" -if (!GVAR(enabled)) exitWith {}; -if (!visibleMap) exitWith {}; +#define ICON_RENDER_SIZE 55 +#define ICON_TEXT_ALIGN "left" +#define ICON_ANGLE 0 +#define ICON_SHADOW 1 +#define TEXT_FONT "PuristaBold" +#define TEXT_ICON_RENDER_SIZE 20 +#define TEXT_SIZE 0.030 +#define TEXT_SHADOW 0 + +if (!GVAR(enabled) || !visibleMap) exitWith {}; params ["_mapHandle"]; -_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); +// Iterate over all nearby players and render their pointer if player is transmitting. { - _nameSane = [name _x] call FUNC(sanitizeName); - _drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane]; - if (!isNil _drawPosVariableName) then { + // Data variable name for unit + _unitUID = getPlayerUID _x; + _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil}; + + if (!isNil "_drawPosVariableName") then { if (isNil {missionNamespace getVariable _drawPosVariableName}) then {missionNamespace setVariable [_drawPosVariableName, [1, 1, 1]];}; _pos = missionNamespace getVariable _drawPosVariableName; - if (alive _x && - {_x getVariable QGVAR(Transmit)}) then { + + // Only render if the unit is alive and transmitting + if (alive _x && {_x getVariable QGVAR(Transmit)}) then { _group = group _x; _grpName = groupID _group; + // If color settings for the group exist, then use those, otherwise fall back to the default colors _color = if (_grpName in GVAR(GroupColorConfigurationsGroups)) then { _grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName; (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group) @@ -39,9 +51,10 @@ _proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)}; }; - _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, 55, 55, 0, "", 1, 0.030, "PuristaBold", "left"]; - _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, 20, 20, 0, name _x, 0, 0.030, "PuristaBold", "left"]; + // Render icon and player name + _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; + _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; }; }; nil -} count _proximityPlayers; +} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers)); diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf index 3ac8803a70..43d78f3506 100644 --- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf +++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf @@ -19,5 +19,6 @@ params ["_unit", "_range"]; _proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range]; -_proximityPlayers = _proximityPlayers - [_unit]; -(_proximityPlayers + (crew vehicle _unit)) +_proximityPlayers deleteAt (_proximityPlayers find _unit); +_proximityPlayers append (crew vehicle _unit) +_proximityPlayers diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index 32f7e73143..013f076347 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -19,22 +19,24 @@ params ["_logic", "_units", "_activated"]; -diag_log "Running"; - -if (!_activated) exitWith {}; -if (!isServer) exitWith {}; +if (!_activated || !isServer) exitWith {}; +// Transcode string setting into usable array. Example: "1,1,1,1" -> [1, 1, 1, 1] _leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]"); if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; _color = call compile ("[" + (_logic getVariable ["color", ""]) + "]"); if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; +// If we already have color configurations from another source, use those, otherwise use default. _configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) }; _configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups)) then { [] } else { +GVAR(GroupColorConfigurationsGroups) }; _configurationGroupsIndex = if (isNil QGVAR(GroupColorConfigurationsGroupIndex)) then { [] } else { +GVAR(GroupColorConfigurationsGroupIndex) }; -_completedGroups = []; +// Save custom color configuration and keep the index of the entry. _configurationIndex = _configurations pushBack [_leadColor, _color]; + +// Add all synchronized groups and reference custom configuration for them +_completedGroups = []; { private "_group"; _group = groupID (group _x); diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf index 719e5a727b..a14efbffc1 100644 --- a/addons/map_gestures/functions/fnc_receiverInit.sqf +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -15,14 +15,6 @@ */ #include "script_component.hpp" -{ - if (isPlayer _x) then { - _nameSane = [name _x] call FUNC(sanitizeName); - missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], [1, 1, 1]]; - }; - nil -} count allUnits; - ACE_player setVariable [QGVAR(Transmit), false, true]; GVAR(EnableTransmit) = false; diff --git a/addons/map_gestures/functions/fnc_sanitizeName.sqf b/addons/map_gestures/functions/fnc_sanitizeName.sqf deleted file mode 100644 index f36e626102..0000000000 --- a/addons/map_gestures/functions/fnc_sanitizeName.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: Dslyecxi, MikeMatrix - * Cleans up unit names to be usable within variable names. - * - * Arguments: - * 0: Name - * - * Return Value: - * Sanitized name - * - * Example: - * ["I am a non valid variable name"] call ace_map_gestures_fnc_sanitizeName - * - * Public: No - */ -#include "script_component.hpp" - -private ["_alphabet", "_nameSanitized"]; - -params ["_name"]; - -_alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]; - -_nameSanitized = []; -{ - if (toString [_x] in _alphabet) then {_nameSanitized pushBack _x}; - nil -} count (toArray _name); - -toString _nameSanitized diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index 4d99caa160..56adbe4266 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -16,26 +16,30 @@ */ #include "script_component.hpp" -private ["_proximityPlayers", "_ownerID", "_nameSane"]; +private ["_proximityPlayers", "_ownerID", "_unitUID", "_drawPosVariableName"]; params ["", "_pfhId"]; -if (!GVAR(EnableTransmit) || !visibleMap) exitWith { +if (!visibleMap) then { call FUNC(endTransmit); +} + +if (!GVAR(EnableTransmit) || !visibleMap) exitWith { [_pfhId] call CBA_fnc_removePerFrameHandler; }; -_proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers); -TRACE_1("Near",_proximityPlayers) - { _ownerID = _x getVariable QGVAR(owner_id); if (isNil "_ownerID") then { - [0, {[_this] call FUNC(assignClientIDOnServer)}, name _x] call cba_fnc_GlobalExecute; + [MAP_GESTURES_NO_OWNER_ID_EVENT, [name _x]] call EFUNC(common,serverEvent); } else { - if (_ownerID != ACE_player getVariable QGVAR(owner_id)) then { - _nameSane = [name ACE_player] call FUNC(sanitizeName); - _ownerID publicVariableClient format [QGVAR(%1_DrawPos), _nameSane]; + _playerOwnerID = ACE_player getVariable QGVAR(owner_id); + if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then { + _unitUID = getPlayerUID ACE_Player; + _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil}; + if (!isNil "_drawPosVariableName") then { + _ownerID publicVariableClient _drawPosVariableName; + }; }; }; -} count _proximityPlayers; +} count ([ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers)); diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf index 828261e017..251e6d2619 100644 --- a/addons/map_gestures/functions/fnc_transmitterInit.sqf +++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_mapCtrl", "_nameSane"]; +private ["_mapCtrl", "_unitUID", "_drawPosVariableName"]; disableSerialization; @@ -24,19 +24,19 @@ _mapCtrl = findDisplay 12 displayCtrl 51; // MouseMoving EH. if (!isNil QGVAR(MouseMoveHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; GVAR(MouseMoveHandlerID) = nil;}; GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", { - if (EGVAR(maptools,drawing_isDrawing)) exitWith {}; - if (EGVAR(maptools,mapTool_isDragging)) exitWith {}; - if (EGVAR(maptools,mapTool_isRotating)) exitWith {}; + // Don't transmit any data if we're using the map tools + if (!GVAR(EnableTransmit) || EGVAR(maptools,drawing_isDrawing) || EGVAR(maptools,mapTool_isDragging) || EGVAR(maptools,mapTool_isRotating)) exitWith {}; params ["_control", "_posX", "_posY"]; - if (GVAR(EnableTransmit)) then { - if (!(ACE_player getVariable QGVAR(Transmit))) then { - ACE_player setVariable [QGVAR(Transmit), true, true]; - }; + if (!(ACE_player getVariable QGVAR(Transmit))) then { + ACE_player setVariable [QGVAR(Transmit), true, true]; + }; - _nameSane = [name ACE_player] call FUNC(sanitizeName); - missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], _control ctrlMapScreenToWorld [_posX, _posY]]; + _unitUID = getPlayerUID ACE_player; + _drawPosVariableName = if (!isNil "_unitUID" && _unitUID != "") then {format [QGVAR(%1_DrawPos), _unitUID]} else {nil}; + if (!isNil "_drawPosVariableName") then { + missionNamespace setVariable [_drawPosVariableName, _control ctrlMapScreenToWorld [_posX, _posY]]; }; }]; @@ -53,6 +53,8 @@ GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", { // MouseUp EH if (!isNil QGVAR(MouseUpHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; GVAR(MouseUpHandlerID) = nil;}; GVAR(MouseUpHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonUp", { + if (!GVAR(enabled)) exitWith {}; + params ["", "_button"]; if (_button == 0) then {call FUNC(endTransmit);}; diff --git a/addons/map_gestures/script_component.hpp b/addons/map_gestures/script_component.hpp index 7c6f3a5b2f..50f155ccc1 100644 --- a/addons/map_gestures/script_component.hpp +++ b/addons/map_gestures/script_component.hpp @@ -10,3 +10,5 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define MAP_GESTURES_NO_OWNER_ID_EVENT "PlayerNameHasNoOwnerID" From 203c4d8a6ca46551b6535c4581d37a76bf48c23e Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Mon, 24 Aug 2015 17:10:54 +0200 Subject: [PATCH 018/311] add WaitUntilAndExecute --- addons/common/XEH_postInit.sqf | 16 ++++++++++++-- .../functions/fnc_waitUnilAndExecute.sqf | 22 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 addons/common/functions/fnc_waitUnilAndExecute.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index bf699ab83c..e57dab3521 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -3,9 +3,9 @@ //IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); -//Singe PFEH to handle execNextFrame and waitAndExec: +//Singe PFEH to handle execNextFrame, waitAndExec and waitUntilAndExec: [{ - private ["_entry"]; + private ["_entry", "_deleted"]; //Handle the waitAndExec array: while {((count GVAR(waitAndExecArray)) > 0) && {((GVAR(waitAndExecArray) select 0) select 0) <= ACE_Time}} do { @@ -17,6 +17,18 @@ { (_x select 0) call (_x select 1); } forEach GVAR(nextFrameBufferA); + + + _deleted = 0; + { + _x params ["_condition", "_code", "_args"]; + if ((_args call _condition)) then { + GVAR(waitUntilAndExecArray) deleteAt (_forEachIndex + _deleted); + _deleted = _deleted + 1; + _args call _code; + }; + } forEach GVAR(waitUntilAndExecArray); + //Swap double-buffer: GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB); GVAR(nextFrameBufferB) = []; diff --git a/addons/common/functions/fnc_waitUnilAndExecute.sqf b/addons/common/functions/fnc_waitUnilAndExecute.sqf new file mode 100644 index 0000000000..de4623b4ae --- /dev/null +++ b/addons/common/functions/fnc_waitUnilAndExecute.sqf @@ -0,0 +1,22 @@ +/* + * Author: joko // Jonas + * + * Executes a code once with after the Condition is True, using a PFH + * + * Argument: + * 0: Condition + * 1: Code to execute + * 2: Parameters to run the code with + + * + * Return value: + * None + * + * Example: + * [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player], false] call ace_common_fnc_waitAndExecute + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(waitUntilAndExecArray) pushBack _this; From ee2cc22801ae83b698a403cb43610fa23031dbae Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 24 Aug 2015 17:28:08 +0200 Subject: [PATCH 019/311] Added missing semicolon --- addons/map_gestures/functions/fnc_transmit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index 56adbe4266..ccd702fd55 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -22,7 +22,7 @@ params ["", "_pfhId"]; if (!visibleMap) then { call FUNC(endTransmit); -} +}; if (!GVAR(EnableTransmit) || !visibleMap) exitWith { [_pfhId] call CBA_fnc_removePerFrameHandler; From 0ff5e86b5271ee4035927caa7df724700fd92d5e Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 24 Aug 2015 21:00:24 +0200 Subject: [PATCH 020/311] Another missing semi-colon --- addons/map_gestures/functions/fnc_getProximityPlayers.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf index 43d78f3506..7a72c00520 100644 --- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf +++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf @@ -20,5 +20,5 @@ params ["_unit", "_range"]; _proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range]; _proximityPlayers deleteAt (_proximityPlayers find _unit); -_proximityPlayers append (crew vehicle _unit) +_proximityPlayers append (crew vehicle _unit); _proximityPlayers From ef2924623f05142ea960e857ed230aec02ba9547 Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 24 Aug 2015 21:45:02 +0200 Subject: [PATCH 021/311] Added common parseList function for module list parsing --- addons/common/XEH_preInit.sqf | 1 + .../functions/fnc_assignObjectsInList.sqf | 39 +++++------- addons/common/functions/fnc_parseList.sqf | 61 +++++++++++++++++++ addons/slideshow/XEH_preInit.sqf | 1 - addons/slideshow/functions/fnc_makeList.sqf | 57 ----------------- addons/slideshow/functions/fnc_moduleInit.sqf | 8 +-- 6 files changed, 80 insertions(+), 87 deletions(-) create mode 100644 addons/common/functions/fnc_parseList.sqf delete mode 100644 addons/slideshow/functions/fnc_makeList.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 6fdf99113c..705e8e8b4b 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -144,6 +144,7 @@ PREP(numberToDigitsString); PREP(numberToString); PREP(onAnswerRequest); PREP(owned); +PREP(parseList); PREP(player); PREP(playerSide); PREP(positionToASL); diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf index 0d10066d01..89c8a3352d 100644 --- a/addons/common/functions/fnc_assignObjectsInList.sqf +++ b/addons/common/functions/fnc_assignObjectsInList.sqf @@ -4,47 +4,36 @@ * Used by moduleAssign* within various parts of the ACE3 project. * * Arguments: - * 0: list - * 1: variableName - * 2: value + * 0: List + * 1: Variable Name + * 2: Value * 3: Global * * Return Value: - * None + * None + * + * Example: + * ["text", "variable", value, true] call ace_common_fnc_assignObjectsInList * * Public: No */ - +#define DEBUG_MODE_FULL #include "script_component.hpp" -private ["_splittedList", "_nilCheckPassedList"]; params ["_list", "_variable", "_setting", "_global"]; if (typeName _list == "STRING") then { - _splittedList = [_list, ","] call BIS_fnc_splitString; - _nilCheckPassedList = ""; - { - _x = [_x] call FUNC(stringRemoveWhiteSpace); - if !(isnil _x) then { - if (_nilCheckPassedList == "") then { - _nilCheckPassedList = _x; - } else { - _nilCheckPassedList = _nilCheckPassedList + ","+ _x; - }; - }; - }foreach _splittedList; - - _list = [] call compile format["[%1]",_nilCheckPassedList]; + _list = [_list, true, true] call FUNC(parseList); + TRACE_1("Parsed",_list) }; { - if (!isnil "_x") then { + if (!isNil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [_variable, _setting, _global]; + _x setVariable [_variable, _setting, _global]; + TRACE_4("Set variable",_x,_variable,_setting,_global); }; }; }; -}foreach _list; - -true +} count _list; diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf new file mode 100644 index 0000000000..20630e1109 --- /dev/null +++ b/addons/common/functions/fnc_parseList.sqf @@ -0,0 +1,61 @@ +/* + * Author: Jonpas + * Makes a list from a string using comma as a delimiter, optionally trim or remove whitespace and check each for object existence. + * + * Arguments: + * 0: List + * 1: Remove or Trim Whitespace (default: false (trim)) + * 2: Check Nil (default: false) + * + * Return Value: + * Parsed List + * + * Example: + * ["text", true, false] call ace_common_fnc_parseList + * + * Public: No + */ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +private ["_splittedList", "_whitespaceList", "_nilCheckedList"]; +params ["_list", ["_removeWhitespace", false], ["_checkNil", false]]; + + +// Split using comma delimiter +_splittedList = [_list, ","] call BIS_fnc_splitString; + + +// Remove or Trim Whitespace +_whitespaceList = []; +{ + if (_removeWhitespace) then { + _whitespaceList pushBack ([_x] call FUNC(stringRemoveWhiteSpace)); + } else { + _whitespaceList pushBack ([_x] call CBA_fnc_trim); + }; + nil +} count _splittedList; +_list = _whitespaceList; + + +// Check for object existence +_nilCheckedList = ""; +if (_checkNil) then { + { + if !(isNil _x) then { + if (_nilCheckedList == "") then { + _nilCheckedList = _x; + } else { + _nilCheckedList = _nilCheckedList + "," + _x; + }; + }; + } count _list; + + // Add Array characters and parse into array + _list = [] call compile format ["[%1]", _nilCheckedList]; +}; + +TRACE_4("Lists",_splittedList,_whitespaceList,_nilCheckedList,_list); + +_list diff --git a/addons/slideshow/XEH_preInit.sqf b/addons/slideshow/XEH_preInit.sqf index 0f9e270896..152c02ec77 100644 --- a/addons/slideshow/XEH_preInit.sqf +++ b/addons/slideshow/XEH_preInit.sqf @@ -5,7 +5,6 @@ ADDON = false; PREP(addSlideActions); PREP(autoTransition); PREP(createSlideshow); -PREP(makeList); PREP(moduleInit); GVAR(slideshows) = 0; diff --git a/addons/slideshow/functions/fnc_makeList.sqf b/addons/slideshow/functions/fnc_makeList.sqf deleted file mode 100644 index 6736fabbdb..0000000000 --- a/addons/slideshow/functions/fnc_makeList.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Author: Jonpas - * Makes a list from a string using comma as a delimiter, optionally remove whitespace and check each for object existence. - * - * Arguments: - * 0: Text - * 1: Trim Whitespace - * 2: Check Nil - * - * Return Value: - * Parsed List - * - * Example: - * ["text", true, false] call ace_slideshow_fnc_makeList - * - * Public: No - */ -#include "script_component.hpp" - -params ["_list", "_trimWhitespace", "_checkNil"]; - -private ["_splittedList", "_listTrimmedWhitespace", "_nilCheckPassedList"]; - -// Split using comma delimiter -_splittedList = [_list, ","] call BIS_fnc_splitString; - -// Remove whitespace -_listTrimmedWhitespace = []; -if (_trimWhitespace) then { - { - _listTrimmedWhitespace pushBack ([_x] call CBA_fnc_trim); - nil - } count _splittedList; - _list = _listTrimmedWhitespace; -}; - -// Check for object existence -_nilCheckPassedList = ""; -if (_checkNil) then { - { - if !(isNil _x) then { - if (_nilCheckPassedList == "") then { - _nilCheckPassedList = _x; - } else { - _nilCheckPassedList = _nilCheckPassedList + "," + _x; - }; - }; - } count _list; - - // Add Array characters and parse into array - _list = "[" + _nilCheckPassedList + "]"; - _list = [] call compile _list; -}; - -TRACE_4("Lists",_splittedList,_listTrimmedWhitespace,_nilCheckPassedList,_list); - -_list // return diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index da1724dfcc..e4f7fbb56c 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -25,10 +25,10 @@ if !(_activated) exitWith {}; if (isNull _logic) exitWith {}; // Extract variables from logic -_objects = [_logic getVariable ["Objects", ""], true, true] call FUNC(makeList); -_controllers = [_logic getVariable ["Controllers", ""], true, true] call FUNC(makeList); -_images = [_logic getVariable ["Images", ""], true, false] call FUNC(makeList); -_names = [_logic getVariable ["Names", ""], true, false] call FUNC(makeList); +_objects = [_logic getVariable ["Objects", ""], true, true] call EFUNC(common,parseList); +_controllers = [_logic getVariable ["Controllers", ""], true, true] call EFUNC(common,parseList); +_images = [_logic getVariable ["Images", ""], false, false] call EFUNC(common,parseList); +_names = [_logic getVariable ["Names", ""], false, false] call EFUNC(common,parseList); _duration = _logic getVariable ["Duration", 0]; // Prepare with actions From 5b6429f23e84bd3af7439d88cd5aa9860f72006a Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 24 Aug 2015 21:55:48 +0200 Subject: [PATCH 022/311] Made more modules use assignObjectsInList common function --- .../functions/fnc_moduleAssignMedicRoles.sqf | 59 ++++-------------- .../fnc_moduleAssignMedicalVehicle.sqf | 60 ++++--------------- .../functions/fnc_moduleAssignEngineer.sqf | 8 +-- .../fnc_moduleAssignRepairFacility.sqf | 6 +- .../fnc_moduleAssignRepairVehicle.sqf | 8 +-- 5 files changed, 30 insertions(+), 111 deletions(-) diff --git a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf index 1c26eb53d4..a884bfe300 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf @@ -1,63 +1,26 @@ /* * Author: Glowbal - * Assign a medical role to a unit + * Assign a medical role to a unit. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * * Return Value: * None * * Public: No */ - #include "script_component.hpp" -private ["_logic","_setting","_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"]; -_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +params ["_logic"]; if (!isNull _logic) then { - _list = _logic getvariable ["EnableList",""]; + private ["_list", "_setting"]; + _list = _logic getVariable ["EnableList", ""]; + _setting = _logic getVariable ["role", 0]; - _splittedList = [_list, ","] call BIS_fnc_splitString; - _nilCheckPassedList = ""; - { - _x = [_x] call EFUNC(common,stringRemoveWhiteSpace); - if !(isnil _x) then { - if (_nilCheckPassedList == "") then { - _nilCheckPassedList = _x; - } else { - _nilCheckPassedList = _nilCheckPassedList + ","+ _x; - }; - }; - }foreach _splittedList; - - _list = "[" + _nilCheckPassedList + "]"; - _parsedList = [] call compile _list; - _setting = _logic getvariable ["role",0]; - _objects = synchronizedObjects _logic; - if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then { - { - if (!isnil "_x") then { - if (typeName _x == typeName objNull) then { - if (local _x) then { - _x setvariable [QGVAR(medicClass), _setting, true]; - }; - }; - }; - }foreach _objects; - }; - { - if (!isnil "_x") then { - if (typeName _x == typeName objNull) then { - if (local _x) then { - _x setvariable [QGVAR(medicClass), _setting, true]; - }; - }; - }; - }foreach _parsedList; - }; - -true \ No newline at end of file + [_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); + [synchronizedObjects _logic, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); +}; diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index af6de73ce1..d073ffaecb 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -1,64 +1,26 @@ /* * Author: Glowbal - * Assign vehicle as a medical vehicle + * Assign vehicle as a medical vehicle. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * * Return Value: * None * * Public: No */ - - #include "script_component.hpp" -private ["_logic","_setting","_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"]; -_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +params ["_logic"]; if (!isNull _logic) then { - _list = _logic getvariable ["EnableList",""]; + private ["_list", "_setting"]; + _list = _logic getVariable ["EnableList", ""]; + _setting = _logic getVariable ["enabled", 0]; - _splittedList = [_list, ","] call BIS_fnc_splitString; - _nilCheckPassedList = ""; - { - _x = [_x] call EFUNC(common,stringRemoveWhiteSpace); - if !(isnil _x) then { - if (_nilCheckPassedList == "") then { - _nilCheckPassedList = _x; - } else { - _nilCheckPassedList = _nilCheckPassedList + ","+ _x; - }; - }; - }foreach _splittedList; - - _list = "[" + _nilCheckPassedList + "]"; - _parsedList = [] call compile _list; - _setting = _logic getvariable ["enabled", 0]; - _objects = synchronizedObjects _logic; - if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then { - { - if (!isnil "_x") then { - if (typeName _x == typeName objNull) then { - if (local _x) then { - _x setvariable [QGVAR(medicClass), _setting, true]; - }; - }; - }; - }foreach _objects; - }; - { - if (!isnil "_x") then { - if (typeName _x == typeName objNull) then { - if (local _x) then { - _x setvariable [QGVAR(medicClass), _setting, true]; - }; - }; - }; - }foreach _parsedList; - }; - -true; + [_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); + [synchronizedObjects _logic, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); +}; diff --git a/addons/repair/functions/fnc_moduleAssignEngineer.sqf b/addons/repair/functions/fnc_moduleAssignEngineer.sqf index 9fb9ed8431..240a8c3b62 100644 --- a/addons/repair/functions/fnc_moduleAssignEngineer.sqf +++ b/addons/repair/functions/fnc_moduleAssignEngineer.sqf @@ -21,11 +21,9 @@ params ["_logic"]; if (!isNull _logic) then { private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList",""]; - _setting = _logic getVariable ["role",0]; + _list = _logic getVariable ["EnableList", ""]; + _setting = _logic getVariable ["role", 0]; [_list, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList); - }; - -true +}; diff --git a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf index 00cb847866..7150d0226b 100644 --- a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf +++ b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf @@ -21,11 +21,9 @@ params ["_logic"]; if (!isNull _logic) then { private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList",""]; - _setting = _logic getVariable ["role",0]; + _list = _logic getVariable ["EnableList", ""]; + _setting = _logic getVariable ["role", 0]; [_list, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList); }; - -true diff --git a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf index 69d2a2c52f..647b5fe52c 100644 --- a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf +++ b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf @@ -21,11 +21,9 @@ params ["_logic"]; if (!isNull _logic) then { private ["_list", "_setting"]; - _list = _logic getVariable ["EnableList",""]; - _setting = _logic getVariable ["role",0]; + _list = _logic getVariable ["EnableList", ""]; + _setting = _logic getVariable ["role", 0]; [_list, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList); [synchronizedObjects _logic, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList); - }; - -true +}; From 3f41882a0673b2bdf8cbf1a42319b431c140fb9f Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 24 Aug 2015 21:56:21 +0200 Subject: [PATCH 023/311] Removed debug --- addons/common/functions/fnc_assignObjectsInList.sqf | 1 - addons/common/functions/fnc_parseList.sqf | 1 - 2 files changed, 2 deletions(-) diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf index 89c8a3352d..eddd792500 100644 --- a/addons/common/functions/fnc_assignObjectsInList.sqf +++ b/addons/common/functions/fnc_assignObjectsInList.sqf @@ -17,7 +17,6 @@ * * Public: No */ -#define DEBUG_MODE_FULL #include "script_component.hpp" params ["_list", "_variable", "_setting", "_global"]; diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf index 20630e1109..8cce3c1837 100644 --- a/addons/common/functions/fnc_parseList.sqf +++ b/addons/common/functions/fnc_parseList.sqf @@ -15,7 +15,6 @@ * * Public: No */ -#define DEBUG_MODE_FULL #include "script_component.hpp" private ["_splittedList", "_whitespaceList", "_nilCheckedList"]; From 3cbe6a3ebcc7792aac5cee970451fd32df22f679 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 24 Aug 2015 22:03:47 +0200 Subject: [PATCH 024/311] Fixed multiple group settings not applying properly. Added client configuration options for default colors. --- addons/map_gestures/ACE_Settings.hpp | 56 +++++++++++++------ addons/map_gestures/XEH_serverPostInit.sqf | 2 +- .../functions/fnc_drawMapGestures.sqf | 2 +- .../functions/fnc_moduleGroupSettings.sqf | 6 +- .../functions/fnc_moduleSettings.sqf | 4 +- .../functions/fnc_receiverInit.sqf | 3 +- .../map_gestures/functions/fnc_transmit.sqf | 2 +- .../functions/fnc_transmitterInit.sqf | 15 ++++- addons/map_gestures/script_component.hpp | 2 +- addons/map_gestures/stringtable.xml | 9 +++ 10 files changed, 72 insertions(+), 29 deletions(-) diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp index c7b9a8b2ed..67f258c4cc 100644 --- a/addons/map_gestures/ACE_Settings.hpp +++ b/addons/map_gestures/ACE_Settings.hpp @@ -1,50 +1,74 @@ class ACE_Settings { class GVAR(enabled) { - value = 1; - typeName = "BOOL"; displayName = CSTRING(enabled_displayName); description = CSTRING(enabled_description); + category = CSTRING(mapGestures_category); + isClientSettable = 0; + typeName = "BOOL"; + value = 1; }; class GVAR(maxRange) { - value = 7; - typeName = "SCALAR"; displayName = CSTRING(maxRange_displayName); description = CSTRING(maxRange_description); + category = CSTRING(mapGestures_category); + isClientSettable = 0; + typeName = "SCALAR"; + value = 7; }; class GVAR(interval) { - value = 0.03; - typeName = "SCALAR"; displayName = CSTRING(interval_displayName); description = CSTRING(interval_description); + category = CSTRING(mapGestures_category); + isClientSettable = 0; + typeName = "SCALAR"; + value = 0.03; + }; + class GVAR(nameTextColor) { + displayName = CSTRING(nameTextColor_displayName); + description = CSTRING(nameTextColor_description); + category = CSTRING(mapGestures_category); + isClientSettable = 1; + typeName = "COLOR"; + value[] = {0.2, 0.2, 0.2, 0.3}; }; class GVAR(defaultLeadColor) { - value[] = {1, 0.88, 0, 0.95}; - typeName = "COLOR"; displayName = CSTRING(defaultLeadColor_displayName); description = CSTRING(defaultLeadColor_description); + category = CSTRING(mapGestures_category); + isClientSettable = 1; + typeName = "COLOR"; + value[] = {1, 0.88, 0, 0.95}; }; class GVAR(defaultColor) { - value[] = {1, 0.88, 0, 0.7}; - typeName = "COLOR"; displayName = CSTRING(defaultColor_displayName); description = CSTRING(defaultColor_description); + category = CSTRING(mapGestures_category); + isClientSettable = 1; + typeName = "COLOR"; + value[] = {1, 0.88, 0, 0.7}; }; class GVAR(GroupColorConfigurations) { - value[] = {}; - typeName = "ARRAY"; displayName = CSTRING(GroupColorConfigurations_displayName); description = CSTRING(GroupColorConfigurations_description); + category = CSTRING(mapGestures_category); + isClientSettable = 0; + typeName = "ARRAY"; + value[] = {}; }; class GVAR(GroupColorConfigurationsGroups) { - value[] = {}; - typeName = "ARRAY"; displayName = CSTRING(GroupColorConfigurationsGroups_displayName); description = CSTRING(GroupColorConfigurationsGroups_description); + category = CSTRING(mapGestures_category); + isClientSettable = 0; + typeName = "ARRAY"; + value[] = {}; }; class GVAR(GroupColorConfigurationsGroupIndex) { - value[] = {}; - typeName = "ARRAY"; displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName); description = CSTRING(GroupColorConfigurationsGroupIndex_description); + category = CSTRING(mapGestures_category); + isClientSettable = 0; + typeName = "ARRAY"; + value[] = {}; }; }; diff --git a/addons/map_gestures/XEH_serverPostInit.sqf b/addons/map_gestures/XEH_serverPostInit.sqf index 9bbf84911e..bde1cdc55b 100644 --- a/addons/map_gestures/XEH_serverPostInit.sqf +++ b/addons/map_gestures/XEH_serverPostInit.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -[MAP_GESTURES_NO_OWNER_ID_EVENT, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler) +[EVENT_PLAYER_HAS_NO_OWNER_ID, FUNC(assignClientIDOnServer)] call EFUNC(common,addEventHandler); diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 31c41ca995..2dcf425faf 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -53,7 +53,7 @@ params ["_mapHandle"]; // Render icon and player name _mapHandle drawIcon ["\a3\ui_f\data\gui\cfg\Hints\icon_text\group_1_ca.paa", _color, _pos, ICON_RENDER_SIZE, ICON_RENDER_SIZE, ICON_ANGLE, "", ICON_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; - _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", [.2,.2,.2,.3], _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; + _mapHandle drawIcon ["#(argb,8,8,3)color(0,0,0,0)", GVAR(nameTextColor), _pos, TEXT_ICON_RENDER_SIZE, TEXT_ICON_RENDER_SIZE, ICON_ANGLE, name _x, TEXT_SHADOW, TEXT_SIZE, TEXT_FONT, ICON_TEXT_ALIGN]; }; }; nil diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index 013f076347..8c819bb4d3 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -48,6 +48,6 @@ _completedGroups = []; nil } count _units; -[QGVAR(GroupColorConfigurations), _configurations, true, true] call EFUNC(common,setSetting); -[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, true, true] call EFUNC(common,setSetting); -[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, true, true] call EFUNC(common,setSetting); +[QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting); +[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, false, true] call EFUNC(common,setSetting); +[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, false, true] call EFUNC(common,setSetting); diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf index 6b21db8588..e3e0bf714b 100644 --- a/addons/map_gestures/functions/fnc_moduleSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -32,5 +32,5 @@ if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaul _defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]"); if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")}; -[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting); -[QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting); +[QGVAR(defaultLeadColor), _defaultLeadColor, false, true] call EFUNC(common,setSetting); +[QGVAR(defaultColor), _defaultColor, false, true] call EFUNC(common,setSetting); diff --git a/addons/map_gestures/functions/fnc_receiverInit.sqf b/addons/map_gestures/functions/fnc_receiverInit.sqf index a14efbffc1..b132dad1d7 100644 --- a/addons/map_gestures/functions/fnc_receiverInit.sqf +++ b/addons/map_gestures/functions/fnc_receiverInit.sqf @@ -19,6 +19,7 @@ ACE_player setVariable [QGVAR(Transmit), false, true]; GVAR(EnableTransmit) = false; if (!isNil QGVAR(DrawMapHandlerID)) then { - (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; GVAR(DrawMapHandlerID) = nil; + (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw", GVAR(DrawMapHandlerID)]; + GVAR(DrawMapHandlerID) = nil; }; GVAR(DrawMapHandlerID) = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", FUNC(drawMapGestures)]; diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index ccd702fd55..444ebbc604 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -31,7 +31,7 @@ if (!GVAR(EnableTransmit) || !visibleMap) exitWith { { _ownerID = _x getVariable QGVAR(owner_id); if (isNil "_ownerID") then { - [MAP_GESTURES_NO_OWNER_ID_EVENT, [name _x]] call EFUNC(common,serverEvent); + [EVENT_PLAYER_HAS_NO_OWNER_ID, [name _x]] call EFUNC(common,serverEvent); } else { _playerOwnerID = ACE_player getVariable QGVAR(owner_id); if (!isNil "_playerOwnerID" && _ownerID != _playerOwnerID) then { diff --git a/addons/map_gestures/functions/fnc_transmitterInit.sqf b/addons/map_gestures/functions/fnc_transmitterInit.sqf index 251e6d2619..897855dc00 100644 --- a/addons/map_gestures/functions/fnc_transmitterInit.sqf +++ b/addons/map_gestures/functions/fnc_transmitterInit.sqf @@ -22,7 +22,10 @@ disableSerialization; _mapCtrl = findDisplay 12 displayCtrl 51; // MouseMoving EH. -if (!isNil QGVAR(MouseMoveHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; GVAR(MouseMoveHandlerID) = nil;}; +if (!isNil QGVAR(MouseMoveHandlerID)) then { + _mapCtrl ctrlRemoveEventHandler ["MouseMoving", GVAR(MouseMoveHandlerID)]; + GVAR(MouseMoveHandlerID) = nil; +}; GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", { // Don't transmit any data if we're using the map tools if (!GVAR(EnableTransmit) || EGVAR(maptools,drawing_isDrawing) || EGVAR(maptools,mapTool_isDragging) || EGVAR(maptools,mapTool_isRotating)) exitWith {}; @@ -41,7 +44,10 @@ GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", { }]; // MouseDown EH -if (!isNil QGVAR(MouseDownHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)]; GVAR(MouseDownHandlerID) = nil;}; +if (!isNil QGVAR(MouseDownHandlerID)) then { + _mapCtrl ctrlRemoveEventHandler ["MouseButtonDown",GVAR(MouseDownHandlerID)]; + GVAR(MouseDownHandlerID) = nil; +}; GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", { if (!GVAR(enabled)) exitWith {}; @@ -51,7 +57,10 @@ GVAR(MouseDownHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonDown", { }]; // MouseUp EH -if (!isNil QGVAR(MouseUpHandlerID)) then {_mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; GVAR(MouseUpHandlerID) = nil;}; +if (!isNil QGVAR(MouseUpHandlerID)) then { + _mapCtrl ctrlRemoveEventHandler ["MouseButtonUp", GVAR(MouseUpHandlerID)]; + GVAR(MouseUpHandlerID) = nil; +}; GVAR(MouseUpHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseButtonUp", { if (!GVAR(enabled)) exitWith {}; diff --git a/addons/map_gestures/script_component.hpp b/addons/map_gestures/script_component.hpp index 50f155ccc1..1a5ecada12 100644 --- a/addons/map_gestures/script_component.hpp +++ b/addons/map_gestures/script_component.hpp @@ -11,4 +11,4 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define MAP_GESTURES_NO_OWNER_ID_EVENT "PlayerNameHasNoOwnerID" +#define EVENT_PLAYER_HAS_NO_OWNER_ID "PlayerNameHasNoOwnerID" diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index 324e9f92e7..78e4378b73 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -91,5 +91,14 @@ Enables the Map Gestures. + + Name Text Color + + + Color of the name tag text besides the map gestures mark. + + + Map Gestures + From 2b0ef7bc6d9831d3dbe626658ad39a9f5e72abda Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 24 Aug 2015 22:10:02 +0200 Subject: [PATCH 025/311] Removed explicitly stated `isClientSettable` in Map Gestures ace settings --- addons/map_gestures/ACE_Settings.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp index 67f258c4cc..1b223d0d67 100644 --- a/addons/map_gestures/ACE_Settings.hpp +++ b/addons/map_gestures/ACE_Settings.hpp @@ -3,7 +3,6 @@ class ACE_Settings { displayName = CSTRING(enabled_displayName); description = CSTRING(enabled_description); category = CSTRING(mapGestures_category); - isClientSettable = 0; typeName = "BOOL"; value = 1; }; @@ -11,7 +10,6 @@ class ACE_Settings { displayName = CSTRING(maxRange_displayName); description = CSTRING(maxRange_description); category = CSTRING(mapGestures_category); - isClientSettable = 0; typeName = "SCALAR"; value = 7; }; @@ -19,7 +17,6 @@ class ACE_Settings { displayName = CSTRING(interval_displayName); description = CSTRING(interval_description); category = CSTRING(mapGestures_category); - isClientSettable = 0; typeName = "SCALAR"; value = 0.03; }; @@ -51,7 +48,6 @@ class ACE_Settings { displayName = CSTRING(GroupColorConfigurations_displayName); description = CSTRING(GroupColorConfigurations_description); category = CSTRING(mapGestures_category); - isClientSettable = 0; typeName = "ARRAY"; value[] = {}; }; @@ -59,7 +55,6 @@ class ACE_Settings { displayName = CSTRING(GroupColorConfigurationsGroups_displayName); description = CSTRING(GroupColorConfigurationsGroups_description); category = CSTRING(mapGestures_category); - isClientSettable = 0; typeName = "ARRAY"; value[] = {}; }; @@ -67,7 +62,6 @@ class ACE_Settings { displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName); description = CSTRING(GroupColorConfigurationsGroupIndex_description); category = CSTRING(mapGestures_category); - isClientSettable = 0; typeName = "ARRAY"; value[] = {}; }; From 93acdbcb4d8802d52730bb43b7f149d88443d100 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 24 Aug 2015 22:45:59 +0200 Subject: [PATCH 026/311] Replaced custom mapping implementation with ACE Hash --- addons/map_gestures/ACE_Settings.hpp | 15 ++++----------- .../functions/fnc_drawMapGestures.sqf | 5 ++--- .../functions/fnc_moduleGroupSettings.sqf | 16 +++------------- addons/map_gestures/stringtable.xml | 14 ++++---------- 4 files changed, 13 insertions(+), 37 deletions(-) diff --git a/addons/map_gestures/ACE_Settings.hpp b/addons/map_gestures/ACE_Settings.hpp index 1b223d0d67..0038027e3b 100644 --- a/addons/map_gestures/ACE_Settings.hpp +++ b/addons/map_gestures/ACE_Settings.hpp @@ -51,18 +51,11 @@ class ACE_Settings { typeName = "ARRAY"; value[] = {}; }; - class GVAR(GroupColorConfigurationsGroups) { - displayName = CSTRING(GroupColorConfigurationsGroups_displayName); - description = CSTRING(GroupColorConfigurationsGroups_description); + class GVAR(GroupColorConfigurationMapping) { + displayName = CSTRING(GroupColorConfigurationMapping_displayName); + description = CSTRING(GroupColorConfigurationMapping_description); category = CSTRING(mapGestures_category); typeName = "ARRAY"; - value[] = {}; - }; - class GVAR(GroupColorConfigurationsGroupIndex) { - displayName = CSTRING(GroupColorConfigurationsGroupIndex_displayName); - description = CSTRING(GroupColorConfigurationsGroupIndex_description); - category = CSTRING(mapGestures_category); - typeName = "ARRAY"; - value[] = {}; + value[] = {{}, {}}; }; }; diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 2dcf425faf..4ba70f1b30 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -44,9 +44,8 @@ params ["_mapHandle"]; _grpName = groupID _group; // If color settings for the group exist, then use those, otherwise fall back to the default colors - _color = if (_grpName in GVAR(GroupColorConfigurationsGroups)) then { - _grpNameIndex = GVAR(GroupColorConfigurationsGroups) find _grpName; - (GVAR(GroupColorConfigurations) select (GVAR(GroupColorConfigurationsGroupIndex) select _grpNameIndex)) select (_x != leader _group) + _color = if (HASH_HASKEY(GVAR(GroupColorConfigurationMapping),_grpName)) then { + (GVAR(GroupColorConfigurations) select (HASH_GET(GVAR(GroupColorConfigurationMapping),_grpName))) select (_x != leader _group) } else { if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)}; }; diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index 8c819bb4d3..ac01516618 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -29,25 +29,15 @@ if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a va // If we already have color configurations from another source, use those, otherwise use default. _configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) }; -_configurationGroups = if (isNil QGVAR(GroupColorConfigurationsGroups)) then { [] } else { +GVAR(GroupColorConfigurationsGroups) }; -_configurationGroupsIndex = if (isNil QGVAR(GroupColorConfigurationsGroupIndex)) then { [] } else { +GVAR(GroupColorConfigurationsGroupIndex) }; +_configurationGroupMappings = if(isNil QGVAR(GroupColorConfigurationMapping)) then { HASH_CREATE } else { +GVAR(GroupColorConfigurationMapping) }; // Save custom color configuration and keep the index of the entry. _configurationIndex = _configurations pushBack [_leadColor, _color]; // Add all synchronized groups and reference custom configuration for them -_completedGroups = []; { - private "_group"; - _group = groupID (group _x); - if (!(_group in _completedGroups)) then { - _index = if (_group in _configurationGroups) then {_configurationGroups find _group} else {_configurationGroups pushBack _group}; - _configurationGroupsIndex set [_index, _configurationIndex]; - _completedGroups pushBack _group; - }; - nil + HASH_SET(_configurationGroupMappings,groupID (group _x),_configurationIndex); } count _units; [QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting); -[QGVAR(GroupColorConfigurationsGroups), _configurationGroups, false, true] call EFUNC(common,setSetting); -[QGVAR(GroupColorConfigurationsGroupIndex), _configurationGroupsIndex, false, true] call EFUNC(common,setSetting); +[QGVAR(GroupColorConfigurationMapping), _configurationGroupMappings, false, true] call EFUNC(common,setSetting); diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index 78e4378b73..e5eab426a3 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -76,17 +76,11 @@ Group color configuration containing arrays of color pairs ([leadColor, color]). - - Group color group name index, containing names of groups with configurations attached to them. + + Hash of Group ID mapped to the Group color configuration index. - - Group color group name index - - - Group color group name mapping index - - - Group color group name mapping index, mapping the GroupColorConfigurationsGroups to the GroupColorConfigurations. + + GroupID Color configuration mapping Enables the Map Gestures. From 431bd309a85c0d0c837d797ee9eb9211ed8e3295 Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Mon, 24 Aug 2015 23:26:03 +0200 Subject: [PATCH 027/311] Fixed variable privatization --- addons/map_gestures/functions/fnc_drawMapGestures.sqf | 2 ++ addons/map_gestures/functions/fnc_getProximityPlayers.sqf | 2 ++ addons/map_gestures/functions/fnc_moduleGroupSettings.sqf | 2 ++ addons/map_gestures/functions/fnc_moduleSettings.sqf | 7 ++++--- addons/map_gestures/functions/fnc_transmit.sqf | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 4ba70f1b30..b369686501 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -26,6 +26,8 @@ if (!GVAR(enabled) || !visibleMap) exitWith {}; +private["_color", "_drawPosVariableName", "_group", "_grpName", "_pos", "_unitUID"]; + params ["_mapHandle"]; // Iterate over all nearby players and render their pointer if player is transmitting. diff --git a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf index 7a72c00520..dded0b1273 100644 --- a/addons/map_gestures/functions/fnc_getProximityPlayers.sqf +++ b/addons/map_gestures/functions/fnc_getProximityPlayers.sqf @@ -16,6 +16,8 @@ */ #include "script_component.hpp" +private "_proximityPlayers"; + params ["_unit", "_range"]; _proximityPlayers = (getPos _unit) nearEntities [["CAMAnBase"], _range]; diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index ac01516618..9c21bf867d 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -17,6 +17,8 @@ */ #include "script_component.hpp" +private ["_color", "_configurationGroupMappings", "_configurationIndex", "_configurations", "_leadColor"]; + params ["_logic", "_units", "_activated"]; if (!_activated || !isServer) exitWith {}; diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf index e3e0bf714b..99583074fc 100644 --- a/addons/map_gestures/functions/fnc_moduleSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -17,10 +17,11 @@ */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; +private ["_defaultColor", "_defaultLeadColor"]; -if (!_activated) exitWith {}; -if (!isServer) exitWith {}; +params ["_logic", "", "_activated"]; + +if (!_activated || !isServer) exitWith {}; [_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule); diff --git a/addons/map_gestures/functions/fnc_transmit.sqf b/addons/map_gestures/functions/fnc_transmit.sqf index 444ebbc604..c9dc487db2 100644 --- a/addons/map_gestures/functions/fnc_transmit.sqf +++ b/addons/map_gestures/functions/fnc_transmit.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_proximityPlayers", "_ownerID", "_unitUID", "_drawPosVariableName"]; +private ["_ownerID", "_unitUID", "_drawPosVariableName", "_playerOwnerID"]; params ["", "_pfhId"]; From 275f04d8762020b5f2d1dcff373d73fafff52331 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 25 Aug 2015 13:18:59 -0500 Subject: [PATCH 028/311] preInit defines and fix func name --- addons/common/XEH_postInit.sqf | 12 ++++++------ addons/common/XEH_preInit.sqf | 4 +++- ...nilAndExecute.sqf => fnc_waitUntilAndExecute.sqf} | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) rename addons/common/functions/{fnc_waitUnilAndExecute.sqf => fnc_waitUntilAndExecute.sqf} (81%) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e57dab3521..9477dcf235 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -18,7 +18,12 @@ (_x select 0) call (_x select 1); } forEach GVAR(nextFrameBufferA); - + //Swap double-buffer for execNextFrame: + GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB); + GVAR(nextFrameBufferB) = []; + GVAR(nextFrameNo) = diag_frameno + 1; + + //Handle the waitUntilAndExec array: _deleted = 0; { _x params ["_condition", "_code", "_args"]; @@ -28,11 +33,6 @@ _args call _code; }; } forEach GVAR(waitUntilAndExecArray); - - //Swap double-buffer: - GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB); - GVAR(nextFrameBufferB) = []; - GVAR(nextFrameNo) = diag_frameno + 1; }, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 6fdf99113c..306eec12da 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -194,6 +194,7 @@ PREP(unmuteUnit); PREP(useItem); PREP(useMagazine); PREP(waitAndExecute); +PREP(waitUntilAndExecute); PREP(waveHeightAt); PREP(translateToWeaponSpace); @@ -297,11 +298,12 @@ PREP(_handleRequestAllSyncedEvents); GVAR(syncedEvents) = HASH_CREATE; -//GVARS for execNextFrame and waitAndExec +//GVARS for execNextFrame and waitAndExec and waitUntilAndExecute GVAR(waitAndExecArray) = []; GVAR(nextFrameNo) = diag_frameno; GVAR(nextFrameBufferA) = []; GVAR(nextFrameBufferB) = []; +GVAR(waitUntilAndExecArray) = []; // @TODO: Generic local-managed global-synced objects (createVehicleLocal) diff --git a/addons/common/functions/fnc_waitUnilAndExecute.sqf b/addons/common/functions/fnc_waitUntilAndExecute.sqf similarity index 81% rename from addons/common/functions/fnc_waitUnilAndExecute.sqf rename to addons/common/functions/fnc_waitUntilAndExecute.sqf index de4623b4ae..630ec4e2ce 100644 --- a/addons/common/functions/fnc_waitUnilAndExecute.sqf +++ b/addons/common/functions/fnc_waitUntilAndExecute.sqf @@ -1,22 +1,22 @@ /* * Author: joko // Jonas - * * Executes a code once with after the Condition is True, using a PFH * * Argument: * 0: Condition * 1: Code to execute * 2: Parameters to run the code with - * * Return value: * None * * Example: - * [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player], false] call ace_common_fnc_waitAndExecute + * [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [ACE_player]] call ace_common_fnc_waitAndExecute * * Public: No */ #include "script_component.hpp" +TRACE_1("Adding",_this); + GVAR(waitUntilAndExecArray) pushBack _this; From a83a5a17a3862f65966ef7dc633fb01d070cd799 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 28 Aug 2015 13:15:21 +0200 Subject: [PATCH 029/311] Fix Issues --- addons/kestrel4500/XEH_preInit.sqf | 2 +- addons/kestrel4500/functions/fnc_dayOfWeek.sqf | 1 + addons/kestrel4500/functions/fnc_displayKestrel.sqf | 2 +- addons/kestrel4500/functions/fnc_updateMemory.sqf | 1 + addons/kestrel4500/script_component.hpp | 2 ++ 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf index b89f07173f..b3f8ba755f 100644 --- a/addons/kestrel4500/XEH_preInit.sqf +++ b/addons/kestrel4500/XEH_preInit.sqf @@ -16,5 +16,5 @@ PREP(storeUserData); PREP(updateDisplay); PREP(updateImpellerState); PREP(updateMemory); -PREP(dayOfWeek) +PREP(dayOfWeek); ADDON = true; diff --git a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf index 9e142f661c..f63a3969b0 100644 --- a/addons/kestrel4500/functions/fnc_dayOfWeek.sqf +++ b/addons/kestrel4500/functions/fnc_dayOfWeek.sqf @@ -15,6 +15,7 @@ * * Public: No */ +#include "script_component.hpp" private "_table"; params ["_year", "_month", "_day"]; diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf index 770347ec71..64d06fea1c 100644 --- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf +++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf @@ -102,7 +102,7 @@ GVAR(Overlay) = true; __ctrlInfoLine1 ctrlSetText _ctrlInfoLine1; __ctrlInfoLine2 ctrlSetText _ctrlInfoLine2; - __ctrlBottomBig ctrlSetText _ctrlBottomBig ; + __ctrlBottomBig ctrlSetText _ctrlBottomBig; __ctrlCenterLine1 ctrlSetText _ctrlCenterLine1; __ctrlCenterLine2 ctrlSetText _ctrlCenterLine2; diff --git a/addons/kestrel4500/functions/fnc_updateMemory.sqf b/addons/kestrel4500/functions/fnc_updateMemory.sqf index f38e9ee6df..c393aee14f 100644 --- a/addons/kestrel4500/functions/fnc_updateMemory.sqf +++ b/addons/kestrel4500/functions/fnc_updateMemory.sqf @@ -14,6 +14,7 @@ * * Public: No */ +#include "script_component.hpp" params ["_slot", "_value"]; GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value]; GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)]; diff --git a/addons/kestrel4500/script_component.hpp b/addons/kestrel4500/script_component.hpp index 90c338ebeb..e1a58dc1df 100644 --- a/addons/kestrel4500/script_component.hpp +++ b/addons/kestrel4500/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT kestrel4500 #include "\z\ace\addons\main\script_mod.hpp" +#define DEBUG_ENABLED_KESTREL4500 + #ifdef DEBUG_ENABLED_KESTREL4500 #define DEBUG_MODE_FULL #endif From 1f602ea9a3c8a0e664b6cd4a56111d145c0a1b51 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 28 Aug 2015 13:17:29 +0200 Subject: [PATCH 030/311] disable Debug --- addons/kestrel4500/script_component.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/kestrel4500/script_component.hpp b/addons/kestrel4500/script_component.hpp index e1a58dc1df..90c338ebeb 100644 --- a/addons/kestrel4500/script_component.hpp +++ b/addons/kestrel4500/script_component.hpp @@ -1,8 +1,6 @@ #define COMPONENT kestrel4500 #include "\z\ace\addons\main\script_mod.hpp" -#define DEBUG_ENABLED_KESTREL4500 - #ifdef DEBUG_ENABLED_KESTREL4500 #define DEBUG_MODE_FULL #endif From 588f5adce8ec8f3812bbef0fc0310bdd4f1db634 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 29 Aug 2015 14:54:42 +0200 Subject: [PATCH 031/311] fix math issue --- addons/common/XEH_postInit.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 9477dcf235..28e334f83f 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -22,13 +22,13 @@ GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB); GVAR(nextFrameBufferB) = []; GVAR(nextFrameNo) = diag_frameno + 1; - + //Handle the waitUntilAndExec array: _deleted = 0; { _x params ["_condition", "_code", "_args"]; if ((_args call _condition)) then { - GVAR(waitUntilAndExecArray) deleteAt (_forEachIndex + _deleted); + GVAR(waitUntilAndExecArray) deleteAt (_forEachIndex - _deleted); _deleted = _deleted + 1; _args call _code; }; From c3beee82615496b2c29b6b7c179396f5d68c607e Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 30 Aug 2015 21:13:29 +0200 Subject: [PATCH 032/311] make use of getHitpointsDamage command to drastically speed up some functions about hitpoints --- addons/common/XEH_preInit.sqf | 1 + addons/common/functions/fnc_getHitPoints.sqf | 46 ++-------------- .../fnc_getHitPointsWithSelections.sqf | 52 ++----------------- .../fnc_getSelectionsWithoutHitPoints.sqf | 28 ++++++++++ 4 files changed, 37 insertions(+), 90 deletions(-) create mode 100644 addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 6fdf99113c..23b4e5c696 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -215,6 +215,7 @@ PREP(getConfigGunner); PREP(getConfigCommander); PREP(getHitPoints); PREP(getHitPointsWithSelections); +PREP(getSelectionsWithoutHitPoints); PREP(getReflectorsWithSelections); PREP(getLightProperties); PREP(getLightPropertiesWeapon); diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 06b2b8d40b..491f243b44 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -1,7 +1,7 @@ /* * Author: commy2 * - * Returns all hitpoints of any vehicle. Non unique hitpoints in turrets are ignored. + * Returns all hitpoints of any vehicle. Might contain duplicates if the turrets contain non unique hitpoints with different selection names. * * Arguments: * 0: A vehicle, not the classname (Object) @@ -11,46 +11,6 @@ */ #include "script_component.hpp" -private ["_config", "_hitpoints", "_i"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; - -_hitpoints = []; - -// get all classes that can contain hitpoints -private "_hitpointClasses"; -_hitpointClasses = [_config >> "HitPoints"]; -{ - private "_class"; - _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; - - if (isClass _class) then { - _hitpointClasses pushBack _class; - }; - -} forEach allTurrets _vehicle; - -// iterate through all classes with hitpoints and their parents -{ - private "_class"; - _class = _x; - - while {isClass _class} do { - - for "_i" from 0 to (count _class - 1) do { - private "_entry"; - _entry = configName (_class select _i); - - if (!(_entry in _hitpoints) && {!isNil {_vehicle getHitPointDamage _entry}}) then { - _hitpoints pushBack _entry; - }; - }; - - _class = inheritsFrom _class; - }; - -} forEach _hitpointClasses; - -_hitpoints +(getAllHitPointsDamage _vehicle select 0) - [""] diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index b66700881e..bc3799665e 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -11,51 +11,9 @@ */ #include "script_component.hpp" -private ["_config", "_hitpoints", "_selections", "_i"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; - -_hitpoints = []; -_selections = []; - -// get all classes that can contain hitpoints -private "_hitpointClasses"; -_hitpointClasses = [_config >> "HitPoints"]; -{ - private "_class"; - _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; - - if (isClass _class) then { - _hitpointClasses pushBack _class; - }; - -} forEach allTurrets _vehicle; - -// iterate through all classes with hitpoints and their parents -{ - private "_class"; - _class = _x; - - while {isClass _class} do { - - for "_i" from 0 to (count _class - 1) do { - if (isClass (_class select _i)) then { - private ["_entry", "_selection"]; - _entry = configName (_class select _i); - _selection = getText (_class select _i >> "name"); - - if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { - _hitpoints pushBack _entry; - _selections pushBack _selection; - }; - }; - }; - - _class = inheritsFrom _class; - }; - -} forEach _hitpointClasses; - -[_hitpoints, _selections] +private "_hitPointsWithSelections"; +_hitPointsWithSelections = getAllHitPointsDamage _vehicle; +_hitPointsWithSelections resize 2; +_hitPointsWithSelections diff --git a/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf b/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf new file mode 100644 index 0000000000..277155108a --- /dev/null +++ b/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf @@ -0,0 +1,28 @@ +/* + * Author: commy2 + * + * Returns all damageable selections without hitpoints of any vehicle. + * + * Arguments: + * 0: A vehicle, not the classname (Object) + * + * Return Value: + * The selections without hitpoints, i.e. reflectors. (Array) + */ +#include "script_component.hpp" + +params ["_vehicle"]; + +private ["_hitPointsFull", "_allSelectionsWithoutHitpoints"]; + +_hitPointsFull = getAllHitPointsDamage _vehicle; + +_allSelectionsWithoutHitpoints = []; + +{ + if (_x == "") then { + _allSelectionsWithoutHitpoints pushBack (_hitPointsFull select 1 select _forEachIndex); + }; +} forEach (_hitPointsFull select 0); + +_allSelectionsWithoutHitpoints From f22072a94da4270519be4bff55c13a655cd29f4f Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 5 Sep 2015 19:57:35 +0200 Subject: [PATCH 033/311] Use pushBack instead of array compiling --- addons/common/functions/fnc_parseList.sqf | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf index 8cce3c1837..22595201fc 100644 --- a/addons/common/functions/fnc_parseList.sqf +++ b/addons/common/functions/fnc_parseList.sqf @@ -39,20 +39,15 @@ _list = _whitespaceList; // Check for object existence -_nilCheckedList = ""; +_nilCheckedList = []; if (_checkNil) then { { if !(isNil _x) then { - if (_nilCheckedList == "") then { - _nilCheckedList = _x; - } else { - _nilCheckedList = _nilCheckedList + "," + _x; - }; + _nilCheckedList pushBack _x; }; } count _list; - // Add Array characters and parse into array - _list = [] call compile format ["[%1]", _nilCheckedList]; + _list = _nilCheckedList; }; TRACE_4("Lists",_splittedList,_whitespaceList,_nilCheckedList,_list); From a2dd77ca702bce3542ffd2985b3e2d4defeb48c6 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 5 Sep 2015 20:15:31 +0200 Subject: [PATCH 034/311] Use splitString instead of BIS_fnc_splitString --- addons/common/functions/fnc_parseList.sqf | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf index 22595201fc..dcdf255081 100644 --- a/addons/common/functions/fnc_parseList.sqf +++ b/addons/common/functions/fnc_parseList.sqf @@ -1,5 +1,5 @@ /* - * Author: Jonpas + * Author: Glowbal, Jonpas * Makes a list from a string using comma as a delimiter, optionally trim or remove whitespace and check each for object existence. * * Arguments: @@ -17,12 +17,13 @@ */ #include "script_component.hpp" -private ["_splittedList", "_whitespaceList", "_nilCheckedList"]; params ["_list", ["_removeWhitespace", false], ["_checkNil", false]]; +private ["_whitespaceList", "_nilCheckedList"]; // Split using comma delimiter -_splittedList = [_list, ","] call BIS_fnc_splitString; +_list = _list splitString ","; +TRACE_1("Splitted List",_list); // Remove or Trim Whitespace @@ -34,22 +35,25 @@ _whitespaceList = []; _whitespaceList pushBack ([_x] call CBA_fnc_trim); }; nil -} count _splittedList; +} count _list; + _list = _whitespaceList; +TRACE_1("Whitespace List",_list); // Check for object existence -_nilCheckedList = []; if (_checkNil) then { + _nilCheckedList = []; { if !(isNil _x) then { _nilCheckedList pushBack _x; }; + nil } count _list; _list = _nilCheckedList; }; -TRACE_4("Lists",_splittedList,_whitespaceList,_nilCheckedList,_list); +TRACE_1("Final List",_list); _list From 06baa5e4d362dc223cc18f30816b620ec7031a60 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 5 Sep 2015 20:51:48 +0200 Subject: [PATCH 035/311] Fixed nilCheck, changed moduleAddSpareParts to use new parseList --- addons/common/functions/fnc_parseList.sqf | 2 +- .../functions/fnc_moduleAddSpareParts.sqf | 34 +++++-------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf index dcdf255081..ef7eaae92a 100644 --- a/addons/common/functions/fnc_parseList.sqf +++ b/addons/common/functions/fnc_parseList.sqf @@ -46,7 +46,7 @@ if (_checkNil) then { _nilCheckedList = []; { if !(isNil _x) then { - _nilCheckedList pushBack _x; + _nilCheckedList pushBack (missionNamespace getVariable _x); }; nil } count _list; diff --git a/addons/repair/functions/fnc_moduleAddSpareParts.sqf b/addons/repair/functions/fnc_moduleAddSpareParts.sqf index 46689951a7..cceb62e10c 100644 --- a/addons/repair/functions/fnc_moduleAddSpareParts.sqf +++ b/addons/repair/functions/fnc_moduleAddSpareParts.sqf @@ -11,51 +11,35 @@ * None * * Example: - * function = "ace_repair_fnc_moduleAssignRepairVehicle" + * function = "ace_repair_fnc_moduleAddSpareParts" * * Public: No */ -#define DEBUG_MODE_FULL #include "script_component.hpp" params ["_logic"]; if (!isNull _logic) then { - private ["_list", "_part", "_amount", "_nilCheckPassedList"]; - // Module settings + private ["_list", "_part", "_amount"]; _list = _logic getVariable ["List", ""]; _part = _logic getVariable ["Part", 0]; _amount = _logic getVariable ["Amount", 1]; // Parse list - _nilCheckPassedList = ""; - { - _x = [_x] call EFUNC(common,stringRemoveWhiteSpace); - if !(isnil _x) then { - if (_nilCheckPassedList == "") then { - _nilCheckPassedList = _x; - } else { - _nilCheckPassedList = _nilCheckPassedList + "," + _x; - }; - }; - } forEach ([_list, ","] call BIS_fnc_splitString); - _list = "[" + _nilCheckPassedList + "]"; - _list = [] call compile _list; + _list = [_list, true, true] call EFUNC(common,parseList); // Add synchronized objects to list { _list pushBack _x; - } forEach (synchronizedObjects _logic); + nil + } count (synchronizedObjects _logic); if (_list isEqualTo []) exitWith {}; - TRACE_3("module info parsed",_list,_part,_amount); + TRACE_3("Module info parsed",_list,_part,_amount); + // Add spare parts { - if (!isNil "_x" && {typeName _x == typeName objNull}) then { - [_x, _amount, _part, true] call FUNC(addSpareParts); - }; - } forEach _list; + [_x, _amount, _part, true] call FUNC(addSpareParts); + } count _list; }; - -true From ce1c735d897e84265febcc728787ed3a64f3bb58 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 5 Sep 2015 21:57:22 +0200 Subject: [PATCH 036/311] Removed Vignette, Cleaned up UI --- addons/ui/$PBOPREFIX$ | 2 +- addons/ui/README.md | 3 ++- addons/ui/RscChat.hpp | 15 +++++++++++++++ addons/ui/RscVignette.hpp | 4 ++++ addons/ui/config.cpp | 22 ++++------------------ addons/ui/functions/script_component.hpp | 1 - 6 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 addons/ui/RscChat.hpp create mode 100644 addons/ui/RscVignette.hpp delete mode 100644 addons/ui/functions/script_component.hpp diff --git a/addons/ui/$PBOPREFIX$ b/addons/ui/$PBOPREFIX$ index 601bbd5f60..9b6ac48f4f 100644 --- a/addons/ui/$PBOPREFIX$ +++ b/addons/ui/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\ui \ No newline at end of file +z\ace\addons\ui \ No newline at end of file diff --git a/addons/ui/README.md b/addons/ui/README.md index f11027038f..c6b2a5a45b 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -1,9 +1,10 @@ ace_ui ======= -Changes the chat contrast on the map to allow easier reading +Removes vignette and changes the chat contrast on the map to allow easier reading. ## Maintainers The people responsible for merging changes to this component or answering potential questions. +- [Jonpas] (https://github.com/jonpas) diff --git a/addons/ui/RscChat.hpp b/addons/ui/RscChat.hpp new file mode 100644 index 0000000000..6b091d73bc --- /dev/null +++ b/addons/ui/RscChat.hpp @@ -0,0 +1,15 @@ +class RscText; +class RscDisplayChat { + class controls { + delete Line; + delete Background; + class CA_Background: RscText { + colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker + }; + }; +}; + +class RscChatListDefault { + colorBackground[] = {0,0,0,0.5}; // Make the chat background darker + colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter +}; diff --git a/addons/ui/RscVignette.hpp b/addons/ui/RscVignette.hpp new file mode 100644 index 0000000000..1da39c2118 --- /dev/null +++ b/addons/ui/RscVignette.hpp @@ -0,0 +1,4 @@ +class RscPicture; +class RscVignette: RscPicture { + text = ""; // Remove Vignette Texture +}; diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index e7ea4b32eb..5433708455 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -6,25 +6,11 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"VKing"}; - authorUrl = "https://github.com/ACEMod/"; + author[] = {"VKing", "Jonpas"}; + authorUrl = "https://github.com/acemod/ACE3"; VERSION_CONFIG; }; }; -class RscText; - -class RscDisplayChat { - class controls { - delete Line; - delete Background; - class CA_Background: RscText { - colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker - }; - }; -}; - -class RscChatListDefault { - colorBackground[] = {0,0,0,0.5}; // Make the chat background darker - colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter -}; +#include "RscChat.hpp" +#include "RscVignette.hpp" diff --git a/addons/ui/functions/script_component.hpp b/addons/ui/functions/script_component.hpp deleted file mode 100644 index 656228f742..0000000000 --- a/addons/ui/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\ui\script_component.hpp" From f45c0334fc1ae7ec931362246fb06e0985513fc9 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 6 Sep 2015 03:49:52 +0200 Subject: [PATCH 037/311] Added spaces --- addons/ui/RscChat.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/ui/RscChat.hpp b/addons/ui/RscChat.hpp index 6b091d73bc..46d8ff0acb 100644 --- a/addons/ui/RscChat.hpp +++ b/addons/ui/RscChat.hpp @@ -4,12 +4,12 @@ class RscDisplayChat { delete Line; delete Background; class CA_Background: RscText { - colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker + colorBackground[] = {0.5, 0.5, 0.5, 0.33}; // Make the chat entry field slightly darker }; }; }; class RscChatListDefault { - colorBackground[] = {0,0,0,0.5}; // Make the chat background darker - colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter + colorBackground[] = {0, 0, 0, 0.5}; // Make the chat background darker + colorMessageProtocol[] = {0.85, 0.85, 0.85, 1}; // And the chat text brighter }; From 3de783d3a7f42de2856f173475096e36839cc4af Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 11 Sep 2015 19:57:21 +0200 Subject: [PATCH 038/311] Cleanup for branch release, picked from #2366 --- addons/repair/CfgVehicles.hpp | 8 +++---- addons/repair/README.md | 1 + addons/repair/config.cpp | 2 +- .../repair/functions/fnc_addRepairActions.sqf | 17 ++++---------- addons/repair/functions/fnc_canMiscRepair.sqf | 4 ---- addons/repair/stringtable.xml | 23 ++----------------- 6 files changed, 13 insertions(+), 42 deletions(-) diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index e9ca5258ba..4bbf932d54 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -118,7 +118,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); class Arguments { class EnableList { - displayName = CSTRING(AssignEngineerRole_EnableList_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AssignEngineerRole_EnableList_Description); defaultValue = ""; typeName = "STRING"; @@ -162,7 +162,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); class Arguments { class EnableList { - displayName = CSTRING(AssignRepairVehicle_EnableList_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AssignRepairVehicle_EnableList_Description); defaultValue = ""; typeName = "STRING"; @@ -194,7 +194,7 @@ class CfgVehicles { function = QFUNC(moduleAssignRepairFacility); class Arguments { class EnableList { - displayName = CSTRING(AssignRepairFacility_EnableList_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AssignRepairFacility_EnableList_Description); defaultValue = ""; typeName = "STRING"; @@ -234,7 +234,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); class Arguments { class List { - displayName = CSTRING(AddSpareParts_List_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AddSpareParts_List_Description); defaultValue = ""; typeName = "STRING"; diff --git a/addons/repair/README.md b/addons/repair/README.md index 180ae38128..5cf5e8f89a 100644 --- a/addons/repair/README.md +++ b/addons/repair/README.md @@ -10,3 +10,4 @@ The people responsible for merging changes to this component or answering potent - [commy2](https://github.com/commy2) - [Glowbal](https://github.com/Glowbal) +- [Jonpas](https://github.com/jonpas) diff --git a/addons/repair/config.cpp b/addons/repair/config.cpp index c7015f4650..2e991b54a6 100644 --- a/addons/repair/config.cpp +++ b/addons/repair/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; - author[] = {"commy2", "Glowbal"}; + author[] = {"commy2", "Glowbal", "Jonpas"}; authorUrl = "https://ace3mod.com"; VERSION_CONFIG; }; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index b76f027bb0..c3588b688f 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -18,7 +18,7 @@ params ["_vehicle"]; TRACE_1("params", _vehicle); -private ["_type", "_initializedClasses"]; +private ["_type", "_initializedClasses", "_condition", "_statement", "_action"]; _type = typeOf _vehicle; @@ -44,28 +44,25 @@ _hitPointsAddedAmount = []; if (_x in _wheelHitPoints) then { // add wheel repair action - private ["_icon", "_selection"]; + private ["_icon", "_selection", "_name", "_text"]; _icon = QUOTE(PATHTOF(ui\tire_ca.paa)); _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; // textDefault = ""; _selection = _wheelHitPointSelections select (_wheelHitPoints find _x); - private ["_name", "_text", "_condition", "_statement"]; - // remove wheel action - _name = format ["Remove_%1", _x]; + _name = format ["Remove_%1", _x]; _text = localize LSTRING(RemoveWheel); _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)}; - private "_action"; _action = [_name, _text, _icon, _statement, _condition, {}, [_x], _selection, 2] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); // replace wheel action - _name = format ["Replace_%1", _x]; + _name = format ["Replace_%1", _x]; _text = localize LSTRING(ReplaceWheel); _condition = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(canRepair)}; @@ -102,7 +99,7 @@ _hitPointsAddedAmount = []; if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {}; // add misc repair action - private ["_name", "_icon", "_selection", "_condition", "_statement"]; + private ["_name", "_icon", "_selection", "_customSelectionsConfig"]; _name = format ["Repair_%1", _x]; @@ -150,11 +147,9 @@ _hitPointsAddedAmount = []; } else { _selection = [1.75, 0, -1.75]; }; - private "_action"; _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "RepairTrack"], _selection, 4] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); } else { - private "_action"; _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "MiscRepair"], _selection, 4] call EFUNC(interact_menu,createAction); // Put inside main actions if no other position was found above if (_selection isEqualTo [0, 0, 0]) then { @@ -166,8 +161,6 @@ _hitPointsAddedAmount = []; }; } forEach _hitPoints; -private ["_action", "_condition", "_statement"]; - _condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)}; _action = [QGVAR(fullRepair), localize LSTRING(fullRepair), "A3\ui_f\data\igui\cfg\actions\repair_ca.paa", _statement, _condition, {}, ["", "fullRepair"], "", 4] call EFUNC(interact_menu,createAction); diff --git a/addons/repair/functions/fnc_canMiscRepair.sqf b/addons/repair/functions/fnc_canMiscRepair.sqf index c60e59c840..40cace1bfc 100644 --- a/addons/repair/functions/fnc_canMiscRepair.sqf +++ b/addons/repair/functions/fnc_canMiscRepair.sqf @@ -47,8 +47,4 @@ _return = false; }; } forEach _hitpointGroup; -if (typeOf _target == "B_MRAP_01_F") then { - diag_log format ["%1 - %2", _hitPoint, _hitpointGroup]; -}; - _return diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 77687ae9cc..915210fdfe 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -735,7 +735,7 @@ Назначить инженером Přiřadit Inženýra - + List Lista Lista @@ -793,13 +793,6 @@ Defina veículo de reparo Назначить ремонтный транспорт - - List - Lista - Lista - Список - Seznam - List of vehicles that will be classified as repair vehicle, separated by commas. Lista nazw pojazdów, które są sklasyfikowane jako pojazdy naprawcze, oddzielone przecinkami. @@ -830,13 +823,6 @@ Definir instalação de reparo Назначить ремонтное сооружение - - List - Lista - Lista - Список - Seznam - List of objects that will be classified as repair Facility, separated by commas. Lista nazw budynków, które są sklasyfikowane jako budynki naprawcze, oddzielone przecinkami. @@ -871,11 +857,6 @@ Dodaj części zamienne do jednego lub wielu obiektów. Adicionar partes sobressalentes para um ou mais objetos - - List - Lista - Lista - List of objects that will get spare parts added, separated by commas. Lista obiektów, które otrzymają części zamienne, oddzielone przecinkiem. From ab02bed1c1a7d4f84861ff328d977ecc00e959ef Mon Sep 17 00:00:00 2001 From: gienkov Date: Fri, 11 Sep 2015 23:42:03 +0200 Subject: [PATCH 039/311] fixed duplicate stringtable entries --- addons/hearing/stringtable.xml | 2 -- addons/optionsmenu/stringtable.xml | 6 ------ 2 files changed, 8 deletions(-) diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index f8585d2191..a694f116c8 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -138,8 +138,6 @@ Aktiviere Taubheit im Gefecht? Povolit ztrátu sluchu? Ativar surdez em combate? - - Activer la surdité au combat? Harci süketség engedélyezése? Уменьшает способность игроков слышать при повреждении слуха diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index f066531927..6ed27e0645 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -356,12 +356,6 @@ Pošle debug informace do RPT a schránky. Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage. Envia informação de depuração para RPT e área de transferência. - - - Headbug Fix - - - Resets your animation state. Copie le Debug dans le RPT et le presse papier Debug információt küld az RPT-be és a vágólapra. Отправляет отладочную информацию в RPT и буфер обмена. From ef36b27fe258e73de655ffc093a204f89d75d64a Mon Sep 17 00:00:00 2001 From: gienkov Date: Fri, 11 Sep 2015 23:49:41 +0200 Subject: [PATCH 040/311] medical pl translation --- addons/medical/stringtable.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index ba34cffae2..521976113a 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -2215,6 +2215,7 @@ Heal fully bandaged hitpoints + Lecz w pełni zabandażowane hitpointy Pain is only temporarily suppressed @@ -3430,9 +3431,11 @@ Heal hitpoints + Lecz hitpointy Heal fully bandaged hitpoints + Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność. Pain suppression @@ -3832,4 +3835,4 @@ Na tej części ciała nie ma stazy! - + \ No newline at end of file From 11738a964d79327b0704ebb34b13f5fe50cb3245 Mon Sep 17 00:00:00 2001 From: alganthe Date: Sat, 12 Sep 2015 02:55:48 +0200 Subject: [PATCH 041/311] contributing.md added --- CONTRIBUTING.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..fc0c12974b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,68 @@ +# Reporting an issue + +## Before reporting + +If you have found an issue with ACE3 please make sure that ACE3 is really the cause of the problem. To do this try to reproduce the issue with using only `@CBA_A3` and `@ace` on a newly created mission. + +Indicate if the issue appears on stable or development version. In case it is the development version, please also include the commit SHA-1 hash. + +
+
Please note:
+

It's not a valid to simply remove @ace from the mod list to confirm that ACE3 is the culprit.

+

If the error happens when using a third-party mod contact the author of the appropriate mod and report the issue there.

+
+ +## Reporting the issue + +Head over to the ACE3 GitHub issue tracker and press the "New issue" button in the top right corner. Add a descriptive title and copy the following issue template in to the text area: + +``` +ACE3 Version: 3.x.x +(indicate if stable or dev, if dev indicate the commit the version is based on) + +**Mods:** +* `@CBA_A3` +* `@ace` + +**Placed ACE3 Modules:** +* *Add the list of modules you have placed on the map. Use 'None' if the error occurs without using any modules.* + +**Description:** +* Add a detailed description of the error. This makes it easier for us to fix the issue.* + +**Steps to reproduce:** +* *Add the steps needed to reproduce the issue.* + +**Where did the issue occur?** +* A possible answer might be "Multiplayer", "Editor" or "Singleplayer"* + +**RPT log file:** +* Add a link (pastebin.com) to the client or server RPT file.* +``` + +A video of the issue might be helpful in resolving it faster. + + +Github uses "Markdown" to style the output. If you want to know more about it (e.g. how to turn text bold, how to denote code blocks or inline code) have a look at the GitHub markdown documentation. + +# Feature Requests + +## Background +ACE2, AGM and CSE had a lot of features implemented or planned. All of them are or have been evaluated for inclusion in ACE3 itself, and we'd like to port the majority of them eventually. However, due to time constraints, we have managed to finish only a fraction of the job so far. + +Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite. + +
+
Note:
+

Due to our current work load, in the period of weeks prior and posterior to the first release, new feature requests are under embargo. Feel free to submit yours now, but don't expect them to be considered just yet. Any treatment or attention by developers towards the feature request thread is highly unlikely during this time.

+
+ +## Requesting a feature +In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for ACE 3 Feature requests. Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier. + +Following their approval, feature requests may be moved by moderators to a separate issue for further discussion. + +# Regarding Pull Requests (PRs) + +- [Make sure to respect the file structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html) +- [Make sure to respect the coding guidelines](http://ace3mod.com/wiki/development/coding-guidelines.html) From cc59ac625b7d50b4a74d661d510125cda0ebf6b6 Mon Sep 17 00:00:00 2001 From: alganthe Date: Sat, 12 Sep 2015 03:36:09 +0200 Subject: [PATCH 042/311] links updated for the guides and how to - Added the installation guide - Getting started (deprecated) replaced by the information center page --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c98983d880..73f7874a9c 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ The mod is **built modularly**, so almost any included PBO can be easily removed ### Guides & how-tos If you installed ACE3 but have trouble understanding how it all works, or where to start, read this first: -- [Getting started](http://ace3mod.com/wiki/user/getting-started.html) +- [Installation guide](http://ace3mod.com/wiki/user/installation-guide.html) +- [Information center](http://ace3mod.com/wiki/user/information-center.html) #### Contributing You can help out with the ongoing development by looking for potential bugs in our code base, or by contributing new features. To contribute something to ACE3, simply fork this repository and submit your pull requests for review by other collaborators. Remember to add yourself to the author array of any PBO you will be editing and the [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) file; including a valid email address. From 165ed90db67f62402cb7438352dbaf85a550c5ba Mon Sep 17 00:00:00 2001 From: alganthe Date: Sat, 12 Sep 2015 14:36:26 +0200 Subject: [PATCH 043/311] CONTRIBUTING.md updated --- CONTRIBUTING.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc0c12974b..0cdd596649 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,17 +52,12 @@ ACE2, AGM and CSE had a lot of features implemented or planned. All of them are Please refrain from making requests for any planned or existing features from either ACE2, AGM or CSE. Most of them are already being or have been considered for porting or a rewrite. -
-
Note:
-

Due to our current work load, in the period of weeks prior and posterior to the first release, new feature requests are under embargo. Feel free to submit yours now, but don't expect them to be considered just yet. Any treatment or attention by developers towards the feature request thread is highly unlikely during this time.

-
- ## Requesting a feature In order to avoid duplicates and keep the issue tracker organized, we have created a common issue for ACE 3 Feature requests. Any and all relevant requests should be submitted there, where they will also get discussed and evaluated. Before adding a new one, make sure to check the previous entries from the thread and do a quick search for similar suggestions; please don't reiterate requests for features that had already been accepted for inclusion, or those which were disregarded earlier. Following their approval, feature requests may be moved by moderators to a separate issue for further discussion. # Regarding Pull Requests (PRs) - +- You want to help but don't know where to start ? check the wiki entry for [setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) - [Make sure to respect the file structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html) - [Make sure to respect the coding guidelines](http://ace3mod.com/wiki/development/coding-guidelines.html) From c947cb09f1b4a79f3ea8d76a0cc531b4a1e18813 Mon Sep 17 00:00:00 2001 From: alganthe Date: Sat, 12 Sep 2015 16:06:28 +0200 Subject: [PATCH 044/311] Typo fixed in CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0cdd596649..ae1a5831fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,6 +58,6 @@ In order to avoid duplicates and keep the issue tracker organized, we have creat Following their approval, feature requests may be moved by moderators to a separate issue for further discussion. # Regarding Pull Requests (PRs) -- You want to help but don't know where to start ? check the wiki entry for [setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) +- You want to help but don't know where to start ? Check the wiki entry for [setting up the development environment](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) - [Make sure to respect the file structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html) - [Make sure to respect the coding guidelines](http://ace3mod.com/wiki/development/coding-guidelines.html) From 024f95968c1cc31abf9c0c083e63065dfa2f7de0 Mon Sep 17 00:00:00 2001 From: alganthe Date: Sat, 12 Sep 2015 19:13:56 +0200 Subject: [PATCH 045/311] line about debug to added --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae1a5831fe..6b7f1006fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,7 @@ ACE3 Version: 3.x.x **Placed ACE3 Modules:** * *Add the list of modules you have placed on the map. Use 'None' if the error occurs without using any modules.* +* You can also press the `Debug to` button in the ACE3 option menu (escape -> ACE3 options -> Debug to) and add a link (pastebin.com) to the results. **Description:** * Add a detailed description of the error. This makes it easier for us to fix the issue.* From db41512dc02058d64f335df8b803cd76b8d86e8e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 14 Sep 2015 22:11:12 -0500 Subject: [PATCH 046/311] #2349 - Don't disable locking for base RocketPods --- addons/laser_selfdesignate/CfgWeapons.hpp | 2 +- addons/missileguidance/CfgAmmo.hpp | 20 +++++++++++++------- addons/missileguidance/CfgWeapons.hpp | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/addons/laser_selfdesignate/CfgWeapons.hpp b/addons/laser_selfdesignate/CfgWeapons.hpp index a62974ce40..70e1afde88 100644 --- a/addons/laser_selfdesignate/CfgWeapons.hpp +++ b/addons/laser_selfdesignate/CfgWeapons.hpp @@ -2,7 +2,7 @@ class CfgWeapons { // Disable locking unless newb mode class LauncherCore; class RocketPods: LauncherCore { - canLock = 1; + // canLock = 1; }; class missiles_DAGR: RocketPods { diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 779d2a82eb..64146b8e7e 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -6,7 +6,7 @@ enum { class CfgAmmo { class MissileBase; - class M_PG_AT : MissileBase { + class M_PG_AT: MissileBase { model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F"; proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; @@ -68,15 +68,18 @@ class CfgAmmo { }; }; - class ACE_Hydra70_DAGR : M_PG_AT { + class ACE_Hydra70_DAGR: M_PG_AT { displayName = CSTRING(Hydra70_DAGR); displayNameShort = CSTRING(Hydra70_DAGR_Short); description = CSTRING(Hydra70_DAGR_Desc); descriptionShort = CSTRING(Hydra70_DAGR_Desc); + + //Explicity add guidance config + class ADDON: ADDON {}; }; - class ACE_Hellfire_AGM114K : ACE_Hydra70_DAGR { + class ACE_Hellfire_AGM114K: ACE_Hydra70_DAGR { displayName = CSTRING(Hellfire_AGM114K); displayNameShort = CSTRING(Hellfire_AGM114K_Short); @@ -91,10 +94,13 @@ class CfgAmmo { indirectHit = 71; indirectHitRange = 4.5; effectsMissile = "missile2"; + + //Explicity add guidance config + class ADDON: ADDON {}; }; // Titan - class M_Titan_AT : MissileBase {}; + class M_Titan_AT: MissileBase {}; class ACE_Javelin_FGM148: M_Titan_AT { irLock = 0; @@ -145,8 +151,8 @@ class CfgAmmo { //Take config changes from (M_Titan_AT_static: M_Titan_AT) initTime = 0.25; //"How long (in seconds) the projectile waits before starting it's engine.", - but doesn't seem to do anything effectsMissileInit = "RocketBackEffectsStaticRPG"; - class ADDON: ADDON { - enabled = 1; - }; + + //Explicity add guidance config + class ADDON: ADDON {}; }; }; diff --git a/addons/missileguidance/CfgWeapons.hpp b/addons/missileguidance/CfgWeapons.hpp index ab36d4dd52..a922c6b82e 100644 --- a/addons/missileguidance/CfgWeapons.hpp +++ b/addons/missileguidance/CfgWeapons.hpp @@ -4,7 +4,7 @@ class CfgWeapons { class LauncherCore; class RocketPods: LauncherCore { - canLock = 1; + // canLock = 1; }; class missiles_DAGR : RocketPods { canLock = 1; From b94df35c08bab64d0f6c9395d57e1f9752b0f844 Mon Sep 17 00:00:00 2001 From: gienkov Date: Wed, 16 Sep 2015 11:42:45 +0200 Subject: [PATCH 047/311] Revert "fixed duplicate stringtable entries" This reverts commit ab02bed1c1a7d4f84861ff328d977ecc00e959ef. --- addons/hearing/stringtable.xml | 2 ++ addons/optionsmenu/stringtable.xml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index a694f116c8..f8585d2191 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -138,6 +138,8 @@ Aktiviere Taubheit im Gefecht? Povolit ztrátu sluchu? Ativar surdez em combate? +
+ Activer la surdité au combat? Harci süketség engedélyezése? Уменьшает способность игроков слышать при повреждении слуха diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 6ed27e0645..f066531927 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -356,6 +356,12 @@ Pošle debug informace do RPT a schránky. Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage. Envia informação de depuração para RPT e área de transferência. + + + Headbug Fix + + + Resets your animation state. Copie le Debug dans le RPT et le presse papier Debug információt küld az RPT-be és a vágólapra. Отправляет отладочную информацию в RPT и буфер обмена. From e2f9b31fb278d6dfe02f1591bef772fad12e345c Mon Sep 17 00:00:00 2001 From: gienkov Date: Wed, 16 Sep 2015 11:53:05 +0200 Subject: [PATCH 048/311] small fix + repair translation --- addons/interaction/stringtable.xml | 4 ++-- addons/repair/stringtable.xml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 7d2b91f6c8..8b026cb307 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -486,7 +486,7 @@ Gruppenverwaltung Gestión de equipo Gestion d'équipe - Zarządzanie oddziałem + Drużyna Správa týmu Управление группой Gerenciamento de Equipe @@ -824,4 +824,4 @@ Управление группами позволяет назначать цвета членам групп, брать командование, вступать в группы или покидать их. - + \ No newline at end of file diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 8de9b07d90..d00f331353 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -903,9 +903,11 @@
Wheel repair requirements + Wym. naprawy kół Items required to remove/replace wheels + Przedmioty potrzebne do wymiany kół - + \ No newline at end of file From 463e21dd918d1c921e3d11a76c702289b2fcc8ef Mon Sep 17 00:00:00 2001 From: Ivan Navarro Cabello Date: Wed, 16 Sep 2015 12:40:30 +0200 Subject: [PATCH 049/311] 330 --- addons/advanced_ballistics/stringtable.xml | 5 +- addons/captives/stringtable.xml | 8 +- addons/cargo/stringtable.xml | 11 ++- addons/common/stringtable.xml | 11 ++- addons/dagr/stringtable.xml | 6 +- addons/explosives/stringtable.xml | 5 +- addons/finger/stringtable.xml | 12 ++- addons/flashlights/stringtable.xml | 8 +- addons/hearing/stringtable.xml | 9 +- addons/interact_menu/stringtable.xml | 5 +- addons/main/stringtable.xml | 3 +- addons/map/stringtable.xml | 15 +++- addons/medical/stringtable.xml | 12 ++- addons/medical_menu/stringtable.xml | 13 ++- addons/optionsmenu/stringtable.xml | 11 +-- addons/parachute/stringtable.xml | 6 +- addons/repair/stringtable.xml | 96 ++++++++++++++++++++-- addons/slideshow/stringtable.xml | 17 +++- addons/spectator/stringtable.xml | 68 ++++++++++++++- addons/zeus/stringtable.xml | 11 ++- 20 files changed, 292 insertions(+), 40 deletions(-) diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 502e86ebe8..7d8e918b53 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -286,6 +286,7 @@ Ce module active la simulation de balistique avancée - ie les projectiles sont influencé par des varibles comme le vent, la température, la pression atmosphérique, l'humidité, la gravité, le type de munition et l'arme avec laquelles ils sont tirés Ez a modul engedélyezi a fejlett ballisztikai szimulációt - a lövedékek röppályáját befolyásolni fogja a levegő hőmérséklete, légnyomás, páratartalom, gravitáció, a lövedék fajtája, valamint a fegyver, amiből kilőtték a lövedéket. Этот модуль включает симуляцию продвинутой баллистики - при этом на траекторию полета снаряда влияют различные параметры, такие как температура воздуха, атмосферное давление, влажность, гравитация, тип боеприпаса и оружия, из которого произвели выстрел. + Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada. - + \ No newline at end of file diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index fd7adedd74..d0a84909ec 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -250,24 +250,28 @@ Wymagaj kapitulacji Requer rendição Требовать пленения + Requiere rendición Require Players to surrender before they can be arrested Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować Requer que jogadores se rendam antes de poderem ser presos Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать + Requiere que los Jugadores se rindan antes de arrestarlos Surrendering only Tylko kapitulacja Somente rendição Только сдавшийся в плен + Solo rendición Surrendering or No weapon Kapitulacja lub brak broni Rendição ou desarmado Сдавшийся или безоружный + Rendición o desarme - + \ No newline at end of file diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 4b1ef90606..8271b80b99 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -7,6 +7,7 @@ Carregar Загрузить Naložit + Cargar
Unload @@ -14,6 +15,7 @@ Descarregar Выгрузить Vyložit + Descargar Cargo @@ -21,6 +23,7 @@ Carga Грузовой отсек Náklad + Carga Cargo Menu @@ -28,6 +31,7 @@ Menu de carga Грузовой отсек Menu nákladu + Menu de carga Cargo space left: %1 @@ -35,6 +39,7 @@ Espaço de carga restante: %1 Осталось мест: %1 Volný prostor: %1 + Espacio de carga restante: %1 Enable Cargo @@ -42,12 +47,14 @@ Ativar carga Включить модуль перевозки грузов Povolit náklad + Habilitar carga Enable the load in cargo module Aktywuj możliwość załadunku skrzyń i przedmiotów do pojazdów. Ativar o módulo de carregamento de carga Включает модуль погрузки и перевозки грузов + Habilitar la carga en el módulo de carga Cargo Settings @@ -55,12 +62,14 @@ Preferências de carregamento Перевозка грузов Nastavení nákladu + Ajustes de carga Configure the cargo module settings Skonfiguruj ustawienia modułu cargo. Configura as preferências do módulo de carga Конфигурирует настройки модуля перевозки грузов + Configure los ajustes del módulo de carga - + \ No newline at end of file diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index e7f5933864..7e226a231e 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -696,6 +696,7 @@ Somente veículos Только в транспорте Pouze vozidla + Solo vehículos Do Not Force @@ -712,12 +713,14 @@ Equipamentos ACE3 ACE3 Снаряжение ACE3 Vybavení + ACE3 Equipo ACE3 Common ACE3 Ogólne Comum ACE3 ACE3 Общие + ACE3 Común ACE3 Weapons @@ -725,12 +728,14 @@ Armamento ACE3 ACE3 Оружие ACE3 Zbraně + ACE3 Armas ACE3 Movement ACE3 Ruch Movimento ACE3 ACE3 Перемещение + ACE3 Movimiento ACE3 Scope Adjustment @@ -738,6 +743,7 @@ Ajuste de luneta ACE3 ACE3 Прицелы ACE3 Nastavení optiky + ACE3 Ajuste de miras ACE3 Vehicles @@ -745,6 +751,7 @@ Veículos ACE3 ACE3 Транспорт ACE3 Vozidla + ACE3 Vehículos - + \ No newline at end of file diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index 77502f271b..1da63910de 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -1,21 +1,25 @@  - + DAGR DAGR + DAGR Configure DAGR Konfiguruj DAGR + Configurar DAGR Toggle DAGR Przełącz DAGR + Mostrar DAGR Defense Advanced GPS Receiver Defense Advanced GPS Receiver + Defense Advanced GPS Receiver \ No newline at end of file diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 094e1bf34f..025f250434 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -609,6 +609,7 @@ Ce module ajuste les options relative aux explosifs Ez a modul a robbanóanyagokhoz kötött beállításokat szabályozza. Этот модуль управляет настройками, связанными со взрывными устройствами + Este módulo ajusta las configuraciones relacionadas con explosivos. - + \ No newline at end of file diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index 5beed84fd9..70de7853a2 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -8,6 +8,7 @@ Pokaż indykator wskazywania palcem dla siebie Saját mutatási indikátor megjelenítése Mostrar indicador para si mesmo + Mostrar el indicador de señalado a uno mismo Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator @@ -16,6 +17,7 @@ Wyświetl indykator kiedy wskazujesz coś palcem. Ta opcja nie wpływa na to, czy inni gracze zobaczą ten indykator czy też nie. Az indikátor megjelenítése a mutató játékosnak. Ez a beállítás nem változtat azon, hogy más játékosok látják-e az indikátort. Renderizar o indicador para o jogador que está apontando. Esta opção não afeta se os outros jogadores verão ou não o indicador + Muestra el indicador para el jugador que apunta. Esta opción no afecta si los otros jugadores verían el indicador Pointing indicator @@ -24,6 +26,7 @@ Indykator palca Ujj-indikátor Indicador de apontamento + Indicador de señalado Color of the pointing indicator circle @@ -32,6 +35,7 @@ Kolor okręgu wyświetlanego przy wskazywaniu palcem Mutatási indikátor körének színe Cor do círculo de indicação + Color del círculo indicador que señala Action "point a finger at" @@ -40,6 +44,7 @@ Akcja "wskaż palcem" Cselekvés "ujj rámutatása" Ação "Apontar um dedo para" + Acción "apuntar con el dedo a" Points, and shows a virtual marker of where you are looking to nearby units. Can be held down. @@ -48,6 +53,7 @@ Mutat, és elhelyez egy virtuális jelölőt a nézett területhez közeli egységekhez. Lenyomva tartható. Aponta e mostra um marcador virtual para onde você está olhando para unidades próximas. Pode ser utilizado para baixo. Показывает пальцем и рисует виртуальный маркер в направлении взгляда ближайшим игрокам. Можно удерживать. + Señala y muestra un marcador virtual donde ustás apuntando para las unidades cercanas. Puede ser mantenido. Pointing Settings @@ -56,6 +62,7 @@ Ujj beállításai Preferências de apontamento Настройки указания пальцем + Ajustes de señalado Pointing Enabled @@ -64,6 +71,7 @@ Mutatás engedélyezése Apontamento ativado Указание пальцем включено + Señalado habilitado Pointing Max Range @@ -72,6 +80,7 @@ Ujj maximum hatótávja Distância máxima do apontamento Макс. дальность + Distancia máxima de señalado Max range between players to show the pointing indicator [default: 4 meters] @@ -80,6 +89,7 @@ A maximális távolság, amelyben a közeli játékosoknak megjelenik az indikátor. [alapértelmezett: 4 méter] Distância máxima entre jogadores para mostrar o apontamento [padrão: 4 metros] Максимальная дальность между игроками для отображения индикатора указания пальцем [по-умолчанию: 4 метра] + Distancia máxima entre los jugadores para mostrar el indicador que señala [por defecto: 4 metros] - + \ No newline at end of file diff --git a/addons/flashlights/stringtable.xml b/addons/flashlights/stringtable.xml index 1fc2ca76b0..a9ec458b2d 100644 --- a/addons/flashlights/stringtable.xml +++ b/addons/flashlights/stringtable.xml @@ -7,6 +7,7 @@ Fulton MX-991 Fulton MX-991 Fulton MX-991 + Fulton MX-991 Flashlight with red filter. For use on map. @@ -14,6 +15,7 @@ Lanterna com filtro vermelho. Para uso no mapa. Фонарь с красным светофильтром. Для использования на карте. Svítilna s červeným filtrem. Pro nahlédnutí do mapy. + Linterna con filtro rojo. Para su uso en el mapa. Maglite XL50 @@ -21,6 +23,7 @@ Maglite XL50 Maglite XL50 Maglite XL50 + Maglite XL50 White mini flashlight. For use on map. @@ -28,6 +31,7 @@ Mini lanterna branca. Para uso no mapa. Небольшой фонарик белого света. Для использования на карте. Bílá mini svítilna. Pro nahlédnutí do mapy. + Mini linterna blanca. Para su uso en el mapa. KSF-1 @@ -35,6 +39,7 @@ KSF-1 KSF-1 KSF-1 + KSF-1 Flashlight with red filter. For use on map. @@ -42,6 +47,7 @@ Lanterna com filtro vermelho. Para uso no mapa. Фонарь с красным светофильтром. Для использования на карте. Svítilna s červeným filtrem. Pro nahlédnutí do mapy. + Linterna con filtro rojo. Para su uso en el mapa. - + \ No newline at end of file diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index e1cb820665..f73ceba74e 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -140,7 +140,7 @@ Ativar surdez em combate? - Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection + Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection Harci süketség engedélyezése? Уменьшает способность игроков слышать при повреждении слуха Głuchota bojowa pojawia się w momentach, kiedy stoimy w pobliżu broni wielkokalibrowej bez ochrony słuchu, lub np. podczas ostrzału artyleryjskiego. Moduł ten pozwala na włączenie lub wyłączenie tego efektu. @@ -148,18 +148,21 @@ Ztráta sluchu je možná ve chvíly, kdy se v bezprostřední blízkosti střílí z velkorážní zbraně nebo při bombardování a osoba je bez ochrany sluchu (např. špunty). Tento modul umožňuje tuto věc povolit nebo zakázat. Este módulo ativa / desativa surdez em combate. Quando ativado, os jogadores podem ficar surdos quando uma arma é disparada ao seu redor ou uma explosão ocorre sem proteção auditiva. Ce module active / désactivé la surdité au combat. Si active, des joueurs peuvent devenir sourds sans protection d'oreille, si une arme est utilisée ou une explosion a lieu à proximité + Controles de sordera de combate y zumbido en los oídos. Al activarlo, los jugadores pueden ser ensordecidos cuando un arma se dispara cerca o una explosión tiene lugar sin protección auditiva Effect Zeus RC Wpływ na Zeus RC Влияет на юнита Зевса Afeta Zeus CR + Efecto Zeus RC Allow zeus remote controlled units to be able to take hearing damage. Aktywuj efekty utraty słuchu dla jednostek kontrolowanych zdalnie przez Zeusa. Контролирует оглушение в бою и звон в ушах. При активации играки могут быть оглушены близкими выстрелами и взрывами при отсутствии защиты для ушей. Permite que unidades remotamente controladas pelo Zeus sejam atingidas por danos auditivos. + Permitir a las unidades por control remoto de zeus que puedan tener daños auditivos. - + \ No newline at end of file diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index d4f7f32e4c..c748acbb35 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -297,6 +297,7 @@ Menu de interação Меню взаимодействия Menu interakce + Menú de interacción - + \ No newline at end of file diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index 94ee52b5af..bd3c27aa63 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -7,6 +7,7 @@ Logísticas ACE ACE: логистика ACE Logistika + ACE Logística - + \ No newline at end of file diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 4fb8c93a3a..8f693ef37a 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -29,18 +29,21 @@ Calcul la luminosité de la carte en fonction des conditions de lumière Симулировать освещение карты на основе окружающего света и приборов игрока? Simular a luz do mapa baseado em luz ambiente e itens do jogador? + Simular iluminación de mapa basada en la iluminación ambiente y los elementos de los jugadores? Map flashlight glow? Poświata latarki Свет фонаря на карте? Brilho de lanterna no mapa? + Resplandor de linterna en el mapa? Add external glow to players who use flashlight on map? Pokaż poświatę światła latarki na graczu, który używa latarki na widoku mapy? Добавить свет при использовании фонаря на карте? Adicionar brilho externo para jogadores que usam lanterna no mapa? + Añadir resplandor externo a los jugadores que utilizan la linterna en el mapa? Map shake? @@ -117,6 +120,7 @@ Ce module permet de personnaliser l'écran de la carte Ez a modul lehetővé teszi a térképnézet testreszabását. Этот модуль позволяет настроить отображение карты. + Este módulo permite personalizar la pantalla del mapa. Blue Force Tracking @@ -202,6 +206,7 @@ Ce module permet de suivre les unités alliées avec des marqueurs sur la carte. Ez a modul lehetővé teszi a szövetséges egységek követését BFT térképjelzőjkkel. Этот модуль позволяет отслеживать перемещение союзных войск по карте при помощи маркеров BFT. + Este módulo permite el seguimiento de las unidades aliadas con marcadores de mapa BFT. Flashlights @@ -209,6 +214,7 @@ Lanternas Фонари Svítilny + Linternas NVG @@ -216,6 +222,7 @@ Óculos de Visão Noturna ПНВ NVG + NVG On @@ -223,6 +230,7 @@ Ligado Вкл. Zapnout + Encendido Off @@ -230,6 +238,7 @@ Desligado Выкл. Vypnout + Apagado Increase Brightness @@ -237,6 +246,7 @@ Aumentar brilho Увеличить яркость Zvýšit jas + Aumentar brillo Decrease Brightness @@ -244,6 +254,7 @@ Diminuir brilho Уменьшить яркость Snížit jas + Reducir brillo - + \ No newline at end of file diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index ba34cffae2..bfbeb35733 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -2104,6 +2104,7 @@ %1 performed CPR %1 wykonał cykl RKO %1 провел сердечно-легочную реанимацию + %1 realicó RCP Heavily wounded @@ -2215,6 +2216,7 @@ Heal fully bandaged hitpoints + Curar puntos de vida totalmente vendados Pain is only temporarily suppressed @@ -3430,9 +3432,11 @@ Heal hitpoints + Curar puntos de vida Heal fully bandaged hitpoints + Curar puntos de vida totalmente vendados Pain suppression @@ -3608,6 +3612,7 @@ Ce module permet d'assigner la classe médicale à une unité sélectionnée Ez a modul engedélyezi az orvosi jelző hozzárendelését kiválasztott egységekhez. Этот модуль позволяет назначить класс медика выбранным юнитам. + Este módulo permite asignar la clase médico a las unidades seleccionadas. None @@ -3822,14 +3827,17 @@ %1 odszedł zbyt daleko, nie można kontynuować leczenia Расстояние до %1 стало слишком большим для лечения A distância de %1 está muito longe para tratamento + La distancia hasta 1% se ha agrandado demasiado para el tratamiento This person (%1) is awake and cannot be loaded Ta osoba (%1) jest przytomna i nie może zostać załadowana + Esta persona (%1) está despierto y no puede ser cargado There is no tourniquet on this body part! Na tej części ciała nie ma stazy! + No hay torniquete en esta parte del cuerpo! - + \ No newline at end of file diff --git a/addons/medical_menu/stringtable.xml b/addons/medical_menu/stringtable.xml index 37b9c1f600..0a176dd6fe 100644 --- a/addons/medical_menu/stringtable.xml +++ b/addons/medical_menu/stringtable.xml @@ -6,60 +6,70 @@ Menu medyczne Menu médico Медицинское меню + Menú médico Allow Medical Menu Akt. menu medyczne Permitir menu médico Разрешить мед. меню + Permitir menú médico Allow clients to use the medical menu Zezwalaj graczom korzystać z menu medycznego Permite que clientes utilizem o menu médico Разрешает клиентам использовать медицинское меню + Permitir a los clientes utilizar el menú médico Use Medical menu Użyj menu medycznego Usar o menu médico Использовать медицинское меню + Utiliza el menú médico If allowed by server, enable the option to use the Medical Menu through keybinding and interaction menu Jeżeli zezwolone przez serwer, aktywuj menu medyczne poprzez skrót klawiszowy i menu interakcji. Se permitido pelo servidor, ativa a opção de usar o menu médico por atalhos de teclas e menu de interação Если разрешено сервером, включает опцию использования медицинского меню с помощью горячих главиш или меню взаимодействия + Si está permitido por el servidor, active la opción de utilizar el menú médico a través del menú de las teclas Re-open Medical menu Otwieraj ponownie menu medyczne Reabrir menu médico Переоткрывать мед. меню + Reabrir menú médico Re-open the medical menu after succesful treatment Otwórz ponownie menu medyczne po udanym zakończeniu leczenia Reabre o menu médico depois de um tratamento bem sucedido Переоткрывать медицинское меню после удачного лечения + Reabre el menú médico despues de un tratamiento con éxito Open Medical Menu Otwórz menu medyczne Abrir menu médico Открыть медицинское меню + Abrir menú médico Medical Menu Settings Ustawienia menu medycznego Preferências do menu médico Настройки медицинского меню + Ajustes del mení médico Configure the usage of the Medical Menu Skonfiguruj opcje menu medycznego Configura o uso do menu médico Настройки использования медицинского меню + Configurar el uso del menú médico EXAMINE & TREATMENT @@ -249,6 +259,7 @@ Tors Torso Trup + Pecho Left Arm @@ -445,4 +456,4 @@ Tubo nasofaríngeo [NPA] - + \ No newline at end of file diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 6ed27e0645..7c4df339b1 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -356,9 +356,6 @@ Pošle debug informace do RPT a schránky. Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage. Envia informação de depuração para RPT e área de transferência. - Copie le Debug dans le RPT et le presse papier - Debug információt küld az RPT-be és a vágólapra. - Отправляет отладочную информацию в RPT и буфер обмена. Headbug Fix @@ -368,6 +365,7 @@ Corrigir Headbug Fix Headbug Fix Headbug + Corregir error de cabeza (headbug) Resets your animation state. @@ -377,6 +375,7 @@ Redefine seu estado de animação. Исправляет баг с зациклившейся анимацией. Resetovat aktuální animaci. + Restablece tu estado de animación. ACE News @@ -405,6 +404,7 @@ Todas categorias Все категории Všechny Kategorie + Todas las categorías Logistics @@ -412,6 +412,7 @@ Logística Логистика Logistika + Logística - + \ No newline at end of file diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index ef77bd8ecd..469230c3c8 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -58,6 +58,7 @@ Cortar para-quedas Обрезать стропы Odžíznout Padák + Cortar paracaídas Reserve Parachute @@ -68,6 +69,7 @@ Para-quedas de reserva Запасной парашют Záložní Padák + Paracaídas de reserva - + \ No newline at end of file diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 8de9b07d90..5200b4b509 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -4,7 +4,7 @@ Spare Track Ersatzkette - Cadena de repuesto + Oruga de repuesto Chenille de réserve Zapasowa gąsienica Esteira reserva @@ -43,6 +43,7 @@ Trocando roda... Замена колеса ... Měním Kolo ... + Cambiando rueda ... Wheel replaced @@ -51,6 +52,7 @@ Roda trocada Колесо заменено Kolo vyměněno + Rueda cambiada Remove Wheel @@ -71,6 +73,7 @@ Removendo roda... Снятие колеса ... Odstraňuji Kolo ... + Quitando rueda ... Wheel removed @@ -79,6 +82,7 @@ Roda removida Колесо снято Kolo odstraněno + Rueda quitada Change Track @@ -86,6 +90,7 @@ Trocar esteira Заменить гусеницу Vyměnit Pás + Cambiar oruga Replacing Track ... @@ -93,6 +98,7 @@ Trocando esteira... Замена гусеницы ... Měním Pás ... + Cambiando oruga ... Track replaced @@ -100,6 +106,7 @@ Esteira trocada Гусеница заменена Pás vyměněn + Oruga cambiada Remove Track @@ -107,6 +114,7 @@ Remover esteira Снять гусеницу Odstranit Pás + Quitar oruga Removing Track ... @@ -114,6 +122,7 @@ Removendo esteira... Снятие гусеницы ... Odstraňuji Pás ... + Quitando oruga ... Track removed @@ -121,6 +130,7 @@ Esteira trocada Гусеница снята Pás odstraněn + Oruga quitada Full Repair @@ -128,6 +138,7 @@ Reparo completo Полный ремонт Kompletní Oprava + Reparación completa Repairing Vehicle ... @@ -135,6 +146,7 @@ Reparando veículo... Ремонт транспорта ... Opravuji Vozidlo ... + Reparando vehículo ... Full Repair Locations @@ -142,12 +154,14 @@ Localizações de reparo completo Места полного ремонта Lokace pro Kompletní Opravu + Lugares de reparación completa At what locations can a vehicle be fully repaired? W jakich miejscach pojazd może zostać w pełni naprawiony? Em quais locais um veículo pode ser reparado por completo? В каких местах транспорт может быть полностью отремеонтирован? + ¿En qué lugares puede un vehículo ser reparado totalmente? Allow Full Repair @@ -155,22 +169,26 @@ Permitir reparo completo Полный ремонт выполняют Povolit Kompletní Opravu + Permitir reparación completa Who can perform a full repair on a vehicle? Kto może przeprowadzić pełną naprawę pojazdu? Кто может выполнять полный ремонт? Quem pode reparar o veículo por completo? + ¿Quién puede realizar una reparación completa de un vehículo? Add Spare Parts Dodaj części zam. Adicionar partes sobressalentes + Añadir repuestos Add spare parts to vehicles (requires Cargo component)? Czy dodać do pojazdów części zamienne? Wymaga włączonego cargo. Adicionar partes sobressalentes aos veículos (requer o componente de carga)? + ¿Añadir repuestos para vehículos (requiere componente de carga)? Repair >> @@ -190,12 +208,14 @@ Mostrar texto quando reparar Отображать текст при ремонте Zobrazit text při opravě + Mostrar texto en la reparación Display a notification whenever you repair a vehicle Pokaż informację, kiedy wykonujesz czynności związane z naprawą pojazdu. Mostra uma notificação quando você repara um veículo Отображать оповещение каждый раз, когда вы ремонтируете транспорт + Mostrar una notificación cada vez que se reparare un vehículo Repairing ... @@ -240,6 +260,7 @@ Parte totalmente reparada Полностью отремонтированная часть Kompletně opravená část + Parte totalmente reparado Partially repaired %1 @@ -247,6 +268,7 @@ Częściowo naprawiono: %1 %1 parcialmente reparado Частично отремонтировано: %1 + Parcialmente reparada %1 Fully repaired %1 @@ -255,6 +277,7 @@ %1 totalmente reparado Полностью отремонтировано: %1 Kompletně opraveno %1 + Totalmente reparada %1 Partially repaired %1 @@ -262,6 +285,7 @@ Częściowo naprawiono: %1 %1 parcialmente reparado Частично отремонтировано: %1 + Parcialmente reparada %1 Body @@ -304,12 +328,14 @@ Lewy statecznik poziomy Левый горизонтальный стабилизатор Estabilizador Horizontal Esquerdo + Estabilizador horizontal izquierdo Right Horizontal Stabilizer Prawy statecznik poziomy Правый горизонтальный стабилизатор Estabilizador Horizontal Direito + Estabilizador horizontal derecho Vertical Stabilizer @@ -317,6 +343,7 @@ Statecznik pionowy Вертикальный стабилизатор Estabilizador Vertical + Estabilizador vertical Fuel Tank @@ -336,12 +363,14 @@ Skrzynia biegów Трансмиссия Transmissão + Transmisión Gear Podwozie Коробка передач Engrenagem + Rueda Starter @@ -349,12 +378,14 @@ Startér Стартер Arranque + Motor de arranque Tail Ogon Ocas Хвост + Tail Pitot Tube @@ -362,12 +393,14 @@ Pilotova Trubice Кокпит Tubo de Pitot + Tubo del pitot Static Port Port statyczny Статический иллюминатор Porta Estática + Puerto estático Ammo @@ -375,6 +408,7 @@ Amunicja Боеприпасы Munição + Munición Turret @@ -406,11 +440,12 @@ Ракеты Rakety Rakiety + Misiles Left Track Linke Kette - Cadena izquierda + Oruga izquierda Chenille gauche Lewa gąsienica Levý Pás @@ -422,7 +457,7 @@ Right Track Rechte Kette - Cadena derecha + Oruga derecha Chenille droite Prawa gąsienica Pravý Pás @@ -569,6 +604,7 @@ Wyciągarka Guincho Лебедка + Cabrestante Glass (right) @@ -611,12 +647,14 @@ Ustawienia naprawy Preferências de reparo Ремонт + Ajustes de reparación Provides a repair system for all types of vehicles. Dostarcza rozbudowany system naprawy dla wszystkich typów pojazdów. Provém um sistema de reparo para todos os veículos Предоставляет систему ремонта для всех типов транспортных средств. + Proporciona un sistema de reparación para todo tipo de vehículos. Anyone @@ -624,6 +662,7 @@ Qualquer um Кто угодно Kdokoliv + Cualquiera Engineer only @@ -631,6 +670,7 @@ Somente engenheiro Только инженеры Pouze inženýr + Solo ingeniero Repair Specialist only @@ -638,6 +678,7 @@ Somente especialista em reparos Только ремонтные специалисты Pouze specialista na opravování + Solo especialista en reparación Allow Wheel @@ -645,6 +686,7 @@ Permite rodas Разрешить замену колес Možnost Výměny Kol + Permitir rueda Who can remove and replace wheels? @@ -652,6 +694,7 @@ Quem pode remover e trocar rodas? Кто может снимать и заменять колеса? Kdo může odstranit a vyměnit kola? + ¿Quién puede quitar y cambiar las ruedas? Allow Repair @@ -659,6 +702,7 @@ Permite reparo Разрешить ремонт Možnost Opravování + Permitir reparación Who can perform repair actions? @@ -666,42 +710,49 @@ Quem pode executar ações de reparo? Кто может выполнять ремонт? Kdo může provádět opravy? + ¿Quién puede realizar reparaciones? Repair Threshold Próg naprawy Limite de reparo Лимит ремкомплекта + Umbral de reparación What is the maximum damage that can be repaired with a toolkit? Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przy pomocy narzędzi? Qual é o dano máximo que pode ser reparado com um kit de ferramentas? Какой максимальный урон можно починить с помощью ремкомплекта? + ¿Cuál es el daño máximo que puede ser reparado con una caja de herramientas? Repair Threshold (Engineer) Próg naprawy (mechanik) Limite de reparo (Engenheiro) Лимит инженера + Umbral de Reparación (Ingeniero) What is the maximum damage that can be repaired by an engineer? Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przez mechanika? Qual é o dano máximo que pode ser reparado com um engenheiro? Какой максимальный урон может починить инженер? + ¿Cuál es el daño máximo que puede ser reparado por un ingeniero? Remove toolkit on use Usuń narzędzia po użyciu Remover kit de ferramentas Удалять ремкомплект после использования + Eliminar conjunto de herramientas al usarlo Should the toolkit be removed on usage? Czy zestaw naprawczy powinien zostać usunięty po jego użyciu? O kit de ferramentas deve ser removido após uso? Следует ли удалять ремкомплект после использования? + ¿Deben retirarse las herramientas al usarlas? Anywhere @@ -709,24 +760,28 @@ Qualquer lugar Где угодно Kdekoliv + En cualquier sitio Repair Vehicle only Przy pojazdach naprawczych Somente veículos de reparo Только у ремонтного транспорта + Reparar solo en vehículo Repair Facility only Przy budynkach naprawczych Somente instalação de reparo Только у ремонтных сооружений + Reparar solo en instalación Repair Facility or Vehicle Przy budynkach i pojazdach naprawczych Instalação e veículo de reparo Только у ремонтного транспорта или ремонтных сооружений + Reparar en instalación o vehículo Assign Engineer @@ -734,6 +789,7 @@ Definir engenheiro Назначить инженером Přiřadit Inženýra + Asignar ingeniero List @@ -741,24 +797,28 @@ Lista Список Seznam + Lista List of unit names that will be classified as engineer, separated by commas. Lista nazw jednostek, które są sklasyfikowane jako inżynierowie, oddzielone przecinkami. Lista de nomes de unidades que serão classificadas como engenheiros, separadas por vírgulas. Список имен юнитов, которые будут классифицированы как инженеры, разделенный запятыми. + Lista de los nombres de las unidades que serán clasificados como ingeniero, separados por comas. Is Engineer Poziom wyszkolenia É engenheiro Это инженер + Es un ingeniero Select the engineering skill level of the unit Wybierz biegłość w dziedzinie naprawy danej jednostki Selecione o nível de habilidade da unidade em engenhraria Укажите уровень инженерного мастерства для юнита + Selecciona el nivel de conocimientos de ingeniería de la unidad None @@ -766,6 +826,7 @@ Nenhum Нет Nikdo + Ningún Engineer @@ -773,6 +834,7 @@ Engenheiro Инженер Inženýr + Ingeniero Specialist @@ -780,18 +842,21 @@ Especialista Специалист Specialista + Especialista Assign one or multiple units as an engineer Przydziel klasę inżyniera do jednej lub kilku jednostek Defina um ou mais unidades como engenheiro Назначить одного или нескольких юнитов инженерами + Asignar una o varias unidades como ingeniero Assign Repair Vehicle Przydziel pojazd naprawczy Defina veículo de reparo Назначить ремонтный транспорт + Asignar vehículo de reparación List @@ -799,36 +864,42 @@ Lista Список Seznam + Lista List of vehicles that will be classified as repair vehicle, separated by commas. Lista nazw pojazdów, które są sklasyfikowane jako pojazdy naprawcze, oddzielone przecinkami. Lista de veículos que serão classificadas como veículo de reparo. Separado por vígulas. Список транспортных средств, которые будут классифицированы как ремонтные, разделенный запятыми. + Lista de los vehículos que se clasifican como vehículo de reparación, separados por comas. Is Repair Vehicle Jest poj. naprawczym É veículo de reparo Это ремонтный транспорт + Es un vehículo de reparación Is the vehicle classified as a repair vehicle? Czy pojazd jest zklasyfikowany jako pojazd naprawczy? O veículo é classificado como reparo? Классифицируется ли этот транспорт как ремонтный? + ¿Está el vehículo clasificado como un vehículo de reparación? Assign one or multiple vehicles as a repair vehicle Przydziel klasę pojazdu naprawczego do jednego lub kilku pojazdów. Definir um ou mais veículos como reparo Назначить одно или несколько транспортных средств ремонтными + Asignar uno o varios vehículos como vehículo de reparación Assign Repair Facility Przydziel budynek naprawczy Definir instalação de reparo Назначить ремонтное сооружение + Asignar instalación de reparación List @@ -836,76 +907,91 @@ Lista Список Seznam + Lista List of objects that will be classified as repair Facility, separated by commas. Lista nazw budynków, które są sklasyfikowane jako budynki naprawcze, oddzielone przecinkami. Lista de objetos que serão classificados como instalações de reparo. separado por vírgulas. Список объектов, которые будут классифицированы как ремонтные, разделенный запятыми. + Lista de los objetos que se clasifican como instalaciones para la reparación, separados por comas. Is Repair Facility Jest bud. naprawczym É uma instalação de reparo Это ремонтное сооружение + Es una instalación de reparación Is the object classified as a repair Facility? Czy budynek jest zklasyfikowany jako budynek naprawczy? O objeto é classificado como instalação de reparo? Классифицируется ли этот объект как ремонтное сооружение? + ¿Está el objeto clasificado como una instalación de reparación? Assign one or multiple objects as a repair Facility Przydziel klasę budynku naprawczego do jednego lub kilku budynków. Назначить один или несколько объектов ремонтными сооружениями Definir um ou mais objetos como instalação de reparos + Asignar uno o varios objetos como una instalación de reparación Add Spare Parts Dodaj części zam. Adicionar partes sobressalentes + Añadir repuestos Add spare parts to one or multiple objects Dodaj części zamienne do jednego lub wielu obiektów. Adicionar partes sobressalentes para um ou mais objetos + Añadir repuestos a uno o varios objetos List Lista Lista + Lista List of objects that will get spare parts added, separated by commas. Lista obiektów, które otrzymają części zamienne, oddzielone przecinkiem. Lista de objetos que ganharão partes sobressalentes, dividos por vírgulas. + Lista de los objetos que tendrán repuestos añadidos, separados por comas. Part Część Parte + Pieza Spare part. Część zamienna. Parte sobressalente + Pieza de recambio. Amount Ilość Quantidade + Cantidad Number of selected spare parts. Ilość wybranych części zamiennych. Número de partes sobressalentes. + Número de piezas de repuesto seleccionados. - + Wheel repair requirements + Requisitos de reparación de ruedas Items required to remove/replace wheels + Elementos necesarios para quitar/cambiar ruedas - + \ No newline at end of file diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index 63363d34e0..e2dd2649df 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -9,6 +9,7 @@ Apresentação de Slides Слайд-шоу Prezentace + Presentación de diapositivas This module allows you to set up slide-shows on different objects. One module per image list. Only objects with hiddenSelection 0 are supported. @@ -17,6 +18,7 @@ Ez a modul lehetővé teszi a különböző objektumokon való vetítést. Egy modul/képlista. Csak "hiddenSelection 0"-t tartalmazó objektumok felelnek meg. Este módulo permite que você monte apresentações de slides em diferentes objetos. Um módulo por lista de imagem. Somente objetos com hiddenSelection 0 são suportados. Этот модуль позволяет вам устроить слайд-шоу на различных объектах. Один модуль на один список изображений. Поддерживаются только объекты с hiddenSelection 0. + Este módulo permite configurar una presentación de diapositivas en diferentes objetos. Un módulo por lista de imágenes. Sólo son soportados objetos con hiddenSelection 0. Objects @@ -26,6 +28,7 @@ Objetos Объекты Objekty + Objetos Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. Reference INFO for object support. @@ -34,6 +37,7 @@ Objektum nevek (szinkronizált is lehet) amik a vetítésen megjelennek, több darab esetén vesszővel elválasztva. Objektumtámogatásért az INFO-t tekintsd meg. Nomes dos objetos (também podem ser objetos sincronizados) em que a apresentação de slides será mostrada, separado por vírgulas se for mais de um. Referência INFO para suporte do objeto. Имена объектов (так же могут использоваться синхронизированные объекты), на которых будет отображаться слайд-шоу, разделенные запятыми. Посмотрите описание, чтобы понять, какие объекты поддерживаются. + Los nombres de objetos (también pueden ser objetos sincronizados) de diapositivas se mostrarán en, separados por comas. Referencia INFO para el soporte del objeto. Controllers @@ -42,6 +46,7 @@ Vezérlők Controles Контроллеры + Controladores Controller object names, separated by commas if multiple. @@ -50,6 +55,7 @@ Vezérlő objektum nevek, vesszővel elválasztva több darab esetén. Nome dos objetos de controle, separado por vírgula se mais de um. Имена объектов-контроллеров, разделенные запятыми. + Nombres de objeto de controlador, separados por comas. Images @@ -59,6 +65,7 @@ Imagens Изображения Obrázky + Imagenes List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). @@ -67,6 +74,7 @@ A képek listája amit a vetítés használni fog, vesszővel elválasztva, megfelelően formázott teljes útvonallal (pl. képek\kép.paa) Lista das imagens que serão utilizadas na apresentação de slides, separadas por vírgula, com o caminho completo corretamente formatado (ex: imagens\imagem.paa). Список изображений, которые будут использованы для слайд-шоу, разделенные запятыми, с полными путями в правильном формате (например, images\image.paa). + Lista de imágenes que se utilizarán para la presentación de diapositivas, separadas por comas, con la ruta completa en formato correcto (ej. imagenes\ image.paa). Interaction Names @@ -76,6 +84,7 @@ Nomes de Interação Интерактивные имена Názvy Interakcí + Nombres de interacción List of names that will be used for interaction entries, separated by commas, in order of images. @@ -84,6 +93,7 @@ Olyan nevek listája, melyek interakciós célra kellenek, vesszővel elválasztva, kép szerinti sorrendben. Lista dos nomes que serão usados para entradas de interação, separados por vírgulas, na ordem das imagens. Список имен, которые будут использованы при взаимодействии, разделенные запятыми, в порядке следования изображений. + Lista de nombres que se utilizarán para las entradas de interacción, separados por comas, en el orden de las imágenes. Slide Duration @@ -92,6 +102,7 @@ Dia időtartam Duração do Slide Длительность слайда + Duración de diapositiva Duration of each slide. Default: 0 (Automatic Transitions Disabled) @@ -100,6 +111,7 @@ A diák időtartama. Alapértelmezett: 0 (Automatikus váltás letiltva) Duração de cada slide. Padrão: 0 (Transição automática desabilitada) Длительность каждого слайда. По-умолчанию: 0 (автоматический переход отключен) + Duración de cada diapositiva. Por defecto: 0 (Transiciones automáticas desactivadas) Slides @@ -108,6 +120,7 @@ Diák Slides Слайды + Diapositivas - + \ No newline at end of file diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index 5d84136da8..166fe39cdb 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -7,12 +7,14 @@ Preferências de Espectador Настройки спектатора Nastavení Pozorovatele + Ajustes de espectador Configure how the spectator system will operate by default. Skonfiguruj domyślne ustawienia obserwatora. Configura como o sistema de espectador operará por padrão. Определяют, как система спектатора будет функционировать по-умолчанию. + Configurar cómo el sistema de espectador funcionará por defecto. Unit filter @@ -20,12 +22,14 @@ Filtro de unidades Фильтр юнитов Filtr jednotek + Filtro de unidad Method of filtering spectatable units. Wybierz jednostki, jakie będzie można obserwować po uruchomeniu obserwatora. Método para filtrar unidades espectáveis Метод фильтрации наблюдаемых юнитов. + Método de filtrado de unidades de espectador No units @@ -33,6 +37,7 @@ Sem unidades Никто Žádné jednotky + Ninguna Only players @@ -40,6 +45,7 @@ Somente jogadores Только игроки Pouze hráči + Solo jugadores Playable Units @@ -47,6 +53,7 @@ Unidades jogáveis Играбельные юниты Hratelné Jednotky + Unidades jugables All units @@ -54,6 +61,7 @@ Todas unidades Все юниты Všechny jednotky + Todas las unidades Side filter @@ -61,12 +69,14 @@ Filtro de lados Фильтр стороны Filtr stran + Filtro de bando Method of filtering spectatable sides. Wybierz strony, jakie będzie można obserwować po uruchomeniu obserwatora. Método para filtrar lados espectáveis. Метод фильтрации наблюдаемых сторон. + Método de filtrado de bandos de espectador Player side @@ -74,6 +84,7 @@ Lado do jogador Сторона игрока Strana hráče + Bando del jugador Friendly sides @@ -81,6 +92,7 @@ Lados aliados Дружественные стороны Strana spojenců + Bandos amigos Hostile sides @@ -88,6 +100,7 @@ Lados hostis Враждебные стороны Strana nepřítele + Bandos enemigos All sides @@ -95,6 +108,7 @@ Todos os lados Все стороны Všechny strany + Todos los bandos Camera modes @@ -102,12 +116,14 @@ Modos de camera Режимы камеры Módy kamery + Modos de cámara Camera modes that can be used. Tryby kamery, jakie mogą być używane. Modos de camera que podem ser utilizados Режимы камеры, которые могут быть использованы + Modos de la cámara que se pueden utilizar. All @@ -115,6 +131,7 @@ Todos Все Všechny + Todos Free only @@ -122,6 +139,7 @@ Somente livre Только свободная Pouze volná + Solo libre Internal only @@ -129,6 +147,7 @@ Somente interna Только внутренняя Pouze vnitřní + Solo interna External only @@ -136,6 +155,7 @@ Somente externa Только внешняя Pouze vnější + Solo externa Internal and external @@ -143,18 +163,21 @@ Interna e externa Внутренняя и внешняя Vnitřní a vnější + Interna y externa Vision modes Tryby wizji Modos de visão Режимы видения + Modos de visión Vision modes that can be used. Tryby wizji, jakie mogą być używane. Modos de visão que podem ser utilizados Режимы видения, которые могут быть использованы + Modos de visión que pueden ser utilizados. Night vision @@ -162,6 +185,7 @@ Visão noturna Ночное видение Noktovize + Visión nocturna Thermal imaging @@ -169,6 +193,7 @@ Visão térmica Тепловизионное Termovize + Imagen térmica @@ -176,12 +201,14 @@ Jednostki obserwatora Unidades espectadoras Юниты + Unidades espectador Spectator Controls Sterowanie obserwatorem Controle do espectador Управление спектатором + Controles de espectador Free @@ -189,6 +216,7 @@ Livre Свободная Volná + Libre Internal @@ -196,6 +224,7 @@ Interna Внутренняя Vnitřní + Interna External @@ -203,6 +232,7 @@ Externa Внешняя Vnější + Externa Normal @@ -210,6 +240,7 @@ Normal Нормальное Normální + Normal Night @@ -217,6 +248,7 @@ Visão Norturna Ночное Noc + Nocturna Thermal @@ -224,6 +256,7 @@ Térmica Тепловизор Termál + Térmica @@ -232,6 +265,7 @@ Câmera livre Свободная камера Volná Kamera + Cámara libre Camera Forward @@ -239,6 +273,7 @@ Câmera para frente Камера вперед Kamera Vpřed + Cámara delantera Camera Backward @@ -246,6 +281,7 @@ Câmera para trás Камера назад Kamera Zpět + Cámara trasera Camera Left @@ -253,6 +289,7 @@ Câmera para esquerda Камера влево Kamera Doleva + Cámara izquierda Camera Right @@ -260,6 +297,7 @@ Câmera para direita Камера вправо Kamera Doprava + Cámara derecha Camera Up @@ -267,6 +305,7 @@ Câmera para cima Камера вверх Kamera Nahoru + Cámara arriba Camera Down @@ -274,18 +313,21 @@ Câmera para baixo Камера вниз Kamera Dolů + Cámara abajo Pan Camera Panoramowanie Câmera panorâmica Панорамирование + Cámara panorámica Dolly Camera Płynna kamera Câmera dolly Рельсовая камера + Cámara dolly Lock Camera to Target @@ -293,12 +335,14 @@ Travar câmera em alvo Зафиксировать камеру на цели Zamknout Kameru na Cíl + Fijar cámara al objetivo Speed Boost Przyśpieszenie kamery Aumento de velocidade Ускорение камеры + Aumento de velocidad Focus on Unit @@ -306,6 +350,7 @@ Focar na unidade Фокус на юните Zaměřit se na Jednotku + Centrarse en la unidad Interface @@ -313,6 +358,7 @@ Interface Интерфейс Rozhraní + Interfaz Toggle Interface @@ -320,6 +366,7 @@ Alternar interface Переключить интерфейс Přepnout Rozhraní + Conmutar Toggle Unit Icons @@ -327,6 +374,7 @@ Alternar ícone de unidades Вкл./выкл. иконки юнитов Přepnout Ikony Jednotek + Conmutar iconos de unidad Toggle Unit List @@ -334,12 +382,14 @@ Alternar lista de unidades Вкл./выкл. список юнитов Přepnout Seznam Jednotek + Conmutar lista de unidades Toggle Toolbar Przełącz pasek narzędzi Alternar barra de ferramentas Вкл./выкл. тулбар + Conmutar barra de herramientas Toggle Compass @@ -347,6 +397,7 @@ Alternar bússola Вкл./выкл. компас Přepnout Kompas + Conmutar brújula Toggle Map @@ -354,6 +405,7 @@ Alternar mapa Вкл./выкл. карту Přepnout Mapu + Conmutar map Toggle Help @@ -361,12 +413,14 @@ Alternar ajuda Вкл./выкл. помощь Přepnout Nápovědu + Conmutar ayuda Camera Attributes Atrybuty kamery Atributos de câmera Атрибуты камеры + Atributos de cámara Next Camera @@ -374,6 +428,7 @@ Próxima câmera Следующая камера Následující Kamera + Siguiente cámara Previous Camera @@ -381,6 +436,7 @@ Câmera anterior Предыдущая камера Předchozí Kamera + Anterior cámara Next Unit @@ -388,6 +444,7 @@ Próxima unidade Следующий юнит Následující Jednotka + Siguiente unidad Previous Unit @@ -395,18 +452,21 @@ Unidade anterior Предыдущий юнит Předchozí Jednotka + Anterior unidad Next Vision Mode Następny tryb wizji Próximo modo de visão Следующий режим видения + Siguiente modo de visión Previous Vision Mode Poprzedni tryb wizji Modo de visão anterior Предыдущий режим видения + Anterior modo de visión Adjust Zoom @@ -414,6 +474,7 @@ Ajustar zoom Настроить зум Regulovat Přiblížení + Ajustar enfoque Adjust Speed @@ -421,18 +482,21 @@ Ajuster velocidade Настроить скорость Regulovat Rychlost + Ajustar velocidad Increment Zoom Reguluj zoom (krok) Incrementar zoom Увеличить зум + Incrementar enfoque Increment Speed Reguluj prędkość (krok) Incrementar velocidade Увеличить скорость + Incrementar velocidad Reset Zoom @@ -440,6 +504,7 @@ Redefinir zoom Сбросить зум Obnovit Přiblížení + Reiniciar enfoque Reset Speed @@ -447,6 +512,7 @@ Redefinir velocidade Сбросить скорость Obnovit Rychlost + Reiniciar velocidad - + \ No newline at end of file diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index ff55e6898f..0f909d8383 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -194,6 +194,7 @@ Definir médico Назначить медиком Přiřadit Zdravotníka + Asignar médico Assign Medical Vehicle @@ -201,6 +202,7 @@ Definir veículo médico Назначить медицинским транспортом Přiřadit Zdravotnické Vozidlo + Asignar vehículo médico Assign Medical Facility @@ -208,6 +210,7 @@ Definir instalação médica Назанчить медицинским сооружением Přiřadit Zdravotnické Zařízení + Asignar instalación médica Unit must be alive @@ -238,12 +241,14 @@ Jednostka musi być budynkiem Unidade deve ser uma estrutura Юнит должен быть строением + La unidad debe ser una estructura Unit must be a vehicle Jednostka musi być pojazdem Unidade deve ser um veículo Юнит должен быть транспортом + La unidad debe ser un vehículo Unit must not be captive @@ -284,12 +289,14 @@ Dodaj obiekt do kuratora Adicionar objetos para o Curator Добавить объекты куратору + Agregar objetos al director Adds any spawned object to all curators in the mission Dodaje każdy zespawnowany obiekt do wszystkich kuratorów podczas misji Adicionar qualquer objeto criado para todos os curators na missão Добавляет любой отспавненный объект всем кураторам в миссии + Añadir cualquier objeto creado a todos los directores en la misión - + \ No newline at end of file From 06a9f6028126db6b53afb762bf431ae6183deadd Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 16 Sep 2015 10:55:23 -0500 Subject: [PATCH 050/311] Cleanup Nightvision --- addons/nightvision/functions/fnc_blending.sqf | 26 +++++++------------ .../functions/fnc_changeNVGBrightness.sqf | 6 +++-- addons/nightvision/script_component.hpp | 2 ++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/addons/nightvision/functions/fnc_blending.sqf b/addons/nightvision/functions/fnc_blending.sqf index 8c49711079..a565eb65c0 100644 --- a/addons/nightvision/functions/fnc_blending.sqf +++ b/addons/nightvision/functions/fnc_blending.sqf @@ -23,25 +23,19 @@ if (!hasInterface) exitWith {}; -private ["_vehicle", "_weapon", "_ammo", "_magazine", "_player"]; +params ["_vehicle", "_weapon", "", "", "_ammo", "_magazine"]; -_vehicle = _this select 0; -_weapon = _this select 1; -_ammo = _this select 4; -_magazine = _this select 5; - -_player = ACE_player; //If our vehicle didn't shoot, or we're not in NVG mode, exit -if ((_vehicle != (vehicle _player)) || {(currentVisionMode _player) != 1}) exitWith {}; +if ((_vehicle != (vehicle ACE_player)) || {(currentVisionMode ACE_player) != 1}) exitWith {}; //If we are mounted, and it wasn't our weapon system that fired, exit -if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {}; +if (ACE_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([ACE_player] call EFUNC(common,getTurretIndex))))}) exitWith {}; -private ["_silencer", "_visibleFireCoef", "_visibleFireTimeCoef", "_visibleFire", "_visibleFireTime", "_nvgBrightnessCoef", "_fnc_isTracer", "_darkness"]; +private["_darkness", "_nvgBrightnessCoef", "_silencer", "_visibleFire", "_visibleFireCoef", "_visibleFireTime", "_visibleFireTimeCoef"]; _silencer = switch (_weapon) do { -case (primaryWeapon _player) : {primaryWeaponItems _player select 0}; -case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0}; -case (handgunWeapon _player) : {handgunItems _player select 0}; + case (primaryWeapon ACE_player) : {primaryWeaponItems ACE_player select 0}; + case (secondaryWeapon ACE_player) : {secondaryWeaponItems ACE_player select 0}; + case (handgunWeapon ACE_player) : {handgunItems ACE_player select 0}; default {""}; }; @@ -55,14 +49,14 @@ if (_silencer != "") then { _visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire"); _visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTime"); -_nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4; +_nvgBrightnessCoef = 1 + (ACE_player getVariable [QGVAR(NVGBrightness), 0]) / 4; _fnc_isTracer = { private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"]; if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false}; - _indexShot = (_player ammo _weapon) + 1; + _indexShot = (ACE_player ammo _weapon) + 1; _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); if (_indexShot <= _lastRoundsTracer) exitWith {true}; @@ -83,7 +77,7 @@ _darkness = 1 - (call EFUNC(common,ambientBrightness)); _visibleFire = _darkness * _visibleFireCoef * _visibleFire * _nvgBrightnessCoef / 10 min 1; _visibleFireTime = _darkness * _visibleFireTimeCoef * _visibleFireTime * _nvgBrightnessCoef / 10 min 0.5; -// ["NightVision", [_visibleFire, _visibleFireTime], {format ["visibleFire: %1 - visibleFireTime: %2", _this select 0, _this select 1]}] call AGM_Debug_fnc_log; //todo +TRACE_2("Player Shot, Adjusting NVG Effect", _visibleFire, _visibleFireTime); GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, _visibleFire, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index a55535e40a..116ab9b5a5 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -16,10 +16,12 @@ */ #include "script_component.hpp" -if (!hasInterface) exitWith {}; +params ["_player", "_changeInBrightness"]; +TRACE_2("params",_player,_changeInBrightness); + private ["_brightness"]; -PARAMS_2(_player,_changeInBrightness); +if (!hasInterface) exitWith {}; _brightness = _player getVariable [QGVAR(NVGBrightness), 0]; diff --git a/addons/nightvision/script_component.hpp b/addons/nightvision/script_component.hpp index d322ea0799..9afeeb5d8d 100644 --- a/addons/nightvision/script_component.hpp +++ b/addons/nightvision/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT nightvision #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_NIGHTVISION #define DEBUG_MODE_FULL #endif From 49e0befbaf62d7b9e71279d872ee02ecd1ceddeb Mon Sep 17 00:00:00 2001 From: alganthe Date: Wed, 16 Sep 2015 19:44:44 +0200 Subject: [PATCH 051/311] added diagnose to torso Signed-off-by: alganthe --- addons/medical/ACE_Medical_Actions.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index ecb9afdfe4..fce5edc750 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -122,6 +122,17 @@ class ACE_Torso { enableInside = 1; icon = PATHTOF(UI\icons\triageCard.paa); }; + class Diagnose { + displayName = CSTRING(Actions_Diagnose); + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = ""; + }; // Advanced medical class FieldDressing { From 6d80740a20c8de075df69459937499bc71150517 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 16 Sep 2015 23:29:07 +0200 Subject: [PATCH 052/311] don't default to english on the switch units module description --- addons/switchunits/stringtable.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 2e96f14d67..0a396df82a 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -169,6 +169,7 @@ Радиус безопасной зоны вокруг ироков из противоположной команды. По-умолчанию: 200 + Moduł ten pozwala na zmianę strony w trakcie gry. Tento modul umožňuje přepínání mazi dostupnými stranami. Este módulo permite mudar o lado à disposição dos jogadores. From ca72770c481ee65b79e5855e066ebb77a65ec432 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 16 Sep 2015 23:49:34 +0200 Subject: [PATCH 053/311] add english translation to switch units module --- addons/switchunits/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 0a396df82a..d38175b1da 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -169,7 +169,7 @@ Радиус безопасной зоны вокруг ироков из противоположной команды. По-умолчанию: 200 - + Module allows you to switch side during the game. Moduł ten pozwala na zmianę strony w trakcie gry. Tento modul umožňuje přepínání mazi dostupnými stranami. Este módulo permite mudar o lado à disposição dos jogadores. From 15f4fc39e39640dbf23e3d5b7d15d079f0fafa9f Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 Sep 2015 01:26:28 +0200 Subject: [PATCH 054/311] optional pbo to hide select weapon actions --- optionals/noactionmenu/$PBOPREFIX$ | 1 + optionals/noactionmenu/CfgActions.hpp | 24 +++++++++++++++++++++ optionals/noactionmenu/README.md | 11 ++++++++++ optionals/noactionmenu/config.cpp | 15 +++++++++++++ optionals/noactionmenu/script_component.hpp | 12 +++++++++++ 5 files changed, 63 insertions(+) create mode 100644 optionals/noactionmenu/$PBOPREFIX$ create mode 100644 optionals/noactionmenu/CfgActions.hpp create mode 100644 optionals/noactionmenu/README.md create mode 100644 optionals/noactionmenu/config.cpp create mode 100644 optionals/noactionmenu/script_component.hpp diff --git a/optionals/noactionmenu/$PBOPREFIX$ b/optionals/noactionmenu/$PBOPREFIX$ new file mode 100644 index 0000000000..5b0abc60fd --- /dev/null +++ b/optionals/noactionmenu/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\noactionmenu \ No newline at end of file diff --git a/optionals/noactionmenu/CfgActions.hpp b/optionals/noactionmenu/CfgActions.hpp new file mode 100644 index 0000000000..164ac31117 --- /dev/null +++ b/optionals/noactionmenu/CfgActions.hpp @@ -0,0 +1,24 @@ + +class CfgActions { + // to pistol + class None; + class HandGunOn: None { + show = 0; + }; + // to rifle + class HandGunOff: None { + show = 0; + }; + + // to launcher, (also used for binoculars?) + class SwitchWeapon: None { + show = 0; + }; + class SwitchMagazine: SwitchWeapon { + show = 1; + }; + // no idea, probably unused + class HideWeapon: SwitchWeapon { + show = 0; + }; +}; diff --git a/optionals/noactionmenu/README.md b/optionals/noactionmenu/README.md new file mode 100644 index 0000000000..c2e247bf44 --- /dev/null +++ b/optionals/noactionmenu/README.md @@ -0,0 +1,11 @@ +ace_noactionmenu +=========== + +Removes weapon select action. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) diff --git a/optionals/noactionmenu/config.cpp b/optionals/noactionmenu/config.cpp new file mode 100644 index 0000000000..3477258612 --- /dev/null +++ b/optionals/noactionmenu/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2"; + VERSION_CONFIG; + }; +}; + +#include "CfgActions.hpp" diff --git a/optionals/noactionmenu/script_component.hpp b/optionals/noactionmenu/script_component.hpp new file mode 100644 index 0000000000..ee07b73c4f --- /dev/null +++ b/optionals/noactionmenu/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT noactionmenu +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_NOACTIONMENU + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_NOACTIONMENU + #define DEBUG_SETTINGS DEBUG_ENABLED_NOACTIONMENU +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file From 014203413d935b4eb019a1f301acf9f6ea67a731 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 Sep 2015 02:13:21 +0200 Subject: [PATCH 055/311] handle optional pbos in checkFiles --- addons/common/functions/fnc_checkFiles.sqf | 3 +++ optionals/noactionmenu/config.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index ecbcb910e8..e80d18e5b1 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -61,6 +61,9 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); // check server version/addons /////////////// if (isMultiplayer) then { + // don't check optional addons + _addons = [_addons, {getNumber (configFile >> "CfgPatches" >> _this >> "ACE_isOptional") != 1}] call FUNC(filter); + if (isServer) then { // send servers version of ACE to all clients GVAR(ServerVersion) = _version; diff --git a/optionals/noactionmenu/config.cpp b/optionals/noactionmenu/config.cpp index 3477258612..763665660b 100644 --- a/optionals/noactionmenu/config.cpp +++ b/optionals/noactionmenu/config.cpp @@ -2,6 +2,7 @@ class CfgPatches { class ADDON { + ACE_isOptional = 1; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; From a09ca8fb80876456c761862bdf4e28fdeec8ee4d Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 Sep 2015 12:23:56 +0200 Subject: [PATCH 056/311] tweak doAnimation switchMove to do no akward camera jumps whenever possible, fix #2474 --- addons/common/functions/fnc_doAnimation.sqf | 17 +++++++++++++++-- .../medical/functions/fnc_treatment_failure.sqf | 1 + .../medical/functions/fnc_treatment_success.sqf | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 81301ce1dc..5b7a1ed1bf 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -44,6 +44,8 @@ if (_animation == "") then { _animation = [_unit] call FUNC(getDefaultAnim); }; +//if (_animation == animationState _unit) exitWith {}; + switch (_priority) do { case 0 : { if (_unit == vehicle _unit) then { @@ -62,8 +64,19 @@ switch (_priority) do { }; }; case 2 : { - // Execute on all machines. SwitchMove has local effects. - [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); + // try playMoveNow first + if (_unit == vehicle _unit) then { + [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); + } else { + // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. + [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); + }; + + // if animation doesn't respond, do switchMove + if (animationState _unit != _animation) then { + // Execute on all machines. SwitchMove has local effects. + [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); + }; }; default {}; }; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index e943485e0e..4aac0eda6a 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -35,6 +35,7 @@ if (vehicle _caller == _caller) then { case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; + [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index bf183e24db..c2347c59ee 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -19,7 +19,7 @@ private ["_config", "_callback", "_weaponSelect", "_lastAnim"]; params ["_args"]; -_args params ["_caller", "_target","_selectionName","_className", "_items", "_usersOfItems"]; +_args params ["_caller", "_target", "_selectionName", "_className", "_items", "_usersOfItems"]; if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; @@ -28,13 +28,14 @@ if (vehicle _caller == _caller) then { _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); - switch (tolower _lastAnim) do { + switch (toLower _lastAnim) do { case "ainvpknlmstpslaywrfldnon_medic": {_lastAnim = "AmovPknlMstpSrasWrflDnon"}; case "ainvppnemstpslaywrfldnon_medic": {_lastAnim = "AmovPpneMstpSrasWrflDnon"}; case "ainvpknlmstpslaywnondnon_medic": {_lastAnim = "AmovPknlMstpSnonWnonDnon"}; case "ainvppnemstpslaywpstdnon_medic": {_lastAnim = "AinvPpneMstpSlayWpstDnon"}; case "ainvpknlmstpslaywpstdnon_medic": {_lastAnim = "AmovPknlMstpSrasWpstDnon"}; }; + [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; From 067b08611e42bd1df91e4350d153a292dcc4550f Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Thu, 17 Sep 2015 12:54:26 +0200 Subject: [PATCH 057/311] Fix missing newlines --- addons/interaction/stringtable.xml | 2 +- addons/medical/stringtable.xml | 2 +- addons/repair/stringtable.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 8b026cb307..13383f8088 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -824,4 +824,4 @@ Управление группами позволяет назначать цвета членам групп, брать командование, вступать в группы или покидать их. - \ No newline at end of file + diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 521976113a..198a5b1746 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3835,4 +3835,4 @@ Na tej części ciała nie ma stazy! - \ No newline at end of file + diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index d00f331353..acee12c3ce 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -910,4 +910,4 @@ Przedmioty potrzebne do wymiany kół - \ No newline at end of file + From 42a754a981d102f77fff6dc1c1bac26d50aa3034 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 Sep 2015 13:43:55 +0200 Subject: [PATCH 058/311] display text when loading / unloading cargo --- addons/cargo/functions/fnc_loadItem.sqf | 8 ++++++++ addons/cargo/functions/fnc_unloadItem.sqf | 8 ++++++++ addons/cargo/stringtable.xml | 24 +++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index cf81bdbe6c..3c79604a04 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -34,6 +34,14 @@ detach _item; _item attachTo [_vehicle,[0,0,100]]; ["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); +// show hint +private ["_itemName", "_vehicleName"]; + +_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); +_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + +["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); + // Invoke listenable event ["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 1390a8c20d..2630f2104a 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -60,6 +60,14 @@ detach _item; _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); ["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); +// show hint +private ["_itemName", "_vehicleName"]; + +_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); +_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + +["displayTextStructured", [[localize LSTRING(UnloadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); + // TOOO maybe drag/carry the unloaded item? // Invoke listenable event diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 4b1ef90606..44cd34a658 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -62,5 +62,29 @@ Configura as preferências do módulo de carga Конфигурирует настройки модуля перевозки грузов + + %1<br/>loaded into<br/>%2 + %1<br/>cargado en<br/>%2 + %1<br/>chargé dans<br/>%2 + %1<br/>in<br/>%2 verladen + %1<br/>załadowano do<br/>%2 + %1<br/>naloženo do<br/>%2 + %1<br/>carregado em<br/>%2 + %1<br/>caricato su<br/>%2 + %1<br/>berakodva ide:<br/>%2 + %1<br/>загружен в<br/>%2 + + + Unloaded<br/>%1 from<br/>%2 + %1<br/>von<br/>%2 abgeladen + Descargado/a<br/>%1 de<br/>%2 + Déchargé<br/>%1 de<br/>%2 + %1<br/>rozładowano z<br/>%2 + Nezatížený<br/>%1 do<br/>%2 + %1<br/>descarregado de<br/>%2 + Hai scaricato<br/>%1 da<br/>%2 + 1%<br/>kirakodva ebből:<br/>%2 + %1<br/>разгружен из<br/>%2 + From 864c0b4baf9451096bf3ffe9a8c732bf8622853c Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 Sep 2015 14:17:48 +0200 Subject: [PATCH 059/311] fix daylasers being a virtual light source, fix #2416 --- addons/common/functions/fnc_lightIntensityFromObject.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index 6722c3a554..0d206223d6 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -42,6 +42,8 @@ if (_lightSource isKindOf "CAManBase") then { default {""}; }; + if (getNumber (configFile >> "CfgWeapons" >> _flashlight >> "ACE_laserpointer") == 1) exitWith {_lightLevel = 0}; + _properties = [[_flashlight], FUNC(getLightPropertiesWeapon), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getLightPropertiesWeapon)), _flashlight], 1E11] call FUNC(cachedCall); //_properties = [_flashlight] call FUNC(getLightPropertiesWeapon); @@ -88,7 +90,7 @@ if (_lightSource isKindOf "CAManBase") then { _lightLevel = _lightLevel max ((linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])); - //systemChat format ["%1 %2", (linearConversion [0, 30, _distance, 1, 0, true]), (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])]; + //systemChat format ["%1 %2", (linearConversion [0, 30, _distance, 1, 0, true]), (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])]; } forEach _lights; From a03bc44ba0904c4cc2fecb944d6e807d35157869 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 Sep 2015 14:40:58 +0200 Subject: [PATCH 060/311] add fcs to static machine guns, close #1188 --- addons/fcs/CfgVehicles.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/addons/fcs/CfgVehicles.hpp b/addons/fcs/CfgVehicles.hpp index 10cb868ca0..53b279ef88 100644 --- a/addons/fcs/CfgVehicles.hpp +++ b/addons/fcs/CfgVehicles.hpp @@ -505,4 +505,26 @@ class CfgVehicles { class Plane_Fighter_03_base_F: Plane_Base_F { class Turrets; }; + + // static weapons. + class StaticWeapon: LandVehicle { + class Turrets { + class MainTurret; //: NewTurret {}; + }; + }; + + class StaticMGWeapon: StaticWeapon {}; + + class HMG_01_base_F: StaticMGWeapon { + class Turrets: Turrets { + class MainTurret: MainTurret { + GVAR(Enabled) = 1; + GVAR(MinDistance) = 100; + GVAR(MaxDistance) = 1500; + GVAR(DistanceInterval) = 5; + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; }; From 3b1a9ab415e36bf9735d454ffb4b09c9072e9c0d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 17 Sep 2015 11:19:47 -0500 Subject: [PATCH 061/311] #2488 - only run addSpareParts on server --- addons/repair/CfgEventHandlers.hpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 2a4386f5b0..03b3b5b494 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -13,31 +13,36 @@ class Extended_PostInit_EventHandlers { class Extended_Init_EventHandlers { class Car { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); + init = QUOTE(_this call DFUNC(addRepairActions)); + serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; class Tank { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); + init = QUOTE(_this call DFUNC(addRepairActions)); + serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; class Helicopter { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); + init = QUOTE(_this call DFUNC(addRepairActions)); + serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; class Plane { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); + init = QUOTE(_this call DFUNC(addRepairActions)); + serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; class Ship_F { class ADDON { - init = QUOTE(_this call DFUNC(addRepairActions); _this call DFUNC(addSpareParts)); + init = QUOTE(_this call DFUNC(addRepairActions)); + serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; }; From 36a279012c6eb90e4902de925e2e9e07b759e5f7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 17 Sep 2015 18:25:02 +0200 Subject: [PATCH 062/311] cleanup common --- addons/common/functions/fnc_ASLToPosition.sqf | 6 +- addons/common/functions/fnc_monitor.sqf | 27 +++-- .../common/functions/fnc_numberToDigits.sqf | 18 ++-- .../functions/fnc_numberToDigitsString.sqf | 14 +-- .../common/functions/fnc_numberToString.sqf | 17 ++-- addons/common/functions/fnc_owned.sqf | 5 +- addons/common/functions/fnc_player.sqf | 4 +- addons/common/functions/fnc_playerSide.sqf | 14 ++- addons/common/functions/fnc_setName.sqf | 16 +-- addons/common/functions/fnc_showUser.sqf | 24 ++++- .../functions/fnc_stringToColoredText.sqf | 25 ++--- addons/common/functions/fnc_toBin.sqf | 29 +++--- addons/common/functions/fnc_toBitmask.sqf | 8 +- addons/common/functions/fnc_toHex.sqf | 23 ++--- addons/common/functions/fnc_unhideUnit.sqf | 8 +- addons/common/functions/fnc_unmuteUnit.sqf | 14 +-- .../common/functions/fnc_waitAndExecute.sqf | 12 +-- addons/common/functions/fnc_waveHeightAt.sqf | 10 +- .../functions/fnc_worldToScreenBounds.sqf | 99 ++++++++++++------- addons/common/functions/script_component.hpp | 2 +- 20 files changed, 225 insertions(+), 150 deletions(-) diff --git a/addons/common/functions/fnc_ASLToPosition.sqf b/addons/common/functions/fnc_ASLToPosition.sqf index 4ff880c019..a5afb1db75 100644 --- a/addons/common/functions/fnc_ASLToPosition.sqf +++ b/addons/common/functions/fnc_ASLToPosition.sqf @@ -3,9 +3,9 @@ * Converts ASL to Arma "Position" * * Arguments: - * 0: position x - * 1: position y - * 2: position z + * 0: position x + * 1: position y + * 2: position z * * Return Value: * None diff --git a/addons/common/functions/fnc_monitor.sqf b/addons/common/functions/fnc_monitor.sqf index f77aa2dd7c..a05abb68c4 100644 --- a/addons/common/functions/fnc_monitor.sqf +++ b/addons/common/functions/fnc_monitor.sqf @@ -1,11 +1,22 @@ -// by commy2 +/* + * Author: commy2 + * + * hint retun value of given function every frame + * + * Argument: + * + * + * Return Value: + * None + * + * Public: Yes + */ #include "script_component.hpp" -terminate (missionNamespace getVariable [QGVAR(MonitorFnc), scriptNull]); - -GVAR(MonitorFnc) = _this spawn { - waitUntil { - hintSilent str (call _this); - false - }; +if (!isNil QGVAR(MonitorFnc)) then { + [GVAR(MonitorFnc)] call CBA_fnc_removePerFrameHandler; }; + +GVAR(MonitorFnc) = [{ + hintSilent str (call (_this select 0)); +}, 0, _this] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf index 3545b53257..851ce1bb48 100644 --- a/addons/common/functions/fnc_numberToDigits.sqf +++ b/addons/common/functions/fnc_numberToDigits.sqf @@ -3,23 +3,23 @@ * * Transforms a number to an array of the correspondending digits. * - * Argument: - * 0: Number to 'digitize' (Number) - * 1: Set the minimal length of the returned array. Useful for getting left hand zeroes. (Number, optional) + * Arguments: + * 0: Number to 'digitize' + * 1: Set the minimal length of the returned array. Useful for getting left hand zeroes. , optional * - * Return value: + * Return Value: * Digits. The maximum count is six digits. (Array) + * + * Public: Yes */ #include "script_component.hpp" -private ["_length", "_digits"]; - -PARAMS_2(_number,_minLength); +params ["_number", "_minLength"]; _number = _number min 999999; - _number = str _number; +private "_length"; _length = count _number; if (isNil "_minLength") then {_minLength = _length}; @@ -31,7 +31,9 @@ while {_length < _minLength} do { _length = _length + 1; }; +private "_digits"; _digits = []; + for "_x" from 0 to (_length - 1) do { _digits pushBack parseNumber (_number select [_x, 1]); }; diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf index e42f246460..b507545573 100644 --- a/addons/common/functions/fnc_numberToDigitsString.sqf +++ b/addons/common/functions/fnc_numberToDigitsString.sqf @@ -3,23 +3,23 @@ * * Transforms a number to an string of the correspondending digits. * - * Argument: - * 0: Number to 'digitize' (Number) + * Arguments: + * 0: Number to 'digitize' * 1: Set the minimal length of the returned string. Useful for getting left hand zeroes. (Number, optional) * - * Return value: + * Return Value: * Digits. The maximum length is six digits. (String) + * + * Public: Yes */ #include "script_component.hpp" -private ["_length"]; - -PARAMS_2(_number,_minLength); +params ["_number", "_minLength"]; _number = _number min 999999; - _number = str _number; +private "_length"; _length = count _number; if (isNil "_minLength") then {_minLength = _length}; diff --git a/addons/common/functions/fnc_numberToString.sqf b/addons/common/functions/fnc_numberToString.sqf index 30efcd8955..4e11668cd8 100644 --- a/addons/common/functions/fnc_numberToString.sqf +++ b/addons/common/functions/fnc_numberToString.sqf @@ -3,23 +3,24 @@ * * Converts a number to a string without losing as much precission as str or format. * - * Argument: - * 0: A number (Number) + * Arguments: + * 0: A number * - * Return value: + * Return Value: * The number as string (String) + * + * Public: Yes */ #include "script_component.hpp" -private ["_decimals"]; +params ["_number"]; -PARAMS_1(_number); - -_decimals = str (abs(_number) mod 1); +private "_decimals"; +_decimals = str (abs _number mod 1); _decimals = toArray _decimals; _decimals deleteAt 0; if (_number < 0) exitWith { - format ["-%1%2", floor abs(_number), toString _decimals]; + format ["-%1%2", floor abs _number, toString _decimals]; }; format ["%1%2", floor _number, toString _decimals]; diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf index b76edb31c1..d94e3975db 100644 --- a/addons/common/functions/fnc_owned.sqf +++ b/addons/common/functions/fnc_owned.sqf @@ -4,14 +4,15 @@ * Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit. * * Arguments: - * 0: Any object. (Object) + * 0: Any object. * * Return Value: * Is this object claimed by someone? * + * Public: No */ #include "script_component.hpp" -PARAMS_1(_target); +params ["_target"]; !isNull (_target getVariable [QGVAR(owner), objNull]) diff --git a/addons/common/functions/fnc_player.sqf b/addons/common/functions/fnc_player.sqf index 3e5990f84b..5f6f272e5e 100644 --- a/addons/common/functions/fnc_player.sqf +++ b/addons/common/functions/fnc_player.sqf @@ -8,7 +8,9 @@ * NONE. * * Return Value: - * Player controlled unit (object) + * Player controlled unit + * + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_playerSide.sqf b/addons/common/functions/fnc_playerSide.sqf index 632cf11abf..a264e82942 100644 --- a/addons/common/functions/fnc_playerSide.sqf +++ b/addons/common/functions/fnc_playerSide.sqf @@ -1,4 +1,16 @@ -// by commy2 +/* + * Author: commy2 + * + * Return the current side of the player + * + * Arguments: + * None + * + * Return Value: + * current local side (Side) + * + * Public: Yes + */ #include "script_component.hpp" side group ACE_player diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index 980408fb12..8a32dd669d 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -3,23 +3,23 @@ * * Sets the name variable of the object. Used to prevent issues with the name command. * - * Argument: - * 0: Object (Object) + * Arguments: + * 0: Object * - * Return value: - * Nothing. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_name"]; - -PARAMS_1(_unit); +params ["_unit"]; if (isNull _unit || {!alive _unit}) exitWith {}; if (_unit isKindOf "CAManBase") then { _name = [name _unit, true] call FUNC(sanitizeString); - + //if (_name != _unit getVariable ["ACE_Name", ""]) then { _unit setVariable ["ACE_Name", _name, true]; //}; diff --git a/addons/common/functions/fnc_showUser.sqf b/addons/common/functions/fnc_showUser.sqf index a88d39ce0d..488dffbaa9 100644 --- a/addons/common/functions/fnc_showUser.sqf +++ b/addons/common/functions/fnc_showUser.sqf @@ -1,8 +1,22 @@ -// by commy2 +/* + * Author: commy2 + * + * hint the Variable ACE_isUsedBy from the input Object every frame + * + * Argument: + * + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -GVAR(Debug_Object) = _this select 0; - -onEachFrame { - hintSilent str (GVAR(Debug_Object) getVariable ["ACE_isUsedBy", objNull]); +if (!isNil QGVAR(showUserPFH)) then { + [GVAR(showUserPFH)] call CBA_fnc_removePerFrameHandler; }; + +GVAR(showUserPFH) = [{ + hintSilent str ((_this select 0) getVariable ["ACE_isUsedBy", objNull]); +}, 0, _this] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_stringToColoredText.sqf b/addons/common/functions/fnc_stringToColoredText.sqf index 4f6b1e7143..5cbf280320 100644 --- a/addons/common/functions/fnc_stringToColoredText.sqf +++ b/addons/common/functions/fnc_stringToColoredText.sqf @@ -3,26 +3,27 @@ * * Create a centered, colored text. * - * Argument: - * 0: Text (Anything) - * 2: Color (Array) + * Arguments: + * 0: Text + * 1: Color * - * Return value: - * Text + * Return Value: + * Text + * + * Public: Yes */ #include "script_component.hpp" -private ["_string", "_color"]; +params ["_string", "_color"]; -_string = format ["%1", _this select 0]; -_color = _this select 1; +_string = format ["%1", _string]; _color = ( - [255 * (_color select 0), 2] call FUNC(toHex) + [255 * (_color select 0), 2] call FUNC(toHex) ) + ( - [255 * (_color select 1), 2] call FUNC(toHex) + [255 * (_color select 1), 2] call FUNC(toHex) ) + ( - [255 * (_color select 2), 2] call FUNC(toHex) + [255 * (_color select 2), 2] call FUNC(toHex) ); -parseText format ["%1", _string, _color]; +parseText format ["%1", _string, _color] diff --git a/addons/common/functions/fnc_toBin.sqf b/addons/common/functions/fnc_toBin.sqf index 7c666f2f73..5afc311511 100644 --- a/addons/common/functions/fnc_toBin.sqf +++ b/addons/common/functions/fnc_toBin.sqf @@ -1,23 +1,22 @@ /* -Author: commy2 - -Description: -Converts number to binary number - -Arguments: -A number - -Return Value: -A binary number, String -*/ + * Author: commy2 + * + * Converts number to binary number + * + * Arguments: + * A number + * + * Return Value: + * A binary number, String + * + * Public: Yes + */ #include "script_component.hpp" +params ["_number", ["_minLength", 1]]; + private ["_sign", "_bin", "_rest"]; -PARAMS_2(_number,_minLength); - -if (isNil "_minLength") then {_minLength = 1}; - _sign = ["", "-"] select (_number < 0); _number = round abs _number; diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf index 14ddb90541..80d671741d 100644 --- a/addons/common/functions/fnc_toBitmask.sqf +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -3,11 +3,13 @@ * * Convert an array of booleans into a number. * - * Argument: - * 0: Booleans (Array of Booleans) + * Arguments: + * N: Booleans * - * Return value: + * Return Value: * Bitmask (Number) + * + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_toHex.sqf b/addons/common/functions/fnc_toHex.sqf index 2d7d7a383e..216d7a5c67 100644 --- a/addons/common/functions/fnc_toHex.sqf +++ b/addons/common/functions/fnc_toHex.sqf @@ -1,15 +1,16 @@ /* -Author: commy2, esteldunedain - -Description: -Converts number to hexadecimal number - -Arguments: -A number between 0 and 255 - -Return Value: -A hexadecimal number, String -*/ + * Author: commy2, esteldunedain + * + * Converts number to hexadecimal number + * + * Arguments: + * A number between 0 and 255 + * + * Return Value: + * A hexadecimal number, + * + * Public: Yes + */ #include "script_component.hpp" private ["_number"]; diff --git a/addons/common/functions/fnc_unhideUnit.sqf b/addons/common/functions/fnc_unhideUnit.sqf index 190be47664..488c4475fd 100644 --- a/addons/common/functions/fnc_unhideUnit.sqf +++ b/addons/common/functions/fnc_unhideUnit.sqf @@ -1,5 +1,6 @@ /* * Author: SilentSpike (based on unmuteUnit) + * * Globally unhides a unit. Only unhides if the last reason was removed. * * Arguments: @@ -7,17 +8,16 @@ * 1: Reason to unhide the unit * * Return Value: - * nil + * None * * Example: * [ACE_Player, "SpectatorMode"] call ace_common_fnc_unhideUnit * - * Public: No + * Public: Yes */ - #include "script_component.hpp" -PARAMS_2(_unit,_reason); +params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf index 24b74785de..e234cb80db 100644 --- a/addons/common/functions/fnc_unmuteUnit.sqf +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -3,16 +3,18 @@ * * Unmutes the unit. Only unmutes if the last reason was removed. * - * Argument: - * 0: Unit (Object) - * 1: Reason to unmute the unit. (String) + * Arguments: + * 0: Unit + * 1: Reason to unmute the unit. * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_unit,_reason); +params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf index 977e4f146d..6fcf83a58f 100644 --- a/addons/common/functions/fnc_waitAndExecute.sqf +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -3,12 +3,12 @@ * * Executes a code once with a given game ACE_time delay, using a PFH * - * Argument: - * 0: Code to execute (Code) - * 1: Parameters to run the code with (Array) - * 2: Delay in seconds before executing the code (Number) + * Arguments: + * 0: Code to execute + * 1: Parameters to run the code with + * 2: Delay in seconds before executing the code * - * Return value: + * Return Value: * None * * Example: @@ -18,7 +18,7 @@ */ #include "script_component.hpp" -PARAMS_3(_func,_params,_delay); +params ["_func", "_params", "_delay"]; GVAR(waitAndExecArray) pushBack [(ACE_time + _delay), _func, _params]; GVAR(waitAndExecArray) sort true; diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf index e05e4219b7..ac9eed10bb 100644 --- a/addons/common/functions/fnc_waveHeightAt.sqf +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -9,12 +9,16 @@ * Return Value: * Wave height in meters * + * + * Public: No */ #include "script_component.hpp" -if(isNil QGVAR(waveHeightLogic)) then { +params ["_position"]; + +if (isNil QGVAR(waveHeightLogic)) then { GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; }; -GVAR(waveHeightLogic) setPosASL (_this select 0); +GVAR(waveHeightLogic) setPosASL _position; -(((getPosASLW GVAR(waveHeightLogic)) select 2) - ((getPosASL GVAR(waveHeightLogic)) select 2)) \ No newline at end of file +(getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2) diff --git a/addons/common/functions/fnc_worldToScreenBounds.sqf b/addons/common/functions/fnc_worldToScreenBounds.sqf index b3b5ba3f1e..2de07c7bbd 100644 --- a/addons/common/functions/fnc_worldToScreenBounds.sqf +++ b/addons/common/functions/fnc_worldToScreenBounds.sqf @@ -1,53 +1,76 @@ -// (c) zGuba 2011 -// Function helper for framing objects on screen. -// Input: [_object,_margins3D,_offset3D] (object, 3 * float array, 3 * float array) -// Output: [_minX,_minY,_minY,_maxY] (4 * float) - +/* + * Author: zGuba 2011 + * + * Function helper for framing objects on screen. + * + * Arguments: + * 0: object + * 1: margins 3D + * 0: X + * 1: Y + * 2: Z + * 2: offset 3D + * 0: X + * 1: Y + * 2: Z + * + * Return Value: + * 0: Minimal X + * 1: Minimal Y + * 2: Maximal X + * 3: Maximal Y + * + * Public: No + */ #include "script_component.hpp" -private ["_minX","_minY","_maxX","_maxY", "_bounds", "_boundsCorners", "_boundsMax", "_boundsMaxX", "_boundsMaxY", "_boundsMaxZ", "_boundsMin", "_boundsMinX", "_boundsMinY", "_boundsMinZ"]; +params ["_object", "_margins", "_offsets"]; -PARAMS_3(_object,_margins,_offsets); +private ["_minX", "_minY", "_maxX", "_maxY", "_bounds", "_boundsCorners"]; _minX = 10; _minY = 10; _maxX = -10; _maxY = -10; -if (true) then { - _bounds = boundingBox _object; +_bounds = boundingBox _object; +_margins params ["_marginsX", "_marginsY", "_marginsZ"]; +_offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"]; - _boundsMin = _bounds select 0; - _boundsMinX = (_boundsMin select 0) - (_margins select 0) + (_offsets select 0); - _boundsMinY = (_boundsMin select 1) - (_margins select 1) + (_offsets select 1); - _boundsMinZ = (_boundsMin select 2) - (_margins select 2) + (_offsets select 2); - _boundsMax = _bounds select 1; - _boundsMaxX = (_boundsMax select 0) + (_margins select 0) + (_offsets select 0); - _boundsMaxY = (_boundsMax select 1) + (_margins select 1) + (_offsets select 1); - _boundsMaxZ = (_boundsMax select 2) + (_margins select 2) + (_offsets select 2); +_bounds params ["_boundsMin", "_boundsMax"]; +_boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"]; +_boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"]; - _boundsCorners = [ - [_boundsMinX,_boundsMinY,_boundsMinZ], - [_boundsMinX,_boundsMinY,_boundsMaxZ], - [_boundsMinX,_boundsMaxY,_boundsMinZ], - [_boundsMinX,_boundsMaxY,_boundsMaxZ], - [_boundsMaxX,_boundsMinY,_boundsMinZ], - [_boundsMaxX,_boundsMinY,_boundsMaxZ], - [_boundsMaxX,_boundsMaxY,_boundsMinZ], - [_boundsMaxX,_boundsMaxY,_boundsMaxZ] - ]; +_boundsMinX = _boundsMinX - _marginsX + _offsetsX; +_boundsMinY = _boundsMinY - _marginsY + _offsetsY; +_boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ; +_boundsMaxX = _boundsMaxX + _marginsX + _offsetsX; +_boundsMaxY = _boundsMaxY + _marginsY + _offsetsY; +_boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ; - { - _ppos = worldToScreen (_object modelToWorld _x); - if (count _ppos >= 2) then { - EXPLODE_2_PVT(_ppos,_pposX,_pposY); - if (_pposX < _minX) then {_minX = _pposX}; - if (_pposX > _maxX) then {_maxX = _pposX}; - if (_pposY < _minY) then {_minY = _pposY}; - if (_pposY > _maxY) then {_maxY = _pposY}; - }; //else - what to do if it is offscreen? - } forEach _boundsCorners; -}; +_boundsCorners = [ + [_boundsMinX,_boundsMinY,_boundsMinZ], + [_boundsMinX,_boundsMinY,_boundsMaxZ], + [_boundsMinX,_boundsMaxY,_boundsMinZ], + [_boundsMinX,_boundsMaxY,_boundsMaxZ], + [_boundsMaxX,_boundsMinY,_boundsMinZ], + [_boundsMaxX,_boundsMinY,_boundsMaxZ], + [_boundsMaxX,_boundsMaxY,_boundsMinZ], + [_boundsMaxX,_boundsMaxY,_boundsMaxZ] +]; + +{ + private "_ppos"; + _ppos = worldToScreen (_object modelToWorld _x); + if (count _ppos >= 2) then { + _ppos params ["_pposX", "_pposY"]; + if (_pposX < _minX) then {_minX = _pposX}; + if (_pposX > _maxX) then {_maxX = _pposX}; + if (_pposY < _minY) then {_minY = _pposY}; + if (_pposY > _maxY) then {_maxY = _pposY}; + }; //else - what to do if it is offscreen? + false +} count _boundsCorners; [_minX,_minY,_maxX,_maxY] diff --git a/addons/common/functions/script_component.hpp b/addons/common/functions/script_component.hpp index 95b7e86461..c213544655 100644 --- a/addons/common/functions/script_component.hpp +++ b/addons/common/functions/script_component.hpp @@ -10,4 +10,4 @@ if((count _this) > c) then {\ _callFrom = _this select c;\ _lineNo = _this select c+1;\ - }; \ No newline at end of file + }; From 5fc127e94c85602410dc1d7f233b27e6339df0fb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 17 Sep 2015 11:34:32 -0500 Subject: [PATCH 063/311] #2491 - fix params --- addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index 818640ca07..9024489a3b 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" private "_reviveStartTime"; -param ["_caller","_target"]; +params ["_caller","_target"]; if (_target getvariable [QGVAR(inReviveState), false]) then { _reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0]; From c5eb6e00708f6e7e54f506f3358c8efcc25e2bf0 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 18 Sep 2015 04:12:18 +0200 Subject: [PATCH 064/311] posible fix for #2495 --- addons/vehiclelock/functions/fnc_lockpick.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index f4837c742b..5c0e04ee0b 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -43,7 +43,7 @@ if (_vehLockpickStrenth < 0) exitWith {false}; //Condition check for progressBar _condition = { params ["_args"]; - _args params ["_args", "_unit", "_veh"]; + _args params ["_unit", "_veh"]; ((_unit distance _veh) < 5) && {(speed _veh) < 0.1} }; From 475c1930603cf446f9cfe296e1cdf0866b8c689d Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 07:42:10 +0200 Subject: [PATCH 065/311] common code cleanup part 2 --- .../common/functions/fnc__handleNetEvent.sqf | 39 ++++++++++++------- .../fnc__handleRequestAllSyncedEvents.sqf | 27 ++++++------- .../fnc__handleRequestSyncedEvent.sqf | 39 ++++++++++--------- .../functions/fnc__handleSyncedEvent.sqf | 28 +++++++------ 4 files changed, 74 insertions(+), 59 deletions(-) diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index 3f5f0d0fb4..a516d93fdd 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -1,20 +1,29 @@ -//fnc__handleNetEvent.sqf -// internal handler for net events +/* + * Author: jaynus + * Internal net event handler. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged", "_events"]; -//IGNORE_PRIVATE_WARNING("_handleNetEvent"); - - -PARAMS_2(_eventType,_event); +params ["_eventType", "_event"]; if (_eventType == "ACEg") then { - _eventName = _event select 0; - _eventArgs = _event select 1; + _event params ["_eventName", "_eventArgs"]; + + private ["_eventNames", "_eventIndex"]; _eventNames = GVAR(events) select 0; _eventIndex = _eventNames find _eventName; + if (_eventIndex != -1) then { + private "_events"; _events = (GVAR(events) select 1) select _eventIndex; #ifdef DEBUG_EVENTS @@ -35,9 +44,9 @@ if (_eventType == "ACEg") then { if (_eventType == "ACEc") then { if (isServer) then { - _eventName = _event select 0; - _eventTargets = _event select 1; - _eventArgs = _event select 2; + _event params ["_eventName", "_eventTargets", "_eventArgs"]; + + private ["_sentEvents", "_owner", "_serverFlagged"]; _sentEvents = []; if (!IS_ARRAY(_eventTargets)) then { @@ -46,15 +55,15 @@ if (_eventType == "ACEc") then { //If not multiplayer, and there are targets, then just run localy if ((!isMultiplayer) && {(count _eventTargets) > 0}) exitWith { - ACEg = [_eventName, _eventArgs]; - ["ACEg", ACEg] call FUNC(_handleNetEvent); + ACEg = [_eventName, _eventArgs]; + ["ACEg", ACEg] call FUNC(_handleNetEvent); }; _serverFlagged = false; { _owner = _x; if (IS_OBJECT(_x)) then { - _owner = owner _x; + _owner = owner _x; }; if (!(_owner in _sentEvents)) then { PUSH(_sentEvents, _owner); diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf index 7c566ce4d1..fbaeb60e4f 100644 --- a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -1,25 +1,26 @@ /* * Author: jaynus - * * Handles a server-side request for synchronization ALL events on JIP to a client. * - * Argument: - * 0: client (object) - * - * Return value: - * Boolean of success + * Arguments: + * 0: client + * + * Return Value: + * Event is successed + * + * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_client); + +params ["_client"]; { - private["_eventName", "_eventEntry", "_eventLog"]; - _eventName = _x; - _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); + private ["_eventEntry", "_eventLog"]; + + _eventEntry = HASH_GET(GVAR(syncedEvents),_x); _eventLog = _eventEntry select 1; - ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); + ["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent); } forEach (GVAR(syncedEvents) select 0); -true \ No newline at end of file +true diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index b93347b8d8..96cd7a51f5 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -1,47 +1,48 @@ /* * Author: jaynus - * * Receives either requests for synchronization from clients, or the synchronization data from the server. * * Arguments [Client] : - * 0: eventName (String) - * 1: eventLog (Array) + * 0: eventName + * 1: eventLog * * Arguments [Server] : - * 0: eventName (String) - * 1: client (Object) + * 0: eventName + * 1: client * - * Return value: - * Boolean of success + * Return Value: + * Event is successed + * + * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_handleSyncedEvent"); - //SEH_s -if(isServer) then { +if (isServer) then { // Find the event name, and shovel out the events to the client - PARAMS_2(_eventName,_client); - private["_eventEntry", "_eventLog"]; + params ["_eventName", "_client"]; - if(!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith { + if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith { ACE_LOGERROR("Request for synced event - key not found."); false }; + + private ["_eventEntry", "_eventLog"]; + _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); _eventLog = _eventEntry select 1; - ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); + ["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent); } else { - PARAMS_2(_eventName,_eventLog); - private ["_eventArgs"]; + params ["_eventName", "_eventLog"]; + // This is the client handling the response from the server // Start running the events { - _eventArgs = _x select 1; - [_eventName, _eventArgs, (_x select 2)] call FUNC(_handleSyncedEvent); + _x params ["", "_eventArgs","_ttl"]; + [_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent); } forEach _eventLog; + ACE_LOGINFO_1("[%1] synchronized",_eventName); }; diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index aaa6fbdaff..3ea516513f 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -1,32 +1,36 @@ /* * Author: jaynus - * * Handles synced events being received. Server will log them, and server/client will execute them. * * Arguments [Client] : - * 0: eventName (String) - * 1: arguments (Array) - * 2: ttl (Scalar) + * 0: eventName + * 1: arguments + * 2: ttl * - * Return value: - * Boolean of success + * Return Value: + * Boolean of success + * + * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_3(_name,_args,_ttl); -private["_internalData", "_eventLog", "_eventCode"]; -if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +params ["_name", "_args", "_ttl"]; + +if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { ACE_LOGERROR("Synced event key not found."); false }; +private ["_internalData", "_eventCode"]; + _internalData = HASH_GET(GVAR(syncedEvents),_name); -if(isServer) then { +if (isServer) then { // Server needs to internally log it for synchronization - if(_ttl > -1) then { + if (_ttl > -1) then { _internalData = HASH_GET(GVAR(syncedEvents),_name); + + private "_eventLog"; _eventLog = _internalData select 1; _eventLog pushback [ACE_diagTime, _args, _ttl]; }; From df2c7dce783f80a566fa7d41c4cbf1dbf7529a61 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 07:53:36 +0200 Subject: [PATCH 066/311] replace old pushback macro --- addons/common/functions/fnc__handleNetEvent.sqf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index a516d93fdd..90cf95ac77 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -54,7 +54,7 @@ if (_eventType == "ACEc") then { }; //If not multiplayer, and there are targets, then just run localy - if ((!isMultiplayer) && {(count _eventTargets) > 0}) exitWith { + if (!isMultiplayer && {count _eventTargets > 0}) exitWith { ACEg = [_eventName, _eventArgs]; ["ACEg", ACEg] call FUNC(_handleNetEvent); }; @@ -65,9 +65,10 @@ if (_eventType == "ACEc") then { if (IS_OBJECT(_x)) then { _owner = owner _x; }; - if (!(_owner in _sentEvents)) then { - PUSH(_sentEvents, _owner); + if !(_owner in _sentEvents) then { + _sentEvents pushBack _owner; ACEg = [_eventName, _eventArgs]; + if (isDedicated || {_x != ACE_player}) then { if (isDedicated && {local _x} && {!_serverFlagged}) then { _serverFlagged = true; From fc82018c49dcf14cfa07c15aef302966498c084c Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 08:23:18 +0200 Subject: [PATCH 067/311] more common cleanup --- .../functions/fnc_addActionEventHandler.sqf | 73 ++++++++----------- .../fnc_addActionMenuEventHandler.sqf | 59 ++++++++------- .../fnc_addCanInteractWithCondition.sqf | 24 +++--- .../fnc_addCuratorUnloadEventhandler.sqf | 16 +++- 4 files changed, 83 insertions(+), 89 deletions(-) diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf index 29b058487b..d9946207f8 100644 --- a/addons/common/functions/fnc_addActionEventHandler.sqf +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -1,73 +1,64 @@ /* * Author: commy2 - * * Add an addAction event to a unit. Used to handle multiple addAction events. Global arguments, local effects. Does only work for player controlled units. * - * Argument: - * 0: Unit the action should be assigned to (Object) - * 1: Name of the action, e.g. "DefaultAction" (String) - * 2: Condition (Code or String) - * 3: Code to execute (Code or String) + * Arguments: + * 0: Unit the action should be assigned to + * 1: Name of the action, e.g. "DefaultAction" + * 2: Condition + * 3: Code to execute * - * Return value: - * ID of the action (used to remove it later). + * Return Value: + * ID of the action (used to remove it later) */ #include "script_component.hpp" -private ["_unit", "_action", "_condition", "_statement", "_name", "_actionsVar", "_actionID", "_actions", "_id", "_actionIDs"]; -//IGNORE_PRIVATE_WARNING("_count", "_index", "_return", "_target"); - -_unit = _this select 0; -_action = _this select 1; -_condition = _this select 2; -_statement = _this select 3; +params ["_unit", "_action", "_condition", "_statement"]; if (typeName _condition == "STRING") then { - _condition = compile _condition; + _condition = compile _condition; }; if (typeName _statement == "STRING") then { - _statement = compile _statement; + _statement = compile _statement; }; -_name = format ["ACE_Action_%1", _action]; +private ["_name", "_actionsVar"]; +_name = format ["ACE_Action_%1", _action]; _actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; if (_unit != _actionsVar select 2) then { // check if the unit is still valid, fixes respawn issues - _actionsVar = [-1, [-1, [], []], objNull]; + _actionsVar = [-1, [-1, [], []], objNull]; }; -_actionID = _actionsVar select 0; -_actions = _actionsVar select 1; +_actionsVar params ["_actionID", "_actionsArray"]; +_actionsArray params ["_id", "_actionIDs", "_actions"]; -_id = (_actions select 0) + 1; -_actionIDs = _actions select 1; -_actions = _actions select 2; +_id = _id + 1; _actionIDs pushBack _id; _actions pushBack [_condition, _statement]; // first action to add, unit needs addAction command if (_actionID == -1) then { - private "_addAction"; + private "_addAction"; + _addAction = call compile format [ + "[ + '', + {if (inputAction '%1' == 0) exitWith {}; {if (_this call (_x select 0)) then {_this call (_x select 1)}} forEach (((_this select 0) getVariable '%2') select 1 select 2)}, + nil, + -1, + false, + true, + '%1', + ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; _actions = (_this getVariable '%2') select 1 select 2; _count = count _actions; _index = 0; _return = false; while {_index < _count && {!_return}} do {_return = [_target, _this] call ((_actions select _index) select 0); _index = _index + 1}; _return"" + ]", + _action, + _name + ]; - _addAction = call compile format [ - "[ - '', - {if (inputAction '%1' == 0) exitWith {}; {if (_this call (_x select 0)) then {_this call (_x select 1)}} forEach (((_this select 0) getVariable '%2') select 1 select 2)}, - nil, - -1, - false, - true, - '%1', - ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; _actions = (_this getVariable '%2') select 1 select 2; _count = count _actions; _index = 0; _return = false; while {_index < _count && {!_return}} do {_return = [_target, _this] call ((_actions select _index) select 0); _index = _index + 1}; _return"" - ]", - _action, - _name - ]; - - _actionID = _unit addAction _addAction; + _actionID = _unit addAction _addAction; }; _unit setVariable [_name, [_actionID, [_id, _actionIDs, _actions], _unit], false]; diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf index 268cc18d5a..9c7a63fb86 100644 --- a/addons/common/functions/fnc_addActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -1,29 +1,25 @@ /* * Author: commy2 - * * Add an addAction event to a unit. Used to handle multiple addAction events and add a action to the mouse wheel menu. Global arguments, local effects. Does only work for player controlled units. * - * Argument: - * 0: Unit the action should be assigned to (Object) - * 1: Menu title of the action (String) - * 2: Name of the action, e.g. "DefaultAction" (String) - * 3: Condition (Code or String) - * 4: Code to execute by the action (Code or String) - * 5: Condition for the menu action (Code or String) - * 6: Code to execute from the menu (Code or String) - * 7: Priority of the action (Number, optional default: 0) + * Arguments: + * 0: Unit the action should be assigned to + * 1: Menu title of the action + * 2: Name of the action, e.g. "DefaultAction" + * 3: Condition + * 4: Code to execute by the action + * 5: Condition for the menu action + * 6: Code to execute from the menu + * 7: Priority of the action (default: 0) * - * Return value: - * ID of the action (used to remove it later). + * Return Value: + * ID of the action (used to remove it later) + * + * Public: No */ #include "script_component.hpp" -private ["_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; -//IGNORE_PRIVATE_WARNING("_target"); - -PARAMS_8(_unit,_displayName,_action,_condition,_statement,_condition2,_statement2,_priority); - -if (isNil "_priority") then {_priority = 0}; +params ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", ["_priority", 0]]; if (typeName _condition == "STRING") then { _condition = compile _condition; @@ -41,13 +37,16 @@ if (typeName _statement2 == "STRING") then { _statement2 = compile _statement2; }; -_name = format ["ACE_ActionMenu_%1", _action]; +private ["_name", "_actionsVar"]; +_name = format ["ACE_ActionMenu_%1", _action]; _actionsVar = _unit getVariable [_name, [-1, [], []]]; -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; +_actionsVar params ["_id", "_actionIDs", "_actions"]; + +_id = _id + 1; + +private ["_nameVar", "_addAction", "_actionID"]; _nameVar = format ["%1_ID%2", _name, _id]; missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _statement2]]; @@ -56,14 +55,14 @@ _actionIDs pushBack _id; _addAction = call compile format [ "[ - '%2', - {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, - nil, - %4, - false, - true, - '%1', - ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" + '%2', + {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, + nil, + %4, + false, + true, + '%1', + ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" ]", _action, _displayName, diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 10ea084858..11213accd6 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -1,31 +1,25 @@ /* * Author: commy2 - * * Add a condition that gets checked by ace_common_fnc_canInteractWith. * * Arguments: - * 0: The conditions id. Used to remove later or as exception name. An already existing name overwrites. (String) - * 1: The condition to check. format of "_this" is "[_player, _target]". (Code) + * 0: The conditions id. Used to remove later or as exception name. An already existing name overwrites. + * 1: The condition to check. format of "_this" is "[_player, _target]". * * Return Value: - * Unit can interact? + * None * + * Public: No */ #include "script_component.hpp" -private ["_conditionName", "_conditionFunc"]; -//IGNORE_PRIVATE_WARNING("_player", "_target"); +params ["_conditionName", "_conditionFunc"]; +_conditionName = toLower _conditionName; -_conditionName = toLower (_this select 0); -_conditionFunc = _this select 1; - -private ["_conditions", "_conditionNames", "_conditionFuncs"]; - +private "_conditions"; _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; - -_conditionNames = _conditions select 0; -_conditionFuncs = _conditions select 1; +_conditions params ["_conditionNames", "_conditionFuncs"]; private "_index"; _index = _conditionNames find _conditionName; @@ -37,4 +31,4 @@ if (_index == -1) then { _conditionNames set [_index, _conditionName]; _conditionFuncs set [_index, _conditionFunc]; -GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs]; +GVAR(InteractionConditions) = _conditions; diff --git a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf index 4623bb4ddb..95cce02e41 100644 --- a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf +++ b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf @@ -1,9 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * Arguments: + * Display where the Unload event was added + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private "_dlg"; - disableSerialization; + +private "_dlg"; _dlg = ctrlParent _this; _dlg displayAddEventHandler ["unload", { From e833c3fc42ff3d4498d54cdd0cb3898952e5375e Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 08:47:14 +0200 Subject: [PATCH 068/311] more common cleanup --- .../common/functions/fnc_addEventHandler.sqf | 29 ++++++++++--------- .../functions/fnc_addLineToDebugDraw.sqf | 14 ++++----- .../fnc_addMapMarkerCreatedEventHandler.sqf | 22 +++++++------- .../fnc_addScrollWheelEventHandler.sqf | 25 ++++++++-------- 4 files changed, 46 insertions(+), 44 deletions(-) diff --git a/addons/common/functions/fnc_addEventHandler.sqf b/addons/common/functions/fnc_addEventHandler.sqf index 86e034a0d9..599e937918 100644 --- a/addons/common/functions/fnc_addEventHandler.sqf +++ b/addons/common/functions/fnc_addEventHandler.sqf @@ -1,33 +1,34 @@ /* * Author: Nou + * Add an event handler. * - * Add a event handler. + * Arguments: + * 0: Event name + * 1: Event code * - * Argument: - * 0: Event name (string) - * 1: Event code (code) + * Return Value: + * Event handler ID number (for use with fnc_removeEventHandler) * - * Return value: - * Event handler ID number (for use with fnc_removeEventHandler) + * Public: Yes */ #include "script_component.hpp" -private ["_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"]; +params ["_eventName", "_eventCode"]; -PARAMS_2(_eventName,_eventCode); +private ["_eventNames", "_eventFunctions", "_eventIndex"]; _eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; + if (_eventIndex != -1) then { _eventFunctions = (GVAR(events) select 1) select _eventIndex; } else { + private "_eventNameCount"; _eventNameCount = count _eventNames; - _eventNames set[_eventNameCount, _eventName]; - (GVAR(events) select 1) set[_eventNameCount, _eventFunctions]; + + _eventNames set [_eventNameCount, _eventName]; + (GVAR(events) select 1) set [_eventNameCount, _eventFunctions]; }; -_eventFunctionCount = count _eventFunctions; -_eventFunctions set [_eventFunctionCount, _eventCode]; - -_eventFunctionCount; \ No newline at end of file +_eventFunctions pushBack _eventCode // Return event function count diff --git a/addons/common/functions/fnc_addLineToDebugDraw.sqf b/addons/common/functions/fnc_addLineToDebugDraw.sqf index 4b8b235811..f0a643e922 100644 --- a/addons/common/functions/fnc_addLineToDebugDraw.sqf +++ b/addons/common/functions/fnc_addLineToDebugDraw.sqf @@ -1,15 +1,15 @@ /* * Author: esteldunedain - * * Add line to draw on debug * - * Argument: - * 0: Start point ASL (Array) - * 1: End point ASL (Array) - * 2: Color (Array) + * Arguments: + * 0: Start point ASL + * 1: End point ASL + * 2: Color * - * Return value: + * None * + * Public: No */ #include "script_component.hpp" @@ -45,4 +45,4 @@ if (isNil QGVAR(debugDrawHandler)) then { drawLine3D [_p0, _p1, _x select 2]; } forEach GVAR(debugLines); }]; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf index c3975be496..1e060f056a 100644 --- a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf @@ -1,29 +1,29 @@ /* * Author: commy2 - * * Add a map marker creation event handler. * - * Argument: - * 0: Code to execute (Code or String) + * Arguments: + * 0: Code to execute * - * Return value: - * ID of the event script (used to remove it later). + * Return Value: + * ID of the event script (used to remove it later). + * + * Public: Yes */ #include "script_component.hpp" -private ["_actionsVar", "_id", "_actionIDs", "_actions"]; - -PARAMS_1(_statement); +params ["_statement"]; if (typeName _statement == "STRING") then { _statement = compile _statement; }; +private "_actionsVar"; _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; +_actionsVar params ["_id", "_actionIDs", "_actions"]; + +_id = _id + 1; if (_id == 0) then { uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers]; diff --git a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf index d079b4b17e..ef60270695 100644 --- a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf @@ -1,29 +1,30 @@ /* * Author: commy2 + * Add an event handler that executes every ACE_time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. + * _this will be [Interval] where 'Interval' is a number. * - * Add an event handler that executes every ACE_time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. Argument will be [Interval] where 'Interval' is a number. + * Arguments: + * 0: Code to execute * - * Argument: - * 0: Code to execute (Code or String) + * Return Value: + * ID of the event script (used to remove it later). * - * Return value: - * ID of the event script (used to remove it later). + * Public: Yes */ #include "script_component.hpp" -private ["_actionsVar", "_id", "_actionIDs", "_actions"]; - -PARAMS_1(_statement); +params ["_statement"]; if (typeName _statement == "STRING") then { - _statement = compile _statement; + _statement = compile _statement; }; +private "_actionsVar"; _actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; +_actionsVar params ["_id", "_actionIDs", "_actions"]; + +_id = _id + 1; _actionIDs pushBack _id; _actions pushBack _statement; From 3a027ff26ff7f267531bb3dacf16aa392f96a3ea Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 09:38:19 +0200 Subject: [PATCH 069/311] more common cleanup --- addons/common/functions/fnc_addSetting.sqf | 7 +- .../functions/fnc_addSyncedEventHandler.sqf | 33 ++-- .../common/functions/fnc_addToInventory.sqf | 186 +++++++++++------- .../functions/fnc_ambientBrightness.sqf | 12 +- .../functions/fnc_applyForceWalkStatus.sqf | 32 ++- .../common/functions/fnc_binarizeNumber.sqf | 21 +- addons/common/functions/fnc_blurScreen.sqf | 34 ++-- 7 files changed, 185 insertions(+), 140 deletions(-) diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf index 42299e6458..06162de6b1 100644 --- a/addons/common/functions/fnc_addSetting.sqf +++ b/addons/common/functions/fnc_addSetting.sqf @@ -11,7 +11,7 @@ * 4: localizedDescription * 5: possibleValues * 6: isForced - * 7: defaultValue (Any) + * 7: defaultValue * * Return Value: * None @@ -20,10 +20,9 @@ */ #include "script_component.hpp" -PARAMS_8(_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); - -private ["_settingData"]; +params ["_name", "", "", "", "", "", "", "_value"]; //["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_isForced", "_value"]; +private "_settingData"; _settingData = [_name] call FUNC(getSettingData); // Exit if the setting already exists diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index 7225a45e59..801a915dc5 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -1,34 +1,29 @@ /* * Author: jaynus - * * Register an event handler for an ACE synced event * - * Argument: - * 0: Name (String) - * 1: Handler (Code) - * 2: TTL (Number or Code) [Optional] + * Arguments: + * 0: Name + * 1: Handler + * 2: TTL (optional: 0) * - * Return value: - * Boolean of success + * Return Value: + * Boolean of success + * + * Public: Yes */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_handleSyncedEvent"); -PARAMS_2(_name,_handler); +params ["_name", "_handler", ["_ttl", 0]]; -private["_ttl", "_eventId", "_data"]; -if( (count _this) > 2) then { - _ttl = _this select 2; -} else { - _ttl = 0; -}; - -if(HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { ACE_LOGERROR("Duplicate synced event creation."); false }; +private ["_eventId", "_data"]; + _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); -_data = [_handler,[],_ttl,_eventId]; +_data = [_handler, [], _ttl, _eventId]; + HASH_SET(GVAR(syncedEvents),_name,_data); diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 05fc2ca48f..4019de93ac 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -1,95 +1,141 @@ /* * Author: Garth 'L-H' de Wet - * Adds an item,weapon,magazine to the unit's inventory - * or places it in a weaponHolder if no space. + * Adds an item, weapon, or magazine to the unit's inventory or places it in a weaponHolder if no space. * * Arguments: * 0: Unit * 1: Classname - * 2: Container (uniform, vest, backpack) - * 3: Magazine Ammo Count + * 2: Container (uniform, vest, backpack) (default: "") + * 3: Magazine Ammo Count (default: -1) * * Return Value: - * Array: - * 0: Added to player (Bool) - * 1: weaponholder (OBJECT) + * 0: Added to player + * 1: weaponholder * * Public: Yes */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_unit,_classname); -DEFAULT_PARAM(2,_container,""); -DEFAULT_PARAM(3,_ammoCount,-1); +params ["_unit", "_classname", ["_container", ""], ["_ammoCount", -1]]; -private ["_addedToPlayer", "_canAdd", "_type", "_pos"]; +private ["_type", "_canAdd", "_addedToUnit"]; -_canAdd = false; -_addedToPlayer = true; - -_type = [_classname] call EFUNC(common,getItemType); +_type = [_classname] call FUNC(getItemType); switch (_container) do { - case "vest": { _canAdd = _unit canAddItemToVest _classname; }; - case "backpack": { _canAdd = _unit canAddItemToBackpack _classname; }; - case "uniform": { _canAdd = _unit canAddItemToUniform _classname; }; - default {_canAdd = _unit canAdd _classname;}; -}; - -switch ((_type select 0)) do { - case "weapon": { - if (_canAdd) then { - switch (_container) do { - case "vest": { (vestContainer _unit) addWeaponCargoGlobal [_classname, 1]; }; - case "backpack": { (backpackContainer _unit) addWeaponCargoGlobal [_classname, 1]; }; - case "uniform": { (uniformContainer _unit) addWeaponCargoGlobal [_classname, 1]; }; - default { _unit addWeaponGlobal _classname; }; - }; - } else { - _addedToPlayer = false; - _pos = _unit modelToWorldVisual [0,1,0.05]; - _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; - _unit addWeaponCargoGlobal [_classname,1]; - _unit setPosATL _pos; - }; + case "vest": { + _canAdd = _unit canAddItemToVest _classname; }; - case "magazine": { - if (_ammoCount == -1) then {_ammoCount = getNumber (configFile >> "CfgMagazines" >> _classname >> "count");}; - if (_canAdd) then { - switch (_container) do { - case "vest": { (vestContainer _unit) addMagazineCargoGlobal [_classname, _ammoCount]; }; - case "backpack": { (backpackContainer _unit) addMagazineCargoGlobal [_classname, _ammoCount]; }; - case "uniform": { (uniformContainer _unit) addMagazineCargoGlobal [_classname, _ammoCount]; }; - default {_unit addMagazine [_classname, _ammoCount]; }; - }; - } else { - _addedToPlayer = false; - _pos = _unit modelToWorldVisual [0,1,0.05]; - _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; - _unit addMagazineCargoGlobal [_classname, _ammoCount]; - _unit setPosATL _pos; - }; + case "backpack": { + _canAdd = _unit canAddItemToBackpack _classname; }; - case "item": { - if (_canAdd) then { - switch (_container) do { - case "vest": { _unit addItemToVest _classname; }; - case "backpack": { _unit addItemToBackpack _classname; }; - case "uniform": { _unit addItemToUniform _classname; }; - default { _unit addItem _classname; }; - }; - } else { - _addedToPlayer = false; - _pos = _unit modelToWorldVisual [0,1,0.05]; - _unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"]; - _unit addItemCargoGlobal [_classname,1]; - _unit setPosATL _pos; - }; + case "uniform": { + _canAdd = _unit canAddItemToUniform _classname; }; default { + _canAdd = _unit canAdd _classname; + }; +}; + +switch (_type select 0) do { + case "weapon": { + if (_canAdd) then { + _addedToUnit = true; + + switch (_container) do { + case "vest": { + (vestContainer _unit) addWeaponCargoGlobal [_classname, 1]; + }; + case "backpack": { + (backpackContainer _unit) addWeaponCargoGlobal [_classname, 1]; + }; + case "uniform": { + (uniformContainer _unit) addWeaponCargoGlobal [_classname, 1]; + }; + default { + _unit addWeaponGlobal _classname; + }; + }; + } else { + _addedToUnit = false; + + private "_pos"; + _pos = _unit modelToWorldVisual [0,1,0.05]; + + _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; + _unit addWeaponCargoGlobal [_classname, 1]; + _unit setPosATL _pos; + }; + }; + + case "magazine": { + if (_ammoCount == -1) then { + _ammoCount = getNumber (configFile >> "CfgMagazines" >> _classname >> "count"); + }; + + if (_canAdd) then { + _addedToUnit = true; + + switch (_container) do { + case "vest": { + (vestContainer _unit) addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command. + }; + case "backpack": { + (backpackContainer _unit) addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command. + }; + case "uniform": { + (uniformContainer _unit) addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command. + }; + default { + _unit addMagazine [_classname, _ammoCount]; + }; + }; + } else { + _addedToUnit = false; + + private "_pos"; + _pos = _unit modelToWorldVisual [0,1,0.05]; + + _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; + _unit addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command. + _unit setPosATL _pos; + }; + }; + + case "item": { + if (_canAdd) then { + _addedToUnit = true; + + switch (_container) do { + case "vest": { + _unit addItemToVest _classname; + }; + case "backpack": { + _unit addItemToBackpack _classname; + }; + case "uniform": { + _unit addItemToUniform _classname; + }; + default { + _unit addItem _classname; + }; + }; + } else { + _addedToUnit = false; + + private "_pos"; + _pos = _unit modelToWorldVisual [0,1,0.05]; + + _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; + _unit addItemCargoGlobal [_classname, 1]; + _unit setPosATL _pos; + }; + }; + + default { + _addedToUnit = false; ACE_LOGWARNING_2("Incorrect item type passed to %1, passed: %2",QFUNC(AddToInventory),_type); }; }; -[_addedToPlayer,_unit] +[_addedToUnit, _unit] diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf index 172739247f..86aef99b0c 100644 --- a/addons/common/functions/fnc_ambientBrightness.sqf +++ b/addons/common/functions/fnc_ambientBrightness.sqf @@ -3,12 +3,14 @@ * * Returns a brightness value depending on the sun and moon state. Ranges from 0 to 1 (dark ... bright). * - * Argument: - * None. + * Arguments: + * None * - * Return value: - * Ambient brightness (Number) + * Return Value: + * Ambient brightness + * + * Public: Yes */ #include "script_component.hpp" -(sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5) * (1 - overcast)) min 1 +(sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity / 5) * (1 - overcast)) min 1 diff --git a/addons/common/functions/fnc_applyForceWalkStatus.sqf b/addons/common/functions/fnc_applyForceWalkStatus.sqf index 2e1c36db4a..82fbd9da3a 100644 --- a/addons/common/functions/fnc_applyForceWalkStatus.sqf +++ b/addons/common/functions/fnc_applyForceWalkStatus.sqf @@ -1,25 +1,23 @@ /* -Name: FUNC(applyForceWalkStatus) - -Author: Pabst Mirror - -Description: - Applys the forceWalk status of an unit. Called from Extended_InitPost_EventHandlers. - -Parameters: - 0: OBJECT - Unit - -Returns: - None - -Example: - [ACE_Player] call FUNC(applyForceWalkStatus) + * Author: Pabst Mirror + * Applys the forceWalk status of an unit. Called from Extended_InitPost_EventHandlers. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [ACE_Player] call FUNC(applyForceWalkStatus) + * + * Public: No */ #include "script_component.hpp" -private ["_forceWalkNumber"]; +params ["_unit"]; -PARAMS_1(_unit); +private "_forceWalkNumber"; _forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; _unit forceWalk (_forceWalkNumber > 0); diff --git a/addons/common/functions/fnc_binarizeNumber.sqf b/addons/common/functions/fnc_binarizeNumber.sqf index 0bf968b7ee..aff2f9dc17 100644 --- a/addons/common/functions/fnc_binarizeNumber.sqf +++ b/addons/common/functions/fnc_binarizeNumber.sqf @@ -1,23 +1,23 @@ /* * Author: commy2 - * * Get a binary equivalent of a decimal number. * - * Argument: - * 0: Decimal Number (Number) - * 1: Minimum length of the returned Array, note: returned array can be larger (Number, optional default 8) + * Arguments: + * 0: Decimal Number + * 1: Minimum length of the returned Array, note: returned array can be larger (default: 8) * - * Return value: - * Booleans (Array) + * Return Value: + * Booleans + * + * Public: Yes */ #include "script_component.hpp" -private ["_number", "_minLength", "_array", "_index", "_rest"]; +params ["_number", ["_minLength", 8]]; -_number = round (_this select 0); -_minLength = _this select 1; +_number = round _number; -if (isNil "_minLength") then {_minLength = 8}; +private ["_array", "_index", "_rest"]; _array = []; _array resize _minLength; @@ -35,4 +35,5 @@ while {_number > 0} do { _array set [_index, _rest == 1]; _index = _index + 1; }; + _array diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index e62cebc173..8136d1476c 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -1,30 +1,33 @@ -/** - * fn_gui_blurScreen.sqf - * @Descr: - * @Author: Glowbal +/* + * Author: Glowbal * - * @Arguments: [] - * @Return: - * @PublicAPI: true + * Arguments: + * 0: ID + * 1: Show? + * + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" if (!hasInterface) exitWith {}; -private ["_show"]; -PARAMS_1(_id); -_show = if (count _this > 1) then {_this select 1} else {false}; +params ["_id", ["_show", false]]; + +if (typeName _show == "SCALAR") then { + _show = _show == 1; +}; if (isNil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; }; -if (typeName _show == typeName 0) then { - _show = (_show == 1); -}; if (_show) then { - GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id; + GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushBack _id; + // show blur if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; @@ -34,9 +37,10 @@ if (_show) then { }; } else { GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id]; + if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then { // hide blur - if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + if (!isNil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN); GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil; }; From b0704e486ff05885b2580a7b05c0c37165b2d883 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 13:09:40 +0200 Subject: [PATCH 070/311] more common cleanup --- addons/common/functions/fnc_cachedCall.sqf | 26 +++++------ .../common/functions/fnc_canGetInPosition.sqf | 26 +++++------ addons/common/functions/fnc_canInteract.sqf | 23 ++++++---- .../common/functions/fnc_canInteractWith.sqf | 25 +++-------- addons/common/functions/fnc_canUseWeapon.sqf | 21 ++++++--- .../fnc_changeProjectileDirection.sqf | 29 +++++------- addons/common/functions/fnc_checkFiles.sqf | 28 +++++++----- addons/common/functions/fnc_checkPBOs.sqf | 45 +++++++++---------- addons/common/functions/fnc_claim.sqf | 13 +++--- 9 files changed, 113 insertions(+), 123 deletions(-) diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index e093f44393..e1e0e16118 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -1,5 +1,5 @@ /* - * Author: esteldunedain and Jaynus + * Author: esteldunedain, Jaynus * Returns the result of the function and caches it up to a given ACE_time or event * * Arguments: @@ -8,7 +8,7 @@ * 2: Namespace to store the cache on * 3: Cache uid * 4: Max duration of the cache - * 5: Event that clears the cache (Optional) + * 5: Event that clears the cache (default: nil) * * Return Value: * Result of the function @@ -17,33 +17,31 @@ */ #include "script_component.hpp" -PARAMS_5(_params,_function,_namespace,_uid,_duration); +params ["_params", "_function", "_namespace", "_uid", "_duration", "_event"]; -//IGNORE_PRIVATE_WARNING("_eventName"); - -if (((_namespace getVariable [_uid, [-99999]]) select 0) < ACE_diagTime) then { +if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then { _namespace setVariable [_uid, [ACE_diagTime + _duration, _params call _function]]; // Does the cache needs to be cleared on an event? - if (count _this > 5) then { - private ["_event","_varName","_cacheList"]; - _event = _this select 5; - _varName = format [QGVAR(clearCache_%1),_event]; + if (!isNil "_event") then { + private ["_varName", "_cacheList"]; + + _varName = format [QGVAR(clearCache_%1), _event]; _cacheList = missionNamespace getVariable _varName; // If there was no EH to clear these caches, add one - if (isNil {_cacheList}) then { + if (isNil "_cacheList") then { _cacheList = []; missionNamespace setVariable [_varName, _cacheList]; [_event, { - private ["_varName","_cacheList"]; + private ["_varName", "_cacheList"]; // _eventName is defined on the function that calls the event #ifdef DEBUG_MODE_FULL ACE_LOGINFO_1("Clear cached variables on event: %1",_eventName); #endif // Get the list of caches to clear - _varName = format [QGVAR(clearCache_%1),_eventName]; + _varName = format [QGVAR(clearCache_%1), _eventName]; _cacheList = missionNamespace getVariable [_varName, []]; // Erase all the cached results { @@ -57,11 +55,13 @@ if (((_namespace getVariable [_uid, [-99999]]) select 0) < ACE_diagTime) then { // Add this cache to the list of the event _cacheList pushBack [_namespace, _uid]; }; + #ifdef DEBUG_MODE_FULL ACE_LOGINFO_2("Calculated result: %1 %2",_namespace,_uid); } else { ACE_LOGINFO_2("Cached result: %1 %2",_namespace,_uid); #endif + }; (_namespace getVariable _uid) select 1 diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index 2c84f11b4d..1ea1eeb5a6 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -4,32 +4,26 @@ * Is the unit able to enter the vehicle in the given position? * * Arguments: - * 0: Unit to enter the vehicle (Object) - * 1: The vehicle to be entered (Object) - * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" (String) - * 3: Check current distance to vehicles memory point? (Bool, optional default: false) + * 0: Unit to enter the vehicle + * 1: The vehicle to be entered + * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" + * 3: Check current distance to vehicles memory point? (default: false) * 4: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. - * Note: This index is diffrent from Armas "cargoIndex". (Number, optional default: next free index) + * Note: This index is diffrent from Armas "cargoIndex". (default: next free index) * * Return Value: - * Nothing + * None + * + * Public: No */ #include "script_component.hpp" #define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} #define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} -private ["_position", "_checkDistance", "_index"]; +params ["_unit", "_vehicle", "_position", ["_checkDistance",false], ["_index",-1]]; -_this resize 5; - -PARAMS_2(_unit,_vehicle); -_position = toLower (_this select 2); -_checkDistance = _this select 3; -_index = _this select 4; // optional, please don't use - -if (isNil "_checkDistance") then {_checkDistance = false}; -if (isNil "_index") then {_index = -1}; +_position = toLower _position; // general if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; diff --git a/addons/common/functions/fnc_canInteract.sqf b/addons/common/functions/fnc_canInteract.sqf index 4b3e22f646..d2ae7e1ffb 100644 --- a/addons/common/functions/fnc_canInteract.sqf +++ b/addons/common/functions/fnc_canInteract.sqf @@ -1,14 +1,19 @@ -/** - * fn_canInteract.sqf - * @Descr: Check if unit can interact with enviroment. Unit has to be awake and not be in arrested state. - * @Author: Glowbal +/* + * Author: Glowbal + * Check if unit can interact with enviroment. Unit has to be awake and not be in arrested state. * - * @Arguments: [unit OBJECT] - * @Return: BOOL True if unit can interact with enviroment. - * @PublicAPI: true + * Arguments: + * 0: Unit that try to Interact + * + * Return Value: + * Can interact with enviroment + * + * Public: No + * + * Deprecated */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -(((_unit getvariable [QGVAR(canInteract),0]) < 1) && ([_unit] call FUNC(isAwake)) && !([_unit] call FUNC(isArrested))) \ No newline at end of file +(_unit getvariable [QGVAR(canInteract),0]) < 1 && [_unit] call FUNC(isAwake) && !([_unit] call FUNC(isArrested)) diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 1a6e766855..2fa0ca26e0 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -5,45 +5,34 @@ * Arguments: * 0: The player. * 1: The interaction target. objNull to ignore. - * 2: Exceptions. What general conditions are to skip? (Optional) + * 2: Exceptions. What general conditions are to skip? (default: []) * * Return Value: * Unit can interact? * - * Public: No + * Public: Yes */ #include "script_component.hpp" -private ["_exceptions"]; +params ["_unit", "_target", ["_exceptions", []]]; -PARAMS_2(_unit,_target); - -_exceptions = if (count _this > 2) then { - _this select 2; -} else { - []; -}; +private ["_exceptions", "_owner"]; _exceptions = [_exceptions, {toLower _this}] call FUNC(map); -// exit if the target is not free to interact -private "_owner"; _owner = _target getVariable [QGVAR(owner), objNull]; +// exit if the target is not free to interact if (!isNull _owner && {_unit != _owner}) exitWith {false}; // check general conditions - -private ["_conditions", "_conditionNames", "_conditionFuncs"]; +private ["_conditions", "_canInteract"]; _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditionNames = _conditions select 0; -_conditionFuncs = _conditions select 1; +_conditions params ["_conditionNames", "_conditionFuncs"]; -private "_canInteract"; _canInteract = true; - { if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { _canInteract = false; diff --git a/addons/common/functions/fnc_canUseWeapon.sqf b/addons/common/functions/fnc_canUseWeapon.sqf index ed478a4470..31aaba17a2 100644 --- a/addons/common/functions/fnc_canUseWeapon.sqf +++ b/addons/common/functions/fnc_canUseWeapon.sqf @@ -1,14 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Check if the unit can use a Weapon. + * Returns true if the unit is on foot or in a FFV position. + * + * Arguments: + * 0: The Unit + * + * Return Value: + * Can the Unit use Weapons + * + * Public: Yes + */ #include "script_component.hpp" -// returns true if the unit is on foot or in a ffv position - -private ["_config"]; - -PARAMS_1(_unit); +params ["_unit"]; if (_unit == vehicle _unit) exitWith {true}; +private "_config"; _config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit; isClass _config diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index 5a65ccff41..e8e71291d0 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -1,30 +1,25 @@ /* * Author: commy2 - * * Adjust a projectiles velocity and dir + up vector. * - * Argument: - * 0: Projectile (Object, CfgAmmo) - * 1: Adjust azimuth this much. (Number) - * 2: Adjust inclination this much. (Number) - * 3: Adjust projectile speed this much. In m/s. (Number, optional default: 0 m/s) + * Arguments: + * 0: Projectile + * 1: Adjust azimuth this much. + * 2: Adjust inclination this much. + * 3: Adjust projectile speed this much. In m/s. (optional: 0) * - * Return value: - * None. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_adjustSpeed", "_vdir", "_dir", "_up", "_vup", "_vel", "_vlat"]; +params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]]; -PARAMS_3(_projectile,_adjustDir,_adjustUp); +//["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log); -_adjustSpeed = if (count _this > 3) then { - _this select 3 -} else { - 0 -}; - -["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log); +private ["_vdir", "_dir", "_up", "_vlat", "_vup", "_vel"]; // get old direction vector _vdir = vectorNormalized velocity _projectile; diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index e80d18e5b1..2c8976f042 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -1,13 +1,14 @@ /* * Author: commy2 - * * Compares version numbers of PBOs and DLLs. * - * Argument: - * None. + * Arguments: + * None * - * Return value: - * None. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" @@ -36,13 +37,17 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); }; }; -} forEach _addons; + false +} count _addons; /////////////// // check dlls /////////////// { - if (_x callExtension "version" == "") then { + private "_versionEx"; + _versionEx = _x callExtension "version"; + + if (_versionEx == "") then { private "_errorMsg"; _errorMsg = format ["Extension %1.dll not installed.", _x]; @@ -53,9 +58,10 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); }; } else { // Print the current extension version - ACE_LOGINFO_2("Extension version: %1: %2",_x,(_x callExtension "version")); + ACE_LOGINFO_2("Extension version: %1: %2",_x,_versionEx); }; -} forEach getArray (configFile >> "ACE_Extensions" >> "extensions"); + false +} count getArray (configFile >> "ACE_Extensions" >> "extensions"); /////////////// // check server version/addons @@ -75,9 +81,7 @@ if (isMultiplayer) then { [{ if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith {}; - private ["_version","_addons"]; - _version = (_this select 0) select 0; - _addons = (_this select 0) select 1; + (_this select 0) params ["_version", "_addons"]; if (_version != GVAR(ServerVersion)) then { private "_errorMsg"; diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index d1441ffd83..4c923899a1 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -5,22 +5,20 @@ * * Arguments: * 0: Mode - * 0: Warn once - * 1: Warn permanently - * 2: Kick - * 1: Check all PBOs? (Optional - default: false) - * 2: Whitelist (Optinal - default: "[]") + * 0 = Warn once + * 1 = Warn permanently + * 2 = Kick + * 1: Check all PBOs? (default: false) + * 2: Whitelist (default: "[]") * - * Return value: + * Return Value: * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_mode", "_checkAll", "_whitelist"]; - -_mode = _this select 0; -_checkAll = if (count _this > 1) then {_this select 1} else {false}; -_whitelist = if (count _this > 2) then {_this select 2} else {"[]"}; +params ["_mode", ["_checkAll", false], ["_whitelist", "[]"]]; _whitelist = [_whitelist, {toLower _this}] call FUNC(map); @@ -30,22 +28,17 @@ ACE_Version_Whitelist = _whitelist; if (!_checkAll) exitWith {}; //ACE is checked by FUNC(checkFiles) if (!isServer) then { - [_mode, _checkAll, _whitelist] spawn { - private ["_missingAddon", "_missingAddonServer", "_oldVersionClient", "_oldVersionServer", "_text", "_error", "_rscLayer", "_ctrlHint"]; - PARAMS_3(_mode,_checkAll,_whitelist); + [{ + if (isNil "ACE_Version_ClientErrors") exitWith {}; - waitUntil { - sleep 1; - !isNil "ACE_Version_ClientErrors" - }; + ACE_Version_ClientErrors params ["_missingAddon", "_missingAddonServer", "_oldVersionClient", "_oldVersionServer"]; - _missingAddon = ACE_Version_ClientErrors select 0; - _missingAddonServer = ACE_Version_ClientErrors select 1; - _oldVersionClient = ACE_Version_ClientErrors select 2; - _oldVersionServer = ACE_Version_ClientErrors select 3; + (_this select 0) params ["_mode", "_checkAll", "_whitelist"]; // Display error message. if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { + private ["_text", "_error"]; + _text = "[ACE] Version mismatch:

"; _error = format ["ACE version mismatch: %1: ", profileName]; @@ -72,6 +65,8 @@ if (!isServer) then { if (_mode < 2) then { _text = composeText [lineBreak, parseText format ["%1", _text]]; + private ["_rscLayer", "_ctrlHint"]; + _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer; _rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true]; @@ -91,9 +86,11 @@ if (!isServer) then { ["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); }; }; - }; + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }, 1, [_mode, _checkAll, _whitelist]] call CBA_fnc_addPerFrameHandler; }; if (_checkAll) then { - 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); + 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); // @todo }; diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index 5c8014ee5f..9a5b373fa5 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -1,22 +1,19 @@ /* * Author: commy2 - * * Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc. * * Arguments: - * 0: Unit that claims another object. ObjNull to remove claim. (Object) - * 1: The object that gets claimed. (Object) - * 2: Lock the claimed object aswell? (Bool) + * 0: Unit that claims another object. ObjNull to remove claim. + * 1: The object that gets claimed. + * 2: Lock the claimed object aswell? (optional: false) * * Return Value: - * NONE + * None * */ #include "script_component.hpp" -PARAMS_3(_unit,_target,_lockTarget); - -if (isNil "_lockTarget") then {_lockTarget = false}; +params ["_unit", "_target", ["_lockTarget", false]]; private "_owner"; _owner = _target getVariable [QGVAR(owner), objNull]; From f83dea6e0145dced32992faebe7f9e6acb435eba Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 14:32:58 +0200 Subject: [PATCH 071/311] formatting, remove an obsolete private --- addons/common/functions/fnc_canGetInPosition.sqf | 2 +- addons/common/functions/fnc_canInteractWith.sqf | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index 1ea1eeb5a6..40724569d0 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -21,7 +21,7 @@ #define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} #define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} -params ["_unit", "_vehicle", "_position", ["_checkDistance",false], ["_index",-1]]; +params ["_unit", "_vehicle", "_position", ["_checkDistance", false], ["_index", -1]]; _position = toLower _position; diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 2fa0ca26e0..31ebf6b89f 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -16,10 +16,9 @@ params ["_unit", "_target", ["_exceptions", []]]; -private ["_exceptions", "_owner"]; - _exceptions = [_exceptions, {toLower _this}] call FUNC(map); +private "_owner"; _owner = _target getVariable [QGVAR(owner), objNull]; // exit if the target is not free to interact From 7efcfcc8a02933841a1fa9ca99988749793d3ee4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 15:40:51 +0200 Subject: [PATCH 072/311] more common cleanup --- addons/common/XEH_preInit.sqf | 1 - .../fnc_closeDialogIfTargetMoves.sqf | 49 --------------- addons/common/functions/fnc_codeToLetter.sqf | 13 +++- addons/common/functions/fnc_codeToString.sqf | 17 +++--- .../common/functions/fnc_convertKeyCode.sqf | 27 +++++---- .../fnc_createOrthonormalReference.sqf | 14 +++-- .../common/functions/fnc_currentChannel.sqf | 10 ++-- addons/common/functions/fnc_debug.sqf | 59 ++++++++----------- addons/common/functions/fnc_debugModule.sqf | 18 +++--- .../common/functions/fnc_defineVariable.sqf | 46 +++++++-------- .../functions/fnc_deviceKeyFindValidIndex.sqf | 18 +++--- .../functions/fnc_deviceKeyRegisterNew.sqf | 7 ++- addons/common/functions/fnc_disableAI.sqf | 13 ++-- 13 files changed, 130 insertions(+), 162 deletions(-) delete mode 100644 addons/common/functions/fnc_closeDialogIfTargetMoves.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 56e3062cd2..2f5c18998b 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -26,7 +26,6 @@ PREP(changeProjectileDirection); PREP(checkFiles); PREP(checkPBOs); PREP(claim); -PREP(closeDialogIfTargetMoves); PREP(codeToLetter); PREP(codeToString); PREP(convertKeyCode); diff --git a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf deleted file mode 100644 index db60180bd1..0000000000 --- a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Author: commy2 - * - * Closes the current dialog if the target moves, changes vehicle etc. - * - * Arguments: - * 0: Target unit - * 1: Ignore the unit being dead? (Optional, default: No) - * - * Return Value: - * None - */ -#include "script_component.hpp" - -_this spawn { - PARAMS_2(_target,_ignoreDead); - private["_inVehicle", "_position", "_vehiclePlayer", "_vehicleTarget"]; - - if (isNil "_ignoreDead") then {_ignoreDead = false}; - - _vehicleTarget = vehicle _target; - _vehiclePlayer = vehicle ACE_player; - _inVehicle = _target != _vehicleTarget; - - _position = getPosASL _target; - - _fnc_check = { - // either unit changed vehicles - if (_vehiclePlayer != vehicle ACE_player) exitWith {True}; - if (_vehicleTarget != vehicle _target) exitWith {True}; - - // target died - if (!alive _target && {!_ignoreDead}) exitWith {True}; - - // player fell unconscious - if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True}; - - // target moved (outside of vehicle) - (!_inVehicle && {getPosASL _target distanceSqr _position > 1}) - }; - - waitUntil { - if (call _fnc_check) then { - closeDialog 0; - call EFUNC(interaction,hideMenu); - }; - (isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open - }; -}; diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf index 8e8a9c8a3e..ccb105ef0b 100644 --- a/addons/common/functions/fnc_codeToLetter.sqf +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -1,4 +1,15 @@ -// by commy2 +/* + * Author: commy2 + * Converts some keys to an Arma Dik Code. + * + * Arguments: + * 0: Key + * + * Return Value: + * Dik Code + * + * Public: Yes + */ #include "script_component.hpp" ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_codeToString.sqf b/addons/common/functions/fnc_codeToString.sqf index 1698182051..9347a55b20 100644 --- a/addons/common/functions/fnc_codeToString.sqf +++ b/addons/common/functions/fnc_codeToString.sqf @@ -1,22 +1,23 @@ /* * Author: commy2 - * * Removes the brackets around a code and returns the code as a string. It does nothing if the code is already a string. * * Argument: - * 0: Code (Code or String) + * 0: Code * * Return value: - * Code (String) + * Code + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_function); +params ["_function"]; if (typeName _function == "STRING") exitWith {_function}; _function = toArray str _function; -_function set [0, -1]; -_function set [count _function - 1, -1]; -_function = toString (_function - [-1]); -_function +_function deleteAt 0; +_function deleteAt (count _function - 1); + +toString _function // return diff --git a/addons/common/functions/fnc_convertKeyCode.sqf b/addons/common/functions/fnc_convertKeyCode.sqf index 498a3eb706..3bf6314bef 100644 --- a/addons/common/functions/fnc_convertKeyCode.sqf +++ b/addons/common/functions/fnc_convertKeyCode.sqf @@ -1,27 +1,30 @@ /* * Author: commy2 + * Get a key code used in AGM key input eh. * - * Get a key code used in ACE key input eh. + * Arguments: + * 0: Arma DIK code + * 1: Key state for shift left and shift right key + * 2: Key state for ctrl left and ctrl right key + * 3: Key state for alt and alt gr key * - * Argument: - * 0: Arma DIK code (Number) - * 1: Key state for shift left and shift right key (Bool) - * 2: Key state for ctrl left and ctrl right key (Bool) - * 3: Key state for alt and alt gr key (Bool) + * Return Value: + * Key code * - * Return value: - * Key code (Number) + * Public: Yes + * + * Deprecated */ #include "script_component.hpp" #define KEY_MODIFIERS [42, 54, 29, 157, 56, 184] -PARAMS_1(_key); +params ["_key", "_stateShift", "_stateCtrl", "_stateAlt"]; if (_key in KEY_MODIFIERS) exitWith {_key}; -if (_this select 1) then {_key = _key + 0.1}; -if (_this select 2) then {_key = _key + 0.2}; -if (_this select 3) then {_key = _key + 0.4}; +if (_stateShift) then {_key = _key + 0.1}; +if (_stateCtrl) then {_key = _key + 0.2}; +if (_stateAlt) then {_key = _key + 0.4}; _key diff --git a/addons/common/functions/fnc_createOrthonormalReference.sqf b/addons/common/functions/fnc_createOrthonormalReference.sqf index 346127c658..3e8fb7fb1d 100644 --- a/addons/common/functions/fnc_createOrthonormalReference.sqf +++ b/addons/common/functions/fnc_createOrthonormalReference.sqf @@ -1,19 +1,21 @@ /* * Author: esteldunedain - * * Returns a orthonormal system of reference aligned with the supplied vector * * Argument: * Vector to align the coordinate system with (Array) * - * Return value: - * 0: v1 (Array) - * 1: v2 (Array) - * 2: v3 (Array) + * Return Value: + * 0: Vector Normalized + * 1: Normalized Cross Product Vector + * 2: Vector Cross Product + * + * Public: Yes */ #include "script_component.hpp" -private ["_v1","_v2","_v3"]; +private ["_v1", "_v2", "_v3"]; + _v1 = vectorNormalized _this; _v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); _v3 = _v2 vectorCrossProduct _v1; diff --git a/addons/common/functions/fnc_currentChannel.sqf b/addons/common/functions/fnc_currentChannel.sqf index 127f3b7a54..52aed1f4ce 100644 --- a/addons/common/functions/fnc_currentChannel.sqf +++ b/addons/common/functions/fnc_currentChannel.sqf @@ -3,11 +3,13 @@ * * Returns the current radio / chat / marker channel. * - * Argument: - * NONE. + * Arguments: + * None * - * Return value: - * The current channel. Can be "group", "side", "global", "command", "vehicle", "direct" or "custom_X" (String) + * Return Value: + * The current channel ("group", "side", "global", "command", "vehicle", "direct", "custom_X") + * + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index df770c6e25..49e067f77d 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -1,51 +1,43 @@ -/** - * fn_debug.sqf - * @Descr: Print logging messages through the ACE framework. - * @Author: Glowbal +/* + * Author: Glowbal + * Print logging messages through the ACE framework. * - * @Arguments: [message ANY, level NUMBER (Optional)] - * @Return: BOOL True if message has been printed - * @PublicAPI: true + * Arguments: + * 0: Message + * 1: Level (default: 2) + * + * Return Value: + * Message is Printed + * + * Public: Yes */ #include "script_component.hpp" #define DEFAULT_LOGGING_LEVEL -1 #define DEFAULT_TEXT_DISPLAY -1 -private ["_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message"]; -PARAMS_1(_msg); -_level = if (count _this > 1) then {_this select 1} else { 2 }; +params ["_msg", ["_level", 2, [0]]]; -if (typeName _level != "NUMBER") then { - _level = 2; -}; +private ["_defaultLoglevel", "_defaultLogDisplayLevel"]; -_defaultLoglevel = if (isNil QGVAR(LOGLEVEL)) then { - DEFAULT_LOGGING_LEVEL; -} else { - GVAR(LOGLEVEL); -}; +_defaultLoglevel = [GVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL] select isNil QGVAR(LOGLEVEL); -if (_defaultLoglevel < 0) exitwith { - false -}; +if (_defaultLoglevel < 0) exitwith {false}; -_defaultLogDisplayLevel = if (isnil QGVAR(LOGDISPLAY_LEVEL)) then { - DEFAULT_TEXT_DISPLAY; -} else { - GVAR(LOGDISPLAY_LEVEL); -}; +_defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL); if (_level <= _defaultLoglevel) then { + private ["_prefix", "_message"]; - _prefix = switch (_level) do { - case 0: { "ACE Error" }; - case 1: { "ACE Warn" }; - case 2: { "ACE Debug" }; - case 3: { "ACE Info" }; - default { "ACE Unknown" }; + switch (_level) do { + case 0: {_prefix = "Error"}; + case 1: {_prefix = "Warn"}; + case 2: {_prefix = "Debug"}; + case 3: {_prefix = "Info"}; + default {_prefix = "Unknown"}; }; - _message = format["[%1] %2",_prefix,_msg]; + + _message = format ["[ACE %1] %2", _prefix, _msg]; if (_level <= _defaultLogDisplayLevel) then { systemChat _message; @@ -55,4 +47,5 @@ if (_level <= _defaultLoglevel) then { // pass it onwards to the log function: // [0, [], compile format["%1",_msg], true] call FUNC(log); }; + true diff --git a/addons/common/functions/fnc_debugModule.sqf b/addons/common/functions/fnc_debugModule.sqf index 262ae9c02d..d313244e52 100644 --- a/addons/common/functions/fnc_debugModule.sqf +++ b/addons/common/functions/fnc_debugModule.sqf @@ -1,16 +1,18 @@ -/** - * fn_debugModule.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -PARAMS_1(_entity); +params ["_entity"]; GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getvariable ["logDisplayLevel","4"]); GVAR(LOGLEVEL) = call compile (_entity getvariable ["logLevel","4"]); diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 28ed5b2015..f64c20ba61 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -1,38 +1,34 @@ -/** - * fn_defineVariable.sqf - * @Descr: Define a variable for the ACE variable framework - * @Author: Glowbal +/* + * Author: Glowbal + * Define a variable for the ACE variable framework * - * @Arguments: [name STRING, defaultValue ANY, publicFlag BOOL, category STRING, type NUMBER, persistentFlag BOOL] - * @Return: - * @PublicAPI: true + * Arguments: + * 0: Name + * 1: defaultValue + * 2: publicFlag + * 3: category + * 4: type (default: 0) + * 5: persistentFlag (default: false) + * + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_code","_persistent"]; +params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persistent", false]]; -PARAMS_4(_name,_value,_defaultGlobal,_catagory); +if (isNil "_defaultGlobal") exitWith {}; -_code = 0; -_persistent = false; - -if (count _this < 3) exitwith {}; -if (count _this > 4) then { - _code = _this select 4; - if (count _this > 5) then { - _persistent = _this select 5; - }; -}; - -if (typeName _name != typeName "") exitwith { +if (typeName _name != "STRING") exitwith { [format["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); }; -if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) then { +if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) then { GVAR(OBJECT_VARIABLES_STORAGE) = []; }; -GVAR(OBJECT_VARIABLES_STORAGE) pushback [_name,_value,_defaultGlobal,_catagory,_code, _persistent]; - -missionNamespace setvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + _name, [_name,_value,_defaultGlobal,_catagory,_code, _persistent]]; +GVAR(OBJECT_VARIABLES_STORAGE) pushBack [_name, _value, _defaultGlobal, _category, _code, _persistent]; +missionNamespace setVariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + _name, [_name, _value, _defaultGlobal, _category, _code, _persistent]]; diff --git a/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf index a8418cd4cd..681ab946e0 100644 --- a/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf +++ b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf @@ -3,7 +3,7 @@ * Finds next valid index for the device array. * * Arguments: - * 0: Offset from currentIndex (use 1 to find next valid after current) or a displayName string or + * 0: Offset from currentIndex (use 1 to find next valid after current) or a displayName string (default: 0) * * Return Value: * The new index (-1 if no valid) @@ -16,23 +16,25 @@ */ #include "script_component.hpp" -DEFAULT_PARAM(0,_searchOffsetOrName,0); +params [["_searchOffsetOrName", 0]]; -private ["_validIndex", "_offsetBy", "_realIndex", "_offset"]; +private ["_validIndex", "_realIndex"]; _validIndex = -1; -if ((typeName _searchOffsetOrName) == "STRING") then { +if (typeName _searchOffsetOrName == "STRING") then { { - if ((_x select 0) == _searchOffsetOrName) exitWith { + if (_x select 0 == _searchOffsetOrName) exitWith { _validIndex = _forEachIndex; }; } forEach GVAR(deviceKeyHandlingArray); } else { - if ((count GVAR(deviceKeyHandlingArray)) > 0) then { - _baseIndex = if (GVAR(deviceKeyCurrentIndex) == -1) then {0} else {GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName}; - for "_offset" from _baseIndex to ((count GVAR(deviceKeyHandlingArray)) - 1 + _baseIndex) do { + if (count GVAR(deviceKeyHandlingArray) > 0) then { + _baseIndex = [GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName, 0] select (GVAR(deviceKeyCurrentIndex) == -1); + + for "_offset" from _baseIndex to (count GVAR(deviceKeyHandlingArray) - 1 + _baseIndex) do { _realIndex = _offset % (count GVAR(deviceKeyHandlingArray)); + if ([] call ((GVAR(deviceKeyHandlingArray) select _realIndex) select 2)) exitWith { _validIndex = _realIndex; }; diff --git a/addons/common/functions/fnc_deviceKeyRegisterNew.sqf b/addons/common/functions/fnc_deviceKeyRegisterNew.sqf index 88ffa84af7..416eef2c77 100644 --- a/addons/common/functions/fnc_deviceKeyRegisterNew.sqf +++ b/addons/common/functions/fnc_deviceKeyRegisterNew.sqf @@ -10,7 +10,7 @@ * 4: Close Code (on ctrl-home press) * * Return Value: - * Nothing + * None * * Example: * [(localize "STR_ACE_microdagr_itemName"), QUOTE(PATHTOF(images\microDAGR_item.paa)), _conditionCode, _toggleCode, _closeCode] call ace_common_fnc_deviceKeyRegisterNew @@ -19,7 +19,8 @@ */ #include "script_component.hpp" -PARAMS_5(_displayName,_iconImage,_conditionCode,_toggleCode,_closeCode); +params ["_displayName", "_iconImage", "_conditionCode", "_toggleCode", "_closeCode"]; + +GVAR(deviceKeyHandlingArray) pushBack [_displayName, _iconImage, _conditionCode, _toggleCode, _closeCode]; -GVAR(deviceKeyHandlingArray) pushBack [_displayName,_iconImage,_conditionCode,_toggleCode,_closeCode]; [] call FUNC(deviceKeyFindValidIndex); diff --git a/addons/common/functions/fnc_disableAI.sqf b/addons/common/functions/fnc_disableAI.sqf index 0e1985eced..1a66628ffb 100644 --- a/addons/common/functions/fnc_disableAI.sqf +++ b/addons/common/functions/fnc_disableAI.sqf @@ -10,15 +10,17 @@ * None * * Example: - * [bob, true] call ace_common_fnc_disableAI; + * [bob, true] call ace_common_fnc_disableAI * * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_disable); +params ["_unit", "_disable"]; -if ((local _unit) && {!([_unit] call EFUNC(common,isPlayer))}) then { +if (!local _unit) exitWith {}; + +if !([_unit] call EFUNC(common,isPlayer)) then { if (_disable) then { _unit disableAI "MOVE"; _unit disableAI "TARGET"; @@ -27,7 +29,10 @@ if ((local _unit) && {!([_unit] call EFUNC(common,isPlayer))}) then { _unit disableConversation true; } else { //Sanity check to make sure we don't enable unconsious AI - if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith {ERROR("Enabling AI for unconsious unit");}; + if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith { + ERROR("Enabling AI for unconsious unit"); + }; + _unit enableAI "MOVE"; _unit enableAI "TARGET"; _unit enableAI "AUTOTARGET"; From c0fdd80ba43e6e5860c0bc60b01806500b8883aa Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 16:00:58 +0200 Subject: [PATCH 073/311] formating --- addons/common/functions/fnc_defineVariable.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index f64c20ba61..6ea15adc43 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -22,7 +22,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi if (isNil "_defaultGlobal") exitWith {}; if (typeName _name != "STRING") exitwith { - [format["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); + [format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); }; if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) then { From 39786420faa92c4269c6eb738a9198a05885416b Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 16:33:53 +0200 Subject: [PATCH 074/311] more common cleanup --- .../common/functions/fnc_hadamardProduct.sqf | 16 +++--- addons/common/functions/fnc_headBugFix.sqf | 53 +++++++++++-------- addons/common/functions/fnc_hideUnit.sqf | 9 ++-- .../common/functions/fnc_inTransitionAnim.sqf | 13 ++++- 4 files changed, 54 insertions(+), 37 deletions(-) diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf index b063b35313..b4ed7f9be1 100644 --- a/addons/common/functions/fnc_hadamardProduct.sqf +++ b/addons/common/functions/fnc_hadamardProduct.sqf @@ -1,25 +1,25 @@ /* * Author: KoffeinFlummi - * * Returns the Hadamard Product of two vectors. * (x hadamard y) = [x1*y1, x2*y2, x3*y3] * * Arguments: - * 0: Vector 1 - * 1: Vector 2 + * 0: Vector 1 + * 1: Vector 2 * * Return Value: - * Hadamard Product + * Hadamard Product + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_vector1,_vector2); - -private ["_newVector", "_i"]; +params ["_vector1", "_vector2"]; +private "_newVector"; _newVector = []; -for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do { +for "_i" from 0 to ((count _vector1 min count _vector2) - 1) do { _newVector pushBack ((_vector1 select _i) * (_vector2 select _i)); }; diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index fe9354f632..0c02b9397a 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -1,42 +1,49 @@ -/** - * fnc_headbugfix.sqf - * @Descr: Fixes animation issues that may get you stuck - * @Author: rocko +/* + * Author: rocko + * Fixes animation issues that may get you stuck * - * @Arguments: - * @Return: nil - * @PublicAPI: true + * Arguments: + * None + * + * Return Value: + * None + * + * Public: Yes + * + * Note: Has to be spawned not called */ - #include "script_component.hpp" -private ["_pos","_dir","_anim"]; -_anim = animationState ACE_player; +private ["_unit", "_anim", "_pos", "_dir", "_dummy"]; + +_unit = ACE_player; +_anim = animationState _unit; + ["HeadbugFixUsed", [profileName, _anim]] call FUNC(serverEvent); ["HeadbugFixUsed", [profileName, _anim]] call FUNC(localEvent); -if (ACE_player != vehicle ACE_player || { !([ACE_player, objNull, ["isNotSitting"]] call FUNC(canInteractWith)) } ) exitWith {false}; +if (_unit != vehicle _unit || {!([_unit, objNull, ["isNotSitting"]] call FUNC(canInteractWith))}) exitWith {false}; -_pos = getposATL ACE_player; -_dir = getDir ACE_player; +_pos = getPosATL _unit; +_dir = getDir _unit; titleCut ["", "BLACK"]; -[ACE_Player, "headBugFix"] call FUNC(hideUnit); +[_unit, "headBugFix"] call FUNC(hideUnit); // create invisible headbug fix vehicle -_ACE_HeadbugFix = "ACE_Headbug_Fix" createVehicleLocal _pos; -_ACE_HeadbugFix setDir _dir; -ACE_player moveInAny _ACE_HeadbugFix; +_dummy = createVehicle ["ACE_Headbug_Fix", _pos, [], 0, "NONE"]; +_dummy setDir _dir; +_unit moveInAny _dummy; sleep 0.1; -unassignVehicle ACE_player; -ACE_player action ["Eject", vehicle ACE_player]; -ACE_player setDir _dir; -ACE_player setposATL _pos; +unassignVehicle _unit; +_unit action ["Eject", vehicle _unit]; +_unit setDir _dir; +_unit setPosATL _pos; sleep 1.0; -deleteVehicle _ACE_HeadbugFix; +deleteVehicle _dummy; -[ACE_Player, "headBugFix"] call FUNC(unhideUnit); +[_unit, "headBugFix"] call FUNC(unhideUnit); titleCut ["", "PLAIN"]; true diff --git a/addons/common/functions/fnc_hideUnit.sqf b/addons/common/functions/fnc_hideUnit.sqf index 94857335f4..7fdd901848 100644 --- a/addons/common/functions/fnc_hideUnit.sqf +++ b/addons/common/functions/fnc_hideUnit.sqf @@ -14,10 +14,9 @@ * * Public: No */ - #include "script_component.hpp" -PARAMS_2(_unit,_reason); +params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; @@ -29,6 +28,6 @@ if !(_reason in _setHiddenReasons) then { _unit setVariable [QGVAR(setHiddenReasons), _setHiddenReasons, true]; }; -//if !(isObjectHidden _unit) then { (Uncomment when isObjectHidden hits stable branch) - ["hideObjectGlobal",[_unit,true]] call FUNC(serverEvent); -//}; +if !(isObjectHidden _unit) then { + ["hideObjectGlobal", [_unit, true]] call FUNC(serverEvent); +}; diff --git a/addons/common/functions/fnc_inTransitionAnim.sqf b/addons/common/functions/fnc_inTransitionAnim.sqf index 4ce16aebf9..34c6c04fd8 100644 --- a/addons/common/functions/fnc_inTransitionAnim.sqf +++ b/addons/common/functions/fnc_inTransitionAnim.sqf @@ -1,4 +1,15 @@ -// by commy2 +/* + * Author: commy2 + * Check if given unit is in a transitional animation + * + * Arguments: + * 0: A soldier + * + * Return Value: + * + * + * Public: Yes + */ #include "script_component.hpp" getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "looped") == 0 From a8ba96a01b6db14548981fd8627127d75aaa8eac Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 16:41:00 +0200 Subject: [PATCH 075/311] more common code cleanup --- addons/common/functions/fnc_codeToString.sqf | 2 +- addons/common/functions/fnc_createOrthonormalReference.sqf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_codeToString.sqf b/addons/common/functions/fnc_codeToString.sqf index 9347a55b20..4a1b158f21 100644 --- a/addons/common/functions/fnc_codeToString.sqf +++ b/addons/common/functions/fnc_codeToString.sqf @@ -2,7 +2,7 @@ * Author: commy2 * Removes the brackets around a code and returns the code as a string. It does nothing if the code is already a string. * - * Argument: + * Arguments: * 0: Code * * Return value: diff --git a/addons/common/functions/fnc_createOrthonormalReference.sqf b/addons/common/functions/fnc_createOrthonormalReference.sqf index 3e8fb7fb1d..4a8db8bba1 100644 --- a/addons/common/functions/fnc_createOrthonormalReference.sqf +++ b/addons/common/functions/fnc_createOrthonormalReference.sqf @@ -2,8 +2,8 @@ * Author: esteldunedain * Returns a orthonormal system of reference aligned with the supplied vector * - * Argument: - * Vector to align the coordinate system with (Array) + * Arguments: + * Vector to align the coordinate system with * * Return Value: * 0: Vector Normalized From 1b96caedc05604ff7d05aabf2695411b7a145775 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 18:28:19 +0200 Subject: [PATCH 076/311] more common code cleanup --- addons/common/XEH_preInit.sqf | 5 -- addons/common/functions/fnc_inWater.sqf | 32 +++++---- addons/common/functions/fnc_isAlive.sqf | 5 +- addons/common/functions/fnc_isArrested.sqf | 13 ---- addons/common/functions/fnc_loadPerson.sqf | 50 +++++++------ .../common/functions/fnc_loadPersonLocal.sqf | 72 ++++++++++--------- .../functions/fnc_loadSettingsFromProfile.sqf | 18 +++-- .../functions/fnc_loadSettingsOnServer.sqf | 21 +++--- addons/common/functions/fnc_localEvent.sqf | 26 ++++--- addons/common/functions/fnc_log.sqf | 25 ------- addons/common/functions/fnc_logControls.sqf | 4 -- addons/common/functions/fnc_logDisplays.sqf | 4 -- addons/common/functions/fnc_logModEntries.sqf | 18 ----- 13 files changed, 127 insertions(+), 166 deletions(-) delete mode 100644 addons/common/functions/fnc_isArrested.sqf delete mode 100644 addons/common/functions/fnc_log.sqf delete mode 100644 addons/common/functions/fnc_logControls.sqf delete mode 100644 addons/common/functions/fnc_logDisplays.sqf delete mode 100644 addons/common/functions/fnc_logModEntries.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 2f5c18998b..ad3101b04f 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -114,7 +114,6 @@ PREP(interpolateFromArray); PREP(inTransitionAnim); PREP(inWater); PREP(isAlive); -PREP(isArrested); PREP(isAutoWind); PREP(isAwake); PREP(isEngineer); @@ -235,10 +234,6 @@ PREP(getTurretsOther); PREP(exportConfig); PREP(getChildren); PREP(getDisplayConfigName); -PREP(log); -PREP(logControls); -PREP(logDisplays); -PREP(logModEntries); PREP(monitor); PREP(showUser); diff --git a/addons/common/functions/fnc_inWater.sqf b/addons/common/functions/fnc_inWater.sqf index f6f491535f..7c8e2eee21 100644 --- a/addons/common/functions/fnc_inWater.sqf +++ b/addons/common/functions/fnc_inWater.sqf @@ -1,25 +1,29 @@ -/** - * fn_inWater_f.sqf - * @Descr: Check if unit is underwater - * @Author: Glowbal +/* + * Author: Glowbal + * Check if unit is underwater * - * @Arguments: [unit OBJECT] - * @Return: BOOL True if unit is in the water - * @PublicAPI: true + * Arguments: + * 0: Unit + * + * Return Value: + * if unit is in the water (BOOLEAN) + * + * Public: Yes */ - #include "script_component.hpp" -private ["_return","_aslPos"]; +params ["_unit"]; -PARAMS_1(_unit); +private "_return"; _return = false; -if ((surfaceIsWater getPos _unit)) then { - _aslPos = _unit modelToWorldVisual (_unit selectionPosition "head"); - if ((_aslPos select 2) <= 0) then { +if (surfaceIsWater getPosASL _unit) then { + private "_pos"; + _pos = _unit modelToWorldVisual (_unit selectionPosition "head"); + + if (_pos select 2 < 0) then { _return = true; }; }; -_return; +_return diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index 1d5a99ac6b..381b19bc24 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true. * * Argument: @@ -8,6 +7,10 @@ * * Return value: * The object exists and is alive (Bool). + * + * Public: Yes + * + * Deprecated */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_isArrested.sqf b/addons/common/functions/fnc_isArrested.sqf deleted file mode 100644 index 36fb44bd1a..0000000000 --- a/addons/common/functions/fnc_isArrested.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/** - * fn_isArrested.sqf - * @Descr: Check if unit is in arrested state - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: BOOL Returns true if unit or object is in arrest state - * @PublicAPI: true - */ - -#include "script_component.hpp" - -((_this select 0) getvariable [QGVAR(StateArrested),false]) \ No newline at end of file diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index 30bb6a7e38..a144303d48 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -1,45 +1,55 @@ -/** - * fn_loadPerson_f.sqf - * @Descr: Loads a specified unit into any nearby vehicle - * @Author: Glowbal +/* + * Author: Glowbal + * Loads a specified unit into any nearby vehicle * - * @Arguments: [caller OBJECT, unitToBeLoaded OBJECT] - * @Return: OBJECT Returns the vehicle that the unitToBeloaded has been loaded in. Returns ObjNull if function failed - * @PublicAPI: true + * Arguments: + * 0: Unit that will load + * 1: Unit to be loaded + * + * Return Value: + * the vehicle that the unitToBeloaded has been loaded in. Returns ObjNull if function failed + * + * Public: Yes */ - #include "script_component.hpp" #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) -private ["_caller", "_unit","_vehicle", "_loadcar", "_loadhelicopter", "_loadtank","_loadboat"]; -_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; -_vehicle = ObjNull; +params ["_caller", "_unit"]; + +private ["_vehicle", "_loadcar", "_loadair", "_loadtank", "_loadboat"]; + +_vehicle = objNull; if (!([_caller] call FUNC(canInteract)) || {_caller == _unit}) exitwith {_vehicle}; -_loadcar = nearestObject [_unit, "car"]; +_loadcar = nearestObject [_unit, "Car"]; + if (_unit distance _loadcar <= 10) then { _vehicle = _loadcar; } else { - _loadhelicopter = nearestObject [_unit, "air"]; - if (_unit distance _loadhelicopter <= 10) then { - _vehicle = _loadhelicopter; + _loadair = nearestObject [_unit, "Air"]; + + if (_unit distance _loadair <= 10) then { + _vehicle = _loadair; } else { - _loadtank = nearestObject [_unit, "tank"]; + _loadtank = nearestObject [_unit, "Tank"]; + if (_unit distance _loadtank <= 10) then { _vehicle = _loadtank; } else { - _loadboat = nearestObject [_unit, "ship"]; + _loadboat = nearestObject [_unit, "Ship_F"]; + if (_unit distance _loadboat <= 10) then { _vehicle = _loadboat; }; }; }; }; + if (!isNull _vehicle) then { [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); - [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc); + [[_unit, _vehicle, _caller], QFUNC(loadPersonLocal), _unit, false] call FUNC(execRemoteFnc); }; -_vehicle \ No newline at end of file + +_vehicle diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index 8718be1e75..c832ededad 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -1,25 +1,28 @@ -/** - * fn_loadPersonLocal_f.sqf - * @Descr: Load a person, local - * @Author: Glowbal +/* + * Author: Glowbal + * Load a person, local * - * @Arguments: [unit OBJECT, vehicle OBJECT, caller OBJECT] - * @Return: void - * @PublicAPI: false + * Arguments: + * 0: unit to be loaded + * 1: vehicle that will beloaded + * 2: caller that will load + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_unit","_vehicle","_caller","_handle","_loaded","_slotsOpen"]; -_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_vehicle = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; -_caller = [_this, 2, ObjNull,[ObjNull]] call BIS_fnc_Param; -_slotsOpen = false; +params ["_unit", "_vehicle", "_caller"]; if (!alive _unit) then { - _unit = [_unit,_caller] call FUNC(makeCopyOfBody); + _unit = [_unit, _caller] call FUNC(makeCopyOfBody); }; +private "_slotsOpen"; + +_slotsOpen = false; if (_vehicle emptyPositions "cargo" > 0) then { _unit moveInCargo _vehicle; @@ -32,26 +35,29 @@ if (_vehicle emptyPositions "cargo" > 0) then { }; if (_slotsOpen) then { - _loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; - _loaded pushback _unit; - _vehicle setvariable [QGVAR(loaded_persons),_loaded,true]; - if (!([_unit] call FUNC(isAwake))) then { - _handle = [_unit,_vehicle] spawn { - private ["_unit","_vehicle"]; - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit == _vehicle}; - sleep 0.5; + private "_loaded"; + _loaded = _vehicle getVariable [QGVAR(loaded_persons),[]]; + _loaded pushBack _unit; - //Save the "awake" animation before applying the death animation - if (vehicle _unit == _vehicle) then { - _unit setVariable [QEGVAR(medical,vehicleAwakeAnim), [_vehicle, (animationState _unit)]]; + _vehicle setVariable [QGVAR(loaded_persons), _loaded, true]; + + if !([_unit] call FUNC(isAwake)) then { + [{ + (_this select 0) params ["_unit", "_vehicle"]; + + // wait until the unit is in the vehicle + if (vehicle _unit != _vehicle) exitWith { + // kill this pfh if either one is deleted + if (isNull _unit || isNull _vehicle) then { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; }; - [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); - }; - } else { - if ([_unit] call FUNC(isArrested)) then { - }; + _unit setVariable [QEGVAR(medical,vehicleAwakeAnim), [_vehicle, animationState _unit]]; + + [_unit, [_unit] call FUNC(getDeathAnim), 1, true] call FUNC(doAnimation); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler; }; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_loadSettingsFromProfile.sqf b/addons/common/functions/fnc_loadSettingsFromProfile.sqf index 7cb99e3400..d4806d0c54 100644 --- a/addons/common/functions/fnc_loadSettingsFromProfile.sqf +++ b/addons/common/functions/fnc_loadSettingsFromProfile.sqf @@ -13,28 +13,26 @@ */ #include "script_component.hpp" -private ["_name", "_isClientSetable", "_isForced", "_profileValue"]; - // Iterate through settings { - _name = _x select 0; - _isClientSetable = _x select 2; - _isForced = _x select 6; + _x params ["_name", "", "_isClientSetable", "", "", "", "_isForced"]; // If setting is user setable if (_isClientSetable) then { // If setting is not forced if !(_isForced) then { - _profileValue = profileNamespace getvariable _name; + private "_profileValue"; + _profileValue = profileNamespace getVariable _name; + // If the setting is stored on the profile if !(isNil "_profileValue") then { // If the profile variable has the correct type - if (typeName _profileValue == typeName (missionNamespace getvariable _name)) then { + if (typeName _profileValue == typeName (missionNamespace getVariable _name)) then { // Load the setting from the profile - missionNamespace setvariable [_name, _profileValue]; + missionNamespace setVariable [_name, _profileValue]; }; }; }; }; - -} forEach GVAR(settings); + false +} count GVAR(settings); diff --git a/addons/common/functions/fnc_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf index 61431ff220..ea8257ec23 100644 --- a/addons/common/functions/fnc_loadSettingsOnServer.sqf +++ b/addons/common/functions/fnc_loadSettingsOnServer.sqf @@ -13,24 +13,26 @@ */ #include "script_component.hpp" -private ["_parseConfigForSettings"]; - GVAR(settings) = []; -_parseConfigForSettings = { - private ["_config", "_countOptions", "_optionEntry", "_index"]; +private "_fnc_parseConfigForSettings"; +_fnc_parseConfigForSettings = { + private ["_config", "_countOptions", "_optionEntry"]; _config = _this select 0; _countOptions = count _config; + for "_index" from 0 to (_countOptions - 1) do { _optionEntry = _config select _index; [_optionEntry] call FUNC(setSettingFromConfig); }; + // Check if all settings should be forced if (GVAR(forceAllSettings)) then { { _x set [6, true]; - } forEach GVAR(settings); + false + } count GVAR(settings); }; }; @@ -41,17 +43,18 @@ _parseConfigForSettings = { // This ensures that all settings are of their correct type, in case an outdated or corrupt server config is used , as well as have their correct localized display name and description // Regular config -[configFile >> "ACE_Settings"] call _parseConfigForSettings; +[configFile >> "ACE_Settings"] call _fnc_parseConfigForSettings; // Server config -[configFile >> "ACE_ServerSettings"] call _parseConfigForSettings; +[configFile >> "ACE_ServerSettings"] call _fnc_parseConfigForSettings; // mission side settings -[missionConfigFile >> "ACE_Settings"] call _parseConfigForSettings; +[missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings; // Publish all settings data publicVariable QGVAR(settings); // Publish all setting values { publicVariable (_x select 0); -} forEach GVAR(settings); + false +} count GVAR(settings); diff --git a/addons/common/functions/fnc_localEvent.sqf b/addons/common/functions/fnc_localEvent.sqf index fb0cbaf40f..ee94111994 100644 --- a/addons/common/functions/fnc_localEvent.sqf +++ b/addons/common/functions/fnc_localEvent.sqf @@ -3,31 +3,37 @@ * * Execute a local event on this client only. * - * Argument: + * Arguments: * 0: Event name (string) * 1: Event args (any) * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_eventName,_eventArgs); +params ["_eventName", "_eventArgs"]; -private["_eventIndex", "_eventNames", "_events"]; +GVAR(events) params ["_eventNames", "_eventArray"]; -_eventNames = GVAR(events) select 0; +private "_eventIndex"; _eventIndex = _eventNames find _eventName; -if(_eventIndex != -1) then { - _events = (GVAR(events) select 1) select _eventIndex; + +if (_eventIndex != -1) then { + private "_events"; + _events = _eventArray select _eventIndex; + #ifdef DEBUG_EVENTS ACE_LOGINFO_1("* Local Event: %1",_eventName); ACE_LOGINFO_1(" args=%1",_eventArgs); #endif { - if(!isNil "_x") then { - _eventArgs call CALLSTACK_NAMED(_x, FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex)); + if (!isNil "_x") then { + _eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex)); + #ifdef DEBUG_EVENTS_CALLSTACK ACE_LOGINFO_1(" ID: %1",_forEachIndex); #endif diff --git a/addons/common/functions/fnc_log.sqf b/addons/common/functions/fnc_log.sqf deleted file mode 100644 index 21ae4cfbf8..0000000000 --- a/addons/common/functions/fnc_log.sqf +++ /dev/null @@ -1,25 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -if ((_this select 0) in (missionNamespace getVariable ["ACE_Debug", []])) then { - _this resize 4; - - PARAMS_4(_type,_argument,_function,_showInGame); - - if (isNil "_function") then { - _function = {_this}; - }; - - if (isNil "_showInGame") then { - _showInGame = true; - }; - - private "_result"; - _result = _argument call _function; - - if (_showInGame) then { - systemChat format ["%1", _result]; - }; - - diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result]; -}; diff --git a/addons/common/functions/fnc_logControls.sqf b/addons/common/functions/fnc_logControls.sqf deleted file mode 100644 index 5bcaea779b..0000000000 --- a/addons/common/functions/fnc_logControls.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -[allControls findDisplay _this, {ctrlIDC _this}] call FUNC(map) diff --git a/addons/common/functions/fnc_logDisplays.sqf b/addons/common/functions/fnc_logDisplays.sqf deleted file mode 100644 index 0ab4fbe5bc..0000000000 --- a/addons/common/functions/fnc_logDisplays.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -[allDisplays, {ctrlIDD _this}] call FUNC(map) diff --git a/addons/common/functions/fnc_logModEntries.sqf b/addons/common/functions/fnc_logModEntries.sqf deleted file mode 100644 index ec8c94b190..0000000000 --- a/addons/common/functions/fnc_logModEntries.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private ["_configs", "_entries", "_name"]; - -_configs = "true" configClasses (configFile >> _this); - -_entries = []; - -{ - { - _name = toLower configName _x; - if !(_name in _entries) then { - diag_log text _name; - _entries pushBack _name; - }; - } forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false]; -} forEach _configs; From 1fd2fcafb052adac25956e67132e441df597e4ad Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 18:34:29 +0200 Subject: [PATCH 077/311] remove old, not working functions --- addons/common/XEH_preInit.sqf | 2 -- addons/common/functions/fnc_canInteract.sqf | 19 ------------ .../common/functions/fnc_setCanInteract.sqf | 30 ------------------- 3 files changed, 51 deletions(-) delete mode 100644 addons/common/functions/fnc_canInteract.sqf delete mode 100644 addons/common/functions/fnc_setCanInteract.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index ad3101b04f..e964dbcb42 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -19,7 +19,6 @@ PREP(binarizeNumber); PREP(blurScreen); PREP(cachedCall); PREP(canGetInPosition); -PREP(canInteract); PREP(canInteractWith); PREP(canUseWeapon); PREP(changeProjectileDirection); @@ -160,7 +159,6 @@ PREP(sanitizeString); PREP(sendRequest); PREP(serverLog); PREP(setArrestState); -PREP(setCanInteract); PREP(setCaptivityStatus); PREP(setDefinedVariable); PREP(setDisableUserInputStatus); diff --git a/addons/common/functions/fnc_canInteract.sqf b/addons/common/functions/fnc_canInteract.sqf deleted file mode 100644 index d2ae7e1ffb..0000000000 --- a/addons/common/functions/fnc_canInteract.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Author: Glowbal - * Check if unit can interact with enviroment. Unit has to be awake and not be in arrested state. - * - * Arguments: - * 0: Unit that try to Interact - * - * Return Value: - * Can interact with enviroment - * - * Public: No - * - * Deprecated - */ -#include "script_component.hpp" - -params ["_unit"]; - -(_unit getvariable [QGVAR(canInteract),0]) < 1 && [_unit] call FUNC(isAwake) && !([_unit] call FUNC(isArrested)) diff --git a/addons/common/functions/fnc_setCanInteract.sqf b/addons/common/functions/fnc_setCanInteract.sqf deleted file mode 100644 index ae05d3cd5b..0000000000 --- a/addons/common/functions/fnc_setCanInteract.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * fn_setCanInteract.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#include "script_component.hpp" - -private ["_unit","_to","_return"]; - -_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_to = _this select 1; -_return = false; - -if (((typeName _to) == "SCALAR")) then { - if (_to <-1) then { - _to = -1; - } else { - if (_to > 1) then { - _to = 1; - }; - }; - _unit setvariable [QGVAR(canInteract), ([_unit] call FUNC(getCanInteract)) + _to,false]; - _return = true; -}; -_return \ No newline at end of file From a621a0c693a745086797b25bb3fe538ef637a0f5 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Fri, 18 Sep 2015 13:36:57 -0300 Subject: [PATCH 078/311] Fixes to spanish translations --- addons/advanced_ballistics/stringtable.xml | 2 +- addons/captives/stringtable.xml | 2 +- addons/common/stringtable.xml | 2 +- addons/dagr/stringtable.xml | 42 +++++++++++----------- addons/explosives/stringtable.xml | 2 +- addons/finger/stringtable.xml | 2 +- addons/flashlights/stringtable.xml | 2 +- addons/hearing/stringtable.xml | 4 +-- addons/interact_menu/stringtable.xml | 4 +-- addons/main/stringtable.xml | 2 +- addons/medical/stringtable.xml | 2 +- addons/medical_menu/stringtable.xml | 4 +-- addons/optionsmenu/stringtable.xml | 4 +-- addons/parachute/stringtable.xml | 2 +- addons/slideshow/stringtable.xml | 6 ++-- addons/spectator/stringtable.xml | 8 ++--- addons/zeus/stringtable.xml | 2 +- 17 files changed, 46 insertions(+), 46 deletions(-) diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 7d8e918b53..5ea26cd906 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -289,4 +289,4 @@ Este módulo permite la simulación balística avanzada - es decir, la trayectoria de los proyectiles está influenciada por variables como la temperatura del aire, la presión atmosférica, la humedad, la gravedad, el tipo de municiones y el arma desde el que fue disparada. - \ No newline at end of file + diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index d0a84909ec..864fa7c437 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -274,4 +274,4 @@ Rendición o desarme - \ No newline at end of file + diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 7e226a231e..e39ef4d7db 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -754,4 +754,4 @@ ACE3 Vehículos - \ No newline at end of file + diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index 1da63910de..9d95873e64 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -1,25 +1,25 @@  - - DAGR - DAGR - DAGR - - - Configure DAGR - Konfiguruj DAGR - Configurar DAGR - - - Toggle DAGR - Przełącz DAGR - Mostrar DAGR - - - Defense Advanced GPS Receiver - Defense Advanced GPS Receiver - Defense Advanced GPS Receiver - + + DAGR + DAGR + DAGR + + + Configure DAGR + Konfiguruj DAGR + Configurar DAGR + + + Toggle DAGR + Przełącz DAGR + Mostrar DAGR + + + Defense Advanced GPS Receiver + Defense Advanced GPS Receiver + Defense Advanced GPS Receiver + - \ No newline at end of file + diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 025f250434..a346d3b4be 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -612,4 +612,4 @@ Este módulo ajusta las configuraciones relacionadas con explosivos. - \ No newline at end of file + diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index 70de7853a2..88030cc7d9 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -92,4 +92,4 @@ Distancia máxima entre los jugadores para mostrar el indicador que señala [por defecto: 4 metros] - \ No newline at end of file + diff --git a/addons/flashlights/stringtable.xml b/addons/flashlights/stringtable.xml index a9ec458b2d..bc6908ab97 100644 --- a/addons/flashlights/stringtable.xml +++ b/addons/flashlights/stringtable.xml @@ -50,4 +50,4 @@ Linterna con filtro rojo. Para su uso en el mapa. - \ No newline at end of file + diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index f73ceba74e..1464639123 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -140,7 +140,7 @@ Ativar surdez em combate? - Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection + Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection Harci süketség engedélyezése? Уменьшает способность игроков слышать при повреждении слуха Głuchota bojowa pojawia się w momentach, kiedy stoimy w pobliżu broni wielkokalibrowej bez ochrony słuchu, lub np. podczas ostrzału artyleryjskiego. Moduł ten pozwala na włączenie lub wyłączenie tego efektu. @@ -165,4 +165,4 @@ Permitir a las unidades por control remoto de zeus que puedan tener daños auditivos. - \ No newline at end of file + diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index c748acbb35..42966c43c1 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -300,4 +300,4 @@ Menú de interacción - \ No newline at end of file + diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index bd3c27aa63..511da9875a 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -10,4 +10,4 @@ ACE Logística - \ No newline at end of file + diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index c74f3a8f22..07bf4c8b49 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,4 +1,4 @@ - + diff --git a/addons/medical_menu/stringtable.xml b/addons/medical_menu/stringtable.xml index 0a176dd6fe..9e3bbc4c2b 100644 --- a/addons/medical_menu/stringtable.xml +++ b/addons/medical_menu/stringtable.xml @@ -259,7 +259,7 @@ Tors Torso Trup - Pecho + Torso Left Arm @@ -456,4 +456,4 @@ Tubo nasofaríngeo [NPA] - \ No newline at end of file + diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 7c4df339b1..6b4cad396b 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -415,4 +415,4 @@ Logística - \ No newline at end of file + diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index 469230c3c8..ebedda7405 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -72,4 +72,4 @@ Paracaídas de reserva - \ No newline at end of file + diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index e2dd2649df..2cf707f024 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -65,7 +65,7 @@ Imagens Изображения Obrázky - Imagenes + Imágenes List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). @@ -74,7 +74,7 @@ A képek listája amit a vetítés használni fog, vesszővel elválasztva, megfelelően formázott teljes útvonallal (pl. képek\kép.paa) Lista das imagens que serão utilizadas na apresentação de slides, separadas por vírgula, com o caminho completo corretamente formatado (ex: imagens\imagem.paa). Список изображений, которые будут использованы для слайд-шоу, разделенные запятыми, с полными путями в правильном формате (например, images\image.paa). - Lista de imágenes que se utilizarán para la presentación de diapositivas, separadas por comas, con la ruta completa en formato correcto (ej. imagenes\ image.paa). + Lista de imágenes que se utilizarán para la presentación de diapositivas, separadas por comas, con la ruta completa en formato correcto (ej. imágenes\image.paa). Interaction Names @@ -123,4 +123,4 @@ Diapositivas - \ No newline at end of file + diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index 166fe39cdb..fbd3311d52 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -474,7 +474,7 @@ Ajustar zoom Настроить зум Regulovat Přiblížení - Ajustar enfoque + Ajustar aumento Adjust Speed @@ -489,7 +489,7 @@ Reguluj zoom (krok) Incrementar zoom Увеличить зум - Incrementar enfoque + Incrementar aumento Increment Speed @@ -504,7 +504,7 @@ Redefinir zoom Сбросить зум Obnovit Přiblížení - Reiniciar enfoque + Reiniciar aumento Reset Speed @@ -515,4 +515,4 @@ Reiniciar velocidad - \ No newline at end of file + diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 0f909d8383..71601745f9 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -299,4 +299,4 @@ Añadir cualquier objeto creado a todos los directores en la misión - \ No newline at end of file + From 2674310e655f43125a6fdb229baadbbe6c3b6482 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 18:45:41 +0200 Subject: [PATCH 079/311] remove another deprecated function --- addons/common/XEH_preInit.sqf | 1 - .../common/functions/fnc_setArrestState.sqf | 44 ------------------- 2 files changed, 45 deletions(-) delete mode 100644 addons/common/functions/fnc_setArrestState.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index e964dbcb42..a2994bc459 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -158,7 +158,6 @@ PREP(runAfterSettingsInit); PREP(sanitizeString); PREP(sendRequest); PREP(serverLog); -PREP(setArrestState); PREP(setCaptivityStatus); PREP(setDefinedVariable); PREP(setDisableUserInputStatus); diff --git a/addons/common/functions/fnc_setArrestState.sqf b/addons/common/functions/fnc_setArrestState.sqf deleted file mode 100644 index 7b4f3cd995..0000000000 --- a/addons/common/functions/fnc_setArrestState.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/** - * fn_setArrestState.sqf - * @Descr: Set a unit in arrest state - * @Author: Glowbal - * - * @Arguments: [unitToBeArrested OBJECT, setArrested BOOL] - * @Return: void - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_unit","_setArrest"]; -_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; -_setArrest = [_this, 1, false, [false]] call BIS_fnc_Param; - -if (_setArrest) then { - [_unit, QGVAR(StateArrested), true] call FUNC(setDefinedVariable); - - if ([_unit] call FUNC(isAwake)) then { - if (vehicle _unit == _unit) then { - [_unit,"UnaErcPoslechVelitele2",1] call FUNC(doAnimation); - }; - }; - if (IsPlayer _unit) then { - [["arrested", true],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); - }; - _unit disableAI "Move"; - _unit disableAI "ANIM"; -} else { - [_unit, QGVAR(StateArrested), false] call FUNC(setDefinedVariable); - - if ([_unit] call FUNC(isAwake)) then { - if (vehicle _unit == _unit) then { - [_unit,"",1] call FUNC(doAnimation); - }; - _unit enableAI "Move"; - _unit enableAI "ANIM"; - }; - if (IsPlayer _unit) then { - [["arrested", false],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); - }; -}; - From a18f63d8616a06c4ef7504b90767985b3808f430 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 19:12:38 +0200 Subject: [PATCH 080/311] more common code cleanup --- .../common/functions/fnc_loadPersonLocal.sqf | 5 +- addons/common/functions/fnc_unloadPerson.sqf | 21 ++--- .../functions/fnc_unloadPersonLocal.sqf | 81 ++++++++++++------- 3 files changed, 67 insertions(+), 40 deletions(-) diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index c832ededad..2d8295e4af 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -41,7 +41,8 @@ if (_slotsOpen) then { _vehicle setVariable [QGVAR(loaded_persons), _loaded, true]; - if !([_unit] call FUNC(isAwake)) then { + // @todo never used. Remove? + /*if !([_unit] call FUNC(isAwake)) then { [{ (_this select 0) params ["_unit", "_vehicle"]; @@ -59,5 +60,5 @@ if (_slotsOpen) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler; - }; + };*/ }; diff --git a/addons/common/functions/fnc_unloadPerson.sqf b/addons/common/functions/fnc_unloadPerson.sqf index cd421fd3e5..950aa9367b 100644 --- a/addons/common/functions/fnc_unloadPerson.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -10,23 +10,26 @@ * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) -private ["_vehicle","_emptyPos"]; -PARAMS_1(_unit); +params ["_unit"]; + +private "_vehicle"; _vehicle = vehicle _unit; -if (_vehicle == _unit) exitwith {false;}; -if !(speed _vehicle <1 && (((getpos _vehicle) select 2) < 2)) exitwith {false;}; +if (_vehicle == _unit) exitWith {false}; -_emptyPos = ((getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]); -if (count _emptyPos == 0) exitwith {false}; +if (speed _vehicle > 1 || getPos _vehicle select 2 > 2) exitWith {false}; + +private "_emptyPos"; +_emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]; + +if (count _emptyPos == 0) exitWith {false}; if (!isNull _vehicle) then { - [[_unit], QUOTE(FUNC(unloadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc); + [[_unit], QUOTE(FUNC(unloadPersonLocal)), _unit, false] call FUNC(execRemoteFnc); }; -true; +true diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 150ea8c500..83ae2d6fd1 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -10,34 +10,48 @@ * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) -private ["_loaded", "_emptyPos","_validVehiclestate"]; -PARAMS_2(_unit,_vehicle); +params ["_unit", "_vehicle"]; + +private ["_validVehiclestate", "_emptyPos", "_loaded"]; + _validVehiclestate = true; if (_vehicle isKindOf "Ship" ) then { - if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; - TRACE_1("SHIP Ground Check", getPosATL _vehicle ); - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]); // TODO: if spot is underwater pick another spot. + if (speed _vehicle > 1 || {getPos _vehicle select 2 > 2}) then { + _validVehiclestate = false; + }; + + TRACE_1("SHIP Ground Check",getPos _vehicle); + + _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]; // TODO: if spot is underwater pick another spot. } else { - if (_vehicle isKindOf "Air" ) then { - if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; - TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); - _emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition); - _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; + if (_vehicle isKindOf "Air") then { + if (speed _vehicle > 1 || {isTouchingGround _vehicle}) then { + _validVehiclestate = false; + }; + + TRACE_1("Vehicle Ground Check",isTouchingGround _vehicle); + + _emptyPos = ASLToAGL getPosASL _vehicle; + _emptyPos = _emptyPos vectorAdd [random 10 - 5, random 10 - 5, 0]; } else { - if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; + if (speed _vehicle > 1 || {getPos _vehicle select 2 > 2}) then { + _validVehiclestate = false; + }; + TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]); + + _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]); }; }; TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); -if (!_validVehiclestate) exitwith { + +if !(_validVehiclestate) exitwith { ACE_LOGWARNING_4("Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPos _vehicle,isTouchingGround _vehicle,speed _vehicle); false }; @@ -47,36 +61,45 @@ if (count _emptyPos == 0) exitwith { false }; //consider displaying text saying there are no safe places to exit the vehicle - unassignVehicle _unit; [_unit] orderGetIn false; + TRACE_1("Ejecting", alive _unit); + _unit action ["Eject", vehicle _unit]; -[ { - private "_anim"; - PARAMS_2(_unit,_emptyPos); - _unit setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); - if (!([_unit] call FUNC(isAwake))) then { + +[{ + params ["_unit", "_emptyPos"]; + + _unit setPosASL AGLToASL _emptyPos; + + // @todo never used. Remove? + /*if !([_unit] call FUNC(isAwake)) then { + TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake)); + if (driver _unit == _unit) then { - _anim = [_unit] call EFUNC(common,getDeathAnim); - [_unit, _anim, 1, true] call EFUNC(common,doAnimation); + private "_anim"; + _anim = [_unit] call FUNC(getDeathAnim); + + [_unit, _anim, 1, true] call FUNC(doAnimation); + [{ _unit = _this select 0; _anim = _this select 1; if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then { - [_unit, _anim, 2, true] call EFUNC(common,doAnimation); + [_unit, _anim, 2, true] call FUNC(doAnimation); }; - }, [_unit, _anim], 0.5, 0] call EFUNC(common,waitAndExecute); + }, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute); }; - }; -},[_unit,_emptyPos], 0.5, 0] call EFUNC(common,waitAndExecute); - + };*/ +}, [_unit, _emptyPos], 0.5, 0] call FUNC(waitAndExecute); [_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); _loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; -_loaded = _loaded - [_unit]; -_vehicle setvariable [QGVAR(loaded_persons),_loaded,true]; +_loaded deleteAt (_loaded find _unit); + +_vehicle setvariable [QGVAR(loaded_persons), _loaded, true]; true From 97921aa665f79e3d7d72aaaa525ba333038e49ca Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 18 Sep 2015 12:18:43 -0500 Subject: [PATCH 081/311] #2503 - run BFT module on server --- addons/map/CfgVehicles.hpp | 2 +- addons/map/functions/fnc_blueForceTrackingModule.sqf | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 3b203c1f62..560453b416 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -67,7 +67,7 @@ class CfgVehicles { displayName = CSTRING(BFT_Module_DisplayName); function = QFUNC(blueForceTrackingModule); scope = 2; - isGlobal = 1; + isGlobal = 0; icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa); class Arguments { class Enabled { diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index 5de07bb457..77275ffd4c 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi -* * Initializes the blue force tracking module. * * Arguments: @@ -12,15 +11,12 @@ #include "script_component.hpp" -if (!hasInterface) exitWith {}; +if (!isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); - -if !(_activated) exitWith {}; +params ["_logic"]; [_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); -ACE_LOGINFO("Blue Force Tracking Module Initialized."); -TRACE_2("[ACE]: Blue Force Tracking Module initialized.", GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); +ACE_LOGINFO_3("Blue Force Tracking Module Initialized:", GVAR(BFT_Enabled), GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); From 8704cd0321fa7e155b019332b1e6dfe26da60f39 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 19:40:48 +0200 Subject: [PATCH 082/311] fix additional bracket, formatting --- addons/common/functions/fnc_unloadPerson.sqf | 2 +- addons/common/functions/fnc_unloadPersonLocal.sqf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_unloadPerson.sqf b/addons/common/functions/fnc_unloadPerson.sqf index 950aa9367b..0ab65a5983 100644 --- a/addons/common/functions/fnc_unloadPerson.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -24,7 +24,7 @@ if (_vehicle == _unit) exitWith {false}; if (speed _vehicle > 1 || getPos _vehicle select 2 > 2) exitWith {false}; private "_emptyPos"; -_emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]; +_emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]; // @todo to small? if (count _emptyPos == 0) exitWith {false}; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 83ae2d6fd1..8dd2737b83 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -20,7 +20,7 @@ private ["_validVehiclestate", "_emptyPos", "_loaded"]; _validVehiclestate = true; -if (_vehicle isKindOf "Ship" ) then { +if (_vehicle isKindOf "Ship") then { if (speed _vehicle > 1 || {getPos _vehicle select 2 > 2}) then { _validVehiclestate = false; }; @@ -45,7 +45,7 @@ if (_vehicle isKindOf "Ship" ) then { TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); - _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]); + _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]; }; }; From 65b8585d60891727e80d94bfeee37d13d6c97675 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 18 Sep 2015 12:48:59 -0500 Subject: [PATCH 083/311] Use _player instead of ACE_player --- addons/nightvision/functions/fnc_blending.sqf | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/addons/nightvision/functions/fnc_blending.sqf b/addons/nightvision/functions/fnc_blending.sqf index a565eb65c0..42d586248d 100644 --- a/addons/nightvision/functions/fnc_blending.sqf +++ b/addons/nightvision/functions/fnc_blending.sqf @@ -25,17 +25,20 @@ if (!hasInterface) exitWith {}; params ["_vehicle", "_weapon", "", "", "_ammo", "_magazine"]; +private "_player"; +_player = ACE_player; + //If our vehicle didn't shoot, or we're not in NVG mode, exit -if ((_vehicle != (vehicle ACE_player)) || {(currentVisionMode ACE_player) != 1}) exitWith {}; +if ((_vehicle != (vehicle _player)) || {(currentVisionMode _player) != 1}) exitWith {}; //If we are mounted, and it wasn't our weapon system that fired, exit -if (ACE_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([ACE_player] call EFUNC(common,getTurretIndex))))}) exitWith {}; +if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {}; private["_darkness", "_nvgBrightnessCoef", "_silencer", "_visibleFire", "_visibleFireCoef", "_visibleFireTime", "_visibleFireTimeCoef"]; _silencer = switch (_weapon) do { - case (primaryWeapon ACE_player) : {primaryWeaponItems ACE_player select 0}; - case (secondaryWeapon ACE_player) : {secondaryWeaponItems ACE_player select 0}; - case (handgunWeapon ACE_player) : {handgunItems ACE_player select 0}; + case (primaryWeapon _player): {(primaryWeaponItems _player) select 0}; + case (secondaryWeapon _player): {(secondaryWeaponItems _player) select 0}; + case (handgunWeapon _player): {(handgunItems _player) select 0}; default {""}; }; @@ -49,14 +52,14 @@ if (_silencer != "") then { _visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire"); _visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTime"); -_nvgBrightnessCoef = 1 + (ACE_player getVariable [QGVAR(NVGBrightness), 0]) / 4; +_nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4; _fnc_isTracer = { private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"]; if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false}; - _indexShot = (ACE_player ammo _weapon) + 1; + _indexShot = (_player ammo _weapon) + 1; _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); if (_indexShot <= _lastRoundsTracer) exitWith {true}; From 6773119f097ee07e6f5c6ea956f712d8cc65e838 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 18 Sep 2015 13:14:00 -0500 Subject: [PATCH 084/311] Script to search for undefined functions --- tools/search_undefinedFunctions.py | 111 +++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 tools/search_undefinedFunctions.py diff --git a/tools/search_undefinedFunctions.py b/tools/search_undefinedFunctions.py new file mode 100644 index 0000000000..e7c1b8fb34 --- /dev/null +++ b/tools/search_undefinedFunctions.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 + +import fnmatch +import os +import re +import ntpath +import sys +import argparse + +import ctypes + +#from http://stackoverflow.com/a/3429034 +#Get required functions, strcpy.. +strcpy = ctypes.cdll.msvcrt.strcpy +ocb = ctypes.windll.user32.OpenClipboard #Basic Clipboard functions +ecb = ctypes.windll.user32.EmptyClipboard +gcd = ctypes.windll.user32.GetClipboardData +scd = ctypes.windll.user32.SetClipboardData +ccb = ctypes.windll.user32.CloseClipboard +ga = ctypes.windll.kernel32.GlobalAlloc # Global Memory allocation +gl = ctypes.windll.kernel32.GlobalLock # Global Memory Locking +gul = ctypes.windll.kernel32.GlobalUnlock +GMEM_DDESHARE = 0x2000 + +def Get( ): + ocb(None) # Open Clip, Default task + pcontents = gcd(1) # 1 means CF_TEXT.. too lazy to get the token thingy ... + data = ctypes.c_char_p(pcontents).value + #gul(pcontents) ? + ccb() + return data + +def Paste( data ): + ocb(None) # Open Clip, Default task + ecb() + hCd = ga( GMEM_DDESHARE, len( bytes(data,"ascii") )+1 ) + pchData = gl(hCd) + strcpy(ctypes.c_char_p(pchData),bytes(data,"ascii")) + gul(hCd) + scd(1,hCd) + ccb() + + + +def getFunctions(filepath): + + selfmodule = (re.search('addons[\W]*([_a-zA-Z0-9]*)', filepath)).group(1) + + # print("Checking {0} from {1}".format(filepath,selfmodule)) + + def pushClosing(t): + closingStack.append(closing.expr) + closing << Literal( closingFor[t[0]] ) + + def popClosing(): + closing << closingStack.pop() + + with open(filepath, 'r') as file: + content = file.read() + + srch = re.compile('[^E]FUNC\(([_a-zA-Z0-9]*)\)') + modfuncs = srch.findall(content) + modfuncs = sorted(set(modfuncs)) + + srch = re.compile('EFUNC\(([_a-zA-Z0-9]*),([_a-zA-Z0-9]*)\)') + exfuncs = srch.findall(content) + exfuncs = sorted(set(exfuncs)) + + allFuncs = [] + for func in modfuncs: + allFuncs.append("ace_{0}_fnc_{1}".format(selfmodule,func)) + + for exModule,func in exfuncs: + allFuncs.append("ace_{0}_fnc_{1}".format(exModule, func)) + + return allFuncs + +def main(): + + print("#########################") + print("# All Functions #") + print("#########################") + + sqf_list = [] + allFunctions = [] + + parser = argparse.ArgumentParser() + parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") + args = parser.parse_args() + + for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): + for filename in fnmatch.filter(filenames, '*.sqf'): + sqf_list.append(os.path.join(root, filename)) + + for filename in sqf_list: + allFunctions = allFunctions + getFunctions(filename) + + + testCode1 = "diag_log text '*********** Scaning for nil functions [count {0}]';".format(len(set(allFunctions))); + testCode2 = "{ if (isNil _x) then {systemChat format ['%1 is nil', _x]; diag_log text format ['%1 is nil', _x];}} forEach allFunctions;"; + + outputCode = "{0} allFunctions = {1}; {2}".format(testCode1, list(set(allFunctions)), testCode2) + + print(outputCode) + Paste(outputCode); + + print ("") + print ("Copied to clipboard, total func count {0}".format(len(set(allFunctions)))) + +if __name__ == "__main__": + main() From c62ea5e4069a972b815a57f13c54529bb3afd69a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 18 Sep 2015 13:47:19 -0500 Subject: [PATCH 085/311] Fix some nil functions --- addons/captives/XEH_postInit.sqf | 1 - addons/captives/functions/fnc_handleGetIn.sqf | 2 +- addons/common/functions/fnc_resetAllDefaults.sqf | 2 +- addons/medical/functions/fnc_addToTriageCard.sqf | 2 +- addons/medical/functions/fnc_handleDamage.sqf | 2 +- addons/medical_menu/functions/fnc_onMenuOpen.sqf | 2 +- addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf | 2 +- addons/scopes/XEH_postInit.sqf | 2 -- 8 files changed, 6 insertions(+), 9 deletions(-) diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 1372b4e10a..fec6e84fbe 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -18,7 +18,6 @@ if (isServer) then { }]; }; -["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler); ["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler); ["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler); diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index 5476073b38..d89049a031 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -26,7 +26,7 @@ if (local _unit) then { }; if (_unit getVariable [QGVAR(isSurrendering), false]) then { - [_unit, false] call FUNC(setSurrender); + [_unit, false] call FUNC(setSurrendered); }; if (_unit getVariable [QGVAR(isHandcuffed), false]) then { diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 3040334ad0..164b8f5f3b 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -18,7 +18,7 @@ _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { [true] call FUNC(setVolume); [false] call FUNC(disableKeyInput); - if (["ace_medical"] call FUNC(isModLoader)) then { + if (["ace_medical"] call FUNC(isModLoaded)) then { [false] call EFUNC(medical,effectBlackOut); }; diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 56b2042bc9..76d74f85a7 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -18,7 +18,7 @@ private ["_log", "_inList", "_amount"]; params ["_unit", "_newItem"]; if (!local _unit) exitwith { - [_this, QUOTE(DFUNC(addToTriageList)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + [_this, QUOTE(DFUNC(addToTriageCard)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; _log = _unit getvariable [QGVAR(triageCard), []]; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 1a58e2ed01..afcf6e12e5 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -109,7 +109,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW if (_delayedUnconsicous) then { [{ [_this select 0, true] call FUNC(setUnconscious); - }, [_unit], 0.7, 0] call EFUNC(common,waitAndExec); + }, [_unit], 0.7, 0] call EFUNC(common,waitAndExecute); } else { [{ [_this select 0, true] call FUNC(setUnconscious); diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index 9f0acfbeb6..fb64865b89 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -74,7 +74,7 @@ GVAR(MenuPFHID) = [{ [GVAR(INTERACTION_TARGET)] call FUNC(updateIcons); [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); - _status = [GVAR(INTERACTION_TARGET)] call FUNC(getTriageStatus); + _status = [GVAR(INTERACTION_TARGET)] call EFUNC(medical,getTriageStatus); (_display displayCtrl 2000) ctrlSetText (_status select 0); (_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); diff --git a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf index cfba7c0e05..32a5a314a7 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf @@ -13,7 +13,7 @@ * ARRAY - [NUMBER - Elevation In Degrees, NUMBER - Shot Durration] * * Example: - * [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(simulateFindSolution); + * [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call ace_mk6mortar_fnc_dev_simulateFindSolution; * * Public: No */ diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 1f56aecefb..2614da0e19 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -161,5 +161,3 @@ GVAR(showShortdot) = false; }; }; }] call EFUNC(common,addEventHandler); - -addMissionEventHandler ["Draw3D", {if (GVAR(showShortdot)) then {call FUNC(onDrawShortdot)};}]; From 5d0a7ed0621ad27e94332f4c538ba4c054db3709 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 21:12:40 +0200 Subject: [PATCH 086/311] more common code cleanup --- addons/common/functions/fnc_codeToLetter.sqf | 6 ++- addons/common/functions/fnc_isEOD.sqf | 38 +++++++++--------- addons/common/functions/fnc_isEngineer.sqf | 11 ++--- addons/common/functions/fnc_isInBuilding.sqf | 29 +++++++------- addons/common/functions/fnc_isModLoaded.sqf | 17 ++++---- addons/common/functions/fnc_isPlayer.sqf | 14 +++---- addons/common/functions/fnc_isTurnedOut.sqf | 40 +++++-------------- addons/common/functions/fnc_letterToCode.sqf | 15 ++++++- .../fnc_lightIntensityFromObject.sqf | 9 +++-- addons/common/functions/fnc_loadPerson.sqf | 2 +- .../fnc_loadSettingsLocalizedText.sqf | 32 ++++++++------- 11 files changed, 106 insertions(+), 107 deletions(-) diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf index ccb105ef0b..0bfb1d465f 100644 --- a/addons/common/functions/fnc_codeToLetter.sqf +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -3,12 +3,14 @@ * Converts some keys to an Arma Dik Code. * * Arguments: - * 0: Key + * 0: Key * * Return Value: - * Dik Code + * Dik Code * * Public: Yes + * + * Deprecated */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_isEOD.sqf b/addons/common/functions/fnc_isEOD.sqf index 92c5dc6dc4..6e331ea317 100644 --- a/addons/common/functions/fnc_isEOD.sqf +++ b/addons/common/functions/fnc_isEOD.sqf @@ -1,25 +1,23 @@ /* - Name: FUNC(isEOD) - - Author: Garth de Wet (LH) - - Description: - Checks whether the passed unit is an explosive specialist. - Either through config entry: "canDeactivateMines" - or - unit setVariable ["ACE_isEOD", true] - - Parameters: - 0: OBJECT - Unit to check if is a specialist - - Returns: - BOOLEAN - - Example: - isSpecialist = [player] call FUNC(isEOD); -*/ + * Author: Garth de Wet (LH) + * Checks whether the passed unit is an explosive specialist. + * Either through config entry: "canDeactivateMines" + * or + * unit setVariable ["ACE_isEOD", true] + * + * Arguments: + * 0: Unit to check if is a specialist + * + * Return Value: + * is the unit an EOD + * + * Example: + * isSpecialist = [player] call FUNC(isEOD); + * + * Public: Yes + */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; _unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf index 4cc5f42bc9..419fb5396d 100644 --- a/addons/common/functions/fnc_isEngineer.sqf +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -1,16 +1,17 @@ /* * Author: marc_book, edited by commy2 - * * Checks if a unit is an engineer. * * Arguments: - * 0: unit to be checked (object) + * 0: unit to be checked * * Return Value: - * Bool: is the unit an engineer? + * is the unit an engineer + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -_unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] +_unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] diff --git a/addons/common/functions/fnc_isInBuilding.sqf b/addons/common/functions/fnc_isInBuilding.sqf index adecf5ac0c..577b865aee 100644 --- a/addons/common/functions/fnc_isInBuilding.sqf +++ b/addons/common/functions/fnc_isInBuilding.sqf @@ -1,45 +1,44 @@ /* * Author: commy2 - * * Check if the unit is in a building. Will return true if the unit is sitting in a bush. * - * Argument: - * 0: Unit (Object) + * Arguments: + * 0: Unit * * Return value: - * Is the unit in a building? (Bool) + * Is the unit in a building? + * + * Public: Yes */ #include "script_component.hpp" -#define DISTANCE 10 +#define CHECK_DISTANCE 10 -private ["_position", "_positionX", "_positionY", "_positionZ", "_intersections"]; +params ["_unit"]; -PARAMS_1(_unit); +private ["_position", "_intersections"]; _position = eyePos _unit; -_positionX = _position select 0; -_positionY = _position select 1; -_positionZ = _position select 2; + _intersections = 0; -if (lineIntersects [_position, [_positionX, _positionY, _positionZ + DISTANCE]]) then { +if (lineIntersects [_position, _position vectorAdd [0, 0, +CHECK_DISTANCE]]) then { _intersections = _intersections + 1; }; -if (lineIntersects [_position, [_positionX + DISTANCE, _positionY, _positionZ]]) then { +if (lineIntersects [_position, _position vectorAdd [+CHECK_DISTANCE, 0, 0]]) then { _intersections = _intersections + 1; }; -if (lineIntersects [_position, [_positionX - DISTANCE, _positionY, _positionZ]]) then { +if (lineIntersects [_position, _position vectorAdd [-CHECK_DISTANCE, 0, 0]]) then { _intersections = _intersections + 1; }; -if (lineIntersects [_position, [_positionX, _positionY + DISTANCE, _positionZ]]) then { +if (lineIntersects [_position, _position vectorAdd [0, +CHECK_DISTANCE, 0]]) then { _intersections = _intersections + 1; }; -if (lineIntersects [_position, [_positionX, _positionY - DISTANCE, _positionZ]]) then { +if (lineIntersects [_position, _position vectorAdd [0, -CHECK_DISTANCE, 0]]) then { _intersections = _intersections + 1; }; diff --git a/addons/common/functions/fnc_isModLoaded.sqf b/addons/common/functions/fnc_isModLoaded.sqf index 622c27a94b..bfdf38f49c 100644 --- a/addons/common/functions/fnc_isModLoaded.sqf +++ b/addons/common/functions/fnc_isModLoaded.sqf @@ -1,13 +1,16 @@ -/** - * fn_isModLoaded_f.sqf - * Descr: Check in cfgPatches if modification is loaded +/* * Author: Glowbal + * Check in cfgPatches if modification is loaded * - * Arguments: [modName STRING (Classname of the mod in cfgPatches)] - * Return: BOOL true if modification is loaded - * PublicAPI: true + * Arguments: + * 0: Mod Name or Classname of the mod in cfgPatches + * + * Return Value: + * if modification is loaded + * + * Public: Yes */ #include "script_component.hpp" -(isClass (configFile >> "cfgPatches" >> (_this select 0))) \ No newline at end of file +isClass (configFile >> "cfgPatches" >> _this select 0) diff --git a/addons/common/functions/fnc_isPlayer.sqf b/addons/common/functions/fnc_isPlayer.sqf index 91e54a51c1..ac7d5bd786 100644 --- a/addons/common/functions/fnc_isPlayer.sqf +++ b/addons/common/functions/fnc_isPlayer.sqf @@ -1,21 +1,19 @@ /* * Author: bux578, commy2, akalegman - * * Checks if a unit is a player / curator controlled unit. * Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine) * * Arguments: - * 0: unit to be checked (object) - * 1: exclude remote controlled units (boolean) + * 0: unit to be checked + * 1: exclude remote controlled units * * Return Value: - * Bool: is unit a player? + * Is unit a player? + * + * Public: Yes */ #include "script_component.hpp" -private ["_unit", "_excludeRemoteControlled"]; - -_unit = _this select 0; -_excludeRemoteControlled = if (count _this > 1) then {_this select 1} else {false}; +params ["_unit", ["_excludeRemoteControlled", false]]; isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)}) diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index 35270ccfc4..15861938b8 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -1,39 +1,19 @@ /* * Author: commy2 - * * Check if the unit is in a vehicle and turned out. * - * Argument: - * 0: Unit, not the vehicle (Object) + * Arguments: + * 0: Unit, not the vehicle * - * Return value: - * Is the unit turned out or not? Will return false if there is no option to turn out in the first place. (Bool) + * Return Value: + * Is the unit turned out or not? Will return false if there is no option to turn out in the first place. + * + * Public: Yes + * + * Deprecated */ #include "script_component.hpp" -private ["_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"]; +params ["_unit"]; -PARAMS_1(_unit); -_vehicle = vehicle _unit; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_animation = animationState _unit; - -if (_unit == driver _vehicle) then { - _action = getText (_config >> "driverAction"); - _inAction = getText (_config >> "driverInAction"); -} else { - _turretIndex = [_unit] call FUNC(getTurretIndex); - - _config = [_config, _turretIndex] call FUNC(getTurretConfigPath); - - _action = getText (_config >> "gunnerAction"); - _inAction = getText (_config >> "gunnerInAction"); -}; - -if (_action == "" || {_inAction == ""} || {_action == _inAction}) exitWith {false}; - -_animation = toArray _animation; -_animation resize (count toArray _action); -_animation = toString _animation; - -_animation == _action +isTurnedOut _unit // return diff --git a/addons/common/functions/fnc_letterToCode.sqf b/addons/common/functions/fnc_letterToCode.sqf index 59243915f5..12e6cf72ce 100644 --- a/addons/common/functions/fnc_letterToCode.sqf +++ b/addons/common/functions/fnc_letterToCode.sqf @@ -1,4 +1,17 @@ -// by commy2 +/* + * Author: commy2 + * Converts some Arma Dik Codes to a key. + * + * Arguments: + * 0: Dik Code + * + * Return Value: + * Key + * + * Public: Yes + * + * Deprecated + */ #include "script_component.hpp" [-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index 0d206223d6..df88671405 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -3,18 +3,19 @@ * Calculate light intensity object 1 recieves from object 2 * * Arguments: - * 0: Object that recieves light (Object) - * 1: Object that emits light (Object) + * 0: Object that recieves light + * 1: Object that emits light * * Return Value: * Brightest light level * + * Public: Yes */ #include "script_component.hpp" -private ["_unitPos","_lightLevel"]; +params ["_unit", "_lightSource"]; -PARAMS_2(_unit,_lightSource); +private ["_unitPos", "_lightLevel"]; _unitPos = _unit modelToWorld (_unit selectionPosition "spine3"); _lightLevel = 0; diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index a144303d48..377412bd4c 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) +#define GROUP_SWITCH_ID QFUNC(loadPerson) params ["_caller", "_unit"]; diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf index 25a67b6079..0dc20849cb 100644 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -12,39 +12,43 @@ */ #include "script_component.hpp" -private ["_parseConfigForDisplayNames", "_name"]; +private ["_fnc_parseConfigForDisplayNames", "_name"]; + +_fnc_parseConfigForDisplayNames = { + params ["_optionEntry"]; -_parseConfigForDisplayNames = { - private ["_optionEntry", "_values", "_text"]; - _optionEntry = _this select 0; if !(isClass _optionEntry) exitwith {false}; + + private "_values"; _values = getArray (_optionEntry >> "values"); + _x set [3, getText (_optionEntry >> "displayName")]; _x set [4, getText (_optionEntry >> "description")]; _x set [5, _values]; _x set [8, getText (_optionEntry >> "category")]; { + private "_text"; _text = _x; - if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then { - _text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $ + + if (typeName _text == "STRING" && {count _text > 1} && {_text select [0, 1] == "$"}) then { + _text = localize (_text select [1]); //chop off the leading $ _values set [_forEachIndex, _text]; }; } forEach _values; - true; + true }; - // Iterate through settings { - _name = _x select 0; + _x params ["_name"]; - if !([configFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then { - if !([configFile >> "ACE_ServerSettings" >> _name] call _parseConfigForDisplayNames) then { - if !([missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then { + if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then { + if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then { + if !([missionConfigFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then { ACE_LOGWARNING_1("Setting found, but couldn't localize [%1] (server has but we don't?)",_name); }; }; }; - -} forEach GVAR(settings); + false +} count GVAR(settings); From f3a175e9d662e51697231244329b03664f6a45bc Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 21:15:06 +0200 Subject: [PATCH 087/311] remove obsolete private --- addons/common/functions/fnc_loadSettingsLocalizedText.sqf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf index 0dc20849cb..1e43359379 100644 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -12,8 +12,7 @@ */ #include "script_component.hpp" -private ["_fnc_parseConfigForDisplayNames", "_name"]; - +private "_fnc_parseConfigForDisplayNames"; _fnc_parseConfigForDisplayNames = { params ["_optionEntry"]; From 5f0d73bab69bc20bf984b3fb8042fa4d3b5dd734 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 18 Sep 2015 14:24:20 -0500 Subject: [PATCH 088/311] Cleanup more stuff --- .../fnc_changeProjectileDirection.sqf | 2 -- addons/common/functions/fnc_debug.sqf | 3 +-- addons/common/functions/fnc_doAnimation.sqf | 2 +- .../functions/fnc_execPersistentFnc.sqf | 2 -- addons/common/functions/fnc_execRemoteFnc.sqf | 2 -- .../common/functions/fnc_loadPersonLocal.sqf | 2 +- .../common/functions/fnc_resetAllDefaults.sqf | 4 +-- .../functions/fnc_pfhUpdateGForces.sqf | 2 -- .../functions/fnc_treatmentTourniquet.sqf | 2 +- .../functions/fnc_displayTemperature.sqf | 2 -- addons/overheating/functions/fnc_overheat.sqf | 2 -- addons/scopes/XEH_postInit.sqf | 25 ------------------- 12 files changed, 6 insertions(+), 44 deletions(-) diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index e8e71291d0..79b8c8aeea 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -17,8 +17,6 @@ params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]]; -//["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log); - private ["_vdir", "_dir", "_up", "_vlat", "_vup", "_vel"]; // get old direction vector diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 49e067f77d..1575aa404b 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -44,8 +44,7 @@ if (_level <= _defaultLoglevel) then { }; diag_log _message; - // pass it onwards to the log function: - // [0, [], compile format["%1",_msg], true] call FUNC(log); + }; true diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 5b7a1ed1bf..db9f1bacc4 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -81,4 +81,4 @@ switch (_priority) do { default {}; }; -["Anim", [_priority, _animation]] call FUNC(log); +TRACE_2("Anim",_priority, _animation); diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf index dd160b8bfd..9d15a7c9d1 100644 --- a/addons/common/functions/fnc_execPersistentFnc.sqf +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -23,8 +23,6 @@ _function = call compile (_this select 1); _unit = _this select 2; _name = _this select 3; -["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); - // execute function on every currently connected machine [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf index 1df17050e6..742ed543d3 100644 --- a/addons/common/functions/fnc_execRemoteFnc.sqf +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -29,8 +29,6 @@ if (isNil "_unit") then { _unit = 2; }; -["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); - if (typeName _unit == "SCALAR") exitWith { switch (_unit) do { case 0 : { diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index 2d8295e4af..896b0952f2 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -17,7 +17,7 @@ params ["_unit", "_vehicle", "_caller"]; if (!alive _unit) then { - _unit = [_unit, _caller] call FUNC(makeCopyOfBody); + // _unit = [_unit, _caller] call FUNC(makeCopyOfBody); //func does not exist }; private "_slotsOpen"; diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 164b8f5f3b..be2eec050a 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -17,9 +17,9 @@ _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { [true] call FUNC(setVolume); - [false] call FUNC(disableKeyInput); + // [false] call FUNC(disableKeyInput); //func does not exist if (["ace_medical"] call FUNC(isModLoaded)) then { - [false] call EFUNC(medical,effectBlackOut); + // [false] call EFUNC(medical,effectBlackOut); //func does not exist }; if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 55a41043b9..b7173f5742 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -87,8 +87,6 @@ if (_suitCoef == 0) then {_suitCoef = 0.001}; _gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG; _gRedOut = MINVIRTUALG / _classCoef; -["GForces", [], {format ["_g _gBO _coef: %1, %2, %3", _average, _gBlackOut, 2 * ((1.0 - ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) ^ 2) max 0) ]}] call EFUNC(common,log); - // @todo: Sort the interaction with medical if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then { [ACE_player, true, (10 + floor(random 5))] call EFUNC(medical,setUnconscious); diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 2a169a50d0..5d3ba6e1d4 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -28,7 +28,7 @@ if (count _items == 0) exitwith {false}; _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part == 0 || _part == 1) exitwith { - // [_caller,"You cannot apply a CAT on this body part!"] call EFUNC(common,sendHintTo); + // ["displayTextStructured", [_caller], ["You cannot apply a CAT on this body part!"]] call EFUNC(common,targetEvent); false; }; diff --git a/addons/overheating/functions/fnc_displayTemperature.sqf b/addons/overheating/functions/fnc_displayTemperature.sqf index 521b998fa7..73c790119d 100644 --- a/addons/overheating/functions/fnc_displayTemperature.sqf +++ b/addons/overheating/functions/fnc_displayTemperature.sqf @@ -28,8 +28,6 @@ _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "Weapo // Calculate cooling _temperature = [_temperature, _barrelMass, ACE_time - _time] call FUNC(cooldown); -//["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log); - // Store new temperature _time = ACE_time; _player setVariable [_string, [_temperature, _time], false]; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index ee1c8f9ff5..d7f40c4d91 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -165,8 +165,6 @@ if ("Jam" in (missionNamespace getvariable ["ACE_Debug", []])) then { _jamChance = 0.5; }; -["Overheating", [_temperature, _jamChance], {format ["Temperature: %1 - JamChance: %2", _this select 0, _this select 1]}] call EFUNC(common,log); - if (random 1 < _jamChance) then { [_unit, _weapon] call FUNC(jamWeapon); }; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 2614da0e19..bd81a0935b 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -136,28 +136,3 @@ if (!hasInterface) exitWith {}; }, {false}, [201, [true, true, false]], true] call cba_fnc_addKeybind; - -// init shortdot -GVAR(showShortdot) = false; - -["playerInventoryChanged", { - if (_this select 1 isEqualTo []) exitWith {}; //@todo fix eh - - private "_showShortdot"; - _showShortdot = _this select 1 select 9 select 2 == "ACE_optic_DMS"; - - if (GVAR(showShortdot)) then { - if (!_showShortdot) then { - // hide control and turn onDraw handler off - (uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull]) ctrlShow false; - GVAR(showShortdot) = false; - }; - } else { - if (_showShortdot) then { - // create control and turn onDraw handler on - ([QGVAR(reticle)] call BIS_fnc_rscLayer) cutRsc ["ACE_Shortdot_Reticle", "PLAIN", 0, false]; - (uiNamespace getVariable "ACE_ctrlShortdotReticle") ctrlSetText QUOTE(PATHTOF(data\reticles\ace_shortdot_reticle_1.paa)); - GVAR(showShortdot) = true; - }; - }; -}] call EFUNC(common,addEventHandler); From 85fd9d9d75301a89ad62a7777782e1582268fcf7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 21:46:21 +0200 Subject: [PATCH 089/311] more common code cleanup --- addons/common/XEH_preInit.sqf | 1 - addons/common/functions/fnc_debug.sqf | 8 +---- addons/common/functions/fnc_map.sqf | 14 +++----- .../common/functions/fnc_moduleCheckPBOs.sqf | 4 ++- .../functions/fnc_moduleLSDVehicles.sqf | 29 +++++++++++------ addons/common/functions/fnc_monitor.sqf | 1 - .../common/functions/fnc_moveToTempGroup.sqf | 32 ------------------- addons/common/functions/fnc_muteUnit.sqf | 19 +++++------ .../functions/fnc_muteUnitHandleInitPost.sqf | 15 +++++++-- .../functions/fnc_muteUnitHandleRespawn.sqf | 15 +++++++-- .../common/functions/fnc_numberToDigits.sqf | 3 +- .../functions/fnc_numberToDigitsString.sqf | 3 +- .../common/functions/fnc_numberToString.sqf | 3 +- .../common/functions/fnc_onAnswerRequest.sqf | 24 ++++++++------ addons/common/functions/fnc_playerSide.sqf | 2 +- 15 files changed, 82 insertions(+), 91 deletions(-) delete mode 100644 addons/common/functions/fnc_moveToTempGroup.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index a2994bc459..ba3372798a 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -132,7 +132,6 @@ PREP(loadSettingsLocalizedText); PREP(map); PREP(moduleCheckPBOs); PREP(moduleLSDVehicles); -PREP(moveToTempGroup); PREP(muteUnit); PREP(muteUnitHandleInitPost); PREP(muteUnitHandleRespawn); diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 49e067f77d..1be8370b34 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -29,13 +29,7 @@ _defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select if (_level <= _defaultLoglevel) then { private ["_prefix", "_message"]; - switch (_level) do { - case 0: {_prefix = "Error"}; - case 1: {_prefix = "Warn"}; - case 2: {_prefix = "Debug"}; - case 3: {_prefix = "Info"}; - default {_prefix = "Unknown"}; - }; + _prefix = ["Error", "Warn", "Debug", "Info"] select (_level min 3); _message = format ["[ACE %1] %2", _prefix, _msg]; diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf index bca205e34a..13e315924e 100644 --- a/addons/common/functions/fnc_map.sqf +++ b/addons/common/functions/fnc_map.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi, commy2 - * * Applies given code to every element in an array, LIKE SOMETHING SQF SHOULD HAVE BY DEFAULT. * * Arguments: @@ -12,18 +11,15 @@ * * Usage: * [["2", "gobblecock", "25"], {parseNumber _this}] call FUNC(map) ==> [2, 0, 25] + * + * Public: No */ #include "script_component.hpp" -private ["_array", "_code"]; +params ["_array", "_code"]; -_array = + _this select 0; -_code = _this select 1; - -if (isNil "_array") exitWith { - ACE_LOGERROR_1("No array for function map in %1.",_fnc_scriptNameParent); - [] -}; +// copy array to not alter the original one +_array = + _array; { _array set [_forEachIndex, _x call _code]; diff --git a/addons/common/functions/fnc_moduleCheckPBOs.sqf b/addons/common/functions/fnc_moduleCheckPBOs.sqf index 0288badf2d..4585682496 100644 --- a/addons/common/functions/fnc_moduleCheckPBOs.sqf +++ b/addons/common/functions/fnc_moduleCheckPBOs.sqf @@ -9,12 +9,14 @@ * * Return Value: * None + * + * Public: No */ #include "script_component.hpp" if !(isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index 0814451f79..dbb04c5efa 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -8,21 +8,25 @@ * * Return Value: * None + * + * Public: No */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); - -private["_colors", "_hSCount", "_hiddenSelections", "_i", "_index", "_vehicle"]; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; { - _hiddenSelections = count (getArray (configFile >> "CfgVehicles" >> (typeOf _x) >> "hiddenSelections")); - if (_hiddenSelections > 0) then { - nul = [_x, _hiddenSelections] spawn { - _vehicle = _this select 0; - _hSCount = _this select 1; + private "_hSCount"; + _hSCount = count (getArray (configFile >> "CfgVehicles" >> typeOf _x >> "hiddenSelections")); + + if (_hSCount > 0) then { + [_x, _hSCount] spawn { + params ["_vehicle", "_hSCount"]; + + private ["_colors", "_index"]; + _colors = [ "#(argb,8,8,3)color(1,0,0,1,co)", "#(argb,8,8,3)color(1,0.5,0,1,co)", @@ -32,16 +36,21 @@ if !(_activated) exitWith {}; "#(argb,8,8,3)color(0.2,0,0.5,1,co)", "#(argb,8,8,3)color(0.5,0,1,1,co)" ]; + _index = 0; - while {True} do { + + while {true} do { for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, (_colors select _index)]; + _vehicle setObjectTexture [_i, _colors select _index]; }; + _index = (_index + 1) % 7; + sleep 0.02; }; }; }; + false } count _units; ACE_LOGINFO("WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE."); diff --git a/addons/common/functions/fnc_monitor.sqf b/addons/common/functions/fnc_monitor.sqf index a05abb68c4..4672d6eec0 100644 --- a/addons/common/functions/fnc_monitor.sqf +++ b/addons/common/functions/fnc_monitor.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * hint retun value of given function every frame * * Argument: diff --git a/addons/common/functions/fnc_moveToTempGroup.sqf b/addons/common/functions/fnc_moveToTempGroup.sqf deleted file mode 100644 index be7335c705..0000000000 --- a/addons/common/functions/fnc_moveToTempGroup.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * fn_moveToTempGroup_f.sqf - * Moves a unit into a temporarly group and stores its original group to allow rejoining. - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, moveToTempGroup BOOL] - * @Return: void - * @PublicAPI: false - */ - -#include "script_component.hpp" - -private ["_unit","_moveTo","_previousGroup","_newGroup", "_currentGroup"]; -_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_moveTo = [_this, 1,false,[false]] call BIS_fnc_Param; - -if (_moveTo) then { - _previousGroup = group _unit; - _newGroup = createGroup (side _previousGroup); - [_unit] joinSilent _newGroup; - _unit setvariable [QGVAR(previousGroup),_previousGroup]; -} else { - _previousGroup = _unit getvariable QGVAR(previousGroup); - if (!isnil "_previousGroup") then { - _currentGroup = group _unit; - _unit setvariable [QGVAR(previousGroup),nil]; - [_unit] joinSilent _previousGroup; - if (count units _currentGroup == 0) then { - deleteGroup _currentGroup; - }; - }; -}; \ No newline at end of file diff --git a/addons/common/functions/fnc_muteUnit.sqf b/addons/common/functions/fnc_muteUnit.sqf index 1eceff744c..84d56f92bd 100644 --- a/addons/common/functions/fnc_muteUnit.sqf +++ b/addons/common/functions/fnc_muteUnit.sqf @@ -1,23 +1,25 @@ /* * Author: commy2 - * * Mutes the unit. It won't trigger auto generated chat messages either. * - * Argument: - * 0: Unit (Object) - * 1: Reason to mute the unit (String) + * Arguments: + * 0: Unit + * 1: Reason to mute the unit * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_unit,_reason); +params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; +private ["_muteUnitReasons", "_speaker"]; + // add reason to mute to the unit -private "_muteUnitReasons"; _muteUnitReasons = _unit getVariable [QGVAR(muteUnitReasons), []]; if !(_reason in _muteUnitReasons) then { @@ -25,7 +27,6 @@ if !(_reason in _muteUnitReasons) then { _unit setVariable [QGVAR(muteUnitReasons), _muteUnitReasons, true]; }; -private "_speaker"; _speaker = speaker _unit; if (_speaker == "ACE_NoVoice") exitWith {}; diff --git a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf index a257a22ea0..8c5967b0d3 100644 --- a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf +++ b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf @@ -1,7 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Applies speaker changes on init post. Used because setSpeaker is broken on init. + * + * Arguments: + * 0: unit + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; // setSpeaker gets overwritten after init on remote units; if unit is muted, setSpeaker again if (count (_unit getVariable [QGVAR(muteUnitReasons), []]) > 0) then { diff --git a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf index 5cef18a0b3..a1a64eada3 100644 --- a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf +++ b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf @@ -1,7 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Applies speaker changes on respawn. Used because speaker is respawning breaks the speaker on non-local clients. Also resets the public object variable (broken for JIP clients, that join after respawn) + * + * Arguments: + * 0: unit + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; // setVariable is broken on JIP after respawn _unit setVariable [QGVAR(muteUnitReasons), _unit getVariable [QGVAR(muteUnitReasons), []], true]; diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf index 851ce1bb48..c5e1b6d7b6 100644 --- a/addons/common/functions/fnc_numberToDigits.sqf +++ b/addons/common/functions/fnc_numberToDigits.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Transforms a number to an array of the correspondending digits. * * Arguments: @@ -8,7 +7,7 @@ * 1: Set the minimal length of the returned array. Useful for getting left hand zeroes. , optional * * Return Value: - * Digits. The maximum count is six digits. (Array) + * Digits. The maximum count is six digits. * * Public: Yes */ diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf index b507545573..f8f192e0e3 100644 --- a/addons/common/functions/fnc_numberToDigitsString.sqf +++ b/addons/common/functions/fnc_numberToDigitsString.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Transforms a number to an string of the correspondending digits. * * Arguments: @@ -8,7 +7,7 @@ * 1: Set the minimal length of the returned string. Useful for getting left hand zeroes. (Number, optional) * * Return Value: - * Digits. The maximum length is six digits. (String) + * Digits. The maximum length is six digits. * * Public: Yes */ diff --git a/addons/common/functions/fnc_numberToString.sqf b/addons/common/functions/fnc_numberToString.sqf index 4e11668cd8..4dd810607c 100644 --- a/addons/common/functions/fnc_numberToString.sqf +++ b/addons/common/functions/fnc_numberToString.sqf @@ -1,13 +1,12 @@ /* * Author: commy2 - * * Converts a number to a string without losing as much precission as str or format. * * Arguments: * 0: A number * * Return Value: - * The number as string (String) + * The number as string * * Public: Yes */ diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf index a8dd2ce351..b1639eb970 100644 --- a/addons/common/functions/fnc_onAnswerRequest.sqf +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -1,19 +1,23 @@ -/** - * fn_onAnswerRequest.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal + * N/A * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: No */ #include "script_component.hpp" +params ["_unit", "_id", "_accepted"]; + private ["_requestID", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; -PARAMS_3(_unit,_id,_accepted); - _info = _unit getvariable _id; + if (!isnil "_info") then { _caller = _info select 0; _target = _info select 1; @@ -21,7 +25,7 @@ if (!isnil "_info") then { _requestMessage = _info select 3; _callBack = _info select 4; _replyParams = [_info, _accepted]; - [_replyParams, QUOTE(FUNC(requestCallback)), _caller, false] call FUNC(execRemoteFnc); + [_replyParams, QFUNC(requestCallback), _caller, false] call FUNC(execRemoteFnc); _unit setvariable [_id, nil]; }; diff --git a/addons/common/functions/fnc_playerSide.sqf b/addons/common/functions/fnc_playerSide.sqf index a264e82942..1607b5b7fc 100644 --- a/addons/common/functions/fnc_playerSide.sqf +++ b/addons/common/functions/fnc_playerSide.sqf @@ -7,7 +7,7 @@ * None * * Return Value: - * current local side (Side) + * current local side * * Public: Yes */ From 2e48a92eefbd60449ffb423be94c06ea176ef875 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 22:25:09 +0200 Subject: [PATCH 090/311] fix ai seemingly reloading disposable launcher at mission start, fix #2508 --- addons/disposable/CfgVehicles.hpp | 102 +++++++++--------- .../functions/fnc_takeLoadedATWeapon.sqf | 2 + 2 files changed, 53 insertions(+), 51 deletions(-) diff --git a/addons/disposable/CfgVehicles.hpp b/addons/disposable/CfgVehicles.hpp index 13d4cedf4b..0ad3ff51c0 100644 --- a/addons/disposable/CfgVehicles.hpp +++ b/addons/disposable/CfgVehicles.hpp @@ -1,5 +1,5 @@ class CfgVehicles { -#define MACRO_NONLAW \ + #define MACRO_NONLAW \ class TransportMagazines { \ class _xx_NLAW_F { \ count = 0; \ @@ -73,56 +73,56 @@ class CfgVehicles { MACRO_NONLAW }; /*class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F { - MACRO_NONLAW -}; -class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { - MACRO_NONLAW -}; -class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { - MACRO_NONLAW -}; -class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - MACRO_NONLAW -};*/ + MACRO_NONLAW + }; + class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { + MACRO_NONLAW + }; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + MACRO_NONLAW + }; + class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { + MACRO_NONLAW + };*/ class Car_F; class MRAP_01_base_F: Car_F { MACRO_NONLAW }; /*class MRAP_01_gmg_base_F: MRAP_01_base_F { - MACRO_NONLAW -}; -class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F { - MACRO_NONLAW -}; -class B_MRAP_01_F: MRAP_01_base_F { - MACRO_NONLAW -}; -class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { - MACRO_NONLAW -}; -class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { - MACRO_NONLAW -};*/ + MACRO_NONLAW + }; + class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F { + MACRO_NONLAW + }; + class B_MRAP_01_F: MRAP_01_base_F { + MACRO_NONLAW + }; + class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { + MACRO_NONLAW + }; + class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { + MACRO_NONLAW + };*/ class MRAP_03_base_F: Car_F { MACRO_NONLAW }; /*class MRAP_03_hmg_base_F: MRAP_03_base_F { - MACRO_NONLAW -}; -class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F { - MACRO_NONLAW -}; -class I_MRAP_03_F: MRAP_03_base_F { - MACRO_NONLAW -}; -class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { - MACRO_NONLAW -}; -class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { - MACRO_NONLAW -};*/ + MACRO_NONLAW + }; + class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F { + MACRO_NONLAW + }; + class I_MRAP_03_F: MRAP_03_base_F { + MACRO_NONLAW + }; + class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { + MACRO_NONLAW + }; + class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { + MACRO_NONLAW + };*/ class Wheeled_APC_F: Car_F {}; class APC_Wheeled_03_base_F: Wheeled_APC_F { @@ -132,15 +132,15 @@ class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { MACRO_NONLAW }; /*class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F { - MACRO_NONLAW -}; -class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { - MACRO_NONLAW -}; -class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F { - MACRO_NONLAW -}; -class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { - MACRO_NONLAW -};*/ + MACRO_NONLAW + }; + class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { + MACRO_NONLAW + }; + class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F { + MACRO_NONLAW + }; + class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { + MACRO_NONLAW + };*/ }; diff --git a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf index b379584b68..de7cdefd70 100644 --- a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf +++ b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf @@ -36,6 +36,7 @@ if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber if (backpack _unit == "") then { _unit addBackpack "Bag_Base"; + _unit removeWeapon _launcher; _unit addMagazine _magazine; _didAdd = _magazine in (magazines _unit); _unit addWeapon _launcher; @@ -45,6 +46,7 @@ if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber }; removeBackpack _unit; } else { + _unit removeWeapon _launcher; _unit addMagazine _magazine; _didAdd = _magazine in (magazines _unit); _unit addWeapon _launcher; From 56f4cbb39e39c42397d73d938f7b30fc0cedd583 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 23:03:35 +0200 Subject: [PATCH 091/311] fix playerInventoryChanged eventhandler triggers when current weapon is changed fix #2513 --- addons/common/functions/fnc_getAllGear.sqf | 7 ++----- addons/respawn/functions/fnc_handleKilled.sqf | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/common/functions/fnc_getAllGear.sqf b/addons/common/functions/fnc_getAllGear.sqf index 33c23c98a3..aa2289309e 100644 --- a/addons/common/functions/fnc_getAllGear.sqf +++ b/addons/common/functions/fnc_getAllGear.sqf @@ -18,7 +18,6 @@ * 14-16: pistol (String, Array, Array) * 17: map, compass, watch, etc. (Array) * 18: binocluar (String) - * 19: active weapon, active muzzle, active weaponMode (Array) * */ #include "script_component.hpp" @@ -35,8 +34,7 @@ if (isNull _unit) exitWith {[ "", ["","","",""], [], "", ["","","",""], [], [], - "", - ["","",""] + "" ]}; [ @@ -49,6 +47,5 @@ if (isNull _unit) exitWith {[ secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit, handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit, assignedItems _unit, - binocular _unit, - [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit] + binocular _unit ] diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 1fea488421..84b84e20cd 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -25,6 +25,7 @@ if (ACE_player == _killedUnit) then { if (GVAR(SavePreDeathGear)) then { GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); + GVAR(unitGear) append [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; }; }; From 30ba4f55862bfa2a7cf2e8d268b29851eb8c8648 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 18 Sep 2015 23:34:49 +0200 Subject: [PATCH 092/311] this append should've been pushBack --- addons/respawn/functions/fnc_handleKilled.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 84b84e20cd..99ec308c1c 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -25,7 +25,7 @@ if (ACE_player == _killedUnit) then { if (GVAR(SavePreDeathGear)) then { GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); - GVAR(unitGear) append [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; + GVAR(unitGear) pushBack [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; }; }; From f8ecf1b8ab9f4d67ef5a4aeac29da2cd1fb669f9 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 00:30:36 +0200 Subject: [PATCH 093/311] fnc_debug was broken --- addons/common/functions/fnc_debug.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 1be8370b34..f09215e200 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -29,7 +29,7 @@ _defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select if (_level <= _defaultLoglevel) then { private ["_prefix", "_message"]; - _prefix = ["Error", "Warn", "Debug", "Info"] select (_level min 3); + _prefix = ["Unknown", "Error", "Warn", "Debug", "Info"] select ([0, 1, 2, 3] find _level + 1); _message = format ["[ACE %1] %2", _prefix, _msg]; From f2070deee8d9023949654a3ebd22f3414da6c785 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sat, 19 Sep 2015 01:12:03 +0200 Subject: [PATCH 094/311] Change spawn while to CBA PFH --- .../functions/fnc_moduleLSDVehicles.sqf | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index dbb04c5efa..3130609ca9 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi + * Author: KoffeinFlummi, joko // Jonas * * Nothing to see here, move along. * @@ -13,44 +13,50 @@ */ #include "script_component.hpp" -params ["_logic", "_units", "_activated"]; +params ["", "_units", "_activated"]; if !(_activated) exitWith {}; +if (isNil QGVAR(LSD_Vehicles)) then { + GVAR(LSD_Vehicles) = []; +}; + +if (isNil QGVAR(LSD_Colors)) then { + GVAR(LSD_Colors) = [ + "#(argb,8,8,3)color(1,0,0,1,co)", + "#(argb,8,8,3)color(1,0.5,0,1,co)", + "#(argb,8,8,3)color(1,1,0,1,co)", + "#(argb,8,8,3)color(0,1,0,1,co)", + "#(argb,8,8,3)color(0,0,1,1,co)", + "#(argb,8,8,3)color(0.2,0,0.5,1,co)", + "#(argb,8,8,3)color(0.5,0,1,1,co)" + ]; +}; + +if (isNil QGVAR(LSD_index)) then { + GVAR(LSD_index) = 0; +}; + +GVAR(LSD_ColorsCount) = count GVAR(LSD_Colors); + { - private "_hSCount"; _hSCount = count (getArray (configFile >> "CfgVehicles" >> typeOf _x >> "hiddenSelections")); - if (_hSCount > 0) then { - [_x, _hSCount] spawn { - params ["_vehicle", "_hSCount"]; - - private ["_colors", "_index"]; - - _colors = [ - "#(argb,8,8,3)color(1,0,0,1,co)", - "#(argb,8,8,3)color(1,0.5,0,1,co)", - "#(argb,8,8,3)color(1,1,0,1,co)", - "#(argb,8,8,3)color(0,1,0,1,co)", - "#(argb,8,8,3)color(0,0,1,1,co)", - "#(argb,8,8,3)color(0.2,0,0.5,1,co)", - "#(argb,8,8,3)color(0.5,0,1,1,co)" - ]; - - _index = 0; - - while {true} do { - for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, _colors select _index]; - }; - - _index = (_index + 1) % 7; - - sleep 0.02; - }; - }; + GVAR(LSD_Vehicles) pushBack [_x, _hSCount]; }; - false + nil } count _units; -ACE_LOGINFO("WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE."); +if (isNil QGVAR(LSD_PFH)) then { + GVAR(LSD_PFH) = [{ + { + params ["_vehicle", "_hSCount"]; + for "_i" from 0 to (_hSCount - 1) do { + _vehicle setObjectTexture [_i, _colors select GVAR(LSD_index)]; + }; + nil + } count GVAR(LSD_Vehicles); + GVAR(LSD_index) = ((GVAR(LSD_index) + 1) % 7) mod GVAR(LSD_ColorsCount); + }, 0.02, []] call CBA_fnc_addPerFrameHandler; +}; +ACE_LOGINFO("WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED."); From c7d636a533a49d3939392338e4d41a28716447fd Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 01:50:17 +0200 Subject: [PATCH 095/311] more common code cleanup --- addons/common/XEH_preInit.sqf | 1 - .../functions/fnc_addActionEventHandler.sqf | 2 + .../fnc_addActionMenuEventHandler.sqf | 2 +- addons/common/functions/fnc_progressBar.sqf | 36 +++++----- .../common/functions/fnc_queueAnimation.sqf | 10 --- .../functions/fnc_readSettingFromModule.sqf | 10 +-- .../common/functions/fnc_receiveRequest.sqf | 69 +++++++++++-------- .../fnc_removeActionEventHandler.sqf | 30 ++++---- .../fnc_removeActionMenuEventHandler.sqf | 30 ++++---- .../functions/fnc_removeAllEventHandlers.sqf | 23 ++++--- .../fnc_removeCanInteractWithCondition.sqf | 17 +++-- .../functions/fnc_removeEventHandler.sqf | 25 ++++--- 12 files changed, 129 insertions(+), 126 deletions(-) delete mode 100644 addons/common/functions/fnc_queueAnimation.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index ba3372798a..10bdc3f6ea 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -144,7 +144,6 @@ PREP(player); PREP(playerSide); PREP(positionToASL); PREP(progressBar); -PREP(queueAnimation); PREP(readSettingFromModule); PREP(receiveRequest); PREP(removeCanInteractWithCondition); diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf index d9946207f8..4d7d96bd44 100644 --- a/addons/common/functions/fnc_addActionEventHandler.sqf +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -10,6 +10,8 @@ * * Return Value: * ID of the action (used to remove it later) + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf index 9c7a63fb86..279842ae5c 100644 --- a/addons/common/functions/fnc_addActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -14,7 +14,7 @@ * * Return Value: * ID of the action (used to remove it later) - * + * * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index adc1b8d4c3..29db1cd0c6 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -1,10 +1,9 @@ /* * Author: commy2, Glowbal, PabstMirror - * * Draw progress bar and execute given function if succesful. * Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] * - * Argument: + * Arguments: * 0: NUMBER - Total Time (in game "ACE_time" seconds) * 1: ARRAY - Arguments, passed to condition, fail and finish * 2: CODE or STRING - On Finish: Code called or STRING raised as event. @@ -13,26 +12,26 @@ * 5: CODE - (Optional) Code to check each frame * 6: ARRAY - (Optional) Exceptions for checking EFUNC(common,canInteractWith) * - * Return value: + * Return Value: * Nothing * * Example: * [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar + * + * Public: Yes */ - #include "script_component.hpp" -PARAMS_4(_totalTime,_args,_onFinish,_onFail); -DEFAULT_PARAM(4,_localizedTitle,""); -DEFAULT_PARAM(5,_condition,{true}); -DEFAULT_PARAM(6,_exceptions,[]); -private ["_player", "_perFrameFunction", "_ctrlPos"]; +params ["_totalTime", "_args", "_onFinish", "_onFail", ["_localizedTitle", ""], ["_condition", {true}], ["_exceptions", []]]; + +private ["_player", "_ctrlPos", "_fnc_perFrameFunction"]; _player = ACE_player; //Open Dialog and set the title closeDialog 0; createDialog QGVAR(ProgressBar_Dialog); + (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle; //Adjust position based on user setting: @@ -46,11 +45,9 @@ _ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; +_fnc_perFrameFunction = { + (_this select 0) params ["_args", "_onFinish", "_onFail", "_condition", "_player", "_startTime", "_totalTime", "_exceptions"]; - -_perFrameFunction = { - PARAMS_2(_parameters,_pfhID); - EXPLODE_8_PVT(_parameters,_args,_onFinish,_onFail,_condition,_player,_startTime,_totalTime,_exceptions); private ["_elapsedTime", "_errorCode"]; _elapsedTime = ACE_time - _startTime; @@ -63,10 +60,10 @@ _perFrameFunction = { if (ACE_player != _player || !alive _player) then { _errorCode = 2; } else { - if (!([_args, _elapsedTime, _totalTime, _errorCode] call _condition)) then { + if !([_args, _elapsedTime, _totalTime, _errorCode] call _condition) then { _errorCode = 3; } else { - if (!([_player, objNull, _exceptions] call EFUNC(common,canInteractWith))) then { + if !([_player, objNull, _exceptions] call EFUNC(common,canInteractWith)) then { _errorCode = 4; } else { if (_elapsedTime >= _totalTime) then { @@ -84,16 +81,17 @@ _perFrameFunction = { if (!isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then { closeDialog 0; }; - [_pfhID] call CBA_fnc_removePerFrameHandler; + + [_this select 1] call CBA_fnc_removePerFrameHandler; if (_errorCode == 0) then { - if ((typeName _onFinish) == (typeName "")) then { + if (typeName _onFinish == "STRING") then { [_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent); } else { [_args, _elapsedTime, _totalTime, _errorCode] call _onFinish; }; } else { - if ((typeName _onFail) == (typeName "")) then { + if (typeName _onFail == "STRING") then { [_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent); } else { [_args, _elapsedTime, _totalTime, _errorCode] call _onFail; @@ -105,4 +103,4 @@ _perFrameFunction = { }; }; -[_perFrameFunction, 0, [_args, _onFinish, _onFail, _condition, _player, ACE_time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler; +[_fnc_perFrameFunction, 0, [_args, _onFinish, _onFail, _condition, _player, ACE_time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_queueAnimation.sqf b/addons/common/functions/fnc_queueAnimation.sqf deleted file mode 100644 index 73f3dca109..0000000000 --- a/addons/common/functions/fnc_queueAnimation.sqf +++ /dev/null @@ -1,10 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -terminate (missionNamespace getVariable [QGVAR(waitForAnimationHandle), scriptNull]); - -GVAR(waitForAnimationHandle) = _this spawn { - waitUntil {!([_this select 0] call FUNC(inTransitionAnim))}; - - _this call FUNC(doAnimation); -}; diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index 545a93deba..25158779e7 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -5,18 +5,20 @@ * Must be called on the server, effect is global. * * Arguments: - * 0: Module (Object) - * 1: ACE_Parameter name (string) - * 2: Module parameter name (string) + * 0: Module + * 1: ACE_Parameter name + * 2: Module parameter name * * Return Value: * None + * + * Public: No */ #include "script_component.hpp" if !(isServer) exitWith {}; -PARAMS_3(_logic,_settingName,_moduleVariable); +params ["_logic", "_settingName", "_moduleVariable"]; // Check if the parameter is defined in the module if (isNil {_logic getVariable _moduleVariable}) exitWith { diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index dc028724f6..1377f4ec35 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -1,37 +1,41 @@ -/** - * fn_recieveRequest.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal + * N/A * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No */ - #include "script_component.hpp" -PARAMS_5(_caller,_target,_requestID,_requestMessage,_callBack); +params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; _requestID = ("ace_recieveRequest_f_id_"+_requestID); -_target setvariable [_requestID, _this]; +_target setVariable [_requestID, _this]; if (isLocalized _requestMessage) then { - _requestMessage = format[localize _requestMessage,[_caller] call FUNC(getName)]; + _requestMessage = format [localize _requestMessage, [_caller] call FUNC(getName)]; } else { - _requestMessage = format[_requestMessage,[_caller] call FUNC(getName)]; + _requestMessage = format [_requestMessage, [_caller] call FUNC(getName)]; }; -hint format["%1",_requestMessage]; -if !(isnil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then { +hint format ["%1", _requestMessage]; // @todo ? + +if !(isNil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then { terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT); }; -if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { +if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; }; -if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { + +if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; }; @@ -41,24 +45,31 @@ GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = _target addAction ["Decline", compile GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = _requestID; -GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [ACE_time, _target, _requestID] spawn { - private["_id", "_t", "_requestID", "_target"]; - _t = (_this select 0) + 40; - _target = _this select 1; - _requestID = _this select 2; - _id = _target getvariable _requestID; - waituntil { - _id = _target getvariable _requestID; +GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [ACE_time, _target, _requestID] spawn { // @todo + params ["_time", "_target", "_requestID"]; + + _time = _time + 40; + + private "_id"; + _id = _target getVariable _requestID; + + waituntil { + _id = _target getVariable _requestID; + + (ACE_time > _time || isNil "_id") + }; + + _target setVariable [_requestID, nil]; - (ACE_time > _t || isnil "_id")}; - _target setvariable [_requestID, nil]; GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; - if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { + + if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; }; - if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { + + if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; }; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_removeActionEventHandler.sqf b/addons/common/functions/fnc_removeActionEventHandler.sqf index 805a0bdde9..b22ed0f152 100644 --- a/addons/common/functions/fnc_removeActionEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionEventHandler.sqf @@ -1,34 +1,30 @@ /* * Author: commy2 - * * Remove an addAction event from a unit. * - * Argument: - * 0: Unit the action is assigned to (Object) - * 1: Name of the action, e.g. "DefaultAction" (String) - * 2: ID of the action (Number) + * Arguments: + * 0: Unit the action is assigned to + * 1: Name of the action, e.g. "DefaultAction" + * 2: ID of the action * - * Return value: - * None. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_name", "_actionsVar", "_actionID", "_actions", "_currentID", "_actionIDs"]; - -PARAMS_3(_unit,_action,_id); +params ["_unit", "_action", "_id"]; if (_id == -1) exitWith {}; -_name = format ["ACE_Action_%1", _action]; +private ["_name", "_actionsVar"]; +_name = format ["ACE_Action_%1", _action]; _actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; -_actionID = _actionsVar select 0; -_actions = _actionsVar select 1; - -_currentID = _actions select 0; -_actionIDs = _actions select 1; -_actions = _actions select 2; +_actionsVar params ["_actionID", "_actionsArray"]; +_actionsArray params ["_currentID", "_actionIDs", "_actions"]; if (_unit != _actionsVar select 2) exitWith {}; diff --git a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf index b45476a3da..e5adbe0c01 100644 --- a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf @@ -1,39 +1,37 @@ /* * Author: commy2 + * Remove an addAction menu event from a unit. * - * Remove an addAction event from a unit. + * Arguments: + * 0: Unit the action is assigned to + * 1: Name of the action, e.g. "DefaultAction" + * 2: ID of the action * - * Argument: - * 0: Unit the action is assigned to (Object) - * 1: Name of the action, e.g. "DefaultAction" (String) - * 2: ID of the action (Number) + * Return Value: + * None * - * Return value: - * None. + * Public: No */ #include "script_component.hpp" -private ["_name", "_actionsVar", "_currentID", "_actionIDs", "_actions", "_actionID", "_nameVar"]; - -PARAMS_3(_unit,_action,_id); +params ["_unit", "_action", "_id"]; if (_id == -1) exitWith {}; -_name = format ["ACE_ActionMenu_%1", _action]; +private ["_name", "_actionsVar"]; +_name = format ["ACE_ActionMenu_%1", _action]; _actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; -_currentID = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; +_actionsVar params ["_currentID", "_actionIDs", "_actions"]; _id = _actionIDs find _id; if (_id == -1) exitWith {}; _action = _actions select _id; -_actionID = _action select 0; -_nameVar = _action select 1; + +_action params ["_actionID", "_nameVar"]; missionNamespace setVariable [_nameVar, nil]; diff --git a/addons/common/functions/fnc_removeAllEventHandlers.sqf b/addons/common/functions/fnc_removeAllEventHandlers.sqf index 6bf4dc742a..1a1a6e255f 100644 --- a/addons/common/functions/fnc_removeAllEventHandlers.sqf +++ b/addons/common/functions/fnc_removeAllEventHandlers.sqf @@ -1,21 +1,26 @@ /* * Author: Nou - * * Remove all events of a certain event type. * * Argument: - * 0: Event name (string) + * 0: Event name * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_eventNames", "_eventFunctions", "_eventIndex"]; -PARAMS_1(_eventName); -_eventNames = GVAR(events) select 0; +params ["_eventName"]; + +GVAR(events) params ["_eventNames", "_events"]; + +private ["_eventFunctions", "_eventIndex"]; + _eventFunctions = []; _eventIndex = _eventNames find _eventName; + if (_eventIndex != -1) then { - (GVAR(events) select 1) set [_eventIndex, []]; -}; \ No newline at end of file + _events set [_eventIndex, []]; +}; diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index 6cfd751c4c..5f8ca43467 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -4,24 +4,23 @@ * Remove a condition that gets checked by ace_common_fnc_canInteractWith. * * Arguments: - * 0: The conditions id. (String) + * 0: The conditions id. * * Return Value: - * Unit can interact? + * None * + * Public: No */ #include "script_component.hpp" -private "_conditionName"; +params ["_conditionName"]; -_conditionName = toLower (_this select 0); - -private ["_conditions", "_conditionNames", "_conditionFuncs"]; +_conditionName = toLower _conditionName; +private "_conditions"; _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditionNames = _conditions select 0; -_conditionFuncs = _conditions select 1; +_conditions params ["_conditionNames", "_conditionFuncs"]; private "_index"; _index = _conditionNames find _conditionName; @@ -31,4 +30,4 @@ if (_index == -1) exitWith {}; _conditionNames deleteAt _index; _conditionFuncs deleteAt _index; -GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs]; +GVAR(InteractionConditions) = _conditions; diff --git a/addons/common/functions/fnc_removeEventHandler.sqf b/addons/common/functions/fnc_removeEventHandler.sqf index 16954d5523..c869b3d0cc 100644 --- a/addons/common/functions/fnc_removeEventHandler.sqf +++ b/addons/common/functions/fnc_removeEventHandler.sqf @@ -1,25 +1,28 @@ /* * Author: Nou - * * Remove an event handler. * * Argument: - * 0: Event name (string) - * 1: Event code (number) + * 0: Event name + * 1: Event code * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_eventNames", "_eventFunctions", "_eventIndex"]; -PARAMS_2(_eventName,_eventCodeIndex); +params ["_eventName", "_eventCodeIndex"]; + +GVAR(events) params ["_eventNames", "_events"]; + +private ["_eventFunctions", "_eventIndex"]; -_eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; if (_eventIndex != -1) then { - _eventFunctions = (GVAR(events) select 1) select _eventIndex; - _eventFunctions set[_eventCodeIndex, nil]; -}; \ No newline at end of file + _eventFunctions = _events select _eventIndex; + _eventFunctions set [_eventCodeIndex, nil]; +}; From 1357d72f169a0990bb355a07f6e606d50017f62a Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 02:44:02 +0200 Subject: [PATCH 096/311] fix broken LSD module --- addons/common/functions/fnc_moduleLSDVehicles.sqf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index 3130609ca9..b7e9a1cf40 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -13,6 +13,16 @@ */ #include "script_component.hpp" +#define COLORS [ \ + "#(argb,8,8,3)color(1,0,0,1,co)", \ + "#(argb,8,8,3)color(1,0.5,0,1,co)", \ + "#(argb,8,8,3)color(1,1,0,1,co)", \ + "#(argb,8,8,3)color(0,1,0,1,co)", \ + "#(argb,8,8,3)color(0,0,1,1,co)", \ + "#(argb,8,8,3)color(0.2,0,0.5,1,co)", \ + "#(argb,8,8,3)color(0.5,0,1,1,co)" \ +] + params ["", "_units", "_activated"]; if !(_activated) exitWith {}; @@ -50,9 +60,9 @@ GVAR(LSD_ColorsCount) = count GVAR(LSD_Colors); if (isNil QGVAR(LSD_PFH)) then { GVAR(LSD_PFH) = [{ { - params ["_vehicle", "_hSCount"]; + _x params ["_vehicle", "_hSCount"]; for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, _colors select GVAR(LSD_index)]; + _vehicle setObjectTexture [_i, COLORS select GVAR(LSD_index)]; }; nil } count GVAR(LSD_Vehicles); From e08c6c343efe86b605cd619696f87cde1b0dc7d2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 09:24:28 +0200 Subject: [PATCH 097/311] fix LSD module, cutback on global variable usage --- .../functions/fnc_moduleLSDVehicles.sqf | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index b7e9a1cf40..cb46ae6796 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -31,24 +31,6 @@ if (isNil QGVAR(LSD_Vehicles)) then { GVAR(LSD_Vehicles) = []; }; -if (isNil QGVAR(LSD_Colors)) then { - GVAR(LSD_Colors) = [ - "#(argb,8,8,3)color(1,0,0,1,co)", - "#(argb,8,8,3)color(1,0.5,0,1,co)", - "#(argb,8,8,3)color(1,1,0,1,co)", - "#(argb,8,8,3)color(0,1,0,1,co)", - "#(argb,8,8,3)color(0,0,1,1,co)", - "#(argb,8,8,3)color(0.2,0,0.5,1,co)", - "#(argb,8,8,3)color(0.5,0,1,1,co)" - ]; -}; - -if (isNil QGVAR(LSD_index)) then { - GVAR(LSD_index) = 0; -}; - -GVAR(LSD_ColorsCount) = count GVAR(LSD_Colors); - { _hSCount = count (getArray (configFile >> "CfgVehicles" >> typeOf _x >> "hiddenSelections")); if (_hSCount > 0) then { @@ -59,14 +41,18 @@ GVAR(LSD_ColorsCount) = count GVAR(LSD_Colors); if (isNil QGVAR(LSD_PFH)) then { GVAR(LSD_PFH) = [{ + (_this select 0) params ["_index"]; { _x params ["_vehicle", "_hSCount"]; for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, COLORS select GVAR(LSD_index)]; + _vehicle setObjectTexture [_i, COLORS select _index]; }; nil } count GVAR(LSD_Vehicles); - GVAR(LSD_index) = ((GVAR(LSD_index) + 1) % 7) mod GVAR(LSD_ColorsCount); - }, 0.02, []] call CBA_fnc_addPerFrameHandler; + + _index = ((_index + 1) % 7) mod count COLORS; + (_this select 0) set [0, _index]; + + }, 0.02, [0]] call CBA_fnc_addPerFrameHandler; }; ACE_LOGINFO("WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEED."); From 0c25f9d8fb25f706283fccbd50de0491279ab9a6 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 19 Sep 2015 11:51:41 +0200 Subject: [PATCH 098/311] Added error handling and debug printing to the medical extension --- extensions/medical/medical.cpp | 57 +++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/extensions/medical/medical.cpp b/extensions/medical/medical.cpp index 3dcf3196ab..78517b99d4 100644 --- a/extensions/medical/medical.cpp +++ b/extensions/medical/medical.cpp @@ -39,26 +39,47 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { std::vector arguments = parseExtensionInput(function); if (arguments.size() > 0) { - std::string command = arguments.at(0); - arguments.erase(arguments.begin()); - - if (command == "addInjuryType") { - returnValue = ace::medical::handleDamage::GetInstance().AddInjuryType(arguments); - } - else if (command == "addDamageType") { - returnValue = ace::medical::handleDamage::GetInstance().AddDamageType(arguments); - } - else if (command == "HandleDamageWounds") { - if (arguments.size() >= 4) { - std::string selectionName = arguments.at(0); - double amountOfDamage = std::stod(arguments.at(1)); - std::string typeOfDamage = arguments.at(2); - int woundID = std::stoi(arguments.at(3)); - returnValue = ace::medical::handleDamage::GetInstance().HandleDamageWounds(selectionName, amountOfDamage, typeOfDamage, woundID); + try { + std::string command = arguments.at(0); + arguments.erase(arguments.begin()); + + if (command == "addInjuryType") { + returnValue = ace::medical::handleDamage::GetInstance().AddInjuryType(arguments); + } + else if (command == "addDamageType") { + returnValue = ace::medical::handleDamage::GetInstance().AddDamageType(arguments); + } + else if (command == "HandleDamageWounds") { + if (arguments.size() >= 4) { + std::string selectionName = arguments.at(0); + double amountOfDamage = std::stod(arguments.at(1)); + std::string typeOfDamage = arguments.at(2); + int woundID = std::stoi(arguments.at(3)); + returnValue = ace::medical::handleDamage::GetInstance().HandleDamageWounds(selectionName, amountOfDamage, typeOfDamage, woundID); + } + } + else if (command == "ConfigComplete") { + ace::medical::handleDamage::GetInstance().FinalizeDefinitions(); } } - else if (command == "ConfigComplete") { - ace::medical::handleDamage::GetInstance().FinalizeDefinitions(); + catch (std::exception e) { + std::stringstream debugreturn; + debugreturn << "diag_log format['ACE3 ERROR - Medical Extension: Something went wrong. Input: '];"; + int i = 0; + for (auto arg : arguments) { + debugreturn << "diag_log format[' arg " << i++ << ":" << arg << "'];"; + } + debugreturn << "diag_log format['Exception: " << e.what() << "'];"; + returnValue = debugreturn.str(); + } + catch (...) { + std::stringstream debugreturn; + debugreturn << "diag_log format['ACE3 ERROR - Medical Extension: Something went wrong. Input: '];"; + int i = 0; + for (auto arg : arguments) { + debugreturn << "diag_log format[' arg " << i++ << ":" << arg << "'];"; + } + returnValue = debugreturn.str(); } } strncpy(output, returnValue.c_str(), outputSize); From 3d188807145af927d0dba0b5fba3c02a61ec7813 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 19 Sep 2015 11:51:57 +0200 Subject: [PATCH 099/311] New build of the medical extension --- ace_medical.dll | Bin 222208 -> 223744 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ace_medical.dll b/ace_medical.dll index 790154d4c44c2807b79baa8adce5fe8d428b14b8..c54febf34f8e4d90c3dd8a704e4a638b888855ec 100644 GIT binary patch delta 74389 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 delta 72284 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 Date: Sat, 19 Sep 2015 11:52:35 +0200 Subject: [PATCH 100/311] Fixed incorrect handleDamage call --- addons/overpressure/functions/fnc_fireLauncherBackblast.sqf | 2 +- addons/overpressure/functions/fnc_overpressureDamage.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf index 14ffdd2db7..1653fce9e1 100644 --- a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf +++ b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf @@ -62,7 +62,7 @@ if (_distance < _backblastRange) then { [_damage * 100] call BIS_fnc_bloodEffect; if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_firer] call EFUNC(medical,hasMedicalEnabled))}) then { - [_firer, "HitBody", [_firer, "body", ((_firer getHitPointDamage "HitBody") + _damage), _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); + [_firer, "body", ((_firer getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage); } else { _firer setDamage (damage _firer + _damage); }; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index a24367937b..a39aec3c14 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -62,7 +62,7 @@ if (!surfaceIsWater _pos) then { if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_x] call EFUNC(medical,hasMedicalEnabled))}) then { - [_x, "HitBody", [_x, "body", (_x getHitPointDamage "HitBody") + _damage, _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); + [_x, "body", ((_x getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage); } else { _x setDamage (damage _x + _damage); }; From 22ac16ead51c390d064ce4f7310e96a024c0247a Mon Sep 17 00:00:00 2001 From: Alessandro Foresi Date: Sat, 19 Sep 2015 16:22:36 +0200 Subject: [PATCH 101/311] Changed: Seeker to aimPoint instead of ASL position --- addons/missileguidance/functions/fnc_seekerType_Optic.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 872f33a917..1cc71c1d94 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -17,7 +17,7 @@ TRACE_1("", _launchParams); // TODO:: Make sure the missile maintains LOS _foundTargetPos = [0,0,0]; if(!isNil "_target") then { - _foundTargetPos = getPosASL _target; + _foundTargetPos = aimPos _target ; //_foundTargetPos = (_target modelToWorldVisual (getCenterOfMass _target)); }; @@ -48,4 +48,4 @@ if(!_angleOkay || !_losOkay) then { }; -_foundTargetPos; \ No newline at end of file +_foundTargetPos; From 2e09a7aa4b87f50bfccf6d44a21bde795b9002df Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 19 Sep 2015 10:02:37 -0500 Subject: [PATCH 102/311] "cherrypick" PR #2496 (lockpick) --- addons/vehiclelock/functions/fnc_lockpick.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index f4837c742b..5c0e04ee0b 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -43,7 +43,7 @@ if (_vehLockpickStrenth < 0) exitWith {false}; //Condition check for progressBar _condition = { params ["_args"]; - _args params ["_args", "_unit", "_veh"]; + _args params ["_unit", "_veh"]; ((_unit distance _veh) < 5) && {(speed _veh) < 0.1} }; From 79d985a64883e2ad3c97e0799267175a8661d773 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 19 Sep 2015 10:43:29 -0500 Subject: [PATCH 103/311] Fix XEH Warning Debug Wait 5 to let supMon run first, and only show visual error if actually missing pbo. --- addons/interact_menu/XEH_clientInit.sqf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index c1a5e63e71..119afe4294 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -107,7 +107,7 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; //Debug to help end users identify mods that break CBA's XEH -["SettingsInitialized", { +[{ private ["_badClassnames"]; _badClassnames = []; { @@ -122,7 +122,11 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; ACE_LOGINFO("All compile checks passed"); } else { ACE_LOGERROR_1("%1 Classnames failed compile check!!! (bad XEH / missing cba_enable_auto_xeh.pbo)", (count _badClassnames)); - ["ACE Interaction failed to compile for some units (try adding cba_enable_auto_xeh.pbo)"] call BIS_fnc_error; - }; -}] call EFUNC(common,addEventHandler); + //Only show visual error if they are actually missing the pbo: + #define SUPMON configFile>>"CfgSettings">>"CBA">>"XEH">>"supportMonitor" + if ((!isNumber(SUPMON)) || {getNumber(SUPMON) != 1}) then { + ["ACE Interaction failed to compile for some units (try adding cba_enable_auto_xeh.pbo)"] call BIS_fnc_error; + }; + }; +}, [], 5] call EFUNC(common,waitAndExecute); //ensure CBASupMon has time to run first From 3c93c2c95c2d1cbe93ccd403c2eb66df9fde694a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 19 Sep 2015 11:07:03 -0500 Subject: [PATCH 104/311] #2525 - Add CanInteractWith checks for repair --- addons/repair/functions/fnc_canMiscRepair.sqf | 2 ++ addons/repair/functions/fnc_canRemove.sqf | 2 ++ addons/repair/functions/fnc_canRepairTrack.sqf | 2 ++ addons/repair/functions/fnc_canReplaceTrack.sqf | 2 ++ addons/repair/functions/fnc_canReplaceWheel.sqf | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/repair/functions/fnc_canMiscRepair.sqf b/addons/repair/functions/fnc_canMiscRepair.sqf index c60e59c840..2ff7fb870e 100644 --- a/addons/repair/functions/fnc_canMiscRepair.sqf +++ b/addons/repair/functions/fnc_canMiscRepair.sqf @@ -20,6 +20,8 @@ private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"]; params ["_caller", "_target", "_hitPoint"]; +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Get hitpoint groups if available _hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups); _hitpointGroup = []; diff --git a/addons/repair/functions/fnc_canRemove.sqf b/addons/repair/functions/fnc_canRemove.sqf index 9fa657a2bb..9f06e8d148 100644 --- a/addons/repair/functions/fnc_canRemove.sqf +++ b/addons/repair/functions/fnc_canRemove.sqf @@ -20,4 +20,6 @@ params ["_unit", "_target", "_hitPoint"]; TRACE_3("params",_unit,_target,_hitPoint); +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + alive _target && {_target getHitPointDamage _hitPoint < 1} diff --git a/addons/repair/functions/fnc_canRepairTrack.sqf b/addons/repair/functions/fnc_canRepairTrack.sqf index 806fa14b2e..0ba01afb87 100644 --- a/addons/repair/functions/fnc_canRepairTrack.sqf +++ b/addons/repair/functions/fnc_canRepairTrack.sqf @@ -21,6 +21,8 @@ params ["_unit", "_target", "_hitPoint", ["_wheel",false]]; TRACE_4("params",_unit,_target,_hitPoint,_wheel); // TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (typeName _wheel == "OBJECT") then { // not near interpret as objNull if !(_wheel in nearestObjects [_unit, ["ACE_Track"], 5]) then { diff --git a/addons/repair/functions/fnc_canReplaceTrack.sqf b/addons/repair/functions/fnc_canReplaceTrack.sqf index 3f4ae77581..aec3a9f062 100644 --- a/addons/repair/functions/fnc_canReplaceTrack.sqf +++ b/addons/repair/functions/fnc_canReplaceTrack.sqf @@ -22,6 +22,8 @@ params ["_unit", "_target", "_hitPoint", ["_track", false]]; TRACE_4("params",_unit,_target,_hitPoint,_track); // TODO [_unit, _track] call EFUNC(common,claim); on start of action +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (typeName _track == "OBJECT") then { // not near interpret as objNull if !(_track in nearestObjects [_unit, ["ACE_Track"], 5]) then { diff --git a/addons/repair/functions/fnc_canReplaceWheel.sqf b/addons/repair/functions/fnc_canReplaceWheel.sqf index e0a2fbbed2..cf7a047f19 100644 --- a/addons/repair/functions/fnc_canReplaceWheel.sqf +++ b/addons/repair/functions/fnc_canReplaceWheel.sqf @@ -23,7 +23,7 @@ TRACE_4("params",_unit,_target,_hitPoint,_wheel); // TODO [_unit, _wheel] call EFUNC(common,claim); on start of action //if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitwith {false}; -//if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; //if !([_unit, GVAR(engineerSetting_Wheel)] call FUNC(isEngineer)) exitWith {false}; From fb71e0594e06ca9cb9a1c5d2e44e28b51b47743c Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 18:47:00 +0200 Subject: [PATCH 105/311] lsd module, use global variable for color --- .../functions/fnc_moduleLSDVehicles.sqf | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index cb46ae6796..59c87f68cc 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -13,16 +13,6 @@ */ #include "script_component.hpp" -#define COLORS [ \ - "#(argb,8,8,3)color(1,0,0,1,co)", \ - "#(argb,8,8,3)color(1,0.5,0,1,co)", \ - "#(argb,8,8,3)color(1,1,0,1,co)", \ - "#(argb,8,8,3)color(0,1,0,1,co)", \ - "#(argb,8,8,3)color(0,0,1,1,co)", \ - "#(argb,8,8,3)color(0.2,0,0.5,1,co)", \ - "#(argb,8,8,3)color(0.5,0,1,1,co)" \ -] - params ["", "_units", "_activated"]; if !(_activated) exitWith {}; @@ -39,18 +29,30 @@ if (isNil QGVAR(LSD_Vehicles)) then { nil } count _units; +if (isNil QGVAR(LSD_Colors)) then { + GVAR(LSD_Colors) = [ + "#(argb,8,8,3)color(1,0,0,1,co)", + "#(argb,8,8,3)color(1,0.5,0,1,co)", + "#(argb,8,8,3)color(1,1,0,1,co)", + "#(argb,8,8,3)color(0,1,0,1,co)", + "#(argb,8,8,3)color(0,0,1,1,co)", + "#(argb,8,8,3)color(0.2,0,0.5,1,co)", + "#(argb,8,8,3)color(0.5,0,1,1,co)" + ]; +}; + if (isNil QGVAR(LSD_PFH)) then { GVAR(LSD_PFH) = [{ (_this select 0) params ["_index"]; { _x params ["_vehicle", "_hSCount"]; for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, COLORS select _index]; + _vehicle setObjectTexture [_i, GVAR(LSD_Colors) select _index]; }; nil } count GVAR(LSD_Vehicles); - _index = ((_index + 1) % 7) mod count COLORS; + _index = ((_index + 1) % 7) mod count GVAR(LSD_Colors); (_this select 0) set [0, _index]; }, 0.02, [0]] call CBA_fnc_addPerFrameHandler; From 20a5c7943116dac1e6fcf196045905b9b530cd6b Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 19:26:45 +0200 Subject: [PATCH 106/311] more common code cleanup --- ...fnc_removeMapMarkerCreatedEventHandler.sqf | 20 ++++---- .../fnc_removeScrollWheelEventHandler.sqf | 20 ++++---- .../functions/fnc_removeSpecificMagazine.sqf | 51 +++++++++++-------- .../fnc_removeSyncedEventHandler.sqf | 17 ++++--- 4 files changed, 57 insertions(+), 51 deletions(-) diff --git a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf index 39225bf9dd..d156359ebf 100644 --- a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf @@ -1,25 +1,23 @@ /* * Author: commy2 - * * Remove a map marker creation event handler. * - * Argument: - * 0: ID of the event handler (Number) + * Arguments: + * 0: ID of the event handler * - * Return value: - * None. + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -PARAMS_1(_id); +params ["_id"]; +private "_actionsVar"; _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; +_actionsVar params ["_currentId", "_actionIDs", "_actions"]; _id = _actionIDs find _id; diff --git a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf index ff7c0c281e..b277467cce 100644 --- a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf @@ -1,25 +1,23 @@ /* * Author: commy2 - * * Remove a scroll wheel event handler. * - * Argument: - * 0: ID of the event handler (Number) + * Arguments: + * 0: ID of the event handler * - * Return value: - * None. + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -PARAMS_1(_id); +params ["_id"]; +private "_actionsVar"; _actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; +_actionsVar params ["_currentId", "_actionIDs", "_actions"]; _id = _actionIDs find _id; diff --git a/addons/common/functions/fnc_removeSpecificMagazine.sqf b/addons/common/functions/fnc_removeSpecificMagazine.sqf index ec24dbf618..46950cc1d8 100644 --- a/addons/common/functions/fnc_removeSpecificMagazine.sqf +++ b/addons/common/functions/fnc_removeSpecificMagazine.sqf @@ -2,68 +2,77 @@ * Author: esteldunedain * Removes a magazine from the unit that has an specific ammo count * - * Argument: - * 0: Player + * Arguments: + * 0: Unit * 1: Magazine * 2: Ammo count * - * Return value: + * Return Value: * None + * + * Public: No */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_player,_magazineType,_ammoCount); +params ["_unit", "_magazineType", "_ammoCount"]; + +private ["_isRemoved", "_magazines", "_index"]; -private ["_magazines","_index","_isRemoved"]; _isRemoved = false; // Check uniform -_magazines = [magazinesAmmoCargo uniformContainer _player, {_this select 0 == _magazineType}] call FUNC(filter); -_index = _magazines find [_magazineType,_ammoCount]; +_magazines = [magazinesAmmoCargo uniformContainer _unit, {_this select 0 == _magazineType}] call FUNC(filter); +_index = _magazines find [_magazineType, _ammoCount]; if (_index > -1) exitWith { { - _player removeItemFromUniform (_x select 0); - } forEach _magazines; + _unit removeItemFromUniform (_x select 0); + false + } count _magazines; { if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then { _isRemoved = true; } else { - (uniformContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; + (uniformContainer _unit) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; }; - } forEach _magazines; + false + } count _magazines; }; // Check vest -_magazines = [magazinesAmmoCargo vestContainer _player, {_this select 0 == _magazineType}] call FUNC(filter); +_magazines = [magazinesAmmoCargo vestContainer _unit, {_this select 0 == _magazineType}] call FUNC(filter); _index = _magazines find [_magazineType,_ammoCount]; if (_index > -1) exitWith { { - _player removeItemFromVest (_x select 0); - } forEach _magazines; + _unit removeItemFromVest (_x select 0); + false + } count _magazines; { if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then { _isRemoved = true; } else { - (vestContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; + (vestContainer _unit) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; }; - } forEach _magazines; + false + } count _magazines; }; // Check backpack -_magazines = [magazinesAmmoCargo backpackContainer _player, {_this select 0 == _magazineType}] call FUNC(filter); +_magazines = [magazinesAmmoCargo backpackContainer _unit, {_this select 0 == _magazineType}] call FUNC(filter); _index = _magazines find [_magazineType,_ammoCount]; if (_index > -1) exitWith { { - _player removeItemFromBackpack (_x select 0); - } forEach _magazines; + _unit removeItemFromBackpack (_x select 0); + false + } count _magazines; { if (!_isRemoved && (_x isEqualTo [_magazineType,_ammoCount])) then { _isRemoved = true; } else { - (backpackContainer _player) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; + (backpackContainer _unit) addMagazineAmmoCargo [_x select 0, 1, _x select 1]; }; - } forEach _magazines; + false + } count _magazines; }; diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 924bb0aa25..ffc4a364f3 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -1,27 +1,28 @@ /* * Author: jaynus - * * Remove a synced event handler * - * Argument: - * 0: Name (String) + * Arguments: + * 0: Name * - * Return value: + * Return Value: * Boolean of success + * + * Public: No */ #include "script_component.hpp" -PARAMS_1(_name); - -private ["_data", "_eventId"]; +params ["_name"]; if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { ACE_LOGERROR("Synced event key not found."); false }; +private ["_data", "_eventId"]; + _data = HASH_GET(GVAR(syncedEvents),_name); _eventId = _data select 3; -[_eventId] call ace_common_fnc_removeEventHandler; +[_eventId] call FUNC(removeEventHandler); HASH_REM(GVAR(syncedEvents),_name); From cbc7f961b253be8ec069fce9901fd73556cacdb1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 19:40:56 +0200 Subject: [PATCH 107/311] more common code cleanup --- .../common/functions/fnc_requestCallback.sqf | 29 +++++++-------- .../functions/fnc_requestSyncedEvent.sqf | 17 ++++----- .../common/functions/fnc_resetAllDefaults.sqf | 35 +++++++++++-------- .../functions/fnc_restoreVariablesJIP.sqf | 19 +++++----- 4 files changed, 53 insertions(+), 47 deletions(-) diff --git a/addons/common/functions/fnc_requestCallback.sqf b/addons/common/functions/fnc_requestCallback.sqf index 827519b99c..399f50466d 100644 --- a/addons/common/functions/fnc_requestCallback.sqf +++ b/addons/common/functions/fnc_requestCallback.sqf @@ -1,22 +1,19 @@ -/** - * fn_requestCallback.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal + * N/A * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: No */ - #include "script_component.hpp" -private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -PARAMS_2(_info,_accepted); +params ["_info", "_accepted"]; -_caller = _info select 0; -_target = _info select 1; -_requestID = _info select 2; -_requestMessage = _info select 3; -_callBack = _info select 4; +_info params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -[_caller, _target, _accepted] call compile _callBack; \ No newline at end of file +[_caller, _target, _accepted] call compile _callBack; diff --git a/addons/common/functions/fnc_requestSyncedEvent.sqf b/addons/common/functions/fnc_requestSyncedEvent.sqf index dea0c7adef..7cbc8f6c8d 100644 --- a/addons/common/functions/fnc_requestSyncedEvent.sqf +++ b/addons/common/functions/fnc_requestSyncedEvent.sqf @@ -1,19 +1,20 @@ /* * Author: jaynus - * * Send a request to synchronize an event name from the client->server. Execute on client only. * - * Argument: - * 0: eventName (String) + * Arguments: + * 0: eventName * - * Return value: + * Return Value: * Boolean of success + * + * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_eventName); + +params ["_eventName"]; // Only JIP machines on initialization send this off, requesting sync on events with the serverCommand -if(isServer) exitWith { false }; +if (isServer) exitWith {false}; -["SEH_s", [_eventName, ACE_player] ] call ace_common_fnc_serverEvent; \ No newline at end of file +["SEH_s", [_eventName, ACE_player] ] call FUNC(serverEvent); diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 3040334ad0..83e62fcf8b 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -1,39 +1,44 @@ -/** - * fn_resetAllDefaults_f.sqf - * @Descr: reset all variables that have been defined - * @Author: Glowbal +/* + * Author: Glowbal + * reset all variables that have been defined * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: No */ - #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -_unit setvariable ["ACE_isDead",nil,true]; +_unit setvariable ["ACE_isDead", nil, true]; _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { [true] call FUNC(setVolume); [false] call FUNC(disableKeyInput); + if (["ace_medical"] call FUNC(isModLoader)) then { [false] call EFUNC(medical,effectBlackOut); }; - if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { + if !(isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { // clear all disable user input { [_x, false] call FUNC(setDisableUserInputStatus); - }foreach GVAR(DISABLE_USER_INPUT_COLLECTION); + false + } count GVAR(DISABLE_USER_INPUT_COLLECTION); }; }; { - if (!(_x select 4)) then { - _unit setvariable [(_x select 0),nil,_x select 3]; + if !(_x select 4) then { + _unit setvariable [_x select 0, nil, _x select 3]; }; -} forEach ([_unit] call FUNC(getAllDefinedSetVariables)); + false +} count ([_unit] call FUNC(getAllDefinedSetVariables)); _unit setVariable ["ACE_forceWalkStatusNumber", 0, true]; diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf index 9ca911d79c..1937c615a4 100644 --- a/addons/common/functions/fnc_restoreVariablesJIP.sqf +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -3,18 +3,19 @@ * * Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP). * - * Argument: - * 0: Object (Object) + * Arguments: + * 0: Object * - * Return value: - * Nothing. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" +params ["_unit"]; + private "_respawnVariables"; - -PARAMS_1(_unit); - _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; // yes those @@ -22,4 +23,6 @@ _respawnVariables pushBack "ACE_PersistentFunctions"; { _unit setVariable [_x, _unit getVariable _x, true]; -} forEach _respawnVariables; + false +} count _respawnVariables; +nil From 1636e3976db27b2450f123ba41e65898e7aa93b8 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 20:17:38 +0200 Subject: [PATCH 108/311] more common code cleanup --- addons/common/XEH_preInit.sqf | 2 - .../common/functions/fnc_convertKeyCode.sqf | 30 ----------- .../functions/fnc_revertKeyCodeLocalized.sqf | 39 -------------- .../common/functions/fnc_sanitizeString.sqf | 16 +++--- .../fnc_sendDisplayInformationTo.sqf | 52 +++++++++++-------- .../functions/fnc_sendDisplayMessageTo.sqf | 51 ++++++++++-------- addons/common/functions/fnc_sendRequest.sqf | 26 ++++++---- 7 files changed, 82 insertions(+), 134 deletions(-) delete mode 100644 addons/common/functions/fnc_convertKeyCode.sqf delete mode 100644 addons/common/functions/fnc_revertKeyCodeLocalized.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 10bdc3f6ea..9604941ab7 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -27,7 +27,6 @@ PREP(checkPBOs); PREP(claim); PREP(codeToLetter); PREP(codeToString); -PREP(convertKeyCode); PREP(createOrthonormalReference); PREP(currentChannel); PREP(debug); @@ -151,7 +150,6 @@ PREP(removeSpecificMagazine); PREP(requestCallback); PREP(resetAllDefaults); PREP(restoreVariablesJIP); -PREP(revertKeyCodeLocalized); PREP(runAfterSettingsInit); PREP(sanitizeString); PREP(sendRequest); diff --git a/addons/common/functions/fnc_convertKeyCode.sqf b/addons/common/functions/fnc_convertKeyCode.sqf deleted file mode 100644 index 3bf6314bef..0000000000 --- a/addons/common/functions/fnc_convertKeyCode.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: commy2 - * Get a key code used in AGM key input eh. - * - * Arguments: - * 0: Arma DIK code - * 1: Key state for shift left and shift right key - * 2: Key state for ctrl left and ctrl right key - * 3: Key state for alt and alt gr key - * - * Return Value: - * Key code - * - * Public: Yes - * - * Deprecated - */ -#include "script_component.hpp" - -#define KEY_MODIFIERS [42, 54, 29, 157, 56, 184] - -params ["_key", "_stateShift", "_stateCtrl", "_stateAlt"]; - -if (_key in KEY_MODIFIERS) exitWith {_key}; - -if (_stateShift) then {_key = _key + 0.1}; -if (_stateCtrl) then {_key = _key + 0.2}; -if (_stateAlt) then {_key = _key + 0.4}; - -_key diff --git a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf deleted file mode 100644 index 75168d4e84..0000000000 --- a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: commy2 - * - * Revert a key code to a readible text. - * - * Argument: - * 0: Key code (Number) - * - * Return value: - * What input will result in the given key code? (String) - */ -#include "script_component.hpp" - -private ["_key", "_alt", "_ctrl", "_shift"]; - -PARAMS_1(_keyCode); - -_key = toString ((toArray keyName floor _keyCode) - [34]); - -_keyCode = round ((_keyCode % 1) * 10); - -switch (_keyCode) do { - case 8 : {format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]}; - case 9 : {format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]}; - default { - _keyCode = toArray ([_keyCode, 3] call FUNC(toBin)); - - _alt = "1" == toString [_keyCode select 0]; - _ctrl = "1" == toString [_keyCode select 1]; - _shift = "1" == toString [_keyCode select 2]; - - format ["%1%2%3%4", - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Alt)))]] select _alt, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Ctrl)))]] select _ctrl, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Shift)))]] select _shift, - _key - ] - }; -}; diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf index 2bc170872d..f502da43dd 100644 --- a/addons/common/functions/fnc_sanitizeString.sqf +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -1,23 +1,22 @@ /* * Author: esteldunedain, based on Killzone-Kid code - * * Removes quotation marks to avoid exploits and optionally html tags from text to avoid conflicts with structured text. * * Arguments: - * 0: Source string (String) - * 1: Remove html tags (Bool, optional) + * 0: Source string + * 1: Remove html tags (optional) * * Return Value: * Sanitized string + * + * Public: Yes */ #include "script_component.hpp" +params ["_string", ["_removeTags", false]]; + private ["_array", "_arrayNew"]; -PARAMS_2(_string,_removeTags); - -if (isNil "_removeTags") then {_removeTags = false}; - _array = toArray _string; _arrayNew = []; @@ -37,6 +36,7 @@ _arrayNew = []; _arrayNew = _arrayNew + [_x]; }; }; -} forEach _array; + false +} count _array; toString _arrayNew diff --git a/addons/common/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf index 1ff209dac6..aa3dba2365 100644 --- a/addons/common/functions/fnc_sendDisplayInformationTo.sqf +++ b/addons/common/functions/fnc_sendDisplayInformationTo.sqf @@ -1,47 +1,53 @@ -/** - * fn_sendDisplayInformationTo.sqf - * @Descr: Sends a display information hint to a receiver - * @Author: Glowbal +/* + * Author: Glowbal + * Sends a display information hint to a receiver * - * @Arguments: [receiver OBJECT, title STRING, content ARRAY (An array with strings), type NUMBER (Optional)] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: receiver + * 1: title + * 2: content + * 3: type (optional) + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; -_reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_title = [_this, 1, "",[""]] call BIS_fnc_Param; -_content = [_this, 2, [""],[[""]]] call BIS_fnc_Param; -_type = [_this, 3, 0,[0]] call BIS_fnc_Param; -_parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; +params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]]; if (isPlayer _reciever) then { if (!local _reciever) then { - [_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc); + [_this, QFUNC(sendDisplayInformationTo), _reciever, false] call FUNC(execRemoteFnc); } else { if (isLocalized _title) then { _title = localize _title; }; + + private "_localizationArray"; _localizationArray = [_title]; + { _localizationArray pushback _x; - } forEach _parameters; + false + } count _parameters; + _title = format _localizationArray; { if (isLocalized _x) then { _localizationArray = [localize _x]; + { - _localizationArray pushback _x; - } forEach _parameters; + _localizationArray pushBack _x; + false + } count _parameters; - _content set [_foreachIndex, format _localizationArray]; + _content set [_forEachIndex, format _localizationArray]; }; + } forEach _content; - }foreach _content; - - [_title,_content,_type] call EFUNC(common,displayInformation); + [_title, _content, _type] call FUNC(displayInformation); }; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_sendDisplayMessageTo.sqf b/addons/common/functions/fnc_sendDisplayMessageTo.sqf index e042f69939..6f16ec8006 100644 --- a/addons/common/functions/fnc_sendDisplayMessageTo.sqf +++ b/addons/common/functions/fnc_sendDisplayMessageTo.sqf @@ -1,46 +1,53 @@ -/** - * fn_sendDisplayMessageTo.sqf - * @Descr: Displays a message on locality of receiver - * @Author: Glowbal +/* + * Author: Glowbal + * Displays a message on locality of receiver * - * @Arguments: [receiver OBJECT, title STRING, content STRING, type NUMBER (Optional)] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: receiver + * 1: title + * 2: content + * 3: type (optional) + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; -_reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_title = [_this, 1, "",[""]] call BIS_fnc_Param; -_content = [_this, 2, "",[""]] call BIS_fnc_Param; -_type = [_this, 3, 0,[0]] call BIS_fnc_Param; -_parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; +params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]]; if (isPlayer _reciever) then { if (!local _reciever) then { - [_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); + [_this, QFUNC(sendDisplayMessageTo), _reciever, false] call FUNC(execRemoteFnc); } else { - if (isLocalized _title) then { _title = localize _title; }; + if (isLocalized _content) then { _content = localize _content; }; + private "_localizationArray"; _localizationArray = [_title]; + { - _localizationArray pushback _x; - }foreach _parameters; + _localizationArray pushBack _x; + false + } count _parameters; + _title = format _localizationArray; _localizationArray = [_content]; + { - _localizationArray pushback _x; - }foreach _parameters; + _localizationArray pushBack _x; + false + } count _parameters; + _content = format _localizationArray; - [_title,_content,_type] call EFUNC(common,displayMessage); + [_title, _content, _type] call FUNC(displayMessage); }; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_sendRequest.sqf b/addons/common/functions/fnc_sendRequest.sqf index 68b42ce302..c8d2ef7e2b 100644 --- a/addons/common/functions/fnc_sendRequest.sqf +++ b/addons/common/functions/fnc_sendRequest.sqf @@ -1,20 +1,26 @@ -/** - * fn_sendRequest_f.sqf - * @Descr: Send a request to an unit and execute code based upon results. - * @Author: Glowbal +/* + * Author: Glowbal + * Send a request to an unit and execute code based upon results. * - * @Arguments: [caller OBJECT, target OBJECT, requestID STRING, requestMessage STRING (Will be localized for other target object), callback CODE (Code called upon accept or decline.)] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: caller + * 1: target + * 2: requestID (STRING) + * 3: requestMessage Will be localized for other target object. (STRING) + * 4: callback Code called upon accept or decline. (CODE) + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -PARAMS_5(_caller,_target,_requestID,_requestMessage,_callBack); +params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; if (isPlayer _target) then { // Pass request on to target locality for player accept/decline. - [[_caller, _target, _requestID, _requestMessage, _callBack], QUOTE(FUNC(receiveRequest)), _target, false] call EFUNC(common,execRemoteFnc); + [[_caller, _target, _requestID, _requestMessage, _callBack], QFUNC(receiveRequest), _target, false] call FUNC(execRemoteFnc); } else { // accept it, since it's an AI. [_caller, _target, true] call compile _callBack; From 3ddaa5ed4a75097dc45266a970713528cf2f7f8d Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 20:34:07 +0200 Subject: [PATCH 109/311] more common code cleanup --- addons/common/functions/fnc_serverEvent.sqf | 23 ++++++----- addons/common/functions/fnc_serverLog.sqf | 15 ++++++- .../functions/fnc_setCaptivityStatus.sqf | 19 +++++---- .../functions/fnc_setDefinedVariable.sqf | 41 +++++++++---------- .../fnc_setDisableUserInputStatus.sqf | 26 +++++++----- 5 files changed, 70 insertions(+), 54 deletions(-) diff --git a/addons/common/functions/fnc_serverEvent.sqf b/addons/common/functions/fnc_serverEvent.sqf index 4a9960c197..65ab0da2a7 100644 --- a/addons/common/functions/fnc_serverEvent.sqf +++ b/addons/common/functions/fnc_serverEvent.sqf @@ -1,26 +1,27 @@ /* * Author: Nou - * * Execute a event only on the server. * * Argument: - * 0: Event name (string) - * 1: Event args (any) + * 0: Event name + * 1: Event args * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_handleNetEvent"); -PARAMS_2(_eventName,_eventArgs); +params ["_eventName", "_eventArgs"]; - #ifdef DEBUG_EVENTS - ACE_LOGINFO_1("* Server Event: %1",_eventName); - ACE_LOGINFO_1(" args=%1",_eventArgs); - #endif +#ifdef DEBUG_EVENTS + ACE_LOGINFO_1("* Server Event: %1",_eventName); + ACE_LOGINFO_1(" args=%1",_eventArgs); +#endif ACEg = [_eventName, _eventArgs]; + if (!isServer) then { publicVariableServer "ACEg"; } else { diff --git a/addons/common/functions/fnc_serverLog.sqf b/addons/common/functions/fnc_serverLog.sqf index 76560e45a3..45ab03891c 100644 --- a/addons/common/functions/fnc_serverLog.sqf +++ b/addons/common/functions/fnc_serverLog.sqf @@ -1,8 +1,19 @@ -// by esteldunedain +/* + * Author: esteldunedain + * ? + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: no + */ #include "script_component.hpp" if (isServer) then { diag_log _this; } else { - [_this, QUOTE(FUNC(serverLog)), 1] call FUNC(execRemoteFnc); + [_this, QFUNC(serverLog), 1] call FUNC(execRemoteFnc); }; diff --git a/addons/common/functions/fnc_setCaptivityStatus.sqf b/addons/common/functions/fnc_setCaptivityStatus.sqf index f579b5cfbc..ecb7b3152a 100644 --- a/addons/common/functions/fnc_setCaptivityStatus.sqf +++ b/addons/common/functions/fnc_setCaptivityStatus.sqf @@ -1,21 +1,22 @@ /* * Author: commy2 - * * Set the captivity status of an unit. This allows the handling of more than one reason to set a unit captive. * - * Argument: - * 0: Unit (Object) - * 1: The reason of the captivity (String) - * 2: Is the reason still valid? True for setting this reason, false for removing it (Bool) + * Arguments: + * 0: Unit + * 1: The reason of the captivity + * 2: Is the reason still valid? True for setting this reason, false for removing it * - * Return value: - * None. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; +params ["_unit", "_reason", "_status"]; -PARAMS_3(_unit,_reason,_status); +private ["_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; diff --git a/addons/common/functions/fnc_setDefinedVariable.sqf b/addons/common/functions/fnc_setDefinedVariable.sqf index ea8a326f21..480632394c 100644 --- a/addons/common/functions/fnc_setDefinedVariable.sqf +++ b/addons/common/functions/fnc_setDefinedVariable.sqf @@ -1,31 +1,30 @@ -/** - * fn_setVariable.sqf - * @Descr: Setvariable value - * @Author: Glowbal +/* + * Author: Glowbal + * Setvariable value * - * @Arguments: [unit OBJECT, variableName STRING, value ANY] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: Unit + * 1: variableName + * 2: value + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_global","_definedVariable"]; +params ["_unit", "_variable", "_value", "_global"]; -PARAMS_3(_unit,_variable,_value); +if (isNil "_global") then { + private "_definedVariable"; + _definedVariable = [_variable] call FUNC(getDefinedVariableInfo); -_global = false; - -if (count _this > 3) then { - _global = _this select 3; -} else { - _definedVariable = ([_variable] call FUNC(getDefinedVariableInfo)); - if (count _definedVariable > 2) then { - _global = _definedVariable select 2; - }; + _definedVariable params ["", "", ["_global", false]]; }; if (!isNil "_value") exitwith { - _unit setvariable [_variable, _value, _global]; + _unit setVariable [_variable, _value, _global]; }; -_unit setvariable [_variable, nil, _global]; \ No newline at end of file + +_unit setVariable [_variable, nil, _global]; diff --git a/addons/common/functions/fnc_setDisableUserInputStatus.sqf b/addons/common/functions/fnc_setDisableUserInputStatus.sqf index 8836f4cd0d..ec475f744f 100644 --- a/addons/common/functions/fnc_setDisableUserInputStatus.sqf +++ b/addons/common/functions/fnc_setDisableUserInputStatus.sqf @@ -1,26 +1,30 @@ -/** - * fn_setDisableUserInputStatus.sqf - * @Descr: Disables the user input. Works stacked. - * @Author: Glowbal +/* + * Author: Glowbal + * Disables the user input. Works stacked. * - * @Arguments: [id STRING, disable BOOL] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: id + * 1: disable + * + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_id,_disable); +params ["_id", "_disable"]; -if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { +if (isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { GVAR(DISABLE_USER_INPUT_COLLECTION) = []; }; if (_disable) then { - GVAR(DISABLE_USER_INPUT_COLLECTION) pushback _id; + GVAR(DISABLE_USER_INPUT_COLLECTION) pushBack _id; [true] call FUNC(disableUserInput); } else { GVAR(DISABLE_USER_INPUT_COLLECTION) = GVAR(DISABLE_USER_INPUT_COLLECTION) - [_id]; if (GVAR(DISABLE_USER_INPUT_COLLECTION) isEqualTo []) then { [false] call FUNC(disableUserInput); }; -}; \ No newline at end of file +}; From 35d94e8d5cd5c1995a9cce7d5ec07af0401cc3b0 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 19 Sep 2015 19:37:38 +0100 Subject: [PATCH 110/311] Fix medical litter scopeCurator values Solves #2526 where medical litter would appear in zeus with no name. --- addons/medical/CfgVehicles.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 4e73e77ee1..3a675e9258 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -695,6 +695,7 @@ class CfgVehicles { class ACE_bodyBagObject: MapBoard_altis_F { XEH_ENABLED; scope = 1; + scopeCurator = 2; side = -1; model = QUOTE(PATHTOEF(apl,bodybag.p3d)); icon = ""; @@ -720,6 +721,7 @@ class CfgVehicles { class Thing; class ACE_MedicalLitterBase: Thing { scope = 1; + scopeCurator = 0; displayName = " "; destrType = "DestructNo"; model = QUOTE(PATHTOF(data\littergeneric.p3d)); @@ -900,6 +902,7 @@ class CfgVehicles { class NATO_Box_Base; class ACE_medicalSupplyCrate: NATO_Box_Base { scope = 2; + scopeCurator = 2; accuracy = 1000; displayName = CSTRING(medicalSupplyCrate); model = PATHTOF(data\ace_medcrate.p3d); From 09f133b7f86a941397903d3d475f300722910803 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 20:55:35 +0200 Subject: [PATCH 111/311] more common code cleanup --- .../functions/fnc_setForceWalkStatus.sqf | 48 ++++++------- .../functions/fnc_setHearingCapability.sqf | 32 ++++----- addons/common/functions/fnc_setParameter.sqf | 12 ++-- .../common/functions/fnc_setPitchBankYaw.sqf | 71 ++++++++++--------- 4 files changed, 85 insertions(+), 78 deletions(-) diff --git a/addons/common/functions/fnc_setForceWalkStatus.sqf b/addons/common/functions/fnc_setForceWalkStatus.sqf index 9935f4ad21..aaa594b9a9 100644 --- a/addons/common/functions/fnc_setForceWalkStatus.sqf +++ b/addons/common/functions/fnc_setForceWalkStatus.sqf @@ -1,36 +1,34 @@ /* -Name: FUNC(setForceWalkStatus) - -Author: Pabst Mirror (from captivity by commy2) - -Description: - Sets the forceWalk status of an unit. This allows the handling of more than one reason to set forceWalk. - Unit will force walk until all reasons are removed. - -Parameters: - 0: OBJECT - Unit - 1: STRING - Reason for forcing walking - 2: BOOL - Is the reason still valid. True to force walk, false to remove restriction. - -Returns: - None - -Example: - [ACE_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus) + * Author: Pabst Mirror (from captivity by commy2) + * Sets the forceWalk status of an unit. This allows the handling of more than one reason to set forceWalk. + * Unit will force walk until all reasons are removed. + * + * Arguments: + * 0: Unit + * 1: Reason for forcing walking + * 2: Is the reason still valid. True to force walk, false to remove restriction. + * + * Returns: + * None + * + * Example: + * [ACE_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus) + * + * Public: No */ #include "script_component.hpp" -private ["_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; +params ["_unit", "_reason", "_status"]; -PARAMS_3(_unit,_reason,_status); +private ["_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; // register new reason (these reasons are shared publicly, since units can change ownership, but keep their forceWalk status) if !(_reason in _forceWalkReasons) then { - _forceWalkReasons pushBack _reason; - ACE_forceWalkReasons = _forceWalkReasons; - publicVariable "ACE_forceWalkReasons"; + _forceWalkReasons pushBack _reason; + ACE_forceWalkReasons = _forceWalkReasons; + publicVariable "ACE_forceWalkReasons"; }; // get reasons why the unit is forceWalking already and update to the new status @@ -38,7 +36,7 @@ _unitForceWalkReasons = [_unit] call FUNC(getForceWalkStatus); _forceWalkReasonsBooleans = []; { - _forceWalkReasonsBooleans set [_forEachIndex, (_forceWalkReasons select _forEachIndex) in _unitForceWalkReasons]; + _forceWalkReasonsBooleans set [_forEachIndex, (_forceWalkReasons select _forEachIndex) in _unitForceWalkReasons]; } forEach _forceWalkReasons; _forceWalkReasonsBooleans set [_forceWalkReasons find _reason, _status]; @@ -48,4 +46,4 @@ _bitmaskNumber = _forceWalkReasonsBooleans call FUNC(toBitmask); _unit setVariable ["ACE_forceWalkStatusNumber", _bitmaskNumber, true]; // actually apply the forceWalk command globaly -[[_unit], QUOTE(FUNC(applyForceWalkStatus)), 2] call FUNC(execRemoteFnc); +[[_unit], QFUNC(applyForceWalkStatus), 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 3e2939d29b..9dea992e3e 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -1,23 +1,22 @@ -/** - * fn_setHearingCapability.sqf - * @Descr: Handle set volume calls. Will use the lowest available volume setting. - * @Author: Glowbal +/* + * Author: Glowbal + * Handle set volume calls. Will use the lowest available volume setting. * - * @Arguments: [id STRING, settings NUMBER, add BOOL (Optional. True will add, false will remove. Default value is true)] - * @Return: nil - * @PublicAPI: true + * Arguments: + * 0: id + * 1: settings + * 2: add (default: true) + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_add", "_exists", "_map", "_lowestVolume"]; +params ["_id", "_settings", ["_add", true]]; -PARAMS_2(_id,_settings); - -_add = true; -if (count _this > 2) then { - _add = _this select 2; -}; +private ["_map", "_exists", "_lowestVolume"]; _map = missionNamespace getVariable [QGVAR(setHearingCapabilityMap),[]]; @@ -44,7 +43,8 @@ missionNamespace setVariable [QGVAR(setHearingCapabilityMap), _map]; _lowestVolume = 1; { _lowestVolume = (_x select 1) min _lowestVolume; -} forEach _map; + false +} count _map; // in game sounds 0 fadeSound _lowestVolume; diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf index d7a4573935..6a1345479b 100644 --- a/addons/common/functions/fnc_setParameter.sqf +++ b/addons/common/functions/fnc_setParameter.sqf @@ -4,19 +4,23 @@ * Sets the value of an ACE_Parameter and makes it public. * * Arguments: - * 0: Parameter name (string) + * 0: Parameter name * 1: Value * * Return Value: * None + * + * Public: Yes + * + * Deprecated *@todo commy */ #include "script_component.hpp" -PARAMS_2(_name,_value); +params ["_name", "_value"]; // Hack to keep backward compatibility for the moment -if ((typeName (missionNamespace getVariable _name)) == "BOOL") then { - if ((typeName _value) == "SCALAR") then { +if (typeName (missionNamespace getVariable _name) == "BOOL") then { + if (typeName _value == "SCALAR") then { _value = _value > 0; }; }; diff --git a/addons/common/functions/fnc_setPitchBankYaw.sqf b/addons/common/functions/fnc_setPitchBankYaw.sqf index f5d13eb6fe..ea7f27a906 100644 --- a/addons/common/functions/fnc_setPitchBankYaw.sqf +++ b/addons/common/functions/fnc_setPitchBankYaw.sqf @@ -1,26 +1,25 @@ /* - * Taken From: - * https://community.bistudio.com/wiki/BIS_fnc_setPitchBank - * Edited By: - * KoffeinFlummi + * Author: Bohemia Interactive edit by KoffeinFlummi + * Sets the value of an ACE_Parameter and makes it public. * * Arguments: - * 0: Unit/Vehicle - * 1: Pitch (degrees) - * 2: Yaw (degrees) - * 3: Bank (degrees) + * 0: Unit/Vehicle + * 1: Pitch + * 2: Yaw + * 3: Bank * * Return Value: * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_object", "_aroundX", "_aroundY", "_aroundZ", "_dirX", "_dirY", "_dirZ", "_upX", "_upY", "_upZ", "_dir", "_up", "_dirXTemp", "_upXTemp"]; +params ["_object", "_aroundX", "_aroundY", "_aroundZ"]; -_object = _this select 0; -_aroundX = _this select 1; -_aroundY = _this select 2; -_aroundZ = (360 - (_this select 3)) - 360; +_aroundZ = - _aroundZ; + +private ["_dirX", "_dirY", "_dirZ", "_upX", "_upY", "_upZ", "_dir", "_up"]; _dirX = 0; _dirY = 1; @@ -28,28 +27,34 @@ _dirZ = 0; _upX = 0; _upY = 0; _upZ = 1; + if (_aroundX != 0) then { - _dirY = cos _aroundX; - _dirZ = sin _aroundX; - _upY = -sin _aroundX; - _upZ = cos _aroundX; -}; -if (_aroundY != 0) then { - _dirX = _dirZ * sin _aroundY; - _dirZ = _dirZ * cos _aroundY; - _upX = _upZ * sin _aroundY; - _upZ = _upZ * cos _aroundY; -}; -if (_aroundZ != 0) then { - _dirXTemp = _dirX; - _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); - _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); - _upXTemp = _upX; - _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); - _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); + _dirY = cos _aroundX; + _dirZ = sin _aroundX; + _upY = -sin _aroundX; + _upZ = cos _aroundX; }; -_dir = [_dirX,_dirY,_dirZ]; -_up = [_upX,_upY,_upZ]; +if (_aroundY != 0) then { + _dirX = _dirZ * sin _aroundY; + _dirZ = _dirZ * cos _aroundY; + _upX = _upZ * sin _aroundY; + _upZ = _upZ * cos _aroundY; +}; + +if (_aroundZ != 0) then { + private ["_dirXTemp", "_upXTemp"]; + + _dirXTemp = _dirX; + _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); + _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); + + _upXTemp = _upX; + _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); + _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); +}; + +_dir = [_dirX, _dirY, _dirZ]; +_up = [_upX, _upY, _upZ]; _object setVectorDirAndUp [_dir,_up]; From db41537f561ce4e7d18e0dd09063dc9d878c662d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 19 Sep 2015 13:58:34 -0500 Subject: [PATCH 112/311] #2524 - Take Unconscious captive --- addons/captives/functions/fnc_canApplyHandcuffs.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index 5e7eb34a76..368ce3cb7a 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -23,4 +23,9 @@ params ["_unit", "_target"]; ("ACE_CableTie" in (items _unit)) && {alive _target} && {!(_target getVariable [QGVAR(isHandcuffed), false])} && -(GVAR(requireSurrender) == 0 || ((_target getVariable [QGVAR(isSurrendering), false]) || (currentWeapon _target == "" && GVAR(requireSurrender) == 2))) +{ + (_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious + {GVAR(requireSurrender) == 0} || //or don't require surrendering + {_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering + {(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon +} From bfd5d13de8458b8576c824df8f02b6df12453980 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 21:33:25 +0200 Subject: [PATCH 113/311] more common code cleanup --- addons/common/functions/fnc_hashCreate.sqf | 14 +++++++++++-- addons/common/functions/fnc_hashGet.sqf | 20 +++++++++++++++---- addons/common/functions/fnc_hashHasKey.sqf | 16 +++++++++++++-- .../functions/fnc_hashListCreateHash.sqf | 16 +++++++++++++-- .../functions/fnc_hashListCreateList.sqf | 16 +++++++++++++-- addons/common/functions/fnc_hashListPush.sqf | 16 +++++++++++++-- .../common/functions/fnc_hashListSelect.sqf | 17 ++++++++++++++-- addons/common/functions/fnc_hashListSet.sqf | 17 ++++++++++++++-- addons/common/functions/fnc_hashRem.sqf | 17 ++++++++++++++-- addons/common/functions/fnc_hashSet.sqf | 16 +++++++++++++-- 10 files changed, 143 insertions(+), 22 deletions(-) diff --git a/addons/common/functions/fnc_hashCreate.sqf b/addons/common/functions/fnc_hashCreate.sqf index 56d9b69922..532b2804fe 100644 --- a/addons/common/functions/fnc_hashCreate.sqf +++ b/addons/common/functions/fnc_hashCreate.sqf @@ -1,5 +1,15 @@ -//fnc_hashCreate.sqf +/* + * Author: ? + * Returns an empty hash structure + * + * Arguments: + * None + * + * Return Value: + * Empty Hash Structure + * + * Public: No + */ #include "script_component.hpp" -// diag_log text format["%1 HASH CREATE"]; [[],[]] diff --git a/addons/common/functions/fnc_hashGet.sqf b/addons/common/functions/fnc_hashGet.sqf index 6b47b98ad9..df5d294beb 100644 --- a/addons/common/functions/fnc_hashGet.sqf +++ b/addons/common/functions/fnc_hashGet.sqf @@ -1,10 +1,21 @@ -//fnc_hashGet.sqf +/* + * Author: ? + * Returns value attached to key in given hash. + * + * Arguments: + * 0: Hash + * 1: Key + * + * Return Value: + * Value + * + * Public: No + */ #include "script_component.hpp" private ["_val", "_index"]; -// diag_log text format["%1 HASH GET: %2", ACE_diagTime, _this]; -PARAMS_2(_hash,_key); +params ["_hash", "_key"]; ERRORDATA(2); _val = nil; @@ -25,4 +36,5 @@ try { }; if (isNil "_val") exitWith { nil }; -_val; + +_val diff --git a/addons/common/functions/fnc_hashHasKey.sqf b/addons/common/functions/fnc_hashHasKey.sqf index 8d31a6fcb4..951c95a2b3 100644 --- a/addons/common/functions/fnc_hashHasKey.sqf +++ b/addons/common/functions/fnc_hashHasKey.sqf @@ -1,10 +1,22 @@ -//fnc_hashHasKey.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" private ["_val", "_index"]; // diag_log text format["%1 HASH HAS KEY: %2", ACE_diagTime, _this]; -PARAMS_2(_hash,_key); +params ["_hash", "_key"]; ERRORDATA(2); _val = false; diff --git a/addons/common/functions/fnc_hashListCreateHash.sqf b/addons/common/functions/fnc_hashListCreateHash.sqf index c7a6085fea..4000c13056 100644 --- a/addons/common/functions/fnc_hashListCreateHash.sqf +++ b/addons/common/functions/fnc_hashListCreateHash.sqf @@ -1,9 +1,21 @@ -//fnc_hashListCreateHash.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" private ["_hashKeys"]; -PARAMS_1(_hashList); +params ["_hashList"]; ERRORDATA(1); _hashKeys = []; diff --git a/addons/common/functions/fnc_hashListCreateList.sqf b/addons/common/functions/fnc_hashListCreateList.sqf index d24b22e7c3..065bec1de6 100644 --- a/addons/common/functions/fnc_hashListCreateList.sqf +++ b/addons/common/functions/fnc_hashListCreateList.sqf @@ -1,6 +1,18 @@ -//fnc_hashListCreateList.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" -PARAMS_1(_keys); +params ["_keys"]; [_keys,[]]; diff --git a/addons/common/functions/fnc_hashListPush.sqf b/addons/common/functions/fnc_hashListPush.sqf index d8908dbe33..a4d023de87 100644 --- a/addons/common/functions/fnc_hashListPush.sqf +++ b/addons/common/functions/fnc_hashListPush.sqf @@ -1,7 +1,19 @@ -//fnc_hashListPush.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" -PARAMS_2(_hashList,_value); +params ["_hashList", "_value"]; ERRORDATA(2); try { diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf index 9f6f6489d0..1ee09f4316 100644 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ b/addons/common/functions/fnc_hashListSelect.sqf @@ -1,9 +1,22 @@ -//fnc_hashListSelect.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" private ["_hash", "_keys", "_hashes", "_values"]; -PARAMS_2(_hashList,_index); +params ["_hashList", "_index"]; + ERRORDATA(2); _hash = nil; try { diff --git a/addons/common/functions/fnc_hashListSet.sqf b/addons/common/functions/fnc_hashListSet.sqf index fdb19350df..3fbb20e414 100644 --- a/addons/common/functions/fnc_hashListSet.sqf +++ b/addons/common/functions/fnc_hashListSet.sqf @@ -1,9 +1,22 @@ -//fnc_hashListSet.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" private ["_vals"]; -PARAMS_3(_hashList,_index,_value); +params ["_hashList", "_index", "_value"]; + ERRORDATA(3); try { if(VALIDHASH(_hashList)) then { diff --git a/addons/common/functions/fnc_hashRem.sqf b/addons/common/functions/fnc_hashRem.sqf index 7f7bb17cc4..0bf31c0f76 100644 --- a/addons/common/functions/fnc_hashRem.sqf +++ b/addons/common/functions/fnc_hashRem.sqf @@ -1,9 +1,22 @@ -//fnc_hashRem.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" private ["_val", "_index"]; -PARAMS_2(_hash,_key); +params ["_hash", "_key"]; + ERRORDATA(2); _val = nil; try { diff --git a/addons/common/functions/fnc_hashSet.sqf b/addons/common/functions/fnc_hashSet.sqf index 1b3bded6e9..0be700037c 100644 --- a/addons/common/functions/fnc_hashSet.sqf +++ b/addons/common/functions/fnc_hashSet.sqf @@ -1,10 +1,22 @@ -//fnc_hashSet.sqf +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" private ["_index"]; // diag_log text format["%1 HASH SET: %2", ACE_diagTime, _this]; -PARAMS_3(_hash,_key,_val); +params ["_hash", "_key", "_val"]; ERRORDATA(3); try { From 6b96c7fd7c3cb6e47bed7f6a460661bbe7f370e0 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 22:27:23 +0200 Subject: [PATCH 114/311] more common code cleanup --- addons/common/functions/fnc_hasItem.sqf | 25 ++++++----- addons/common/functions/fnc_hasMagazine.sqf | 30 ++++++-------- addons/common/functions/fnc_headBugFix.sqf | 2 +- .../common/functions/fnc_inTransitionAnim.sqf | 2 +- addons/common/functions/fnc_inheritsFrom.sqf | 41 ++++++++++++------- addons/common/functions/fnc_insertionSort.sqf | 38 +++++++++-------- .../functions/fnc_interpolateFromArray.sqf | 20 +++++++-- addons/common/functions/fnc_isAutoWind.sqf | 13 +++--- addons/common/functions/fnc_isAwake.sqf | 23 ++++++----- addons/common/functions/fnc_isEOD.sqf | 2 +- addons/common/functions/fnc_isEngineer.sqf | 2 +- .../functions/fnc_isFeatureCameraActive.sqf | 5 +-- addons/common/functions/fnc_isModLoaded.sqf | 3 +- addons/common/functions/fnc_isPlayer.sqf | 2 +- 14 files changed, 119 insertions(+), 89 deletions(-) diff --git a/addons/common/functions/fnc_hasItem.sqf b/addons/common/functions/fnc_hasItem.sqf index 00c5ed5846..526f5a46f2 100644 --- a/addons/common/functions/fnc_hasItem.sqf +++ b/addons/common/functions/fnc_hasItem.sqf @@ -1,13 +1,18 @@ -/** - * fn_hasItem.sqf - * @Descr: Check if unit has item - * @Author: Glowbal +/* + * Author: Glowbal + * Check if unit has item * - * @Arguments: [unit OBJECT, item STRING (Classname of item)] - * @Return: BOOL - * @PublicAPI: true + * Arguments: + * 0: Unit + * 1: Item Classname + * + * Return Value: + * has Item + * + * Public: yes */ - #include "script_component.hpp" +#include "script_component.hpp" -// item classname in items unit -((_this select 1) in items (_this select 0)); \ No newline at end of file +params ["_unit", "_item"]; + +_item in items _unit // return diff --git a/addons/common/functions/fnc_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf index 52a5ed4cd5..27150ea5d5 100644 --- a/addons/common/functions/fnc_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -1,22 +1,18 @@ -/** - * fn_hasMagazine.sqf - * @Descr: Check if given unit has a magazine of given classname - * @Author: Glowbal +/* + * Author: Glowbal + * Check if given unit has a magazine of given classname * - * @Arguments: [unit OBJECT, magazine STRING] - * @Return: BOOL True if unith as given magazine - * @PublicAPI: true + * Arguments: + * 0: Unit + * 1: Magazine Classname + * + * Return Value: + * has Magazine + * + * Public: yes */ - #include "script_component.hpp" -private ["_return"]; -PARAMS_2(_unit,_magazine); +params ["_unit", "_magazine"]; -if (_magazine != "") then { - _return = (_magazine in magazines _unit); -} else { - _return = false; -}; - -_return \ No newline at end of file +_magazine in magazines _unit // return diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 0c02b9397a..78b1a602df 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -34,7 +34,7 @@ titleCut ["", "BLACK"]; _dummy = createVehicle ["ACE_Headbug_Fix", _pos, [], 0, "NONE"]; _dummy setDir _dir; _unit moveInAny _dummy; -sleep 0.1; +sleep 0.1; // @todo unassignVehicle _unit; _unit action ["Eject", vehicle _unit]; diff --git a/addons/common/functions/fnc_inTransitionAnim.sqf b/addons/common/functions/fnc_inTransitionAnim.sqf index 34c6c04fd8..fd90291d73 100644 --- a/addons/common/functions/fnc_inTransitionAnim.sqf +++ b/addons/common/functions/fnc_inTransitionAnim.sqf @@ -12,4 +12,4 @@ */ #include "script_component.hpp" -getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "looped") == 0 +getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "looped") == 0 // return diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index 27d84b9d12..586a37847c 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -1,25 +1,36 @@ -/** - * fn_inheritsFrom.sqf - * @Descr: Checks whether a given configuration name appears in the inheritance tree of a specific configuration entry. - * @Author: Ruthberg +/* + * Author: Ruthberg + * Checks whether a given configuration name appears in the inheritance tree of a specific configuration entry. * - * @Arguments: [configEntry CONFIG, configname STRING] - * @Return: BOOL - * @PublicAPI: true + * Arguments: + * 0: configEntry (CONFIG) + * 1: configname (STING) + * + * Return Value: + * BOOLEAN + * + * Public: Yes + * + * Note: Not to be confused with the inheritsFrom scripting command. + * + * Deprecated */ - #include "script_component.hpp" - private ["_match"]; -PARAMS_2(_configEntry,_configMatch); +params ["_configEntry", "_configMatch"]; -if (configName _configEntry == _configMatch) exitWith { true }; -if (configName _configEntry == ",") exitWith { false }; +if (configName _configEntry == _configMatch) exitWith {true}; +if (configName _configEntry == ",") exitWith {false}; +private "_match"; _match = false; + while {configName _configEntry != ""} do { - if (configName _configEntry == _configMatch) exitWith { _match = true }; - _configEntry = inheritsFrom(_configEntry); + if (configName _configEntry == _configMatch) exitWith { + _match = true; + }; + + _configEntry = inheritsFrom _configEntry; }; -_match \ No newline at end of file +_match diff --git a/addons/common/functions/fnc_insertionSort.sqf b/addons/common/functions/fnc_insertionSort.sqf index bdafa70592..9f8c95e095 100644 --- a/addons/common/functions/fnc_insertionSort.sqf +++ b/addons/common/functions/fnc_insertionSort.sqf @@ -1,34 +1,38 @@ -/** - * fn_insertionSort.sqf - * @Descr: Sorts an array of numbers - * @Author: Ruthberg +/* + * Author: Ruthberg + * Sorts an array of numbers * - * @Arguments: [array ARRAY, (optional) ascending BOOL] - * @Return: sortedArray ARRAY - * @PublicAPI: true + * Arguments: + * 0: array + * 1: ascending (optional) + * + * Return Value: + * sortedArray (ARRAY) + * + * Public: Yes */ - #include "script_component.hpp" -private ["_list", "_ascending", "_tmp", "_i", "_j"]; -_list = +(_this select 0); -_ascending = true; -if (count _this > 1) then { - _ascending = _this select 1; -}; +params ["_list", ["_ascending", true]]; -for "_i" from 1 to (count _list) - 1 do { +_list = + _list; // copy array to not alter the original one + +private "_tmp"; + +for "_i" from 1 to (count _list - 1) do { _tmp = _list select _i; _j = _i; + while {_j >= 1 && {_tmp < _list select (_j - 1)}} do { _list set [_j, _list select (_j - 1)]; _j = _j - 1; }; - _list set[_j, _tmp]; + + _list set [_j, _tmp]; }; if (!_ascending) then { reverse _list; }; -_list \ No newline at end of file +_list diff --git a/addons/common/functions/fnc_interpolateFromArray.sqf b/addons/common/functions/fnc_interpolateFromArray.sqf index 2427fa47b5..5ce59bde62 100644 --- a/addons/common/functions/fnc_interpolateFromArray.sqf +++ b/addons/common/functions/fnc_interpolateFromArray.sqf @@ -1,11 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Interpolates between two set points in a curve. + * + * Arguments: + * 0: List of numbers to interpolate from + * 1: Value / index + * + * Return Value: + * Interpolation result + * + * Public: Yes + */ #include "script_component.hpp" -private ["_min", "_max"]; +params ["_array", "_value"]; -PARAMS_2(_array,_value); +private ["_min", "_max"]; _min = _array select floor _value; _max = _array select ceil _value; -_min + (_max - _min) * (_value % 1) +_min + (_max - _min) * (_value % 1) // return diff --git a/addons/common/functions/fnc_isAutoWind.sqf b/addons/common/functions/fnc_isAutoWind.sqf index 50933e40a2..04bb22a785 100644 --- a/addons/common/functions/fnc_isAutoWind.sqf +++ b/addons/common/functions/fnc_isAutoWind.sqf @@ -1,14 +1,15 @@ /* * Author: commy2 - * * Check if wind is set on auto. * - * Argument: - * None. + * Arguments + * None * - * Return value: - * This mission has automatic wind? (Bool) + * Return Value: + * This mission has automatic wind? + * + * Public: Yes */ #include "script_component.hpp" -["Mission", "Intel", "windForced"] call FUNC(getNumberFromMissionSQM) != 1 +["Mission", "Intel", "windForced"] call FUNC(getNumberFromMissionSQM) != 1 // return diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index c0dd59288e..f640eaa012 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -1,15 +1,18 @@ -/** - * fn_isAwake.sqf - * @Descr: Check if unit is awake. Will be false when death or unit is unconscious. - * @Author: Glowbal +/* + * Author: Glowbal * - * @Arguments: [unit OBJECT] - * @Return: BOOL True if unit is awake - * @PublicAPI: true + * Check if unit is awake. Will be false when death or unit is unconscious. + * + * Arguments: + * 0: Unit + * + * Return Value: + * if unit is awake + * + * Public: Yes */ - #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -(!(_unit getvariable ["ACE_isUnconscious",false]) && alive _unit && !(_unit getvariable ["ACE_isDead",false])); +!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]); diff --git a/addons/common/functions/fnc_isEOD.sqf b/addons/common/functions/fnc_isEOD.sqf index 6e331ea317..ee82cf2068 100644 --- a/addons/common/functions/fnc_isEOD.sqf +++ b/addons/common/functions/fnc_isEOD.sqf @@ -20,4 +20,4 @@ params ["_unit"]; -_unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] +_unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] // return diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf index 419fb5396d..9018149c27 100644 --- a/addons/common/functions/fnc_isEngineer.sqf +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -14,4 +14,4 @@ params ["_unit"]; -_unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] +_unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] // return diff --git a/addons/common/functions/fnc_isFeatureCameraActive.sqf b/addons/common/functions/fnc_isFeatureCameraActive.sqf index 0b91b19e55..7d282109b2 100644 --- a/addons/common/functions/fnc_isFeatureCameraActive.sqf +++ b/addons/common/functions/fnc_isFeatureCameraActive.sqf @@ -19,9 +19,8 @@ * Example: * [] call ace_common_fnc_isFeatureCameraActive * - * Public: No + * Public: Yes */ - #include "script_component.hpp" !( @@ -32,4 +31,4 @@ {isNull (GETMVAR(BIS_fnc_camera_cam, objNull))} && // Splendid camera {isNull (GETUVAR(BIS_fnc_animViewer_cam, objNull))} && // Animation viewer camera {isNull (GETMVAR(BIS_DEBUG_CAM, objNull))} // Classic camera -) +) // return diff --git a/addons/common/functions/fnc_isModLoaded.sqf b/addons/common/functions/fnc_isModLoaded.sqf index bfdf38f49c..3628777f6c 100644 --- a/addons/common/functions/fnc_isModLoaded.sqf +++ b/addons/common/functions/fnc_isModLoaded.sqf @@ -10,7 +10,6 @@ * * Public: Yes */ - #include "script_component.hpp" -isClass (configFile >> "cfgPatches" >> _this select 0) +isClass (configFile >> "cfgPatches" >> _this select 0) // return diff --git a/addons/common/functions/fnc_isPlayer.sqf b/addons/common/functions/fnc_isPlayer.sqf index ac7d5bd786..8bea7e9771 100644 --- a/addons/common/functions/fnc_isPlayer.sqf +++ b/addons/common/functions/fnc_isPlayer.sqf @@ -16,4 +16,4 @@ params ["_unit", ["_excludeRemoteControlled", false]]; -isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)}) +isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)}) // return From 73a9c1b5f88dc8c6148f809ce6942936809b1f06 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 19 Sep 2015 23:18:07 +0200 Subject: [PATCH 115/311] more common code cleanup --- addons/common/functions/fnc_localEvent.sqf | 1 - addons/common/functions/fnc_setProne.sqf | 40 ++++------ addons/common/functions/fnc_setSetting.sqf | 27 +++---- .../functions/fnc_setSettingFromConfig.sqf | 15 ++-- .../common/functions/fnc_setVariableJIP.sqf | 23 +++--- .../functions/fnc_setVariablePublic.sqf | 73 ++++++++++--------- 6 files changed, 83 insertions(+), 96 deletions(-) diff --git a/addons/common/functions/fnc_localEvent.sqf b/addons/common/functions/fnc_localEvent.sqf index ee94111994..f5a121c088 100644 --- a/addons/common/functions/fnc_localEvent.sqf +++ b/addons/common/functions/fnc_localEvent.sqf @@ -1,6 +1,5 @@ /* * Author: Nou - * * Execute a local event on this client only. * * Arguments: diff --git a/addons/common/functions/fnc_setProne.sqf b/addons/common/functions/fnc_setProne.sqf index b456c5094a..ce61f923a2 100644 --- a/addons/common/functions/fnc_setProne.sqf +++ b/addons/common/functions/fnc_setProne.sqf @@ -1,28 +1,20 @@ -/** - * fn_setProne.sqf - * @Descr: Force a unit to go prone - * @Author: Glowbal +/* + * Author: Glowbal + * Force a unit to go prone * - * @Arguments: [unit OBJECT] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_unit"]; -_unit = [_this,0, ObjNull,[ObjNull]] call BIS_fnc_Param; -switch (currentWeapon _unit) do { - case (primaryWeapon _unit): { - [_unit,"amovppnemstpsraswrfldnon"] call FUNC(localAnim); - }; - case (secondaryWeapon _unit): { - [_unit,"amovppnemstpsraswlnrdnon"] call FUNC(localAnim); - }; - case (handgunWeapon _unit): { - [_unit,"AmovPpneMstpSrasWpstDnon"] call FUNC(localAnim); - }; - default { - [_unit,"amovppnemstpsnonwnondnon"] call FUNC(localAnim); - }; -}; \ No newline at end of file +params ["_unit"]; + +[ + _unit, + ["amovppnemstpsnonwnondnon", "amovppnemstpsraswrfldnon", "amovppnemstpsraswlnrdnon", "amovppnemstpsraswpstdnon"] select (([primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit] find currentWeapon _unit) + 1) +] call FUNC(localAnim); diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index d50e09fb15..60b64e31d4 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -5,10 +5,10 @@ * If executed on server it can have global effect if the last parameter is set to true. * * Arguments: - * 0: Setting name (String) - * 1: Value (Any) - * 2: Force it? (Bool) (Optional) - * 3: Broadcast the change to all clients (Bool) (Optional) + * 0: Setting name + * 1: Value + * 2: Force it? (default: false) + * 3: Broadcast the change to all clients (default: false) * * Return Value: * None @@ -17,15 +17,9 @@ */ #include "script_component.hpp" -private ["_force", "_settingData","_failed"]; +params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]]; -PARAMS_2(_name,_value); - -private ["_force"]; -_force = false; -if (count _this > 2) then { - _force = _this select 2; -}; +private ["_settingData", "_failed"]; _settingData = [_name] call FUNC(getSettingData); @@ -37,9 +31,9 @@ if (_settingData select 6) exitWith {}; // If the type is not equal, try to cast it _failed = false; -if ((typeName _value) != (_settingData select 1)) then { +if (typeName _value != _settingData select 1) then { _failed = true; - if ((_settingData select 1) == "BOOL" and (typeName _value) == "SCALAR") then { + if (_settingData select 1 == "BOOL" && typeName _value == "SCALAR") then { // If value is not 0 or 1 consider it invalid and don't set anything if (_value isEqualTo 0) then { _value = false; @@ -50,10 +44,11 @@ if ((typeName _value) != (_settingData select 1)) then { _failed = false; }; }; - if ((_settingData select 1) == "COLOR" and (typeName _value) == "ARRAY") then { + if (_settingData select 1 == "COLOR" && typeName _value == "ARRAY") then { _failed = false; }; }; + if (_failed) exitWith {}; // Force it if it was required @@ -66,7 +61,7 @@ if (_value isEqualTo (missionNamespace getVariable _name)) exitWith {}; TRACE_2("Variable Updated",_name,_value); missionNamespace setVariable [_name, _value]; -if (isServer && {count _this > 3} && {_this select 3}) then { +if (isServer && {_broadcastChanges}) then { // Publicize the new value publicVariable _name; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index f06436884f..5dc55f51f7 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -3,7 +3,7 @@ * Load a setting from config if it was not previosuly forced. Force if neccesary. * * Arguments: - * 0: Config entry (config entry) + * 0: Config entry * * Return Value: * None @@ -12,12 +12,12 @@ */ #include "script_component.hpp" -PARAMS_1(_optionEntry); +params ["_optionEntry"]; -private ["_fnc_getValueWithType", "_value","_name", "_typeName", "_settingData", "_valueConfig", "_text"]; +private ["_fnc_getValueWithType", "_value", "_name", "_typeName", "_settingData", "_valueConfig", "_text"]; _fnc_getValueWithType = { - EXPLODE_2_PVT(_this,_optionEntry,_typeName); + params ["_optionEntry", "_typeName"]; _valueConfig = (_optionEntry >> "value"); _value = if (isNumber (_optionEntry >> "value")) then {getNumber (_optionEntry >> "value")} else {0}; @@ -103,11 +103,8 @@ if (isNil _name) then { // The setting is not forced, so update the value - // Get the type from the existing variable - _typeName = _settingData select 1; - - // Read entry and cast it to the correct type - _value = [_optionEntry, _typeName] call _fnc_getValueWithType; + // Read entry and cast it to the correct type from the existing variable + _value = [_optionEntry, _settingData select 1] call _fnc_getValueWithType; // Update the variable missionNamespace setVariable [_name, _value]; diff --git a/addons/common/functions/fnc_setVariableJIP.sqf b/addons/common/functions/fnc_setVariableJIP.sqf index 8177e97473..766a4d9f5b 100644 --- a/addons/common/functions/fnc_setVariableJIP.sqf +++ b/addons/common/functions/fnc_setVariableJIP.sqf @@ -3,25 +3,26 @@ * * Sets a public object namespace variable that gets reset with the same value after respawn, so JIP clients keep the value. * - * Argument: - * 0: Object (Object) - * 1: Variable name (String) - * 2: Any value (Anything) + * Arguments: + * 0: Object + * 1: Variable name + * 2: Any value * - * Return value: - * Nothing. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_respawnVariables"]; - -PARAMS_3(_unit,_varName,_value); +params ["_unit", "_varName", "_value"]; +private "_respawnVariables"; _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; if !(_varName in _respawnVariables) then { - _respawnVariables pushBack _varName; - _unit setVariable ["ACE_respawnVariables", _respawnVariables, true]; + _respawnVariables pushBack _varName; + _unit setVariable ["ACE_respawnVariables", _respawnVariables, true]; }; _unit setVariable [_varName, _value, true]; diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index f5ab1920db..7e9b98233a 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -1,54 +1,57 @@ /* - * Author: commy2 + * Author: commy2 and joko // Jonas * * Sets a public variable, but wait a certain amount of ACE_time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. * - * Argument: - * 0: Object the variable should be assigned to (Object) - * 1: Name of the variable (String) - * 2: Value of the variable (Any) - * 3: Windup ACE_time (Number, optional. Default: 1) + * Arguments: + * 0: Object the variable should be assigned to + * 1: Name of the variable + * 2: Value of the variable + * 3: Windup ACE_time (default: 1) * - * Return value: - * Nothing. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -PARAMS_4(_object,_varName,_value,_sync); - -if (isNil "_sync") then { - _sync = 1; -}; +params ["_object", "_varName", "_value", ["_sync", 1]]; // set value locally _object setVariable [_varName, _value]; -// "duh" -if (!isMultiplayer) exitWith {}; +// Exit Dedicated server and headless Clients +if (!hasInterface) exitWith {}; -// generate stacked eventhandler id -private "_idName"; -_idName = format ["ACE_setVariablePublic_%1", _varName]; +private ["_idName", "_syncTime"]; -// exit now if an eh for that variable already exists -private "_allIdNames"; -_allIdNames = [GETMVAR(BIS_stackedEventHandlers_onEachFrame,[]), {_this select 0}] call FUNC(map); +if (_idName in GVAR(setVariableNames)) exitWith {}; -if (_idName in _allIdNames) exitWith {}; - -// when to push the value -private "_syncTime"; _syncTime = ACE_diagTime + _sync; -// add eventhandler -[_idName, "onEachFrame", { - // wait to sync the variable - if (ACE_diagTime > _this select 2) then { - // set value public - (_this select 0) setVariable [_this select 1, (_this select 0) getVariable (_this select 1), true]; +GVAR(setVariableNames) pushBack _idName; - // remove eventhandler - [_this select 3, "onEachFrame"] call BIS_fnc_removeStackedEventHandler +GVAR(setVariablePublicArray) pushBack [_object, _varName, _syncTime, _idName]; + +if (isNil QGVAR(setVariablePublicPFH)) exitWith {}; + +GVAR(setVariablePublicPFH) = [{ + private "_delete"; + _delete = 0; + { + _x params ["_object", "_varName", "_syncTime", "_idName"]; + if (ACE_diagTime > _syncTime) then { + // set value public + _object setVariable [_varName, _object getVariable _varName, true]; + GVAR(setVariablePublicArray) deleteAt _forEachIndex - _delete; + GVAR(setVariableNames) deleteAt _forEachIndex - _delete; + _delete = _delete + 1; + }; + } forEach GVAR(setVariablePublicArray); + + if (GVAR(setVariablePublicArray) isEqualTo []) then { + [GVAR(setVariablePublicPFH)] call CBA_fnc_removePerFrameHandler; + GVAR(setVariablePublicPFH) = nil; }; -}, [_object, _varName, _syncTime, _idName]] call BIS_fnc_addStackedEventHandler; -nil +}, 0, []] call CBA_fnc_addPerFrameHandler; From dfa6d71a641e2726a21e23b2d17baf78f6d272fb Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 00:55:58 +0200 Subject: [PATCH 116/311] more common code cleanup --- addons/common/functions/fnc_setProne.sqf | 2 + addons/common/functions/fnc_setVolume.sqf | 23 ++++---- addons/common/functions/fnc_showUser.sqf | 1 - .../functions/fnc_sortAlphabeticallyBy.sqf | 27 ++++++---- .../functions/fnc_stringRemoveWhiteSpace.sqf | 29 +++++----- .../functions/fnc_switchToGroupSide.sqf | 54 +++++++++++-------- addons/common/functions/fnc_targetEvent.sqf | 22 ++++---- addons/common/functions/fnc_timePFH.sqf | 17 ++++-- addons/common/functions/fnc_toBin.sqf | 7 ++- addons/common/functions/fnc_toBitmask.sqf | 6 +-- addons/common/functions/fnc_toHex.sqf | 18 ++++--- addons/common/functions/fnc_toNumber.sqf | 40 +++++++------- .../functions/fnc_translateToModelSpace.sqf | 31 ++++++----- .../functions/fnc_translateToWeaponSpace.sqf | 39 ++++++++------ 14 files changed, 181 insertions(+), 135 deletions(-) diff --git a/addons/common/functions/fnc_setProne.sqf b/addons/common/functions/fnc_setProne.sqf index ce61f923a2..75be8bac2d 100644 --- a/addons/common/functions/fnc_setProne.sqf +++ b/addons/common/functions/fnc_setProne.sqf @@ -9,6 +9,8 @@ * None * * Public: Yes + * + * Note: Not functional, because FUNC(localAnim) does no longer exist */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setVolume.sqf b/addons/common/functions/fnc_setVolume.sqf index 133a09bd24..37e1f04cfa 100644 --- a/addons/common/functions/fnc_setVolume.sqf +++ b/addons/common/functions/fnc_setVolume.sqf @@ -1,21 +1,24 @@ -/** - * fn_setVolume_f.sqf - * @Descr: Sets the volume of the game, including third party radio modifications such as TFAR and ACRE. - * @Author: Glowbal +/* + * Author: Glowbal + * Sets the volume of the game, including third party radio modifications such as TFAR and ACRE. * - * @Arguments: [setVolume BOOL] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: setVolume (default: false) + * + * Return Value: + * None + * + * Public: Yes + * + * Note: Uses player */ - #include "script_component.hpp" #define MUTED_LEVEL 0.2 #define NORMAL_LEVEL 1 #define NO_SOUND 0 -private ["_setVolume"]; -_setVolume = [_this, 0, false, [false]] call BIS_fnc_Param; +params [["_setVolume", false]]; if (_setVolume) then { // Vanilla Game diff --git a/addons/common/functions/fnc_showUser.sqf b/addons/common/functions/fnc_showUser.sqf index 488dffbaa9..b783fb4ec5 100644 --- a/addons/common/functions/fnc_showUser.sqf +++ b/addons/common/functions/fnc_showUser.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * hint the Variable ACE_isUsedBy from the input Object every frame * * Argument: diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index db142b01b6..3380b181c8 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -1,18 +1,22 @@ -/** - * fn_sortAlphabeticallyBy.sqf - * @Descr: - * @Author: Glowbal +/* + * Author: Glowbal + * ? deprecated * - * @Arguments: [] - * @Return: - * @PublicAPI: true + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: Yes + * + * Deprecated */ - #include "script_component.hpp" -private ["_elements","_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; +params ["_array", "_elementN"]; -PARAMS_2(_array,_elementN); +private ["_elements", "_indexes", "_theElement", "_tmp", "_tempIndex", "_returnArray"]; _indexes = []; _elements = []; @@ -37,8 +41,9 @@ for "_i" from 1 to (count _elements) - 1 do { }; _returnArray = []; + { _returnArray pushback (_array select _x); } forEach _indexes; -_returnArray; \ No newline at end of file +_returnArray diff --git a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf index 19ca13de3b..7caf8cdf9f 100644 --- a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf +++ b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf @@ -1,21 +1,26 @@ -/** - * fn_stringTrim.sqf - * @Descr: Removes white spaces from string - * @Author: Glowbal +/* + * Author: Glowbal + * Removes white spaces from string * - * @Arguments: [string STRING] - * @Return: STRING copy of string - * @PublicAPI: true + * Arguments: + * 0: stringA + * 1: stringB + * + * Return Value: + * copy of string + * + * Public: Yes + * + * Deprecated */ - #include "script_component.hpp" -#define WHITE_SPACE [20] +params ["_string", ""]; + +private ["_charArray", "_returnString"]; -private ["_string", "_charArray", "_returnString"]; -_string = [_this, 0, "",[""]] call bis_fnc_param; _charArray = toArray _string; _charArray = _charArray - [((toArray " ") select 0)]; _returnString = toString _charArray; -_returnString; \ No newline at end of file +_returnString diff --git a/addons/common/functions/fnc_switchToGroupSide.sqf b/addons/common/functions/fnc_switchToGroupSide.sqf index 528d32853c..95f17a9c7b 100644 --- a/addons/common/functions/fnc_switchToGroupSide.sqf +++ b/addons/common/functions/fnc_switchToGroupSide.sqf @@ -1,45 +1,53 @@ -/** - * fn_switchToGroupSide_f.sqf - * @Descr: Stack group switches. Will always trace back to original group. - * @Author: Glowbal +/* + * Author: Glowbal + * Stack group switches. Will always trace back to original group. * - * @Arguments: [unit OBJECT, switch BOOL, id STRING, side SIDE] - * @Return: void - * @PublicAPI: true + * Arguments: + * 0: Unit + * 1: switch + * 2: id + * 3: side + * + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_unit","_side","_previousGroup","_newGroup", "_currentGroup", "_switch", "_originalSide", "_previousGroupsList", "_id"]; -_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_switch = [_this, 1, false,[false]] call BIS_fnc_Param; -_id = [_this, 2, "", [""]] call BIS_fnc_Param; -_side = [_this, 3, side _unit,[west]] call BIS_fnc_Param; +params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]]; + +private "_previousGroupsList"; +_previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo), []]; -_previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo),[]]; if (_switch) then { // go forward + private ["_previousGroup", "_originalSide", "_newGroup"]; + _previousGroup = group _unit; _originalSide = side group _unit; if (count units _previousGroup == 1 && _originalSide == _side) exitwith { - [format["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); + [format ["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); }; _newGroup = createGroup _side; [_unit] joinSilent _newGroup; - _previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; - _unit setvariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true]; + _previousGroupsList pushBack [_previousGroup, _originalSide, _id, true]; + _unit setVariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true]; } else { // go one back + private ["_currentGroup", "_newGroup"]; + { if (_id == (_x select 2)) exitwith { _x set [ 3, false]; - _previousGroupsList set [_foreachIndex, _x]; + _previousGroupsList set [_forEachIndex, _x]; [format["found group with ID: %1", _id]] call FUNC(debug); }; - }foreach _previousGroupsList; + } forEach _previousGroupsList; + reverse _previousGroupsList; { @@ -55,10 +63,12 @@ if (_switch) then { if (count units _currentGroup == 0) then { deleteGroup _currentGroup; }; - _previousGroupsList set [_foreachIndex, ObjNull]; + _previousGroupsList set [_forEachIndex, objNull]; }; - }foreach _previousGroupsList; + } forEach _previousGroupsList; + _previousGroupsList = _previousGroupsList - [objNull]; reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. - _unit setvariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true]; + + _unit setVariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true]; }; diff --git a/addons/common/functions/fnc_targetEvent.sqf b/addons/common/functions/fnc_targetEvent.sqf index 75023a38b5..b9802f0835 100644 --- a/addons/common/functions/fnc_targetEvent.sqf +++ b/addons/common/functions/fnc_targetEvent.sqf @@ -1,24 +1,23 @@ /* * Author: Nou - * * Execute a event only on specific clients. * - * Argument: - * 0: Event name (string) - * 1: Event targets (object or array of objects) - * 2: Event args (any) + * Arguments: + * 0: Event name (STRING) + * 1: Event targets + * 2: Event args * * Note: If local executor is in list of targets, event will execute with * network delay, and not immediatly. * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_handleNetEvent"); - -PARAMS_3(_eventName,_eventTargets,_eventArgs); +params ["_eventName", "_eventTargets", "_eventArgs"]; #ifdef DEBUG_EVENTS ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets); @@ -26,7 +25,8 @@ PARAMS_3(_eventName,_eventTargets,_eventArgs); #endif ACEc = [_eventName, _eventTargets, _eventArgs]; -if(!isServer) then { + +if (!isServer) then { publicVariableServer "ACEc"; } else { ["ACEc", ACEc] call FUNC(_handleNetEvent); diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index 40fef519a8..1c66974c0d 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -1,7 +1,18 @@ -//#define DEBUG_MODE_FULL +/* + * Author: ? + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" -private["_lastTickTime", "_lastGameTime", "_delta"]; +private ["_lastTickTime", "_lastGameTime", "_delta"]; _lastTickTime = ACE_diagTime; _lastGameTime = ACE_gameTime; @@ -10,7 +21,7 @@ ACE_gameTime = time; ACE_diagTime = diag_tickTime; _delta = ACE_diagTime - _lastTickTime; -if(ACE_gameTime <= _lastGameTime) then { +if (ACE_gameTime <= _lastGameTime) then { TRACE_1("paused",_delta); ACE_paused = true; // Game is paused or not running diff --git a/addons/common/functions/fnc_toBin.sqf b/addons/common/functions/fnc_toBin.sqf index 5afc311511..9f3296597d 100644 --- a/addons/common/functions/fnc_toBin.sqf +++ b/addons/common/functions/fnc_toBin.sqf @@ -1,13 +1,12 @@ /* * Author: commy2 - * * Converts number to binary number * * Arguments: - * A number + * A number * * Return Value: - * A binary number, String + * A binary number as string * * Public: Yes */ @@ -32,4 +31,4 @@ while {count toArray _bin < _minLength} do { _bin = "0" + _bin; }; -_sign + _bin +_sign + _bin // return diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf index 80d671741d..7c6beba733 100644 --- a/addons/common/functions/fnc_toBitmask.sqf +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -1,13 +1,12 @@ /* * Author: commy2 - * * Convert an array of booleans into a number. * * Arguments: - * N: Booleans + * N: Booleans * * Return Value: - * Bitmask (Number) + * Bitmask * * Public: Yes */ @@ -18,6 +17,7 @@ private ["_array", "_result"]; _array = _this; _result = 0; + { if (_x) then {_result = _result + 2 ^ _forEachIndex}; } forEach _array; diff --git a/addons/common/functions/fnc_toHex.sqf b/addons/common/functions/fnc_toHex.sqf index 216d7a5c67..80d8757b80 100644 --- a/addons/common/functions/fnc_toHex.sqf +++ b/addons/common/functions/fnc_toHex.sqf @@ -1,26 +1,28 @@ /* * Author: commy2, esteldunedain - * * Converts number to hexadecimal number * * Arguments: * A number between 0 and 255 * * Return Value: - * A hexadecimal number, + * A hexadecimal number as string * * Public: Yes */ #include "script_component.hpp" -private ["_number"]; -_number = ((round abs (_this select 0)) max 0) min 255; +params ["_number"]; + +_number = ((round abs _number) max 0) min 255; if (isNil QGVAR(hexArray)) then { - private ["_minLength", "_i", "_num", "_hex", "_rest"]; - GVAR(hexArray) = []; + + private ["_minLength", "_num", "_hex", "_rest"]; + _minLength = 2; + for [{_i = 0;}, {_i < 256}, {_i = _i + 1}] do { _num = _i; _hex = ["", "0"] select (_i == 0); @@ -39,11 +41,13 @@ if (isNil QGVAR(hexArray)) then { _num = floor (_num / 16); _hex = _rest + _hex; }; + while {count toArray _hex < _minLength} do { _hex = "0" + _hex; }; + GVAR(hexArray) pushBack _hex; }; }; -(GVAR(hexArray) select _number) +GVAR(hexArray) select _number // return diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf index 55a9ba2787..56d14f6d18 100644 --- a/addons/common/functions/fnc_toNumber.sqf +++ b/addons/common/functions/fnc_toNumber.sqf @@ -1,25 +1,23 @@ /* - Name: FUNC(toNumber) - - Author(s): - Garth de Wet (LH) - - Description: - Takes a string/number and returns the number. - - Parameters: - 0: TYPE - Value to attempt to convert to number or if number simply return number. - - Returns: - NUMBER - - Example: - number = ["102"] call FUNC(toNumber); -*/ + * Author: Garth de Wet (LH) + * + * Takes a string/number and returns the number. + * + * Arguments: + * 0: Value to attempt to convert to number or if number simply return number. + * + * Return Value: + * + * + * Example: + * number = ["102"] call ace_common_fnc_toNumber; + * + * Public: Yes + */ #include "script_component.hpp" -if (typeName (_this select 0) == "SCALAR") exitWith { - (_this select 0) -}; +params ["_value"]; -(parseNumber (_this select 0)) \ No newline at end of file +if (typeName _value == "SCALAR") exitWith {_value}; + +parseNumber _value // return diff --git a/addons/common/functions/fnc_translateToModelSpace.sqf b/addons/common/functions/fnc_translateToModelSpace.sqf index d2dfa38643..578feb8d5b 100644 --- a/addons/common/functions/fnc_translateToModelSpace.sqf +++ b/addons/common/functions/fnc_translateToModelSpace.sqf @@ -1,20 +1,25 @@ +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" -private["_matrix", "_object", "_offset", "_origin", "_out", "_xVec", "_y", "_yVec", "_z", "_zVec"]; +params ["_object", "_matrix", "_offset"]; -_object = _this select 0; +private "_origin"; _origin = getPosASL _object; -_matrix = _this select 1; -_xVec = _matrix select 0; -_yVec = _matrix select 1; -_zVec = _matrix select 2; -_offset = _this select 2; +_matrix params ["_xVec", "_yVec", "_zVec"]; -_x = _offset select 0; -_y = _offset select 1; -_z = _offset select 2; +_offset params ["_x", "_y", "_z"]; -_out = (((_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y)) vectorAdd (_zVec vectorMultiply _z)) vectorAdd _origin; - -_out; \ No newline at end of file +(_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y) vectorAdd (_zVec vectorMultiply _z) vectorAdd _origin // return diff --git a/addons/common/functions/fnc_translateToWeaponSpace.sqf b/addons/common/functions/fnc_translateToWeaponSpace.sqf index ca1544b317..a226265987 100644 --- a/addons/common/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/common/functions/fnc_translateToWeaponSpace.sqf @@ -1,26 +1,31 @@ +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" -private["_matrix", "_object", "_offset", "_origin", "_out", "_xVec", "_y", "_yVec", "_z", "_zVec"]; +params ["_object", "_matrix", "_offset"]; -_object = _this select 0; +private "_origin"; _origin = getPosASL _object; -_matrix = _this select 1; -_xVec = _matrix select 0; -_yVec = _matrix select 1; -_zVec = _matrix select 2; -_offset = _this select 2; +_matrix params ["_xVec", "_yVec", "_zVec"]; _offset = _offset vectorDiff _origin; -_x = _offset select 0; -_y = _offset select 1; -_z = _offset select 2; +_offset params ["_x", "_y", "_z"]; -_out = [ - ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), - ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), - ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) - ]; - -_out; \ No newline at end of file +[ + ((_xVec select 0) * _x) + ((_xVec select 1) * _y) + ((_xVec select 2) * _z), + ((_yVec select 0) * _x) + ((_yVec select 1) * _y) + ((_yVec select 2) * _z), + ((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z) +] // return From 05f4dad76452b202e3ae2a5b7de5be9a549d1af0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 19 Sep 2015 20:42:46 -0500 Subject: [PATCH 117/311] maptools - Remove debug --- addons/maptools/functions/fnc_handleMouseButton.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 442ec4d50e..19869ee3ce 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -91,6 +91,4 @@ if (_dir != 1) then { _handled }; -diag_log text format ["HJa %1", _handled]; - _handled From d33a98c61235fe92a940bcd201f7d715d0fbb47d Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 11:02:15 +0200 Subject: [PATCH 118/311] set variable public didn't work / didn't work on server and headless client --- addons/common/functions/fnc_setVariablePublic.sqf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 7e9b98233a..2f6cd70f65 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -21,11 +21,13 @@ params ["_object", "_varName", "_value", ["_sync", 1]]; // set value locally _object setVariable [_varName, _value]; -// Exit Dedicated server and headless Clients -if (!hasInterface) exitWith {}; +// Exit if in SP +if (!isMultiplayer) exitWith {}; private ["_idName", "_syncTime"]; +_idName = format ["ACE_setVariablePublic_%1", _varName]; + if (_idName in GVAR(setVariableNames)) exitWith {}; _syncTime = ACE_diagTime + _sync; @@ -39,6 +41,7 @@ if (isNil QGVAR(setVariablePublicPFH)) exitWith {}; GVAR(setVariablePublicPFH) = [{ private "_delete"; _delete = 0; + { _x params ["_object", "_varName", "_syncTime", "_idName"]; if (ACE_diagTime > _syncTime) then { From 4265b11d51a437b0162c705e25930d7e87cf821f Mon Sep 17 00:00:00 2001 From: alganthe Date: Sun, 20 Sep 2015 14:13:22 +0200 Subject: [PATCH 119/311] wrong target fixed Signed-off-by: alganthe --- addons/medical/ACE_Medical_Actions.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index fce5edc750..2912c87011 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -125,8 +125,8 @@ class ACE_Torso { class Diagnose { displayName = CSTRING(Actions_Diagnose); distance = 5.0; - condition = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(canTreatCached)); - statement = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(treatment)); + condition = QUOTE([ARR_4(_player, _target, 'body', 'Diagnose')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'Diagnose')] call DFUNC(treatment)); EXCEPTIONS showDisabled = 0; priority = 2; From e8ebe874508672a855dcdcb84dd4e3d55df6ad31 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 15:52:40 +0200 Subject: [PATCH 120/311] more common code cleanup --- addons/common/XEH_preInit.sqf | 1 + .../functions/fnc_setHearingCapability.sqf | 2 + addons/common/functions/fnc_setName.sqf | 1 - addons/common/functions/fnc_setParameter.sqf | 3 +- .../common/functions/fnc_setVariableJIP.sqf | 1 - .../functions/fnc_setVariablePublic.sqf | 1 - .../functions/fnc_sortAlphabeticallyBy.sqf | 2 +- addons/common/functions/fnc_stringCompare.sqf | 38 +++++++----- .../functions/fnc_stringRemoveWhiteSpace.sqf | 12 +--- .../functions/fnc_stringToColoredText.sqf | 1 - addons/common/functions/fnc_syncedEvent.sqf | 32 ++++------ .../common/functions/fnc_syncedEventPFH.sqf | 62 ++++++++++++------- .../functions/fnc_throttledPublicVariable.sqf | 17 +++-- addons/common/functions/fnc_timePFH.sqf | 1 + addons/common/functions/fnc_toBitmask.sqf | 7 +-- addons/common/functions/fnc_toNumber.sqf | 1 - .../functions/fnc_translateToModelSpace.sqf | 1 - .../functions/fnc_translateToWeaponSpace.sqf | 1 - addons/common/functions/fnc_unhideUnit.sqf | 1 - .../common/functions/fnc_uniqueElements.sqf | 27 ++++++++ .../functions/fnc_uniqueElementsOnly.sqf | 33 ++++------ addons/common/functions/fnc_unmuteUnit.sqf | 1 - addons/common/functions/fnc_useItem.sqf | 41 ++++++------ addons/common/functions/fnc_useMagazine.sqf | 40 ++++++------ .../common/functions/fnc_waitAndExecute.sqf | 3 +- addons/common/functions/fnc_waveHeightAt.sqf | 1 + 26 files changed, 176 insertions(+), 155 deletions(-) create mode 100644 addons/common/functions/fnc_uniqueElements.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 9604941ab7..ee10806f39 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -179,6 +179,7 @@ PREP(toBitmask); PREP(toHex); PREP(toNumber); PREP(unhideUnit); +PREP(uniqueElements); PREP(uniqueElementsOnly); PREP(unloadPerson); PREP(unloadPersonLocal); diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 9dea992e3e..d24f8d0d9d 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -11,6 +11,8 @@ * None * * Public: Yes + * + * Note: uses player */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index 8a32dd669d..117445b561 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Sets the name variable of the object. Used to prevent issues with the name command. * * Arguments: diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf index 6a1345479b..dd946f7bc5 100644 --- a/addons/common/functions/fnc_setParameter.sqf +++ b/addons/common/functions/fnc_setParameter.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Sets the value of an ACE_Parameter and makes it public. * * Arguments: @@ -12,7 +11,7 @@ * * Public: Yes * - * Deprecated *@todo commy + * Deprecated */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_setVariableJIP.sqf b/addons/common/functions/fnc_setVariableJIP.sqf index 766a4d9f5b..d1bd27ea4e 100644 --- a/addons/common/functions/fnc_setVariableJIP.sqf +++ b/addons/common/functions/fnc_setVariableJIP.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Sets a public object namespace variable that gets reset with the same value after respawn, so JIP clients keep the value. * * Arguments: diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 2f6cd70f65..b6fb58b0f4 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 and joko // Jonas - * * Sets a public variable, but wait a certain amount of ACE_time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. * * Arguments: diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index 3380b181c8..76082013ef 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -1,6 +1,6 @@ /* * Author: Glowbal - * ? deprecated + * ? * * Arguments: * ? diff --git a/addons/common/functions/fnc_stringCompare.sqf b/addons/common/functions/fnc_stringCompare.sqf index 2162f71fd0..da65c676f8 100644 --- a/addons/common/functions/fnc_stringCompare.sqf +++ b/addons/common/functions/fnc_stringCompare.sqf @@ -1,35 +1,41 @@ -/** - * fn_stringCompare.sqf - * @Descr: Determines whether one string matches another and how many characters match. Case insensitive. - * @Author: bovine3dom +/* + * Author: bovine3dom + * Determines whether one string matches another and how many characters match. Case insensitive. * - * @Arguments: [stringA STRING, stringB STRING] - * @Return: NUMBER Number of matching characters - * @PublicAPI: true + * Arguments: + * 0: stringA + * 1: stringB + * + * Return Value: + * Number of matching characters >NUMBER> + * + * Public: Yes */ - #include "script_component.hpp" -private ["_searchTerm", "_string", "_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"]; -_string = toLower (_this select 0); // removes case sensitivity -_searchTerm = toLower (_this select 1); +params ["_string", "_searchTerm"]; +_string = toLower _string; // removes case sensitivity +_searchTerm = toLower _searchTerm; + +private ["_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"]; _arraySearchTerm = toArray _searchTerm; // splits string into array of unicode decimals _arrayString = toArray _string; _sizeSearchTerm = count _arraySearchTerm; // We only measure the array once _sizeString = count _arrayString; - _matchingCharacters = 0; -_targetIterator = 0; _searchIterator = 0; -while {(_searchIterator < _sizeSearchTerm) && (_targetIterator < _sizeString)} do { // Prevents us from going out of bounds - if ((_arraySearchTerm select _searchIterator) == (_arrayString select _targetIterator)) then { // If we have a match, start looking for the next character in the search term +_targetIterator = 0; + +while {_searchIterator < _sizeSearchTerm && _targetIterator < _sizeString} do { // Prevents us from going out of bounds + if (_arraySearchTerm select _searchIterator == _arrayString select _targetIterator) then { // If we have a match, start looking for the next character in the search term _matchingCharacters = _matchingCharacters + 1; _searchIterator = _searchIterator + 1 }; + _targetIterator = _targetIterator + 1; // Look at the next character in the string }; -_matchingCharacters \ No newline at end of file +_matchingCharacters diff --git a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf index 7caf8cdf9f..2121f69ef4 100644 --- a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf +++ b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf @@ -10,17 +10,9 @@ * copy of string * * Public: Yes - * - * Deprecated */ #include "script_component.hpp" -params ["_string", ""]; +params ["_string"]; -private ["_charArray", "_returnString"]; - -_charArray = toArray _string; -_charArray = _charArray - [((toArray " ") select 0)]; -_returnString = toString _charArray; - -_returnString +(_string splitString " ") joinString "" diff --git a/addons/common/functions/fnc_stringToColoredText.sqf b/addons/common/functions/fnc_stringToColoredText.sqf index 5cbf280320..e6e19e4869 100644 --- a/addons/common/functions/fnc_stringToColoredText.sqf +++ b/addons/common/functions/fnc_stringToColoredText.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Create a centered, colored text. * * Arguments: diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 42b2147f10..34043fa8ae 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -1,33 +1,27 @@ /* * Author: jaynus - * * Call and propegate a synced event * - * Argument: - * 0: Name (String) - * 1: Arguments (Array) - * 2: TTL (Number or Code) [Optional] for this specific event call + * Arguments: + * 0: Name + * 1: Arguments + * 2: TTL [Optional] for this specific event call * - * Return value: - * Boolean of success + * Return Value: + * Boolean of success + * + * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_name,_args); +params ["_name", "_args", ["_ttl", 0]]; -private["_ttl", "_eventData"]; - -if( (count _this) > 2) then { - _ttl = _this select 2; -} else { - _ttl = 0; -}; - -if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { ACE_LOGERROR("Synced event key not found."); false }; -_eventData = [_name, _args,_ttl]; +private "_eventData"; +_eventData = [_name, _args, _ttl]; + ["SEH", _eventData] call FUNC(globalEvent); diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf index a5ec809706..923e445839 100644 --- a/addons/common/functions/fnc_syncedEventPFH.sqf +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -1,52 +1,66 @@ -//#define DEBUG_MODE_FULL +/* + * Author: ? + * + * ? + * + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: ? + */ #include "script_component.hpp" -if(!isServer) exitWith { false }; +if (!isServer) exitWith {false}; // Walk through the local synced events and clean up anything thats already EOL // @TODO: This should be iteration limited to prevent FPS lag -private["_data"]; + { - private["_data", "_eventLog", "_newEventLog", "_name", "_globalEventTTL"]; + private ["_name", "_data", "_newEventLog"]; + _name = _x; _data = HASH_GET(GVAR(syncedEvents),_name); - _eventLog = _data select 1; - _globalEventTTL = _data select 2; + _data params ["_eventTime", "_eventLog", "_globalEventTTL"]; + _newEventLog = []; - + // @TODO: This should be iteration limited to prevent FPS lag { - private["_eventEntry", "_ttlReturn"]; + private ["_eventEntry", "_ttlReturn"]; + _eventEntry = _x; - _ttlReturn = true; - if(typeName _globalEventTTL == "CODE") then { - _ttlReturn = [(_data select 0),_eventEntry] call _globalEventTTL; + + if (typeName _globalEventTTL == "CODE") then { + _ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL; } else { - _ttlReturn = call { _globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL} }; + _ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}}; }; - if(_ttlReturn) then { + if (_ttlReturn) then { // Do event based TTL check - private["_eventTTL"]; - _eventTTL = _eventEntry select 2; - - if(typeName _eventTTL == "CODE") then { - _ttlReturn = [(_data select 0),_eventEntry] call _eventTTL; + _eventEntry params ["_time", "", "_eventTTL"]; + + if (typeName _eventTTL == "CODE") then { + _ttlReturn = [_eventTime, _eventEntry] call _eventTTL; } else { - _ttlReturn = call { _eventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _eventTTL} }; + _ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}}; }; }; // Finally drop it if the TTL check fails - if(_ttlReturn) then { + if (_ttlReturn) then { _newEventLog pushBack _x; }; - } forEach _eventLog; - - _data set[1, _newEventLog]; -} forEach (GVAR(syncedEvents) select 0); + false + } count _eventLog; + _data set [1, _newEventLog]; + false +} count (GVAR(syncedEvents) select 0); // @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf index d43841146a..cdc72f4450 100644 --- a/addons/common/functions/fnc_throttledPublicVariable.sqf +++ b/addons/common/functions/fnc_throttledPublicVariable.sqf @@ -17,21 +17,20 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_varName,_maxDelay); +params ["_unit", "_varName", "_maxDelay"]; // Create the publish scheduler PFH the first ACE_time if (isNil QGVAR(publishSchedId)) then { - GVAR(publishVarNames) = []; GVAR(publishNextTime) = 1e7; GVAR(publishSchedId) = [{ - if (ACE_diagTime > GVAR(publishNextTime)) then { { - EXPLODE_2_PVT(_x,_unit,_varName); - _unit setVariable [_varName, (_unit getVariable _varName), true]; - } forEach GVAR(publishVarNames); + _x params [_unit, _varName]; + _unit setVariable [_varName, _unit getVariable _varName, true]; + false + } count GVAR(publishVarNames); GVAR(publishVarNames) = []; GVAR(publishNextTime) = 1e7; @@ -40,10 +39,10 @@ if (isNil QGVAR(publishSchedId)) then { }; // If the variable is not on the list -if (GVAR(publishVarNames) find [_unit,_varName] == -1) exitWith { - GVAR(publishVarNames) pushBack [_unit,_varName]; +if (GVAR(publishVarNames) find [_unit, _varName] == -1) exitWith { + GVAR(publishVarNames) pushBack [_unit, _varName]; GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay); }; // If the variable is on the list -GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay); \ No newline at end of file +GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay); diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index 1c66974c0d..4f099ea68c 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -21,6 +21,7 @@ ACE_gameTime = time; ACE_diagTime = diag_tickTime; _delta = ACE_diagTime - _lastTickTime; + if (ACE_gameTime <= _lastGameTime) then { TRACE_1("paused",_delta); ACE_paused = true; diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf index 7c6beba733..35b1e06f9f 100644 --- a/addons/common/functions/fnc_toBitmask.sqf +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -12,14 +12,11 @@ */ #include "script_component.hpp" -private ["_array", "_result"]; - -_array = _this; - +private "_result"; _result = 0; { if (_x) then {_result = _result + 2 ^ _forEachIndex}; -} forEach _array; +} forEach _this; _result diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf index 56d14f6d18..6b1aacde1e 100644 --- a/addons/common/functions/fnc_toNumber.sqf +++ b/addons/common/functions/fnc_toNumber.sqf @@ -1,6 +1,5 @@ /* * Author: Garth de Wet (LH) - * * Takes a string/number and returns the number. * * Arguments: diff --git a/addons/common/functions/fnc_translateToModelSpace.sqf b/addons/common/functions/fnc_translateToModelSpace.sqf index 578feb8d5b..b05a19bed6 100644 --- a/addons/common/functions/fnc_translateToModelSpace.sqf +++ b/addons/common/functions/fnc_translateToModelSpace.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_translateToWeaponSpace.sqf b/addons/common/functions/fnc_translateToWeaponSpace.sqf index a226265987..db3a5eaf37 100644 --- a/addons/common/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/common/functions/fnc_translateToWeaponSpace.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_unhideUnit.sqf b/addons/common/functions/fnc_unhideUnit.sqf index 488c4475fd..5bcafc3509 100644 --- a/addons/common/functions/fnc_unhideUnit.sqf +++ b/addons/common/functions/fnc_unhideUnit.sqf @@ -1,6 +1,5 @@ /* * Author: SilentSpike (based on unmuteUnit) - * * Globally unhides a unit. Only unhides if the last reason was removed. * * Arguments: diff --git a/addons/common/functions/fnc_uniqueElements.sqf b/addons/common/functions/fnc_uniqueElements.sqf new file mode 100644 index 0000000000..812bf59dba --- /dev/null +++ b/addons/common/functions/fnc_uniqueElements.sqf @@ -0,0 +1,27 @@ +/* + * Author: Glowbal + * Make a copy of an array with only the unique elements. + * + * Arguments: + * 0: array + * + * Return Value: + * Copy of original array + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_array"]; + +private "_result"; +_result = []; + +{ + if !(_x in _result) then { + _result pushBack _x; + }; + false +} count _array; + +_result diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index c81efb8308..e8d469867e 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -1,24 +1,17 @@ -/** - * fn_uniqueElementsOnly.sqf - * @Descr: Make a copy of an array with only the unique elements. - * @Author: Glowbal +/* + * Author: Glowbal + * Make a copy of an array with only the unique elements. * - * @Arguments: [array ARRAY] - * @Return: ARRAY Copy of original array - * @PublicAPI: true + * Arguments: + * 0: array + * + * Return Value: + * Copy of original array + * + * Public: Yes + * + * Deprecated */ - #include "script_component.hpp" -private ["_result", "_value"]; -PARAMS_1(_array); - -_result = []; -{ - _value = _x; - if ({_x isEqualTo _value} count _result == 0) then { - _result pushback _x; - }; -} forEach _array; - -_result; \ No newline at end of file +_this call FUNC(uniqueElements) diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf index e234cb80db..bf02fe676f 100644 --- a/addons/common/functions/fnc_unmuteUnit.sqf +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Unmutes the unit. Only unmutes if the last reason was removed. * * Arguments: diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf index 03589cd56d..acf359813c 100644 --- a/addons/common/functions/fnc_useItem.sqf +++ b/addons/common/functions/fnc_useItem.sqf @@ -1,36 +1,37 @@ -/** - * fn_useItem.sqf - * @Descr: - * @Author: Glowbal +/* + * Author: Glowbal + * Use item * - * @Arguments: [] - * @Return: - * @PublicAPI: true + * Arguments: + * 0: unit + * 1: item + * + * Return Value: + * if item has been used. + * + * Public: Yes */ - #include "script_component.hpp" -PARAMS_2(_unit,_item); - -private ["_return", "_vehicleUsage"]; - -_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; +params ["_unit", "_item", ["_vehicleUsage", false]]; +private "_return"; _return = false; -if (!_vehicleUsage) then { + +if !(_vehicleUsage) then { if (_item != "") then { - if (_item in (items _unit)) then { + if (_item in items _unit) then { _unit removeItem _item; _return = true; } else { - if (_item in (assignedItems _unit)) then { - _unit unassignItem _item; - _unit removeItem _item; + if (_item in assignedItems _unit) then { + _unit unlinkItem _item; _return = true; }; }; }; +//} else { + // @todo implement shared item functionality for with vehicles. }; -// TODO implement shared item functionality for with vehicles. -_return; \ No newline at end of file +_return diff --git a/addons/common/functions/fnc_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf index f21a04d026..1a77d0b3f3 100644 --- a/addons/common/functions/fnc_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -1,28 +1,32 @@ -/** - * fn_useMagazine.sqf - * @Descr: Use magazine - * @Author: Glowbal +/* + * Author: Glowbal + * Use magazine * - * @Arguments: [unit OBJECt, magazine STRING] - * @Return: BOOL True if magazine has been used. - * @PublicAPI: true + * Arguments: + * 0: unit + * 1: magazine + * + * Return Value: + * if magazine has been used. + * + * Public: Yes */ - #include "script_component.hpp" -private ["_return", "_vehicleUsage"]; -PARAMS_2(_unit,_magazine); -_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; +params ["_unit", "_magazine", ["_vehicleUsage", false]]; -if (!_vehicleUsage) then { +private "_return"; +_return = false; + +if !(_vehicleUsage) then { if (_magazine != "") then { _unit removeMagazine _magazine; _return = true; - } else { - _return = false; }; - [format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug); + + [format ["fnc_useMagazine: %1 | %2", _this, _return]] call FUNC(debug); +//} else { + // @todo implement shared magazine functionality +}; + _return -} else { - // TODO implement shared magazine functionality -}; \ No newline at end of file diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf index 6fcf83a58f..c8f078854b 100644 --- a/addons/common/functions/fnc_waitAndExecute.sqf +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Executes a code once with a given game ACE_time delay, using a PFH * * Arguments: @@ -20,5 +19,5 @@ params ["_func", "_params", "_delay"]; -GVAR(waitAndExecArray) pushBack [(ACE_time + _delay), _func, _params]; +GVAR(waitAndExecArray) pushBack [ACE_time + _delay, _func, _params]; GVAR(waitAndExecArray) sort true; diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf index ac9eed10bb..a3f2447729 100644 --- a/addons/common/functions/fnc_waveHeightAt.sqf +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -19,6 +19,7 @@ params ["_position"]; if (isNil QGVAR(waveHeightLogic)) then { GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; }; + GVAR(waveHeightLogic) setPosASL _position; (getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2) From e62683a0c411193cfda99b43a085e097a507e9e7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 16:40:49 +0200 Subject: [PATCH 121/311] more common code cleanup --- addons/common/functions/fnc_globalEvent.sqf | 18 +++++----- addons/common/functions/fnc_goKneeling.sqf | 34 +++++++------------ addons/common/functions/fnc_hashHasKey.sqf | 1 - .../functions/fnc_hashListCreateHash.sqf | 1 - .../functions/fnc_hashListCreateList.sqf | 1 - addons/common/functions/fnc_hashListPush.sqf | 1 - .../common/functions/fnc_hashListSelect.sqf | 1 - addons/common/functions/fnc_hashListSet.sqf | 1 - addons/common/functions/fnc_hashRem.sqf | 1 - addons/common/functions/fnc_hashSet.sqf | 1 - addons/common/functions/fnc_isAlive.sqf | 2 +- addons/common/functions/fnc_isAwake.sqf | 3 +- addons/common/functions/fnc_isModLoaded.sqf | 4 ++- addons/common/functions/fnc_map.sqf | 1 + .../functions/fnc_moduleLSDVehicles.sqf | 1 - addons/common/functions/fnc_owned.sqf | 1 - addons/common/functions/fnc_player.sqf | 1 - addons/common/functions/fnc_playerSide.sqf | 1 - addons/common/functions/fnc_positionToASL.sqf | 2 +- .../functions/fnc_readSettingFromModule.sqf | 1 - .../fnc_removeCanInteractWithCondition.sqf | 1 - .../functions/fnc_restoreVariablesJIP.sqf | 1 - .../common/functions/fnc_sanitizeString.sqf | 29 ++++++++++------ 23 files changed, 48 insertions(+), 60 deletions(-) diff --git a/addons/common/functions/fnc_globalEvent.sqf b/addons/common/functions/fnc_globalEvent.sqf index b605a406b1..9928bc3468 100644 --- a/addons/common/functions/fnc_globalEvent.sqf +++ b/addons/common/functions/fnc_globalEvent.sqf @@ -3,18 +3,20 @@ * * Execute a global event on all clients, including self. * - * Argument: - * 0: Event name (string) - * 1: Event args (any) + * Arguments: + * 0: Event name + * 1: Event args * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_handleNetEvent"); -PARAMS_2(_eventName,_eventArgs); +params ["_eventName", "_eventArgs"]; ACEg = [_eventName, _eventArgs]; publicVariable "ACEg"; -["ACEg", ACEg] call FUNC(_handleNetEvent); \ No newline at end of file + +["ACEg", ACEg] call FUNC(_handleNetEvent); diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf index 0ff25b460f..4ee502f929 100644 --- a/addons/common/functions/fnc_goKneeling.sqf +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -1,32 +1,22 @@ /* * Author: commy2 + * Move unit to kneeling position. * - * Abhocken! Unit goes kneeling if not prone already and lowers weapon. Try, throw, catch because I'm bored. + * Arguments: + * 0: Unit * - * Argument: - * 0: Unit (Object) + * Return Value: + * None * - * Return value: - * None. + * Public: No */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -//IGNORE_PRIVATE_WARNING("_exception"); +if (stance _unit == "PRONE") exitWith {}; -try { - if (_unit == vehicle _unit) then { - switch (currentWeapon _unit) do { - case "" : {throw "AmovPknlMstpSnonWnonDnon"}; - case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"}; - case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"}; - case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"}; - case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"}; - }; - }; -} catch { - if (stance _unit != "PRONE") then { - [_unit, _exception] call FUNC(doAnimation); - }; -}; +[ + _unit, + ["AmovPknlMstpSnonWnonDnon", "AmovPknlMstpSlowWrflDnon", "AmovPknlMstpSrasWlnrDnon", "AmovPknlMstpSlowWpstDnon", "AmovPknlMstpSoptWbinDnon"] select ((["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] find currentWeapon _unit) max 0) +] call FUNC(doAnimation); diff --git a/addons/common/functions/fnc_hashHasKey.sqf b/addons/common/functions/fnc_hashHasKey.sqf index 951c95a2b3..5c6293fc85 100644 --- a/addons/common/functions/fnc_hashHasKey.sqf +++ b/addons/common/functions/fnc_hashHasKey.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_hashListCreateHash.sqf b/addons/common/functions/fnc_hashListCreateHash.sqf index 4000c13056..d6a94445eb 100644 --- a/addons/common/functions/fnc_hashListCreateHash.sqf +++ b/addons/common/functions/fnc_hashListCreateHash.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_hashListCreateList.sqf b/addons/common/functions/fnc_hashListCreateList.sqf index 065bec1de6..3d02b0cb0b 100644 --- a/addons/common/functions/fnc_hashListCreateList.sqf +++ b/addons/common/functions/fnc_hashListCreateList.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_hashListPush.sqf b/addons/common/functions/fnc_hashListPush.sqf index a4d023de87..21651c2ed0 100644 --- a/addons/common/functions/fnc_hashListPush.sqf +++ b/addons/common/functions/fnc_hashListPush.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf index 1ee09f4316..df072d55bd 100644 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ b/addons/common/functions/fnc_hashListSelect.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_hashListSet.sqf b/addons/common/functions/fnc_hashListSet.sqf index 3fbb20e414..5fea048327 100644 --- a/addons/common/functions/fnc_hashListSet.sqf +++ b/addons/common/functions/fnc_hashListSet.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_hashRem.sqf b/addons/common/functions/fnc_hashRem.sqf index 0bf31c0f76..4346a509cf 100644 --- a/addons/common/functions/fnc_hashRem.sqf +++ b/addons/common/functions/fnc_hashRem.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_hashSet.sqf b/addons/common/functions/fnc_hashSet.sqf index 0be700037c..af7a361dd6 100644 --- a/addons/common/functions/fnc_hashSet.sqf +++ b/addons/common/functions/fnc_hashSet.sqf @@ -1,6 +1,5 @@ /* * Author: ? - * * ? * * Arguments: diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index 381b19bc24..f9e8caadec 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -14,4 +14,4 @@ */ #include "script_component.hpp" -!isNull (_this select 0) && {alive (_this select 0)} +!isNull (_this select 0) && {alive (_this select 0)} // return diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index f640eaa012..8a123cfec9 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -1,6 +1,5 @@ /* * Author: Glowbal - * * Check if unit is awake. Will be false when death or unit is unconscious. * * Arguments: @@ -15,4 +14,4 @@ params ["_unit"]; -!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]); +!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]) // return diff --git a/addons/common/functions/fnc_isModLoaded.sqf b/addons/common/functions/fnc_isModLoaded.sqf index 3628777f6c..e5f94b202d 100644 --- a/addons/common/functions/fnc_isModLoaded.sqf +++ b/addons/common/functions/fnc_isModLoaded.sqf @@ -12,4 +12,6 @@ */ #include "script_component.hpp" -isClass (configFile >> "cfgPatches" >> _this select 0) // return +params ["_modName"]; + +isClass (configFile >> "cfgPatches" >> _modName) // return diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf index 13e315924e..30499a2ef2 100644 --- a/addons/common/functions/fnc_map.sqf +++ b/addons/common/functions/fnc_map.sqf @@ -24,4 +24,5 @@ _array = + _array; { _array set [_forEachIndex, _x call _code]; } forEach _array; + _array diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index 59c87f68cc..8a6cb90eca 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi, joko // Jonas - * * Nothing to see here, move along. * * Arguments: diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf index d94e3975db..e352795c5e 100644 --- a/addons/common/functions/fnc_owned.sqf +++ b/addons/common/functions/fnc_owned.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit. * * Arguments: diff --git a/addons/common/functions/fnc_player.sqf b/addons/common/functions/fnc_player.sqf index 5f6f272e5e..1a268515a7 100644 --- a/addons/common/functions/fnc_player.sqf +++ b/addons/common/functions/fnc_player.sqf @@ -1,6 +1,5 @@ /* * Author: bux578, commy2 - * * Returns the player or curator controlled unit. * Use this in INIT and RESPAWN eh scripts, because ACE_player isn't reset yet. * diff --git a/addons/common/functions/fnc_playerSide.sqf b/addons/common/functions/fnc_playerSide.sqf index 1607b5b7fc..3a7ce5bba9 100644 --- a/addons/common/functions/fnc_playerSide.sqf +++ b/addons/common/functions/fnc_playerSide.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Return the current side of the player * * Arguments: diff --git a/addons/common/functions/fnc_positionToASL.sqf b/addons/common/functions/fnc_positionToASL.sqf index d933e67125..267bbf2353 100644 --- a/addons/common/functions/fnc_positionToASL.sqf +++ b/addons/common/functions/fnc_positionToASL.sqf @@ -10,7 +10,7 @@ * Return Value: * None * - * Public: No + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index 25158779e7..f7cb361c1b 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Reads a setting value from a module, set it and force it. Logs if the setting is missing from the module. * Must be called on the server, effect is global. * diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index 5f8ca43467..6c3fa8354b 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Remove a condition that gets checked by ace_common_fnc_canInteractWith. * * Arguments: diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf index 1937c615a4..491ce89bb4 100644 --- a/addons/common/functions/fnc_restoreVariablesJIP.sqf +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP). * * Arguments: diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf index f502da43dd..fff3288db6 100644 --- a/addons/common/functions/fnc_sanitizeString.sqf +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Source string - * 1: Remove html tags (optional) + * 1: Remove html tags (default: false) * * Return Value: * Sanitized string @@ -15,28 +15,37 @@ params ["_string", ["_removeTags", false]]; -private ["_array", "_arrayNew"]; +private "_array"; +_array = []; -_array = toArray _string; - -_arrayNew = []; { switch _x do { case 60 : { - _arrayNew = if (_removeTags) then {_arrayNew + toArray "<";} else {_arrayNew + [_x];}; + if (_removeTags) then { + _array append toArray "<"; + } else { + _array pushBack _x; + }; }; case 62 : { - _arrayNew = if (_removeTags) then {_arrayNew + toArray ">";} else {_arrayNew + [_x];}; + if (_removeTags) then { + _array append toArray ">"; + } else { + _array pushBack _x; + }; }; + case 34 : { }; + case 39 : { }; + default { - _arrayNew = _arrayNew + [_x]; + _array pushBack _x; }; }; false -} count _array; +} count toArray _string; -toString _arrayNew +toString _array // return From 0a01bbdc762da9e2f45c127a3cf9b8e845fe22e0 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 16:56:35 +0200 Subject: [PATCH 122/311] more common code cleanup --- addons/common/functions/fnc_filter.sqf | 26 +++++++++---------- addons/common/functions/fnc_fixCollision.sqf | 7 ++--- .../common/functions/fnc_fixCrateContent.sqf | 17 +++++++++--- addons/common/functions/fnc_fixFloating.sqf | 6 ++--- .../fnc_fixLoweredRifleAnimation.sqf | 4 +-- addons/common/functions/fnc_fixPosition.sqf | 8 +++--- addons/common/functions/fnc_isAlive.sqf | 8 +++--- addons/common/functions/fnc_map.sqf | 2 +- 8 files changed, 46 insertions(+), 32 deletions(-) diff --git a/addons/common/functions/fnc_filter.sqf b/addons/common/functions/fnc_filter.sqf index 3d84d9d3a2..0b30e59cf9 100644 --- a/addons/common/functions/fnc_filter.sqf +++ b/addons/common/functions/fnc_filter.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi, commy2 - * * Filters array and removes every element not fitting the condition * * Arguments: @@ -12,22 +11,21 @@ * * Usage: * [[0,1,2,3,4], {_this > 2}] call FUNC(filter) ==> [3,4] + * + * Public: Yes */ #include "script_component.hpp" -private ["_newArray", "_index"]; +params ["_array", "_code"]; -PARAMS_2(_array,_code); +private "_result"; +_result = []; -if (isNil "_array") exitWith { - ACE_LOGERROR_1("No array for function filter in %1.",_fnc_scriptNameParent); - [] -}; - -_newArray = []; -for "_index" from 0 to (count _array - 1) do { - if ((_array select _index) call _code) then { - _newArray pushBack (_array select _index); +{ + if (_x call _code) then { + _result pushBack _x; }; -}; -_newArray + false +} count _array; + +_result diff --git a/addons/common/functions/fnc_fixCollision.sqf b/addons/common/functions/fnc_fixCollision.sqf index 6b43cec469..1d55eb1454 100644 --- a/addons/common/functions/fnc_fixCollision.sqf +++ b/addons/common/functions/fnc_fixCollision.sqf @@ -1,13 +1,14 @@ /* * Author: commy2 - * Attempt to fix physx collisions causing unreasonable impact forces and damage. + * Attempt to fix PhysX collisions causing unreasonable impact forces and damage. * * Arguments: - * 0: Object + * Object * * Return Value: - * Nothing + * None * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_fixCrateContent.sqf b/addons/common/functions/fnc_fixCrateContent.sqf index ad3ed8e528..a067c29c63 100644 --- a/addons/common/functions/fnc_fixCrateContent.sqf +++ b/addons/common/functions/fnc_fixCrateContent.sqf @@ -1,9 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * Fixes zeus placed crates containing buged mine detectors and ace items. + * + * Arguments: + * 0: Crate + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_weapons", "_items"]; +params ["_crate"]; -PARAMS_1(_crate); +private ["_weapons", "_items"]; // get all weapons inside the crate _weapons = weaponCargo _crate; diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf index 6f08af1482..5fe94dcef7 100644 --- a/addons/common/functions/fnc_fixFloating.sqf +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -3,16 +3,16 @@ * Attempt to fix floating physx with disabled damage after setPosXXX commands. * * Arguments: - * Physx object (Object) + * PhysX object * * Return Value: - * Nothing + * None * + * Public: No */ #include "script_component.hpp" private "_object"; - _object = _this; // setHitPointDamage requires local object diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf index f39f85cc94..9e230b00ad 100644 --- a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -15,8 +15,8 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {(vehicle _unit) == _unit}) then { +if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {vehicle _unit == _unit}) then { [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); }; diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf index 32cde87e52..54d0cdfbf6 100644 --- a/addons/common/functions/fnc_fixPosition.sqf +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -4,10 +4,12 @@ * Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object. * * Argument: - * Object (Object) + * Object * - * Return value: - * NONE + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index f9e8caadec..343466c00d 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -3,10 +3,10 @@ * Check if the object still exists and is alive. This function exists because 'alive objNull' actually returns true. * * Argument: - * 0: Any object (Object) + * 0: Any object * * Return value: - * The object exists and is alive (Bool). + * The object exists and is alive . * * Public: Yes * @@ -14,4 +14,6 @@ */ #include "script_component.hpp" -!isNull (_this select 0) && {alive (_this select 0)} // return +params ["_unit"]; + +!isNull _unit && {alive _unit} // return diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf index 30499a2ef2..a727de08bf 100644 --- a/addons/common/functions/fnc_map.sqf +++ b/addons/common/functions/fnc_map.sqf @@ -12,7 +12,7 @@ * Usage: * [["2", "gobblecock", "25"], {parseNumber _this}] call FUNC(map) ==> [2, 0, 25] * - * Public: No + * Public: Yes */ #include "script_component.hpp" From 789f3843d5a7b22bffce2ab65ef94b177d524da3 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 10:05:34 -0500 Subject: [PATCH 123/311] #2488 - Fix cargo setVariable on server with InitPost --- addons/cargo/CfgEventHandlers.hpp | 16 ++-------------- addons/cargo/functions/fnc_addCargoItem.sqf | 4 +++- addons/cargo/functions/fnc_initVehicle.sqf | 6 +++++- addons/cargo/functions/fnc_loadItem.sqf | 8 +++++++- addons/cargo/script_component.hpp | 2 ++ addons/repair/CfgEventHandlers.hpp | 7 ++----- addons/repair/script_component.hpp | 2 ++ 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 15aaaadad6..689ba5f19e 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -16,85 +16,73 @@ class Extended_Killed_EventHandlers { }; }; -class Extended_Init_EventHandlers { +//Need initPost or we have problems with setVariable with 'ACE_Cargo' +class Extended_InitPost_EventHandlers { class StaticWeapon { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class ReammoBox_F { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class Cargo_base_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class CargoNet_01_box_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class Land_CargoBox_V1_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class Land_PaperBox_closed_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class Car { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Tank { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Helicopter { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Plane { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Ship_F { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class ACE_RepairItem_Base { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class ACE_bodyBagObject { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class ACE_ConcertinaWireCoil { class ADDON { init = QUOTE(_this call DFUNC(initObject)); diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 1233d0228d..17264ec15a 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -30,9 +30,11 @@ for "_i" from 1 to _amount do { // Load item or delete it if no space left if !([_item, _vehicle] call FUNC(loadItem)) exitWith { + TRACE_1("no room to load item - deleting",_item); deleteVehicle _item; }; - + TRACE_1("Item Loaded",_item); + // Invoke listenable event ["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); }; diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index efb3b9a5cf..d436e0d416 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -25,7 +25,11 @@ _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); if (isServer) then { { if (isClass _x) then { - ["AddCargoByClass", [getText (_x >> "type"), _vehicle, getNumber (_x >> "amount")]] call EFUNC(common,localEvent); + private ["_cargoClassname", "_cargoCount"]; + _cargoClassname = getText (_x >> "type"); + _cargoCount = getNumber (_x >> "amount"); + TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount); + ["AddCargoByClass", [_cargoClassname, _vehicle, _cargoCount]] call EFUNC(common,localEvent); }; } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); }; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index cf81bdbe6c..ebe4260bc6 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -19,13 +19,19 @@ private ["_loaded", "_space", "_itemSize"]; params ["_item", "_vehicle"]; +TRACE_2("params",_item,_vehicle); -if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false}; +if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith { + TRACE_2("canLoadItemIn failed",_item,_vehicle); + false +}; _loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded pushback _item; _vehicle setVariable [QGVAR(loaded), _loaded, true]; +TRACE_1("added to loaded array",_loaded); + _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), _space - _itemSize, true]; diff --git a/addons/cargo/script_component.hpp b/addons/cargo/script_component.hpp index 9716d7a536..3f4d6c5d51 100644 --- a/addons/cargo/script_component.hpp +++ b/addons/cargo/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT cargo #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_CARGO #define DEBUG_MODE_FULL #endif diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 03b3b5b494..798a10316a 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -10,35 +10,32 @@ class Extended_PostInit_EventHandlers { }; }; -class Extended_Init_EventHandlers { +//Need initPost or we have problems with setVariable with addSpareParts +class Extended_InitPost_EventHandlers { class Car { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Tank { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Helicopter { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Plane { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Ship_F { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); diff --git a/addons/repair/script_component.hpp b/addons/repair/script_component.hpp index 89983dd0e8..aa60544ad2 100644 --- a/addons/repair/script_component.hpp +++ b/addons/repair/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT repair #include "\z\ace\addons\main\script_mod.hpp" +#define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_REPAIR #define DEBUG_MODE_FULL #endif From 9c61f256bcfec8b78d971939044b8993e05f9575 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 10:06:24 -0500 Subject: [PATCH 124/311] Rem debug --- addons/repair/script_component.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/repair/script_component.hpp b/addons/repair/script_component.hpp index aa60544ad2..a6aa1db61f 100644 --- a/addons/repair/script_component.hpp +++ b/addons/repair/script_component.hpp @@ -1,7 +1,7 @@ #define COMPONENT repair #include "\z\ace\addons\main\script_mod.hpp" -#define DEBUG_MODE_FULL +// #define DEBUG_MODE_FULL #ifdef DEBUG_ENABLED_REPAIR #define DEBUG_MODE_FULL From aabc43731445b48ce20ed02f8d516747fbdfd854 Mon Sep 17 00:00:00 2001 From: Alessandro Foresi Date: Sun, 20 Sep 2015 17:37:33 +0200 Subject: [PATCH 125/311] Remove: pain diagnosis on dead patients --- addons/medical/functions/fnc_actionDiagnose.sqf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index 5cc0d307da..072b9b1a7e 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -35,10 +35,12 @@ if (_target getvariable[QGVAR(hasLostBlood), 0] > 0) then { _genericMessages pushback LSTRING(noBloodloss); }; -if (_target getvariable[QGVAR(hasPain), false]) then { - _genericMessages pushback LSTRING(inPain); -} else { - _genericMessages pushback LSTRING(noPain); +if (alive _target) then { + if (_target getvariable[QGVAR(hasPain), false]) then { + _genericMessages pushback LSTRING(inPain); + } else { + _genericMessages pushback LSTRING(noPain); + }; }; ["displayTextStructured", [_caller], [_genericMessages, 3.0, _caller]] call EFUNC(common,targetEvent); From 610fb0bb2c49c145db75dd5ca3cd8a370a5aa605 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 11:28:43 -0500 Subject: [PATCH 126/311] Fix Merge --- .../common/functions/fnc_resetAllDefaults.sqf | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index be2eec050a..c2ba1bee18 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -1,39 +1,44 @@ -/** - * fn_resetAllDefaults_f.sqf - * @Descr: reset all variables that have been defined - * @Author: Glowbal +/* + * Author: Glowbal + * reset all variables that have been defined * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * ? + * + * Return Value: + * ? + * + * Public: No */ - #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -_unit setvariable ["ACE_isDead",nil,true]; +_unit setvariable ["ACE_isDead", nil, true]; _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { [true] call FUNC(setVolume); // [false] call FUNC(disableKeyInput); //func does not exist + if (["ace_medical"] call FUNC(isModLoaded)) then { // [false] call EFUNC(medical,effectBlackOut); //func does not exist }; - if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { + if !(isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { // clear all disable user input { [_x, false] call FUNC(setDisableUserInputStatus); - }foreach GVAR(DISABLE_USER_INPUT_COLLECTION); + false + } count GVAR(DISABLE_USER_INPUT_COLLECTION); }; }; { - if (!(_x select 4)) then { - _unit setvariable [(_x select 0),nil,_x select 3]; + if !(_x select 4) then { + _unit setvariable [_x select 0, nil, _x select 3]; }; -} forEach ([_unit] call FUNC(getAllDefinedSetVariables)); + false +} count ([_unit] call FUNC(getAllDefinedSetVariables)); _unit setVariable ["ACE_forceWalkStatusNumber", 0, true]; From 0c8a694b96b0ddb8a3efc99b9001c1e5afb1048c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 12:07:44 -0500 Subject: [PATCH 127/311] Medical_menu settings under medical category --- addons/medical_menu/ACE_Settings.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/medical_menu/ACE_Settings.hpp b/addons/medical_menu/ACE_Settings.hpp index 1f2b9cc3ea..42bd80044f 100644 --- a/addons/medical_menu/ACE_Settings.hpp +++ b/addons/medical_menu/ACE_Settings.hpp @@ -1,4 +1,3 @@ - class ACE_Settings { class GVAR(allow) { displayName = CSTRING(allow); @@ -6,6 +5,7 @@ class ACE_Settings { value = 1; typeName = "SCALAR"; values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; + category = ECSTRING(medical,Category_Medical); }; class GVAR(useMenu) { displayName = CSTRING(useMenu); @@ -14,6 +14,7 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; isClientSettable = 1; + category = ECSTRING(medical,Category_Medical); }; class GVAR(openAfterTreatment) { displayName = CSTRING(openAfterTreatment); @@ -21,5 +22,6 @@ class ACE_Settings { typeName = "BOOL"; value = 1; isClientSettable = 1; + category = ECSTRING(medical,Category_Medical); }; }; From 86fae2c2512b88f8a8f20d187d4b7fb04f9bbdbf Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 13:19:51 -0500 Subject: [PATCH 128/311] #2528 - addToLog date / missing string fullHeal --- addons/medical/functions/fnc_addToLog.sqf | 2 +- addons/medical/stringtable.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index 3b071948f3..0e341792c9 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -23,7 +23,7 @@ if (!local _unit) exitwith { [_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; -date params ["", "", "", "_minute", "_hour"]; +date params ["", "", "", "_hour", "_minute"]; _moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute]; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index ba34cffae2..3691a87711 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -2105,6 +2105,9 @@ %1 wykonał cykl RKO %1 провел сердечно-легочную реанимацию + + %1 used Personal Aid Kit + Heavily wounded Schwer verwundet: From 2348c25e1a6c994010c7035eda82f814e4b1189e Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 20:25:25 +0200 Subject: [PATCH 129/311] more common code cleanup --- addons/common/functions/fnc_displayIcon.sqf | 108 ++++++++++-------- addons/common/functions/fnc_displayText.sqf | 37 +++--- .../functions/fnc_endRadioTransmission.sqf | 5 +- addons/common/functions/fnc_eraseCache.sqf | 2 +- addons/common/functions/fnc_errorMessage.sqf | 6 +- addons/common/functions/fnc_execNextFrame.sqf | 15 +-- .../functions/fnc_execPersistentFnc.sqf | 30 ++--- addons/common/functions/fnc_execRemoteFnc.sqf | 40 +++---- .../functions/fnc_executePersistent.sqf | 17 ++- addons/common/functions/fnc_exportConfig.sqf | 24 ++-- .../common/functions/fnc_uniqueElements.sqf | 12 +- 11 files changed, 152 insertions(+), 144 deletions(-) diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 2fd5245465..8421f5be7e 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -1,24 +1,23 @@ /* -* Author: Glowbal -* -* Draw progress bar and execute given function if succesful. -* Finish/Failure/Conditional are all passed [args, elapsedTime, totalTime, errorCode] -* -* Argument: -* 0: icon ID -* 1: show -* 2: Icon Path -* 3: Icon color -* 4: timeAlive. -1 = forever -* -* Return value: -* Nothing -* -* Example: -* ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon; -*/ - - + * Author: Glowbal + * Draw progress bar and execute given function if succesful. + * Finish/Failure/Conditional are all passed [args, elapsedTime, totalTime, errorCode] + * + * Arguments: + * 0: icon ID + * 1: show + * 2: Icon Path + * 3: Icon color + * 4: timeAlive. -1 = forever (default: 6) + * + * Return Value: + * None + * + * Example: + * ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon; + * + * Public: Yes + */ #include "script_component.hpp" // positions for the icon UI @@ -42,31 +41,37 @@ // other constants #define DEFAULT_TIME 6 -private ["_allControls", "_refresh", "_timeAlive", "_list"]; - -PARAMS_4(_iconId,_show,_icon,_color); - -_timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME}; - disableSerialization; -_list = missionNamespace getvariable [QGVAR(displayIconList),[]]; + +params ["_iconId", "_show", "_icon", "_color", ["_timeAlive", DEFAULT_TIME]]; + +private ["_list", "_refresh"]; + +_list = missionNamespace getVariable [QGVAR(displayIconList), []]; _refresh = { - private ["_allControls"]; // Refreshing of all icons.. - _allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []]; + private "_allControls"; + _allControls = missionNamespace getVariable [QGVAR(displayIconListControls), []]; + { ctrlDelete _x; - }foreach _allControls; + false + } count _allControls; _allControls = []; - private ["_ctrl", "_setting", "_position"]; - _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; + private ["_setting", "_ctrl", "_position"]; + + _setting = missionNamespace getVariable [QGVAR(settingFeedbackIcons), 0]; + if (_setting > 0) then { { + _x params ["", "_xicon", "_xcolor"]; + // +19000 because we want to make certain we are using free IDCs.. - _ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]); + _ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000]; + _position = switch (_setting) do { case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; @@ -74,46 +79,53 @@ _refresh = { case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; }; + _ctrl ctrlSetPosition _position; - _ctrl ctrlsetText (_x select 1); - _ctrl ctrlSetTextColor (_x select 2); + _ctrl ctrlSetText _xicon; + _ctrl ctrlSetTextColor _xcolor; _ctrl ctrlCommit 0; - _allControls pushback _ctrl; - }foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]); + _allControls pushBack _ctrl; + false + } forEach (missionNamespace getVariable [QGVAR(displayIconList),[]]); }; - missionNamespace setvariable [QGVAR(displayIconListControls), _allControls]; + + missionNamespace setVariable [QGVAR(displayIconListControls), _allControls]; }; if (_show) then { - if ({(_x select 0 == _iconId)} count _list == 0) then { - _list pushback [_iconId, _icon, _color, ACE_time]; + if ({_x select 0 == _iconId} count _list == 0) then { + _list pushBack [_iconId, _icon, _color, ACE_time]; } else { { if (_x select 0 == _iconId) exitwith { - _list set [_foreachIndex, [_iconId, _icon, _color, ACE_time]]; + _list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]]; }; } forEach _list; }; - missionNamespace setvariable [QGVAR(displayIconList), _list]; + + missionNamespace setVariable [QGVAR(displayIconList), _list]; call _refresh; if (_timeAlive >= 0) then { [{ - [_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon); - }, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute); + [_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon); + }, [_iconId], _timeAlive, _timeAlive] call FUNC(waitAndExecute); }; } else { - if ({(_x select 0 == _iconId)} count _list == 1) then { + + if ({_x select 0 == _iconId} count _list == 1) then { private "_newList"; _newList = []; + { if (_x select 0 != _iconId) then { - _newList pushback _x; + _newList pushBack _x; }; - } forEach _list; + false + } count _list; - missionNamespace setvariable [QGVAR(displayIconList), _newList]; + missionNamespace setVariable [QGVAR(displayIconList), _newList]; call _refresh; }; }; diff --git a/addons/common/functions/fnc_displayText.sqf b/addons/common/functions/fnc_displayText.sqf index 22349962ac..fce8fdd832 100644 --- a/addons/common/functions/fnc_displayText.sqf +++ b/addons/common/functions/fnc_displayText.sqf @@ -1,42 +1,35 @@ /* * Author: commy2 - * * Display a message. * - * Argument: - * 0: Message (String) - * 1: Play a clicking sound (Bool, optional default: false) - * 2: How long before hiding the message in seconds (Number, optional default: 2 sec) - * 3: Priority, higher priority messages will override lesser important ones (Number, optional default: 0) + * Arguments: + * 0: Message + * 1: Play a clicking sound (default: false) + * 2: How long before hiding the message in seconds (default: 2) + * 3: Priority, higher priority messages will override lesser important ones (default: 0) * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -#define DEFAULT_PLAY_SOUND false -#define DEFAULT_DELAY 2 -#define DEFAULT_PRIORITY 0 - -_this resize 4; - -private ["_lastHintTime", "_lastHintPriority", "_time"]; - -PARAMS_4(_text,_sound,_delay,_priority); +params ["_text", ["_sound", false], ["_delay", 2], ["_priority", 0]]; if (isNil QGVAR(lastHint)) then { GVAR(lastHint) = [0, 0]; }; +if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; + +private ["_lastHintTime", "_lastHintPriority", "_time"]; + _lastHintTime = GVAR(lastHint) select 0; _lastHintPriority = GVAR(lastHint) select 1; -if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; -if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND}; -if (isNil "_delay") then {_delay = DEFAULT_DELAY}; -if (isNil "_priority") then {_priority = DEFAULT_PRIORITY}; - _time = ACE_time; + if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { hintSilent _text; if (_sound) then {playSound "ACE_Sound_Click"}; diff --git a/addons/common/functions/fnc_endRadioTransmission.sqf b/addons/common/functions/fnc_endRadioTransmission.sqf index 78a50e9f2c..4597426d67 100644 --- a/addons/common/functions/fnc_endRadioTransmission.sqf +++ b/addons/common/functions/fnc_endRadioTransmission.sqf @@ -4,11 +4,12 @@ * End radio transmissions of addons TFAR and ACRE2. TFAR v0.9.7, ACRE Public Beta 2.0.3.571 * * Arguments: - * None. + * None * * Return Value: - * None. + * None * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_eraseCache.sqf b/addons/common/functions/fnc_eraseCache.sqf index 9521bb3630..ae988ced28 100644 --- a/addons/common/functions/fnc_eraseCache.sqf +++ b/addons/common/functions/fnc_eraseCache.sqf @@ -13,6 +13,6 @@ */ #include "script_component.hpp" -PARAMS_2(_namespace,_uid); +params ["_namespace", "_uid"]; _namespace setVariable [_uid, nil]; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index 3929477e76..f06aa2d30d 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -29,11 +29,7 @@ if (isNull (call BIS_fnc_displayMission)) exitWith { }, 1, _this] call CBA_fnc_addPerFrameHandler; }; -private ["_onOK", "_onCancel"]; - -PARAMS_2(_textHeader,_textMessage); -_onOK = ARR_SELECT(_this,2,{}); -_onCancel = ARR_SELECT(_this,3,{}); +params ["_textHeader", "_textMessage", ["_onOK", {}], ["_onCancel", {}]]; if (typeName _textMessage == "STRING") then { _textMessage = parseText _textMessage; diff --git a/addons/common/functions/fnc_execNextFrame.sqf b/addons/common/functions/fnc_execNextFrame.sqf index ddd36be073..7b3f034c6d 100644 --- a/addons/common/functions/fnc_execNextFrame.sqf +++ b/addons/common/functions/fnc_execNextFrame.sqf @@ -1,18 +1,19 @@ /* * Author: esteldunedain - * * Executes a code on the next frame * - * Argument: - * 0: Code to execute (Code) - * 1: Parameters to run the code with (Array) + * Arguments: + * 0: Code to execute + * 1: Parameters to run the code with * - * Return value: - * PFH handler ID + * Return Value: + * PFH handler ID + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_func,_params); +params ["_func", "_params"]; if (diag_frameno != GVAR(nextFrameNo)) then { GVAR(nextFrameBufferA) pushBack [_params, _func]; diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf index dd160b8bfd..dc88a7c3c9 100644 --- a/addons/common/functions/fnc_execPersistentFnc.sqf +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -1,29 +1,29 @@ /* * Author: commy2 - * * Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1). * - * Argument: - * 0: Function arguments (Array) - * 1: Function to execute, has to be defined on the remote machine first (String) - * 2: Namespace to save that variable in (Object or Namespace) - * 3: Name. Will overwrite previously defined functions with that name (String) + * Arguments: + * 0: Function arguments + * 1: Function to execute, has to be defined on the remote machine first + * 2: Namespace to save that variable in + * 3: Name. Will overwrite previously defined functions with that name * - * Return value: - * Nothing. + * Return Value: + * None + * + * Public: No + * + * Deprecated */ #include "script_component.hpp" -private ["_arguments", "_function", "_unit", "_name"]; - GVAR(remoteFnc) = _this; -_arguments = _this select 0; -_function = call compile (_this select 1); -_unit = _this select 2; -_name = _this select 3; +params ["_arguments", "_function", "_unit", "_name"]; -["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); +_function = call compile _function; + +//["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); // execute function on every currently connected machine [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf index 1df17050e6..6b617bf92f 100644 --- a/addons/common/functions/fnc_execRemoteFnc.sqf +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -1,35 +1,32 @@ /* * Author: commy2 - * * Execute a function on a remote machine in mp. * - * Argument: - * 0: Function arguments (Array) - * 1: Function to execute, has to be defined on the remote machine first (String) - * 2: The function will be executed where this unit is local OR the mode were this function should be executed. (Object OR Number, optional default: 2) - * Mode 0: execute on this machine only - * Mode 1: execute on server - * Mode 2: execute on all clients + server - * Mode 3: execute on dedicated only + * Arguments: + * 0: Function arguments + * 1: Function to execute, has to be defined on the remote machine first + * 2: The function will be executed where this unit is local OR the mode were this function should be executed. (default: 2) + * 0 = execute on this machine only + * 1 = execute on server + * 2 = execute on all clients + server + * 3 = execute on dedicated only * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: No + * + * Deprecated */ #include "script_component.hpp" -private ["_arguments", "_function", "_unit", "_id"]; - GVAR(remoteFnc) = _this; -_arguments = _this select 0; -_function = call compile (_this select 1); -_unit = _this select 2; +params ["_arguments", "_function", ["_unit", 2]]; -if (isNil "_unit") then { - _unit = 2; -}; +_function = call compile _function; -["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); +//["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); if (typeName _unit == "SCALAR") exitWith { switch (_unit) do { @@ -63,8 +60,7 @@ if (local _unit) then { _arguments call _function; } else { if (isServer) then { - _id = owner _unit; - _id publicVariableClient QGVAR(remoteFnc); + (owner _unit) publicVariableClient QGVAR(remoteFnc); } else { publicVariableServer QGVAR(remoteFnc); }; diff --git a/addons/common/functions/fnc_executePersistent.sqf b/addons/common/functions/fnc_executePersistent.sqf index bbc4e91ea7..3763d1bb58 100644 --- a/addons/common/functions/fnc_executePersistent.sqf +++ b/addons/common/functions/fnc_executePersistent.sqf @@ -1,11 +1,22 @@ -// by commy2 +/* + * Author: commy2 + * Execute all Persistent Functions + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_target); +params ["_target"]; { if (isNil "_x") then { - ACE_LOGERROR_1("No argument and function for remote function. ID: %1",_forEachIndex); + ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex); } else { if (typeName _x == "ARRAY") then { [_x select 0, _target] call (_x select 1); diff --git a/addons/common/functions/fnc_exportConfig.sqf b/addons/common/functions/fnc_exportConfig.sqf index e8370c8f0f..9b28786e43 100644 --- a/addons/common/functions/fnc_exportConfig.sqf +++ b/addons/common/functions/fnc_exportConfig.sqf @@ -1,17 +1,25 @@ -// by commy2 /* - usage: - - (configFile >> "CfgAmmo") call FUNC(exportConfig); -*/ + * Author: commy2 + * Export Config Entrys to RPT logs + * + * Arguments: + * Config Path + * + * Return Value: + * None + * + * Example: + * [configFile >> "CfgAmmo"] call ace_common_fnc_exportConfig; + * + * Public: No + */ #include "script_component.hpp" private "_fnc_logEntries"; - _fnc_logEntries = { - private ["_p", "_t", "_e", "_a", "_i"]; + params ["_c", "_d"]; - PARAMS_2(_c,_d); + private ["_p", "_t", "_e", "_a", "_i"]; _p = inheritsFrom _c; diff --git a/addons/common/functions/fnc_uniqueElements.sqf b/addons/common/functions/fnc_uniqueElements.sqf index 812bf59dba..55d8c4ef5f 100644 --- a/addons/common/functions/fnc_uniqueElements.sqf +++ b/addons/common/functions/fnc_uniqueElements.sqf @@ -14,14 +14,4 @@ params ["_array"]; -private "_result"; -_result = []; - -{ - if !(_x in _result) then { - _result pushBack _x; - }; - false -} count _array; - -_result +_array arrayIntersect _array // return From 493ce1b09211ea7aacfbbb783f9ff3eea9420872 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 22:16:51 +0200 Subject: [PATCH 130/311] more common code cleanup --- .../common/functions/fnc_disableUserInput.sqf | 28 ++++----- .../functions/fnc_displayTextPicture.sqf | 29 +++++----- .../functions/fnc_displayTextStructured.sqf | 25 ++++---- addons/common/functions/fnc_doAnimation.sqf | 45 +++++---------- addons/common/functions/fnc_dropBackpack.sqf | 22 +++---- addons/common/functions/fnc_dumpArray.sqf | 26 +++++++-- .../functions/fnc_dumpPerformanceCounters.sqf | 57 ++++++++++++------- 7 files changed, 123 insertions(+), 109 deletions(-) diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index d9485b11e7..ffa6d8e28f 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -5,23 +5,20 @@ * Arguments: * 0: True to disable key inputs, false to re-enable them * - * Return value: - * Nothing + * Return Value: + * None * - * Public: Yes + * Public: No */ - #include "script_component.hpp" -private ["_dlg"]; - -PARAMS_1(_state); +params ["_state"]; if (_state) then { disableSerialization; if (!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])) exitWith {}; - if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) exitWith {}; + if (!isNil QGVAR(disableInputPFH)) exitWith {}; // end TFAR and ACRE2 radio transmissions call FUNC(endRadioTransmission); @@ -34,19 +31,22 @@ if (_state) then { closeDialog 0; createDialog QGVAR(DisableMouse_Dialog); + private "_dlg"; _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); _dlg displayAddEventHandler ["KeyDown", { - private ["_key", "_dlg", "_ctrl", "_config", "_acc", "_index"]; - _key = _this select 1; + params ["", "_key"]; if (_key == 1 && {alive player}) then { createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); disableSerialization; + + private ["_dlg", "_ctrl"]; + _dlg = finddisplay 49; _dlg displayAddEventHandler ["KeyDown", { - _key = _this select 1; + params ["", "_key"]; !(_key == 1) }]; @@ -62,19 +62,21 @@ if (_state) then { _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)]; - _ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); + _ctrl ctrlEnable (call {private "_config"; _config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); _ctrl ctrlSetText "RESPAWN"; _ctrl ctrlSetTooltip "Respawn."; }; if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then { (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; + + private "_acc"; _acc = accTime; teamSwitch; setAccTime _acc; }; - if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then { + if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then { (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openCuratorInterface; }; diff --git a/addons/common/functions/fnc_displayTextPicture.sqf b/addons/common/functions/fnc_displayTextPicture.sqf index 93d4d38df7..3bdf908d16 100644 --- a/addons/common/functions/fnc_displayTextPicture.sqf +++ b/addons/common/functions/fnc_displayTextPicture.sqf @@ -1,25 +1,21 @@ /* * Author: commy2, Glowbal - * * Display a structured text with image. * - * Argument: + * Arguments: * 0: Text * 1: Image - * 2: Image color - * 3: Target Unit. Will only display if target is the player controlled object + * 2: Image color (default: [0, 0, 0, 0]) + * 3: Target Unit. Will only display if target is the player controlled object (default: ACE_player) * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_imageColor", "_target"]; -PARAMS_2(_text,_image); -_imageColor = if (count _this > 2) then {_this select 2} else {[1,1,1]}; -_imageColor resize 3; -_target = if (count _this > 3) then {_this select 3} else {ACE_player}; +params ["_text", "_image", ["_imageColor", [1,1,1]], ["_target", ACE_player]]; if (_target != ACE_player) exitWith {}; @@ -28,16 +24,21 @@ if (typeName _text != "TEXT") then { if (count _text > 0) then { { if (typeName _x == "STRING" && {isLocalized _x}) then { - _text set [_foreachIndex, localize _x]; + _text set [_forEachIndex, localize _x]; }; - }foreach _text; + } forEach _text; + _text = format _text; }; }; + if (typeName _text == "STRING" && {isLocalized _text}) then { _text = localize _text; }; + _text = parseText format ["%1", _text]; }; + _text = composeText [parseText format ["", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text]; + [_text, 2] call FUNC(displayTextStructured); diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf index cfe2feb3cb..255a014b6f 100644 --- a/addons/common/functions/fnc_displayTextStructured.sqf +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -1,23 +1,20 @@ /* * Author: commy2, Glowbal - * * Display a structured text. * - * Argument: + * Arguments: * 0: Text - * 1: Size of the textbox - * 2: Target Unit. Will only display if target is the player controlled object + * 1: Size of the textbox (default: 1.5) + * 2: Target Unit. Will only display if target is the player controlled object (default: ACE_player) * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ - #include "script_component.hpp" -private ["_text", "_size", "_isShown", "_ctrlHint", "_yPos", "_xPos", "_wPos", "_hPos", "_position", "_target"]; -_text = _this select 0; -_size = if (count _this > 1) then {_this select 1} else {1.5;}; -_target = if (count _this > 2) then {_this select 2} else {ACE_player}; +params ["_text", ["_size", 1.5], ["_target", ACE_player]]; if (_target != ACE_player) exitWith {}; @@ -38,6 +35,8 @@ if (typeName _text != "TEXT") then { _text = composeText [lineBreak, parseText format ["%1", _text]]; }; +private ["_isShown", "_ctrlHint", "_xPos", "_yPos", "_wPos", "_hPos", "_position"]; + _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]); ("ACE_RscHint" call BIS_fnc_rscLayer) cutRsc ["ACE_RscHint", "PLAIN", 0, true]; @@ -60,8 +59,8 @@ _yPos = safeZoneY + 0.175 * safezoneH; _wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40)); _hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); -//Zeus Interface Open and Display would be under the "CREATE" list -if (!isnull curatorCamera) then { +// Zeus Interface Open and Display would be under the "CREATE" list +if (!isNull curatorCamera) then { _xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos); }; diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 5b7a1ed1bf..42d59f0b72 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -3,35 +3,22 @@ * * Execute an animation. This is used to not break things like the unconsciousness animation. * - * Argument: - * 0: Unit (Object) - * 1: Animation (String) - * 2: Priority of the animation. (Number, optional default: 0) - * 0: PlayMove - * 1: PlayMoveNow - * 2: SwitchMove (no transitional animation, doesn't overwrite priority 1) + * Arguments: + * 0: Unit + * 1: Animation + * 2: Priority of the animation. (default: 0) + * 0 = PlayMove + * 1 = PlayMoveNow + * 2 = SwitchMove (no transitional animation, doesn't overwrite priority 1) * - * Return value: - * Nothing + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_force"]; - -PARAMS_3(_unit,_animation,_priority); -_force = False; - -// no animation given -if (isNil "_animation") exitWith { - ACE_LOGERROR_1("No animation specified in %1.",_fnc_scriptNameParent); -}; - -if (isNil "_priority") then { - _priority = 0; -}; -if (count _this > 3) then { - _force = _this select 3; -}; +params ["_unit", "_animation", ["_priority", 0], ["_force", false]]; // don't overwrite more important animations if (_unit getVariable ["ACE_isUnconscious", false] && {(_animation != "Unconscious")} && {!_force}) exitWith {}; @@ -47,7 +34,7 @@ if (_animation == "") then { //if (_animation == animationState _unit) exitWith {}; switch (_priority) do { - case 0 : { + case 0: { if (_unit == vehicle _unit) then { [_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc); } else { @@ -55,7 +42,7 @@ switch (_priority) do { [_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc); }; }; - case 1 : { + case 1: { if (_unit == vehicle _unit) then { [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); } else { @@ -63,7 +50,7 @@ switch (_priority) do { [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); }; }; - case 2 : { + case 2: { // try playMoveNow first if (_unit == vehicle _unit) then { [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); @@ -80,5 +67,3 @@ switch (_priority) do { }; default {}; }; - -["Anim", [_priority, _animation]] call FUNC(log); diff --git a/addons/common/functions/fnc_dropBackpack.sqf b/addons/common/functions/fnc_dropBackpack.sqf index 05ee3ab750..fc2b0bba64 100644 --- a/addons/common/functions/fnc_dropBackpack.sqf +++ b/addons/common/functions/fnc_dropBackpack.sqf @@ -1,30 +1,24 @@ /* * Author: commy2 - * * Drops a backback. Also returns the ground wepaon holder object of the dropped backpack. * - * Argument: - * 0: Unit that has a backpack (Object) + * Arguments: + * 0: Unit that has a backpack * * Return value: - * Ground wepaon holder with backpack (Object) + * Ground wepaon holder with backpack * + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -private ["_backpackObject","_holder"]; +private ["_backpackObject", "_holder"]; _backpackObject = backpackContainer _unit; + _unit addBackpack "Bag_Base"; removeBackpack _unit; -_holder = objNull; -{ - if (_backpackObject in everyBackpack _x) exitWith { - _holder = _x; - }; -} forEach (position _unit nearObjects ["WeaponHolder", 5]); - -_holder +objectParent _backpackObject // return diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 8572aaf134..e07da9f695 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -1,10 +1,21 @@ -//fnc_dumpArray.sqf +/* + * Author: ? + * ? + * + * Arguments: + * 0: Array to be dumped + * 1: Depth + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_pad", "_i", "_x"]; - -PARAMS_2(_var,_depth); +params ["_var", "_depth"]; +private "_pad"; _pad = ""; for "_i" from 0 to _depth do { @@ -14,11 +25,14 @@ for "_i" from 0 to _depth do { _depth = _depth + 1; if (IS_ARRAY(_var)) then { - if ((count _var) > 0) then { + if (count _var > 0) then { diag_log text format["%1[", _pad]; + { [_x, _depth] call FUNC(dumpArray); - } forEach _var; + false + } count _var; + diag_log text format["%1],", _pad]; } else { diag_log text format["%1[],", _pad]; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index 0c3d6c8e78..7845aaf95d 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -1,49 +1,68 @@ -//fnc_dumpPerformanceCounters.sqf -#define DEBUG_MODE_FULL +/* + * Author: ? + * Dumps performance counter statistics into Logs. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" - diag_log text format["REGISTERED ACE PFH HANDLERS"]; diag_log text format["-------------------------------------------"]; + if (!isNil "ACE_PFH_COUNTER") then { { - private ["_isActive"]; _x params ["_pfh", "_parameters"]; - _isActive = if (!isNil {cba_common_PFHhandles select (_pfh select 0)}) then {"ACTIVE"} else {"REMOVED"}; - diag_log text format["Registered PFH: id=%1 [%2, delay %3], %4:%5", (_pfh select 0), (_isActive), (_parameters select 1), (_pfh select 1), (_pfh select 2) ]; - } forEach ACE_PFH_COUNTER; + + private "_isActive"; + _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)} + + diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2]; + false + } count ACE_PFH_COUNTER; }; -diag_log text format["ACE COUNTER RESULTS"]; -diag_log text format["-------------------------------------------"]; +diag_log text format ["ACE COUNTER RESULTS"]; +diag_log text format ["-------------------------------------------"]; + { - private ["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; + private ["_counterEntry", "_iter", "_total", "_count", "_averageResult", "_delta"]; + _counterEntry = _x; _iter = 0; _total = 0; _count = 0; _averageResult = 0; - if( (count _counterEntry) > 3) then { + + if (count _counterEntry > 3) then { // calc { - if(_iter > 2) then { + if (_iter > 2) then { _count = _count + 1; _delta = (_x select 1) - (_x select 0); _total = _total + _delta; }; + _iter = _iter + 1; - } forEach _counterEntry; - + false + } count _counterEntry; + // results _averageResult = (_total / _count) * 1000; - + // dump results - diag_log text format["%1: Average: %2s / %3 = %4ms", (_counterEntry select 0), _total, _count, _averageResult]; + diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult]; } else { - diag_log text format["%1: No results", (_counterEntry select 0) ]; + diag_log text format ["%1: No results", _counterEntry select 0]; }; -} forEach ACE_COUNTERS; + false +} count ACE_COUNTERS; /* // Dump PFH Trackers @@ -71,4 +90,4 @@ diag_log text format["-------------------------------------------"]; // //} forEach ACRE_EXCESSIVE_FRAME_TRACKER; -*/ \ No newline at end of file +*/ From 5fd1938f25efb1d2b202544445d05f80bfbf66f4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 22:29:38 +0200 Subject: [PATCH 131/311] more common code cleanup --- addons/common/functions/fnc__handleNetEvent.sqf | 3 ++- .../fnc__handleRequestAllSyncedEvents.sqf | 3 ++- .../functions/fnc__handleRequestSyncedEvent.sqf | 3 ++- addons/common/functions/fnc_ambientBrightness.sqf | 1 - .../common/functions/fnc_applyForceWalkStatus.sqf | 4 ++-- .../common/functions/fnc_assignObjectsInList.sqf | 15 +++++++++------ addons/common/functions/fnc_blurScreen.sqf | 1 - addons/common/functions/fnc_canGetInPosition.sqf | 1 - addons/common/functions/fnc_claim.sqf | 1 + addons/common/functions/fnc_currentChannel.sqf | 1 - addons/common/functions/fnc_debugModule.sqf | 2 +- 11 files changed, 19 insertions(+), 16 deletions(-) diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index 90cf95ac77..e409afe6a3 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -80,6 +80,7 @@ if (_eventType == "ACEc") then { ["ACEg", ACEg] call FUNC(_handleNetEvent); }; }; - } forEach _eventTargets; + false + } count _eventTargets; }; }; diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf index fbaeb60e4f..4e755562b5 100644 --- a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -21,6 +21,7 @@ params ["_client"]; _eventLog = _eventEntry select 1; ["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent); -} forEach (GVAR(syncedEvents) select 0); + false +} count (GVAR(syncedEvents) select 0); true diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index 96cd7a51f5..d4d9b2cf76 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -41,7 +41,8 @@ if (isServer) then { { _x params ["", "_eventArgs","_ttl"]; [_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent); - } forEach _eventLog; + false + } count _eventLog; ACE_LOGINFO_1("[%1] synchronized",_eventName); }; diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf index 86aef99b0c..4ec2840e47 100644 --- a/addons/common/functions/fnc_ambientBrightness.sqf +++ b/addons/common/functions/fnc_ambientBrightness.sqf @@ -1,6 +1,5 @@ /* * Author: commy2, idea by Falke - * * Returns a brightness value depending on the sun and moon state. Ranges from 0 to 1 (dark ... bright). * * Arguments: diff --git a/addons/common/functions/fnc_applyForceWalkStatus.sqf b/addons/common/functions/fnc_applyForceWalkStatus.sqf index 82fbd9da3a..d3b58a25a4 100644 --- a/addons/common/functions/fnc_applyForceWalkStatus.sqf +++ b/addons/common/functions/fnc_applyForceWalkStatus.sqf @@ -9,10 +9,10 @@ * None * * Example: - * [ACE_Player] call FUNC(applyForceWalkStatus) + * [ACE_Player] call ace_common_fnc_applyForceWalkStatus * * Public: No -*/ + */ #include "script_component.hpp" params ["_unit"]; diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf index 0d10066d01..6bbb31d2dc 100644 --- a/addons/common/functions/fnc_assignObjectsInList.sqf +++ b/addons/common/functions/fnc_assignObjectsInList.sqf @@ -14,37 +14,40 @@ * * Public: No */ - #include "script_component.hpp" -private ["_splittedList", "_nilCheckPassedList"]; params ["_list", "_variable", "_setting", "_global"]; if (typeName _list == "STRING") then { + private ["_splittedList", "_nilCheckPassedList"]; + _splittedList = [_list, ","] call BIS_fnc_splitString; _nilCheckPassedList = ""; + { _x = [_x] call FUNC(stringRemoveWhiteSpace); - if !(isnil _x) then { + if !(isNil _x) then { if (_nilCheckPassedList == "") then { _nilCheckPassedList = _x; } else { _nilCheckPassedList = _nilCheckPassedList + ","+ _x; }; }; - }foreach _splittedList; + false + } count _splittedList; _list = [] call compile format["[%1]",_nilCheckPassedList]; }; { - if (!isnil "_x") then { + if (!isNil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { _x setvariable [_variable, _setting, _global]; }; }; }; -}foreach _list; + false +} count _list; true diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index 8136d1476c..a3394a1fbf 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -10,7 +10,6 @@ * * Public: Yes */ - #include "script_component.hpp" if (!hasInterface) exitWith {}; diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index 40724569d0..45a2642655 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Is the unit able to enter the vehicle in the given position? * * Arguments: diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index 9a5b373fa5..ac89a80172 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -10,6 +10,7 @@ * Return Value: * None * + * Public: No */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_currentChannel.sqf b/addons/common/functions/fnc_currentChannel.sqf index 52aed1f4ce..82dd66b485 100644 --- a/addons/common/functions/fnc_currentChannel.sqf +++ b/addons/common/functions/fnc_currentChannel.sqf @@ -1,6 +1,5 @@ /* * Author: commy2 - * * Returns the current radio / chat / marker channel. * * Arguments: diff --git a/addons/common/functions/fnc_debugModule.sqf b/addons/common/functions/fnc_debugModule.sqf index d313244e52..4f3da4d7cb 100644 --- a/addons/common/functions/fnc_debugModule.sqf +++ b/addons/common/functions/fnc_debugModule.sqf @@ -1,5 +1,6 @@ /* * Author: Glowbal + * ? * * Arguments: * None @@ -9,7 +10,6 @@ * * Public: No */ - #include "script_component.hpp" params ["_entity"]; From 62ec00a2518b8a9c47987502b5c961207f0359d6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 22:36:05 +0200 Subject: [PATCH 132/311] more common code cleanup --- addons/common/functions/fnc_addCanInteractWithCondition.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 11213accd6..740fa9bb9f 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -17,11 +17,11 @@ params ["_conditionName", "_conditionFunc"]; _conditionName = toLower _conditionName; -private "_conditions"; +private ["_conditions", "_index"]; + _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; _conditions params ["_conditionNames", "_conditionFuncs"]; -private "_index"; _index = _conditionNames find _conditionName; if (_index == -1) then { From a98a45e5d161d73535905bfb8e53b1db0bd7197b Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 23:18:51 +0200 Subject: [PATCH 133/311] more common code cleanup --- addons/common/functions/fnc_getAllGear.sqf | 42 ++++++++++++------- .../functions/fnc_getCaptivityStatus.sqf | 16 +++---- addons/common/functions/fnc_getChildren.sqf | 22 +++++++--- .../functions/fnc_getConfigCommander.sqf | 17 ++++---- .../common/functions/fnc_getConfigGunner.sqf | 17 ++++---- addons/common/functions/fnc_getConfigType.sqf | 13 +++--- .../functions/fnc_getConfigTypeObject.sqf | 13 +++--- addons/common/functions/fnc_getGunner.sqf | 26 ++++++------ .../functions/fnc_getTurretCommander.sqf | 30 +++++++------ .../common/functions/fnc_getTurretCopilot.sqf | 19 +++++---- .../common/functions/fnc_getTurretGunner.sqf | 19 +++++---- addons/common/functions/fnc_getTurretsFFV.sqf | 20 +++++---- .../common/functions/fnc_getTurretsOther.sqf | 20 +++++---- 13 files changed, 159 insertions(+), 115 deletions(-) diff --git a/addons/common/functions/fnc_getAllGear.sqf b/addons/common/functions/fnc_getAllGear.sqf index aa2289309e..97b28fddd6 100644 --- a/addons/common/functions/fnc_getAllGear.sqf +++ b/addons/common/functions/fnc_getAllGear.sqf @@ -1,28 +1,38 @@ /* * Author: bux578, commy2 - * * Returns an array containing all items of a given unit * - * Argument: - * 0: Unit (Object) + * Arguments: + * 0: Unit * - * Return value: - * Array with all the gear, format: - * 0: headgear (String) - * 1: goggles (String) - * 2,3: uniform (String, Array) - * 4,5: vest (String, Array) - * 6,7: backpack (String, Array) - * 8-10: rifle (String, Array, Array) - * 11-13: launcher (String, Array, Array) - * 14-16: pistol (String, Array, Array) - * 17: map, compass, watch, etc. (Array) - * 18: binocluar (String) + * Return Value: + * 0: Headgear + * 1: Goggles + * 2: Uniform + * 3: Uniform Items + * 4: Vest + * 5: Vest Items + * 6: Backback + * 7: Backpack Items + * 8: Rifle + * 9: Rifle Items + * 10: Rifle Magazines + * 11: Launcher + * 12: Launcher Items + * 13: Launcher Magazines + * 14: Handgun + * 15: Handgun Items + * 16: Handgun Magazines + * 17: Assigned Items (map, compass, watch, etc.) + * 18: Binoculars * + * Public: Yes + * + * Note: Element 17 includes the Head Mounted Display (HMD) */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; if (isNull _unit) exitWith {[ "", diff --git a/addons/common/functions/fnc_getCaptivityStatus.sqf b/addons/common/functions/fnc_getCaptivityStatus.sqf index 50aeeced3a..36bf0ff183 100644 --- a/addons/common/functions/fnc_getCaptivityStatus.sqf +++ b/addons/common/functions/fnc_getCaptivityStatus.sqf @@ -1,25 +1,27 @@ /* * Author: commy2 - * * Return the captivity status of an unit. * - * Argument: - * 0: Unit (Object) + * Arguments: + * 0: Unit * - * Return value: - * Reasons, why the unit is a captive. An empty array is returned if the unit is not a captive (Array of Strings) + * Return Value: + * Captivity Reasons, empty if not captive + * + * Public: Yes */ #include "script_component.hpp" -private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; +params ["_unit"]; -PARAMS_1(_unit); +private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; _unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber); _unitCaptivityReasons = []; + { if (_unitCaptivityStatus select _forEachIndex) then { _unitCaptivityReasons pushBack _x; diff --git a/addons/common/functions/fnc_getChildren.sqf b/addons/common/functions/fnc_getChildren.sqf index d28ba7cb70..d5212dd9a5 100644 --- a/addons/common/functions/fnc_getChildren.sqf +++ b/addons/common/functions/fnc_getChildren.sqf @@ -1,10 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * Obtain children of a config entry + * + * Arguments: + * 0: Unit + * + * Return Value: + * Parent Entry Class Children + * + * Public: Yes + */ #include "script_component.hpp" -private ["_classes"]; - -PARAMS_2(_name,_cfgClass); +params ["_name", "_cfgClass"]; +private "_classes"; _classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass); -_classes = [_classes, {configName _this}] call FUNC(map); -_classes + +[_classes, {configName _this}] call FUNC(map) // return diff --git a/addons/common/functions/fnc_getConfigCommander.sqf b/addons/common/functions/fnc_getConfigCommander.sqf index 44f02cbeb1..bfa5fbc379 100644 --- a/addons/common/functions/fnc_getConfigCommander.sqf +++ b/addons/common/functions/fnc_getConfigCommander.sqf @@ -1,21 +1,22 @@ /* * Author: commy2 - * * Get the commander config of a vehicles turret. * - * Argument: - * 0: vehicle (Object) + * Arguments: + * 0: vehicle * - * Return value: - * Commander config (Config) + * Return Value: + * Commander config + * + * Public: Yes */ #include "script_component.hpp" -private ["_config", "_turret"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_config", "_turret"]; _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _turret = [_vehicle] call FUNC(getTurretCommander); -[_config, _turret] call FUNC(getTurretConfigPath) +[_config, _turret] call FUNC(getTurretConfigPath) // return diff --git a/addons/common/functions/fnc_getConfigGunner.sqf b/addons/common/functions/fnc_getConfigGunner.sqf index a28491bfff..bc3131d798 100644 --- a/addons/common/functions/fnc_getConfigGunner.sqf +++ b/addons/common/functions/fnc_getConfigGunner.sqf @@ -1,21 +1,22 @@ /* * Author: commy2 - * * Get the gunner config of a vehicles turret. * - * Argument: - * 0: vehicle (Object) + * Arguments: + * 0: vehicle * - * Return value: - * Gunner config (Config) + * Return Value: + * Gunner config + * + * Public: Yes */ #include "script_component.hpp" -private ["_config", "_turret"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_config", "_turret"]; _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _turret = [_vehicle] call FUNC(getTurretGunner); -[_config, _turret] call FUNC(getTurretConfigPath) +[_config, _turret] call FUNC(getTurretConfigPath) // return diff --git a/addons/common/functions/fnc_getConfigType.sqf b/addons/common/functions/fnc_getConfigType.sqf index b2d601c121..1496cfa2b9 100644 --- a/addons/common/functions/fnc_getConfigType.sqf +++ b/addons/common/functions/fnc_getConfigType.sqf @@ -1,17 +1,18 @@ /* * Author: commy2 + * Determins type of item. Can be CfgMagaines, CfgWeapons or CfgGlasses. * - * What kind of Cfg is the item. Works for CfgMagaines, CfgWeapons and CfgGlasses + * Arguments: + * 0: Item Classname * - * Argument: - * 0: A item's classname. (String) + * Return Value: + * Config category ("CfgWeapons", "CfgMagazines", "CfgGlasses", "") * - * Return value: - * CfgWhatever (String) + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_item); +params ["_item"]; if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"}; diff --git a/addons/common/functions/fnc_getConfigTypeObject.sqf b/addons/common/functions/fnc_getConfigTypeObject.sqf index ef39ce22c7..6186ad6bff 100644 --- a/addons/common/functions/fnc_getConfigTypeObject.sqf +++ b/addons/common/functions/fnc_getConfigTypeObject.sqf @@ -1,17 +1,18 @@ /* * Author: commy2 + * Determins type of object. Can be CfgVehicles or CfgAmmo. * - * What kind of Cfg is the object. Works for CfgVehicles and CfgAmmo + * Arguments: + * 0: Object classname * - * Argument: - * 0: An object's classname. (String) + * Return Value: + * Config category ("CfgWeapons", "Cfgmagazines", "CfgGlasses", "") * - * Return value: - * CfgWhatever (String) + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_object); +params ["_object"]; if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"}; diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index ce73019f70..dac42ce535 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -1,20 +1,19 @@ /* * Author: commy2 + * Returns gunner using specified weapon type in vehicle. Only works if all turrets have different weapons. * - * Get the gunner of a vehicle who uses the given weapon type. Requires every turret to have a different weapon. + * Arguments: + * 0: Vehicle + * 1: Weapon * - * Argument: - * 0: The vehicle (Object) - * 1: weapon of the vehicle (String) + * Return Value: + * Gunner * - * Return value: - * The turret gunner with this weapon (Object) + * Public: Yes */ +#include "script_component.hpp" -private ["_vehicle", "_weapon"]; - -_vehicle = _this select 0; -_weapon = _this select 1; +params ["_vehicle", "_weapon"]; // on foot if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle || {toLower _weapon in ["throw", "put"]}}) exitWith {gunner _vehicle}; @@ -27,11 +26,12 @@ _gunner = objNull; if (_weapon in (_vehicle weaponsTurret _x)) exitWith { _gunner = _vehicle turretUnit _x; }; -} forEach allTurrets [_vehicle, true]; + false +} count allTurrets [_vehicle, true]; // ensure that at least the pilot is returned if there is no gunner if (isManualFire _vehicle && {isNull _gunner}) then { - _gunner = driver _vehicle; + _gunner = driver _vehicle; }; -_gunner \ No newline at end of file +_gunner diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf index 99665d03e3..e045c2d46f 100644 --- a/addons/common/functions/fnc_getTurretCommander.sqf +++ b/addons/common/functions/fnc_getTurretCommander.sqf @@ -1,30 +1,34 @@ /* * Author: commy2 - * * Get the turret index of a vehicles commander. * - * Argument: - * 0: Vehicle (Object) + * Arguments: + * 0: Vehicle * - * Return value: - * Turret index of the vehicles commander. Empty array means no observer position. (Array) + * Return Value: + * Vehicle commander turrent indecies + * + * Public: Yes */ #include "script_component.hpp" -private ["_turrets", "_turret", "_config"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_turrets", "_turret", "_config"]; _turrets = allTurrets [_vehicle, true]; _turret = []; + { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); + + if (getNumber (_config >> "primaryObserver") == 1) exitWith { + _turret = _x; + }; + false +} count _turrets; - if (getNumber (_config >> "primaryObserver") == 1) exitWith { - _turret = _x; - }; -} forEach _turrets; _turret diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf index d496051558..94a30b7697 100644 --- a/addons/common/functions/fnc_getTurretCopilot.sqf +++ b/addons/common/functions/fnc_getTurretCopilot.sqf @@ -1,23 +1,25 @@ /* * Author: commy2 - * * Get the turret index of a vehicles copilot. * - * Argument: - * 0: Vehicle (Object) + * Arguments: + * 0: Vehicle * - * Return value: - * Turret index of the vehicles gunner. Empty array means no copilot position. (Array) + * Return Value: + * Vehicle Copilot Turret indecies + * + * Public: Yes */ #include "script_component.hpp" -private ["_turrets", "_turret", "_config"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_turrets", "_turret", "_config"]; _turrets = allTurrets [_vehicle, true]; _turret = []; + { _config = configFile >> "CfgVehicles" >> typeOf _vehicle; @@ -26,6 +28,7 @@ _turret = []; if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { _turret = _x; }; -} forEach _turrets; + false +} count _turrets; _turret diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf index a4bcca54dd..9a71d292bd 100644 --- a/addons/common/functions/fnc_getTurretGunner.sqf +++ b/addons/common/functions/fnc_getTurretGunner.sqf @@ -1,23 +1,25 @@ /* * Author: commy2 - * * Get the turret index of a vehicles gunner. * - * Argument: - * 0: Vehicle (Object) + * Arguments: + * 0: Vehicle * - * Return value: - * Turret index of the vehicles gunner. Empty array means no gunner position. (Array) + * Return Value: + * Vehicle Gunner Turret indecies + * + * Public: Yes */ #include "script_component.hpp" -private ["_turrets", "_turret", "_config"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_turrets", "_turret", "_config"]; _turrets = allTurrets [_vehicle, true]; _turret = []; + { _config = configFile >> "CfgVehicles" >> typeOf _vehicle; @@ -26,6 +28,7 @@ _turret = []; if (getNumber (_config >> "primaryGunner") == 1) exitWith { _turret = _x; }; -} forEach _turrets; + false +} count _turrets; _turret diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf index 2eaa8807b0..ff7726d1be 100644 --- a/addons/common/functions/fnc_getTurretsFFV.sqf +++ b/addons/common/functions/fnc_getTurretsFFV.sqf @@ -1,23 +1,25 @@ /* * Author: commy2 - * * Get the turret indices of ffv turrets. * - * Argument: - * 0: Vehicle (Object) + * Arguments: + * 0: Vehicle * - * Return value: - * Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array) + * Return Value: + * Vehicle FFV Turret indecies + * + * Public: Yes */ #include "script_component.hpp" -private ["_turrets", "_turret", "_config"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_turrets", "_turret", "_config"]; _turrets = allTurrets [_vehicle, true]; _turret = []; + { _config = configFile >> "CfgVehicles" >> typeOf _vehicle; @@ -26,5 +28,7 @@ _turret = []; if (getNumber (_config >> "isPersonTurret") == 1) then { _turret pushBack _x; }; -} forEach _turrets; + false +} count _turrets; + _turret diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf index 5f373f7c9c..93ab3f2321 100644 --- a/addons/common/functions/fnc_getTurretsOther.sqf +++ b/addons/common/functions/fnc_getTurretsOther.sqf @@ -1,23 +1,25 @@ /* * Author: commy2 - * * Get the turret indices of other turrets (not gunner, commander, copilot or ffv). * - * Argument: - * 0: Vehicle (Object) + * Arguments: + * 0: Vehicle * - * Return value: - * Turret index of the vehicles gunner. Empty array means no other turrets. (Array) + * Return Value: + * Vehicle Other Turret indecies + * + * Public: Yes */ #include "script_component.hpp" -private ["_turrets", "_turret", "_config"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_turrets", "_turret", "_config"]; _turrets = allTurrets [_vehicle, true]; _turret = []; + { _config = configFile >> "CfgVehicles" >> typeOf _vehicle; @@ -30,5 +32,7 @@ _turret = []; ) then { _turret pushBack _x; }; -} forEach _turrets; + false +} count _turrets; + _turret From ffc5a1638445f574c96807aa3df5d812ddb52494 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 23:40:51 +0200 Subject: [PATCH 134/311] more common code cleanup --- .../fnc_getAllDefinedSetVariables.sqf | 46 +++++++++++-------- .../functions/fnc_getTurretConfigPath.sqf | 21 +++++---- .../functions/fnc_getTurretDirection.sqf | 38 +++++++++------ .../common/functions/fnc_getTurretIndex.sqf | 20 ++++---- addons/common/functions/fnc_getTurrets.sqf | 30 +++++++----- 5 files changed, 95 insertions(+), 60 deletions(-) diff --git a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf index 2163accae2..18c8a18c72 100644 --- a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -1,30 +1,40 @@ -/** - * fn_getAllSetVariables.sqf - * @Descr: Returns an 2d array of all variables that have been set on the object - * @Author: Glowbal +/* + * Author: Glowbal + * Returns an 2d array of all variables that have been set on the object * - * @Arguments: [unit OBJECT, category STRING (Optional. Only get the variables from the specified category. Default is "" == all)] - * @Return: ARRAY REturns an array with the format [ [name STRING, typeName STRING, value ANY, publicFlag BOOL, peristentFlag BOOL] ] - * @PublicAPI: true + * Arguments: + * 0: Unit + * 1: Limiting Category (default: "") + * + * Return Value: + * Variable Data + * 0: Name + * 1: typeName + * 2: value + * 3: publicFlag + * 4: peristentFlag + * + * Public: Yes */ - #include "script_component.hpp" -private ["_return", "_val", "_category"]; -PARAMS_1(_object); -_category = if (count _this > 1) then { _this select 1 } else { "" }; +params ["_object", ["_category", ""]]; -if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith { - []; -}; +if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith {[]}; + +private ["_return", "_val"]; _return = []; + { _val = _object getvariable (_x select 0); - if (!isnil "_val") then { + + if (!isNil "_val") then { if (_category == "" || _category == _x select 3) then { - _return pushback [_x select 0, typeName _val, _val, _x select 2, _x select 5]; + _return pushBack [_x select 0, typeName _val, _val, _x select 2, _x select 5]; }; }; -}foreach GVAR(OBJECT_VARIABLES_STORAGE); -_return \ No newline at end of file + false +} count GVAR(OBJECT_VARIABLES_STORAGE); + +_return diff --git a/addons/common/functions/fnc_getTurretConfigPath.sqf b/addons/common/functions/fnc_getTurretConfigPath.sqf index 1fca65eaac..07d7ac4e0c 100644 --- a/addons/common/functions/fnc_getTurretConfigPath.sqf +++ b/addons/common/functions/fnc_getTurretConfigPath.sqf @@ -1,28 +1,29 @@ /* * Author: commy2 - * * Get the config path of a vehicles turret. * - * Argument: - * 0: vehicles config (Config) - * 1: Turret index (Array) + * Arguments: + * 0: Vehicle Config + * 1: Turret indecies * - * Return value: - * Turret config (Config) + * Return Value: + * Turret config + * + * Public: Yes */ #include "script_component.hpp" -private ["_index", "_offset", "_config2", "_foundClasses", "_a"]; +params ["_config", "_turretIndex"]; -PARAMS_2(_config,_turretIndex); +private ["_offset", "_config2", "_foundClasses"]; for "_index" from 0 to (count _turretIndex - 1) do { _config = _config >> "Turrets"; _offset = 0; _config2 = _config select 0; - _foundClasses = 0; + for "_a" from 0 to (count _config - 1) do { if (isClass _config2) then { _foundClasses = _foundClasses + 1; @@ -33,6 +34,8 @@ for "_index" from 0 to (count _turretIndex - 1) do { if (_foundClasses == _turretIndex select _index) exitWith {}; }; + _config = _config2; }; + _config diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index 31b68ccabc..ced29a9a85 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -1,37 +1,47 @@ /* * Author: jaynus - * * Get the absolute turret direction for FOV/PIP turret. * - * Argument: - * 0: Vehicle (Object) - * 1: Turret Position + * Arguments: + * 0: Vehicle + * 1: Turret Position * - * Return value: - * [position, direction] + * Return Value: + * 0: Position ASL + * 1: Direction + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_vehicle,_position); -private ["_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov", "_gunBeg", "_gunEnd", "_pipDir"]; +params ["_vehicle", "_position"]; + +private ["_turret", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir"]; _turret = [_vehicle, _position] call CBA_fnc_getTurret; + _pov = getText (_turret >> "memoryPointGunnerOptics"); _gunBeg = getText (_turret >> "gunBeg"); -_gunEnd = getText (_turret >> "gunEnd"); +_gunEnd = getText (_turret >> "gunEnd"); + TRACE_3("", _pov, _gunBeg, _gunEnd); // Pull the PIP pov or barrel direction, depending on how the model is set up -_povPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _pov ) ); +_povPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _pov)); //@todo AGLToASL ? _povDir = [0,0,0]; if (_pov == "pip0_pos") then { - _pipDir = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir" ) ); + private "_pipDir"; + _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir")); + _povDir = _pipDir vectorDiff _povPos; } else { - _gunBeginPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg ) ); - _gunEndPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd ) ); + private ["_gunBeginPos", "_gunEndPos"]; + + _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg)); + _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd)); + _povDir = _gunBeginPos vectorDiff _gunEndPos; }; -[_povPos, _povDir] \ No newline at end of file +[_povPos, _povDir] diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf index bfb96b4665..b2f28c5f90 100644 --- a/addons/common/functions/fnc_getTurretIndex.sqf +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -1,19 +1,21 @@ /* * Author: commy2 - * * Get the turret index of a units current turret. * - * Argument: - * 0: Unit, not the vehicle (as in not a car but the player) (Object) + * Arguments: + * 0: Unit * - * Return value: - * Turret index array or config path. E.g: [0] for gunner or [0,0] for commander. Returns empty array if unit is not in a turret. (Array) + * Return Value: + * Turret Index + * + * Public: Yes */ #include "script_component.hpp" +params ["_unit"]; + private ["_vehicle", "_turrets", "_units", "_index"]; -PARAMS_1(_unit); _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {[]}; @@ -21,9 +23,11 @@ if (_unit == _vehicle) exitWith {[]}; _turrets = allTurrets [_vehicle, true]; _units = []; + { - _units pushBack (_vehicle turretUnit _x); -} forEach _turrets; + _units pushBack (_vehicle turretUnit _x); + false +} count _turrets; _index = _units find _unit; diff --git a/addons/common/functions/fnc_getTurrets.sqf b/addons/common/functions/fnc_getTurrets.sqf index ea656941e4..9a1a48e2bd 100644 --- a/addons/common/functions/fnc_getTurrets.sqf +++ b/addons/common/functions/fnc_getTurrets.sqf @@ -1,37 +1,45 @@ /* * Author: commy2 + * Get all turret indicies of a vehicle type. * - * Get all turret indicies of a vehicle. + * Arguments: + * 0: Vehicle type * - * Argument: - * 0: Vehicle type (String) + * Return Value: + * Turret Indecies * - * Return value: - * All turret index arrays of the vehicle. E.g: [[0], [0,0]] (Array) + * Public: Yes + * + * Note: It's advised to use allTurrets [_vehicle, true] instead whenever possible */ #include "script_component.hpp" -private ["_config", "_turrets", "_fnc_addTurret", "_varName"]; +params ["_type"]; -PARAMS_1(_type); +private ["_varName", "_turrets"]; -_varName = format ["ACE_CachedTurrets_%1", _type]; +_varName = format [QGVAR(CachedTurrets_%1), _type]; _turrets = + (uiNamespace getVariable _varName); if (!isNil "_turrets") exitWith {_turrets}; +private ["_config", "_fnc_addTurret"]; + _config = configFile >> "CfgVehicles" >> _type; _turrets = []; -_fnc_addTurret = { - private ["_count", "_offset", "_index", "_path2", "_config2"]; - PARAMS_2(_config,_path); +_fnc_addTurret = { + params ["_config", "_path"]; _config = _config >> "Turrets"; + + private ["_count", "_offset", "_path2", "_config2"]; + _count = count _config; _offset = 0; + for "_index" from 0 to (_count - 1) do { _path2 = _path + [_index - _offset]; _config2 = _config select _index; From 1d4eb209a46af0003c589ff9aef121c78e72b1e1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 20 Sep 2015 23:50:30 +0200 Subject: [PATCH 135/311] fix missing ; in dumpPerformanceCounters --- addons/common/functions/fnc_dumpPerformanceCounters.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index 7845aaf95d..d23e3428db 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -20,7 +20,7 @@ if (!isNil "ACE_PFH_COUNTER") then { _x params ["_pfh", "_parameters"]; private "_isActive"; - _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)} + _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)}; diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2]; false From 79d4eb62beec4d6481876cdfdfd470bec54b0d04 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 16:55:33 -0500 Subject: [PATCH 136/311] Allow fixing jam when in FFV slot --- addons/overheating/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 51f23bf0b6..1b64d7f0b0 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -7,7 +7,7 @@ if (!hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(unjamWeapon), localize LSTRING(UnjamWeapon), { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) && {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} From 1679235b5152b110106b3ac1c9386f34489573b9 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 00:28:25 +0200 Subject: [PATCH 137/311] more common code cleanup --- addons/common/functions/fnc_getDeathAnim.sqf | 23 ++++++----- .../common/functions/fnc_getDefaultAnim.sqf | 40 ++++++++++++++----- .../functions/fnc_getDefinedVariable.sqf | 39 ++++++++++-------- .../fnc_getDefinedVariableDefault.sqf | 27 ++++++++----- .../functions/fnc_getDefinedVariableInfo.sqf | 23 ++++++----- .../functions/fnc_getDisplayConfigName.sqf | 28 ++++++++++--- .../common/functions/fnc_getDoorTurrets.sqf | 21 +++++----- addons/common/functions/fnc_globalEvent.sqf | 1 - 8 files changed, 128 insertions(+), 74 deletions(-) diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 539c8d2616..c88f89d35f 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -9,35 +9,38 @@ * animation * * Example: - * [bob] call ace_common_fnc_getDeathAnim; + * [bob] call ace_common_fnc_getDeathAnim * * Public: No */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -private ["_returnAnimation", "_animationState", "_unitAnimationCfg", "_unitActionsCfg", "_interpolateArray", "_indexAnimation", "_index"]; +private ["_returnAnimation", "_animationState", "_unitAnimationCfg", "_unitActionsCfg", "_interpolateArray", "_indexAnimation"]; _returnAnimation = ""; -_animationState = (animationState _unit); -_unitAnimationCfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); -//If we're already in a terminal animation just return current -if ((getNumber (_unitAnimationCfg >> "terminal")) == 1) exitWith {_animationState}; +_animationState = animationState _unit; +_unitAnimationCfg = configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState; -_unitActionsCfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimationCfg >> "actions"))); +//If we're already in a terminal animation just return current +if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState}; + +_unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions"); TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg); -if ((vehicle _unit) != _unit) then { +if (vehicle _unit != _unit) then { _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); + for "_index" from 0 to (count _interpolateArray - 1) step 2 do { _indexAnimation = _interpolateArray select _index; + //No guarentee that first animation will be right so scan for the first "terminal" animation //E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1}; - if ((getNumber ((configFile >> "CfgMovesMaleSdr" >> "States" >> _indexAnimation) >> "terminal")) == 1) exitWith { + if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _indexAnimation >> "terminal") == 1) exitWith { _returnAnimation = _indexAnimation; }; }; diff --git a/addons/common/functions/fnc_getDefaultAnim.sqf b/addons/common/functions/fnc_getDefaultAnim.sqf index fbcca2712e..372a2424eb 100644 --- a/addons/common/functions/fnc_getDefaultAnim.sqf +++ b/addons/common/functions/fnc_getDefaultAnim.sqf @@ -1,29 +1,47 @@ -// by commy2 +/* + * Author: commy2 + * Get the Defualt animation for the unit + * + * Arguments: + * 0: unit + * + * Return Value: + * animation + * + * Example: + * [bob] call ace_common_fnc_getDefaultAnim; + * + * Public: No + */ #include "script_component.hpp" +params ["_unit"]; + private ["_anim", "_stance"]; -PARAMS_1(_unit); -_anim = toLower (animationState _unit); +_anim = toLower animationState _unit; // stance is broken for some animations. _stance = stance _unit; + if (_anim find "ppne" == 4) then { - _stance = "PRONE"; + _stance = "PRONE"; }; + if (_anim find "pknl" == 4) then { - _stance = "CROUCH"; + _stance = "CROUCH"; }; + if (_anim find "perc" == 4) then { - _stance = "STAND"; + _stance = "STAND"; }; _anim = format ["AmovP%1M%2S%3W%4D%5", - ["erc", "knl", "pne"] select (["STAND", "CROUCH", "PRONE"] find _stance) max 0, - ["stp", "run"] select (vectorMagnitude velocity _unit > 1), - [["ras", "low"] select weaponLowered _unit, "non"] select (currentWeapon _unit == ""), - ["non", "rfl", "lnr", "pst", "bin"] select (["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] find currentWeapon _unit) max 0, - ["non", _anim select [count _anim - 1, 1]] select (_anim select [count _anim - 2, 2] in ["df", "db", "dl", "dr"]) + ["erc", "knl", "pne"] select (["STAND", "CROUCH", "PRONE"] find _stance) max 0, + ["stp", "run"] select (vectorMagnitude velocity _unit > 1), + [["ras", "low"] select weaponLowered _unit, "non"] select (currentWeapon _unit == ""), + ["non", "rfl", "lnr", "pst", "bin"] select (["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] find currentWeapon _unit) max 0, + ["non", _anim select [count _anim - 1, 1]] select (_anim select [count _anim - 2, 2] in ["df", "db", "dl", "dr"]) ]; ["", _anim] select isClass (configFile >> "CfgMovesMaleSdr" >> "States" >> _anim) diff --git a/addons/common/functions/fnc_getDefinedVariable.sqf b/addons/common/functions/fnc_getDefinedVariable.sqf index 6c10c4f682..c0d7ce8d83 100644 --- a/addons/common/functions/fnc_getDefinedVariable.sqf +++ b/addons/common/functions/fnc_getDefinedVariable.sqf @@ -1,33 +1,38 @@ -/** - * fn_getVariable.sqf - * @Descr: Grabs a variable. If variable has not been set, attempts to use default defined value - * @Author: Glowbal +/* + * Author: Glowbal + * Grabs a variable. If variable has not been set, attempts to use default defined value * - * @Arguments: [unit OBJECT, variableName STRING] - * @Return: ANY - * @PublicAPI: true + * Arguments: + * 0: unit + * 1: Variable Name + * + * Return Value: + * Value of variable or default value, if the variable is undefined + * + * Public: No */ - #include "script_component.hpp" -#define UNIT (_this select 0) -#define VARIABLE (_this select 1) +params ["_unit", "_variable", "_defaultValue"]; private "_value"; +_value = _unit getvariable _variable; -_value = UNIT getvariable VARIABLE; -if (isnil "_value") then { - if (count _this >2) then { - _value = _this select 2; +if (isNil "_value") then { + if (!isNil "_defaultValue") then { + _value = _defaultValue; } else { private "_definedVariable"; - _definedVariable = ([VARIABLE] call FUNC(getDefinedVariableInfo)); + _definedVariable = [_variable] call FUNC(getDefinedVariableInfo); + if (count _definedVariable > 1) then { _value = _definedVariable select 1; }; }; - if (isnil "_value") then { + + if (isNil "_value") then { _value = 0; }; }; -_value \ No newline at end of file + +_value diff --git a/addons/common/functions/fnc_getDefinedVariableDefault.sqf b/addons/common/functions/fnc_getDefinedVariableDefault.sqf index cd4e4f08f2..4bb4b12253 100644 --- a/addons/common/functions/fnc_getDefinedVariableDefault.sqf +++ b/addons/common/functions/fnc_getDefinedVariableDefault.sqf @@ -1,19 +1,24 @@ -/** - * fn_getvariableDefault.sqf - * @Descr: Get the variable default value - * @Author: Glowbal +/* + * Author: Glowbal + * Get the variable default value * - * @Arguments: [variableName STRING] - * @Return: ANY - * @PublicAPI: true + * Arguments: + * 0: Variable Name + * + * Return Value: + * Default value of variable + * + * Public: Yes */ - #include "script_component.hpp" +params ["_varName"]; + private "_variableDefinition"; -_variableDefinition = ([_this select 0] call FUNC(getDefinedVariableInfo)); -if (count _variableDefinition > 0) exitwith { +_variableDefinition = [_varName] call FUNC(getDefinedVariableInfo); + +if !(_variableDefinition isEqualTo []) exitwith { _variableDefinition select 1; }; -nil; \ No newline at end of file +nil diff --git a/addons/common/functions/fnc_getDefinedVariableInfo.sqf b/addons/common/functions/fnc_getDefinedVariableInfo.sqf index 03b50b0649..adcb70c6ee 100644 --- a/addons/common/functions/fnc_getDefinedVariableInfo.sqf +++ b/addons/common/functions/fnc_getDefinedVariableInfo.sqf @@ -1,12 +1,17 @@ -/** - * fn_getvariableInfo.sqf - * @Descr: N/A - * @Author: Glowbal +/* + * Author: Glowbal + * Get the variable Informations * - * @Arguments: [] - * @Return: - * @PublicAPI: false + * Arguments: + * 0: Variable Name + * + * Return Value: + * Variable Metadata + * + * Public: No */ - #include "script_component.hpp" -+(missionNamespace getvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + (_this select 0),[]]) + +params ["_varName"]; + ++ (missionNamespace getVariable [format [QGVAR(OBJECT_VARIABLES_STORAGE_%1), _varName], []]) diff --git a/addons/common/functions/fnc_getDisplayConfigName.sqf b/addons/common/functions/fnc_getDisplayConfigName.sqf index 92b6700238..7a0d9ffa95 100644 --- a/addons/common/functions/fnc_getDisplayConfigName.sqf +++ b/addons/common/functions/fnc_getDisplayConfigName.sqf @@ -1,15 +1,31 @@ -// by commy2 +/* + * Author: commy2 + * Get display classnames from config with given idd. + * + * Arguments: + * 0: Display ID (idd) + * + * Return Value: + * Display Classnames + * + * Public: Yes + * + * Note: Really slow due to iteration through whole config. Meant for debugging. + */ #include "script_component.hpp" -private ["_configName", "_index", "_config"]; +params ["_idd"]; -_configName = ""; +private ["_configNames", "_config"]; + +_configNames = []; for "_index" from 0 to (count configFile - 1) do { _config = configFile select _index; - if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith { - _configName = configName _config; + + if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _idd}) then { + _configNames pushBack configName _config; }; }; -_configName +_configNames diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf index f304c1714c..cab259a214 100644 --- a/addons/common/functions/fnc_getDoorTurrets.sqf +++ b/addons/common/functions/fnc_getDoorTurrets.sqf @@ -1,19 +1,20 @@ /* * Author: bux578 + * Returns all turret indecies of door gunners. * - * Gets the turret index of door gunners + * Arguments: + * 0: Vehicle * - * Argument: - * 0: Vehicle (Object) + * Return Value: + * All turret indecies of the Vehicle * - * Return value: - * Turret indexes of the door gunner. Empty array means no gunner position. (Array) + * Public: Yes */ #include "script_component.hpp" -private ["_turrets", "_doorTurrets", "_config"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_turrets", "_doorTurrets", "_config"]; _turrets = allTurrets [_vehicle, true]; @@ -21,11 +22,13 @@ _doorTurrets = []; { _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = [_config, _x] call FUNC(getTurretConfigPath); - if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then { + if (getNumber (_config >> "isCopilot" == 0) && {count getArray (_config >> "weapons") > 0}) then { _doorTurrets pushBack _x; }; -} forEach _turrets; + false +} count _turrets; _doorTurrets diff --git a/addons/common/functions/fnc_globalEvent.sqf b/addons/common/functions/fnc_globalEvent.sqf index 9928bc3468..126419b553 100644 --- a/addons/common/functions/fnc_globalEvent.sqf +++ b/addons/common/functions/fnc_globalEvent.sqf @@ -1,6 +1,5 @@ /* * Author: Nou - * * Execute a global event on all clients, including self. * * Arguments: From 5f7d8c0095c4bb4138054ba8ddd5587e312c5aa6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 00:34:04 +0200 Subject: [PATCH 138/311] more common code cleanup --- addons/common/functions/fnc_dumpArray.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index e07da9f695..7e8128e3ed 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -25,7 +25,9 @@ for "_i" from 0 to _depth do { _depth = _depth + 1; if (IS_ARRAY(_var)) then { - if (count _var > 0) then { + if (_var isEqualTo []) then { + diag_log text format["%1[],", _pad]; + } else { diag_log text format["%1[", _pad]; { @@ -34,8 +36,6 @@ if (IS_ARRAY(_var)) then { } count _var; diag_log text format["%1],", _pad]; - } else { - diag_log text format["%1[],", _pad]; }; } else { diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)]; From fe75aa55cf5c44c203dc5f6b550e1f240fbe6792 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Mon, 21 Sep 2015 00:39:13 +0200 Subject: [PATCH 139/311] Add missing english string --- addons/common/stringtable.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index e39ef4d7db..8973d1d3e6 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -482,7 +482,8 @@ Проверка аддонов - Sprawdzaj spójność addonów z serwerem + Check addon integrity with server and do selected action if an addon is missing. + Sprawdzaj spójność addonów z serwerem i wykonuj stosowną akcję jeżeli zostanie wykryty brak addonu. Este módulo verifica la integridad de los addons con los que iniciamos el simulador Dieses Modul überprüft ob jeder Spieler die richtigen PBO-Dateien hat. Zjistit addon který je v souladu se serverem From 29db26eb580ad385690c710426baa3b1bb4bf821 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Mon, 21 Sep 2015 00:40:14 +0200 Subject: [PATCH 140/311] Add missing english string --- addons/mk6mortar/stringtable.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index bd8f99da0d..f1bbef9228 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -127,6 +127,7 @@ Показывает цифровой компас MK6 + This module allows you to setup MK6 mortar settings. Moduł ten pozwala dostosować ustawienia moździerza MK6. Dieses Modul erlaubt das Einstellen des MK6-Mörsers. Tento modul umožňuje nastavení minometu MK6. From 89a1495534afc6f7ceb7b95e2f6e169af4cb0e76 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Mon, 21 Sep 2015 00:42:08 +0200 Subject: [PATCH 141/311] Add missing english string --- addons/respawn/stringtable.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 0406b4caa6..0b4a06ff7f 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -238,6 +238,7 @@ Система точек сбора + This module allows you to use rally points in missions, to which you can quickly teleport from base flag. Requires placing special objects on map - base and flag. Both available in category Empty -> ACE Respawn. Moduł ten pozwala zastosować na misji "punkt zbiórki", do którego można szybko przeteleportować się z "bazy". Wymaga postawienia odpowiednich obiektów na mapie - bazy oraz flagi. Obydwa dostępne są w kategorii Puste -> ACE Odrodzenie. Tento modul umožňuje určit místo shromaždiště, kam se mohou jednokty rychle teleportovat ze "základny". Toto vyžaduje vhodné objekty v mapě - základna a vlajka. Oba dva můžete najít v kategorii Prázdné -> ACE Oživení. Este módulo permite que você aplique em uma missão "pontos de encontro", que pode rapidamente se teletransportar para a "base". Ele requer colocar objetos apropriados no mapa - base e bandeiras. Ambos estão disponíveis na categoria em branco -> ACE Revival. From 5555eb195a4ba33dcf8b321a5f655995f53e84b7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 17:46:43 -0500 Subject: [PATCH 142/311] Also search for missing stringtable entries --- addons/spectator/stringtable.xml | 2 +- tools/search_undefinedFunctions.py | 90 +++++++++++++++++++----------- 2 files changed, 58 insertions(+), 34 deletions(-) diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index fbd3311d52..00d50e4704 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -9,7 +9,7 @@ Nastavení Pozorovatele Ajustes de espectador - + Configure how the spectator system will operate by default. Skonfiguruj domyślne ustawienia obserwatora. Configura como o sistema de espectador operará por padrão. diff --git a/tools/search_undefinedFunctions.py b/tools/search_undefinedFunctions.py index e7c1b8fb34..6d7ec5ae62 100644 --- a/tools/search_undefinedFunctions.py +++ b/tools/search_undefinedFunctions.py @@ -20,11 +20,11 @@ ccb = ctypes.windll.user32.CloseClipboard ga = ctypes.windll.kernel32.GlobalAlloc # Global Memory allocation gl = ctypes.windll.kernel32.GlobalLock # Global Memory Locking gul = ctypes.windll.kernel32.GlobalUnlock -GMEM_DDESHARE = 0x2000 +GMEM_DDESHARE = 0x2000 def Get( ): ocb(None) # Open Clip, Default task - pcontents = gcd(1) # 1 means CF_TEXT.. too lazy to get the token thingy ... + pcontents = gcd(1) # 1 means CF_TEXT.. too lazy to get the token thingy ... data = ctypes.c_char_p(pcontents).value #gul(pcontents) ? ccb() @@ -41,20 +41,10 @@ def Paste( data ): ccb() - def getFunctions(filepath): - selfmodule = (re.search('addons[\W]*([_a-zA-Z0-9]*)', filepath)).group(1) - # print("Checking {0} from {1}".format(filepath,selfmodule)) - - def pushClosing(t): - closingStack.append(closing.expr) - closing << Literal( closingFor[t[0]] ) - - def popClosing(): - closing << closingStack.pop() - + with open(filepath, 'r') as file: content = file.read() @@ -65,16 +55,41 @@ def getFunctions(filepath): srch = re.compile('EFUNC\(([_a-zA-Z0-9]*),([_a-zA-Z0-9]*)\)') exfuncs = srch.findall(content) exfuncs = sorted(set(exfuncs)) - - allFuncs = [] + + fileFuncs = [] for func in modfuncs: - allFuncs.append("ace_{0}_fnc_{1}".format(selfmodule,func)) - + fileFuncs.append("ace_{0}_fnc_{1}".format(selfmodule,func)) + for exModule,func in exfuncs: - allFuncs.append("ace_{0}_fnc_{1}".format(exModule, func)) - - return allFuncs - + fileFuncs.append("ace_{0}_fnc_{1}".format(exModule, func)) + + return fileFuncs + + +def getStrings(filepath): + selfmodule = (re.search('addons[\W]*([_a-zA-Z0-9]*)', filepath)).group(1) + # print("Checking {0} from {1}".format(filepath,selfmodule)) + + with open(filepath, 'r') as file: + content = file.read() + + srch = re.compile('[^E][CL]STRING\(([_a-zA-Z0-9]*)\)') + modfuncs = srch.findall(content) + modfuncs = sorted(set(modfuncs)) + + srch = re.compile('[^E][CL]STRING\(([_a-zA-Z0-9]*)\)') + exfuncs = srch.findall(content) + exfuncs = sorted(set(exfuncs)) + + fileStrings = [] + for func in modfuncs: + fileStrings.append("STR_ACE_{0}_{1}".format(selfmodule,func)) + + # for exModule,func in exfuncs: + # fileStrings.append("STR_ACE_{0}_{1}".format(exModule, func)) + + return fileStrings + def main(): print("#########################") @@ -82,30 +97,39 @@ def main(): print("#########################") sqf_list = [] + allFunctions = [] - + allStrings = [] + parser = argparse.ArgumentParser() parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") args = parser.parse_args() - + for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): for filename in fnmatch.filter(filenames, '*.sqf'): sqf_list.append(os.path.join(root, filename)) - + for filename in fnmatch.filter(filenames, '*.cpp'): + sqf_list.append(os.path.join(root, filename)) + for filename in fnmatch.filter(filenames, '*.hpp'): + sqf_list.append(os.path.join(root, filename)) + for filename in sqf_list: allFunctions = allFunctions + getFunctions(filename) - - - testCode1 = "diag_log text '*********** Scaning for nil functions [count {0}]';".format(len(set(allFunctions))); - testCode2 = "{ if (isNil _x) then {systemChat format ['%1 is nil', _x]; diag_log text format ['%1 is nil', _x];}} forEach allFunctions;"; - - outputCode = "{0} allFunctions = {1}; {2}".format(testCode1, list(set(allFunctions)), testCode2) - + for filename in sqf_list: + allStrings = allStrings + getStrings(filename) + + + codeHeader = "diag_log text '*********** Scaning for nil functions [funcs {0} / strings {1}]';".format(len(set(allFunctions)), len(set(allStrings))) + codeFuncCheck = "{ if (isNil _x) then {systemChat format ['%1 is nil', _x]; diag_log text format ['%1 is nil', _x];}} forEach allFunctions;" + codeStringCheck = "{ if (!isLocalized _x) then {systemChat format ['%1 is not in stringtable', _x]; diag_log text format ['%1 is not in stringtable', _x];}} forEach allStrings;" + + outputCode = "{0} allFunctions = {1}; allStrings = {2}; {3} {4}".format(codeHeader, list(set(allFunctions)), list(set(allStrings)), codeFuncCheck, codeStringCheck) + print(outputCode) Paste(outputCode); print ("") - print ("Copied to clipboard, total func count {0}".format(len(set(allFunctions)))) - + print ("Copied to clipboard, [funcs {0} / strings {1}]'".format(len(set(allFunctions)), len(set(allStrings)))) + if __name__ == "__main__": main() From 80483f6dad2dfb42698ddb2a7bc8999e6851ba01 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 20 Sep 2015 17:56:07 -0500 Subject: [PATCH 143/311] fix ESTRING search --- tools/search_undefinedFunctions.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/search_undefinedFunctions.py b/tools/search_undefinedFunctions.py index 6d7ec5ae62..1c281fa717 100644 --- a/tools/search_undefinedFunctions.py +++ b/tools/search_undefinedFunctions.py @@ -74,19 +74,19 @@ def getStrings(filepath): content = file.read() srch = re.compile('[^E][CL]STRING\(([_a-zA-Z0-9]*)\)') - modfuncs = srch.findall(content) - modfuncs = sorted(set(modfuncs)) + modStrings = srch.findall(content) + modStrings = sorted(set(modStrings)) - srch = re.compile('[^E][CL]STRING\(([_a-zA-Z0-9]*)\)') - exfuncs = srch.findall(content) - exfuncs = sorted(set(exfuncs)) + srch = re.compile('E[CL]STRING\(([_a-zA-Z0-9]*),([_a-zA-Z0-9]*)\)') + exStrings = srch.findall(content) + exStrings = sorted(set(exStrings)) fileStrings = [] - for func in modfuncs: - fileStrings.append("STR_ACE_{0}_{1}".format(selfmodule,func)) + for localString in modStrings: + fileStrings.append("STR_ACE_{0}_{1}".format(selfmodule, localString)) - # for exModule,func in exfuncs: - # fileStrings.append("STR_ACE_{0}_{1}".format(exModule, func)) + for (exModule, exString) in exStrings: + fileStrings.append("STR_ACE_{0}_{1}".format(exModule, exString)) return fileStrings From d449e4bd8307120e99599fbb702fc7227680d23a Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 01:07:49 +0200 Subject: [PATCH 144/311] more common code cleanup --- addons/common/functions/fnc_dumpArray.sqf | 8 +- .../functions/fnc_dumpPerformanceCounters.sqf | 4 +- .../functions/fnc_getForceWalkStatus.sqf | 35 +++-- addons/common/functions/fnc_getInPosition.sqf | 125 +++++++++--------- addons/common/functions/fnc_getItemType.sqf | 95 +++++++------ .../functions/fnc_getLightProperties.sqf | 50 ++----- .../fnc_getLightPropertiesWeapon.sqf | 49 ++----- addons/common/functions/fnc_getName.sqf | 22 ++- .../common/functions/fnc_getPitchBankYaw.sqf | 15 ++- .../common/functions/fnc_getWindDirection.sqf | 48 +++---- addons/common/functions/fnc_getZoom.sqf | 15 ++- 11 files changed, 206 insertions(+), 260 deletions(-) diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 7e8128e3ed..182c542df2 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -26,17 +26,17 @@ _depth = _depth + 1; if (IS_ARRAY(_var)) then { if (_var isEqualTo []) then { - diag_log text format["%1[],", _pad]; + diag_log text format ["%1[],", _pad]; } else { - diag_log text format["%1[", _pad]; + diag_log text format ["%1[", _pad]; { [_x, _depth] call FUNC(dumpArray); false } count _var; - diag_log text format["%1],", _pad]; + diag_log text format ["%1],", _pad]; }; } else { - diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)]; + diag_log text format ["%1%2", _pad, [_var] call FUNC(formatVar)]; }; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index d23e3428db..e076831c6f 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -12,8 +12,8 @@ */ #include "script_component.hpp" -diag_log text format["REGISTERED ACE PFH HANDLERS"]; -diag_log text format["-------------------------------------------"]; +diag_log text format ["REGISTERED ACE PFH HANDLERS"]; +diag_log text format ["-------------------------------------------"]; if (!isNil "ACE_PFH_COUNTER") then { { diff --git a/addons/common/functions/fnc_getForceWalkStatus.sqf b/addons/common/functions/fnc_getForceWalkStatus.sqf index dbab640d86..acdc2f1a05 100644 --- a/addons/common/functions/fnc_getForceWalkStatus.sqf +++ b/addons/common/functions/fnc_getForceWalkStatus.sqf @@ -1,25 +1,23 @@ /* -Name: FUNC(getForceWalkStatus) - -Author: Pabst Mirror (from captivity by commy2) - -Description: - Returns reasons why the unit is forceWalk-ing, empty if not forced. - -Parameters: - 0: OBJECT - Unit - -Returns: - ARRAY(of strings) - Reason why the unit is force walking - -Example: - [ACE_Player] call FUNC(getForceWalkStatus) -*/ + * Author: PabstMirror, commy2 + * Returns reasons why the unit is forceWalk-ing. + * + * Arguments: + * 0: unit + * + * Return Value: + * Force Walk reasons + * + * Example: + * [ACE_Player] call ace_common_fnc_getForceWalkStatus + * + * Public: Yes + */ #include "script_component.hpp" -private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; +params ["_unit"]; -PARAMS_1(_unit); +private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; @@ -28,6 +26,7 @@ _unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; _unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber); _unitForceWalkReasons = []; + { if (_unitForceWalkStatus select _forEachIndex) then { _unitForceWalkReasons pushBack _x; diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index d80c387b5d..dc3ad38cde 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -1,31 +1,26 @@ /* * Author: commy2 + * Move unit into given vehicle position or switch to that position if the unit is already inside the vehicle. + * + * Arguments: + * 0: Unit + * 1: Vehicle + * 2: Position ("Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver", "Cargo") + * 3: Index (only applies to "Turret", "FFV", "Codriver", "Cargo") (default: next free index) + * + * Return Value: + * None * - * Move unit into given vehicle position. Or switch to that position if the unit is already inside the vehicle. - * - * Arguments: - * 0: Unit to enter the vehicle (Object) - * 1: The vehicle to be entered (Object) - * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" (String) - * 3: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. - * Note: This index is diffrent from Armas "cargoIndex". (Number, optional default: next free index) - * - * Return Value: - * Nothing + * Public: Yes */ #include "script_component.hpp" #define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} #define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} -private ["_position", "_index"]; +params ["_unit", "_vehicle", "_position", ["_index", -1]]; -PARAMS_2(_unit,_vehicle); - -_position = toLower (_this select 2); -_index = _this select 3; // optional, please don't use - -if (isNil "_index") then {_index = -1}; +_position = toLower _position; // general if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; @@ -39,27 +34,29 @@ _isInside = vehicle _unit == _vehicle; _script = {}; _enemiesInVehicle = false; //Possible Side Restriction + { if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; -} forEach crew _vehicle; + false +} count crew _vehicle; switch (_position) do { case "driver" : { if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _script = [ + {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; }; }; case "pilot" : { if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - _position = "driver"; + _script = [ + {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + _position = "driver"; }; }; @@ -67,10 +64,10 @@ switch (_position) do { _turret = [_vehicle] call FUNC(getTurretGunner); if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _script = [ + {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; }; }; @@ -78,10 +75,10 @@ switch (_position) do { _turret = [_vehicle] call FUNC(getTurretCommander); if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _script = [ + {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; }; }; @@ -89,12 +86,12 @@ switch (_position) do { _turret = [_vehicle] call FUNC(getTurretCopilot); if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" }; }; @@ -104,8 +101,8 @@ switch (_position) do { if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} ] select _enemiesInVehicle; _position = "gunner"; @@ -114,13 +111,13 @@ switch (_position) do { _turret = _turrets select _index; if (CANGETINTURRETINDEX) exitWith { _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} ] select _enemiesInVehicle; _position = "gunner"; }; - }; + }; }; }; @@ -130,22 +127,22 @@ switch (_position) do { if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} ] select _enemiesInVehicle; _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" } else { for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - }; + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + }; }; }; }; @@ -160,8 +157,8 @@ switch (_position) do { if (_index != -1 && {_index in _positions}) then { _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} ] select _enemiesInVehicle; _position = "cargo"; @@ -169,8 +166,8 @@ switch (_position) do { _index = _positions select 0; if (!isNil "_index") then { _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} ] select _enemiesInVehicle; _position = "cargo"; @@ -188,8 +185,8 @@ switch (_position) do { if (_index != -1 && {_index in _positions}) then { _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} ] select _enemiesInVehicle; _position = "cargo"; @@ -197,8 +194,8 @@ switch (_position) do { _index = _positions select 0; if (!isNil "_index") then { _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} ] select _enemiesInVehicle; _position = "cargo"; diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index 4de2bfa862..79abf41341 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -1,83 +1,78 @@ /* * Author: commy2 + * Returns item type of given classname. * - * What kind of item is given classname + * Arguments: + * 0: Item * - * Argument: - * 0: Classname of a item. (String) - * - * Return value: - * Item type. (Array) - * 0: "weapon", "item", "magazine" or "" (String) - * 1: A description of the item (e.g. "primary" for a weapon or "vest" for a vest item) + * Return Value: + * 0: Type ("weapon", "item", "magazine", "") + * 1: Item Description * + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_item); +params ["_item"]; -private ["_cfgType"]; +private ["_cfgType", "_config", "_type", "_default"]; _cfgType = [_item] call FUNC(getConfigType); -if (_cfgType == "") exitWith {["",""]}; +if (_cfgType == "") exitWith {["", ""]}; -if (_cfgType == "CfgGlasses") exitWith {["item","glasses"]}; - -private ["_config", "_type"]; +if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]}; _config = configFile >> _cfgType >> _item; - _type = getNumber (_config >> "type"); if (isNumber (_config >> "ItemInfo" >> "type")) then { _type = getNumber (_config >> "ItemInfo" >> "type"); }; -private "_default"; _default = ["item", "magazine"] select (_cfgType == "CfgMagazines"); switch (true) do { case (_type == 0): {[_default,"unknown"]}; - case (_type == 2^0): {["weapon","primary"]}; - case (_type == 2^1): {["weapon","handgun"]}; - case (_type == 2^2): {["weapon","secondary"]}; - case (_type < 2^4): {["weapon","unknown"]}; - case (_type == 2^4): {["magazine","handgun"]}; // handgun - case (_type == 2^8): {["magazine","primary"]}; // rifle - case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines - //case (_type < 2^11): {["magazine","unknown"]}; + case (_type == 2^0): {["weapon", "primary"]}; + case (_type == 2^1): {["weapon", "handgun"]}; + case (_type == 2^2): {["weapon", "secondary"]}; + case (_type < 2^4): {["weapon", "unknown"]}; + case (_type == 2^4): {["magazine", "handgun"]}; // handgun + case (_type == 2^8): {["magazine", "primary"]}; // rifle + case (_type == 2^9): {["magazine", "secondary"]}; // rpg, mg, mines + //case (_type < 2^11): {["magazine", "unknown"]}; - case (_type == 101): {["item","muzzle"]}; - case (_type == 201): {["item","optics"]}; - case (_type == 301): {["item","flashlight"]}; - case (_type == 302): {["item","under"]}; // czech for bipod item - case (_type == 401): {["item","first_aid_kit"]}; - case (_type == 501): {["item","fins"]}; // not implemented - case (_type == 601): {["item","breathing_bomb"]}; // not implemented - case (_type == 603): {["item","goggles"]}; - case (_type == 604): {["item","scuba"]}; // not implemented - case (_type == 605): {["item","headgear"]}; - case (_type == 611): {["item","radio"]}; - case (_type == 616): {["item","hmd"]}; - case (_type == 617): {["item","binocular"]}; - case (_type == 619): {["item","medikit"]}; - case (_type == 620): {["item","toolkit"]}; - case (_type == 621): {["item","uav_terminal"]}; - case (_type == 701): {["item","vest"]}; - case (_type == 801): {["item","uniform"]}; + case (_type == 101): {["item", "muzzle"]}; + case (_type == 201): {["item", "optics"]}; + case (_type == 301): {["item", "flashlight"]}; + case (_type == 302): {["item", "under"]}; // czech for bipod item + case (_type == 401): {["item", "first_aid_kit"]}; + case (_type == 501): {["item", "fins"]}; // not implemented + case (_type == 601): {["item", "breathing_bomb"]}; // not implemented + case (_type == 603): {["item", "goggles"]}; + case (_type == 604): {["item", "scuba"]}; // not implemented + case (_type == 605): {["item", "headgear"]}; + case (_type == 611): {["item", "radio"]}; + case (_type == 616): {["item", "hmd"]}; + case (_type == 617): {["item", "binocular"]}; + case (_type == 619): {["item", "medikit"]}; + case (_type == 620): {["item", "toolkit"]}; + case (_type == 621): {["item", "uav_terminal"]}; + case (_type == 701): {["item", "vest"]}; + case (_type == 801): {["item", "uniform"]}; case (_type == 2^12): { switch (toLower getText (_config >> "simulation")) do { - case ("weapon"): {["weapon","binocular"]}; - case ("binocular"): {["weapon","binocular"]}; - case ("nvgoggles"): {["item","nvgoggles"]}; - case ("itemminedetector"): {["item","minedetector"]}; - default {[_default,"unknown"]}; + case ("weapon"): {["weapon", "binocular"]}; + case ("binocular"): {["weapon", "binocular"]}; + case ("nvgoggles"): {["item", "nvgoggles"]}; + case ("itemminedetector"): {["item", "minedetector"]}; + default {[_default, "unknown"]}; }; }; - case (_type == 2^16): {["weapon","vehicle"]}; - case (_type == 2^17): {[_default,"unknown"]}; // ??? - default {[_default,"unknown"]}; + case (_type == 2^16): {["weapon", "vehicle"]}; + case (_type == 2^17): {[_default, "unknown"]}; // ??? + default {[_default, "unknown"]}; }; diff --git a/addons/common/functions/fnc_getLightProperties.sqf b/addons/common/functions/fnc_getLightProperties.sqf index 456084c3f9..bbaf955a8b 100644 --- a/addons/common/functions/fnc_getLightProperties.sqf +++ b/addons/common/functions/fnc_getLightProperties.sqf @@ -3,22 +3,26 @@ * Read properties of given vehicles light. * * Arguments: - * 0: Object with lights (Object) - * 1: Light classname (String) + * 0: Object with lights + * 1: Light classname * * Return Value: - * Stuff from config (Array) + * 0: Light intensity + * 1: Light position + * 2: Light direction + * 3: Light inner angle + * 4: Light outer angle * + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_vehicle,_light); +params ["_vehicle", "_light"]; + +private ["_config", "_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; -private "_config"; _config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light; -private ["_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; - _intensity = getNumber (_config >> "intensity"); _position = getText (_config >> "position"); _direction = getText (_config >> "direction"); @@ -26,35 +30,3 @@ _innerAngle = getNumber (_config >> "innerAngle"); _outerAngle = getNumber (_config >> "outerAngle"); [_intensity, _position, _direction, _innerAngle, _outerAngle] - -/* -class Reflectors -{ - class Light_1 - { - color[] = {1000,1000,1100}; - ambient[] = {10,10,11}; - intensity = 5; - size = 1; - innerAngle = 90; - outerAngle = 130; - coneFadeCoef = 2; - position = "Light_1_pos"; - direction = "Light_1_dir"; - hitpoint = "Light_1_hitpoint"; - selection = "Light_1_hide"; - useFlare = 1; - flareSize = 0.9; - flareMaxDistance = 85; - class Attenuation - { - start = 0; - constant = 0; - linear = 0; - quadratic = 0.9; - hardLimitStart = 40; - hardLimitEnd = 60; - }; - }; -}; -*/ diff --git a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf index 03c6753a76..01567fee58 100644 --- a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf +++ b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf @@ -1,23 +1,29 @@ /* * Author: commy2 - * Read properties of given flashlight. @todo, Can weapons themselves still have flashlights (no attachment)? + * Read properties of given flashlight. * * Arguments: - * 0: A flashlight (String) + * 0: Flashlight * * Return Value: - * Stuff from config (Array) + * 0: Light intensity + * 1: Light position + * 2: Light direction + * 3: Light inner angle + * 4: Light outer angle * + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_weapon); +params ["_weapon"]; + +// @todo: Can weapons themselves still have flashlights (no attachment)? + +private ["_config", "_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; -private "_config"; _config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; -private ["_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; - _intensity = getNumber (_config >> "intensity"); _position = getText (_config >> "position"); _direction = getText (_config >> "direction"); @@ -25,32 +31,3 @@ _innerAngle = getNumber (_config >> "innerAngle"); _outerAngle = getNumber (_config >> "outerAngle"); [_intensity, _position, _direction, _innerAngle, _outerAngle] - -/* -class FlashLight -{ - color[] = {180,156,120}; - ambient[] = {0.9,0.78,0.6}; - intensity = 20; - size = 1; - innerAngle = 20; - outerAngle = 80; - coneFadeCoef = 5; - position = "flash dir"; - direction = "flash"; - useFlare = 1; - flareSize = 1.4; - flareMaxDistance = "100.0f"; - dayLight = 0; - class Attenuation - { - start = 0.5; - constant = 0; - linear = 0; - quadratic = 1.1; - hardLimitStart = 20; - hardLimitEnd = 30; - }; - scale[] = {0}; -}; -*/ diff --git a/addons/common/functions/fnc_getName.sqf b/addons/common/functions/fnc_getName.sqf index 1da59534f0..a7facd2c6d 100644 --- a/addons/common/functions/fnc_getName.sqf +++ b/addons/common/functions/fnc_getName.sqf @@ -1,25 +1,21 @@ /* * Author: commy2 - * * Returns the name of the object. Used to prevent issues with the name command. * - * Argument: - * 0: Object (Object) - * 1: Show effective commander name? (Bool, optinal default: false) + * Arguments: + * 0: Object + * 1: Use effective commander name when used on vehicles (default: false) * - * Return value: - * The name. + * Return Value: + * Object Name + * + * Public: Yes */ #include "script_component.hpp" -private ["_name"]; - -PARAMS_2(_unit,_showEffective); - -if (isNil "_showEffective") then { - _showEffective = false; -}; +params ["_unit", ["_showEffective", false]]; +private "_name"; _name = ""; if (_unit isKindOf "CAManBase") then { diff --git a/addons/common/functions/fnc_getPitchBankYaw.sqf b/addons/common/functions/fnc_getPitchBankYaw.sqf index 2a9b0bacd1..74eac376fc 100644 --- a/addons/common/functions/fnc_getPitchBankYaw.sqf +++ b/addons/common/functions/fnc_getPitchBankYaw.sqf @@ -1,14 +1,19 @@ /* * Author: KoffeinFlummi - * - * Returns [pitch, bank, yaw] for given vehicle in degrees. + * Returns pitch, bank, yaw for given vehicle in degrees. * * Arguments: - * 0: Unit/Vehicle + * 0: Unit/Vehicle * * Return Value: - * [pitch, bank, yaw] + * 0: pitch + * 1: bank + * 2: yaw + * + * Public: Yes */ #include "script_component.hpp" -((_this select 0) call BIS_fnc_getPitchBank) + [getDir (_this select 0)] +private ["_vehicle"]; + +(_vehicle call BIS_fnc_getPitchBank) + [getDir _vehicle] diff --git a/addons/common/functions/fnc_getWindDirection.sqf b/addons/common/functions/fnc_getWindDirection.sqf index d93023bfe4..7341ea9c1d 100644 --- a/addons/common/functions/fnc_getWindDirection.sqf +++ b/addons/common/functions/fnc_getWindDirection.sqf @@ -1,31 +1,33 @@ /* * Author: commy2 - * * Get the compass direction the wind is blowing from. * - * Argument: - * None. + * Arguments: + * None * - * Return value: - * Wind direction. (String) + * Return Value: + * Wind cardinal direction + * + * Public: Yes */ #include "script_component.hpp" -switch (round (windDir / 360 * 16)) do { - case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))}; - case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))}; - case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))}; - case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))}; - case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))}; - case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))}; - case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))}; - case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))}; - case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))}; - case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))}; - case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))}; - case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))}; - case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))}; - case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))}; - case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))}; - default {localize QUOTE(DOUBLES(STR,GVAR(S)))}; -}; +localize ([ + LSTRING(S), + LSTRING(SSW), + LSTRING(SW), + LSTRING(WSW), + LSTRING(W), + LSTRING(WNW), + LSTRING(NW), + LSTRING(NNW), + LSTRING(N), + LSTRING(NNE), + LSTRING(NE), + LSTRING(ENE), + LSTRING(E), + LSTRING(ESE), + LSTRING(SE), + LSTRING(SSE), + LSTRING(S) +] select (round (windDir / 360 * 16))) // return diff --git a/addons/common/functions/fnc_getZoom.sqf b/addons/common/functions/fnc_getZoom.sqf index 1f319ac768..f4113198a7 100644 --- a/addons/common/functions/fnc_getZoom.sqf +++ b/addons/common/functions/fnc_getZoom.sqf @@ -1,14 +1,17 @@ /* * Author: commy2 - * * Returns a value depending on current zoom level. * - * Argument: - * None. + * Arguments: + * None * - * Return value: - * Zoom. (Number) + * Return Value: + * Zoom + * + * Public: Yes */ #include "script_component.hpp" -(0.5 - ((worldToScreen positionCameraToWorld [0,1,1]) select 1)) * (getResolution select 5) +if (!hasInterface) exitWith {0}; + +(0.5 - ((worldToScreen positionCameraToWorld [0, 1, 1]) select 1)) * (getResolution select 5) From d802cdfb23bff474fd3efa3d47e90e29be4e4c0f Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 01:41:17 +0200 Subject: [PATCH 145/311] more common code cleanup --- addons/common/functions/fnc_getItemType.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index 79abf41341..4d6ee932fa 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -33,7 +33,7 @@ if (isNumber (_config >> "ItemInfo" >> "type")) then { _default = ["item", "magazine"] select (_cfgType == "CfgMagazines"); switch (true) do { - case (_type == 0): {[_default,"unknown"]}; + case (_type == 0): {[_default, "unknown"]}; case (_type == 2^0): {["weapon", "primary"]}; case (_type == 2^1): {["weapon", "handgun"]}; case (_type == 2^2): {["weapon", "secondary"]}; From 9fa6eb0651df16d916c5f021f3fb97481149384e Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 13:08:10 +0200 Subject: [PATCH 146/311] more common code cleanup --- .../fnc_getFirstObjectIntersection.sqf | 34 +++++++----- .../fnc_getFirstTerrainIntersection.sqf | 30 ++++++----- .../functions/fnc_getNumberFromMissionSQM.sqf | 18 +++---- .../functions/fnc_getNumberMagazinesIn.sqf | 28 +++++----- .../common/functions/fnc_getPitchBankYaw.sqf | 2 +- .../common/functions/fnc_getSettingData.sqf | 29 +++++----- .../functions/fnc_getStringFromMissionSQM.sqf | 26 ++++++--- .../fnc_getTargetAzimuthAndInclination.sqf | 13 ++--- .../functions/fnc_getTargetDistance.sqf | 21 ++++---- .../common/functions/fnc_getTargetObject.sqf | 19 ++++--- .../functions/fnc_getTurnedOnLights.sqf | 14 ++--- .../functions/fnc_getUavControlPosition.sqf | 42 ++++++++------- .../common/functions/fnc_getVehicleCargo.sqf | 16 +++--- .../functions/fnc_getVehicleCodriver.sqf | 16 +++--- .../common/functions/fnc_getVehicleCrew.sqf | 41 +++++++------- addons/common/functions/fnc_getVersion.sqf | 20 ++++--- .../fnc_getWeaponAzimuthAndInclination.sqf | 17 +++--- .../common/functions/fnc_getWeaponIndex.sqf | 15 +++--- .../common/functions/fnc_getWeaponModes.sqf | 24 +++++---- .../common/functions/fnc_getWeaponMuzzles.sqf | 16 +++--- .../common/functions/fnc_getWeaponState.sqf | 54 +++++++------------ addons/common/functions/fnc_getWeaponType.sqf | 26 ++++----- 22 files changed, 279 insertions(+), 242 deletions(-) diff --git a/addons/common/functions/fnc_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf index 3a99f244ed..1111094ed0 100644 --- a/addons/common/functions/fnc_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -1,23 +1,31 @@ -/** - * fn_getFirstIntersection.sqf - * @Descr: Returns the the first intersection with an object between two positions - * @Author: Ruthberg +/* + * Author: Ruthberg + * Returns the the first intersection with terrain between two positions. @todo rewrite using lineIntersectsSurfaces? * - * @Arguments: [position PositionASL, position PositionASL, accuracy FLOAT] - * @Return: [intersects BOOL, intersection PositionASL] - * @PublicAPI: true + * Arguments: + * 0: PositionASL + * 1: PositionATL + * 2: Accuracy + * + * Return Value: + * 0: Intersects + * 1: Intersection Position ASL + * + * Public: Yes */ - #include "script_component.hpp" +#include "script_component.hpp" -private ["_distance", "_lower", "_upper", "_mid", "_intersections", "_result", "_dir"]; +params ["_source", "_destination", "_accuracy"]; -PARAMS_3(_source,_destination,_accuracy); +private ["_result", "_distance"]; _result = [false, [0, 0, 0]]; _distance = _source vectorDistance _destination; -if (count (lineIntersectsWith [_source, _destination]) > 0) then { +if !(lineIntersectsWith [_source, _destination] isEqualTo []) then { + private ["_lower", "_upper", "_mid", "_dir"]; + _lower = 0; _upper = 1; _mid = 0.5; @@ -27,9 +35,7 @@ if (count (lineIntersectsWith [_source, _destination]) > 0) then { while {(_upper - _lower) * _distance > _accuracy} do { _mid = _lower + (_upper - _lower) / 2; - _intersections = count (lineIntersectsWith [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]); - - if (_intersections > 0) then { + if !(lineIntersectsWith [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))] isEqualTo []) then { _upper = _mid; } else { _lower = _mid; diff --git a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf index 2fe8242c15..a5065413d9 100644 --- a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -1,23 +1,31 @@ -/** - * fn_getFirstIntersection.sqf - * @Descr: Returns the the first intersection with an object between two positions - * @Author: Ruthberg +/* + * Author: Ruthberg + * Returns the the first intersection with an object between two positions. @todo rewrite using lineIntersectsSurfaces? * - * @Arguments: [position PositionASL, position PositionASL, accuracy FLOAT] - * @Return: [intersects BOOL, intersection PositionASL] - * @PublicAPI: true + * Arguments: + * 0: PositionASL + * 1: PositionATL + * 2: Accuracy + * + * Return Value: + * 0: Intersects + * 1: Intersection Position ASL + * + * Public: Yes */ #include "script_component.hpp" -private ["_distance", "_lower", "_upper", "_mid", "_intersection", "_result", "_dir"]; +params ["_source", "_destination", "_accuracy"]; -PARAMS_3(_source,_destination,_accuracy); +private ["_result", "_distance"]; _result = [false, [0, 0, 0]]; _distance = _source vectorDistance _destination; if (terrainIntersectASL [_source, _destination]) then { + private ["_lower", "_upper", "_mid", "_dir"]; + _lower = 0; _upper = 1; _mid = 0.5; @@ -27,9 +35,7 @@ if (terrainIntersectASL [_source, _destination]) then { while {(_upper - _lower) * _distance > _accuracy} do { _mid = _lower + (_upper - _lower) / 2; - _intersection = terrainIntersectASL [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; - - if (_intersection) then { + if (terrainIntersectASL [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]) then { _upper = _mid; } else { _lower = _mid; diff --git a/addons/common/functions/fnc_getNumberFromMissionSQM.sqf b/addons/common/functions/fnc_getNumberFromMissionSQM.sqf index 1c9fbda77d..6c381d4f54 100644 --- a/addons/common/functions/fnc_getNumberFromMissionSQM.sqf +++ b/addons/common/functions/fnc_getNumberFromMissionSQM.sqf @@ -1,18 +1,16 @@ /* * Author: commy2 - * * Get a number from the mission.sqm file. Mission has to be saved in the Editor. + * On non-existing entries, it might return 0 or the value of an entry with the same name of another calss. * - * Argument: - * 0: Path of the entry in the mission.sqm (Array) + * Arguments: + * 0: Path of the entry in the mission.sqm * - * Return value: - * Value of the entry. Note: If the entry does not exist, it might return 0 or an entry with the same name of another class! (Number) + * Return Value: + * Entry value + * + * Public: No */ #include "script_component.hpp" -private "_number"; - -_number = _this call FUNC(getStringFromMissionSQM); - -parseNumber _number; +parseNumber (_this call FUNC(getStringFromMissionSQM)) // return diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index 91921abd77..df1f7ed64b 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -1,26 +1,30 @@ -/** - * fn_getNumberMagazinesIn.sqf - * @Descr: - * @Author: Glowbal +/* + * Author: Glowbal + * Count magazines of unit. * - * @Arguments: [] - * @Return: - * @PublicAPI: true + * Arguments: + * 0: Unit + * 1: Magazine + * + * Return Value: + * Magazine amount + * + * Public: No */ - #include "script_component.hpp" -PARAMS_2(_unit,_magazine); - -private ["_return"]; +params ["_unit", "_magazine"]; +private "_return"; _return = 0; + if (_unit isKindOf "CAManBase") then { _return = {_x == _magazine} count magazines _unit; } else { { _return = _return + {_x == _magazine} count magazines _x; - } forEach (crew _unit); + false + } count crew _unit; _return = _return + ({_x == _magazine} count getMagazineCargo _unit); }; diff --git a/addons/common/functions/fnc_getPitchBankYaw.sqf b/addons/common/functions/fnc_getPitchBankYaw.sqf index 74eac376fc..89fab8d92b 100644 --- a/addons/common/functions/fnc_getPitchBankYaw.sqf +++ b/addons/common/functions/fnc_getPitchBankYaw.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -private ["_vehicle"]; +params ["_vehicle"]; (_vehicle call BIS_fnc_getPitchBank) + [getDir _vehicle] diff --git a/addons/common/functions/fnc_getSettingData.sqf b/addons/common/functions/fnc_getSettingData.sqf index 40ed962a7a..de9ef40447 100644 --- a/addons/common/functions/fnc_getSettingData.sqf +++ b/addons/common/functions/fnc_getSettingData.sqf @@ -3,29 +3,32 @@ * Returns the metadata of a setting if it exists * * Arguments: - * 0: Name of the setting (String) + * 0: Setting Name * * Return Value: * Setting Data (Array) - * 0: _name - * 1: _typeName - * 2: _isClientSetable - * 3: _localizedName - * 4: _localizedDescription - * 5: _possibleValues - * 6: _isForced - * 7: _defaultValue + * 0: Name + * 1: Type Name + * 2: Is Client Settable + * 3: Localized Name + * 4: Localized Description + * 5: Possible Values + * 6: Is Forced + * 7: Default Value + * 8: Localized Category * * Public: No */ #include "script_component.hpp" -PARAMS_1(_name); +params ["_name"]; -private ["_value"]; +private "_value"; _value = []; + { - if ((_x select 0) == _name) exitWith {_value = _x}; -} forEach GVAR(settings); + if (_x select 0 == _name) exitWith {_value = _x}; + false +} count GVAR(settings); _value diff --git a/addons/common/functions/fnc_getStringFromMissionSQM.sqf b/addons/common/functions/fnc_getStringFromMissionSQM.sqf index cfb7495467..6b6a34cfb7 100644 --- a/addons/common/functions/fnc_getStringFromMissionSQM.sqf +++ b/addons/common/functions/fnc_getStringFromMissionSQM.sqf @@ -1,28 +1,34 @@ /* * Author: commy2 + * Get a string from the mission.sqm file. Mission has to be saved in the Editor. + * The string cannot contain the ; character. + * If the entry does not exist, it might return an empty string or an entry with the same name of another class! * - * Get a string from the mission.sqm file. Mission has to be saved in the Editor. The string cannot contain the ; character. + * Arguments: + * 0: Path of the entry in the mission.sqm * - * Argument: - * 0: Path of the entry in the mission.sqm (Array) + * Return Value: + * Value of the entry. * - * Return value: - * Value of the entry. Note: If the entry does not exist, it might return an empty string or an entry with the same name of another class! (String) + * Public: No */ #include "script_component.hpp" -private ["_path", "_mission", "_a", "_class", "_index", "_array", "_b", "_entry"]; +private ["_path", "_mission", "_class", "_index", "_array", "_entry"]; _path = _this; if (missionName == "") exitWith {""}; + _mission = toArray toLower loadFile "mission.sqm"; _mission resize 65536; + { if (_x < 33) then { _mission set [_forEachIndex, -1]; } } forEach _mission; + _mission = toString (_mission - [-1]); {_path set [_forEachIndex, toLower _x]} forEach _path; @@ -33,9 +39,11 @@ for "_a" from 0 to (count _path - 2) do { _index = _mission find _class; _array = toArray _mission; + for "_b" from 0 to (_index + count toArray _class - 1) do { _array set [_b, -1]; }; + _array = _array - [-1]; _mission = toString _array; @@ -43,16 +51,20 @@ for "_a" from 0 to (count _path - 2) do { _entry = format ["%1=", _path select (count _path - 1)]; _index = _mission find _entry; + if (_index == -1) exitWith {""}; _array = toArray _mission; + for "_b" from 0 to (_index + count toArray _entry - 1) do { _array set [_b, -1]; }; + _mission = toString (_array - [-1]); _index = _mission find ";"; _mission = toArray _mission; _mission resize _index; -format ["%1", toString _mission]; + +format ["%1", toString _mission] // return diff --git a/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf index 396a3ec85e..da23e600aa 100644 --- a/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf @@ -1,14 +1,15 @@ /* * Author: commy2 + * Get players viewing direction and slope. * - * Get players viewing direction and slope + * Arguments: + * None * - * Argument: - * None. + * Return Value: + * 0: Azimuth + * 1: Inclination * - * Return value: - * 0: Azimuth (Number) - * 1: Inclination or 'slope' (Number) + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getTargetDistance.sqf b/addons/common/functions/fnc_getTargetDistance.sqf index ac3c444a73..fe75268cea 100644 --- a/addons/common/functions/fnc_getTargetDistance.sqf +++ b/addons/common/functions/fnc_getTargetDistance.sqf @@ -1,21 +1,22 @@ /* * Author: commy2 - * * Get the distance to the next object the player is looking at. Used for laser distance measurements. * - * Argument: - * 0: How accurate will the measurement be? In meters. (Number) - * 1: Maximal distance to measure. (Number) - * 2: Minimal distance to measure. (optional, Number) + * Arguments: + * 0: Messurement Accuracy + * 1: Maximal messure distance + * 2: Minimal messure distance (default: nil) * - * Return value: - * Measured distance in meters. Can return maximal or minimal distance (Number) + * Return Value: + * Distance in meters + * + * Public: Yes */ #include "script_component.hpp" -private ["_position", "_laser", "_line", "_distance", "_iteration"]; +params ["_interval", "_maxDistance", "_minDistance"]; -PARAMS_3(_interval,_maxDistance,_minDistance); +private ["_position", "_laser", "_line", "_distance", "_iteration"]; _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; @@ -42,6 +43,6 @@ _distance = _interval * round (_distance / _interval); _distance = _distance min _maxDistance; -if !(isNil "_minDistance") then {_distance = _distance max _minDistance}; +if (!isNil "_minDistance") then {_distance = _distance max _minDistance}; _distance diff --git a/addons/common/functions/fnc_getTargetObject.sqf b/addons/common/functions/fnc_getTargetObject.sqf index 6e3db94763..adaaa3e344 100644 --- a/addons/common/functions/fnc_getTargetObject.sqf +++ b/addons/common/functions/fnc_getTargetObject.sqf @@ -1,19 +1,20 @@ /* * Author: commy2 - * * Get the nearest object the player is looking at. Used for laser designator instead of cursorTarget. * - * Argument: - * 0: Maximal distance to search. (Number) + * Arguments: + * 0: Maximum search distance * - * Return value: - * Nearest object directly in line of sight, if none objNull (Object) + * Return Value: + * Nearest object in line of sight, objNull if none are found + * + * Public: Yes */ #include "script_component.hpp" -private ["_position", "_laser", "_intersects"]; +params ["_maxDistance"]; -PARAMS_1(_maxDistance); +private ["_position", "_laser", "_intersects"]; _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; @@ -23,4 +24,6 @@ _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; _intersects = lineIntersectsObjs [_position, _laser, objNull, objNull, true, 2]; -if (count _intersects == 0) then {objNull} else {_intersects select 0} +if (_intersects isEqualTo []) exitWith {objNull}; + +_intersects select 0 // return diff --git a/addons/common/functions/fnc_getTurnedOnLights.sqf b/addons/common/functions/fnc_getTurnedOnLights.sqf index b0eb201bca..0d71a3362e 100644 --- a/addons/common/functions/fnc_getTurnedOnLights.sqf +++ b/addons/common/functions/fnc_getTurnedOnLights.sqf @@ -1,21 +1,22 @@ /* * Author: commy2 - * * Returns all turned on lights of any vehicle or streetlamp. * * Arguments: - * 0: A vehicle, not the classname (Object) + * 0: Vehicle * * Return Value: - * All burning lights (Array) + * All burning lights + * + * Public: Yes */ #include "script_component.hpp" -PARAMS_1(_vehicle); +params ["_vehicle"]; if (!isLightOn _vehicle) exitWith {[]}; -private ["_reflectorsWithSelections", "_lights", "_hitpoints"]; +private ["_reflectorsWithSelections", "_lights", "_hitpoints", "_turnedOnLights"]; _reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getReflectorsWithSelections)), typeOf _vehicle], 1E11] call FUNC(cachedCall); //_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections); @@ -23,13 +24,12 @@ _reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNa _lights = _reflectorsWithSelections select 0; _hitpoints = _reflectorsWithSelections select 1; -private "_turnedOnLights"; _turnedOnLights = []; + { if (_vehicle getHit _x <= 0.9) then { _turnedOnLights pushBack (_lights select _forEachIndex); }; - } forEach _hitpoints; _turnedOnLights diff --git a/addons/common/functions/fnc_getUavControlPosition.sqf b/addons/common/functions/fnc_getUavControlPosition.sqf index ad2487c9c1..a9b5340eb2 100644 --- a/addons/common/functions/fnc_getUavControlPosition.sqf +++ b/addons/common/functions/fnc_getUavControlPosition.sqf @@ -1,32 +1,34 @@ /* -Name: FUNC(getUavControlPosition) - -Author: Pabst Mirror - -Description: - Gets the seat position of a UAV that the unit is activly controlling. - "" - not connected to anything or not activly controling - "DRIVER" - "GUNNER" - -Parameters: - 0: OBJECT - Unit - -Returns: - STRING - Position in the UAV that is currently being controled by the unit. - -Example: - [ACE_Player] call FUNC(getUavControlPosition) -*/ + * Author: PabstMirror + * Returns the seat position of a UAV that the unit is activly controling. + * + * Arguments: + * 0: Unit + * + * Return Value: + * Position + * "" = not connected to anything or activly controling + * "DRIVER" + * "GUNNER" + * + * Example: + * [ACE_Player] call ace_common_fnc_getUavControlPosition + * + * Public: Yes + */ #include "script_component.hpp" +params ["_unit"]; + private ["_uav", "_positionArray", "_playerIndex"]; -PARAMS_1(_unit); _uav = getConnectedUAV _unit; + if (isNull _uav) exitWith {""}; + _positionArray = UAVControl _uav; _playerIndex = _positionArray find _unit; + if (_playerIndex == -1) exitWith {""}; _positionArray select (_playerIndex + 1) diff --git a/addons/common/functions/fnc_getVehicleCargo.sqf b/addons/common/functions/fnc_getVehicleCargo.sqf index 4b8ca63f5c..5be213aa68 100644 --- a/addons/common/functions/fnc_getVehicleCargo.sqf +++ b/addons/common/functions/fnc_getVehicleCargo.sqf @@ -1,19 +1,20 @@ /* * Author: commy2 - * * Get the vehicle cargo positions. Codrivers and ffv positions are not listed. * - * Argument: - * 0: Vehicle type (String) + * Arguments: + * 0: Vehicle type * - * Return value: - * Vehicle cargo positions. (Array) + * Return Value: + * Vehicle cargo positions + * + * Public: Yes */ #include "script_component.hpp" -private ["_config", "_cargo", "_codrivers", "_index"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_config", "_cargo", "_codrivers"]; _config = configFile >> "CfgVehicles" >> _vehicle; @@ -25,4 +26,5 @@ for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { _cargo pushBack _index; }; }; + _cargo diff --git a/addons/common/functions/fnc_getVehicleCodriver.sqf b/addons/common/functions/fnc_getVehicleCodriver.sqf index 019c7b9971..e23cfcd0d4 100644 --- a/addons/common/functions/fnc_getVehicleCodriver.sqf +++ b/addons/common/functions/fnc_getVehicleCodriver.sqf @@ -1,19 +1,20 @@ /* * Author: commy2 - * * Get the vehicle codriver positions. * - * Argument: - * 0: Vehicle type (String) + * Arguments: + * 0: Vehicle type * - * Return value: - * Vehicle codriver positions. (Array) + * Return Value: + * Vehicle codriver positions + * + * Public: Yes */ #include "script_component.hpp" -private ["_config", "_cargo", "_codrivers", "_index"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_config", "_cargo", "_codrivers"]; _config = configFile >> "CfgVehicles" >> _vehicle; @@ -25,4 +26,5 @@ for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { _cargo pushBack _index; }; }; + _cargo diff --git a/addons/common/functions/fnc_getVehicleCrew.sqf b/addons/common/functions/fnc_getVehicleCrew.sqf index 23957c31fd..58d0067b85 100644 --- a/addons/common/functions/fnc_getVehicleCrew.sqf +++ b/addons/common/functions/fnc_getVehicleCrew.sqf @@ -1,36 +1,37 @@ /* * Author: commy2 - * * Returns array of crew member objects. * - * Argument: - * 0: Vehicle (Object) - * 1: Slot types. Can contain "driver", "commander", "gunner", "turret", "cargo" and "ffv". Case sensitive (Array) + * Arguments: + * 0: Vehicle + * 1: Slot types filter (default: ["driver", "commander", "gunner", "turret", "cargo", "ffv"]) * - * Return value: - * Crew (Array) + * Return Value: + * Crew + * + * Public: Yes */ #include "script_component.hpp" -private ["_crew"]; - -PARAMS_2(_vehicle,_types); +params ["_vehicle", ["_types", ["driver", "commander", "gunner", "turret", "cargo", "ffv"]]]; +private "_crew"; _crew = []; // iterate through all crew members { - // this unit is in a ffv position. check if we search for ffv. - if (_x select 4) then { - if ("ffv" in _types) then { - _crew pushBack (_x select 0); + // this unit is in a ffv position. check if we search for ffv. + if (_x select 4) then { + if ("ffv" in _types) then { + _crew pushBack (_x select 0); + }; + } else { + // otherwise check if we search for that type. toLower, because fullCrew returns "driver" vs. "Turret". + if (toLower (_x select 1) in _types) then { + _crew pushBack (_x select 0); + }; }; - } else { - // otherwise check if we search for that type. toLower, because fullCrew returns "driver" vs. "Turret". - if (toLower (_x select 1) in _types) then { - _crew pushBack (_x select 0); - }; - }; -} forEach fullCrew _vehicle; + false +} count fullCrew _vehicle; _crew diff --git a/addons/common/functions/fnc_getVersion.sqf b/addons/common/functions/fnc_getVersion.sqf index e1bd95cdab..24773240b7 100644 --- a/addons/common/functions/fnc_getVersion.sqf +++ b/addons/common/functions/fnc_getVersion.sqf @@ -1,11 +1,15 @@ -/** - * fn_getVersion.sqf - * @Descr: Get the version number of the current ACE Build - * @Author: Glowbal +/* + * Author: Glowbal + * Get the version number of the current ACE build. * - * @Arguments: [] - * @Return: STRING String containing the version - * @PublicAPI: true + * Arguments: + * None + * + * Return Value: + * ACE Version + * + * Public: Yes */ #include "script_component.hpp" -getText (configFile >> "cfgPatches" >> "ACE_main" >> "version"); \ No newline at end of file + +getText (configFile >> "CfgPatches" >> "ACE_main" >> "version") // return diff --git a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf index 03b7b1c707..09968d8e39 100644 --- a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf @@ -1,20 +1,21 @@ /* * Author: commy2 + * Get local players weapon direction and slope. * - * Get players weapon direction and slope + * Arguments: + * 0: Weapon name * - * Argument: - * 0: Weapon name (String) + * Return Value: + * 0: Azimuth + * 1: Inclination * - * Return value: - * 0: Azimuth (Number) - * 1: Inclination or 'slope' (Number) + * Public: Yes */ #include "script_component.hpp" -private ["_direction", "_azimuth", "_inclination"]; +params ["_weapon"]; -PARAMS_1(_weapon); +private ["_direction", "_azimuth", "_inclination"]; _direction = ACE_player weaponDirection _weapon; diff --git a/addons/common/functions/fnc_getWeaponIndex.sqf b/addons/common/functions/fnc_getWeaponIndex.sqf index b11054a5e7..0e24f190a5 100644 --- a/addons/common/functions/fnc_getWeaponIndex.sqf +++ b/addons/common/functions/fnc_getWeaponIndex.sqf @@ -1,20 +1,23 @@ /* * Author: commy2 * Get the index of the weapon. - * 0 = primary, 1 = secondary, 2 = handgun, -1 = other * - * Argument: + * Arguments: * 0: Unit * 1: Weapon * - * Return value: + * Return Value: * Weapon index + * 0 = primary + * 1 = secondary + * 2 = handgun + * -1 = other * - * Public: No + * Public: Yes */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; if (_weapon == "") exitWith {-1}; @@ -22,4 +25,4 @@ if (_weapon == "") exitWith {-1}; primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit -] find _weapon +] find _weapon // return diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index 83e7b7559f..a2bb9c3205 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -1,30 +1,34 @@ /* * Author: commy2 + * Get the available firing modes of a weapon. Will ignore the AI helper modes. * - * Get the available firing modes of a weapon. Will ignore the ai helper modes. + * Arguments: + * 0: Weapon * - * Argument: - * 0: A weapon in cfgWeapons (String) + * Return Value: + * Firing Modes * - * Return value: - * All firing modes (Array) + * Public: Yes */ #include "script_component.hpp" -private ["_modes"]; +params ["_weapon"]; -PARAMS_1(_weapon); +private ["_config", "_modes"]; + +_config = configFile >> "CfgWeapons" >> _weapon; _modes = []; + { - if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { + if (getNumber (_config >> _x >> "showToPlayer") == 1) then { _modes pushBack _x; }; if (_x == "this") then { _modes pushBack _weapon; }; - -} forEach getArray (configfile >> "CfgWeapons" >> _weapon >> "modes"); + false +} count getArray (_config >> "modes"); _modes diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index b0b7173d2f..cdfd58f238 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -1,20 +1,20 @@ /* * Author: commy2 - * * Get the muzzles of a weapon. * - * Argument: - * 0: A weapon in cfgWeapons (String) + * Arguments: + * 0: Weapon * - * Return value: - * All weapon muzzles (Array) + * Return Value: + * All weapon muzzles + * + * Public: Yes */ #include "script_component.hpp" -private ["_muzzles"]; - -PARAMS_1(_weapon); +params ["_weapon"]; +private "_muzzles"; _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); if ("this" in _muzzles) then { diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf index 543f356b7e..8ee1610f4e 100644 --- a/addons/common/functions/fnc_getWeaponState.sqf +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -1,46 +1,28 @@ /* * Author: commy2 - * * Return current state of the weapon. Attachments and magazines with ammo. * - * Argument: - * 0: A unit (Object) - * 1: A weapon (String) + * Arguments: + * 0: unit + * 1: weapon * - * Return value: - * Weapon info, format: [attachments, muzzles, magazines, ammo] (Array) + * Return Value: + * 0: Attachements + * 1: Muzzles + * 2: Magazines + * 3: Ammo + * + * Public: Yes */ - #include "script_component.hpp" +#include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; + +private ["_muzzles", "_weaponInfo"]; -private "_muzzles"; _muzzles = [_weapon] call FUNC(getWeaponMuzzles); -private "_weaponInfo"; -_weaponInfo = []; - -switch (_weapon) do { - case (primaryWeapon _unit): { - _weaponInfo pushBack primaryWeaponItems _unit; - - }; - - case (secondaryWeapon _unit): { - _weaponInfo pushBack secondaryWeaponItems _unit; - - }; - - case (handgunWeapon _unit): { - _weaponInfo pushBack handgunItems _unit; - - }; - - default { - _weaponInfo pushBack ["","","",""]; - - }; -}; +_weaponInfo = [["","","",""], primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit] select ((["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit] find _weapon) max 0); // get loaded magazines and ammo private ["_magazines", "_ammo"]; @@ -51,7 +33,8 @@ _ammo = []; { _magazines pushBack ""; _ammo pushBack 0; -} forEach _muzzles; + false +} count _muzzles; { if (_x select 2) then { @@ -63,7 +46,8 @@ _ammo = []; _ammo set [_index, _x select 1]; }; }; -} forEach magazinesAmmoFull _unit; + false +} count magazinesAmmoFull _unit; _weaponInfo append [_muzzles, _magazines, _ammo]; diff --git a/addons/common/functions/fnc_getWeaponType.sqf b/addons/common/functions/fnc_getWeaponType.sqf index c153bb2b3c..f8ee7f9fe4 100644 --- a/addons/common/functions/fnc_getWeaponType.sqf +++ b/addons/common/functions/fnc_getWeaponType.sqf @@ -1,19 +1,24 @@ /* * Author: commy2 + * Check what kind of weapon the given class name is. * - * Check what kind of weapon the given class name is. (primary, secondary or handgun) + * Arguments: + * 0: Weapons * - * Argument: - * 0: Class name of the weapon (String) + * Return Value: + * Slot index + * 1 = primary + * 2 = secondary + * 3 = handgun + * -1 = other * - * Return value: - * Slot index of the given class name, 1: primary, 2: secondary, 3: handgun, else: -1 (Number) + * Public: Yes */ #include "script_component.hpp" -private ["_type", "_index"]; +params ["_weapon"]; -PARAMS_1(_weapon); +private ["_type", "_index"]; _type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber); @@ -23,9 +28,4 @@ while {!(_type select _index) && {_index < 16}} do { _index = _index + 1; }; -switch (_index) do { - case 0 : {1}; - case 1 : {3}; - case 2 : {2}; - default {-1}; -} +[-1, 1, 3, 2] select (([0, 1, 2] find _index) + 1) // return From b0f9eab1f7a94f1378a450e588800d741ffe783f Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 13:53:12 +0200 Subject: [PATCH 147/311] more common code cleanup --- .../common/functions/fnc_getMapGridData.sqf | 28 +++++--- .../functions/fnc_getMapPosFromGrid.sqf | 19 +++--- addons/common/functions/fnc_getMarkerType.sqf | 68 ++++++++++--------- .../fnc_getReflectorsWithSelections.sqf | 11 +-- 4 files changed, 71 insertions(+), 55 deletions(-) diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index 838b753e91..c74f378d75 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -1,12 +1,13 @@ /* - * Author: PabstMirror (ideas from Nou's mapGridToPos and BIS_fnc_gridToPos) + * Author: PabstMirror * Finds real x/y offset and map step for a 10 digit grid * Save time by preparing data one time at startup + * Ideas from Nou's mapGridToPos and BIS_fnc_gridToPos * - * Argument: + * Arguments: * None * - * Return values: + * Return Value: * None * * Example: @@ -16,10 +17,10 @@ */ #include "script_component.hpp" -private["_cfgGrid", "_formatX", "_formatY", "_heightOffset", "_offsetX", "_offsetY", "_originGrid", "_realOffsetY", "_startGrid", "_stepX", "_stepY", "_zoom", "_zoomMax", "_letterGrid"]; - GVAR(mapGridData) = []; +private ["_cfgGrid", "_offsetX", "_offsetY", "_zoomMax", "_formatX", "_formatY", "_stepX", "_stepY", "_zoom", "_letterGrid", "_heightOffset", "_startGrid", "_originGrid", "_realOffsetY"]; + //--- Extract grid values from world config (Borrowed from BIS_fnc_gridToPos) _cfgGrid = configFile >> "CfgWorlds" >> worldName >> "Grid"; _offsetX = getNumber (_cfgGrid >> "offsetX"); @@ -29,6 +30,7 @@ _formatX = ""; _formatY = ""; _stepX = 1e10; _stepY = 1e10; + { _zoom = getnumber (_x >> "zoomMax"); if (_zoom < _zoomMax) then { @@ -38,11 +40,14 @@ _stepY = 1e10; _stepX = getNumber (_x >> "stepX"); _stepY = getNumber (_x >> "stepY"); }; -} foreach configProperties [_cfgGrid, "isClass _x", false]; + false +} count configProperties [_cfgGrid, "isClass _x", false]; _letterGrid = false; -if (((toLower _formatX) find "a") != -1) then {_letterGrid = true}; -if (((toLower _formatY) find "a") != -1) then {_letterGrid = true}; + +if (toLower _formatX find "a" != -1) then {_letterGrid = true}; +if (toLower _formatY find "a" != -1) then {_letterGrid = true}; + if (_letterGrid) exitWith { ACE_LOGWARNING_3("Map Grid Warning (%1) - Map uses letter grids [%2, %3]",worldName,_formatX,_formatY); }; @@ -51,13 +56,14 @@ if (_letterGrid) exitWith { _heightOffset = 500; _startGrid = mapGridPosition [0, _heightOffset]; _originGrid = _startGrid; + while {_startGrid == _originGrid} do { _heightOffset = _heightOffset + 1; _originGrid = mapGridPosition [0, _heightOffset]; }; //Calculate the real y offset -_realOffsetY = parseNumber (_originGrid select [(count _formatX), (count _formatY)]) * _stepY + _heightOffset - 1; +_realOffsetY = (parseNumber (_originGrid select [count _formatX, count _formatY])) * _stepY + _heightOffset - 1; //Calculate MGRS 10digit step - they should both be 1 meter: _stepXat5 = _stepX * 10 ^ ((count _formatX) - 5); @@ -66,10 +72,12 @@ _stepYat5 = -1 * _stepY * 10 ^ ((count _formatY) - 5); if (_stepYat5 < 0) then { ACE_LOGWARNING_1("Map Grid Warning (%1) - Northing is reversed.",worldName); }; + if (_stepXat5 != 1) then { ACE_LOGWARNING_2("Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for x.",worldName,_stepXat5); }; -if ((_stepYat5 != 1) && {_stepYat5 != -1}) then { + +if (_stepYat5 != 1 && {_stepYat5 != -1}) then { ACE_LOGWARNING_2("Map Grid Warning (%1) - MGRS 10 digit grid does not equal 1 meter: (%2) for y.",worldName,_stepXat5); }; diff --git a/addons/common/functions/fnc_getMapPosFromGrid.sqf b/addons/common/functions/fnc_getMapPosFromGrid.sqf index 20194df88a..5ba67a40bf 100644 --- a/addons/common/functions/fnc_getMapPosFromGrid.sqf +++ b/addons/common/functions/fnc_getMapPosFromGrid.sqf @@ -2,9 +2,9 @@ * Author: PabstMirror * Gets position from grid cords * - * Argument: + * Arguments: * 0: Grid Cords - * 1: Get Center or bottom right + * 1: Grid center (true), Grid Bottom Right (false) (default: true) * * Return values: * Position @@ -16,24 +16,23 @@ */ #include "script_component.hpp" -PARAMS_1(_inputString); -DEFAULT_PARAM(1,_getCenterOfGrid,true); +params ["_inputString", ["_getCenterOfGrid", true]]; -private["_countInput", "_countInputHalf", "_xPart", "_xPos", "_yPart", "_yPos"]; - -if ((count GVAR(mapGridData)) == 0) exitWith { +if (count GVAR(mapGridData) == 0) exitWith { ERROR("Map has bad data, falling back to BIS_fnc_gridToPos"); (_this call BIS_fnc_gridToPos) select 0 }; -EXPLODE_4_PVT(GVAR(mapGridData),_offsetX,_realOffsetY,_stepXat5,_stepYat5); +GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"]; + +private ["_countInput", "_countInputHalf", "_xPart", "_yPart", "_xPos", "_yPos"]; _countInput = count _inputString; _countInputHalf = floor (_countInput / 2); //Split string, ignoring middle _xPart = _inputString select [0, _countInputHalf]; -_yPart = _inputString select [(ceil (_countInput / 2)), _countInputHalf]; +_yPart = _inputString select [ceil (_countInput / 2), _countInputHalf]; _xPos = ((parseNumber _xPart) * _stepXat5 * 10 ^ (5 - _countInputHalf)) + _offsetX; _yPos = ((parseNumber _yPart) * _stepYat5 * 10 ^ (5 - _countInputHalf)) + _realOffsetY; @@ -43,4 +42,4 @@ if (_getCenterOfGrid) then { _yPos = _yPos + 0.5 * _stepYat5 * 10 ^ (5 - _countInputHalf); }; -[_xPos, _yPos, 0]; +[_xPos, _yPos, 0] diff --git a/addons/common/functions/fnc_getMarkerType.sqf b/addons/common/functions/fnc_getMarkerType.sqf index bba8c15199..7c99302d8f 100644 --- a/addons/common/functions/fnc_getMarkerType.sqf +++ b/addons/common/functions/fnc_getMarkerType.sqf @@ -1,19 +1,20 @@ /* * Author: KoffeinFlummi - * * Get the apropriate marker for a group. * * Arguments: * 0: Group * * Return Value: - * Marker Type (string) + * Marker Type + * + * Public: No */ #include "script_component.hpp" -private ["_leader","_vehicle","_side"]; +params ["_group"]; -PARAMS_1(_group); +private ["_leader", "_vehicle", "_side"]; _leader = leader _group; _vehicle = vehicle _leader; @@ -21,56 +22,61 @@ _side = side _leader; if (_vehicle == _leader) exitWith { if ( - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or - (getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver") - ) then { - ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + getNumber (configFile >> "CfgVehicles" >> typeOf _leader >> "detectSkill") > 20 || + getNumber (configFile >> "CfgVehicles" >> typeOf _leader >> "camouflage") < 1 || + getText (configFile >> "CfgVehicles" >> typeOf _leader >> "textsingular") == "diver" + ) then { + ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) } else { - ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; }; -if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attendant") == 1) exitWith { - ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +if (getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1) exitWith { + ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; + if ( - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportRepair") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportFuel") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportAmmo") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_canRepair") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_fuelCapacityCargo") > 0) - ) exitWith { - ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "transportRepair") > 0 || + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "transportFuel") > 0 || + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "transportAmmo") > 0 || + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "ACE_canRepair") > 0 || + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "ACE_fuelCapacityCargo") > 0 +) exitWith { + ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; if (_vehicle isKindOf "Plane") exitWith { - ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; + if (_vehicle isKindOf "Air") exitWith { - ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; if (_vehicle isKindOf "StaticMortar") exitWith { - ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; -if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "artilleryScanner") == 1) exitWith { - ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + +if (getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "artilleryScanner") == 1) exitWith { + ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; if (_vehicle isKindOf "Car") exitWith { - ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; -if ((_vehicle isKindOf "Tank") and (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportSoldier") > 0)) exitWith { - ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; + if (_vehicle isKindOf "Tank") exitWith { - ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + if (getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "transportSoldier") > 0) then { + ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) + } else { + ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) + }; }; if (_vehicle isKindOf "Ship") exitWith { - ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) }; // generic marker -["n_unknown", "b_unknown", "o_unknown"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +["n_unknown", "b_unknown", "o_unknown"] select ((["GUER", "WEST", "EAST"] find str _side) max 0) diff --git a/addons/common/functions/fnc_getReflectorsWithSelections.sqf b/addons/common/functions/fnc_getReflectorsWithSelections.sqf index d50269ade8..ef2b908bde 100644 --- a/addons/common/functions/fnc_getReflectorsWithSelections.sqf +++ b/addons/common/functions/fnc_getReflectorsWithSelections.sqf @@ -6,16 +6,19 @@ * They behave like having an armor value of 0. * * Arguments: - * 0: A vehicle, not the classname (Object) + * 0: Vehicle * * Return Value: - * The light names and selections (Array) + * 0: Light Hitpoints + * 1: Selections + * + * Public: Yes */ #include "script_component.hpp" -private ["_config", "_hitpoints", "_selections", "_i"]; +params ["_vehicle"]; -PARAMS_1(_vehicle); +private ["_config", "_hitpoints", "_selections"]; _config = configFile >> "CfgVehicles" >> typeOf _vehicle; From df3211cc429c6433fcca867772c05e5ba193f4c5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 14:20:53 +0200 Subject: [PATCH 148/311] more common code cleanup --- addons/common/functions/fnc_getHitPoints.sqf | 11 +- .../fnc_getHitPointsWithSelections.sqf | 14 ++- addons/common/functions/fnc_getMGRSdata.sqf | 118 +++++++++--------- .../functions/fnc_getMapGridFromPos.sqf | 33 ++--- 4 files changed, 94 insertions(+), 82 deletions(-) diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 491f243b44..8b2f10728c 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -1,13 +1,16 @@ /* * Author: commy2 - * - * Returns all hitpoints of any vehicle. Might contain duplicates if the turrets contain non unique hitpoints with different selection names. + * Returns all hitpoints and their selections of any vehicle. Might contain duplicates if the turrets contain non unique hitpoints with different selection names. * * Arguments: - * 0: A vehicle, not the classname (Object) + * 0: Vehicle * * Return Value: - * The hitpoints (Array) + * Hitpoints + * + * Public: Yes + * + * Deprecated */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index bc3799665e..7b027d9efa 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -1,13 +1,17 @@ /* * Author: commy2 - * - * Returns all hitpoints and their selections of any vehicle. Might contain duplicates if the turrets contain non unique hitpoints with different selection names. + * Returns all hitpoints and their respective selections of any vehicle. Might contain duplicates for non unique hitpoints in turrets. * * Arguments: - * 0: A vehicle, not the classname (Object) + * 0: Vehicle * * Return Value: - * The hitpoints with selections. Format: [hitpoints, selections]. They correspond by index. (Array) + * 0: Hitpoints + * 1: Selections + * + * Public: Yes + * + * Deprecated */ #include "script_component.hpp" @@ -15,5 +19,7 @@ params ["_vehicle"]; private "_hitPointsWithSelections"; _hitPointsWithSelections = getAllHitPointsDamage _vehicle; + _hitPointsWithSelections resize 2; + _hitPointsWithSelections diff --git a/addons/common/functions/fnc_getMGRSdata.sqf b/addons/common/functions/fnc_getMGRSdata.sqf index 775f439174..b4f10db8a4 100644 --- a/addons/common/functions/fnc_getMGRSdata.sqf +++ b/addons/common/functions/fnc_getMGRSdata.sqf @@ -1,28 +1,28 @@ /* * Author: VKing * Gets the current map's MGRS grid zone designator and 100km square. - * Also gets longitude, latitude and altitude offset for the map + * Also gets longitude, latitude and altitude offset for the map. + * Writes return values to GVAR(MGRS_data) if run on the current map. * * Argument: - * 0: Optional: Map name, if undefined the current map is used (String) + * 0: Map name (default: worldName) * - * Return value: - * 0: Grid zone designator (String) - * 1: 100km square (String) - * 2: GZD + 100km sq. as a single string (String) - * Writes return values to GVAR(MGRS_data) if run on the current map + * Return Value: + * 0: Grid zone designator + * 1: 100km square + * 2: GZD + 100km sq. as a single string + * + * Public: No */ - -// #define DEBUG_MODE_FULL #include "script_component.hpp" -private ["_zone","_band","_GZD","_long","_lat","_UTM","_easting","_northing", "_altitude"]; +params [["_map", worldName]]; -DEFAULT_PARAM(0,_map,worldName); +private ["_long", "_lat", "_altitude", "_UTM", "_easting", "_northing", "_zone", "_band", "_GZD"]; -_long = getNumber (ConfigFile >> "CfgWorlds" >> _map >> "longitude"); -_lat = getNumber (ConfigFile >> "CfgWorlds" >> _map >> "latitude"); -_altitude = getNumber (ConfigFile >> "CfgWorlds" >> _map >> "elevationOffset"); +_long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude"); +_lat = getNumber (configFile >> "CfgWorlds" >> _map >> "latitude"); +_altitude = getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset"); if (_map in ["Chernarus", "Bootcamp_ACR", "Woodland_ACR", "utes"]) then { _lat = 50; _altitude = 0; }; if (_map in ["Altis", "Stratis"]) then { _lat = 40; _altitude = 0; }; @@ -46,11 +46,10 @@ if (_map in ["lingor"]) then { _lat = -4; _altitude = 0; }; if (_map in ["Panthera3"]) then { _lat = 46; _altitude = 0; }; if (_map in ["Kunduz"]) then { _lat = 37; _altitude = 400; }; - _UTM = [_long,_lat] call BIS_fnc_posDegToUTM; _easting = _UTM select 0; _northing = _UTM select 1; -// _zone = _UTM select 2; +//_zone = _UTM select 2; TRACE_4("",_UTM,_easting,_northing,_zone); /* @@ -76,9 +75,11 @@ _band = switch (true) do { case (_lat>8): {"P"}; case (_lat>=0): {"N"}; }; - */ +*/ + _zone = 1 + (floor ((_long + 180) / 6)); _band = "Z"; + if (_lat <= -80) then { _band = "A"; } else { @@ -86,13 +87,13 @@ if (_lat <= -80) then { _band = "CDEFGHJKLMNPQRSTUVWXX" select [(floor ((_lat / 8) + 10)), 1]; }; }; + if (_map == "VR") then {_zone = 0; _band = "RV";}; _GZD = format ["%1%2",_zone,_band]; TRACE_3("",_zone,_band,_GZD); - -private ["_set1","_set2","_set3","_set4","_set5","_set6","_metaE","_metaN","_letterE","_letterN","_grid100km"]; +private ["_set1", "_set2", "_set3", "_set4", "_set5", "_set6", "_metaE", "_metaN", "_letterE", "_letterN", "_grid100km"]; _set1 = [1,7,13,19,25,31,37,43,49,55]; _set2 = [2,8,14,20,26,32,38,44,50,56]; @@ -102,25 +103,25 @@ _set5 = [5,11,17,23,29,35,41,47,53,59]; _set6 = [6,12,18,24,30,36,42,48,54,60]; switch (true) do { -case (_zone in _set1): {_metaE = 1; _metaN = 1;}; -case (_zone in _set2): {_metaE = 2; _metaN = 2;}; -case (_zone in _set3): {_metaE = 3; _metaN = 1;}; -case (_zone in _set4): {_metaE = 1; _metaN = 2;}; -case (_zone in _set5): {_metaE = 2; _metaN = 1;}; -case (_zone in _set6): {_metaE = 3; _metaN = 2;}; + case (_zone in _set1): {_metaE = 1; _metaN = 1;}; + case (_zone in _set2): {_metaE = 2; _metaN = 2;}; + case (_zone in _set3): {_metaE = 3; _metaN = 1;}; + case (_zone in _set4): {_metaE = 1; _metaN = 2;}; + case (_zone in _set5): {_metaE = 2; _metaN = 1;}; + case (_zone in _set6): {_metaE = 3; _metaN = 2;}; }; TRACE_2("",_metaE,_metaN); switch (true) do { -case (_zone == 0): {_letterE = "E"}; -case (_easting > 800000): {LOG("E8"); switch (_metaE) do {case 1: {_letterE="H"}; case 2: {_letterE="R"}; case 3: {_letterE="Z"}; }; }; -case (_easting > 700000): {LOG("E7"); switch (_metaE) do {case 1: {_letterE="G"}; case 2: {_letterE="Q"}; case 3: {_letterE="Y"}; }; }; -case (_easting > 600000): {LOG("E6"); switch (_metaE) do {case 1: {_letterE="F"}; case 2: {_letterE="P"}; case 3: {_letterE="X"}; }; }; -case (_easting > 500000): {LOG("E5"); switch (_metaE) do {case 1: {_letterE="E"}; case 2: {_letterE="N"}; case 3: {_letterE="W"}; }; }; -case (_easting > 400000): {LOG("E4"); switch (_metaE) do {case 1: {_letterE="D"}; case 2: {_letterE="M"}; case 3: {_letterE="V"}; }; }; -case (_easting > 300000): {LOG("E3"); switch (_metaE) do {case 1: {_letterE="C"}; case 2: {_letterE="L"}; case 3: {_letterE="U"}; }; }; -case (_easting > 200000): {LOG("E2"); switch (_metaE) do {case 1: {_letterE="B"}; case 2: {_letterE="K"}; case 3: {_letterE="T"}; }; }; -case (_easting > 100000): {LOG("E1"); switch (_metaE) do {case 1: {_letterE="A"}; case 2: {_letterE="J"}; case 3: {_letterE="S"}; }; }; + case (_zone == 0): {_letterE = "E"}; + case (_easting > 800000): {LOG("E8"); switch (_metaE) do {case 1: {_letterE="H"}; case 2: {_letterE="R"}; case 3: {_letterE="Z"}; }; }; + case (_easting > 700000): {LOG("E7"); switch (_metaE) do {case 1: {_letterE="G"}; case 2: {_letterE="Q"}; case 3: {_letterE="Y"}; }; }; + case (_easting > 600000): {LOG("E6"); switch (_metaE) do {case 1: {_letterE="F"}; case 2: {_letterE="P"}; case 3: {_letterE="X"}; }; }; + case (_easting > 500000): {LOG("E5"); switch (_metaE) do {case 1: {_letterE="E"}; case 2: {_letterE="N"}; case 3: {_letterE="W"}; }; }; + case (_easting > 400000): {LOG("E4"); switch (_metaE) do {case 1: {_letterE="D"}; case 2: {_letterE="M"}; case 3: {_letterE="V"}; }; }; + case (_easting > 300000): {LOG("E3"); switch (_metaE) do {case 1: {_letterE="C"}; case 2: {_letterE="L"}; case 3: {_letterE="U"}; }; }; + case (_easting > 200000): {LOG("E2"); switch (_metaE) do {case 1: {_letterE="B"}; case 2: {_letterE="K"}; case 3: {_letterE="T"}; }; }; + case (_easting > 100000): {LOG("E1"); switch (_metaE) do {case 1: {_letterE="A"}; case 2: {_letterE="J"}; case 3: {_letterE="S"}; }; }; default {_letterE="@"}; }; TRACE_1("",_letterE); @@ -129,37 +130,38 @@ _northing = _northing mod 2000000; TRACE_1("",_northing); switch (true) do { -case (_zone == 0): {_letterN = "N"}; -case (_northing > 1900000): {LOG("N19"); switch (_metaN) do {case 1: {_letterN = "V"}; case 2: {_letterN = "E"}; }; }; -case (_northing > 1800000): {LOG("N18"); switch (_metaN) do {case 1: {_letterN = "U"}; case 2: {_letterN = "D"}; }; }; -case (_northing > 1700000): {LOG("N17"); switch (_metaN) do {case 1: {_letterN = "T"}; case 2: {_letterN = "C"}; }; }; -case (_northing > 1600000): {LOG("N16"); switch (_metaN) do {case 1: {_letterN = "S"}; case 2: {_letterN = "B"}; }; }; -case (_northing > 1500000): {LOG("N15"); switch (_metaN) do {case 1: {_letterN = "R"}; case 2: {_letterN = "A"}; }; }; -case (_northing > 1400000): {LOG("N14"); switch (_metaN) do {case 1: {_letterN = "Q"}; case 2: {_letterN = "V"}; }; }; -case (_northing > 1300000): {LOG("N13"); switch (_metaN) do {case 1: {_letterN = "P"}; case 2: {_letterN = "U"}; }; }; -case (_northing > 1200000): {LOG("N12"); switch (_metaN) do {case 1: {_letterN = "N"}; case 2: {_letterN = "T"}; }; }; -case (_northing > 1100000): {LOG("N11"); switch (_metaN) do {case 1: {_letterN = "M"}; case 2: {_letterN = "S"}; }; }; -case (_northing > 1000000): {LOG("N10"); switch (_metaN) do {case 1: {_letterN = "L"}; case 2: {_letterN = "R"}; }; }; -case (_northing > 900000): {LOG("N09"); switch (_metaN) do {case 1: {_letterN = "K"}; case 2: {_letterN = "Q"}; }; }; -case (_northing > 800000): {LOG("N08"); switch (_metaN) do {case 1: {_letterN = "J"}; case 2: {_letterN = "P"}; }; }; -case (_northing > 700000): {LOG("N07"); switch (_metaN) do {case 1: {_letterN = "H"}; case 2: {_letterN = "N"}; }; }; -case (_northing > 600000): {LOG("N06"); switch (_metaN) do {case 1: {_letterN = "G"}; case 2: {_letterN = "M"}; }; }; -case (_northing > 500000): {LOG("N05"); switch (_metaN) do {case 1: {_letterN = "F"}; case 2: {_letterN = "L"}; }; }; -case (_northing > 400000): {LOG("N04"); switch (_metaN) do {case 1: {_letterN = "E"}; case 2: {_letterN = "K"}; }; }; -case (_northing > 300000): {LOG("N03"); switch (_metaN) do {case 1: {_letterN = "D"}; case 2: {_letterN = "J"}; }; }; -case (_northing > 200000): {LOG("N02"); switch (_metaN) do {case 1: {_letterN = "C"}; case 2: {_letterN = "H"}; }; }; -case (_northing > 100000): {LOG("N01"); switch (_metaN) do {case 1: {_letterN = "B"}; case 2: {_letterN = "G"}; }; }; -case (_northing > 0): {LOG("N00"); switch (_metaN) do {case 1: {_letterN = "A"}; case 2: {_letterN = "F"}; }; }; + case (_zone == 0): {_letterN = "N"}; + case (_northing > 1900000): {LOG("N19"); switch (_metaN) do {case 1: {_letterN = "V"}; case 2: {_letterN = "E"}; }; }; + case (_northing > 1800000): {LOG("N18"); switch (_metaN) do {case 1: {_letterN = "U"}; case 2: {_letterN = "D"}; }; }; + case (_northing > 1700000): {LOG("N17"); switch (_metaN) do {case 1: {_letterN = "T"}; case 2: {_letterN = "C"}; }; }; + case (_northing > 1600000): {LOG("N16"); switch (_metaN) do {case 1: {_letterN = "S"}; case 2: {_letterN = "B"}; }; }; + case (_northing > 1500000): {LOG("N15"); switch (_metaN) do {case 1: {_letterN = "R"}; case 2: {_letterN = "A"}; }; }; + case (_northing > 1400000): {LOG("N14"); switch (_metaN) do {case 1: {_letterN = "Q"}; case 2: {_letterN = "V"}; }; }; + case (_northing > 1300000): {LOG("N13"); switch (_metaN) do {case 1: {_letterN = "P"}; case 2: {_letterN = "U"}; }; }; + case (_northing > 1200000): {LOG("N12"); switch (_metaN) do {case 1: {_letterN = "N"}; case 2: {_letterN = "T"}; }; }; + case (_northing > 1100000): {LOG("N11"); switch (_metaN) do {case 1: {_letterN = "M"}; case 2: {_letterN = "S"}; }; }; + case (_northing > 1000000): {LOG("N10"); switch (_metaN) do {case 1: {_letterN = "L"}; case 2: {_letterN = "R"}; }; }; + case (_northing > 900000): {LOG("N09"); switch (_metaN) do {case 1: {_letterN = "K"}; case 2: {_letterN = "Q"}; }; }; + case (_northing > 800000): {LOG("N08"); switch (_metaN) do {case 1: {_letterN = "J"}; case 2: {_letterN = "P"}; }; }; + case (_northing > 700000): {LOG("N07"); switch (_metaN) do {case 1: {_letterN = "H"}; case 2: {_letterN = "N"}; }; }; + case (_northing > 600000): {LOG("N06"); switch (_metaN) do {case 1: {_letterN = "G"}; case 2: {_letterN = "M"}; }; }; + case (_northing > 500000): {LOG("N05"); switch (_metaN) do {case 1: {_letterN = "F"}; case 2: {_letterN = "L"}; }; }; + case (_northing > 400000): {LOG("N04"); switch (_metaN) do {case 1: {_letterN = "E"}; case 2: {_letterN = "K"}; }; }; + case (_northing > 300000): {LOG("N03"); switch (_metaN) do {case 1: {_letterN = "D"}; case 2: {_letterN = "J"}; }; }; + case (_northing > 200000): {LOG("N02"); switch (_metaN) do {case 1: {_letterN = "C"}; case 2: {_letterN = "H"}; }; }; + case (_northing > 100000): {LOG("N01"); switch (_metaN) do {case 1: {_letterN = "B"}; case 2: {_letterN = "G"}; }; }; + case (_northing > 0): {LOG("N00"); switch (_metaN) do {case 1: {_letterN = "A"}; case 2: {_letterN = "F"}; }; }; }; TRACE_1("",_letterN); -_grid100km = _letterE+_letterN; +_grid100km = _letterE + _letterN; TRACE_1("",_grid100km); if (_map == worldName) then { - GVAR(MGRS_data) = [_GZD,_grid100km,_GZD+_grid100km]; + GVAR(MGRS_data) = [_GZD, _grid100km, _GZD + _grid100km]; GVAR(mapAltitude) = _altitude; GVAR(mapLatitude) = _lat; GVAR(mapLongitude) = _long; }; -[_GZD,_grid100km,_GZD+_grid100km] \ No newline at end of file + +[_GZD, _grid100km, _GZD + _grid100km] diff --git a/addons/common/functions/fnc_getMapGridFromPos.sqf b/addons/common/functions/fnc_getMapGridFromPos.sqf index 983b78ffff..1f946a6e80 100644 --- a/addons/common/functions/fnc_getMapGridFromPos.sqf +++ b/addons/common/functions/fnc_getMapGridFromPos.sqf @@ -2,57 +2,58 @@ * Author: VKing, PabstMirror * Gets a 10-digit map grid for the given world position * - * Argument: + * Arguments: * 0: Position (2D Position) - * 1: Return type; false for array of easting and northing, true for single string + * 1: Return type; false for array of easting and northing, true for single string (default: false) * - * Return values: + * Return Value: * 0: Easting * 1: Northing * * Example: - * [(getPos player)] call ace_common_fnc_getMapGridFromPos; + * [getPos player] call ace_common_fnc_getMapGridFromPos * * Public: Yes */ -// #define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_1(_pos); -DEFAULT_PARAM(1,_returnSingleString,false); +params ["_pos", ["_returnSingleString", false]]; -private["_count", "_easting", "_nativeGrid", "_northing"]; +private ["_nativeGrid", "_count", "_easting", "_northing"]; //Fallback, when map data is weird (letters) -if ((count GVAR(mapGridData)) == 0) exitWith { +if (GVAR(mapGridData) isEqualTo []) exitWith { _nativeGrid = mapGridPosition _pos; + if (_returnSingleString) then { _nativeGrid } else { _count = floor ((count _nativeGrid) / 2); - [(_nativeGrid select [0, _count]), (_nativeGrid select [_count, _count])] + [_nativeGrid select [0, _count], _nativeGrid select [_count, _count]] }; }; -EXPLODE_4_PVT(GVAR(mapGridData),_offsetX,_realOffsetY,_stepXat5,_stepYat5); +GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"]; + _easting = floor (((_pos select 0) - _offsetX) / _stepXat5); _northing = floor (((_pos select 1) - _realOffsetY) / _stepYat5); //Attempt to handle negative east/north (e.g.: moving west of map bounds) if (_easting > 0) then { _easting = str _easting; - while {count _easting < 5} do {_easting = "0" + _easting;}; + while {count _easting < 5} do {_easting = "0" + _easting}; } else { _easting = str abs _easting; - while {count _easting < 4} do {_easting = "0" + _easting;}; + while {count _easting < 4} do {_easting = "0" + _easting}; _easting = "-" + _easting; }; + if (_northing > 0) then { _northing = str _northing; - while {count _northing < 5} do {_northing = "0" + _northing;}; + while {count _northing < 5} do {_northing = "0" + _northing}; } else { _northing = str abs _northing; - while {count _northing < 4} do {_northing = "0" + _northing;}; + while {count _northing < 4} do {_northing = "0" + _northing}; _northing = "-" + _northing; }; @@ -60,4 +61,4 @@ if (_returnSingleString) then { _easting + _northing } else { [_easting, _northing] -}; +}; // return From 3037181fc2b6aeef5082a25a362bfc50d559a9a2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 17:00:53 +0200 Subject: [PATCH 149/311] more common code cleanup --- addons/common/XEH_postInit.sqf | 426 +++++++++++++++++++-------------- 1 file changed, 248 insertions(+), 178 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index a9db9bb92e..9f9824efb5 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -1,16 +1,18 @@ // ACE - Common - -// #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); +// #define ENABLE_PERFORMANCE_COUNTERS + +////////////////////////////////////////////////// +// PFHs +////////////////////////////////////////////////// //Singe PFEH to handle execNextFrame and waitAndExec: [{ - private ["_entry"]; + private "_entry"; //Handle the waitAndExec array: - while {((count GVAR(waitAndExecArray)) > 0) && {((GVAR(waitAndExecArray) select 0) select 0) <= ACE_Time}} do { + while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do { _entry = GVAR(waitAndExecArray) deleteAt 0; (_entry select 2) call (_entry select 1); }; @@ -18,7 +20,9 @@ //Handle the execNextFrame array: { (_x select 0) call (_x select 1); - } forEach GVAR(nextFrameBufferA); + false + } count GVAR(nextFrameBufferA); + //Swap double-buffer: GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB); GVAR(nextFrameBufferB) = []; @@ -26,39 +30,46 @@ }, 0, []] call CBA_fnc_addPerFrameHandler; -// Listens for global "SettingChanged" events, to update the force status locally -["SettingChanged", { - PARAMS_2(_name,_value); - if !(count _this > 2) exitWith {}; - private ["_force", "_settingData"]; - _force = _this select 2; - if (_force) then { - _settingData = [_name] call FUNC(getSettingData); - if (count _settingData == 0) exitWith {}; - _settingData set [6,_force]; - }; -}] call FUNC(addEventhandler); +////////////////////////////////////////////////// +// Get Map Data +////////////////////////////////////////////////// - -["HeadbugFixUsed", { - PARAMS_2(_profileName,_animation); - ACE_LOGINFO_2("Headbug Used: Name: %1, Animation: %2",_profileName,_animation); -}] call FUNC(addEventHandler); - - -//~~~~~Get Map Data~~~~~ //Find MGRS zone and 100km grid for current map [] call FUNC(getMGRSdata); //Prepare variables for FUNC(getMapGridFromPos)/FUNC(getMapPosFromGrid) [] call FUNC(getMapGridData); +////////////////////////////////////////////////// +// Eventhandlers +////////////////////////////////////////////////// -["fixCollision", DFUNC(fixCollision)] call FUNC(addEventhandler); -["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler); -["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler); +// Listens for global "SettingChanged" events, to update the force status locally +["SettingChanged", { + params ["_name", "_value", "_force"]; -["unloadPersonEvent", DFUNC(unloadPersonLocal)] call FUNC(addEventhandler); + if (_force) then { + private "_settingData"; + _settingData = [_name] call FUNC(getSettingData); + + if (_settingData isEqualTo []) exitWith {}; + + _settingData set [6, _force]; + }; +}] call FUNC(addEventhandler); + + +// Event to log Fix Headbug output +["HeadbugFixUsed", { + params ["_profileName", "_animation"]; + ACE_LOGINFO_2("Headbug Used: Name: %1, Animation: %2",_profileName,_animation); +}] call FUNC(addEventHandler); + +["fixCollision", FUNC(fixCollision)] call FUNC(addEventhandler); +["fixFloating", FUNC(fixFloating)] call FUNC(addEventhandler); +["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); + +["unloadPersonEvent", FUNC(unloadPersonLocal)] call FUNC(addEventhandler); ["lockVehicle", { _this setVariable [QGVAR(lockStatus), locked _this]; @@ -77,22 +88,10 @@ if (isServer) then { ["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler); }; -QGVAR(remoteFnc) addPublicVariableEventHandler { - (_this select 1) call FUNC(execRemoteFnc); -}; -[missionNamespace] call FUNC(executePersistent); - -private ["_currentVersion", "_previousVersion"]; -// check previous version number from profile -_currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); -_previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; - -if (_currentVersion != _previousVersion) then { - // do something - - profileNamespace setVariable ["ACE_VersionNumberString", _currentVersion]; -}; +////////////////////////////////////////////////// +// Set up remote execution +////////////////////////////////////////////////// // ACE events "ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; @@ -100,7 +99,7 @@ if (_currentVersion != _previousVersion) then { // Synced ACE events // Handle JIP scenario -if(!isServer) then { +if (!isServer) then { ["PlayerJip", { ACE_LOGINFO("JIP event synchronization initialized"); ["SEH_all", [player]] call FUNC(serverEvent); @@ -108,31 +107,72 @@ if(!isServer) then { } else { ["SEH_all", FUNC(_handleRequestAllSyncedEvents)] call FUNC(addEventHandler); }; + ["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); ["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler); + if (isServer) then { [FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; }; +// @todo deprecated +QGVAR(remoteFnc) addPublicVariableEventHandler { + (_this select 1) call FUNC(execRemoteFnc); +}; + +// @todo figure out what this does. +[missionNamespace] call FUNC(executePersistent); + + +////////////////////////////////////////////////// +// Check files, previous installed version etc. +////////////////////////////////////////////////// + +private ["_currentVersion", "_previousVersion"]; + +_currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); +_previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; + +// check previous version number from profile +if (_currentVersion != _previousVersion) then { + // do something + + profileNamespace setVariable ["ACE_VersionNumberString", _currentVersion]; +}; + call FUNC(checkFiles); +////////////////////////////////////////////////// +// Set up SettingsInitialized eventhandler +////////////////////////////////////////////////// + +["SettingsInitialized", { + [ + GVAR(checkPBOsAction), + GVAR(checkPBOsCheckAll), + call compile GVAR(checkPBOsWhitelist) + ] call FUNC(checkPBOs) +}] call FUNC(addEventHandler); + // Create a pfh to wait until all postinits are ready and settings are initialized [{ - PARAMS_1(_args); - EXPLODE_1_PVT(_args,_waitingMsgSent); + params ["_args"]; + + _args params ["_waitingMsgSent"]; + // If post inits are not ready then wait if !(SLX_XEH_MACHINE select 8) exitWith {}; // If settings are not initialized then wait - if (isNil QGVAR(settings) || {(!isServer) && (isNil QEGVAR(modules,serverModulesRead))}) exitWith { - if (!_waitingMsgSent) then { + if (isNil QGVAR(settings) || {!isServer && isNil QEGVAR(modules,serverModulesRead)}) exitWith { + if !(_waitingMsgSent) then { _args set [0, true]; ACE_LOGINFO("Waiting on settings from server..."); }; }; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; ACE_LOGINFO("Settings received from server."); @@ -152,36 +192,31 @@ call FUNC(checkFiles); //Set init finished and run all delayed functions: GVAR(settingsInitFinished) = true; - diag_log text format ["[ACE] %1 delayed functions running", (count GVAR(runAtSettingsInitialized))]; + ACE_LOGINFO_1(%1 delayed functions running.,count GVAR(runAtSettingsInitialized)) + { - _x params ["_func", "_params"]; - _params call _func; - } forEach GVAR(runAtSettingsInitialized); + (_x select 1) call (_x select 0); + false + } count GVAR(runAtSettingsInitialized); + GVAR(runAtSettingsInitialized) = nil; //cleanup - }, 0, [false]] call CBA_fnc_addPerFrameHandler; -["SettingsInitialized", { - [ - GVAR(checkPBOsAction), - GVAR(checkPBOsCheckAll), - call compile GVAR(checkPBOsWhitelist) - ] call FUNC(checkPBOs) -}] call FUNC(addEventHandler); +/***************************************************************************/ +/***************************************************************************/ +/** everything that only player controlled machines need, goes below this **/ +/***************************************************************************/ +/***************************************************************************/ - -/***************************************************************/ -/***************************************************************/ -/***************************************************************/ -/***************************************************************/ -/***************************************************************/ - -// everything that only player controlled machines need, goes below this if (!hasInterface) exitWith {}; -call COMPILE_FILE(scripts\assignedItemFix); -call COMPILE_FILE(scripts\initScrollWheel); +////////////////////////////////////////////////// +// Set up mouse wheel eventhandler +////////////////////////////////////////////////// + +call COMPILE_FILE(scripts\assignedItemFix);///////////// +call COMPILE_FILE(scripts\initScrollWheel);///////////// DFUNC(mouseZHandler) = { waitUntil {!isNull (findDisplay 46)}; sleep 0.1; @@ -192,142 +227,175 @@ DFUNC(mouseZHandler) = { addMissionEventHandler ["Loaded", {[] spawn FUNC(mouseZHandler)}]; [] spawn FUNC(mouseZHandler); +/* +call FUNC(assignedItemFix); +GVAR(ScrollWheelFrame) = diag_frameno; + +addMissionEventHandler ["Loaded", {call FUNC(mouseZHandler)}]; +call FUNC(mouseZHandler); +*/ +// @todo remove? enableCamShake true; + +////////////////////////////////////////////////// +// Eventhandler to set player names +////////////////////////////////////////////////// + // Set the name for the current player ["playerChanged", { - EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer); + params ["_newPlayer","_oldPlayer"]; if (alive _newPlayer) then { - [_newPlayer] call FUNC(setName) - }; - if (alive _oldPlayer) then { - [_oldPlayer] call FUNC(setName) + [_newPlayer] call FUNC(setName); }; + if (alive _oldPlayer) then { + [_oldPlayer] call FUNC(setName); + }; }] call FUNC(addEventhandler); -GVAR(OldPlayerInventory) = [ACE_player] call FUNC(getAllGear); -GVAR(OldPlayerVisionMode) = currentVisionMode ACE_player; -GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312); -GVAR(OldCameraView) = cameraView; -GVAR(OldPlayerVehicle) = vehicle ACE_player; -GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); -GVAR(OldPlayerWeapon) = currentWeapon ACE_player; + +////////////////////////////////////////////////// +// Set up numerous eventhanders for player controlled units +////////////////////////////////////////////////// + +// default variables +GVAR(OldPlayerVehicle) = vehicle objNull; +GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex); +GVAR(OldPlayerWeapon) = currentWeapon objNull; +GVAR(OldPlayerInventory) = [objNull] call FUNC(getAllGear); +GVAR(OldPlayerVisionMode) = currentVisionMode objNull; +GVAR(OldCameraView) = ""; GVAR(OldVisibleMap) = false; +GVAR(OldInventoryDisplayIsOpen) = nil; //@todo check this +GVAR(OldZeusDisplayIsOpen) = false; +GVAR(OldIsCamera) = false; // PFH to raise varios events [{ BEGIN_COUNTER(stateChecker); - private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen", "_newVisibleMap"]; - // "playerInventoryChanged" event - _newPlayerInventory = [ACE_player] call FUNC(getAllGear); - if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { - // Raise ACE event locally - GVAR(OldPlayerInventory) = _newPlayerInventory; - ["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent); - }; - - // "playerVisionModeChanged" event - _newPlayerVisionMode = currentVisionMode ACE_player; - if !(_newPlayerVisionMode isEqualTo GVAR(OldPlayerVisionMode)) then { - // Raise ACE event locally - GVAR(OldPlayerVisionMode) = _newPlayerVisionMode; - ["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent); - }; - - // "inventoryDisplayChanged" event - _newInventoryDisplayIsOpen = !(isNull findDisplay 602); - if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then { - // Raise ACE event locally - GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen; - ["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent); - }; - - // "zeusDisplayChanged" event - _newZeusDisplayIsOpen = !(isNull findDisplay 312); - if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then { - // Raise ACE event locally - GVAR(OldZeusDisplayIsOpen) = _newZeusDisplayIsOpen; - ["zeusDisplayChanged", [ACE_player, _newZeusDisplayIsOpen]] call FUNC(localEvent); - }; - - // "cameraViewChanged" event - _newCameraView = cameraView; - if !(_newCameraView isEqualTo GVAR(OldCameraView)) then { - // Raise ACE event locally - GVAR(OldCameraView) = _newCameraView; - ["cameraViewChanged", [ACE_player, _newCameraView]] call FUNC(localEvent); - }; + private "_data"; // reuse one variable to reduce number of variables that have to be set to private each frame // "playerVehicleChanged" event - _newPlayerVehicle = vehicle ACE_player; - if !(_newPlayerVehicle isEqualTo GVAR(OldPlayerVehicle)) then { + _data = vehicle ACE_player; + if !(_data isEqualTo GVAR(OldPlayerVehicle)) then { // Raise ACE event locally - GVAR(OldPlayerVehicle) = _newPlayerVehicle; - ["playerVehicleChanged", [ACE_player, _newPlayerVehicle]] call FUNC(localEvent); + GVAR(OldPlayerVehicle) = _data; + ["playerVehicleChanged", [ACE_player, _data]] call FUNC(localEvent); }; // "playerTurretChanged" event - _newPlayerTurret = [ACE_player] call FUNC(getTurretIndex); - if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then { + _data = [ACE_player] call FUNC(getTurretIndex); + if !(_data isEqualTo GVAR(OldPlayerTurret)) then { // Raise ACE event locally - GVAR(OldPlayerTurret) = _newPlayerTurret; - ["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent); + GVAR(OldPlayerTurret) = _data; + ["playerTurretChanged", [ACE_player, _data]] call FUNC(localEvent); }; // "playerWeaponChanged" event - _newPlayerWeapon = currentWeapon ACE_player; - if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then { + _data = currentWeapon ACE_player; + if (_data != GVAR(OldPlayerWeapon)) then { // Raise ACE event locally - GVAR(OldPlayerWeapon) = _newPlayerWeapon; - ["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent); + GVAR(OldPlayerWeapon) = _data; + ["playerWeaponChanged", [ACE_player, _data]] call FUNC(localEvent); + }; + + // "playerInventoryChanged" event + _data = [ACE_player] call FUNC(getAllGear); + if !(_data isEqualTo GVAR(OldPlayerInventory)) then { + // Raise ACE event locally + GVAR(OldPlayerInventory) = _data; + ["playerInventoryChanged", [ACE_player, _data]] call FUNC(localEvent); + }; + + // "playerVisionModeChanged" event + _data = currentVisionMode ACE_player; + if !(_data isEqualTo GVAR(OldPlayerVisionMode)) then { + // Raise ACE event locally + GVAR(OldPlayerVisionMode) = _data; + ["playerVisionModeChanged", [ACE_player, _data]] call FUNC(localEvent); + }; + + // "cameraViewChanged" event + _data = cameraView; + if !(_data isEqualTo GVAR(OldCameraView)) then { + // Raise ACE event locally + GVAR(OldCameraView) = _data; + ["cameraViewChanged", [ACE_player, _data]] call FUNC(localEvent); }; // "visibleMapChanged" event - _newVisibleMap = visibleMap; - if (!_newVisibleMap isEqualTo GVAR(OldVisibleMap)) then { + _data = visibleMap; + if (!_data isEqualTo GVAR(OldVisibleMap)) then { // Raise ACE event locally - GVAR(OldVisibleMap) = _newVisibleMap; - ["visibleMapChanged", [ACE_player, _newVisibleMap]] call FUNC(localEvent); + GVAR(OldVisibleMap) = _data; + ["visibleMapChanged", [ACE_player, _data]] call FUNC(localEvent); + }; + + // "inventoryDisplayChanged" event + _data = !(isNull findDisplay 602); + if !(_data isEqualTo GVAR(OldInventoryDisplayIsOpen)) then { + // Raise ACE event locally + GVAR(OldInventoryDisplayIsOpen) = _data; + ["inventoryDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); + }; + + // "zeusDisplayChanged" event + _data = !(isNull findDisplay 312); + if !(_data isEqualTo GVAR(OldZeusDisplayIsOpen)) then { + // Raise ACE event locally + GVAR(OldZeusDisplayIsOpen) = _data; + ["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); + }; + + // "activeCameraChanged" event + _data = call FUNC(isfeatureCameraActive); + if !(_data isEqualTo GVAR(OldIsCamera)) then { + // Raise ACE event locally + GVAR(OldIsCamera) = _data; + ["activeCameraChanged", [ACE_player, _data]] call FUNC(localEvent); }; END_COUNTER(stateChecker); - }, 0, []] call CBA_fnc_addPerFrameHandler; -GVAR(OldIsCamera) = false; +////////////////////////////////////////////////// +// Eventhandlers for player controlled machines +////////////////////////////////////////////////// -[{ - - // "activeCameraChanged" event - private ["_isCamera"]; - _isCamera = call FUNC(isfeatureCameraActive); - if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { - // Raise ACE event locally - GVAR(OldIsCamera) = _isCamera; - ["activeCameraChanged", [ACE_player, _isCamera]] call FUNC(localEvent); - }; - -}, 1, []] call CBA_fnc_addPerFrameHandler; // feel free to decrease the sleep ACE_time if you need it. - - -[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); +// @todo still needed? +[QGVAR(StateArrested), false, true, QUOTE(ADDON)] call FUNC(defineVariable); ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); -["medical_onUnconscious", {if (local (_this select 0) && {!(_this select 1)}) then {[ _this select 0, false, QUOTE(FUNC(loadPerson)), west /* dummy side */] call FUNC(switchToGroupSide);};}] call FUNC(addEventhandler); + +["medical_onUnconscious", { + params ["_unit", "_isUnconscious"]; + + if (local _unit && {!_isUnconscious}) then { + [_unit, false, QFUNC(loadPerson), west /* dummy side */] call FUNC(switchToGroupSide); + }; +}] call FUNC(addEventhandler); + + +////////////////////////////////////////////////// +// Add various canInteractWith conditions +////////////////////////////////////////////////// ["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); + ["isNotInside", { + params ["_unit", "_target"]; + // Players can always interact with himself if not boarded - vehicle (_this select 0) == (_this select 0) || + vehicle _unit == _unit || // Players can always interact with his vehicle - {vehicle (_this select 0) == (_this select 1)} || + {vehicle _unit == _target} || // Players can always interact with passengers of the same vehicle - {!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}} + {_unit != _target && {vehicle _unit == vehicle _target}} }] call FUNC(addCanInteractWithCondition); // Lastly, do JIP events @@ -337,45 +405,47 @@ if (didJip) then { [{ if((!(isNull player)) && GVAR(settingsInitFinished)) then { ["PlayerJip", [player] ] call FUNC(localEvent); - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; }, 0, []] call CBA_fnc_addPerFrameHandler; }; + +////////////////////////////////////////////////// +// CBA key input handling +////////////////////////////////////////////////// + //Device Handler: GVAR(deviceKeyHandlingArray) = []; GVAR(deviceKeyCurrentIndex) = -1; // Register localizations for the Keybinding categories -["ACE3 Equipment", localize LSTRING(ACEKeybindCategoryEquipment)] call cba_fnc_registerKeybindModPrettyName; -["ACE3 Common", localize LSTRING(ACEKeybindCategoryCommon)] call cba_fnc_registerKeybindModPrettyName; -["ACE3 Weapons", localize LSTRING(ACEKeybindCategoryWeapons)] call cba_fnc_registerKeybindModPrettyName; -["ACE3 Movement", localize LSTRING(ACEKeybindCategoryMovement)] call cba_fnc_registerKeybindModPrettyName; -["ACE3 Scope Adjustment", localize LSTRING(ACEKeybindCategoryScopeAdjustment)] call cba_fnc_registerKeybindModPrettyName; -["ACE3 Vehicles", localize LSTRING(ACEKeybindCategoryVehicles)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Equipment", localize LSTRING(ACEKeybindCategoryEquipment)] call CBA_fnc_registerKeybindModPrettyName; +["ACE3 Common", localize LSTRING(ACEKeybindCategoryCommon)] call CBA_fnc_registerKeybindModPrettyName; +["ACE3 Weapons", localize LSTRING(ACEKeybindCategoryWeapons)] call CBA_fnc_registerKeybindModPrettyName; +["ACE3 Movement", localize LSTRING(ACEKeybindCategoryMovement)] call CBA_fnc_registerKeybindModPrettyName; +["ACE3 Scope Adjustment", localize LSTRING(ACEKeybindCategoryScopeAdjustment)] call CBA_fnc_registerKeybindModPrettyName; +["ACE3 Vehicles", localize LSTRING(ACEKeybindCategoryVehicles)] call CBA_fnc_registerKeybindModPrettyName; -["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"), -{ +["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"), { [] call FUNC(deviceKeyFindValidIndex); if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false}; [] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 3); true }, {false}, -[0xC7, [false, false, false]], false] call cba_fnc_addKeybind; //Home Key +[0xC7, [false, false, false]], false] call CBA_fnc_addKeybind; //Home Key -["ACE3 Equipment", QGVAR(closeDevice), (localize "STR_ACE_Common_closeHandheldDevice"), -{ +["ACE3 Equipment", QGVAR(closeDevice), (localize "STR_ACE_Common_closeHandheldDevice"), { [] call FUNC(deviceKeyFindValidIndex); if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false}; [] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 4); true }, {false}, -[0xC7, [false, true, false]], false] call cba_fnc_addKeybind; //CTRL + Home Key +[0xC7, [false, true, false]], false] call CBA_fnc_addKeybind; //CTRL + Home Key -["ACE3 Equipment", QGVAR(cycleDevice), (localize "STR_ACE_Common_cycleHandheldDevices"), -{ +["ACE3 Equipment", QGVAR(cycleDevice), (localize "STR_ACE_Common_cycleHandheldDevices"), { [1] call FUNC(deviceKeyFindValidIndex); if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false}; _displayName = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 0); @@ -384,6 +454,6 @@ GVAR(deviceKeyCurrentIndex) = -1; true }, {false}, -[0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key +[0xC7, [true, false, false]], false] call CBA_fnc_addKeybind; //SHIFT + Home Key GVAR(commonPostInited) = true; From b5b5c761c4b87fb65e365b7d441bb7dd63df7c1b Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 17:09:10 +0200 Subject: [PATCH 150/311] fix missing '' in info log macro --- addons/common/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 9f9824efb5..96c803a409 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -192,7 +192,7 @@ call FUNC(checkFiles); //Set init finished and run all delayed functions: GVAR(settingsInitFinished) = true; - ACE_LOGINFO_1(%1 delayed functions running.,count GVAR(runAtSettingsInitialized)) + ACE_LOGINFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized)) { (_x select 1) call (_x select 0); From 13b487e13b767bab50816e3d891a0d5c21f0b1f8 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 17:13:28 +0200 Subject: [PATCH 151/311] fix missing ; --- addons/common/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 96c803a409..9c494ff859 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -192,7 +192,7 @@ call FUNC(checkFiles); //Set init finished and run all delayed functions: GVAR(settingsInitFinished) = true; - ACE_LOGINFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized)) + ACE_LOGINFO_1("%1 delayed functions running.",count GVAR(runAtSettingsInitialized)); { (_x select 1) call (_x select 0); From 1a4ebdac5160b217993adbd7508a63892b85fc1e Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 17:32:21 +0200 Subject: [PATCH 152/311] more common code cleanup --- addons/common/XEH_postInit.sqf | 19 +++++++++++++++++++ addons/common/XEH_preInit.sqf | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 9c494ff859..2359a50f7e 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -273,11 +273,30 @@ GVAR(OldInventoryDisplayIsOpen) = nil; //@todo check this GVAR(OldZeusDisplayIsOpen) = false; GVAR(OldIsCamera) = false; +// clean up playerChanged eventhandler from preinit and put it in the same PFH as the other events to reduce overhead and guarantee advantageous execution order +if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { + [GVAR(PreInit_playerChanged_PFHID)] call CBA_fnc_removePerFrameHandler; + GVAR(PreInit_playerChanged_PFHID) = nil; +}; + // PFH to raise varios events [{ BEGIN_COUNTER(stateChecker); private "_data"; // reuse one variable to reduce number of variables that have to be set to private each frame + // "playerChanged" event + _data = call FUNC(player); + if !(_data isEqualTo GVAR(OldPlayerVehicle)) then { + private "_oldPlayer"; + _oldPlayer = ACE_player; + + ACE_player = _data; + uiNamespace setVariable ["ACE_player", _data]; + + // Raise ACE event locally + ["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent); + }; + // "playerVehicleChanged" event _data = vehicle ACE_player; if !(_data isEqualTo GVAR(OldPlayerVehicle)) then { diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 9db3794a81..44c5da6293 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -306,11 +306,11 @@ if (isServer) then { call FUNC(loadSettingsOnServer); }; -ACE_player = player; +ACE_player = objNull; if (hasInterface) then { // PFH to update the ACE_player variable - [{ + GVAR(PreInit_playerChanged_PFHID) = [{ if !(ACE_player isEqualTo (call FUNC(player))) then { private ["_oldPlayer"]; _oldPlayer = ACE_player; From b695a54655ec33fb79b18d97f81dabe51ee1261d Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 21 Sep 2015 18:01:45 +0200 Subject: [PATCH 153/311] Add a first implementation of the sqf validator/parser/linter. Checks all sqf files within given module or entire project for missing [] {} or () Prints out information regarding anything it marks as a possible error --- tools/sqf_validator.py | 121 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 tools/sqf_validator.py diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py new file mode 100644 index 0000000000..5bd65619e8 --- /dev/null +++ b/tools/sqf_validator.py @@ -0,0 +1,121 @@ + +import fnmatch +import os +import re +import ntpath +import sys +import argparse + +def check_sqf_syntax(filepath): + bad_count_file = 0 + def pushClosing(t): + closingStack.append(closing.expr) + closing << Literal( closingFor[t[0]] ) + + def popClosing(): + closing << closingStack.pop() + + with open(filepath, 'r') as file: + content = file.read() + brackets_list = [] + + isInCommentBlock = False + checkIfInComment = False + ignoreTillEndOfLine = False + checkIfNextIsClosingBlock = False + isInString = False + + lineNumber = 0 + + for c in content: + if c == '\n': + lineNumber += 1 # so we can print accurate line number information when we detect a possible error + if (isInString): + if (c == inStringType): + isInString = False + elif (isInCommentBlock == False): # if we are not in a comment block, we will check if we are at the start of one or count the () {} and [] + if (checkIfInComment): # This means we have encountered a /, so we are now checking if this is an inline comment or a comment block + checkIfInComment = False + if c == '*': # if the next character after / is a *, we are at the start of a comment block + isInCommentBlock = True + if (c == '/'): # Otherwise, will check if we are in an line comment + ignoreTillEndOfLine = True # and an line comment is a / followed by another / (//) We won't care about anything that comes after it + if (isInCommentBlock == False): + if (ignoreTillEndOfLine): # we are in a line comment, just continue going through the characters until we find an end of line + if (c == '\n'): + ignoreTillEndOfLine = False + else: + if (c == '"'): + isInString = True + inStringType = c + elif (c == '/'): + checkIfInComment = True + elif (c == '('): + brackets_list.append('(') + elif (c == ')'): + if (brackets_list[-1] in ['{', '[']): + print "Possible missing bracket detected at )" + print filepath + "Line number: " + str(lineNumber) + bad_count_file += 1 + brackets_list.append(')') + elif (c == '['): + brackets_list.append('[') + elif (c == ']'): + if (brackets_list[-1] in ['{', '(']): + print "Possible missing bracket detected at ]" + print filepath + "Line number: " + str(lineNumber) + bad_count_file += 1 + brackets_list.append(']') + elif (c == '{'): + brackets_list.append('{') + elif (c == '}'): + if (brackets_list[-1] in ['(', '[']): + print "Possible missing bracket detected at }" + print filepath + "Line number: " + str(lineNumber) + bad_count_file += 1 + brackets_list.append('}') + else: + if (c == '*'): + checkIfNextIsClosingBlock = True; + elif (checkIfNextIsClosingBlock): + if (c == '/'): + isInCommentBlock = False + elif (c != '*'): + checkIfNextIsClosingBlock = False + + if brackets_list.count('[') != brackets_list.count(']'): + print "A possible missing [ or ] in file " + filepath + "[ = " + str(brackets_list.count('[')) + " ] =" + str(brackets_list.count(']')) + bad_count_file += 1 + if brackets_list.count('(') != brackets_list.count(')'): + print "A possible missing ( or ) in file " + filepath + "( = " + str(brackets_list.count('(')) + " ) =" + str(brackets_list.count(')')) + bad_count_file += 1 + if brackets_list.count('{') != brackets_list.count('}'): + print "A possible missing { or } in file " + filepath + "{ = " + str(brackets_list.count('{')) + " } =" + str(brackets_list.count('}')) + bad_count_file += 1 + return bad_count_file + +def main(): + + print("#########################") + print("# Validate SQF files missing brackets #") + print("#########################") + + sqf_list = [] + bad_count = 0 + + parser = argparse.ArgumentParser() + parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") + args = parser.parse_args() + + for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): + for filename in fnmatch.filter(filenames, '*.sqf'): + sqf_list.append(os.path.join(root, filename)) + + for filename in sqf_list: + bad_count = bad_count + check_sqf_syntax(filename) + + + print ("Bad Count {0}".format(bad_count)) + +if __name__ == "__main__": + main() From 8503d15c9b64eefeaad95d23bb20c0d8dd8130b3 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 18:37:19 +0200 Subject: [PATCH 154/311] more common code cleanup --- addons/common/XEH_postInit.sqf | 33 ++++----- addons/common/XEH_preInit.sqf | 58 ++++++++------- .../common/functions/fnc_assignedItemFix.sqf | 73 +++++++++++++++++++ .../functions/fnc_handleScrollWheel.sqf | 25 +++++++ .../functions/fnc_handleScrollWheelInit.sqf | 15 ++++ addons/common/scripts/assignedItemFix.sqf | 64 ---------------- addons/common/scripts/initScrollWheel.sqf | 16 ---- addons/main/script_macros.hpp | 2 + 8 files changed, 159 insertions(+), 127 deletions(-) create mode 100644 addons/common/functions/fnc_assignedItemFix.sqf create mode 100644 addons/common/functions/fnc_handleScrollWheel.sqf create mode 100644 addons/common/functions/fnc_handleScrollWheelInit.sqf delete mode 100644 addons/common/scripts/assignedItemFix.sqf delete mode 100644 addons/common/scripts/initScrollWheel.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 2359a50f7e..e374a7a716 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -215,25 +215,12 @@ if (!hasInterface) exitWith {}; // Set up mouse wheel eventhandler ////////////////////////////////////////////////// -call COMPILE_FILE(scripts\assignedItemFix);///////////// -call COMPILE_FILE(scripts\initScrollWheel);///////////// - -DFUNC(mouseZHandler) = { - waitUntil {!isNull (findDisplay 46)}; sleep 0.1; - findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )]; - [false] call FUNC(disableUserInput); -}; - -addMissionEventHandler ["Loaded", {[] spawn FUNC(mouseZHandler)}]; -[] spawn FUNC(mouseZHandler); - -/* call FUNC(assignedItemFix); + GVAR(ScrollWheelFrame) = diag_frameno; - -addMissionEventHandler ["Loaded", {call FUNC(mouseZHandler)}]; -call FUNC(mouseZHandler); -*/ + +addMissionEventHandler ["Loaded", {call FUNC(handleScrollWheelInit)}]; +call FUNC(handleScrollWheelInit); // @todo remove? enableCamShake true; @@ -417,14 +404,20 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { {_unit != _target && {vehicle _unit == vehicle _target}} }] call FUNC(addCanInteractWithCondition); + +////////////////////////////////////////////////// +// Set up PlayerJIP eventhandler +////////////////////////////////////////////////// + // Lastly, do JIP events // JIP Detection and event trigger. Run this at the very end, just in case anything uses it +// Note: usage of player is most likely on purpose if (didJip) then { // We are jipping! Get ready and wait, and throw the event [{ - if((!(isNull player)) && GVAR(settingsInitFinished)) then { - ["PlayerJip", [player] ] call FUNC(localEvent); - [(_this select 1)] call CBA_fnc_removePerFrameHandler; + if(!isNull player && GVAR(settingsInitFinished)) then { + ["PlayerJip", [player]] call FUNC(localEvent); + [_this select 1] call CBA_fnc_removePerFrameHandler; }; }, 0, []] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 44c5da6293..a1f19aab8d 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -1,16 +1,13 @@ // by commy2 #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); - ADDON = false; -// ACE Common Function - PREP(addCanInteractWithCondition); PREP(addLineToDebugDraw); PREP(addSetting); PREP(addToInventory); +PREP(assignedItemFix); PREP(assignObjectsInList); PREP(ambientBrightness); PREP(applyForceWalkStatus); @@ -82,14 +79,6 @@ PREP(getTargetAzimuthAndInclination); PREP(getTargetDistance); PREP(getTargetObject); PREP(getTurnedOnLights); -PREP(getTurretCommander); -PREP(getTurretConfigPath); -PREP(getTurretCopilot); -PREP(getTurretGunner); -PREP(getTurretIndex); -PREP(getTurrets); -PREP(getTurretsFFV); -PREP(getTurretsOther); PREP(getTurretDirection); PREP(getUavControlPosition); PREP(getVehicleCargo); @@ -102,6 +91,8 @@ PREP(getWindDirection); PREP(getZoom); PREP(goKneeling); PREP(hadamardProduct); +PREP(handleScrollWheel); +PREP(handleScrollWheelInit); PREP(hasItem); PREP(hasMagazine); PREP(headBugFix); @@ -251,6 +242,17 @@ PREP(localEvent); PREP(removeEventHandler); PREP(removeAlLEventHandlers); +// Synchronized Events +PREP(syncedEventPFH); +PREP(addSyncedEventHandler); +PREP(removeSyncedEventHandler); +PREP(requestSyncedEvent); +PREP(syncedEvent); + +PREP(_handleSyncedEvent); +PREP(_handleRequestSyncedEvent); +PREP(_handleRequestAllSyncedEvents); + // other eventhandlers PREP(addActionEventHandler); PREP(addActionMenuEventHandler); @@ -274,17 +276,6 @@ PREP(hashListSelect); PREP(hashListSet); PREP(hashListPush); -// Synchronized Events -PREP(syncedEventPFH); -PREP(addSyncedEventHandler); -PREP(removeSyncedEventHandler); -PREP(requestSyncedEvent); -PREP(syncedEvent); - -PREP(_handleSyncedEvent); -PREP(_handleRequestSyncedEvent); -PREP(_handleRequestAllSyncedEvents); - GVAR(syncedEvents) = HASH_CREATE; //GVARS for execNextFrame and waitAndExec @@ -296,7 +287,7 @@ GVAR(nextFrameBufferB) = []; GVAR(settingsInitFinished) = false; GVAR(runAtSettingsInitialized) = []; -// @TODO: Generic local-managed global-synced objects (createVehicleLocal) +// @todo: Generic local-managed global-synced objects (createVehicleLocal) //Debug ACE_COUNTERS = []; @@ -306,8 +297,15 @@ if (isServer) then { call FUNC(loadSettingsOnServer); }; -ACE_player = objNull; +////////////////////////////////////////////////// +// Set up PlayerChanged eventhandler for pre init +////////////////////////////////////////////////// + +ACE_player = objNull; +uiNamespace setVariable ["ACE_player", objNull]; + +// @todo check if this can be removed if (hasInterface) then { // PFH to update the ACE_player variable GVAR(PreInit_playerChanged_PFHID) = [{ @@ -324,7 +322,11 @@ if (hasInterface) then { }, 0, []] call CBA_fnc_addPerFrameHandler; }; + +////////////////////////////////////////////////// // Time handling +////////////////////////////////////////////////// + ACE_time = diag_tickTime; ACE_realTime = diag_tickTime; ACE_virtualTime = diag_tickTime; @@ -339,6 +341,8 @@ PREP(timePFH); // Init toHex [0] call FUNC(toHex); -ADDON = true; +isHC = !hasInterface && !isDedicated; // deprecated because no tag +missionNamespace setVariable ["ACE_isHC", ACE_isHC]; +uiNamespace setVariable ["ACE_isHC", ACE_isHC]; -isHC = !(hasInterface || isDedicated); +ADDON = true; diff --git a/addons/common/functions/fnc_assignedItemFix.sqf b/addons/common/functions/fnc_assignedItemFix.sqf new file mode 100644 index 0000000000..ed381cfc9b --- /dev/null +++ b/addons/common/functions/fnc_assignedItemFix.sqf @@ -0,0 +1,73 @@ +/* + * Author: commy2 + * Initialized the assigned item fix. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public : No + */ +#include "script_component.hpp" + +private "_config"; + +ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first +ACE_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; +ACE_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; +ACE_isRadioEnabled = call {_config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}}; +ACE_isGPSEnabled = call {_config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}}; + +GVAR(AssignedItems) = []; +GVAR(AssignedItemsInfo) = []; +GVAR(AssignedItemsShownItems) = [ + ACE_isMapEnabled, + ACE_isCompassEnabled, + ACE_isWatchEnabled, + ACE_isRadioEnabled, + ACE_isGPSEnabled +]; + +["playerInventoryChanged", { + params ["_unit", "_assignedItems"]; + + _assignedItems = _assignedItems select 17; + + { + if !(_x in GVAR(AssignedItems)) then { + GVAR(AssignedItems) pushBack _x; + GVAR(AssignedItemsInfo) pushBack toLower getText (configFile >> "CfgWeapons" >> _x >> "ACE_hideItemType"); + }; + + switch (GVAR(AssignedItemsInfo) select (GVAR(AssignedItems) find _x)) do { + case ("map"): { + GVAR(AssignedItemsShownItems) set [0, false]; + }; + case ("compass"): { + GVAR(AssignedItemsShownItems) set [1, false]; + }; + case ("watch"): { + GVAR(AssignedItemsShownItems) set [2, false]; + }; + case ("radio"): { + GVAR(AssignedItemsShownItems) set [3, false]; + }; + case ("gps"): { + GVAR(AssignedItemsShownItems) set [4, false]; + }; + }; + false + } count _assignedItems; + + //systemChat str GVAR(AssignedItemsShownItems); + + GVAR(AssignedItemsShownItems) params ["_showMap", "_showCompass", "_showWatch", "_showRadio", "_showGPS"]; + + showMap _showMap; + showCompass _showCompass; + showWatch _showWatch; + showRadio _showRadio; + showGPS (_showGPS || {cameraOn == getConnectedUAV _unit}); //If player is activly controling a UAV, showGPS controls showing the map (m key) +}] call FUNC(addEventHandler); diff --git a/addons/common/functions/fnc_handleScrollWheel.sqf b/addons/common/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..c0b88f9ed7 --- /dev/null +++ b/addons/common/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * Handles MouseZChanged event. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public : No + */ +#include "script_component.hpp" + +// prevents a bug that causes the MouseZChanged to trigger N-times, where N is the number of times you consecutively pressed "Restart" instead of "Preview" in the editor +if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; + +GVAR(ScrollWheelFrame) = diag_frameno; + +{ + [_this select 1] call _x; + false +} count ((missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]) select 2); + +nil diff --git a/addons/common/functions/fnc_handleScrollWheelInit.sqf b/addons/common/functions/fnc_handleScrollWheelInit.sqf new file mode 100644 index 0000000000..12f8b5f337 --- /dev/null +++ b/addons/common/functions/fnc_handleScrollWheelInit.sqf @@ -0,0 +1,15 @@ +/* + * Author: commy2 + * Initializes the MouseZChanged eventhandler. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public : No + */ +#include "script_component.hpp" + +(findDisplay 46) displayAddEventHandler ["MouseZChanged", QUOTE(_this call FUNC(handleScrollWheel))]; diff --git a/addons/common/scripts/assignedItemFix.sqf b/addons/common/scripts/assignedItemFix.sqf deleted file mode 100644 index bcf79a3ac1..0000000000 --- a/addons/common/scripts/assignedItemFix.sqf +++ /dev/null @@ -1,64 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private ["_config"]; - -ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first -ACE_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; -ACE_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; -ACE_isRadioEnabled = call {_config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}}; -ACE_isGPSEnabled = call {_config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}}; - -GVAR(AssignedItems) = []; -GVAR(AssignedItemsInfo) = []; - -["playerInventoryChanged", { - private ["_unit", "_assignedItems", "_shownItems"]; - - _unit = _this select 0; - _assignedItems = _this select 1 select 17; - - _shownItems = [ - ACE_isMapEnabled, - ACE_isCompassEnabled, - ACE_isWatchEnabled, - ACE_isRadioEnabled, - ACE_isGPSEnabled - ]; - - { - if !(_x in GVAR(AssignedItems)) then { - GVAR(AssignedItems) pushBack _x; - GVAR(AssignedItemsInfo) pushBack toLower getText (configFile >> "CfgWeapons" >> _x >> "ACE_hideItemType") - }; - - private "_hideItemType"; - _hideItemType = GVAR(AssignedItemsInfo) select (GVAR(AssignedItems) find _x); - - switch (_hideItemType) do { - case ("map"): { - _shownItems set [0, false]; - }; - case ("compass"): { - _shownItems set [1, false]; - }; - case ("watch"): { - _shownItems set [2, false]; - }; - case ("radio"): { - _shownItems set [3, false]; - }; - case ("gps"): { - _shownItems set [4, false]; - }; - }; - } forEach _assignedItems; - - //systemChat str _shownItems; - - showMap (_shownItems select 0); - showCompass (_shownItems select 1); - showWatch (_shownItems select 2); - showRadio (_shownItems select 3); - showGPS (_shownItems select 4 || {cameraOn == getConnectedUAV _unit}); //If player is activly controling a UAV, showGPS controls showing the map (m key) -}] call FUNC(addEventHandler); diff --git a/addons/common/scripts/initScrollWheel.sqf b/addons/common/scripts/initScrollWheel.sqf deleted file mode 100644 index 78920bb371..0000000000 --- a/addons/common/scripts/initScrollWheel.sqf +++ /dev/null @@ -1,16 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -GVAR(ScrollWheelFrame) = diag_frameno; - -GVAR(onScrollWheel) = { - private ["_scroll"]; - _scroll = _this select 1; - - if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; - GVAR(ScrollWheelFrame) = diag_frameno; - - { - [_scroll] call _x; - } count ((missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]) select 2); -}; diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 41514e4aaf..130c7427d8 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -97,6 +97,8 @@ // Time functions for accuracy per frame #define ACE_tickTime (ACE_time + (diag_tickTime - ACE_diagTime)) +#define ACE_isHC (!hasInterface && !isDedicated) + #define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message) #define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message) From 5a5242f1c9a2e2d32c3dcc175044f810f55cca93 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 19:19:49 +0200 Subject: [PATCH 155/311] more common code cleanup --- addons/common/functions/fnc_assignedItemFix.sqf | 2 ++ addons/common/functions/fnc_getItemType.sqf | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_assignedItemFix.sqf b/addons/common/functions/fnc_assignedItemFix.sqf index ed381cfc9b..9f804eaa4d 100644 --- a/addons/common/functions/fnc_assignedItemFix.sqf +++ b/addons/common/functions/fnc_assignedItemFix.sqf @@ -35,6 +35,8 @@ GVAR(AssignedItemsShownItems) = [ _assignedItems = _assignedItems select 17; + GVAR(AssignedItemsShownItems) = [true, true, true, true, true]; + { if !(_x in GVAR(AssignedItems)) then { GVAR(AssignedItems) pushBack _x; diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index 4d6ee932fa..ec20b46f74 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -15,7 +15,7 @@ params ["_item"]; -private ["_cfgType", "_config", "_type", "_default"]; +private ["_cfgType", "_config", "_type", "_simulation", "_default"]; _cfgType = [_item] call FUNC(getConfigType); @@ -25,6 +25,7 @@ if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]}; _config = configFile >> _cfgType >> _item; _type = getNumber (_config >> "type"); +_simulation = getText (_config >> "simulation"); if (isNumber (_config >> "ItemInfo" >> "type")) then { _type = getNumber (_config >> "ItemInfo" >> "type"); @@ -63,7 +64,7 @@ switch (true) do { case (_type == 801): {["item", "uniform"]}; case (_type == 2^12): { - switch (toLower getText (_config >> "simulation")) do { + switch (toLower _simulation) do { case ("weapon"): {["weapon", "binocular"]}; case ("binocular"): {["weapon", "binocular"]}; case ("nvgoggles"): {["item", "nvgoggles"]}; @@ -73,6 +74,15 @@ switch (true) do { }; case (_type == 2^16): {["weapon", "vehicle"]}; - case (_type == 2^17): {[_default, "unknown"]}; // ??? + case (_type == 2^17): { + switch (toLower _simulation) do { + case ("itemmap"): {["item", "map"]}; + case ("itemgps"): {["item", "gps"]}; + case ("itemradio"): {["item", "radio"]}; + case ("itemcompass"): {["item", "compass"]}; + case ("itemwatch"): {["item", "watch"]}; + default {[_default, "unknown"]}; + }; + }; default {[_default, "unknown"]}; }; From 1d5217d16542a66ba65d4d87f2672e616ee091d7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Sep 2015 12:43:35 -0500 Subject: [PATCH 156/311] Medical - delayedUnconsicous fix waitAndExecute --- addons/medical/functions/fnc_handleDamage.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 1a58e2ed01..afcf6e12e5 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -109,7 +109,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW if (_delayedUnconsicous) then { [{ [_this select 0, true] call FUNC(setUnconscious); - }, [_unit], 0.7, 0] call EFUNC(common,waitAndExec); + }, [_unit], 0.7, 0] call EFUNC(common,waitAndExecute); } else { [{ [_this select 0, true] call FUNC(setUnconscious); From af309b937b24ad005458ac9020a6d9ff47a91e0c Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 21:25:18 +0200 Subject: [PATCH 157/311] add depracted warnings --- addons/common/functions/fnc_checkPBOs.sqf | 2 +- addons/common/functions/fnc_codeToLetter.sqf | 2 ++ addons/common/functions/fnc_getHitPoints.sqf | 2 ++ addons/common/functions/fnc_getHitPointsWithSelections.sqf | 2 ++ addons/common/functions/fnc_inheritsFrom.sqf | 2 ++ addons/common/functions/fnc_isAlive.sqf | 2 ++ addons/common/functions/fnc_isTurnedOut.sqf | 2 ++ addons/common/functions/fnc_letterToCode.sqf | 2 ++ addons/common/functions/fnc_sortAlphabeticallyBy.sqf | 2 ++ addons/common/functions/fnc_uniqueElementsOnly.sqf | 2 ++ addons/common/scripts/Version/script_component.hpp | 1 - addons/common/scripts/{Version => }/checkVersionNumber.sqf | 0 12 files changed, 19 insertions(+), 2 deletions(-) delete mode 100644 addons/common/scripts/Version/script_component.hpp rename addons/common/scripts/{Version => }/checkVersionNumber.sqf (100%) diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 4c923899a1..9cb5ed4d61 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -92,5 +92,5 @@ if (!isServer) then { }; if (_checkAll) then { - 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); // @todo + 0 spawn COMPILE_FILE(scripts\checkVersionNumber); // @todo }; diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf index 0bfb1d465f..64d17be918 100644 --- a/addons/common/functions/fnc_codeToLetter.sqf +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -14,4 +14,6 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_codeToLetter","1.5","-"); + ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 8b2f10728c..9d50ed7330 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_getHitPoints","1.5","getAllHitPointsDamage"); + params ["_vehicle"]; (getAllHitPointsDamage _vehicle select 0) - [""] diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 7b027d9efa..6a5b7a0ef5 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_getHitPointsWithSelections","1.5","getAllHitPointsDamage"); + params ["_vehicle"]; private "_hitPointsWithSelections"; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index 586a37847c..253a01d856 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -17,6 +17,8 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_inheritsFrom","1.5","inheritsFrom ARRAY"); + params ["_configEntry", "_configMatch"]; if (configName _configEntry == _configMatch) exitWith {true}; diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index 343466c00d..524d5739ee 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_isAlive","1.5","alive"); + params ["_unit"]; !isNull _unit && {alive _unit} // return diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index 15861938b8..e11f971b4a 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_isTurnedOut","1.5","isTurnedOut"); + params ["_unit"]; isTurnedOut _unit // return diff --git a/addons/common/functions/fnc_letterToCode.sqf b/addons/common/functions/fnc_letterToCode.sqf index 12e6cf72ce..f995a40168 100644 --- a/addons/common/functions/fnc_letterToCode.sqf +++ b/addons/common/functions/fnc_letterToCode.sqf @@ -14,4 +14,6 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_letterToCode","1.5","-"); + [-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index 76082013ef..a6bd39f101 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_sortAlphabeticallyBy","1.5","sort"); + params ["_array", "_elementN"]; private ["_elements", "_indexes", "_theElement", "_tmp", "_tempIndex", "_returnArray"]; diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index e8d469867e..3c6568c1c6 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -14,4 +14,6 @@ */ #include "script_component.hpp" +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_uniqueElementsOnly","1.5","ace_common_fnc_uniqueElements"); + _this call FUNC(uniqueElements) diff --git a/addons/common/scripts/Version/script_component.hpp b/addons/common/scripts/Version/script_component.hpp deleted file mode 100644 index 23da62b05c..0000000000 --- a/addons/common/scripts/Version/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf similarity index 100% rename from addons/common/scripts/Version/checkVersionNumber.sqf rename to addons/common/scripts/checkVersionNumber.sqf From b1f79f0383ebf559460c76072dafc858b8cf9981 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 21:39:45 +0200 Subject: [PATCH 158/311] fix broken log warning macro --- addons/main/script_macros.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 130c7427d8..180ded8e21 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -132,7 +132,7 @@ #define ACE_LOGWARNING_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGWARNING(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) #define ACE_LOGWARNING_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGWARNING(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) -#define ACE_WARNINGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"WARNING",message) +#define ACE_WARNINGFORMAT(message) ACE_LOG(COMPONENT,"WARNING",message) #define ACE_WARNINGFORMAT_1(message,arg1) ACE_WARNINGFORMAT(FORMAT_1(message,arg1)) #define ACE_WARNINGFORMAT_2(message,arg1,arg2) ACE_WARNINGFORMAT(FORMAT_2(message,arg1,arg2)) #define ACE_WARNINGFORMAT_3(message,arg1,arg2,arg3) ACE_WARNINGFORMAT(FORMAT_3(message,arg1,arg2,arg3)) From 441efcd65f93b28b288b9a7382d4c63d8af492c1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 21:48:18 +0200 Subject: [PATCH 159/311] change version number in deprecated log --- addons/common/functions/fnc_codeToLetter.sqf | 2 +- addons/common/functions/fnc_getHitPoints.sqf | 2 +- addons/common/functions/fnc_getHitPointsWithSelections.sqf | 2 +- addons/common/functions/fnc_inheritsFrom.sqf | 2 +- addons/common/functions/fnc_isAlive.sqf | 2 +- addons/common/functions/fnc_isTurnedOut.sqf | 2 +- addons/common/functions/fnc_letterToCode.sqf | 2 +- addons/common/functions/fnc_sortAlphabeticallyBy.sqf | 2 +- addons/common/functions/fnc_uniqueElementsOnly.sqf | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf index 64d17be918..8d33763e87 100644 --- a/addons/common/functions/fnc_codeToLetter.sqf +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_codeToLetter","1.5","-"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_codeToLetter","3.5.0","-"); ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 9d50ed7330..23c297dc5b 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_getHitPoints","1.5","getAllHitPointsDamage"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 6a5b7a0ef5..38d5dd8785 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_getHitPointsWithSelections","1.5","getAllHitPointsDamage"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index 253a01d856..a139ed69c7 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_inheritsFrom","1.5","inheritsFrom ARRAY"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY"); params ["_configEntry", "_configMatch"]; diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index 524d5739ee..dc58a42f75 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_isAlive","1.5","alive"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isAlive","3.5.0","alive"); params ["_unit"]; diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index e11f971b4a..d58073e90d 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_isTurnedOut","1.5","isTurnedOut"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut"); params ["_unit"]; diff --git a/addons/common/functions/fnc_letterToCode.sqf b/addons/common/functions/fnc_letterToCode.sqf index f995a40168..95dc168239 100644 --- a/addons/common/functions/fnc_letterToCode.sqf +++ b/addons/common/functions/fnc_letterToCode.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_letterToCode","1.5","-"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_letterToCode","3.5.0","-"); [-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index a6bd39f101..4d9ef7ab8a 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_sortAlphabeticallyBy","1.5","sort"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort"); params ["_array", "_elementN"]; diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index 3c6568c1c6..5cfc527ac1 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by %3","ace_common_fnc_uniqueElementsOnly","1.5","ace_common_fnc_uniqueElements"); +ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements"); _this call FUNC(uniqueElements) From 020915a52a8400a078c48d6073f89a0f1b0a979f Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 21:51:05 +0200 Subject: [PATCH 160/311] Revert "fix broken log warning macro" This reverts commit b1f79f0383ebf559460c76072dafc858b8cf9981. --- addons/main/script_macros.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 180ded8e21..130c7427d8 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -132,7 +132,7 @@ #define ACE_LOGWARNING_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGWARNING(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) #define ACE_LOGWARNING_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGWARNING(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) -#define ACE_WARNINGFORMAT(message) ACE_LOG(COMPONENT,"WARNING",message) +#define ACE_WARNINGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"WARNING",message) #define ACE_WARNINGFORMAT_1(message,arg1) ACE_WARNINGFORMAT(FORMAT_1(message,arg1)) #define ACE_WARNINGFORMAT_2(message,arg1,arg2) ACE_WARNINGFORMAT(FORMAT_2(message,arg1,arg2)) #define ACE_WARNINGFORMAT_3(message,arg1,arg2,arg3) ACE_WARNINGFORMAT(FORMAT_3(message,arg1,arg2,arg3)) From f8676afca43619f9dcc3035f82510f5b3adfff0f Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 21:56:18 +0200 Subject: [PATCH 161/311] use correct macro for rpt writing --- addons/common/functions/fnc_codeToLetter.sqf | 2 +- addons/common/functions/fnc_getHitPoints.sqf | 2 +- addons/common/functions/fnc_getHitPointsWithSelections.sqf | 2 +- addons/common/functions/fnc_inheritsFrom.sqf | 2 +- addons/common/functions/fnc_isAlive.sqf | 2 +- addons/common/functions/fnc_isTurnedOut.sqf | 2 +- addons/common/functions/fnc_letterToCode.sqf | 2 +- addons/common/functions/fnc_sortAlphabeticallyBy.sqf | 2 +- addons/common/functions/fnc_uniqueElementsOnly.sqf | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf index 8d33763e87..ef71b60b1b 100644 --- a/addons/common/functions/fnc_codeToLetter.sqf +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_codeToLetter","3.5.0","-"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_codeToLetter","3.5.0","-"); ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 23c297dc5b..a32cda7c1f 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 38d5dd8785..f76391e593 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index a139ed69c7..f9e2882a37 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY"); params ["_configEntry", "_configMatch"]; diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index dc58a42f75..5505f5d46b 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isAlive","3.5.0","alive"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isAlive","3.5.0","alive"); params ["_unit"]; diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index d58073e90d..87b261ed06 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut"); params ["_unit"]; diff --git a/addons/common/functions/fnc_letterToCode.sqf b/addons/common/functions/fnc_letterToCode.sqf index 95dc168239..83a0cea671 100644 --- a/addons/common/functions/fnc_letterToCode.sqf +++ b/addons/common/functions/fnc_letterToCode.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_letterToCode","3.5.0","-"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_letterToCode","3.5.0","-"); [-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index 4d9ef7ab8a..ab43645768 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort"); params ["_array", "_elementN"]; diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index 5cfc527ac1..9c5bcdd1ba 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_WARNINGFORMAT_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements"); +ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements"); _this call FUNC(uniqueElements) From 9996aa22ab5784c376e76fdce2fe3d57578f9958 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Sep 2015 15:03:34 -0500 Subject: [PATCH 162/311] Replace googles - isTurnedOut --- addons/goggles/functions/fnc_onEachFrame.sqf | 2 +- addons/goggles/functions/fnc_rainEffect.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf index 863046da7f..85692a0f57 100644 --- a/addons/goggles/functions/fnc_onEachFrame.sqf +++ b/addons/goggles/functions/fnc_onEachFrame.sqf @@ -17,7 +17,7 @@ if (isNull(ace_player)) exitWith {}; GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; if (GVAR(FrameEvent) select 0) exitWith { - if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; + if (vehicle ace_player != ace_player && {!isTurnedOut ACE_player}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; }; private ["_rotorWash","_safe"]; diff --git a/addons/goggles/functions/fnc_rainEffect.sqf b/addons/goggles/functions/fnc_rainEffect.sqf index b5badef6f2..6f351f4002 100644 --- a/addons/goggles/functions/fnc_rainEffect.sqf +++ b/addons/goggles/functions/fnc_rainEffect.sqf @@ -19,7 +19,7 @@ if (isNull(ace_player) || {!(alive ace_player)}) exitWith {}; _fnc_underCover = { private ["_pos", "_unit"]; _unit = (_this select 0); - if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true}; + if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true}; _pos = eyePos _unit; ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} }; From f134a77e98062629b5cf811bc23db4b4759537c4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 22:09:54 +0200 Subject: [PATCH 163/311] add and use deprecated macro --- addons/common/functions/fnc_codeToLetter.sqf | 2 +- addons/common/functions/fnc_getHitPoints.sqf | 2 +- addons/common/functions/fnc_getHitPointsWithSelections.sqf | 2 +- addons/common/functions/fnc_inheritsFrom.sqf | 2 +- addons/common/functions/fnc_isAlive.sqf | 2 +- addons/common/functions/fnc_isTurnedOut.sqf | 2 +- addons/common/functions/fnc_letterToCode.sqf | 2 +- addons/common/functions/fnc_sortAlphabeticallyBy.sqf | 2 +- addons/common/functions/fnc_uniqueElementsOnly.sqf | 2 +- addons/main/script_macros.hpp | 2 ++ 10 files changed, 11 insertions(+), 9 deletions(-) diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf index ef71b60b1b..80f6291d0f 100644 --- a/addons/common/functions/fnc_codeToLetter.sqf +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_codeToLetter","3.5.0","-"); +ACE_DEPRECATED("ace_common_fnc_codeToLetter","3.5.0","-"); ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index a32cda7c1f..6c0645007e 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); +ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index f76391e593..36475672b9 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage"); +ACE_DEPRECATED("ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index f9e2882a37..7f881ff746 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY"); +ACE_DEPRECATED("ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY"); params ["_configEntry", "_configMatch"]; diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index 5505f5d46b..b9d94eed5d 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isAlive","3.5.0","alive"); +ACE_DEPRECATED("ace_common_fnc_isAlive","3.5.0","alive"); params ["_unit"]; diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index 87b261ed06..39eb460cc4 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut"); +ACE_DEPRECATED("ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut"); params ["_unit"]; diff --git a/addons/common/functions/fnc_letterToCode.sqf b/addons/common/functions/fnc_letterToCode.sqf index 83a0cea671..7bbbcf4f3d 100644 --- a/addons/common/functions/fnc_letterToCode.sqf +++ b/addons/common/functions/fnc_letterToCode.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_letterToCode","3.5.0","-"); +ACE_DEPRECATED("ace_common_fnc_letterToCode","3.5.0","-"); [-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index ab43645768..287c4566d5 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort"); +ACE_DEPRECATED("ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort"); params ["_array", "_elementN"]; diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index 9c5bcdd1ba..9bdb6ff647 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -14,6 +14,6 @@ */ #include "script_component.hpp" -ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3","ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements"); +ACE_DEPRECATED("ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements"); _this call FUNC(uniqueElements) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 130c7427d8..2ad20a08c7 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -182,4 +182,6 @@ #define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) #define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) +#define ACE_DEPRECATED(arg1,arg2,arg3) ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3",arg1,arg2,arg3); + #include "script_debug.hpp" From f1abd4698f3815ddaf454dcfc123fb96e77f68a4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 22:12:17 +0200 Subject: [PATCH 164/311] remove superfluous ; --- addons/main/script_macros.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 2ad20a08c7..f7ec3a3fa3 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -182,6 +182,6 @@ #define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) #define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) -#define ACE_DEPRECATED(arg1,arg2,arg3) ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3",arg1,arg2,arg3); +#define ACE_DEPRECATED(arg1,arg2,arg3) ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3",arg1,arg2,arg3) #include "script_debug.hpp" From 62ad9d4284e948929192685a03238ac8797fb421 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 21 Sep 2015 22:31:01 +0200 Subject: [PATCH 165/311] Version 3.3.2 --- README.md | 4 ++-- addons/main/script_mod.hpp | 4 ++-- mod.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 146784e36b..5a01e5d5de 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@

- ACE3 Version + ACE3 Version - + ACE3 Download diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index e7b0479d24..c87a23aba2 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -5,8 +5,8 @@ #define MAJOR 3 #define MINOR 3 -#define PATCHLVL 1 -#define BUILD 2 +#define PATCHLVL 2 +#define BUILD 0 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD diff --git a/mod.cpp b/mod.cpp index d7b52260b0..2e8513a952 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,8 +1,8 @@ -name = "Advanced Combat Environment 3.3.1"; +name = "Advanced Combat Environment 3.3.2"; picture = "logo_ace3_ca.paa"; actionName = "GitHub"; action = "https://github.com/acemod/ACE3"; -description = "ACE3 - Version 3.3.1"; +description = "ACE3 - Version 3.3.2"; logo = "logo_ace3_ca.paa"; logoOver = "logo_ace3_ca.paa"; tooltip = "ACE3"; From 23e3db9cc0ab7b0dc43cbe1d8331000922bef244 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 21 Sep 2015 22:41:29 +0200 Subject: [PATCH 166/311] use CBA pfh in disableUserInput and fix key input weirdness --- .../common/functions/fnc_disableUserInput.sqf | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index ffa6d8e28f..8b00cedeac 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -44,11 +44,7 @@ if (_state) then { private ["_dlg", "_ctrl"]; - _dlg = finddisplay 49; - _dlg displayAddEventHandler ["KeyDown", { - params ["", "_key"]; - !(_key == 1) - }]; + _dlg = findDisplay 49; for "_index" from 100 to 2000 do { (_dlg displayCtrl _index) ctrlEnable false; @@ -97,16 +93,17 @@ if (_state) then { _dlg displayAddEventHandler ["KeyUp", {true}]; - ["ACE_DisableUserInput", "onEachFrame", { + GVAR(disableInputPFH) = [{ if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then { - ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + [GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler; + GVAR(disableInputPFH) = nil; [true] call FUNC(disableUserInput); }; - }] call BIS_fnc_addStackedEventHandler; - + }, 0, []] call CBA_fnc_addPerFrameHandler; } else { - if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then { - ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + if (!isNil QGVAR(disableInputPFH)) then { + [GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler; + GVAR(disableInputPFH) = nil; }; (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; From 6702a1faa4f246123e090d5136ee19958d6c295e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Sep 2015 16:34:02 -0500 Subject: [PATCH 167/311] Fix warnings for WeaponHolderSimulated --- addons/interact_menu/XEH_clientInit.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 119afe4294..44dfddcadd 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -111,7 +111,8 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; private ["_badClassnames"]; _badClassnames = []; { - if ((isNil (format [QGVAR(Act_%1), typeOf _x])) || {isNil (format [QGVAR(SelfAct_%1), typeOf _x])}) then { + //Only check Land objects (WeaponHolderSimulated show up in `vehicles` for some reason) + if ((_x isKindOf "Land") && {(isNil (format [QGVAR(Act_%1), typeOf _x])) || {isNil (format [QGVAR(SelfAct_%1), typeOf _x])}}) then { if (!((typeOf _x) in _badClassnames)) then { _badClassnames pushBack (typeOf _x); ACE_LOGERROR_3("Compile checks bad for (classname: %1)(addon: %2) %3", (typeOf _x), (unitAddons (typeOf _x)), _x); From b05f0c62fff9ea8ace8f87b68e5e9600d87698fb Mon Sep 17 00:00:00 2001 From: gienkov Date: Tue, 22 Sep 2015 00:36:10 +0200 Subject: [PATCH 168/311] missing english respawn strings --- addons/respawn/stringtable.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 0b4a06ff7f..658d863e0f 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -201,6 +201,7 @@ Удалять трупы игроков после дисконнекта? + This module allows you to setup respawn in your mission. Moduł ten pozwala dostosować ustawienia odrodzenia (respawnu). Dieses Modul erlaubt es die Respawn-Einstellungen anzupassen. Tento modul umožňuje nastavení znovuzrození (spawn). @@ -220,6 +221,7 @@ Сообщения об огне по своим + Using this module in your mission will make it so any friendly fire kills will be displayed in form of message in chat. Użycie tego modułu na misji spowoduje wyświetlenie wiadomości na czacie w przypadku, kiedy zostanie popełniony friendly fire - wyświetlona zostanie wtedy wiadomość kto kogo zabił. Zobrazí zprávu v chatu v případě, když budete střílet na vlastní jednotky. Ve zprávě se zobrazí kdo na koho střílel, popř. kdo koho zabil. Usando este módulo em uma missão para exibir mensagens chat, no caso de quando você faz um fogo amigo - então a mensagem será exibida mostrando quem matou quem. From bbccfbaa351ba6fc0a3a396c2dbe33eb3c3ecfc0 Mon Sep 17 00:00:00 2001 From: gienkov Date: Tue, 22 Sep 2015 01:04:46 +0200 Subject: [PATCH 169/311] pl medical string --- addons/medical/stringtable.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 17944e83c3..259257aa18 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -2108,6 +2108,7 @@ %1 used Personal Aid Kit + %1 użył apteczki Heavily wounded From 55eae90484b3d80c7a43c4ccf4f5d9234e39bd6c Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Tue, 22 Sep 2015 02:35:06 +0200 Subject: [PATCH 170/311] tabz --- addons/respawn/stringtable.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 658d863e0f..0be2ae6c82 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -201,7 +201,7 @@ Удалять трупы игроков после дисконнекта? - This module allows you to setup respawn in your mission. + This module allows you to setup respawn in your mission. Moduł ten pozwala dostosować ustawienia odrodzenia (respawnu). Dieses Modul erlaubt es die Respawn-Einstellungen anzupassen. Tento modul umožňuje nastavení znovuzrození (spawn). @@ -221,7 +221,7 @@ Сообщения об огне по своим - Using this module in your mission will make it so any friendly fire kills will be displayed in form of message in chat. + Using this module in your mission will make it so any friendly fire kills will be displayed in form of message in chat. Użycie tego modułu na misji spowoduje wyświetlenie wiadomości na czacie w przypadku, kiedy zostanie popełniony friendly fire - wyświetlona zostanie wtedy wiadomość kto kogo zabił. Zobrazí zprávu v chatu v případě, když budete střílet na vlastní jednotky. Ve zprávě se zobrazí kdo na koho střílel, popř. kdo koho zabil. Usando este módulo em uma missão para exibir mensagens chat, no caso de quando você faz um fogo amigo - então a mensagem será exibida mostrando quem matou quem. From f93538eb9a86fe4eb4a325e952ea92c1387ded15 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Sep 2015 21:44:52 -0500 Subject: [PATCH 171/311] #2423 - assign vehicle module fix for prefilled veh --- .../functions/fnc_moduleAssignMedicalVehicle.sqf | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 9744ce5f7b..8481aaf293 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -12,11 +12,9 @@ * * Public: No */ - - #include "script_component.hpp" -private ["_setting", "_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"]; +private ["_setting", "_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList", "_xVehicle"]; params [["_logic", objNull, [objNull]]]; if (!isNull _logic) then { @@ -42,9 +40,11 @@ if (!isNull _logic) then { if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then { { if (!isnil "_x") then { - if (typeName _x == typeName objNull) then { + if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [QGVAR(medicClass), _setting, true]; + _xVehicle = vehicle _x; + TRACE_3("setting medical vehicle", _x, _xVehicle, (typeOf _xVehicle)); + _xVehicle setvariable [QGVAR(medicClass), _setting, true]; }; }; }; @@ -52,11 +52,12 @@ if (!isNull _logic) then { }; { if (!isnil "_x") then { - if (typeName _x == typeName objNull) then { + if (typeName _x == typeName objNull) then { if (local _x) then { + TRACE_2("setting medical vehicle", _x, (typeOf _x)); _x setvariable [QGVAR(medicClass), _setting, true]; }; }; }; } foreach _parsedList; - }; +}; From cf8a7f742e9fb5ed71168e059587676f8097b1d7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Sep 2015 22:50:48 -0500 Subject: [PATCH 172/311] #2541 - Attach getIn/Out run on local unit --- addons/attach/functions/fnc_handleGetIn.sqf | 11 ++++++++--- addons/attach/functions/fnc_handleGetOut.sqf | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/attach/functions/fnc_handleGetIn.sqf b/addons/attach/functions/fnc_handleGetIn.sqf index b7b2997081..d9f469eee2 100644 --- a/addons/attach/functions/fnc_handleGetIn.sqf +++ b/addons/attach/functions/fnc_handleGetIn.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["", "", "_unit"]; TRACE_1("params",_unit); +if (!local _unit) exitWith {}; + private ["_attachedList"]; _attachedList = _unit getVariable [QGVAR(attached), []]; @@ -29,9 +29,14 @@ if ((count _attachedList) == 0) exitWith {}; (_attachedList select 0) params ["_xObject"]; if (!isNull _xObject) then { + TRACE_1("detaching and moving attached light",_xObject); detach _xObject; _xObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]); - [{deleteVehicle (_this select 0)}, [_xObject], 2] call EFUNC(common,waitAndExecute); + [{ + params ["_detachedLight"]; + TRACE_1("delayed delete",_detachedLight); + deleteVehicle _detachedLight; + }, [_xObject], 2] call EFUNC(common,waitAndExecute); (_attachedList select 0) set [0, objNull]; }; diff --git a/addons/attach/functions/fnc_handleGetOut.sqf b/addons/attach/functions/fnc_handleGetOut.sqf index 57fb69cf15..4ed268d5dc 100644 --- a/addons/attach/functions/fnc_handleGetOut.sqf +++ b/addons/attach/functions/fnc_handleGetOut.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["", "", "_unit"]; TRACE_1("params",_unit); +if (!local _unit) exitWith {}; + private ["_attachedList"]; _attachedList = _unit getVariable [QGVAR(attached), []]; From 1848ea6325afc27db0c51a2b9016b0d7634087fc Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Tue, 22 Sep 2015 14:58:59 +0200 Subject: [PATCH 173/311] fixez --- addons/respawn/stringtable.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 0be2ae6c82..e44150ff10 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -201,7 +201,7 @@ Удалять трупы игроков после дисконнекта? - This module allows you to setup respawn in your mission. + This module enables you to configure ACE functionality specific to respawns. Moduł ten pozwala dostosować ustawienia odrodzenia (respawnu). Dieses Modul erlaubt es die Respawn-Einstellungen anzupassen. Tento modul umožňuje nastavení znovuzrození (spawn). @@ -221,7 +221,7 @@ Сообщения об огне по своим - Using this module in your mission will make it so any friendly fire kills will be displayed in form of message in chat. + Using this module in your mission will make it so any friendly fire kills will be displayed in form of a message in chat. Użycie tego modułu na misji spowoduje wyświetlenie wiadomości na czacie w przypadku, kiedy zostanie popełniony friendly fire - wyświetlona zostanie wtedy wiadomość kto kogo zabił. Zobrazí zprávu v chatu v případě, když budete střílet na vlastní jednotky. Ve zprávě se zobrazí kdo na koho střílel, popř. kdo koho zabil. Usando este módulo em uma missão para exibir mensagens chat, no caso de quando você faz um fogo amigo - então a mensagem será exibida mostrando quem matou quem. From a42685af2ed741d00a027c81078d3aeb554aa4f1 Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 22 Sep 2015 18:04:27 +0200 Subject: [PATCH 174/311] Removed copy/pasted maintainer intruder --- addons/ui/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/ui/README.md b/addons/ui/README.md index 0f80216b3d..340e3ad0f6 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -9,4 +9,3 @@ Removes vignette and changes the chat contrast on the map to allow easier readin The people responsible for merging changes to this component or answering potential questions. - [VKing](https://github.com/VKing6) -- [Jonpas](https://github.com/jonpas) From 5add8d6789660aa4717ed2cf674bc8a1bfb3acee Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 22 Sep 2015 11:31:58 -0500 Subject: [PATCH 175/311] #2537 - Delay one frame when selecting explosives --- addons/explosives/functions/fnc_addExplosiveActions.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 764c0cd7b8..fa00fdd207 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -45,7 +45,7 @@ _children = []; format ["Explosive_%1", _forEachIndex], format [_name + " (%1)", _itemCount select _forEachIndex], getText(_x >> "picture"), - {_this call FUNC(setupExplosive);}, + {[{_this call FUNC(setupExplosive)}, _this] call EFUNC(common,execNextFrame)}, {true}, {}, (configName _x) From 93e5429ed5bd7211768e0f0f89fb4cc9b03aa007 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Tue, 22 Sep 2015 20:18:12 +0200 Subject: [PATCH 176/311] Add sqf validator script to travis configuration --- .travis.yml | 1 + tools/sqf_validator.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 388b1f114f..0aadd9cd0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ before_script: - pip install pygithub3 script: - python3 tools/deploy.py + - python3 tools/sqf_validator.py env: global: - secure: "KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=" diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index 5bd65619e8..c80e2e5462 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -114,8 +114,8 @@ def main(): for filename in sqf_list: bad_count = bad_count + check_sqf_syntax(filename) - print ("Bad Count {0}".format(bad_count)) + return bad_count if __name__ == "__main__": - main() + sys.exit(main()) From 10296d2883236c0d64de6be31f21708a07950669 Mon Sep 17 00:00:00 2001 From: alganthe Date: Wed, 23 Sep 2015 15:50:50 +0200 Subject: [PATCH 177/311] PAK and Surgical Kit strings normalized inside modules. Signed-off-by: alganthe --- addons/medical/stringtable.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 17944e83c3..813cbbd4ea 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3274,7 +3274,7 @@ Elsősegélycsomag helyek - Where can the Personal Aid Kit be used? + Where can the PAK be used? Где может использоваться аптечка? Gdzie można korzystać z apteczek osobistych? ¿Dónde se puede utilizar el equipo de primeros auxilios? @@ -3295,7 +3295,7 @@ Условие использования аптечки - When can the Personal Aid Kit be used? + When can the PAK be used? Kde může být použita osobní lékárnička? ¿Cuando se puede utilizar el Equipo de primeros auxilios? Quand peut être utilisé le Kit de Premier Secours @@ -3349,7 +3349,7 @@ Járművek & létesítmény - Allow Surgical kit (Adv) + Allow Surgical Kit (Adv) Хирургический набор может использоваться (усл.) Ust. zestawu chirurg. Permitir equipo quirúrgico (Avanzado) @@ -3360,7 +3360,7 @@ Sebészkészlet (Fejlett) engedélyezése - Who can use the surgical kit? + Who can use the Surgical Kit? Кто может использовать хирургический набор? Kto może skorzystać z zestawu chirurgicznego w celu zszycia ran? ¿Quién puede utilizar el equipo quirúrgico? @@ -3371,7 +3371,7 @@ Ki használhatja a sebészkészletet? - Remove Surgical kit (Adv) + Remove Surgical Kit (Adv) Удалять хирургический набор (усл.) Usuń zest. chir. po użyciu Eliminar equipo quirúrgico (Avanzado) @@ -3393,7 +3393,7 @@ Eltávolítódjon a sebészkészlet használatkor? - Locations Surgical kit (Adv) + Locations Surgical Kit (Adv) Место использования хирургического набора (усл.) Ogr. zestawu chirurg. Ubicaciones del equipo quirúrgico (Avanzado) @@ -3404,7 +3404,7 @@ Sebészkészlet (Fejlett) helyei - Where can the Surgical kit be used? + Where can the Surgical Kit be used? Где может использоваться хирургический набор? Gdzie można korzystać z zestawu chirurgicznego? Dónde se puede utilizar el equipo quirúrgico @@ -3415,7 +3415,7 @@ Hol lehet a sebészkészletet használni? - Condition Surgical kit (Adv) + Condition Surgical Kit (Adv) Podmínka chirurgické soupravy (Pokr.) Condición de equipo quirúrgico (Av) Conditions d'utilisation du kit de chirurgie @@ -3425,7 +3425,7 @@ Условие использования хирургического набора (усл.) - When can the Surgical kit be used? + When can the Surgical Kit be used? Kde může být použita chirurgická souprava? ¿Cuando se puede utilizar el equipo quirúrgico? Quand peut être utilisé les kit de chirurgie From dce49721e4bf8e03c6ddf1bbf1e2694eb41e7c1d Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Wed, 23 Sep 2015 19:17:57 +0200 Subject: [PATCH 178/311] Posible Fix for Invisible Tactical Ladder --- .../data/ace_tacticalladder.p3d | Bin 2115464 -> 2116794 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/addons/tacticalladder/data/ace_tacticalladder.p3d b/addons/tacticalladder/data/ace_tacticalladder.p3d index 7bb924ff46e4ba8f2e454a9f674878e178f4238e..c2e05260ff14a9ae0a4269e8a71076c2ca872db5 100644 GIT binary patch delta 2500 zcma)+T}&KR6vywK8FqG;vTWNeP`gDGgFKM9P(V<^j7r*vrlyLnD={s$to5TUi&hgq znVPjFh`Q-gZknJWO_L@X3&xMprpb~>Y_e@E54O;TmVSU%=tEPDFPh*vcet171Icc3 zGUtEK|98*1b0^#L*?xNR$bOnC@wIsfx#c4y@y&e??d&FJZ#5D^=&Oh4n!TA<452rF z@6RNs|2D|rQr)ewj{dK&)EjPIXu*H!sv|FSw%MNu&9A zaM}cSEeZHP+ED8VX)$!Hb517aFgqyCc81 zN!&Sp18$9m%Jom(^$oZ+*3mEST<}5*Ufem>kr$c}izRPrp>MaxTf3s8wV?4T;g?Hp zeh2=H<6k~cM~;TlLoeUYQk_13I`u(CdhbL>o9XJ6Q=U^VoQGW-)56S}3x(1zOb$eI z+T1-%PK_21RhAySG!Qi;zOax}E?auzPw~MagHleTL#WK&HL7&^{NZSzSpFcm^kuvsVxJyy5XQ`opGUfgjs1NCZ6th zsVxJy`h%k;T5q~gJiwpQN=zJZPHN{x%}c*!uum(BOBA!#UR$g0sIj9}szvu8gyZ28 zd*c%~#x?AXPdqNxP~#H^!5q(mUaaF2*D=R+%<)OfTjRUqJNLyq%1PF)eo}o+v4f3; zS=Aoe9`GtZqyk+E3vN_P3JG<7J6?PvPO^TxYoC5yVG(t84C^cG+mEUNm2G`X^`dTI zsbT#Wdwf{+Q)V(XvbfkAn8C#`&7;-Tq9albHc*H1oDD|ys8#l_o7HU!Y7a}yhBeB^ zEAUE3%q}~jx6^@lix04&i-C7E+URV!L1AU{;ZZg^9_X-x{rX-FnMww`CLIQK4D~UM zHaO6~^f*8ip|;}yDK^N2f~JursES#``dN)W>_9(LbeWvmimkGI!BQB!y(z@%`3Xuj zTJI1aI|fc{M53QBq!j+XAwQwlQq03tqje6`$}OXuX+mZjUl`&HxPkF;3wfgB?I6N>QUaJkKf=3vi;DZ#sR)U z1Dq5(lp=5n^*9H9W$!B1 z_);jy23oW)4)$%*Ao3tQ5ITex!Uy4p$cI<~Q2-HuD1-R-{Blx>7W=0Ii$7(O|^S2XdZ!&hvqspYd(+ zSXeg=JoTzLW?o7u_zf?;K)=MrKYnvn)MG3m4JVmtl9&5)W4d33b9wOH^OA|643rQ=;ovl)n zXh9{#f+^dNgS*v98tV`VVAUcGH;~Rz#mbr`sPB@|S~Jy2Ck)}OEWeYD8c2-_(NWK3w8kJ0DAO+uNr_abfrch!RBnX25#2h- zT5qJgoMRVZkw9!4e3#Wmu8v&~v0Nq1H6dc3R4$6d-l>)$+J7bAyv#uI5M5fNOP5k& zIV1WR(Tp$<2@3B(GV%yf44?lK-9-~gZCtr0vE^ytG|LXq<5|d-8rfTHZxKT_A4B&j z(SE3-tocI*gedR;fD!}PM*~9)aNzt+&J%s$C6Y`k6Ks|fuX`+ALQBY-$I`MhxLdc* zJvm+@gDjv7kOH!TGC?-bEYNJw9FPji0@*>?pd1k89iVxjT+n=w6SM&20_B0+poO4( KGG4Rj%kMvN?iN`9 From d6203d0f2eb3a2d7dd2f7a3643908b9d8660fd6d Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Wed, 23 Sep 2015 19:54:12 +0200 Subject: [PATCH 179/311] Posible Fix for Invisible Tactical Ladder V2 --- .../data/ace_tacticalladder.p3d | Bin 2116794 -> 2120596 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/addons/tacticalladder/data/ace_tacticalladder.p3d b/addons/tacticalladder/data/ace_tacticalladder.p3d index c2e05260ff14a9ae0a4269e8a71076c2ca872db5..ad1c21c144d1a4f8090236ed320767887a6774f8 100644 GIT binary patch delta 3774 zcmY*bTWl3o6g@L@+uH}d6k4DZC>MO8RxG8x6jC}zP@q_);tP3{7FtjQEk$`Kcn^qR zh$1G$5fc+)j2JWqsBzSo(jX=TKH$TTtEnFl!-tPr1QZd(z2?r@b7-=&_d0v6v-h4k zb8f%hx7FI~Z?*Q6DB6USqA#GxE@fIBo4H8t%?-t>y-f=bpL=XY*a$KsFy?t=9#$USqA- z4QPE9r-gNVW#*{az^>C(H{onPDwxejSnG8`t=CxVbpu)-;50pQbXfWACk^@)phFWQ ze`?^Mt6u@~Cf0f`80t0FdfkB515^F%6EF*+Lla{Hvmo*&Mjm`!Q0q0;dfkB56V3?^ zjdx*pd1-fF$F=p{O__G5yYq*7`_)X}&P<=>XZq~+q<7}B9jjePC-=8}>NxycMELgr zD{Lc{5bkHJ+{J|d@XlVchoxF69AK$(+X!DUs7nd|$ykUM!WZ+sw*KDX7;BDJHniR3S0ke~gujt!_la z3i`ssKZyaX00+-WqCuN+_BlBPUhieQG_{O!u}CYH6V73-5FLbb87sG)a6GH6ewyMu z)++ZI!ubYwCE)_bLafO3s*VqR%_Ry5LSQw5WS0bA?3DcQIBj_PRUNf?H{5F~dE~6%zAJWUO55b+0jR zm7&E9lb9yhu33Sh+6{o|4s8Z=|@6waVQ@c&fqO zKzJHsA=cA@-d_|R==GGWXR(kVPmjnFjWjS;E*f>irookl7KQI)u8?SY24m%7ubH71 z-1`kJhIoLvLSn#KjFpSMW`|mE=NMYd(8ydN(c@gk*@yLDsC|iYO_5f-O!y(@3bBRo z!;F=?nee<&t0-<}t#Y>#e#GFW3D0LN#4Cg!4G%Qp$5<;QxQ|C%i9ViStX%Z@WLOv6 z1%?)NpJJ|%=y@Sy#-d0148QPdDBzj!NIQy)Y z7kHJ|?eTUpLz}1T+u0?oUiHLEnf{Z*o))8YJF+4t7ToLg2{NeFwV-24_ zJgyw%fZ=g%AYPkG|GIz-0z49kanB%z$8p7{0gq!3k0XsW9D8_tYRCb@;}bxP&j?)P z;jxYw>xeg@JG>{H33$A3c)Uxj;eEs7j3EaMk8^?;=LcNm;jxYw>xkj4Wo_#^L~)^a zw%eKJ?b#f!^9SZ6zPJ6iHpTmGZ(xJd?45C)WuD z14Op{;{N!%L5V|AiR~!yOO7=qR2{R>i40`TsBzMQ?&Cn$7wH!G#hr>kL(@VF7ZWF_)y_nX1?5CNR!yiW55}@FRy8CO z2wzM%zLZX#<&mNf;$2i_GATTIYUhH9Y`-}ZKjH-M5sWti@*#vrh+G|#4}z?0kH{4s zZT}4#$^=a$!TmCjZAbVc$tH!eF3@@dS*cesyKF}!s{;4uKo&eS+xDjSIQ#4m-}W;- z&iOaJmZn(TYyGLD{b&^F2SB delta 843 zcmYk3O=uHA7>0LdHrb>$n;(CYv}vpqA%}pp#u~ktL#fyFM+j|^Sd)uXh}1&`4`~e) zL?K|vR1uA!ruZ8XGAaS%O+t|#6@(Ohd&TSnM)~F~w@Nxwns2ozDNnLH zCZ1hlLGhDogxws>|&tMc@H zJy8xjN2x#=r&5{u?+nWNp-RHt&UKN#r_YebVW(kA;l0ExOeM#=RVmppLO6~a#ef>F zXh%y^5&fXKm<-@o$>^@3aCTr?;Oq&*Fb+e`Fl4E`Ukj0uLPV~8L?y@CzQdaA6Og<3 z1_g9jk3kV?EBZ+hQ>hFwf}R1RXUXUpCmfEi(y#!-QKiQ5SGSGSh9Qs-JAcdaBlI?V z#?Y6fJ_r3sTmQ6uDmlOpeMOd4Dq}gM@{M82$Ylkl;kIc}s$AyX@EgWo^2j_fDecrh z>Rt!GSof~*`nFf2jho_>YSFKkr`6AFb!}D!CSV2{umCIQ0ee6%umK&|fde>!3+x5^ bz Date: Wed, 23 Sep 2015 20:17:16 +0200 Subject: [PATCH 180/311] fix Littergeneric fly over ground(add Landcontact Points) --- addons/medical/data/littergeneric.p3d | Bin 196881 -> 195911 bytes addons/medical/data/littergeneric_clean.p3d | Bin 89167 -> 89333 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/addons/medical/data/littergeneric.p3d b/addons/medical/data/littergeneric.p3d index 4170dd5a410eb07cb44ec14342a01db531a90b69..801a6f5a4f3499ae9241d1f3b28bece71c471fd4 100644 GIT binary patch delta 281 zcmbQ(#B=-?H>a^uG>==~pTYL_l z0Ol*4Zn0aE9c;ZlV=I lJEL-FSa52IG6M@p1PB)7&z1QkB61E8`zW006zY8NH0|QGV=T=Te#sKc%)ST4hlGGGsh7Hp%{9qE9{@@1_%P29x qVZg|+T``!+i*fqJA56ldu|ZC3Ff%ZK1CgJxoil)OJ7)ls#~J_;0Bl_V diff --git a/addons/medical/data/littergeneric_clean.p3d b/addons/medical/data/littergeneric_clean.p3d index 7fa6fb3e9132775f161670ed999c06c5a21db18a..0ebddf30ca99ebe20378e1bfc1c6442f910a0e7d 100644 GIT binary patch delta 191 zcmX@VgZ1l9R!(0Ze-}nZ1_stf&aIq`ZZY)%#xA}x3_t)BWCPJiAe^VkEjU~0V0q4yFKicFnz+laJj50x&$P+Lc7j{J zb%M>AJs`fU{Bhd@tedRd{%!!vhd8>cyE7_>h6SgVC^N8tlmG#vvTI(7f0|onPO36k JU}gN{2mk=MF7^Nb delta 23 ecmeymllA-#R!(0Ze-}nZ1_qW!&aIq`ZZQB}#s+2p From 412685e0ff43ba3aea9d30c2d2f837617d4ecb30 Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 25 Sep 2015 11:15:25 +0200 Subject: [PATCH 181/311] fix some code was commented out in loadPersonLocal and unloadPersonLocal --- addons/common/functions/fnc_loadPersonLocal.sqf | 5 ++--- addons/common/functions/fnc_unloadPersonLocal.sqf | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index 2d8295e4af..c832ededad 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -41,8 +41,7 @@ if (_slotsOpen) then { _vehicle setVariable [QGVAR(loaded_persons), _loaded, true]; - // @todo never used. Remove? - /*if !([_unit] call FUNC(isAwake)) then { + if !([_unit] call FUNC(isAwake)) then { [{ (_this select 0) params ["_unit", "_vehicle"]; @@ -60,5 +59,5 @@ if (_slotsOpen) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler; - };*/ + }; }; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 8dd2737b83..67d104a9e4 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -73,9 +73,7 @@ _unit action ["Eject", vehicle _unit]; _unit setPosASL AGLToASL _emptyPos; - // @todo never used. Remove? - /*if !([_unit] call FUNC(isAwake)) then { - + if !([_unit] call FUNC(isAwake)) then { TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake)); if (driver _unit == _unit) then { @@ -92,7 +90,7 @@ _unit action ["Eject", vehicle _unit]; }; }, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute); }; - };*/ + }; }, [_unit, _emptyPos], 0.5, 0] call FUNC(waitAndExecute); [_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); From dcbf977d6d0145152144fd386d28287b42ecbada Mon Sep 17 00:00:00 2001 From: Cuel Date: Fri, 25 Sep 2015 12:51:13 +0200 Subject: [PATCH 182/311] fix spectator view if called instantly If you call setSpectator directly from init.sqf you'll be put into some weird limbo mode with borders and spectator not working. This should fix it --- addons/spectator/functions/fnc_setSpectator.sqf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index f94d9d9f68..efa7000b8f 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -72,8 +72,10 @@ if (_set) then { closeDialog 0; }; - // Create the display - (findDisplay 46) createDisplay QGVAR(interface); + [{ + // Create the display + (findDisplay 46) createDisplay QGVAR(interface); + }, []] call EFUNC(common,execNextFrame); // Cache and disable nametag settings if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { From 4ad16ed938736df95e8d919efa1c2ac9965f1ac4 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Fri, 25 Sep 2015 13:29:39 +0200 Subject: [PATCH 183/311] fix that waitUntilAndExecute have a return --- addons/common/functions/fnc_waitUntilAndExecute.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/common/functions/fnc_waitUntilAndExecute.sqf b/addons/common/functions/fnc_waitUntilAndExecute.sqf index 630ec4e2ce..6a7867d707 100644 --- a/addons/common/functions/fnc_waitUntilAndExecute.sqf +++ b/addons/common/functions/fnc_waitUntilAndExecute.sqf @@ -20,3 +20,4 @@ TRACE_1("Adding",_this); GVAR(waitUntilAndExecArray) pushBack _this; +nil From 2fe142032e30f69269168f67a67918e8d2dcafae Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 03:16:55 +0200 Subject: [PATCH 184/311] rework modifier key, cleanup sandbags, tripod, ladder, fix #2590 --- addons/common/XEH_postInit.sqf | 30 +++++++-- addons/common/XEH_preInit.sqf | 4 ++ addons/common/functions/fnc_getHitPoints.sqf | 10 ++- .../fnc_getHitPointsWithSelections.sqf | 5 ++ .../functions/fnc_getVehicleUAVCrew.sqf | 17 +++++ .../functions/fnc_handleModifierKey.sqf | 17 +++++ .../functions/fnc_handleModifierKeyInit.sqf | 16 +++++ .../functions/fnc_handleModifierKeyUp.sqf | 17 +++++ addons/dragging/CfgEventHandlers.hpp | 3 +- .../{XEH_clientInit.sqf => XEH_postInit.sqf} | 17 +++-- addons/dragging/XEH_serverInit.sqf | 5 -- addons/dragging/functions/fnc_canCarry.sqf | 4 +- addons/dragging/functions/fnc_canDrag.sqf | 4 +- addons/dragging/functions/fnc_carryObject.sqf | 37 +++++------ addons/dragging/functions/fnc_dragObject.sqf | 37 ++++++----- addons/dragging/functions/fnc_dropObject.sqf | 12 +++- .../functions/fnc_dropObject_carry.sqf | 12 +++- .../functions/fnc_handleScrollWheel.sqf | 7 +-- addons/dragging/stringtable.xml | 4 ++ addons/explosives/stringtable.xml | 20 +++--- addons/interaction/Menu_Config.hpp | 2 +- addons/interaction/XEH_postInit.sqf | 17 ----- .../functions/fnc_hideMouseHint.sqf | 3 +- .../functions/fnc_showMouseHint.sqf | 20 +++--- addons/sandbag/CfgEventHandlers.hpp | 17 +++-- addons/sandbag/CfgVehicles.hpp | 39 +++++------- addons/sandbag/XEH_postInit.sqf | 28 ++++++--- addons/sandbag/XEH_preInit.sqf | 7 ++- addons/sandbag/functions/fnc_canDeploy.sqf | 12 ++-- addons/sandbag/functions/fnc_carry.sqf | 56 ----------------- addons/sandbag/functions/fnc_deploy.sqf | 62 ++++++++++++------- addons/sandbag/functions/fnc_deployCancel.sqf | 29 ++++----- .../sandbag/functions/fnc_deployConfirm.sqf | 52 +++++++++------- addons/sandbag/functions/fnc_drop.sqf | 47 -------------- .../fnc_handleInteractMenuOpened.sqf | 19 ++++++ addons/sandbag/functions/fnc_handleKilled.sqf | 19 ++++++ .../functions/fnc_handlePlayerChanged.sqf | 24 +++++++ .../fnc_handlePlayerInventoryChanged.sqf | 22 +++++++ .../functions/fnc_handleUnconscious.sqf | 19 ++++++ addons/sandbag/functions/fnc_pickup.sqf | 21 ++++--- addons/sandbag/stringtable.xml | 20 +++--- addons/tacticalladder/CfgEventHandlers.hpp | 9 +++ addons/tacticalladder/CfgVehicles.hpp | 14 +++-- addons/tacticalladder/XEH_postInit.sqf | 21 +++++-- addons/tacticalladder/XEH_preInit.sqf | 4 ++ .../functions/fnc_cancelTLdeploy.sqf | 18 ++++-- .../functions/fnc_confirmTLdeploy.sqf | 27 +++++--- .../tacticalladder/functions/fnc_deployTL.sqf | 27 ++++---- .../fnc_handleInteractMenuOpened.sqf | 19 ++++++ .../functions/fnc_handleKilled.sqf | 19 ++++++ .../functions/fnc_handlePlayerChanged.sqf | 26 ++++++++ .../functions/fnc_handleScrollWheel.sqf | 2 +- .../functions/fnc_handleUnconscious.sqf | 19 ++++++ .../tacticalladder/functions/fnc_pickupTL.sqf | 13 ++-- .../functions/fnc_positionTL.sqf | 31 ++++++---- addons/tacticalladder/stringtable.xml | 11 +--- addons/tripod/CfgEventHandlers.hpp | 9 +++ addons/tripod/CfgVehicles.hpp | 30 ++++----- addons/tripod/XEH_postInit.sqf | 21 ++++--- addons/tripod/XEH_preInit.sqf | 4 ++ addons/tripod/functions/fnc_adjust.sqf | 32 +++++----- .../fnc_handleInteractMenuOpened.sqf | 19 ++++++ addons/tripod/functions/fnc_handleKilled.sqf | 19 ++++++ .../functions/fnc_handlePlayerChanged.sqf | 24 +++++++ .../functions/fnc_handleScrollWheel.sqf | 2 +- .../functions/fnc_handleUnconscious.sqf | 19 ++++++ addons/tripod/functions/fnc_pickup.sqf | 21 ++++--- addons/tripod/functions/fnc_place.sqf | 19 +++--- addons/tripod/stringtable.xml | 18 +++--- 69 files changed, 849 insertions(+), 461 deletions(-) create mode 100644 addons/common/functions/fnc_getVehicleUAVCrew.sqf create mode 100644 addons/common/functions/fnc_handleModifierKey.sqf create mode 100644 addons/common/functions/fnc_handleModifierKeyInit.sqf create mode 100644 addons/common/functions/fnc_handleModifierKeyUp.sqf rename addons/dragging/{XEH_clientInit.sqf => XEH_postInit.sqf} (50%) delete mode 100644 addons/dragging/XEH_serverInit.sqf delete mode 100644 addons/sandbag/functions/fnc_carry.sqf delete mode 100644 addons/sandbag/functions/fnc_drop.sqf create mode 100644 addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf create mode 100644 addons/sandbag/functions/fnc_handleKilled.sqf create mode 100644 addons/sandbag/functions/fnc_handlePlayerChanged.sqf create mode 100644 addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf create mode 100644 addons/sandbag/functions/fnc_handleUnconscious.sqf create mode 100644 addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf create mode 100644 addons/tacticalladder/functions/fnc_handleKilled.sqf create mode 100644 addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf create mode 100644 addons/tacticalladder/functions/fnc_handleUnconscious.sqf create mode 100644 addons/tripod/functions/fnc_handleInteractMenuOpened.sqf create mode 100644 addons/tripod/functions/fnc_handleKilled.sqf create mode 100644 addons/tripod/functions/fnc_handlePlayerChanged.sqf create mode 100644 addons/tripod/functions/fnc_handleUnconscious.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e374a7a716..c7042c03db 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -86,6 +86,7 @@ if (isServer) then { ["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler); + ["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler); }; @@ -94,8 +95,8 @@ if (isServer) then { ////////////////////////////////////////////////// // ACE events -"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; -"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; +"ACEg" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)}; +"ACEc" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)}; // Synced ACE events // Handle JIP scenario @@ -219,8 +220,29 @@ call FUNC(assignedItemFix); GVAR(ScrollWheelFrame) = diag_frameno; -addMissionEventHandler ["Loaded", {call FUNC(handleScrollWheelInit)}]; -call FUNC(handleScrollWheelInit); +["mainDisplayLoaded", { + call FUNC(handleScrollWheelInit); + [{ + call FUNC(handleModifierKeyInit); + }, [], 0.1] call FUNC(waitAndExecute); // needs delay, otherwise doesn't work without pressing "RESTART" in editor once. Tested in 1.52RC +}] call FUNC(addEventHandler); + +// add PFH to execute event that fires when the main display (46) is created +private "_fnc_initMainDisplayCheck"; +_fnc_initMainDisplayCheck = { + [{ + if !(isNull findDisplay 46) then { + // Raise ACE event locally + ["mainDisplayLoaded", [findDisplay 46]] call FUNC(localEvent); + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + }, 0, []] call CBA_fnc_addPerFrameHandler; +}; + +call _fnc_initMainDisplayCheck; + +// repeat this every time a savegame is loaded +addMissionEventHandler ["Loaded", _fnc_initMainDisplayCheck]; // @todo remove? enableCamShake true; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index a1f19aab8d..e422206134 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -91,6 +91,9 @@ PREP(getWindDirection); PREP(getZoom); PREP(goKneeling); PREP(hadamardProduct); +PREP(handleModifierKey); +PREP(handleModifierKeyUp); +PREP(handleModifierKeyInit); PREP(handleScrollWheel); PREP(handleScrollWheelInit); PREP(hasItem); @@ -204,6 +207,7 @@ PREP(getReflectorsWithSelections); PREP(getLightProperties); PREP(getLightPropertiesWeapon); PREP(getVehicleCrew); +PREP(getVehicleUAVCrew); // turrets PREP(getTurrets); diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 6c0645007e..84099b659a 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -18,4 +18,12 @@ ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; -(getAllHitPointsDamage _vehicle select 0) - [""] +private "_hitPointsWithSelections"; +_hitPointsWithSelections = getAllHitPointsDamage _vehicle; + +// get correct format on vehicles without any hitpoints +if (_hitPointsWithSelections isEqualTo []) then { + _hitPointsWithSelections = [[],[],[]]; +}; + +(_hitPointsWithSelections select 0) - [""] diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 36475672b9..b0b9867cf7 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -22,6 +22,11 @@ params ["_vehicle"]; private "_hitPointsWithSelections"; _hitPointsWithSelections = getAllHitPointsDamage _vehicle; +// get correct format on vehicles without any hitpoints +if (_hitPointsWithSelections isEqualTo []) then { + _hitPointsWithSelections = [[],[],[]]; +}; + _hitPointsWithSelections resize 2; _hitPointsWithSelections diff --git a/addons/common/functions/fnc_getVehicleUAVCrew.sqf b/addons/common/functions/fnc_getVehicleUAVCrew.sqf new file mode 100644 index 0000000000..8d9156810a --- /dev/null +++ b/addons/common/functions/fnc_getVehicleUAVCrew.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Returns array of uav dummy ais. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * UAV Dummy Crew + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_vehicle"]; + +[crew _vehicle, {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") == "UAVPilot"}] call FUNC(filter) // return diff --git a/addons/common/functions/fnc_handleModifierKey.sqf b/addons/common/functions/fnc_handleModifierKey.sqf new file mode 100644 index 0000000000..bfb7e84931 --- /dev/null +++ b/addons/common/functions/fnc_handleModifierKey.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Handles key down event for modifier key. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public : No + */ +#include "script_component.hpp" + +if (_this select 3) then {ACE_modifier = 1}; + +false diff --git a/addons/common/functions/fnc_handleModifierKeyInit.sqf b/addons/common/functions/fnc_handleModifierKeyInit.sqf new file mode 100644 index 0000000000..a945f5eba1 --- /dev/null +++ b/addons/common/functions/fnc_handleModifierKeyInit.sqf @@ -0,0 +1,16 @@ +/* + * Author: commy2 + * Initializes the modifier key handler. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public : No + */ +#include "script_component.hpp" + +(findDisplay 46) displayAddEventHandler ["KeyDown", FUNC(handleModifierKey)]; +(findDisplay 46) displayAddEventHandler ["KeyUp", FUNC(handleModifierKeyUp)]; diff --git a/addons/common/functions/fnc_handleModifierKeyUp.sqf b/addons/common/functions/fnc_handleModifierKeyUp.sqf new file mode 100644 index 0000000000..ffa5855115 --- /dev/null +++ b/addons/common/functions/fnc_handleModifierKeyUp.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Handles key up event for modifier key. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public : No + */ +#include "script_component.hpp" + +ACE_modifier = 0; + +false diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 2ff7d07c0d..7276bc4284 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -7,8 +7,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); - serverInit = QUOTE(call COMPILE_FILE(XEH_serverInit)); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_postInit.sqf similarity index 50% rename from addons/dragging/XEH_clientInit.sqf rename to addons/dragging/XEH_postInit.sqf index e80d63cfde..5a54f8c8a2 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -1,7 +1,14 @@ // by PabstMirror, commy2 #include "script_component.hpp" -[DFUNC(handleScrollWheel)] call EFUNC(common,addScrollWheelEventHandler); +if (isServer) then { + // release object on hard disconnection. Function is identical to killed + addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleKilled)}]; +}; + +if (!hasInterface) exitWith {}; + +[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); if (isNil "ACE_maxWeightDrag") then { ACE_maxWeightDrag = 800; @@ -15,11 +22,11 @@ if (isNil "ACE_maxWeightCarry") then { ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); // release object on player change. This does work when returning to lobby, but not when hard disconnecting. -["playerChanged", DFUNC(handlePlayerChanged)] call EFUNC(common,addEventhandler); -["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerWeaponChanged", DFUNC(handlePlayerWeaponChanged)] call EFUNC(common,addEventhandler); +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerWeaponChanged", {_this call FUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); // handle waking up dragged unit and falling unconscious while dragging -["medical_onUnconscious", DFUNC(handleUnconscious)] call EFUNC(common,addEventhandler); +["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); //@todo Captivity? diff --git a/addons/dragging/XEH_serverInit.sqf b/addons/dragging/XEH_serverInit.sqf deleted file mode 100644 index 01d78ef4e3..0000000000 --- a/addons/dragging/XEH_serverInit.sqf +++ /dev/null @@ -1,5 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -// release object on hard disconnection. Function is identical to killed -addMissionEventHandler ["HandleDisconnect", DFUNC(handleKilled)]; diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index a6b8fed5ab..6ee28edff3 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -18,7 +18,7 @@ params ["_unit", "_target"]; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; -// a static weapon has to be empty for dragging -if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; +// a static weapon has to be empty for dragging (ignore UAV AI) +if (((typeOf _target) isKindOf "StaticWeapon") && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false}; alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})} diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 4ab3562ba2..58c4718407 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -21,7 +21,7 @@ _target = _this select 1; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; -// a static weapon has to be empty for dragging -if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; +// a static weapon has to be empty for dragging (ignore UAV AI) +if ((typeOf _target) isKindOf "StaticWeapon" && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false}; alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 7f70b2bdc5..8bea72b907 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -17,7 +17,7 @@ params ["_unit", "_target"]; // get attachTo offset and direction. -private ["_position", "_direction"]; +private ["_position", "_direction", "_UAVCrew"]; _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; _direction = _target getVariable [QGVAR(carryDirection), 0]; @@ -48,29 +48,26 @@ if (_target isKindOf "CAManBase") then { _unit setVariable [QGVAR(isCarrying), true, true]; _unit setVariable [QGVAR(carriedObject), _target, true]; -// add scrollwheel action to release object -private "_actionID"; -_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; +// add drop action +_unit setVariable [QGVAR(ReleaseActionID), [ + _unit, "DefaultAction", + {!isNull ((_this select 0) getVariable [QGVAR(carriedObject), objNull])}, + {[_this select 0, (_this select 0) getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry)} +] call EFUNC(common,addActionEventHandler)]; -if (_actionID != -1) then { - _unit removeAction _actionID; -}; - -_actionID = _unit addAction [ - format ["%1", localize LSTRING(Drop)], - QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])] call FUNC(dropObject_carry)), - nil, - 20, - false, - true, - "", - QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])) -]; - -_unit setVariable [QGVAR(ReleaseActionID), _actionID]; +// show mouse hint +[localize LSTRING(Drop), "", localize LSTRING(LowerRaise)] call EFUNC(interaction,showMouseHint); // check everything [FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler; // reset current dragging height. GVAR(currentHeightChange) = 0; + +// prevent UAVs from firing +_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); + +if !(_UAVCrew isEqualTo []) then { + {_target deleteVehicleCrew _x} count _UAVCrew; + _target setVariable [QGVAR(isUAV), true, true]; +}; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index d12a98213a..17fbc60c06 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -14,9 +14,10 @@ */ #include "script_component.hpp" -private ["_position", "_direction", "_offset", "_actionID"]; params ["_unit", "_target"]; +private ["_position", "_direction", "_offset", "_UAVCrew"]; + // get attachTo offset and direction. _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; _direction = _target getVariable [QGVAR(dragDirection), 0]; @@ -37,28 +38,26 @@ if (_target isKindOf "CAManBase") then { _unit setVariable [QGVAR(isDragging), true, true]; _unit setVariable [QGVAR(draggedObject), _target, true]; -// add scrollwheel action to release object -_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; +// add drop action +_unit setVariable [QGVAR(ReleaseActionID), [ + _unit, "DefaultAction", + {!isNull ((_this select 0) getVariable [QGVAR(draggedObject), objNull])}, + {[_this select 0, (_this select 0) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject)} +] call EFUNC(common,addActionEventHandler)]; -if (_actionID != -1) then { - _unit removeAction _actionID; -}; - -_actionID = _unit addAction [ - format ["%1", localize LSTRING(Drop)], - QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)), - nil, - 20, - false, - true, - "", - QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])) -]; - -_unit setVariable [QGVAR(ReleaseActionID), _actionID]; +// show mouse hint +[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint); // check everything [FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler; // reset current dragging height. GVAR(currentHeightChange) = 0; + +// prevent UAVs from firing +_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); + +if !(_UAVCrew isEqualTo []) then { + {_target deleteVehicleCrew _x} count _UAVCrew; + _target setVariable [QGVAR(isUAV), true, true]; +}; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 2ae07be091..9da1656b8b 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -16,8 +16,8 @@ params ["_unit", "_target"]; -// remove scroll wheel action -_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); +// remove drop action +[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler); private "_inBuilding"; _inBuilding = [_unit] call FUNC(isObjectOnObject); @@ -49,6 +49,9 @@ if (_inBuilding) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); }; +// hide mouse hint +[] call EFUNC(interaction,hideMouseHint); + _unit setVariable [QGVAR(isDragging), false, true]; _unit setVariable [QGVAR(draggedObject), objNull, true]; @@ -63,3 +66,8 @@ if !(_target isKindOf "CAManBase") then { if (_unit getvariable ["ACE_isUnconscious", false]) then { [_unit, "unconscious", 2, true] call EFUNC(common,doAnimation); }; + +// recreate UAV crew +if (_target getVariable [QGVAR(isUAV), false]) then { + createVehicleCrew _target; +}; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 86009ac867..300846bc6c 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -16,8 +16,8 @@ params ["_unit", "_target"]; -// remove scroll wheel action -_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); +// remove drop action +[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler); private "_inBuilding"; _inBuilding = [_unit] call FUNC(isObjectOnObject); @@ -55,6 +55,9 @@ if (_inBuilding) then { _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); }; +// hide mouse hint +[] call EFUNC(interaction,hideMouseHint); + _unit setVariable [QGVAR(isCarrying), false, true]; _unit setVariable [QGVAR(carriedObject), objNull, true]; @@ -65,3 +68,8 @@ if !(_target isKindOf "CAManBase") then { ["fixPosition", _target, _target] call EFUNC(common,targetEvent); ["fixFloating", _target, _target] call EFUNC(common,targetEvent); }; + +// recreate UAV crew +if (_target getVariable [QGVAR(isUAV), false]) then { + createVehicleCrew _target; +}; diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index cd613316ec..73c42c2810 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -13,20 +13,15 @@ */ #include "script_component.hpp" -private ["_unit", "_carriedItem", "_position", "_maxHeight"]; - params ["_scrollAmount"]; -// requires modifier key to be hold down -if (missionNamespace getVariable ["ACE_Modifier", 0] == 0) exitWith {false}; +private ["_unit", "_carriedItem", "_position", "_maxHeight"]; _unit = ACE_player; // EH is always assigned. Exit and don't overwrite input if not carrying if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false}; - - // move carried item 15 cm per scroll interval _scrollAmount = _scrollAmount * 0.15; diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 35f9d6038d..42bd0ccd02 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -49,5 +49,9 @@ Trasporta Нести + + Raise/Lower + Heben/Senken + diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index a346d3b4be..f23cb2fc00 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -94,16 +94,16 @@ Отмена - + Modifier, rotates - + Modifikator, drehen - + Modificador, girar - + Modificateur, tourner - + Modificatore, rotazione - + Modifikátor, otočit - + Változtatás, forgatás - + Modyfikator, obrót - + Modificador, rotaciona - + Bращать + +Ctrl rotate + +Strg drehen + +Ctrl girar + +Ctrl tourner + +Ctrl rotazione + +Ctrl otočit + +Ctrl forgatás + +Ctrl obrót + +Ctrl rotaciona + +Ctrl Bращать Turn On Thor III diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp index 8359ee560a..4788e47c0d 100644 --- a/addons/interaction/Menu_Config.hpp +++ b/addons/interaction/Menu_Config.hpp @@ -148,7 +148,7 @@ class RscInteractionHelperIcon: RscInteractionIcon { class RscInteractionText: RscText{ x = 21 * GUI_GRID_W; y = 16 * GUI_GRID_H; - w = 8 * GUI_GRID_W; + w = 24 * GUI_GRID_W; h = 1.5 * GUI_GRID_H; }; class RscTitles { diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 8d97803b1d..7ecf9a5f5c 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -64,22 +64,5 @@ private ["_team"]; {false}, [20, [true, false, false]], false] call cba_fnc_addKeybind; -["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey), -{ - // Conditions: canInteract - //if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed - - // Statement - ACE_Modifier = 1; - // Return false so it doesn't block other actions - false -}, -{ - //Probably don't want any condidtions here, so variable never gets locked down - ACE_Modifier = 0; - false; -}, -[29, [false, false, false]], false] call cba_fnc_addKeybind; - ["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); ["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index 69acba25a2..39f43e7fa3 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -15,7 +15,8 @@ */ #include "script_component.hpp" -if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{}; +if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith {}; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; + showHUD true; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index e3a9b45f94..e8f279cc0c 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -20,18 +20,16 @@ #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04) -private ["_scroll", "_display"]; +params ["_leftClick", "_rightClick", ["_scroll", ""]]; -PARAMS_2(_leftClick,_rightClick); -_scroll = ""; -if (count _this > 2) then { - _scroll = _this select 2; -}; +(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN", 0.5, false]; -(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN",0.5, false]; disableSerialization; + +private "_display"; _display = uiNamespace getVariable ["ACE_Helper_Display", objNull]; -if (isNull _display) exitWith{}; + +if (isNull _display) exitWith {}; (_display displayCtrl 1000) ctrlSetText _leftClick; (_display displayCtrl 1001) ctrlSetText _rightClick; @@ -44,10 +42,12 @@ if (isNull _display) exitWith{}; if (_scroll == "") exitWith { (_display displayCtrl 1002) ctrlShow false; (_display displayCtrl 1202) ctrlShow false; - (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; - (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; + (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 24 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1.5 * GUI_GRID_W, 1 * GUI_GRID_H]; (_display displayCtrl 1001) ctrlCommit 0; (_display displayCtrl 1201) ctrlCommit 0; }; + (_display displayCtrl 1002) ctrlSetText _scroll; + showHUD false; diff --git a/addons/sandbag/CfgEventHandlers.hpp b/addons/sandbag/CfgEventHandlers.hpp index 17911f6b1f..da53514f3b 100644 --- a/addons/sandbag/CfgEventHandlers.hpp +++ b/addons/sandbag/CfgEventHandlers.hpp @@ -1,19 +1,28 @@ + class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; class Extended_Init_EventHandlers { class ACE_SandbagObject { class ADDON { - init = QUOTE(_this call DEFUNC(dragging,initObject)); + init = QUOTE(_this call EFUNC(dragging,initObject)); }; }; -}; \ No newline at end of file +}; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; diff --git a/addons/sandbag/CfgVehicles.hpp b/addons/sandbag/CfgVehicles.hpp index 5a9b530062..a2b255318e 100644 --- a/addons/sandbag/CfgVehicles.hpp +++ b/addons/sandbag/CfgVehicles.hpp @@ -1,14 +1,15 @@ + class CfgVehicles { class Man; class CAManBase: Man { class ACE_SelfActions { - class ACE_Sandbags { + class GVAR(place) { displayName = CSTRING(DeploySandbag); - condition = QUOTE(call FUNC(canDeploy)); - //wait a frame to handle "Do When releasing action menu key" option: - statement = QUOTE([ARR_2({_this call FUNC(deploy)}, [])] call EFUNC(common,execNextFrame)); + condition = QUOTE(_this call FUNC(canDeploy)); + //wait a frame to handle "Do When releasing action menu key" option + statement = QUOTE([ARR_2({_this call FUNC(deploy)},_this)] call EFUNC(common,execNextFrame)); exceptions[] = {"isNotSwimming"}; - showDisabled = 1; + showDisabled = 0; priority = 4; icon = PATHTOF(UI\icon_sandbag_ca.paa); }; @@ -26,8 +27,8 @@ class CfgVehicles { MACRO_ADDITEM(ACE_Sandbag_empty,1); }; }; - /* - class ACE_Item_Sandbag: Item_Base_F { + + /*class ACE_Item_Sandbag: Item_Base_F { author = ECSTRING(common,ACETeam); scope = 2; scopeCurator = 2; @@ -39,8 +40,8 @@ class CfgVehicles { count = 1; }; }; - }; - */ + };*/ + class thingX; class ACE_SandbagObject: thingX { author = ECSTRING(common,ACETeam); @@ -55,10 +56,10 @@ class CfgVehicles { nameSound = "Bunker"; icon = PATHTOF(UI\icon_sandbag_ca.paa); accuracy = 1000; - destrType = "DestructDefault"; class DestructionEffects {}; + class Damage { tex[] = {}; mat[] = { @@ -67,28 +68,19 @@ class CfgVehicles { "z\ace\addons\sandbag\data\bag_destruct.rvmat" }; }; + class ACE_Actions { class ACE_MainActions { selection = ""; distance = 5; condition = "true"; + class ACE_PickUp { selection = ""; displayName = CSTRING(PICKUPSB); distance = 4; - condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)])); - statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); - showDisabled = 0; - exceptions[] = {}; - priority = 5; - icon = PATHTOF(UI\icon_sandbag_ca.paa); - }; - class ACE_Carry { - selection = ""; - displayName = CSTRING(CARRYSB); - distance = 4; - condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)])); - statement = QUOTE([ARR_2(_target,_player)] call FUNC(carry)); + condition = QUOTE(!(_player getVariable [ARR_2(QUOTE(QGVAR(isUsingSandbag)),false)])); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(pickup)); showDisabled = 0; exceptions[] = {}; priority = 5; @@ -97,6 +89,7 @@ class CfgVehicles { }; }; }; + class ACE_SandbagObject_NoGeo: ACE_SandbagObject { scope = 1; model = PATHTOF(data\ace_sandbag_nogeo.p3d); diff --git a/addons/sandbag/XEH_postInit.sqf b/addons/sandbag/XEH_postInit.sqf index d1c0ad0766..c3f99c2a9b 100644 --- a/addons/sandbag/XEH_postInit.sqf +++ b/addons/sandbag/XEH_postInit.sqf @@ -1,15 +1,27 @@ #include "script_component.hpp" -GVAR(placer) = objNull; +if (isServer) then { + // Cancel deploy on hard disconnection. Function is identical to killed + addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleKilled)}]; +}; + +if (!hasInterface) exitWith {}; + GVAR(sandBag) = objNull; GVAR(deployPFH) = -1; GVAR(deployDirection) = 0; -// Cancel deploy sandbag if interact menu opened -["interactMenuOpened", { - if (GVAR(deployPFH) != -1 && {!isNull (GVAR(sandBag))}) then { - call FUNC(deployCancel); - }; -}] call EFUNC(common,addEventHandler); +[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); -[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); +// Cancel deploy sandbag if interact menu opened +["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler); + +// Cancel deploy on player change. This does work when returning to lobby, but not when hard disconnecting. +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerInventoryChanged", {_this call FUNC(handlePlayerInventoryChanged)}] call EFUNC(common,addEventhandler); +["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); + +// handle waking up dragged unit and falling unconscious while dragging +["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); + +//@todo Captivity? diff --git a/addons/sandbag/XEH_preInit.sqf b/addons/sandbag/XEH_preInit.sqf index 1978913723..444dca7ae0 100644 --- a/addons/sandbag/XEH_preInit.sqf +++ b/addons/sandbag/XEH_preInit.sqf @@ -3,12 +3,15 @@ ADDON = false; PREP(canDeploy); -PREP(carry); PREP(deploy); PREP(deployCancel); PREP(deployConfirm); -PREP(drop); +PREP(handleInteractMenuOpened); +PREP(handleKilled); +PREP(handlePlayerChanged); +PREP(handlePlayerInventoryChanged); PREP(handleScrollWheel); +PREP(handleUnconscious); PREP(pickup); ADDON = true; diff --git a/addons/sandbag/functions/fnc_canDeploy.sqf b/addons/sandbag/functions/fnc_canDeploy.sqf index 0c5fda5b4c..d26569f4ab 100644 --- a/addons/sandbag/functions/fnc_canDeploy.sqf +++ b/addons/sandbag/functions/fnc_canDeploy.sqf @@ -1,5 +1,5 @@ /* - * Author: Ruthberg + * Author: Ruthberg, commy2 * Checks if the player can deploy a sandbag * * Arguments: @@ -9,7 +9,7 @@ * Can deploy * * Example: - * [] call ace_sandbag_fnc_canDeploy + * [ACE_player] call ace_sandbag_fnc_canDeploy * * Public: No */ @@ -17,13 +17,13 @@ #define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"] -if !([ACE_player, "ACE_Sandbag_empty"] call EFUNC(common,hasItem)) exitWith { false }; -if (ACE_player getVariable [QGVAR(usingSandbag), false]) exitWith { false }; -if ((getPosATL ACE_player select 2) - (getPos ACE_player select 2) > 1E-5) exitWith { false }; +params ["_unit"]; + +if !("ACE_Sandbag_empty" in items _unit) exitWith {false}; private ["_surfaceClass", "_surfaceType"]; -_surfaceClass = ([surfaceType (position ACE_player), "#"] call CBA_fnc_split) select 1; +_surfaceClass = (surfaceType getPosASL _unit) select [1]; _surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); !(_surfaceType in SURFACE_BLACKLIST) diff --git a/addons/sandbag/functions/fnc_carry.sqf b/addons/sandbag/functions/fnc_carry.sqf deleted file mode 100644 index 84ab8c1883..0000000000 --- a/addons/sandbag/functions/fnc_carry.sqf +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Author: Ruthberg - * Carry sandbag - * - * Arguments: - * 0: sandbag - * 1: unit - * - * Return Value: - * None - * - * Example: - * [_sandbag, _unit] call ace_sandbag_fnc_carry - * - * Public: No - */ -#include "script_component.hpp" - -params ["_sandbag", "_unit"]; - -_unit playActionNow "PutDown"; - -_unit setVariable [QGVAR(usingSandbag), true]; -[{ - params ["_sandbag", "_unit"]; - - GVAR(carrier) = ACE_player; - - [GVAR(carrier), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus); - - deleteVehicle _sandbag; - - GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; - GVAR(sandBag) enableSimulationGlobal false; - - // Force physx update - { - _x setPosASL (getPosASL _x); - } count (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]); - - GVAR(carryPFH) = [{ - if (GVAR(carrier) != ACE_player) exitWith { - call FUNC(drop); - }; - GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0])); - GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player); - }, 0, []] call CBA_fnc_addPerFrameHandler; - - [localize LSTRING(DropSandbag), "", ""] call EFUNC(interaction,showMouseHint); - - GVAR(carrier) setVariable [QGVAR(drop), - [GVAR(carrier), "DefaultAction", - {GVAR(carryPFH) != -1 && !isNull (GVAR(sandBag))}, - {call FUNC(drop);} - ] call EFUNC(common,AddActionEventHandler)]; -}, [_sandbag, _unit], 1, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 5bb162e029..de5bd9458e 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -1,47 +1,61 @@ /* - * Author: Garth 'L-H' de Wet, Ruthberg + * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support * Starts the deploy process for sandbags. * * Arguments: - * None + * 0: unit * * Return Value: * None * * Example: - * [] call ace_sandbag_fnc_deploy + * [ACE_player] call ace_sandbag_fnc_deploy * * Public: No */ #include "script_component.hpp" -closeDialog 0; +params ["_unit"]; -GVAR(placer) = ACE_player; +// prevent the placing unit from running +[_unit, "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus); -[GVAR(placer), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus); +// create the sandbag +private "_sandBag"; +_sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; -GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; -GVAR(sandBag) enableSimulationGlobal false; +GVAR(sandBag) = _sandBag; +// prevent collisions with sandbag +["enableSimulationGlobal", [_sandBag, false]] call EFUNC(common,serverEvent); + +GVAR(deployDirection) = 0; + +// pfh that runs while the deployment is in progress GVAR(deployPFH) = [{ - if (GVAR(placer) != ACE_player) exitWith { - call FUNC(deployCancel); - }; - GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0])); - GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player); -}, 0, []] call CBA_fnc_addPerFrameHandler; + (_this select 0) params ["_unit", "_sandBag"]; + if (isNull _sandBag) exitWith { + [_unit] call FUNC(deployCancel); + }; + + _sandBag setPosASL (eyePos _unit vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0])); + _sandBag setDir (GVAR(deployDirection) + getDir _unit); +}, 0, [_unit, _sandBag]] call CBA_fnc_addPerFrameHandler; + +// add mouse button action and hint [localize LSTRING(ConfirmDeployment), localize LSTRING(CancelDeployment), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); -GVAR(placer) setVariable [QGVAR(Deploy), - [GVAR(placer), "DefaultAction", - {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, - {call FUNC(deployConfirm);} -] call EFUNC(common,AddActionEventHandler)]; +_unit setVariable [QGVAR(Deploy), [ + _unit, "DefaultAction", + {GVAR(deployPFH) != -1}, + {[_this select 0] call FUNC(deployConfirm)} +] call EFUNC(common,addActionEventHandler)]; -GVAR(placer) setVariable [QGVAR(Cancel), - [GVAR(placer), "zoomtemp", - {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, - {call FUNC(deployCancel);} -] call EFUNC(common,AddActionEventHandler)]; +_unit setVariable [QGVAR(Cancel), [ + _unit, "zoomtemp", + {GVAR(deployPFH) != -1}, + {[_this select 0] call FUNC(deployCancel)} +] call EFUNC(common,addActionEventHandler)]; + +_unit setVariable [QGVAR(isDeploying), true, true]; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf index bb7480a59e..9186ddbf57 100644 --- a/addons/sandbag/functions/fnc_deployCancel.sqf +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -1,35 +1,36 @@ /* - * Author: Garth 'L-H' de Wet, Ruthberg + * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support * Cancels sandbag deployment * * Arguments: - * None + * 0: unit * * Return Value: * None * * Example: - * [] call ace_sandbag_fnc_deployCancel + * [ACE_player] call ace_sandbag_fnc_deployCancel * * Public: No */ #include "script_component.hpp" -if (isNull GVAR(placer)) exitWith {}; +params ["_unit"]; -[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler; +// enable running again +[_unit, "ACE_Sandbag", false] call EFUNC(common,setForceWalkStatus); -if (!isNull (GVAR(sandBag))) then { - deleteVehicle GVAR(sandBag); -}; +// delete placement dummy +deleteVehicle GVAR(sandBag); -[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus); +// remove deployment pfh +[GVAR(deployPFH)] call CBA_fnc_removePerFrameHandler; +GVAR(deployPFH) = -1; +// remove mouse button actions call EFUNC(interaction,hideMouseHint); -[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); -GVAR(placer) addItem "ACE_Sandbag_empty"; +[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler); +[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler); -GVAR(sandBag) = objNull; -GVAR(placer) = objNull; +_unit setVariable [QGVAR(isDeploying), false, true]; diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 61264c15fe..62848dd0cd 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -1,51 +1,59 @@ /* - * Author: Garth 'L-H' de Wet, Ruthberg + * Author: Garth 'L-H' de Wet, Ruthberg, edited by commy2 for better MP and eventual AI support * Confirms sandbag deployment * * Arguments: - * None + * 0: unit * * Return Value: * None * * Example: - * [] call ace_sandbag_fnc_deployConfirm + * [ACE_player] call ace_sandbag_fnc_deployConfirm * * Public: No */ #include "script_component.hpp" -if (isNull GVAR(sandBag) || isNull GVAR(placer)) exitWith {}; +params ["_unit"]; -[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler; +// enable running again +[_unit, "ACE_Sandbag", false] call EFUNC(common,setForceWalkStatus); -[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus); -[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +// remove sandbag from inventory +_unit removeItem "ACE_Sandbag_empty"; -call EFUNC(interaction,hideMouseHint); - -GVAR(placer) playActionNow "PutDown"; - -GVAR(placer) setVariable [QGVAR(usingSandbag), true]; +// delete placement dummy and create real sandbag [{ - _this setVariable [QGVAR(usingSandbag), false]; -}, GVAR(placer), 1.5, 0.5] call EFUNC(common,waitAndExecute); + if (isNull GVAR(sandBag)) exitWith {}; + + params ["_unit"]; + + private ["_position", "_direction", "_sandBag"]; -[{ - private ["_sandBag", "_position", "_direction"]; _position = getPosASL GVAR(sandBag); _direction = getDir GVAR(sandBag); deleteVehicle GVAR(sandBag); _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; - _sandBag enableSimulationGlobal true; _sandBag setPosASL _position; _sandBag setDir _direction; - GVAR(placer) removeItem "ACE_Sandbag_empty"; - GVAR(sandBag) = objNull; - GVAR(placer) = objNull; -}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute); +}, [_unit], 1] call EFUNC(common,waitAndExecute); + +// remove deployment pfh +[GVAR(deployPFH)] call CBA_fnc_removePerFrameHandler; +GVAR(deployPFH) = -1; + +// remove mouse button actions +call EFUNC(interaction,hideMouseHint); + +[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler); +[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler); + +// play animation +_unit playActionNow "PutDown"; + +_unit setVariable [QGVAR(isDeploying), false, true]; diff --git a/addons/sandbag/functions/fnc_drop.sqf b/addons/sandbag/functions/fnc_drop.sqf deleted file mode 100644 index 3ba825d423..0000000000 --- a/addons/sandbag/functions/fnc_drop.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet, Ruthberg - * Drop sandbag - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_sandbag_fnc_deployCancel - * - * Public: No - */ -#include "script_component.hpp" - -if (isNull GVAR(sandBag) || isNull GVAR(carrier)) exitWith {}; - -[GVAR(carryPFH)] call cba_fnc_removePerFrameHandler; - -[GVAR(carrier), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus); -[GVAR(carrier), "DefaultAction", GVAR(carrier) getVariable [QGVAR(drop), -1]] call EFUNC(Common,removeActionEventHandler); - -call EFUNC(interaction,hideMouseHint); - -GVAR(carrier) playActionNow "PutDown"; - -[{ - _this setVariable [QGVAR(usingSandbag), false]; -}, GVAR(carrier), 1.5, 0.5] call EFUNC(common,waitAndExecute); - -[{ - private ["_sandBag", "_position", "_direction"]; - _position = getPosASL GVAR(sandBag); - _direction = getDir GVAR(sandBag); - - deleteVehicle GVAR(sandBag); - - _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; - _sandBag enableSimulationGlobal true; - _sandBag setPosASL _position; - _sandBag setDir _direction; - - GVAR(sandBag) = objNull; - GVAR(carrier) = objNull; -}, [], 1.0, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf b/addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf new file mode 100644 index 0000000000..f4ea5891c7 --- /dev/null +++ b/addons/sandbag/functions/fnc_handleInteractMenuOpened.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle opening of interaction menu. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (_unit getVariable [QGVAR(isDeploying), false]) then { + [_unit] call FUNC(deployCancel); +}; diff --git a/addons/sandbag/functions/fnc_handleKilled.sqf b/addons/sandbag/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..63babd3f52 --- /dev/null +++ b/addons/sandbag/functions/fnc_handleKilled.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle death. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (_unit getVariable [QGVAR(isDeploying), false]) then { + [_unit] call FUNC(deployCancel); +}; diff --git a/addons/sandbag/functions/fnc_handlePlayerChanged.sqf b/addons/sandbag/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..f27a295903 --- /dev/null +++ b/addons/sandbag/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,24 @@ +/* + * Author: commy2 + * Handle player changes. + * + * Arguments: + * 0: New Player Unit + * 1: Old Player Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_newPlayer", "_oldPlayer"]; + +if (_newPlayer getVariable [QGVAR(isDeploying), false]) then { + [_newPlayer] call FUNC(deployCancel); +}; + +if (_oldPlayer getVariable [QGVAR(isDeploying), false]) then { + [_oldPlayer] call FUNC(deployCancel); +}; diff --git a/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf b/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf new file mode 100644 index 0000000000..9f5920edd1 --- /dev/null +++ b/addons/sandbag/functions/fnc_handlePlayerInventoryChanged.sqf @@ -0,0 +1,22 @@ +/* + * Author: commy2 + * Handle the InventoryChanged event. + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (_unit getVariable [QGVAR(isDeploying), false]) then { + if !("ACE_Sandbag_empty" in items _unit) then { + [_unit] call FUNC(deployCancel); + }; +}; diff --git a/addons/sandbag/functions/fnc_handleUnconscious.sqf b/addons/sandbag/functions/fnc_handleUnconscious.sqf new file mode 100644 index 0000000000..7e0e257158 --- /dev/null +++ b/addons/sandbag/functions/fnc_handleUnconscious.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle unconsciousness. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (_unit getVariable [QGVAR(isDeploying), false]) then { + [_unit] call FUNC(deployCancel); +}; diff --git a/addons/sandbag/functions/fnc_pickup.sqf b/addons/sandbag/functions/fnc_pickup.sqf index dd0b93fd59..7e04d047fd 100644 --- a/addons/sandbag/functions/fnc_pickup.sqf +++ b/addons/sandbag/functions/fnc_pickup.sqf @@ -3,27 +3,32 @@ * Pick up sandbag * * Arguments: - * 0: sandbag - * 1: unit + * 0: unit + * 1: sandbag * * Return Value: * None * * Example: - * [_sandbag, _unit] call ace_sandbag_fnc_pickup + * [_unit, _sandbag] call ace_sandbag_fnc_pickup * * Public: No */ #include "script_component.hpp" -params ["_sandbag", "_unit"]; +params ["_unit", "_sandbag"]; _unit playActionNow "PutDown"; -_unit setVariable [QGVAR(usingSandbag), true]; +_unit setVariable [QGVAR(isUsingSandbag), true]; + [{ - params ["_sandbag", "_unit"]; - _unit setVariable [QGVAR(usingSandbag), false]; + params ["_unit", "_sandbag"]; + + _unit setVariable [QGVAR(isUsingSandbag), false]; + + if (isNull _sandbag) exitWith {}; + deletevehicle _sandbag; // Force physx update @@ -32,4 +37,4 @@ _unit setVariable [QGVAR(usingSandbag), true]; } count (_unit nearObjects ["ACE_SandbagObject", 5]); [_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory); -}, [_sandbag, _unit], 1.5, 0.5] call EFUNC(common,waitAndExecute); +}, [_unit, _sandbag], 1.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/stringtable.xml b/addons/sandbag/stringtable.xml index 5576add969..c67173466c 100644 --- a/addons/sandbag/stringtable.xml +++ b/addons/sandbag/stringtable.xml @@ -146,16 +146,16 @@ Aqui não tem areia - + Modifier, rotates - + Modifikator, drehen - + Modificador, girar - + Modificateur, tourner - + Modificatore, rotazione - + Modifikátor, otočit - + Változtatás, forgatás - + Modyfikator, obrót - + Modificador, rotaciona - + Bращать + +Ctrl rotate + +Strg drehen + +Ctrl girar + +Ctrl tourner + +Ctrl rotazione + +Ctrl otočit + +Ctrl forgatás + +Ctrl obrót + +Ctrl rotaciona + +Ctrl Bращать \ No newline at end of file diff --git a/addons/tacticalladder/CfgEventHandlers.hpp b/addons/tacticalladder/CfgEventHandlers.hpp index 737cae5e43..f9ceb35aa5 100644 --- a/addons/tacticalladder/CfgEventHandlers.hpp +++ b/addons/tacticalladder/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE( call COMPILE_FILE(XEH_preInit) ); @@ -9,3 +10,11 @@ class Extended_PostInit_EventHandlers { init = QUOTE( call COMPILE_FILE(XEH_postInit) ); }; }; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; diff --git a/addons/tacticalladder/CfgVehicles.hpp b/addons/tacticalladder/CfgVehicles.hpp index a1eda1a955..1457c4ddee 100644 --- a/addons/tacticalladder/CfgVehicles.hpp +++ b/addons/tacticalladder/CfgVehicles.hpp @@ -5,8 +5,8 @@ class CfgVehicles { class ACE_SelfActions { class ACE_TacticalLadders { displayName = CSTRING(Deploy); - condition = QUOTE((backpack ACE_player) == QUOTE(QUOTE(ACE_TacticalLadder_Pack))); - statement = QUOTE(call FUNC(deployTL)); + condition = QUOTE(backpack _player == 'ACE_TacticalLadder_Pack'); + statement = QUOTE([_player] call FUNC(deployTL)); exceptions[] = {}; showDisabled = 1; priority = 4; @@ -33,7 +33,7 @@ class CfgVehicles { }; class House; - class ACE_Tactical_Ladder: House { + class ACE_TacticalLadder: House { XEH_ENABLED; displayName = CSTRING(DisplayName); class DestructionEffects {}; @@ -42,6 +42,7 @@ class CfgVehicles { autocenter = 0; featureSize = 12; ladders[] = {{"start","end"}}; + class AnimationSources { class rotate { source = "user"; @@ -62,28 +63,31 @@ class CfgVehicles { class extract_10: extract_1 {}; class extract_11: extract_1 {}; }; + class ACE_Actions { class ACE_MainActions { selection = "roadway"; distance = 5; condition = "true"; + class ACE_PickUp { selection = ""; displayName = CSTRING(Pickup); distance = 4; condition = QUOTE((backpack ACE_player) == ''); - statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickupTL)); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(pickupTL)); showDisabled = 0; exceptions[] = {}; priority = 5; }; + class ACE_Position { selection = ""; displayName = CSTRING(Position); distance = 4; condition = "true"; //wait a frame to handle "Do When releasing action menu key" option: - statement = QUOTE([ARR_2({_this call FUNC(positionTL)}, [ARR_2(_target,_player)])] call EFUNC(common,execNextFrame)); + statement = QUOTE([ARR_2({_this call FUNC(positionTL)},[ARR_2(_player,_target)])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; diff --git a/addons/tacticalladder/XEH_postInit.sqf b/addons/tacticalladder/XEH_postInit.sqf index f0091ec7fa..8ebf776987 100644 --- a/addons/tacticalladder/XEH_postInit.sqf +++ b/addons/tacticalladder/XEH_postInit.sqf @@ -1,15 +1,28 @@ #include "script_component.hpp" +if (!hasInterface) exitWith {}; + GVAR(ladder) = objNull; GVAR(cancelTime) = 0; GVAR(currentStep) = 3; GVAR(currentAngle) = 0; -// Cancel tactical ladder deployment if the interact menu is opened -["interactMenuOpened", { +/*["interactMenuOpened", { if ((ACE_time > GVAR(cancelTime)) && !isNull GVAR(ladder)) then { GVAR(ladder) call FUNC(cancelTLdeploy); }; -}] call EFUNC(common,addEventHandler); +}] call EFUNC(common,addEventHandler);*/ -[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); +// Cancel adjustment if interact menu opens +["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler); + +[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); + +// Cancel adjusting on player change. +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); + +// handle falling unconscious +["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); + +// @todo captivity? diff --git a/addons/tacticalladder/XEH_preInit.sqf b/addons/tacticalladder/XEH_preInit.sqf index e434974c9a..cb1d3a8cf3 100644 --- a/addons/tacticalladder/XEH_preInit.sqf +++ b/addons/tacticalladder/XEH_preInit.sqf @@ -5,7 +5,11 @@ ADDON = false; PREP(cancelTLdeploy); PREP(confirmTLdeploy); PREP(deployTL); +PREP(handleKilled); +PREP(handleInteractMenuOpened); +PREP(handlePlayerChanged); PREP(handleScrollWheel); +PREP(handleUnconscious); PREP(pickupTL); PREP(positionTL); diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index 456d245832..c134df31d1 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -1,9 +1,10 @@ /* - * Author: Rocko, Ruthberg + * Author: Rocko, Ruthberg, commy2 * Cancel tactical ladder deployment * * Arguments: - * 0: ladder + * 0: unit + * 1: ladder * * Return Value: * None @@ -17,16 +18,23 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -params ["_ladder"]; +params ["_unit", "_ladder"]; + +// enable running again +[_unit, "ACE_Ladder", false] call EFUNC(common,setForceWalkStatus); detach _ladder; + _ladder animate ["rotate", 0]; + { _ladder animate [_x, 0]; } count __ANIMS; +// remove mouse buttons and hint call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); + +[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 764e5c73d8..0094e460dc 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -1,9 +1,10 @@ /* - * Author: Rocko, Ruthberg + * Author: Rocko, Ruthberg, commy2 * Confirm tactical ladder deployment * * Arguments: - * 0: ladder + * 0: unit + * 1: ladder * * Return Value: * Success @@ -15,18 +16,26 @@ */ #include "script_component.hpp" -params ["_ladder"]; +params ["_unit", "_ladder"]; + +// enable running again +[_unit, "ACE_Ladder", false] call EFUNC(common,setForceWalkStatus); private ["_pos1", "_pos2"]; -_pos1 = getPosASL GVAR(ladder); -_pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) call EFUNC(common,positionToASL); -if (lineIntersects [_pos1, _pos2, GVAR(ladder)]) exitWith { false }; -call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +_pos1 = getPosASL _ladder; +_pos2 = AGLToASL (_ladder modelToWorld (_ladder selectionPosition "check2")); + +if (lineIntersects [_pos1, _pos2, _ladder]) exitWith {false}; detach _ladder; + +// remove mouse buttons and hint +call EFUNC(interaction,hideMouseHint); + +[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(common,removeActionEventHandler); +[_unit, "zoomtemp", _unit getVariable [QGVAR(Cancel), -1]] call EFUNC(common,removeActionEventHandler); + GVAR(ladder) = objNull; true diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf index 14c386dda1..b0eb1e0f68 100644 --- a/addons/tacticalladder/functions/fnc_deployTL.sqf +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -3,32 +3,35 @@ * Deploy tactical ladder * * Arguments: - * None + * 0: unit * * Return Value: * None * * Example: - * [] call ace_tacticalladder_fnc_deployTL + * [_unit] call ace_tacticalladder_fnc_deployTL * * Public: No */ #include "script_component.hpp" -if ((backpack ACE_player) != "ACE_TacticalLadder_Pack") exitWith {}; +params ["_unit"]; + +if (backpack _unit != 'ACE_TacticalLadder_Pack') exitWith {}; + +removeBackpack _unit; private ["_pos", "_offset", "_ladder"]; -removeBackpack ACE_player; +_pos = _unit modelToWorld [0,0,0]; +_offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; -_pos = ACE_player modelToWorld [0,0,0]; -_offset = if ((ACE_player call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; -_pos set [0, (_pos select 0) + (sin (direction ACE_player) * _offset)]; -_pos set [1, (_pos select 1) + (cos (direction ACE_player) * _offset)]; -_pos set [2, [ACE_player] call CBA_fnc_realHeight]; +_pos set [0, (_pos select 0) + (sin getDir _unit) * _offset]; +_pos set [1, (_pos select 1) + (cos getDir _unit) * _offset]; +_pos set [2, [_unit] call CBA_fnc_realHeight]; -_ladder = "ACE_Tactical_Ladder" createVehicle _pos; +_ladder = "ACE_TacticalLadder" createVehicle _pos; _ladder setPos _pos; -_ladder setDir (direction ACE_player); +_ladder setDir getDir _unit; -ACE_player reveal _ladder; +_unit reveal _ladder; diff --git a/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf b/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf new file mode 100644 index 0000000000..c7187acd55 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_handleInteractMenuOpened.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle opening of interaction menu. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (!isNull (GETMVAR(GVAR(ladder),objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { + [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); +}; diff --git a/addons/tacticalladder/functions/fnc_handleKilled.sqf b/addons/tacticalladder/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..c5d6aa1314 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_handleKilled.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle death. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { + [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); +}; diff --git a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..bc8d1faf54 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,26 @@ +/* + * Author: commy2 + * Handle player changes. + * + * Arguments: + * 0: New Player Unit + * 1: Old Player Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +if (isNull (GETMVAR(ladder,objNull))) exitWith {}; + +params ["_newPlayer", "_oldPlayer"]; + +if (GVAR(ladder) in attachedObjects _newPlayer) then { + [_newPlayer, GVAR(ladder)] call FUNC(cancelTLdeploy); +}; + +if (GVAR(ladder) in attachedObjects _oldPlayer) then { + [_oldPlayer, GVAR(ladder)] call FUNC(cancelTLdeploy); +}; diff --git a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf index 6b5107b814..0b64d89610 100644 --- a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf +++ b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf @@ -41,7 +41,7 @@ if (GETMVAR(ACE_Modifier,0) == 0) then { }; } else { // Tilting - GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 90; + GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 30; GVAR(ladder) animate ["rotate", GVAR(currentAngle)]; }; diff --git a/addons/tacticalladder/functions/fnc_handleUnconscious.sqf b/addons/tacticalladder/functions/fnc_handleUnconscious.sqf new file mode 100644 index 0000000000..e9ce28d524 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_handleUnconscious.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle unconsciousness. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (!isNull (GETMVAR(ladder,objNull)) && {GVAR(ladder) in attachedObjects _unit}) then { + [_unit, GVAR(ladder)] call FUNC(cancelTLdeploy); +}; diff --git a/addons/tacticalladder/functions/fnc_pickupTL.sqf b/addons/tacticalladder/functions/fnc_pickupTL.sqf index ad409f8870..d8e313a17b 100644 --- a/addons/tacticalladder/functions/fnc_pickupTL.sqf +++ b/addons/tacticalladder/functions/fnc_pickupTL.sqf @@ -1,26 +1,27 @@ /* - * Author: Rocko, Ruthberg + * Author: Rocko, Ruthberg, commy2 * Pick up tactical ladder * * Arguments: - * 0: ladder - * 1: unit + * 0: unit + * 1: ladder * * Return Value: * Success * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL + * [_unit, _ladder] call ace_tacticalladder_fnc_pickupTL * * Public: No */ #include "script_component.hpp" -if ((backpack ACE_player) != "") exitWith { false }; +params ["_unit", "_ladder"]; -params ["_ladder", "_unit"]; +if (backpack _unit != "") exitWith {false}; deleteVehicle _ladder; + _unit addBackpack "ACE_TacticalLadder_Pack"; true diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 1035101556..1e7f0db209 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -3,14 +3,14 @@ * Position tactical ladder * * Arguments: - * 0: sandbag - * 1: unit + * 0: unit + * 1: ladder * * Return Value: * None * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL + * [_unit, _ladder] call ace_tacticalladder_fnc_positionTL * * Public: No */ @@ -18,13 +18,17 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -params ["_ladder", "_unit"]; +params ["_unit", "_ladder"]; + +// prevent the placing unit from running +[_unit, "ACE_Ladder", true] call EFUNC(common,setForceWalkStatus); { _ladder animate [_x, 0]; } count __ANIMS; -_unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03"; +[_unit, "amovpercmstpslowwrfldnon_player_idlesteady03", 2] call EFUNC(common,doAnimation); + _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player _ladder animate ["rotate", 0]; @@ -37,16 +41,17 @@ GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling GVAR(currentStep) = 3; GVAR(currentAngle) = 0; +// add mouse buttons and hints [localize LSTRING(Deploy), localize LSTRING(Drop), localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint); -ACE_player setVariable [QGVAR(Deploy), - [ACE_player, "DefaultAction", +_unit setVariable [QGVAR(Deploy), [ + _unit, "DefaultAction", {!isNull GVAR(ladder)}, - {GVAR(ladder) call FUNC(confirmTLdeploy);} -] call EFUNC(common,AddActionEventHandler)]; + {[_this select 0, GVAR(ladder)] call FUNC(confirmTLdeploy)} +] call EFUNC(common,addActionEventHandler)]; -ACE_player setVariable [QGVAR(Cancel), - [ACE_player, "zoomtemp", +_unit setVariable [QGVAR(Cancel), [ + _unit, "zoomtemp", {!isNull GVAR(ladder)}, - {GVAR(ladder) call FUNC(cancelTLdeploy);} -] call EFUNC(common,AddActionEventHandler)]; + {[_this select 0, GVAR(ladder)] call FUNC(cancelTLdeploy)} +] call EFUNC(common,addActionEventHandler)]; diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index a05c82efb2..98e041b1af 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -38,15 +38,8 @@ Derrubar escada - Adjust ladder - Leiter einstellen - Reguluj drabinę - Upravit žebřík - Ajustar escalera - Ajustar escada - Régler l'échelle - Létra állítása - Выровнять лестницу + Extend, +Ctrl tilt + Ausfahren, +Strg kippen Position ladder diff --git a/addons/tripod/CfgEventHandlers.hpp b/addons/tripod/CfgEventHandlers.hpp index d700ed4c85..ed59062ad5 100644 --- a/addons/tripod/CfgEventHandlers.hpp +++ b/addons/tripod/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE( call COMPILE_FILE(XEH_preInit) ); @@ -17,3 +18,11 @@ class Extended_Init_EventHandlers { }; }; }; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; diff --git a/addons/tripod/CfgVehicles.hpp b/addons/tripod/CfgVehicles.hpp index 2a689ba349..60486b8afb 100644 --- a/addons/tripod/CfgVehicles.hpp +++ b/addons/tripod/CfgVehicles.hpp @@ -2,15 +2,13 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_SelfActions { - class ACE_Equipment { - class GVAR(place) { - displayName = CSTRING(Placedown); - condition = QUOTE([ARR_2(_player,'ACE_Tripod')] call EFUNC(common,hasItem)); - statement = QUOTE([ARR_2(_player,'ACE_Tripod')] call FUNC(place)); - showDisabled = 0; - priority = 2; - icon = PATHTOF(UI\w_sniper_tripod_ca.paa); - }; + class GVAR(place) { + displayName = CSTRING(Placedown); + condition = QUOTE([ARR_2(_player,'ACE_Tripod')] call EFUNC(common,hasItem)); + statement = QUOTE([ARR_2(_player,'ACE_Tripod')] call FUNC(place)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(UI\w_sniper_tripod_ca.paa); }; }; }; @@ -37,9 +35,13 @@ class CfgVehicles { class thingX; class ACE_TripodObject: thingX { XEH_ENABLED; + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition[]) = {0,1,0}; + EGVAR(dragging,dragDirection) = 0; scope = 2; displayName = CSTRING(DisplayName); model = PATHTOF(data\sniper_tripod.p3d); + class AnimationSources { class slide_down_tripod { source = "user"; @@ -52,32 +54,32 @@ class CfgVehicles { class retract_leg_2: retract_leg_1 {}; class retract_leg_3: retract_leg_2 {}; }; - EGVAR(dragging,canDrag) = 1; - EGVAR(dragging,dragPosition[]) = {0,1,0}; - EGVAR(dragging,dragDirection) = 0; + class ACE_Actions { class ACE_MainActions { selection = ""; distance = 5; condition = "true"; + class ACE_Pickup { selection = ""; displayName = CSTRING(PickUp); distance = 5; condition = "true"; - statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(pickup)); showDisabled = 0; exceptions[] = {}; priority = 5; icon = PATHTOF(UI\w_sniper_tripod_ca.paa); }; + class ACE_Adjust { selection = ""; displayName = CSTRING(Adjust); distance = 5; condition = "true"; //wait a frame to handle "Do When releasing action menu key" option: - statement = QUOTE([ARR_2({_this call FUNC(adjust)}, [_target])] call EFUNC(common,execNextFrame)); + statement = QUOTE([ARR_2({_this call FUNC(adjust)}, [ARR_2(_player,_target)])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; diff --git a/addons/tripod/XEH_postInit.sqf b/addons/tripod/XEH_postInit.sqf index 706aaecae9..6f2dc9b7e0 100644 --- a/addons/tripod/XEH_postInit.sqf +++ b/addons/tripod/XEH_postInit.sqf @@ -1,16 +1,21 @@ #include "script_component.hpp" -GVAR(adjuster) = objNull; -GVAR(adjusting) = false; +if (!hasInterface) exitWith {}; + GVAR(adjustPFH) = -1; GVAR(height) = 0; // Cancel adjustment if interact menu opens -["interactMenuOpened", { - if (GVAR(adjustPFH) != -1 && GVAR(adjusting)) then { - GVAR(adjusting) = false; - }; -}] call EFUNC(common,addEventHandler); +["interactMenuOpened", {[ACE_player] call FUNC(handleInteractMenuOpened)}] call EFUNC(common,addEventHandler); -[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); +[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); + +// Cancel adjusting on player change. +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); + +// handle falling unconscious +["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); + +// @todo captivity? diff --git a/addons/tripod/XEH_preInit.sqf b/addons/tripod/XEH_preInit.sqf index f27b707936..1699258b47 100644 --- a/addons/tripod/XEH_preInit.sqf +++ b/addons/tripod/XEH_preInit.sqf @@ -3,7 +3,11 @@ ADDON = false; PREP(adjust); +PREP(handleInteractMenuOpened); +PREP(handleKilled); +PREP(handlePlayerChanged); PREP(handleScrollWheel); +PREP(handleUnconscious); PREP(pickup); PREP(place); diff --git a/addons/tripod/functions/fnc_adjust.sqf b/addons/tripod/functions/fnc_adjust.sqf index 1ba99cedbe..2b8659b2a4 100644 --- a/addons/tripod/functions/fnc_adjust.sqf +++ b/addons/tripod/functions/fnc_adjust.sqf @@ -9,37 +9,39 @@ * None * * Example: - * [tripod] call ace_tripod_fnc_adjust + * [ACE_player, tripod] call ace_tripod_fnc_adjust * * Public: No */ #include "script_component.hpp" -params ["_tripod"]; +params ["_unit", "_tripod"]; -GVAR(adjuster) = ACE_player; -GVAR(adjusting) = true; +_unit setVariable [QGVAR(adjusting), true, true]; +// add PFH to adjust the tripod animation GVAR(adjustPFH) = [{ - params ["_args", "_pfhId"]; - _args params ["_tripod"]; + (_this select 0) params ["_unit", "_tripod"]; - if (GVAR(adjuster) != ACE_player || !GVAR(adjusting)) exitWith { + if (!(_unit getVariable [QGVAR(adjusting), false]) || {isNull _tripod} || {_unit distance _tripod > 5}) exitWith { call EFUNC(interaction,hideMouseHint); - [ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Adjust), -1]] call EFUNC(Common,removeActionEventHandler); - [_pfhId] call cba_fnc_removePerFrameHandler; + + [_unit, "DefaultAction", _unit getVariable [QGVAR(Adjust), -1]] call EFUNC(common,removeActionEventHandler); + + [_this select 1] call CBA_fnc_removePerFrameHandler; }; { _tripod animate [_x, 1 - GVAR(height)]; } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; -}, 0, [_tripod]] call CBA_fnc_addPerFrameHandler; +}, 0, [_unit, _tripod]] call CBA_fnc_addPerFrameHandler; +// add mouse button action and hint [localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint); -ACE_player setVariable [QGVAR(Adjust), - [ACE_player, "DefaultAction", - {GVAR(adjustPFH) != -1 && GVAR(adjusting)}, - {GVAR(adjusting) = false;} -] call EFUNC(common,AddActionEventHandler)]; +_unit setVariable [QGVAR(Adjust), [ + _unit, "DefaultAction", + {GVAR(adjustPFH) != -1}, + {(_this select 0) setVariable [QGVAR(adjusting), false, true]} +] call EFUNC(common,addActionEventHandler)]; diff --git a/addons/tripod/functions/fnc_handleInteractMenuOpened.sqf b/addons/tripod/functions/fnc_handleInteractMenuOpened.sqf new file mode 100644 index 0000000000..8c49359d96 --- /dev/null +++ b/addons/tripod/functions/fnc_handleInteractMenuOpened.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle opening of interaction menu. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (_unit getVariable [QGVAR(adjusting), false]) then { + _unit setVariable [QGVAR(adjusting), false, true]; +}; diff --git a/addons/tripod/functions/fnc_handleKilled.sqf b/addons/tripod/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..ee28fc1f45 --- /dev/null +++ b/addons/tripod/functions/fnc_handleKilled.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle death. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (_unit getVariable [QGVAR(adjusting), false]) then { + _unit setVariable [QGVAR(adjusting), false, true]; +}; diff --git a/addons/tripod/functions/fnc_handlePlayerChanged.sqf b/addons/tripod/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..dd0cad6533 --- /dev/null +++ b/addons/tripod/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,24 @@ +/* + * Author: commy2 + * Handle player changes. + * + * Arguments: + * 0: New Player Unit + * 1: Old Player Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_newPlayer", "_oldPlayer"]; + +if (_newPlayer getVariable [QGVAR(adjusting), false]) then { + _newPlayer setVariable [QGVAR(adjusting), false, true]; +}; + +if (_oldPlayer getVariable [QGVAR(adjusting), false]) then { + _oldPlayer setVariable [QGVAR(adjusting), false, true]; +}; diff --git a/addons/tripod/functions/fnc_handleScrollWheel.sqf b/addons/tripod/functions/fnc_handleScrollWheel.sqf index 973a57dd2f..1589bbc476 100644 --- a/addons/tripod/functions/fnc_handleScrollWheel.sqf +++ b/addons/tripod/functions/fnc_handleScrollWheel.sqf @@ -17,7 +17,7 @@ params ["_scroll"]; -if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(adjustPFH) == -1) exitWith { false }; +if (GVAR(adjustPFH) == -1) exitWith {false}; GVAR(height) = 0 max (GVAR(height) + (_scroll / 20)) min 1; diff --git a/addons/tripod/functions/fnc_handleUnconscious.sqf b/addons/tripod/functions/fnc_handleUnconscious.sqf new file mode 100644 index 0000000000..f81cecea58 --- /dev/null +++ b/addons/tripod/functions/fnc_handleUnconscious.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Handle unconsciousness. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Public: No +*/ +#include "script_component.hpp" + +params ["_unit"]; + +if (_unit getVariable [QGVAR(adjusting), false]) then { + _unit setVariable [QGVAR(adjusting), false, true]; +}; diff --git a/addons/tripod/functions/fnc_pickup.sqf b/addons/tripod/functions/fnc_pickup.sqf index 24fc26ea1d..886aa5087e 100644 --- a/addons/tripod/functions/fnc_pickup.sqf +++ b/addons/tripod/functions/fnc_pickup.sqf @@ -3,28 +3,31 @@ * Pick up tripod * * Arguments: - * 0: tripod - * 1: unit + * 0: unit + * 1: tripod * * Return value: * None * * Example: - * [tripod, player] call ace_tripod_fnc_pickup + * [ACE_player, tripod] call ace_tripod_fnc_pickup * * Public: No */ #include "script_component.hpp" -params ["_tripod", "_unit"]; +params ["_unit", "_tripod"]; -if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { - _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +if (stance _unit == "STAND") then { + [_unit, "AmovPercMstpSrasWrflDnon_diary"] call EFUNC(common,doAnimation); }; [{ - params ["_tripod", "_unit"]; + params ["_unit", "_tripod"]; + + if (isNull _tripod) exitWith {}; + + deleteVehicle _tripod; [_unit, "ACE_Tripod"] call EFUNC(common,addToInventory); - deleteVehicle _tripod; -}, [_tripod, _unit], 1, 0]call EFUNC(common,waitAndExecute); +}, [_unit, _tripod], 1] call EFUNC(common,waitAndExecute); diff --git a/addons/tripod/functions/fnc_place.sqf b/addons/tripod/functions/fnc_place.sqf index ce7f445885..3168703f31 100644 --- a/addons/tripod/functions/fnc_place.sqf +++ b/addons/tripod/functions/fnc_place.sqf @@ -20,34 +20,37 @@ params ["_unit", "_tripodClass"]; _unit removeItem _tripodClass; -if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { - _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +if (stance _unit == "STAND") then { + [_unit, "AmovPercMstpSrasWrflDnon_diary"] call EFUNC(common,doAnimation); }; [{ params ["_unit"]; private ["_direction", "_position", "_tripod"]; + _direction = getDir _unit; - _position = (getPosASL _unit) vectorAdd [0.8 * sin(_direction), 0.8 * cos(_direction), 0.02]; + _position = getPosASL _unit vectorAdd [0.8 * sin _direction, 0.8 * cos _direction, 0.02]; _tripod = "ACE_TripodObject" createVehicle [0, 0, 0]; + { _tripod animate [_x, 1]; } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; [{ - params ["_args", "_pfhId"]; - _args params ["_tripod", "_direction", "_position"]; + (_this select 0) params ["_tripod", "_direction", "_position"]; if (_tripod animationPhase "slide_down_tripod" == 1) then { _tripod setDir _direction; _tripod setPosASL _position; - if ((getPosATL _tripod select 2) - (getPos _tripod select 2) < 1E-5) then { + + if ((getPosATL _tripod select 2) - (getPos _tripod select 2) < 1E-5) then { // if not on object, then adjust to surface normale _tripod setVectorUp (surfaceNormal (position _tripod)); }; - [_pfhId] call CBA_fnc_removePerFrameHandler; + + [_this select 1] call CBA_fnc_removePerFrameHandler; }; }, 0, [_tripod, _direction, _position]] call CBA_fnc_addPerFrameHandler; -}, [_unit], 1, 0] call EFUNC(common,waitAndExecute); +}, [_unit], 1] call EFUNC(common,waitAndExecute); diff --git a/addons/tripod/stringtable.xml b/addons/tripod/stringtable.xml index e87c89e6ff..c6366ba8de 100644 --- a/addons/tripod/stringtable.xml +++ b/addons/tripod/stringtable.xml @@ -59,15 +59,15 @@ Готово - + Modifier, adjust - + Modyfikator, regulacja - + Modificador, ajuste - + Modifikátor, regulace - + Modifikator, anpassen - + Modificador, ajuste - + modifier, régler - + Módosító, szabályzás - + Модификатор, подстройка + adjust + regulacja + ajuste + regulace + anpassen + ajuste + régler + szabályzás + подстройка From 8bb5f71ba1d383304cb68948e844da5b59399d34 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 25 Sep 2015 22:30:57 -0500 Subject: [PATCH 185/311] Macro for non spawned CBA Debug Logging --- addons/main/script_macros.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index f7ec3a3fa3..c2ecab058b 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -99,6 +99,11 @@ #define ACE_isHC (!hasInterface && !isDedicated) +//By default CBA's TRACE/LOG/WARNING spawn a buffer, which can cause messages to be logged out of order: +#ifdef CBA_DEBUG_SYNCHRONOUS + #define CBA_fnc_log { params ["_file","_lineNum","_message"]; diag_log [diag_frameNo, diag_tickTime, time, _file + ":"+str(_lineNum + 1), _message]; } +#endif + #define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message) #define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message) From dc7d24a3fd1007ad0bc4d09a049ab39bfb291fe4 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 14:38:50 +0200 Subject: [PATCH 186/311] fix fixFloating resetting reflector hitpoints, close #2279 --- addons/common/functions/fnc_fixFloating.sqf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf index 5fe94dcef7..24084d2c11 100644 --- a/addons/common/functions/fnc_fixFloating.sqf +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -19,14 +19,17 @@ _object = _this; if (!local _object) exitWith {}; // save and restore hitpoints, see below why -private ["_hitPoints", "_hitPointDamages"]; +private "_hitPointDamages"; +_hitPointDamages = getAllHitPointsDamage _object; -_hitPoints = [_object] call FUNC(getHitpoints); -_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map); +// get correct format for objects without hitpoints +if (_hitPointDamages isEqualTo []) then { + _hitPointDamages = [[],[],[]]; +}; // this prevents physx objects from floating when near other physx objects with allowDamage false _object setDamage damage _object; { - _object setHitPointDamage [_x, _hitPointDamages select _forEachIndex]; -} forEach _hitPoints; + _object setHitIndex [_forEachIndex, _x]; +} forEach (_hitPointDamages select 2); From 5425836e474959e665e7e4e21475faba99c63453 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 16:26:41 +0200 Subject: [PATCH 187/311] cleanup respawn module, close #2184 --- addons/respawn/ACE_Settings.hpp | 1 + addons/respawn/CfgAddons.hpp | 1 + addons/respawn/CfgVehicleClasses.hpp | 1 + addons/respawn/CfgVehicles.hpp | 4 +- addons/respawn/XEH_postInit.sqf | 2 +- addons/respawn/XEH_preInit.sqf | 1 - .../functions/fnc_canMoveRallypoint.sqf | 45 +++-- .../functions/fnc_handleInitPostServer.sqf | 33 ++-- addons/respawn/functions/fnc_handleKilled.sqf | 39 ++-- .../functions/fnc_handlePlayerChanged.sqf | 64 +++---- .../respawn/functions/fnc_handleRespawn.sqf | 41 ++--- .../respawn/functions/fnc_initRallypoint.sqf | 52 +++--- addons/respawn/functions/fnc_module.sqf | 63 ++++--- .../functions/fnc_moduleFriendlyFire.sqf | 49 +++--- .../functions/fnc_moduleRallypoint.sqf | 38 ++-- .../respawn/functions/fnc_moveRallypoint.sqf | 56 +++--- addons/respawn/functions/fnc_removeBody.sqf | 45 ++--- .../fnc_removeDisconnectedPlayer.sqf | 31 ---- addons/respawn/functions/fnc_restoreGear.sqf | 166 ++++++++---------- .../functions/fnc_showFriendlyFireMessage.sqf | 38 ++-- .../functions/fnc_teleportToRallypoint.sqf | 21 +-- .../functions/fnc_updateRallypoint.sqf | 24 ++- 22 files changed, 371 insertions(+), 444 deletions(-) delete mode 100644 addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf diff --git a/addons/respawn/ACE_Settings.hpp b/addons/respawn/ACE_Settings.hpp index 5c947b8670..f704d25412 100644 --- a/addons/respawn/ACE_Settings.hpp +++ b/addons/respawn/ACE_Settings.hpp @@ -1,3 +1,4 @@ + class ACE_Settings { class GVAR(SavePreDeathGear) { value = 0; diff --git a/addons/respawn/CfgAddons.hpp b/addons/respawn/CfgAddons.hpp index 111613615e..50ea187915 100644 --- a/addons/respawn/CfgAddons.hpp +++ b/addons/respawn/CfgAddons.hpp @@ -1,3 +1,4 @@ + class CfgAddons { class GVAR(Rallypoints) { list[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"}; diff --git a/addons/respawn/CfgVehicleClasses.hpp b/addons/respawn/CfgVehicleClasses.hpp index ab9c9b6c7e..817ee8150f 100644 --- a/addons/respawn/CfgVehicleClasses.hpp +++ b/addons/respawn/CfgVehicleClasses.hpp @@ -1,3 +1,4 @@ + class CfgVehicleClasses { class GVAR(Rallypoints) { displayName = CSTRING(EditorCategory); diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index aa99b4e942..8fdfb5f0fc 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -1,3 +1,4 @@ + class CfgVehicles { class ACE_Module; class ACE_ModuleRespawn: ACE_Module { @@ -6,7 +7,7 @@ class CfgVehicles { displayName = CSTRING(Module_DisplayName); function = QFUNC(module); scope = 2; - isGlobal = 1; + isGlobal = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_Respawn_ca.paa)); class Arguments { @@ -24,6 +25,7 @@ class CfgVehicles { defaultValue = 1; }; }; + class ModuleDescription { description = CSTRING(Module_Description); }; diff --git a/addons/respawn/XEH_postInit.sqf b/addons/respawn/XEH_postInit.sqf index ada5765e86..22be7b86ac 100644 --- a/addons/respawn/XEH_postInit.sqf +++ b/addons/respawn/XEH_postInit.sqf @@ -2,4 +2,4 @@ #include "script_component.hpp" ["rallypointMoved", {_this call FUNC(updateRallypoint)}] call EFUNC(common,addEventhandler); -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers diff --git a/addons/respawn/XEH_preInit.sqf b/addons/respawn/XEH_preInit.sqf index dd116f108c..eda5293876 100644 --- a/addons/respawn/XEH_preInit.sqf +++ b/addons/respawn/XEH_preInit.sqf @@ -13,7 +13,6 @@ PREP(moduleFriendlyFire); PREP(moduleRallypoint); PREP(moveRallypoint); PREP(removeBody); -PREP(removeDisconnectedPlayer); PREP(restoreGear); PREP(showFriendlyFireMessage); PREP(teleportToRallypoint); diff --git a/addons/respawn/functions/fnc_canMoveRallypoint.sqf b/addons/respawn/functions/fnc_canMoveRallypoint.sqf index d5f325c067..174d76c69d 100644 --- a/addons/respawn/functions/fnc_canMoveRallypoint.sqf +++ b/addons/respawn/functions/fnc_canMoveRallypoint.sqf @@ -1,33 +1,30 @@ /* - Name: ACE_Respawn_fnc_canMoveRallypoint - - Author(s): - commy2 - - Description: - checks if a unit can move a rally point - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - - Returns: - BOOLEAN -*/ - + * Author: commy2 + * Checks if a unit can move a rally point. + * + * Arguments: + * 0: Unit + * 1: Side + * + * Return Value: + * Can move + * + * Example: + * [ACE_Player, side ACE_Player] call ace_respawn_fnc_canMoveRallypoint + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_side"]; +params ["_unit", "_side"]; -_unit = _this select 0; -_side = _this select 1; +// player has to be a rallypoint mover. group leader by default +if !(_unit getVariable ["ACE_canMoveRallypoint", false]) exitWith {false}; -// rallypoint names are defined in CfgVehicles.hpp - -_unit getVariable ["ACE_canMoveRallypoint", false] -&& {!isNull ([ +// rallypoint of that side has to exist +!isNull ([ objNull, missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] -] select ([west, east, independent] find _side) + 1)} +] select ([west, east, independent] find _side) + 1) // return diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index 914334cc25..a1e46c1caf 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -1,26 +1,39 @@ -// by commy2 -// execute on server only! +/* + * Author: commy2 + * Handle XEH Init Post on Server. + * Execution on server only. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [ACE_Player] call ace_respawn_fnc_handleInitPostServer + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -private ["_group0", "_rallypoint"]; +private ["_groupUnit", "_rallypoint", "_leaderVarName"]; -_group0 = group _unit; // _group-is a reserved veriable and shouldn't be used +_groupUnit = group _unit; // _group is a reserved veriable and shouldn't be used _rallypoint = [ objNull, missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] -] select ([west, east, independent] find side _group0) + 1; +] select ([west, east, independent] find side _groupUnit) + 1; // exit if no moveable rallypoint is placed for that side if (isNull _rallypoint) exitWith {}; // find leader -private "_leaderVarName"; -_leaderVarName = _group0 getVariable [QGVAR(leaderVarName), ""]; +_leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""]; // exit if group already has a playable slot assigned as rallypoint leader if (_leaderVarName != "") exitWith { @@ -31,7 +44,7 @@ if (_leaderVarName != "") exitWith { }; // treat group leader -_unit = leader _group0; +_unit = leader _groupUnit; _leaderVarName = vehicleVarName _unit; @@ -47,6 +60,6 @@ if (_leaderVarName == "") then { }; // prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP -_group0 setVariable [QGVAR(leaderVarName), _leaderVarName]; +_groupUnit setVariable [QGVAR(leaderVarName), _leaderVarName]; _unit setVariable ["ACE_canMoveRallypoint", true, true]; diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 99ec308c1c..200e3c98c8 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -1,31 +1,30 @@ /* - Name: ACE_Respawn_fnc_handleKilled - - Author(s): - bux578 - - Description: - Handles the XEH Killed event - - Parameters: - 0: OBJECT - Killed unit - 1: OBJECT - Attacker - - Returns: - VOID -*/ - + * Author: bux578 + * Handles the XEH killed event. + * + * Arguments: + * 0: Unit + * 1: Killer + * + * Return Value: + * None + * + * Example: + * [ACE_player, bad_dude] call ace_respawn_fnc_handleKilled + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_killedUnit); +params ["_unit"]; // Saves the gear when the player! (and only him) is killed -if (ACE_player == _killedUnit) then { +if (ACE_player == _unit) then { GVAR(unitGear) = []; if (GVAR(SavePreDeathGear)) then { - GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); - GVAR(unitGear) pushBack [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; + GVAR(unitGear) = [_unit] call EFUNC(common,getAllGear); + GVAR(unitGear) pushBack [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]; }; }; diff --git a/addons/respawn/functions/fnc_handlePlayerChanged.sqf b/addons/respawn/functions/fnc_handlePlayerChanged.sqf index db699066bc..6ea5d7bb53 100644 --- a/addons/respawn/functions/fnc_handlePlayerChanged.sqf +++ b/addons/respawn/functions/fnc_handlePlayerChanged.sqf @@ -1,44 +1,28 @@ -// by commy2 +/* + * Author: commy2 + * Handle player changed event. Updates visibility of Rallypoint markers. + * + * Arguments: + * 0: New Unit + * + * Return Value: + * None + * + * Example: + * [ACE_player] call ace_respawn_fnc_handlePlayerChanged + * + * Public: No + */ #include "script_component.hpp" -private "_newUnit"; +params ["_newUnit"]; -_newUnit = _this select 0; +private "_side"; +_side = side group _newUnit; -switch (side group _newUnit) do { - case (west): { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - }; - - case (east): { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - }; - - case (independent): { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - }; - - default { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - }; -}; +((GETGVAR("ACE_Rallypoint_West", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); +((GETGVAR("ACE_Rallypoint_West_Base", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); +((GETGVAR("ACE_Rallypoint_East", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); +((GETGVAR("ACE_Rallypoint_East_Base", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); +((GETGVAR("ACE_Rallypoint_Independent", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); +((GETGVAR("ACE_Rallypoint_Independent_Base", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); diff --git a/addons/respawn/functions/fnc_handleRespawn.sqf b/addons/respawn/functions/fnc_handleRespawn.sqf index 33a0ec09e5..ab5ecedbda 100644 --- a/addons/respawn/functions/fnc_handleRespawn.sqf +++ b/addons/respawn/functions/fnc_handleRespawn.sqf @@ -1,32 +1,29 @@ /* - Name: ACE_Respawn_fnc_handleRespawn - - Author(s): - bux578 - - Description: - Handles the XEH Respawn event - - Parameters: - 0: OBJECT - Respawned Unit - 1: ? - - Returns: - VOID -*/ - + * Author: bux578 + * Handles the XEH Respawn event. + * + * Arguments: + * 0: Unit + * 1: Corpse + * + * Return Value: + * None + * + * Example: + * [ACE_Player, old_body_lying_on_floor] call ace_respawn_fnc_handleRespawn + * + * Public: No + */ #include "script_component.hpp" -private ["_respawnedUnit"]; - -_respawnedUnit = _this select 0; +params ["_unit"]; // Restores the gear when the player respawns if (GVAR(SavePreDeathGear)) then { - [_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear); + [_unit, GVAR(unitGear)] call FUNC(restoreGear); }; // fix for setVariable public being lost on respawn for machines that JIP after the command was broadcasted -if (_respawnedUnit getVariable ["ACE_canMoveRallypoint", false]) then { - _respawnedUnit setVariable ["ACE_canMoveRallypoint", true, true]; +if (_unit getVariable ["ACE_canMoveRallypoint", false]) then { + _unit setVariable ["ACE_canMoveRallypoint", true, true]; }; diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index bb295a1809..dba1ae5d0a 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -1,52 +1,51 @@ /* - Name: ACE_Respawn_fnc_initRallypoint - - Author(s): - commy2 - - Description: - init code for rally points - - Parameters: - 0: OBJECT - rally - - Returns: - VOID -*/ - + * Author: commy2 + * Init code for rallypoints. + * + * Arguments: + * 0: Rallypoint Object + * 1: Respawn Marker + * 2: Side + * + * Return Value: + * None + * + * Example: + * [respawn_object, "", west] call ace_respawn_fnc_initRallypoint + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_rallypoint,_respawnMarker,_side); +params ["_rallypoint", "_respawnMarker", "_side"]; private "_name"; _name = typeOf _rallypoint; // init visible marker if (hasInterface) then { - // fix init having wrong position, vars etc. - [_rallypoint, _respawnMarker, _side, _name] spawn { - PARAMS_4(_rallypoint,_respawnMarker,_side,_name); + [{ + params ["_rallypoint", "_respawnMarker", "_side", "_name"]; - private ["_marker", "_type"]; + private ["_marker", "_type", "_date"]; _marker = format ["ACE_Marker_%1", _name]; - // exit if it already exist + // exit if marker already exist if (_marker in allMapMarkers) exitWith {}; _marker = createMarkerLocal [_marker, getPosASL _rallypoint]; _type = ["selector_selectedFriendly", "selector_selectedEnemy"] select (_respawnMarker == ""); _marker setMarkerTypeLocal _type; - _marker setMarkerAlphaLocal ([0,1] select (_side == playerSide)); // playerSide to guarantee init + _marker setMarkerAlphaLocal ([0,1] select (_side == playerSide)); // playerSide to guarantee init - private "_markerDate"; - _markerDate = _rallypoint getVariable [QGVAR(markerDate), ""]; + _date = _rallypoint getVariable [QGVAR(markerDate), ""]; - _marker setMarkerTextLocal _markerDate; + _marker setMarkerTextLocal _date; _rallypoint setVariable [QGVAR(marker), _marker]; - }; + }, [_rallypoint, _respawnMarker, _side, _name], 0.1] call EFUNC(common,waitAndExecute); }; if (!isServer) exitWith {}; @@ -62,7 +61,6 @@ if (isNil _name) then { }; ["rallypointMoved", [_rallypoint, _side]] call EFUNC(common,globalEvent); - } else { deleteVehicle _rallypoint; ACE_LOGERROR("Multiple Rallypoints of same type."); diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index 8921c75f54..b37a0a8d91 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -1,26 +1,25 @@ - /* - Name: ACE_Respawn_fnc_module - - Author(s): - KoffeinFlummi, bux578, esteldunedain, commy2 - - Description: - initializes the respawn module - - Parameters: - 0: OBJECT - logic - 1: ARRAY - synced units - 2: BOOLEAN - activated - - Returns: - VOID -*/ - +/* + * Author: KoffeinFlummi, bux578, esteldunedain, commy2 + * Initializes the respawn module. + * + * Arguments: + * 0: Logic + * 1: Synced units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [logic, [ACE_Player], true] call ace_respawn_fnc_module + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); +if (!isServer) exitWith {}; -if !(isServer) exitWith {}; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; @@ -29,20 +28,18 @@ GVAR(Module) = true; [_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(RemoveDeadBodiesDisconnected), "RemoveDeadBodiesDisconnected"] call EFUNC(common,readSettingFromModule); -if (isServer) then { - if (GVAR(RemoveDeadBodiesDisconnected)) then { - addMissionEventHandler ["HandleDisconnect", { - [{ - PARAMS_1(_unit); +if (isServer && {GVAR(RemoveDeadBodiesDisconnected)}) then { + addMissionEventHandler ["HandleDisconnect", { + [{ + params ["_unit"]; - if (!alive _unit) then { - deleteVehicle _unit; - }; - }, - _this, 4, 1] call EFUNC(common,waitAndExecute); - false - }]; - }; + if (!alive _unit) then { + deleteVehicle _unit; + }; + }, + _this, 4] call EFUNC(common,waitAndExecute); + false + }]; }; ACE_LOGINFO("Respawn Module Initialized."); diff --git a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf index 2d81372e85..f5b982f0ea 100644 --- a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf +++ b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf @@ -1,32 +1,33 @@ /* - Name: ACE_Respawn_fnc_moduleFriendlyFire - - Author(s): - commy2 - - Description: - initializes the Friendly Fire Messages module - - Parameters: - 0: OBJECT - logic - 1: ARRAY - synced units - 2: BOOLEAN - activated - - Returns: - VOID -*/ - + * Author: commy2 + * Initializes the friendly fire module. + * + * Arguments: + * 0: Logic + * 1: Synced units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [logic, [ACE_Player], true] call ace_respawn_fnc_moduleFriendlyFire + * + * Public: No + */ #include "script_component.hpp" -_this spawn { - PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; - if !(_activated) exitWith {}; +if !(_activated) exitWith {}; - if (isServer) then { +// this is done for JIP compatibility +if (isServer) then { + [{ missionNamespace setVariable [QGVAR(showFriendlyFireMessage), true]; publicVariable QGVAR(showFriendlyFireMessage); - }; - - ACE_LOGINFO("Friendly Fire Messages Module Initialized."); + }, + [], 0.1] call EFUNC(common,waitAndExecute); }; + +ACE_LOGINFO("Friendly Fire Messages Module Initialized."); diff --git a/addons/respawn/functions/fnc_moduleRallypoint.sqf b/addons/respawn/functions/fnc_moduleRallypoint.sqf index 86a83bf061..89baed660f 100644 --- a/addons/respawn/functions/fnc_moduleRallypoint.sqf +++ b/addons/respawn/functions/fnc_moduleRallypoint.sqf @@ -1,29 +1,29 @@ /* - Name: ACE_Respawn_fnc_moduleRallypoint - - Author(s): - commy2 - - Description: - initializes the Rallypoint module - - Parameters: - 0: OBJECT - logic - 1: ARRAY - synced units - 2: BOOLEAN - activated - - Returns: - VOID -*/ - + * Author: commy2 + * Initializes the Rallypoint module. + * + * Arguments: + * 0: Logic + * 1: Synced units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [logic, [ACE_Player], true] call ace_respawn_fnc_moduleRallypoint + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; { _x setVariable ["ACE_canMoveRallypoint", true]; -} forEach _units; + false +} count _units; ACE_LOGINFO("Rallypoint Module Initialized."); diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index d512c23886..bf96905343 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -1,52 +1,47 @@ /* - Name: ACE_Respawn_fnc_moveRallypoint - - Author(s): - commy2 - - Description: - Moves a rallypoint to the player's location - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - - Returns: - VOID -*/ - + * Author: commy2 + * Moves a rallypoint to the players location. + * + * Arguments: + * 0: Unit + * 1: Side + * + * Return Value: + * None + * + * Example: + * [ACE_Player, side ACE_Player] call ace_respawn_fnc_moveRallypoint + * + * Public: No + */ #include "script_component.hpp" -PARAMS_2(_unit,_side); +params ["_unit", "_side"]; private ["_rallypoint", "_position"]; -// rallypoint names are defined in CfgVehicles.hpp - _rallypoint = [ - objNull, - missionNamespace getVariable ["ACE_Rallypoint_West", objNull], - missionNamespace getVariable ["ACE_Rallypoint_East", objNull], - missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] + objNull, + missionNamespace getVariable ["ACE_Rallypoint_West", objNull], + missionNamespace getVariable ["ACE_Rallypoint_East", objNull], + missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] ] select ([west, east, independent] find _side) + 1; -TRACE_3("moving rally",_unit, _rallypoint, (typeOf _rallypoint)); +TRACE_3("moving rally",_unit,_rallypoint,typeOf _rallypoint); if (isNull _rallypoint) exitWith {}; _position = getPosATL _unit; _position = _position findEmptyPosition [0, 2, typeOf _rallypoint]; -if (count _position == 0) then {_position = getPosATL _unit}; + +if (_position isEqualTo []) then {_position = getPosATL _unit}; _position set [2, 0]; [localize LSTRING(Deploy)] call EFUNC(common,displayTextStructured); [{ - _rallypoint = _this select 0; - _unit = _this select 1; - _position = _this select 2; - _rallypoint = _this select 3; + params ["_rallypoint", "_unit", "_position"]; _rallypoint setPosATL _position; _unit reveal _rallypoint; @@ -56,5 +51,4 @@ _position set [2, 0]; ["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent); [localize LSTRING(Deployed)] call EFUNC(common,displayTextStructured); -}, -[_rallypoint, _unit, _position, _rallypoint], 5, 1] call EFUNC(common,waitAndExecute); +}, [_rallypoint, _unit, _position], 5] call EFUNC(common,waitAndExecute); diff --git a/addons/respawn/functions/fnc_removeBody.sqf b/addons/respawn/functions/fnc_removeBody.sqf index e00f633e6c..e9676696a1 100644 --- a/addons/respawn/functions/fnc_removeBody.sqf +++ b/addons/respawn/functions/fnc_removeBody.sqf @@ -1,36 +1,27 @@ /* - Name: ACE_Respawn_fnc_removeBody - - Author(s): - bux578 - - Description: - removes a given body - - Parameters: - 0: OBJECT - body - 1: BOOLEAN - forceRemove // not used atm - - Returns: - VOID -*/ - + * Author: bux578, commy2 + * Removes a given body. + * + * Arguments: + * 0: Body + * + * Return Value: + * None + * + * Example: + * [corpse] call ace_respawn_fnc_removeBody + * + * Public: No + */ #include "script_component.hpp" -private ["_body", "_forceRemove", "_bodyRemoveTimer"]; +params ["_body", "_forceRemove"]; -_body = _this select 0; -_forceRemove = _this select 1; - -_bodyRemoveTimer = GVAR(BodyRemoveTimer) max 0; - -// could be used for SpecOps missions. -if (_forceRemove) then { - _bodyRemoveTimer = 2; -}; +private "_bodyRemoveTimer"; +_bodyRemoveTimer = [GVAR(BodyRemoveTimer) max 0, 2] select _forceRemove; // could be used for SpecOps missions. [{ // hideBody takes ~20s till body is fully underground // a better hideBody would make this more aesthetic deleteVehicle _this; -}, _body, _bodyRemoveTimer, 1] call EFUNC(common,waitAndExecute); +}, _body, _bodyRemoveTimer] call EFUNC(common,waitAndExecute); diff --git a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf deleted file mode 100644 index 7bd0a6707f..0000000000 --- a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/* - Name: ACE_Respawn_fnc_removeDisconnectedPlayer - - Author(s): - commy2 - - Description: - handles the disconnected event - - Parameters: - 0: BOOLEAN - forceRemove // not used atm - - Returns: - VOID -*/ - -#include "script_component.hpp" - -private ["_forceRemove", "_body", "_uid"]; - -_forceRemove = _this select 0; - -{ - if (getPlayerUID _x == _uid) exitWith { - _body = _x; - }; -} forEach playableUnits; - -if (!isNil "_body" && {!alive _body}) then { - [_body, _forceRemove] call FUNC(removeBody); -}; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index fd3f03d7aa..fb430bc400 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -1,34 +1,22 @@ /* - Name: ACE_Respawn_fnc_restoreGear - - Author(s): - bux578 - - Description: - Restores previously saved gear - - Parameters: - 0: OBJECT - unit - 1: ARRAY - Array containing all gear (result of ACE_common_fnc_getAllGear) - - Returns: - VOID -*/ - + * Author: bux578 + * Restores previously saved gear. + * + * Arguments: + * 0: Unit + * 1: All Gear based on return value of ACE_common_fnc_getAllGear + * + * Return Value: + * None + * + * Example: + * [ACE_Player, stored_allGear] call ace_respawn_fnc_restoreGear + * + * Public: No + */ #include "script_component.hpp" -PARAMS_2(_unit,_allGear); - -private ["_unit", "_allGear", "_headgear", "_goggles", -"_uniform", "_uniformitems", -"_vest", "_vestitems", -"_backpack", "_backpackitems", "_backpa", -"_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", -"_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine", -"_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", -"_assigneditems", "_binocular", -"_activeWeaponAndMuzzle", "_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; - +params ["_unit", "_allGear"]; // remove all starting gear of a player removeAllWeapons _unit; @@ -40,77 +28,66 @@ removeAllAssignedItems _unit; clearAllItemsFromBackpack _unit; removeBackpack _unit; -_headgear = _allGear select 0; -_goggles = _allGear select 1; -_uniform = _allGear select 2; -_uniformitems = _allGear select 3; -_vest = _allGear select 4; -_vestitems = _allGear select 5; -_backpack = _allGear select 6; -_backpackitems = _allGear select 7; -_primaryweapon = _allGear select 8; -_primaryweaponitems = _allGear select 9; -_primaryweaponmagazine = _allGear select 10; -_secondaryweapon = _allGear select 11; -_secondaryweaponitems = _allGear select 12; -_secondaryweaponmagazine = _allGear select 13; -_handgunweapon = _allGear select 14; -_handgunweaponitems = _allGear select 15; -_handgunweaponmagazine = _allGear select 16; -_assigneditems = _allGear select 17; -_binocular = _allGear select 18; -_activeWeaponAndMuzzle = _allGear select 19; - +_allGear params [ + "_headgear", "_goggles", + "_uniform", "_uniformitems", + "_vest", "_vestitems", + "_backpack", "_backpackitems", + "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", + "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine", + "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", + "_assigneditems", "_binocular", + "_activeWeaponAndMuzzle" +]; // start restoring the items -if (_headgear != "") then { - _unit addHeadgear _headgear; -}; -if (_uniform != "") then { - _unit forceAddUniform _uniform; -}; -if (_vest != "") then { - _unit addVest _vest; -}; -if (_goggles != "") then { - _unit addGoggles _goggles; -}; +if (_headgear != "") then {_unit addHeadgear _headgear}; +if (_goggles != "") then {_unit addGoggles _goggles}; +if (_uniform != "") then {_unit forceAddUniform _uniform}; +if (_vest != "") then {_unit addVest _vest}; { _unit addItemToUniform _x; -} forEach _uniformitems; + false +} count _uniformitems; { _unit addItemToVest _x; -} forEach _vestitems; + false +} count _vestitems; private "_flagRemoveDummyBag"; -_flagRemoveDummyBag = false; -if (format["%1", _backpack] != "") then { +if (format ["%1", _backpack] != "") then { _unit addBackpack _backpack; - _backpa = unitBackpack _unit; - clearMagazineCargoGlobal _backpa; - clearWeaponCargoGlobal _backpa; - clearItemCargoGlobal _backpa; + // make sure the backpack is empty. Some bags are prefilled by config + private "_backpackObject"; + _backpackObject = unitBackpack _unit; + + clearMagazineCargoGlobal _backpackObject; + clearWeaponCargoGlobal _backpackObject; + clearItemCargoGlobal _backpackObject; + { _unit addItemToBackpack _x; - } forEach _backpackitems; + false + } count _backpackitems; + _flagRemoveDummyBag = false; } else { // dummy backpack to ensure mags being loaded - _unit addBackpack "B_Kitbag_Base"; + _unit addBackpack "Bag_Base"; _flagRemoveDummyBag = true; }; - // primaryWeapon if ((_primaryweapon != "") && {_primaryweapon != "ACE_FakePrimaryWeapon"}) then { { _unit addMagazine _x; - } forEach _primaryweaponmagazine; + false + } count _primaryweaponmagazine; _unit addWeapon _primaryweapon; @@ -118,15 +95,16 @@ if ((_primaryweapon != "") && {_primaryweapon != "ACE_FakePrimaryWeapon"}) then if (_x != "") then { _unit addPrimaryWeaponItem _x; }; - } forEach _primaryweaponitems; + false + } count _primaryweaponitems; }; - // secondaryWeapon if (_secondaryweapon != "") then { { _unit addMagazine _x; - } forEach _secondaryweaponmagazine; + false + } count _secondaryweaponmagazine; _unit addWeapon _secondaryweapon; @@ -134,15 +112,16 @@ if (_secondaryweapon != "") then { if (_x != "") then { _unit addSecondaryWeaponItem _x; }; - } forEach _secondaryweaponitems; + false + } count _secondaryweaponitems; }; - // handgun if (_handgunweapon != "") then { { _unit addMagazine _x; - } forEach _handgunweaponmagazine; + false + } count _handgunweaponmagazine; _unit addWeapon _handgunweapon; @@ -150,20 +129,19 @@ if (_handgunweapon != "") then { if (_x != "") then { _unit addHandgunItem _x; }; - } forEach _handgunweaponitems; + false + } count _handgunweaponitems; }; - // remove dummy bagpack if (_flagRemoveDummyBag) then { removeBackpack _unit; }; - -_assignedItems = _assignedItems - [_binocular]; +_assignedItems deleteAt (_assignedItems find _binocular); // items -{_unit linkItem _x} forEach _assignedItems; +{_unit linkItem _x; false} count _assignedItems; _unit addWeapon _binocular; @@ -178,24 +156,24 @@ if ("Laserdesignator" in assignedItems _unit) then { }; // restore the last active weapon, muzzle and weaponMode -_activeWeapon = _activeWeaponAndMuzzle select 0; -_activeMuzzle = _activeWeaponAndMuzzle select 1; -_activeWeaponMode = _activeWeaponAndMuzzle select 2; - -if (!(_activeMuzzle isEqualTo "") and - !(_activeMuzzle isEqualTo _activeWeapon) and - (_activeMuzzle in getArray (configfile >> "CfgWeapons" >> _activeWeapon >> "muzzles"))) then { +_activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponMode"] +if ( + (_activeMuzzle != "") && + {_activeMuzzle != _activeWeapon} && + {_activeMuzzle in getArray (configfile >> "CfgWeapons" >> _activeWeapon >> "muzzles")} +) then { _unit selectWeapon _activeMuzzle; } else { - if (!(_activeWeapon isEqualTo "")) then { + if (_activeWeapon != "") then { _unit selectWeapon _activeWeapon; }; }; -if (!(currentWeapon _unit isEqualTo "")) then { - private ["_index"]; +if (currentWeapon _unit != "") then { + private "_index"; _index = 0; + while { _index < 100 && {currentWeaponMode _unit != _activeWeaponMode} } do { diff --git a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf index 1fdd10da4e..1c5a7b7cc2 100644 --- a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf +++ b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf @@ -1,28 +1,24 @@ /* - Name: ACE_Respawn_fnc_showFriendlyFireMessages - - Author(s): - commy2 - - Description: - shows a message in system chat of who killed who - - Parameters: - 0: OBJECT - unit - 1: OBJECT - killer - - Returns: - VOID -*/ - + * Author: commy2 + * Shows a message in system chat of who killed whom. + * + * Arguments: + * 0: Unitn + * 1: Killer + * + * Return Value: + * None + * + * Example: + * [ACE_Player, killer] call ace_module_fnc_functionName + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_killer"]; +params ["_unit", "_killer"]; -_unit = _this select 0; -_killer = _this select 1; - -if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then { +if (_unit != _killer && {side group _unit in [side group ACE_player, civilian]} && {side group _killer == side group ACE_player}) then { systemChat format ["%1 was killed by %2", [_unit] call EFUNC(common,getName), [_killer] call EFUNC(common,getName)]; // Raise ACE globalEvent diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index 59a9766114..88bd0d6d52 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -1,29 +1,25 @@ /* * Author: commy2 - * teleports a unit to a rallypoint + * Teleports a unit to a rallypoint * * Arguments: - * 0: unit - * 1: side? - * 2: teleport to base + * 0: Unit + * 1: Side + * 2: Rallypoint name * * Return Value: - * Nothing + * None * * Example: - * [,,] call ACE_Respawn_fnc_teleportToRallypoint; + * [ACE_player, side ACE_Player, rallypoint_name] call ace_respawn_fnc_teleportToRallypoint; * * Public: No */ #include "script_component.hpp" -PARAMS_3(_unit,_side,_rallypoint); +params ["_unit", "_side", "_rallypoint"]; -private ["_toBase"]; - -// rallypoint names are defined in CfgVehicles.hpp - -//IGNORE_PRIVATE_WARNING("_Base") +private "_toBase"; _toBase = _rallypoint find "_Base" != -1; _rallypoint = missionNamespace getVariable [_rallypoint, objNull], @@ -31,4 +27,5 @@ _rallypoint = missionNamespace getVariable [_rallypoint, objNull], if (isNull _rallypoint) exitWith {}; _unit setPosASL getPosASL _rallypoint; + [[localize LSTRING(TeleportedToRallypoint), localize LSTRING(TeleportedToBase)] select _toBase] call EFUNC(common,displayTextStructured); diff --git a/addons/respawn/functions/fnc_updateRallypoint.sqf b/addons/respawn/functions/fnc_updateRallypoint.sqf index 248955155a..8b34f87019 100644 --- a/addons/respawn/functions/fnc_updateRallypoint.sqf +++ b/addons/respawn/functions/fnc_updateRallypoint.sqf @@ -1,11 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Updates marker position and texts. + * + * Arguments: + * 0: Marker + * 1: Side + * 2: Position + * + * Return Value: + * None + * + * Example: + * [marker_name, side ACE_Player, getPos ACE_Player] call ace_respawn_fnc_updateRallypoint + * + * Public: No + */ #include "script_component.hpp" -private ["_rallypoint", "_side", "_position"]; - -_rallypoint = _this select 0; -_side = _this select 1; -_position = _this select 2; +params ["_rallypoint", "_side", "_position"]; if (!hasInterface) exitWith {}; From b1fb7befe8f480e6b5112b6f5abfaf2473388da7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 16:32:29 +0200 Subject: [PATCH 188/311] remove wrong isServer check --- addons/respawn/functions/fnc_module.sqf | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index b37a0a8d91..ea6ba555d5 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -17,8 +17,6 @@ */ #include "script_component.hpp" -if (!isServer) exitWith {}; - params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; From 6d9943ff2ec500090234e80433e1a706667dbf71 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 16:45:39 +0200 Subject: [PATCH 189/311] fix wrong macro, missing ; --- addons/respawn/functions/fnc_handlePlayerChanged.sqf | 12 ++++++------ addons/respawn/functions/fnc_restoreGear.sqf | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/respawn/functions/fnc_handlePlayerChanged.sqf b/addons/respawn/functions/fnc_handlePlayerChanged.sqf index 6ea5d7bb53..7d595e6a44 100644 --- a/addons/respawn/functions/fnc_handlePlayerChanged.sqf +++ b/addons/respawn/functions/fnc_handlePlayerChanged.sqf @@ -20,9 +20,9 @@ params ["_newUnit"]; private "_side"; _side = side group _newUnit; -((GETGVAR("ACE_Rallypoint_West", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); -((GETGVAR("ACE_Rallypoint_West_Base", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); -((GETGVAR("ACE_Rallypoint_East", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); -((GETGVAR("ACE_Rallypoint_East_Base", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); -((GETGVAR("ACE_Rallypoint_Independent", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); -((GETGVAR("ACE_Rallypoint_Independent_Base", objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); +((GETMVAR(ACE_Rallypoint_West, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); +((GETMVAR(ACE_Rallypoint_West_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); +((GETMVAR(ACE_Rallypoint_East, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); +((GETMVAR(ACE_Rallypoint_East_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); +((GETMVAR(ACE_Rallypoint_Independent, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); +((GETMVAR(ACE_Rallypoint_Independent_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index fb430bc400..e8a512e127 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -156,7 +156,7 @@ if ("Laserdesignator" in assignedItems _unit) then { }; // restore the last active weapon, muzzle and weaponMode -_activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponMode"] +_activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; if ( (_activeMuzzle != "") && From 8affae9f7a16f5ed38fcb054850441c74b3a8a32 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 18:16:38 +0200 Subject: [PATCH 190/311] dont access cargo of destroyed vehicles, fix #2523 --- addons/cargo/functions/fnc_initVehicle.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index d436e0d416..8857030cb7 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -45,7 +45,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex private ["_text", "_condition", "_statement", "_icon", "_action"]; _condition = { params ["_target", "_player"]; - GVAR(enable) && {locked _target < 2} && {[_player, _target, []] call EFUNC(common,canInteractWith)} + GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, []] call EFUNC(common,canInteractWith)} }; _text = localize LSTRING(openMenu); _statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; From 07774647e9666fb6af606c762f5d4aeb0761ec2a Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 19:30:13 +0200 Subject: [PATCH 191/311] delay setUnconscious until the settings are inited, fix #148 --- addons/medical/functions/fnc_setUnconscious.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 3de62db974..cb9fff0693 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -21,6 +21,11 @@ #define DEFAULT_DELAY (round(random(10)+5)) +// only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this]; +}; + private ["_animState", "_originalPos", "_startingTime", "_isDead"]; params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force", false]]; From 9ae215704c6bd2df965ea3f763261690a566daf8 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 20:29:08 +0200 Subject: [PATCH 192/311] Code cleanup Backpacks --- addons/backpacks/XEH_postInit.sqf | 2 +- .../functions/fnc_backpackOpened.sqf | 19 ++++++++++--------- addons/backpacks/functions/fnc_isBackpack.sqf | 15 ++++++++------- .../functions/fnc_onOpenInventory.sqf | 14 ++++++++------ 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/addons/backpacks/XEH_postInit.sqf b/addons/backpacks/XEH_postInit.sqf index 639bf74919..375fcd5f89 100644 --- a/addons/backpacks/XEH_postInit.sqf +++ b/addons/backpacks/XEH_postInit.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler); +["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler); diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 9488bf6bd9..4e61e8fbcc 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -1,18 +1,19 @@ /* * Author: commy2 + * Someone opened your backpack. Play sound and camshake. Execute locally. * - * Someone opened your backpack. Execute locally. - * - * Argument: + * Arguments: * 0: Who accessed your inventory? (Object) * 1: Unit that wields the backpack (Object) * 2: The backpack object (Object) * - * Return value: - * None. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_sounds", "_position"]; + params ["_target", "_backpack"]; // do cam shake if the target is the player @@ -20,7 +21,8 @@ if ([_target] call EFUNC(common,isPlayer)) then { addCamShake [4, 0.5, 5]; }; -// play a rustling sound +// play a zipper sound effect +private ["_sounds", "_position"]; _sounds = [ /*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss", @@ -32,8 +34,7 @@ _sounds = [ QUOTE(PATHTO_R(sounds\zip_out.wav)) ]; -_position = _target modelToWorldVisual (_target selectionPosition "Spine3"); -_position = _position call EFUNC(common,positionToASL); +_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3")); playSound3D [ _sounds select floor random count _sounds, diff --git a/addons/backpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf index 3419d2ed38..fab82c505f 100644 --- a/addons/backpacks/functions/fnc_isBackpack.sqf +++ b/addons/backpacks/functions/fnc_isBackpack.sqf @@ -1,23 +1,24 @@ /* * Author: commy2 + * Check if the given backpack is an actual backpack that can store items. Parachute, static weapon packs, etc. will return false. * - * Check if the given backpack is an actual backpack that can store items. Parachute backpacks will return false for example. + * Arguments: + * 0: Backpack * - * Argument: - * 0: A backpack (Object or String) + * Return Value: + * Boolean * - * Return value: - * Boolean (Bool) + * Public: Yes */ #include "script_component.hpp" -private ["_config"]; params ["_backpack"]; if (typeName _backpack == "OBJECT") then { _backpack = typeOf _backpack; }; +private "_config"; _config = configFile >> "CfgVehicles" >> _backpack; -getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} +getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index afeeb21313..154000202d 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -1,17 +1,19 @@ /* * Author: commy2 + * Handle the open inventory event. Camshake and sound on target client. * - * Handle the open inventory event. Display message on target client. + * Arguments: + * 0: Unit + * 1: Backpack * - * Argument: - * Input from "InventoryOpened" eventhandler - * - * Return value: + * Return Value: * false. Always open the inventory dialog. (Bool) + * + * Public: No */ #include "script_component.hpp" -params ["_unit","_backpack"]; +params ["_unit", "_backpack"]; // exit if the target is not a real backpack, i.e. parachute, static weapon bag etc. if !([_backpack] call FUNC(isBackpack)) exitWith {false}; From 0509e2669080cc9a6a90676a4503f7a18a7537b3 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 20:45:19 +0200 Subject: [PATCH 193/311] Code Cleanup NoRadio --- addons/noradio/CfgEventhandlers.hpp | 10 +++++----- addons/noradio/XEH_postInit.sqf | 24 +++++++++++++++++++++++ addons/noradio/XEH_post_initClient.sqf | 27 -------------------------- addons/noradio/XEH_post_initServer.sqf | 6 ------ 4 files changed, 29 insertions(+), 38 deletions(-) create mode 100644 addons/noradio/XEH_postInit.sqf delete mode 100644 addons/noradio/XEH_post_initClient.sqf delete mode 100644 addons/noradio/XEH_post_initServer.sqf diff --git a/addons/noradio/CfgEventhandlers.hpp b/addons/noradio/CfgEventhandlers.hpp index d960e896df..386d98d241 100644 --- a/addons/noradio/CfgEventhandlers.hpp +++ b/addons/noradio/CfgEventhandlers.hpp @@ -1,6 +1,6 @@ + class Extended_PostInit_EventHandlers { - class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_post_initClient)); - serverInit = QUOTE(call COMPILE_FILE(XEH_post_initServer)); - }; -}; \ No newline at end of file + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/noradio/XEH_postInit.sqf b/addons/noradio/XEH_postInit.sqf new file mode 100644 index 0000000000..4aeccffd62 --- /dev/null +++ b/addons/noradio/XEH_postInit.sqf @@ -0,0 +1,24 @@ +// by commy2 +#include "script_component.hpp" + +// unmute unit if that player disconnects +if (isServer) then { + addMissionEventHandler ["HandleDisconnect", { + [_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit); + }]; +}; + +if (!hasInterface) exitWith {}; + +// mutes/unmutes units when the player changes +["playerChanged", { + params ["_newPlayer", "_oldPlayer"]; + + // mute the new player + [_newPlayer, "isPlayer"] call EFUNC(common,muteUnit); + + // unmute the old player + if (alive _oldPlayer) then { + [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); + }; +}] call EFUNC(common,addEventhandler); diff --git a/addons/noradio/XEH_post_initClient.sqf b/addons/noradio/XEH_post_initClient.sqf deleted file mode 100644 index ecd80a6436..0000000000 --- a/addons/noradio/XEH_post_initClient.sqf +++ /dev/null @@ -1,27 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -/* -[{ - if (!isNull ACE_player) then { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - - [ACE_player, "isPlayer"] call EFUNC(common,muteUnit); - }; -}, 0, []] call CBA_fnc_addPerFrameHandler; -*/ - -if (!hasInterface) exitWith {}; - -// Mutes/unmutes units when the player changes -["playerChanged", { - EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer); - - // On player change mute the new player - [_newPlayer, "isPlayer"] call EFUNC(common,muteUnit); - - // Unmute the old player - if (alive _oldPlayer) then { - [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); - }; -}] call EFUNC(common,addEventhandler); diff --git a/addons/noradio/XEH_post_initServer.sqf b/addons/noradio/XEH_post_initServer.sqf deleted file mode 100644 index ae2dc16ec1..0000000000 --- a/addons/noradio/XEH_post_initServer.sqf +++ /dev/null @@ -1,6 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -addMissionEventHandler ["HandleDisconnect", { - [_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit); -}]; From c12584e15cb8d43aaa214b5b31a14c894687d721 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 21:23:18 +0200 Subject: [PATCH 194/311] Code Cleanup HitReactions --- addons/hitreactions/ACE_Settings.hpp | 1 + .../hitreactions/functions/fnc_fallDown.sqf | 109 +++++++++++------- 2 files changed, 68 insertions(+), 42 deletions(-) diff --git a/addons/hitreactions/ACE_Settings.hpp b/addons/hitreactions/ACE_Settings.hpp index adbbdacaf2..4fa45e8ebc 100644 --- a/addons/hitreactions/ACE_Settings.hpp +++ b/addons/hitreactions/ACE_Settings.hpp @@ -1,3 +1,4 @@ + class ACE_Settings { class GVAR(minDamageToTrigger) { //Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely. diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index 7fa6453fe2..f5a0a89247 100644 --- a/addons/hitreactions/functions/fnc_fallDown.sqf +++ b/addons/hitreactions/functions/fnc_fallDown.sqf @@ -1,39 +1,52 @@ -// by commy2 +/* + * Author: commy2 + * Check if the given backpack is an actual backpack that can store items. Parachute backpacks will return false for example. + * + * Arguments: + * 0: unit + * 1: firer + * 2: damage taken + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" params ["_unit", "_firer", "_damage"]; +// exit if system is disabled +if (GVAR(minDamageToTrigger) == -1) exitWith {}; + +// don't fall after minor damage +if (_damage < GVAR(minDamageToTrigger)) exitWith {}; + // don't fall on collision damage if (_unit == _firer) exitWith {}; -//Exit if system disabled: -if (GVAR(minDamageToTrigger) == -1) exitWith {}; - -// cam shake for player +// camshake for player if (_unit == ACE_player) then { addCamShake [3, 5, _damage + random 10]; }; +// play scream sound +if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then { + [_unit] call EFUNC(medical,playInjuredSound); +}; + private "_vehicle"; _vehicle = vehicle _unit; // handle static weapons -if (_vehicle isKindOf "StaticWeapon") exitwith { +if (_vehicle isKindOf "StaticWeapon") exitWith { if (!alive _unit) then { _unit action ["Eject", _vehicle]; unassignVehicle _unit; }; }; -// don't fall after minor damage -if (_damage < GVAR(minDamageToTrigger)) exitWith {}; - -// play sound -if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then { - [_unit] call EFUNC(medical,playInjuredSound); -}; - -//Don't do animations if in a vehicle (looks weird and animations never reset): +// don't do animations if in a vehicle (looks weird and animations never reset): if (_vehicle != _unit) exitWith {}; // this checks most things, so it doesn't mess with being inside vehicles or while dragging etc. @@ -54,40 +67,52 @@ _velocity = vectorMagnitude velocity _unit; if (_velocity < 2) exitWith {}; // get correct animation by weapon -private ["_isPlayer", "_isRunning", "_anim"]; +private "_anim"; -_isPlayer = [_unit] call EFUNC(common,isPlayer); -_isRunning = _velocity > 4; +call { + private "_weapon"; + _weapon = currentWeapon _unit; -_anim = switch (currentWeapon _unit) do { - case (""): {"AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"}; - case (primaryWeapon _unit): { - if !(_isPlayer) exitWith {"AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"}; - - [ - ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, - ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, - "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft", - "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright" - ] select floor random 4; + if (_weapon == "") exitWith { + _anim = "AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon" }; - case (handgunWeapon _unit): { - if !(_isPlayer) exitWith {"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"}; - [ - "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", - "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", - "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft", - "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright" - ] select floor random 4; + if (_weapon == primaryWeapon _unit) exitWith { + if ([_unit] call EFUNC(common,isPlayer)) then { + private "_isRunning"; + _isRunning = _velocity > 4; + + _anim = [ + ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, + ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, + "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft", + "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright" + ] select floor random 4; + } else { + _anim = "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"; + }; }; - default {""}; + + if (_weapon == handgunWeapon _unit) exitWith { + if ([_unit] call EFUNC(common,isPlayer)) then { + _anim = [ + "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", + "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", + "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft", + "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright" + ] select floor random 4; + } else { + _anim = "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"; + }; + }; + + _anim = ""; }; -// exit if no animation for this weapon exists, i.E. binocular or rocket launcher +// exit if no animation for this weapon exists, i.e. binocular or rocket launcher if (_anim == "") exitWith {}; // don't mess with transitions. don't fall then. -if ([_unit] call EFUNC(common,inTransitionAnim)) exitWith {}; - -[_unit, _anim, 2] call EFUNC(common,doAnimation); +if !([_unit] call EFUNC(common,inTransitionAnim)) then { + [_unit, _anim, 2] call EFUNC(common,doAnimation); +}; From 028aa404e9643c6b72a3787277eba89a54c245da Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 21:27:00 +0200 Subject: [PATCH 195/311] change description in function header --- addons/hitreactions/functions/fnc_fallDown.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index f5a0a89247..d93b99bd6b 100644 --- a/addons/hitreactions/functions/fnc_fallDown.sqf +++ b/addons/hitreactions/functions/fnc_fallDown.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Check if the given backpack is an actual backpack that can store items. Parachute backpacks will return false for example. + * Adds reactions to a unit that was hit. EH only runs where to unit is local. Adds screams, falling down, falling from ladders, ejecting from static weapons and camshake for players * * Arguments: * 0: unit From 6cc920dc34115e7aa6bcf34fbd2e5b2e0f687232 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 22:39:12 +0200 Subject: [PATCH 196/311] Code Cleanup Grenades, fix dedicated server AI thrown flasbangs do nothing --- addons/grenades/CfgAmmo.hpp | 1 + addons/grenades/CfgEventHandlers.hpp | 7 ++-- addons/grenades/CfgVehicles.hpp | 8 ++-- addons/grenades/CfgWeapons.hpp | 9 ++++- addons/grenades/XEH_postInit.sqf | 4 +- .../functions/fnc_flashbangExplosionEH.sqf | 37 +++++++++++-------- .../functions/fnc_flashbangThrownFuze.sqf | 2 + 7 files changed, 41 insertions(+), 27 deletions(-) diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 6cb16b0328..5aa33284c8 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -1,3 +1,4 @@ + class CfgAmmo { class FlareCore; class FlareBase: FlareCore { diff --git a/addons/grenades/CfgEventHandlers.hpp b/addons/grenades/CfgEventHandlers.hpp index 2587bdf86f..d93f8469bc 100644 --- a/addons/grenades/CfgEventHandlers.hpp +++ b/addons/grenades/CfgEventHandlers.hpp @@ -1,19 +1,20 @@ + class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; class Extended_FiredBIS_EventHandlers { class CAManBase { class ADDON { - clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) ); + firedBIS = QUOTE(_this call FUNC(throwGrenade)); }; }; }; diff --git a/addons/grenades/CfgVehicles.hpp b/addons/grenades/CfgVehicles.hpp index 7cf2085193..94c60e10d7 100644 --- a/addons/grenades/CfgVehicles.hpp +++ b/addons/grenades/CfgVehicles.hpp @@ -1,9 +1,6 @@ + class CfgVehicles { class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - class Box_NATO_Support_F; - class Box_NATO_Grenades_F: NATO_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_White,12); @@ -12,6 +9,7 @@ class CfgVehicles { }; }; + class EAST_Box_Base; class Box_East_Grenades_F: EAST_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_Yellow,12); @@ -20,6 +18,7 @@ class CfgVehicles { }; }; + class IND_Box_Base; class Box_IND_Grenades_F: IND_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_Yellow,12); @@ -28,6 +27,7 @@ class CfgVehicles { }; }; + class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_White,12); diff --git a/addons/grenades/CfgWeapons.hpp b/addons/grenades/CfgWeapons.hpp index 4edc6e6d12..f84c00713a 100644 --- a/addons/grenades/CfgWeapons.hpp +++ b/addons/grenades/CfgWeapons.hpp @@ -1,21 +1,26 @@ + class CfgWeapons { class GrenadeLauncher; - class Throw: GrenadeLauncher { - muzzles[] += {"ACE_HandFlare_WhiteMuzzle", "ACE_HandFlare_RedMuzzle", "ACE_HandFlare_GreenMuzzle", "ACE_HandFlare_YellowMuzzle", "ACE_M84Muzzle"}; + muzzles[] += {"ACE_HandFlare_WhiteMuzzle","ACE_HandFlare_RedMuzzle","ACE_HandFlare_GreenMuzzle","ACE_HandFlare_YellowMuzzle","ACE_M84Muzzle"}; + class ThrowMuzzle; class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_White"}; }; + class ACE_HandFlare_RedMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_Red"}; }; + class ACE_HandFlare_GreenMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_Green"}; }; + class ACE_HandFlare_YellowMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_Yellow"}; }; + class ACE_M84Muzzle: ThrowMuzzle { magazines[] = {"ACE_M84"}; }; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 260bf63f6e..54c2b06e8b 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" -["flashbangExplosion", DFUNC(flashbangExplosionEH)] call EFUNC(common,addEventHandler); +["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler); if (!hasInterface) exitWith {}; @@ -21,4 +21,4 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; [] call FUNC(nextMode); }, {false}, -[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key +[9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 1f7e97c47a..6583172df9 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -15,13 +15,14 @@ */ #include "script_component.hpp" -private ["_affected", "_strength", "_posGrenade", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"]; params ["_grenade"]; +private ["_affected", "_strength", "_posGrenade", "_eyePos", "_losCount", "_eyeDir", "_dirToUnitVector", "_angleDiff", "_light"]; + _affected = _grenade nearEntities ["CAManBase", 20]; { - if ((local _x) && {alive _x}) then { + if (local _x && {alive _x}) then { _strength = 1 - ((_x distance _grenade) min 15) / 15; @@ -30,14 +31,17 @@ _affected = _grenade nearEntities ["CAManBase", 20]; if (_x != ACE_player) then { //must be AI [_x, true] call EFUNC(common,disableAI); - _x setSkill ((skill _x) / 50); + + _x setSkill (skill _x / 50); [{ params ["_unit"]; + //Make sure we don't enable AI for unconscious units - if (!(_unit getVariable ["ace_isunconscious", false])) then { + if (!(_unit getVariable ["ace_isUnconscious", false])) then { [_unit, false] call EFUNC(common,disableAI); }; + _unit setSkill (skill _unit * 50); }, [_x], (7 * _strength)] call EFUNC(common,waitAndExecute); } else { @@ -49,7 +53,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; //Check for line of sight (check 4 points in case grenade is stuck in an object or underground) _losCount = { - (!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player]) + !lineIntersects [_posGrenade vectorAdd _x, _eyePos, _grenade, ACE_player] } count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; TRACE_1("Line of sight count (out of 4)",_losCount); @@ -57,9 +61,9 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _strength = _strength / 10; }; - //Add ace_hearing ear ringing sound effect - if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then { - [_x, (20 * _strength)] call EFUNC(hearing,earRinging); + // add ace_hearing ear ringing sound effect + if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") && {_strength > 0}) then { + [_x, 20 * _strength] call EFUNC(hearing,earRinging); }; // account for people looking away by slightly @@ -68,16 +72,16 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _dirToUnitVector = _eyePos vectorFromTo _posGrenade; _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); - //From 0-45deg, full effect + // from 0-45deg, full effect if (_angleDiff > 45) then { _strength = _strength - _strength * ((_angleDiff - 45) / 120); }; TRACE_1("Final strength for player",_strength); - //Add ace_medical pain effect: - if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0.1}) then { - [ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel); + // add ace_medical pain effect: + if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {_strength > 0.1}) then { + [ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel); }; // create flash to illuminate environment @@ -87,14 +91,14 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _light setLightColor [1,1,1]; _light setLightDayLight true; - //Delete the light after 0.1 seconds + // delete the light after 0.1 seconds [{ params ["_light"]; deleteVehicle _light; }, [_light], 0.1] call EFUNC(common,waitAndExecute); // blind player - if (_strength > 0.1 && hasInterface) then { + if (hasInterface && {_strength > 0.1}) then { GVAR(flashbangPPEffectCC) ppEffectEnable true; GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; @@ -102,14 +106,15 @@ _affected = _grenade nearEntities ["CAManBase", 20]; //PARTIALRECOVERY - start decreasing effect over ACE_time [{ params ["_strength"]; + GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength); - }, [_strength], (7 * _strength), 0] call EFUNC(common,waitAndExecute); + }, [_strength], 7 * _strength] call EFUNC(common,waitAndExecute); //FULLRECOVERY - end effect [{ GVAR(flashbangPPEffectCC) ppEffectEnable false; - }, [], (17 * _strength)] call EFUNC(common,waitAndExecute); + }, [], 17 * _strength] call EFUNC(common,waitAndExecute); }; }; }; diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index f0e2406b53..21d132464a 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -14,6 +14,7 @@ * Public: No */ #include "script_component.hpp" + params ["_projectile"]; if (alive _projectile) then { @@ -21,5 +22,6 @@ if (alive _projectile) then { private "_affected"; _affected = _projectile nearEntities ["CAManBase", 50]; + ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); }; From cd839a0ddcbc9be02a01fb0593a2f63444103a3e Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 26 Sep 2015 22:42:47 +0200 Subject: [PATCH 197/311] remove superfluous brackets --- addons/grenades/functions/fnc_flashbangExplosionEH.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 6583172df9..b45dc099fc 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -38,12 +38,12 @@ _affected = _grenade nearEntities ["CAManBase", 20]; params ["_unit"]; //Make sure we don't enable AI for unconscious units - if (!(_unit getVariable ["ace_isUnconscious", false])) then { + if !(_unit getVariable ["ace_isUnconscious", false]) then { [_unit, false] call EFUNC(common,disableAI); }; _unit setSkill (skill _unit * 50); - }, [_x], (7 * _strength)] call EFUNC(common,waitAndExecute); + }, [_x], 7 * _strength] call EFUNC(common,waitAndExecute); } else { //Do effects for player // is there line of sight to the grenade? From 64d6a172c7c30ea25a167cb670fb4c470693c569 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 26 Sep 2015 22:53:49 +0200 Subject: [PATCH 198/311] Improved public function parameter handling, Fixed issue with synchronized objects --- .../functions/fnc_createSlideshow.sqf | 25 +++++++++++-------- addons/slideshow/functions/fnc_moduleInit.sqf | 6 +++++ addons/slideshow/script_component.hpp | 3 +++ 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index bed2a2ae7f..2061dcf82e 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -10,7 +10,7 @@ * 4: Slide Duration (0 disables automatic transitions) * * Return Value: - * Parsed List + * None * * Example: * [[object1, object2, object3], [controller1], ["images\image1.paa", "images\image2.paa"], ["Action1", "Action2"], 5] call ace_slideshow_fnc_createSlideshow @@ -20,18 +20,21 @@ #include "script_component.hpp" private ["_currentSlideshow", "_slidesAction", "_varString"]; -params ["_objects", "_controllers", "_images", "_names", "_duration"]; +params [ + ["_objects", [], []], + ["_controllers", [], []], + ["_images", [], []], + ["_names", [], []], + ["_duration", 0, 0] +]; // Verify data -if (count _images != count _names || {count _images == 0} || {count _names == 0}) exitWith { - ACE_LOGERROR("Slideshow Images or Names fields can NOT be empty and must have equal number of items!"); +if (_objects isEqualTo []) exitWith { + ACE_LOGERROR{"Slideshow Objects field may NOT be empty!"}; +}; +if (count _images != count _names || {_images isEqualTo []} || {_names isEqualTo []}) exitWith { + ACE_LOGERROR("Slideshow Images or Names fields may NOT be empty and must have equal number of items!"); }; - -// Objects synced to the module -{ - _objects pushBack _x; - nil -} count (synchronizedObjects _logic); // If no controllers use objects as controllers if (count _controllers == 0) then { @@ -54,7 +57,7 @@ _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR gets change // If interaction menu module is not present, set default duration value if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { - _duration = 5; + _duration = NOINTERACTMENU_DURATION; ACE_LOGINFO_1("Interaction Menu module not present, defaulting duration value to %1",_duration); }; diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index 7da64cd3cc..83a82257b6 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -30,6 +30,12 @@ _images = [_logic getVariable ["Images", ""], true, false] call FUNC(makeList); _names = [_logic getVariable ["Names", ""], true, false] call FUNC(makeList); _duration = _logic getVariable ["Duration", 0]; +// Objects synced to the module +{ + _objects pushBack _x; + nil +} count (synchronizedObjects _logic); + // Prepare with actions [_objects, _controllers, _images, _names, _duration] call FUNC(createSlideshow); diff --git a/addons/slideshow/script_component.hpp b/addons/slideshow/script_component.hpp index 12f60ee1ab..3acd23c0ee 100644 --- a/addons/slideshow/script_component.hpp +++ b/addons/slideshow/script_component.hpp @@ -10,3 +10,6 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +#define NOINTERACTMENU_DURATION 5 From 4a5d6cade1925bcabee6c275ff6e82cff87af9ff Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 26 Sep 2015 22:54:31 +0200 Subject: [PATCH 199/311] Bracket to Brace --- addons/slideshow/functions/fnc_createSlideshow.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 2061dcf82e..a1040d936f 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -30,7 +30,7 @@ params [ // Verify data if (_objects isEqualTo []) exitWith { - ACE_LOGERROR{"Slideshow Objects field may NOT be empty!"}; + ACE_LOGERROR("Slideshow Objects field may NOT be empty!"); }; if (count _images != count _names || {_images isEqualTo []} || {_names isEqualTo []}) exitWith { ACE_LOGERROR("Slideshow Images or Names fields may NOT be empty and must have equal number of items!"); From b7872868374ed63fd40809ca4cdd9ca2f57e8666 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 26 Sep 2015 23:02:18 +0200 Subject: [PATCH 200/311] Fixed allowed data types --- addons/slideshow/functions/fnc_createSlideshow.sqf | 10 +++++----- addons/slideshow/functions/fnc_moduleInit.sqf | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index a1040d936f..18cdfe5211 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -21,11 +21,11 @@ private ["_currentSlideshow", "_slidesAction", "_varString"]; params [ - ["_objects", [], []], - ["_controllers", [], []], - ["_images", [], []], - ["_names", [], []], - ["_duration", 0, 0] + ["_objects", [], [[]] ], + ["_controllers", [], [[]] ], + ["_images", [], [[]] ], + ["_names", [], [[]] ], + ["_duration", 0, [0]] ]; // Verify data diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index 83a82257b6..f09dab678d 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -39,4 +39,4 @@ _duration = _logic getVariable ["Duration", 0]; // Prepare with actions [_objects, _controllers, _images, _names, _duration] call FUNC(createSlideshow); -ACE_LOGINFO_2("Slideshow Module Initialized for: %1 with Duration: %2", _objects, _duration); +ACE_LOGINFO_1("Slideshow Module Initialized on %1 Objects", count _objects); From 498dddcc2656ad4a67bf9f1744b7a70c76dad773 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 26 Sep 2015 23:06:35 +0200 Subject: [PATCH 201/311] Used isEqualTo --- addons/slideshow/functions/fnc_createSlideshow.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index 18cdfe5211..b480e4ac01 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -37,7 +37,7 @@ if (count _images != count _names || {_images isEqualTo []} || {_names isEqualTo }; // If no controllers use objects as controllers -if (count _controllers == 0) then { +if (_controllers isEqualTo []) then { _controllers = _objects; }; @@ -65,7 +65,7 @@ if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { if (_duration == 0) then { { // Add Slides sub-action and populate with images - _slidesAction = [QGVAR(Slides), localize LSTRING(Interaction), "", {}, {true}, {(_this select 2) call FUNC(addSlideActions)}, [_objects,_images,_names,_x,_currentSlideshow], [0,0,0], 2] call EFUNC(interact_menu,createAction); + _slidesAction = [QGVAR(Slides), localize LSTRING(Interaction), "", {}, {true}, {(_this select 2) call FUNC(addSlideActions)}, [_objects, _images, _names, _x, _currentSlideshow], [0, 0, 0], 2] call EFUNC(interact_menu,createAction); [_x, 0, ["ACE_MainActions"], _slidesAction] call EFUNC(interact_menu,addActionToObject); nil } count _controllers; From 30544dc7577b954042e5d51f6fe83fcda4f2b508 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 26 Sep 2015 23:16:05 +0200 Subject: [PATCH 202/311] Make cargo loaded hint optional, disable it when not loading manually --- addons/cargo/functions/fnc_addCargoItem.sqf | 4 ++-- addons/cargo/functions/fnc_loadItem.sqf | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 17264ec15a..5aed10388b 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -29,12 +29,12 @@ for "_i" from 1 to _amount do { _item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; // Load item or delete it if no space left - if !([_item, _vehicle] call FUNC(loadItem)) exitWith { + if !([_item, _vehicle, false] call FUNC(loadItem)) exitWith { TRACE_1("no room to load item - deleting",_item); deleteVehicle _item; }; TRACE_1("Item Loaded",_item); - + // Invoke listenable event ["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); }; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index e09d0e1429..11e7638f1b 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -5,6 +5,7 @@ * Arguments: * 0: Object * 1: Vehicle + * 2: Show Hint (default: true) * * Return value: * Object loaded @@ -18,7 +19,7 @@ private ["_loaded", "_space", "_itemSize"]; -params ["_item", "_vehicle"]; +params ["_item", "_vehicle", ["_showHint", true, [true]] ]; TRACE_2("params",_item,_vehicle); if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith { @@ -46,7 +47,9 @@ private ["_itemName", "_vehicleName"]; _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); -["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); +if (_showHint) then { + ["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); +}; // Invoke listenable event ["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); From b345db4ae9a4ca632cc7a23cd0a622131b02ae42 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 00:29:19 +0200 Subject: [PATCH 203/311] Added Zeus modules for adding Spare Tracks and Wheels --- addons/zeus/CfgVehicles.hpp | 27 ++++++++++-- addons/zeus/XEH_preInit.sqf | 2 + addons/zeus/config.cpp | 7 ++++ .../functions/fnc_moduleAddSpareTrack.sqf | 41 +++++++++++++++++++ .../functions/fnc_moduleAddSpareWheel.sqf | 41 +++++++++++++++++++ addons/zeus/stringtable.xml | 22 +++++++++- 6 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 addons/zeus/functions/fnc_moduleAddSpareTrack.sqf create mode 100644 addons/zeus/functions/fnc_moduleAddSpareWheel.sqf diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index e110970ae3..35c43b0e84 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -117,7 +117,7 @@ class CfgVehicles { }; class GVAR(moduleSetMedic): GVAR(moduleBase) { curatorCanAttach = 1; - displayName = CSTRING(ModuleSetMedic_displayName); + displayName = CSTRING(ModuleSetMedic_DisplayName); function = QFUNC(moduleSetMedic); icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); class ModuleDescription { @@ -127,7 +127,7 @@ class CfgVehicles { }; class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) { curatorCanAttach = 1; - displayName = CSTRING(ModuleSetMedicalVehicle_displayName); + displayName = CSTRING(ModuleSetMedicalVehicle_DisplayName); function = QFUNC(moduleSetMedicalVehicle); icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); class ModuleDescription { @@ -137,7 +137,7 @@ class CfgVehicles { }; class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) { curatorCanAttach = 1; - displayName = CSTRING(ModuleSetMedicalFacility_displayName); + displayName = CSTRING(ModuleSetMedicalFacility_DisplayName); function = QFUNC(moduleSetMedicalFacility); icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); class ModuleDescription { @@ -145,4 +145,25 @@ class CfgVehicles { sync[] = {}; }; }; + + class GVAR(moduleAddSpareTrack): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleAddSpareTrack_DisplayName); + function = QFUNC(moduleAddSpareTrack); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo + class ModuleDescription { + description = CSTRING(ModuleAddSpareTrack_Description); + sync[] = {}; + }; + }; + class GVAR(moduleAddSpareWheel): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleAddSpareWheel_DisplayName); + function = QFUNC(moduleAddSpareWheel); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa));//@todo + class ModuleDescription { + description = CSTRING(ModuleAddSpareWheel_Description); + sync[] = {}; + }; + }; }; diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 5aee98c3f3..9837d7162b 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -8,6 +8,8 @@ PREP(bi_moduleMine); PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); PREP(handleZeusUnitAssigned); +PREP(moduleAddSpareTrack); +PREP(moduleAddSpareWheel); PREP(moduleCaptive); PREP(moduleSetMedic); PREP(moduleSetMedicalVehicle); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 810ce17396..853edaf2e9 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -25,11 +25,18 @@ class CfgPatches { QGVAR(moduleSetMedicalFacility) }; }; + class GVAR(cargoAndRepair): ADDON { + units[] = { + QGVAR(moduleAddSpareTrack), + QGVAR(moduleAddSpareWheel) + }; + }; }; class ACE_Curator { GVAR(captives) = "ace_captives"; GVAR(medical) = "ace_medical"; + GVAR(cargoAndRepair[]) = {"ace_cargo", "ace_repair"}; }; #include "CfgEventHandlers.hpp" diff --git a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf new file mode 100644 index 0000000000..3acb024476 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf @@ -0,0 +1,41 @@ +/* + * Author: Jonpas + * Adds a Spare Track to the vehicle. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + (GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"]; + + if (_mouseOverType != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _mouseOverUnit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (getNumber (configFile >> "CfgVehicles" >> "ACE_Track" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { + [LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured); + } else { + ["AddCargoByClass", ["ACE_Track", _mouseOverUnit, 1, true]] call EFUNC(common,localEvent); + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf new file mode 100644 index 0000000000..c353af189b --- /dev/null +++ b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf @@ -0,0 +1,41 @@ +/* + * Author: Jonpas + * Adds a Spare Wheel to the vehicle. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + (GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"]; + + if (_mouseOverType != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _mouseOverUnit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (getNumber (configFile >> "CfgVehicles" >> "ACE_Wheel" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { + [LSTRING(OnlyEnoughCargoSpace)] call EFUNC(common,displayTextStructured); + } else { + ["AddCargoByClass", ["ACE_Wheel", _mouseOverUnit, 1, true]] call EFUNC(common,localEvent); + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 46aadce4a2..6063f5011a 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -212,6 +212,18 @@ Přiřadit Zdravotnické Zařízení Asignar instalación médica + + Add Spare Wheel + + + Adds a Spare Wheel to the vehicle + + + Add Spare Track + + + Adds a Spare Track to the vehicle + Unit must be alive Utiliser uniquement sur une unité vivante @@ -250,6 +262,12 @@ Юнит должен быть транспортом La unidad debe ser un vehículo + + Unit must be a vehicle with cargo space + + + Unit must have cargo space left + Unit must not be captive Jednostka nie może być więźniem @@ -299,4 +317,4 @@ Añadir cualquier objeto creado a todos los directores en la misión - \ No newline at end of file + From 151903ace4ac3aa2a188b4a04c49da52641de06b Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 00:31:23 +0200 Subject: [PATCH 204/311] Expanded optional hint to addCargoItem and AddCargoByClass event --- addons/cargo/functions/fnc_addCargoItem.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 5aed10388b..9f349153c0 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -6,6 +6,7 @@ * 0: Item Classname * 1: Vehicle * 2: Amount (default: 1) + * 3: Show Hint (default: false) * * Return Value: * None @@ -18,7 +19,7 @@ #include "script_component.hpp" private ["_position", "_item", "_i"]; -params ["_itemClass", "_vehicle", ["_amount", 1]]; +params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ]; TRACE_3("params",_itemClass,_vehicle,_amount); _position = getPos _vehicle; @@ -29,7 +30,7 @@ for "_i" from 1 to _amount do { _item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; // Load item or delete it if no space left - if !([_item, _vehicle, false] call FUNC(loadItem)) exitWith { + if !([_item, _vehicle, _showHint] call FUNC(loadItem)) exitWith { TRACE_1("no room to load item - deleting",_item); deleteVehicle _item; }; From e3985dce3eb95ea7674b9a5e1fe18d2b939cae94 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 00:40:59 +0200 Subject: [PATCH 205/311] Cleanup sitRotation as it's no longer needed --- addons/sitting/CfgVehicles.hpp | 6 ------ addons/sitting/functions/fnc_sit.sqf | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp index a156d5e87e..7b0237d172 100644 --- a/addons/sitting/CfgVehicles.hpp +++ b/addons/sitting/CfgVehicles.hpp @@ -60,7 +60,6 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -0.45}; - GVAR(sitRotation) = 10; }; // Camping Chair class Land_CampingChair_V2_F: ThingX { @@ -69,7 +68,6 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -0.45}; - GVAR(sitRotation) = 45; }; class Furniture_base_F; @@ -80,7 +78,6 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 90; GVAR(sitPosition[]) = {0, 0, -0.5}; - GVAR(sitRotation) = 5; }; // Chair (Wooden) class Land_ChairWood_F: Furniture_base_F { @@ -89,7 +86,6 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.05, 0}; - GVAR(sitRotation) = 75; }; // Office Chair class Land_OfficeChair_01_F: Furniture_base_F { @@ -98,7 +94,6 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, 0, -0.6}; - GVAR(sitRotation) = 15; }; // Rattan Chair class Land_RattanChair_01_F: Furniture_base_F { @@ -107,6 +102,5 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point) - GVAR(sitRotation) = 2; }; }; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 5e9c36947e..e77e2d2b13 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_seatPosOrig"]; +private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosOrig"]; params ["_seat", "_player"]; @@ -50,7 +50,6 @@ _player setVariable [QGVAR(StandUpActionID), _actionID]; _configFile = configFile >> "CfgVehicles" >> typeOf _seat; _sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection)); _sitPosition = getArray (_configFile >> QGVAR(sitPosition)); -_sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber (_configFile >> QGVAR(sitRotation))} else {45}; // Apply default if config entry not present // Get random animation and perform it (before moving player to ensure correct placement) [_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations From a7a716ca8d730ad407625c3447b15a7d255c9766 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 01:20:40 +0200 Subject: [PATCH 206/311] Better sitting framework in terms of interactions --- addons/sitting/CfgEventHandlers.hpp | 8 ++++ addons/sitting/CfgVehicles.hpp | 24 ----------- addons/sitting/XEH_preInit.sqf | 3 ++ .../sitting/functions/fnc_addSitActions.sqf | 42 +++++++++++++++++++ addons/sitting/functions/fnc_canSit.sqf | 6 +-- addons/sitting/functions/fnc_sit.sqf | 2 +- 6 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 addons/sitting/functions/fnc_addSitActions.sqf diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp index 1e804e8cc9..bd13e623f0 100644 --- a/addons/sitting/CfgEventHandlers.hpp +++ b/addons/sitting/CfgEventHandlers.hpp @@ -17,3 +17,11 @@ class Extended_Killed_EventHandlers { }; }; }; + +class Extended_InitPost_EventHandlers { + class All { + class ADDON { + init = QUOTE(_this call DFUNC(addSitActions)) + }; + }; +}; diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp index 7b0237d172..0d41ba1ed6 100644 --- a/addons/sitting/CfgVehicles.hpp +++ b/addons/sitting/CfgVehicles.hpp @@ -34,29 +34,10 @@ class CfgVehicles { }; }; - #define MACRO_SEAT_ACTION \ - class ACE_Actions { \ - class ACE_MainActions { \ - displayName = ECSTRING(interaction,MainAction); \ - selection = ""; \ - distance = 1.5; \ - condition = "true"; \ - class GVAR(Sit) { \ - displayName = CSTRING(Sit); \ - condition = QUOTE(_this call FUNC(canSit)); \ - statement = QUOTE(_this call FUNC(sit)); \ - showDisabled = 0; \ - priority = 0; \ - icon = PATHTOF(UI\sit_ca.paa); \ - }; \ - }; \ - }; - class ThingX; // Folding Chair class Land_CampingChair_V1_F: ThingX { XEH_ENABLED; - MACRO_SEAT_ACTION GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -0.45}; @@ -64,7 +45,6 @@ class CfgVehicles { // Camping Chair class Land_CampingChair_V2_F: ThingX { XEH_ENABLED; - MACRO_SEAT_ACTION GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -0.45}; @@ -74,7 +54,6 @@ class CfgVehicles { // Chair (Plastic) class Land_ChairPlastic_F: Furniture_base_F { XEH_ENABLED; - MACRO_SEAT_ACTION GVAR(canSit) = 1; GVAR(sitDirection) = 90; GVAR(sitPosition[]) = {0, 0, -0.5}; @@ -82,7 +61,6 @@ class CfgVehicles { // Chair (Wooden) class Land_ChairWood_F: Furniture_base_F { XEH_ENABLED; - MACRO_SEAT_ACTION GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.05, 0}; @@ -90,7 +68,6 @@ class CfgVehicles { // Office Chair class Land_OfficeChair_01_F: Furniture_base_F { XEH_ENABLED; - MACRO_SEAT_ACTION GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, 0, -0.6}; @@ -98,7 +75,6 @@ class CfgVehicles { // Rattan Chair class Land_RattanChair_01_F: Furniture_base_F { XEH_ENABLED; - MACRO_SEAT_ACTION GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point) diff --git a/addons/sitting/XEH_preInit.sqf b/addons/sitting/XEH_preInit.sqf index 86912ada6b..15ffe281c8 100644 --- a/addons/sitting/XEH_preInit.sqf +++ b/addons/sitting/XEH_preInit.sqf @@ -2,6 +2,7 @@ ADDON = false; +PREP(addSitActions); PREP(canSit); PREP(canStand); PREP(getRandomAnimation); @@ -10,4 +11,6 @@ PREP(moduleInit); PREP(sit); PREP(stand); +GVAR(initializedClasses) = []; + ADDON = true; diff --git a/addons/sitting/functions/fnc_addSitActions.sqf b/addons/sitting/functions/fnc_addSitActions.sqf new file mode 100644 index 0000000000..18779d9229 --- /dev/null +++ b/addons/sitting/functions/fnc_addSitActions.sqf @@ -0,0 +1,42 @@ +/* + * Author: Jonpas + * Adds sit actions. + * + * Arguments: + * 0: Seat + * + * Return Value: + * None + * + * Example: + * [seat] call ace_sitting_fnc_addSitActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_seat"]; +private ["_type", "_sitAction"]; + +_type = typeOf _seat; + +// Exit if the object is not specified as a seat +if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canSit)) != 1) exitWith {}; + +// Exit if class already initialized +if (_type in GVAR(initializedClasses)) exitWith {}; + +GVAR(initializedClasses) pushBack _type; + +_sitAction = [ + QGVAR(Sit), + localize LSTRING(Sit), + QUOTE(PATHTOF(UI\sit_ca.paa)), + {_this call FUNC(sit)}, + {_this call FUNC(canSit)}, + {}, + [], + [0, 0, 0], + 1.5 +] call EFUNC(interact_menu,createAction); +[_type, 0, ["ACE_MainActions"], _sitAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf index fef36b4bbd..1dd0c9676f 100644 --- a/addons/sitting/functions/fnc_canSit.sqf +++ b/addons/sitting/functions/fnc_canSit.sqf @@ -4,22 +4,20 @@ * * Arguments: * 0: Seat - * 1: Player * * Return Value: * Can Sit Down * * Example: - * [seat, player] call ace_sitting_fnc_canSit + * [seat] call ace_sitting_fnc_canSit * * Public: No */ #include "script_component.hpp" -params ["_seat", "_player"]; +params ["_seat"]; // Sitting enabled, is seat object, not occupied and standing up (or not on a big slope) GVAR(enable) && -{getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1} && {isNil {_seat getVariable QGVAR(seatOccupied)}} && {round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index e77e2d2b13..61872dd1a0 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -21,7 +21,7 @@ private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosO params ["_seat", "_player"]; // Set global variable for standing up -GVAR(seat) = _seat; +GVAR(seat) = _seat; //@todo - put into player isSitting variable // Overwrite weird position, because Arma decides to set it differently based on current animation/stance... _player switchMove "amovpknlmstpsraswrfldnon"; From dbd0beb5140355133ee234bd1cd658a5a2cd32d7 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 01:31:23 +0200 Subject: [PATCH 207/311] Stored a global variable in player setVariable --- addons/sitting/CfgEventHandlers.hpp | 1 + addons/sitting/XEH_clientInit.sqf | 2 +- addons/sitting/functions/fnc_canStand.sqf | 2 +- addons/sitting/functions/fnc_handleInterrupt.sqf | 2 +- addons/sitting/functions/fnc_sit.sqf | 9 +++------ addons/sitting/functions/fnc_stand.sqf | 9 ++++++--- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp index bd13e623f0..8b3768a747 100644 --- a/addons/sitting/CfgEventHandlers.hpp +++ b/addons/sitting/CfgEventHandlers.hpp @@ -18,6 +18,7 @@ class Extended_Killed_EventHandlers { }; }; +// Need initPost or there are problems with setVariable class Extended_InitPost_EventHandlers { class All { class ADDON { diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf index 9cf8278877..23816bd8d7 100644 --- a/addons/sitting/XEH_clientInit.sqf +++ b/addons/sitting/XEH_clientInit.sqf @@ -4,7 +4,7 @@ if (!hasInterface) exitWith {}; // Add interaction menu exception -["isNotSitting", {!((_this select 0) getVariable [QGVAR(isSitting), false])}] call EFUNC(common,addCanInteractWithCondition); +["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition); // Handle interruptions ["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); diff --git a/addons/sitting/functions/fnc_canStand.sqf b/addons/sitting/functions/fnc_canStand.sqf index c516485a82..a051e1784e 100644 --- a/addons/sitting/functions/fnc_canStand.sqf +++ b/addons/sitting/functions/fnc_canStand.sqf @@ -18,4 +18,4 @@ params ["_player"]; // Sitting -(_player getVariable [QGVAR(isSitting), false]) +!isNil {_player getVariable QGVAR(isSitting)} diff --git a/addons/sitting/functions/fnc_handleInterrupt.sqf b/addons/sitting/functions/fnc_handleInterrupt.sqf index 328675c172..c7e0a545ff 100644 --- a/addons/sitting/functions/fnc_handleInterrupt.sqf +++ b/addons/sitting/functions/fnc_handleInterrupt.sqf @@ -17,6 +17,6 @@ params ["_player"]; -if (_player getVariable [QGVAR(isSitting), false]) then { +if (!isNil {_player getVariable QGVAR(isSitting)}) then { _player call FUNC(stand); }; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 61872dd1a0..1b6f979b42 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -20,9 +20,6 @@ private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosO params ["_seat", "_player"]; -// Set global variable for standing up -GVAR(seat) = _seat; //@todo - put into player isSitting variable - // Overwrite weird position, because Arma decides to set it differently based on current animation/stance... _player switchMove "amovpknlmstpsraswrfldnon"; @@ -60,8 +57,8 @@ _player setDir _sitDirection; // No need for ATL/ASL as modelToWorld returns in format position _player setPos (_seat modelToWorld _sitPosition); -// Set variables -_player setVariable [QGVAR(isSitting), true]; +// Set variables, save seat object on player +_player setVariable [QGVAR(isSitting), _seat]; _seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat @@ -72,7 +69,7 @@ _seatPosOrig = getPosASL _seat; _args params ["_player", "_seat", "_seatPosOrig"]; // Remove PFH if not sitting any more - if !(_player getVariable [QGVAR(isSitting), false]) exitWith { + if (isNil {_player getVariable QGVAR(isSitting)}) exitWith { [_pfhId] call CBA_fnc_removePerFrameHandler; TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(isSitting), false)]); }; diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf index ef19d5f586..4c56eba1c4 100644 --- a/addons/sitting/functions/fnc_stand.sqf +++ b/addons/sitting/functions/fnc_stand.sqf @@ -17,7 +17,7 @@ params ["_player"]; -// remove scroll wheel action +// Remove scroll wheel action _player removeAction (_player getVariable [QGVAR(StandUpActionID), -1]); // Restore animation @@ -31,7 +31,10 @@ _animation = switch (currentWeapon _player) do { [_player, _animation, 2] call EFUNC(common,doAnimation); +// Get seat from variable on player +_seat = _player getVariable [QGVAR(isSitting), objNull]; +if (isNull _seat) exitWith {}; + // Set variables to nil _player setVariable [QGVAR(isSitting), nil]; -GVAR(seat) setVariable [QGVAR(seatOccupied), nil, true]; -GVAR(seat) = nil; +_seat setVariable [QGVAR(seatOccupied), nil, true]; From 85cff04e0c368caf1f426d5d587e229cfcc9b6c4 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 01:37:19 +0200 Subject: [PATCH 208/311] Stored scroll-wheel action ID into already existing player setVariable instead of having 2 --- addons/sitting/functions/fnc_sit.sqf | 10 +--------- addons/sitting/functions/fnc_stand.sqf | 13 ++++++------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 1b6f979b42..821bb230d1 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -24,12 +24,6 @@ params ["_seat", "_player"]; _player switchMove "amovpknlmstpsraswrfldnon"; // Add scroll-wheel action to release object -_actionID = _player getVariable [QGVAR(StandUpActionID), -1]; - -if (_actionID != -1) then { - _player removeAction _actionID; -}; - _actionID = _player addAction [ format ["%1", localize LSTRING(Stand)], QUOTE((_this select 0) call FUNC(stand)), @@ -41,8 +35,6 @@ _actionID = _player addAction [ QUOTE(_this call FUNC(canStand)) ]; -_player setVariable [QGVAR(StandUpActionID), _actionID]; - // Read config _configFile = configFile >> "CfgVehicles" >> typeOf _seat; _sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection)); @@ -58,7 +50,7 @@ _player setDir _sitDirection; _player setPos (_seat modelToWorld _sitPosition); // Set variables, save seat object on player -_player setVariable [QGVAR(isSitting), _seat]; +_player setVariable [QGVAR(isSitting), [_seat, _actionID]]; _seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf index 4c56eba1c4..4c08461746 100644 --- a/addons/sitting/functions/fnc_stand.sqf +++ b/addons/sitting/functions/fnc_stand.sqf @@ -16,12 +16,14 @@ #include "script_component.hpp" params ["_player"]; +private ["_animation"]; -// Remove scroll wheel action -_player removeAction (_player getVariable [QGVAR(StandUpActionID), -1]); +(_player getVariable QGVAR(isSitting)) params ["_seat", "_actionID"]; + +// Remove scroll-wheel action +_player removeAction _actionID; // Restore animation -private "_animation"; _animation = switch (currentWeapon _player) do { case "": {"amovpercmstpsnonwnondnon"}; case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"}; @@ -31,10 +33,7 @@ _animation = switch (currentWeapon _player) do { [_player, _animation, 2] call EFUNC(common,doAnimation); -// Get seat from variable on player -_seat = _player getVariable [QGVAR(isSitting), objNull]; -if (isNull _seat) exitWith {}; - // Set variables to nil _player setVariable [QGVAR(isSitting), nil]; +if (isNull _seat) exitWith {}; _seat setVariable [QGVAR(seatOccupied), nil, true]; From cd510c8ff75d36e813babcb908ac2450df47dccb Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 02:05:38 +0200 Subject: [PATCH 209/311] Added carrying to chairs --- addons/dragging/CfgEventHandlers.hpp | 12 +----------- addons/sitting/CfgVehicles.hpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 2ff7d07c0d..3ee6e9b8cf 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -18,17 +18,7 @@ class Extended_Init_EventHandlers { init = QUOTE(_this call DFUNC(initPerson)); }; }; - class StaticWeapon { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class ReammoBox_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class ACE_RepairItem_Base { + class All { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp index 0d41ba1ed6..4ac0d0edb7 100644 --- a/addons/sitting/CfgVehicles.hpp +++ b/addons/sitting/CfgVehicles.hpp @@ -41,6 +41,9 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -0.45}; + EGVAR(dragging,canCarry) = 1; + EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5}; + EGVAR(dragging,carryDirection) = 180; }; // Camping Chair class Land_CampingChair_V2_F: ThingX { @@ -48,6 +51,9 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -0.45}; + EGVAR(dragging,canCarry) = 1; + EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5}; + EGVAR(dragging,carryDirection) = 180; }; class Furniture_base_F; @@ -57,6 +63,9 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 90; GVAR(sitPosition[]) = {0, 0, -0.5}; + EGVAR(dragging,canCarry) = 1; + EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5}; + EGVAR(dragging,carryDirection) = 270; }; // Chair (Wooden) class Land_ChairWood_F: Furniture_base_F { @@ -64,6 +73,9 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.05, 0}; + EGVAR(dragging,canCarry) = 1; + EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5}; + EGVAR(dragging,carryDirection) = 180; }; // Office Chair class Land_OfficeChair_01_F: Furniture_base_F { @@ -71,6 +83,9 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, 0, -0.6}; + EGVAR(dragging,canCarry) = 1; + EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5}; + EGVAR(dragging,carryDirection) = 180; }; // Rattan Chair class Land_RattanChair_01_F: Furniture_base_F { @@ -78,5 +93,8 @@ class CfgVehicles { GVAR(canSit) = 1; GVAR(sitDirection) = 180; GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point) + EGVAR(dragging,canCarry) = 1; + EGVAR(dragging,carryPosition[]) = {0, 0.75, 0.5}; + EGVAR(dragging,carryDirection) = 180; }; }; From ae07a71b0de9ac0b34daefc42aafe29f5c500eed Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 02:13:32 +0200 Subject: [PATCH 210/311] Minimized XEH to ThingX config level --- addons/dragging/CfgEventHandlers.hpp | 7 ++++++- addons/sitting/CfgEventHandlers.hpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 3ee6e9b8cf..532038c2c5 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -18,7 +18,12 @@ class Extended_Init_EventHandlers { init = QUOTE(_this call DFUNC(initPerson)); }; }; - class All { + class StaticWeapon { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + class ThingX { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp index 8b3768a747..da7efe1601 100644 --- a/addons/sitting/CfgEventHandlers.hpp +++ b/addons/sitting/CfgEventHandlers.hpp @@ -20,7 +20,7 @@ class Extended_Killed_EventHandlers { // Need initPost or there are problems with setVariable class Extended_InitPost_EventHandlers { - class All { + class ThingX { class ADDON { init = QUOTE(_this call DFUNC(addSitActions)) }; From 2ab58ab9ce87e9ae4cccab0f17e7347a8f6d1e7d Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 27 Sep 2015 02:23:56 +0200 Subject: [PATCH 211/311] Replaced common,isAlive function with alive command --- addons/dragging/functions/fnc_carryObjectPFH.sqf | 2 +- addons/dragging/functions/fnc_dragObjectPFH.sqf | 2 +- addons/dragging/functions/fnc_startCarryPFH.sqf | 2 +- addons/dragging/functions/fnc_startDragPFH.sqf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index d0eb7fda17..b50383707a 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject_carry); [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index dea8897b27..f6ff252886 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject); [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index ae5ad17978..eafc9b8e01 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject); [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index f527cda7d8..1edbd92a99 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject); [_idPFH] call CBA_fnc_removePerFrameHandler; }; From 174d8ac3062bc90044a4dd24301de9c37cde890f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 26 Sep 2015 22:02:05 -0500 Subject: [PATCH 212/311] #2486 - Run color setup on settingsInit --- addons/interact_menu/XEH_clientInit.sqf | 16 +++++++++------- addons/interact_menu/functions/fnc_render.sqf | 10 ++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 44dfddcadd..59fb01a353 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -8,17 +8,19 @@ GVAR(cachedBuildingActionPairs) = []; GVAR(ParsedTextCached) = []; -//Setup text/shadow/size/color settings matrix -[] call FUNC(setupTextColors); ["SettingChanged", { - PARAMS_1(_name); - if (_name in [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) then { + params ["_name"]; + if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then { [] call FUNC(setupTextColors); }; }] call EFUNC(common,addEventhandler); -// Install the render EH on the main display -addMissionEventHandler ["Draw3D", DFUNC(render)]; +["SettingsInitialized", { + //Setup text/shadow/size/color settings matrix + [] call FUNC(setupTextColors); + // Install the render EH on the main display + addMissionEventHandler ["Draw3D", DFUNC(render)]; +}] call EFUNC(common,addEventHandler); //Add Actions to Houses: ["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler); @@ -54,7 +56,7 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; // If no menu is open just quit if (GVAR(openedMenuType) < 0) exitWith {}; - EXPLODE_2_PVT(_this,_unit,_isUnconscious); + params ["_unit", "_isUnconscious"]; if (_unit != ACE_player || !_isUnconscious) exitWith {}; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 55ca280c43..39a0f048be 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -10,17 +10,19 @@ * * Public: No */ + #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" BEGIN_COUNTER(fnc_render); -private ["_cursorPos1", "_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"]; -_foundTarget = false; -_cursorPos1 = positionCameraToWorld [0, 0, 0]; -_cursorPos2 = positionCameraToWorld [0, 0, 2]; +private ["_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"]; +_foundTarget = false; if (GVAR(openedMenuType) >= 0) then { + // _cursorPos1 = positionCameraToWorld [0, 0, 2]; + _cursorPos2 = positionCameraToWorld [0, 0, 2]; + // Render all available nearby interactions call FUNC(renderActionPoints); From 4a935eb1298d6cca3633a162ffc4c28a7f528695 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 26 Sep 2015 22:02:44 -0500 Subject: [PATCH 213/311] Remove debug --- addons/interact_menu/functions/fnc_render.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 39a0f048be..54f197a2a3 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -10,7 +10,6 @@ * * Public: No */ - #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" BEGIN_COUNTER(fnc_render); From 50046decf37daa04127be6c80f55f9f24e64c714 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 27 Sep 2015 08:28:55 +0200 Subject: [PATCH 214/311] Code Cleanup SafetyMode --- addons/safemode/CfgEventHandlers.hpp | 4 +- addons/safemode/XEH_postInit.sqf | 5 +- addons/safemode/functions/fnc_lockSafety.sqf | 66 ++++++++----------- .../functions/fnc_playChangeFiremodeSound.sqf | 25 ++++--- .../functions/fnc_setSafeModeVisual.sqf | 4 +- .../safemode/functions/fnc_unlockSafety.sqf | 22 +++---- 6 files changed, 59 insertions(+), 67 deletions(-) diff --git a/addons/safemode/CfgEventHandlers.hpp b/addons/safemode/CfgEventHandlers.hpp index eefe61652b..0cd959a047 100644 --- a/addons/safemode/CfgEventHandlers.hpp +++ b/addons/safemode/CfgEventHandlers.hpp @@ -1,12 +1,12 @@ class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE( call COMPILE_FILE(XEH_postInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index c7132dd76c..f3ab06d20e 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -7,8 +7,7 @@ if (!hasInterface) exitWith {}; //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" - -// Add keybinds +// add keybinds ["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), { // Conditions: canInteract @@ -21,4 +20,4 @@ if (!hasInterface) exitWith {}; true }, {false}, -[41, [false, true, false]], false] call cba_fnc_addKeybind; +[41, [false, true, false]], false] call CBA_fnc_addKeybind; diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 54fa254716..9fe429a49b 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -20,10 +20,10 @@ // don't immediately switch back if (inputAction "nextWeapon" > 0) exitWith {}; -private ["_safedWeapons", "_condition", "_statement", "_id", "_picture"]; - params ["_unit", "_weapon", "_muzzle"]; +private ["_safedWeapons", "_picture"]; + _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) exitWith { @@ -35,47 +35,39 @@ _safedWeapons pushBack _weapon; _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; if (_unit getVariable [QGVAR(actionID), -1] == -1) then { - _condition = { - params ["", "_caller"]; - if ( - [_caller] call EFUNC(common,canUseWeapon) - && { - if (currentMuzzle _caller in (_caller getVariable [QGVAR(safedWeapons), []])) then { - if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon _caller, currentMuzzle _caller] call FUNC(unlockSafety); - false - }; - true - } else {false} - } - ) then { - // player hud - [false] call FUNC(setSafeModeVisual); - true - } else { - // player hud - [true] call FUNC(setSafeModeVisual); - false - } - }; - - _statement = { - params ["", "_caller"]; - [_caller, currentWeapon _caller, currentMuzzle _caller] call FUNC(unlockSafety); - }; - - //_id = [_unit, format ["%1", localize LSTRING(TakeOffSafety)], "DefaultAction", _condition, {}, {true}, _statement, 10] call EFUNC(common,addActionMenuEventHandler); - _id = [_unit, "DefaultAction", _condition, {}] call EFUNC(common,addActionEventHandler); - - _unit setVariable [QGVAR(actionID), _id]; + _unit setVariable [QGVAR(actionID), [ + _unit, "DefaultAction", { + if ( + [_this select 1] call EFUNC(common,canUseWeapon) + && { + if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { + if (inputAction "nextWeapon" > 0) exitWith { + [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + false + }; + true + } else {false} + } + ) then { + // player hud + [false] call FUNC(setSafeModeVisual); + true + } else { + // player hud + [true] call FUNC(setSafeModeVisual); + false + }; + }, {} + ] call EFUNC(common,addActionEventHandler)]; }; -if ((typeName _muzzle) == (typeName "")) then { - _unit selectWeapon _muzzle; //_weapon +if (typeName _muzzle == "STRING") then { + _unit selectWeapon _muzzle; }; // play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); +// show info box _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 3fa29f3d88..5da4aeb672 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -16,23 +16,28 @@ */ #include "script_component.hpp" -private ["_sound", "_position"]; - params ["_unit", "_weapon"]; +private ["_sound", "_position"]; + _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); -if (count _sound == 0) exitWith { +if (_sound isEqualTo []) exitWith { playSound "ACE_Sound_Click"; }; -// add file extension -if ({(toLower (_sound select 0) find _x == (count toArray (_sound select 0) - count toArray _x) - 1)} count [".wav", ".ogg", ".wss"] == 0) then { - _sound set [0, (_sound select 0) + ".wss"]; -}; - -_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); -_position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; +// get position where to play the sound (position of the weapon) +_position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); _sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; + +if (_filename == "") exitWith { + playSound "ACE_Sound_Click"; +}; + +// add file extension .wss as default +if !(toLower (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { + _filename = format ["%1.wss", _filename]; +}; + playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index 43f4bc79b6..492d5c6996 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -15,17 +15,17 @@ */ #include "script_component.hpp" -private ["_control", "_config"]; - params ["_show"]; disableSerialization; +private "_control"; _control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl 187; if (isNull _control) exitWith {}; if (_show) then { + private "_config"; _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 35fdb0dee5..ef01766872 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -17,24 +17,19 @@ */ #include "script_component.hpp" -private ["_safedWeapons", "_id", "_picture"]; - params ["_unit", "_weapon", "_muzzle"]; +private ["_safedWeapons", "_picture"]; + _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +_safedWeapons deleteAt (_safedWeapons find _weapon); -if (_weapon in _safedWeapons) then { - _safedWeapons = _safedWeapons - [_weapon]; +_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; - _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; - - if (count _safedWeapons == 0) then { - _id = _unit getVariable [QGVAR(actionID), -1]; - - //[_unit, "DefaultAction", _id] call EFUNC(common,removeActionMenuEventHandler); - [_unit, "DefaultAction", _id] call EFUNC(common,removeActionEventHandler); - _unit setVariable [QGVAR(actionID), -1]; - }; +// remove action if all weapons have put their safety on +if (_safedWeapons isEqualTo []) then { + [_unit, "DefaultAction", _unit getVariable [QGVAR(actionID), -1]] call EFUNC(common,removeActionEventHandler); + _unit setVariable [QGVAR(actionID), -1]; }; _unit selectWeapon _muzzle; @@ -74,5 +69,6 @@ if (inputAction "nextWeapon" > 0) then { // player hud [true] call FUNC(setSafeModeVisual); +// show info box _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); From a078d732308ed55df5c2ec3dc334fa15bf1daf6b Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 27 Sep 2015 08:51:42 +0200 Subject: [PATCH 215/311] Code Cleanup WeaponSelect --- addons/common/XEH_postInit.sqf | 4 ++-- addons/weaponselect/ACE_Settings.hpp | 1 + addons/weaponselect/CfgEventHandlers.hpp | 4 ++-- addons/weaponselect/XEH_postInit.sqf | 2 +- .../fnc_displayGrenadeTypeAndNumber.sqf | 16 ++++++++-------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e374a7a716..54bf79d61f 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -375,8 +375,8 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { // @todo still needed? [QGVAR(StateArrested), false, true, QUOTE(ADDON)] call FUNC(defineVariable); -["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); -["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); +["displayTextStructured", {_this call FUNC(displayTextStructured)}] call FUNC(addEventhandler); +["displayTextPicture", {_this call FUNC(displayTextPicture)}] call FUNC(addEventhandler); ["medical_onUnconscious", { params ["_unit", "_isUnconscious"]; diff --git a/addons/weaponselect/ACE_Settings.hpp b/addons/weaponselect/ACE_Settings.hpp index 7b60527449..2214451247 100644 --- a/addons/weaponselect/ACE_Settings.hpp +++ b/addons/weaponselect/ACE_Settings.hpp @@ -1,3 +1,4 @@ + class ACE_Settings { class GVAR(DisplayText) { typeName = "BOOL"; diff --git a/addons/weaponselect/CfgEventHandlers.hpp b/addons/weaponselect/CfgEventHandlers.hpp index f409a36e5a..fd928fde2a 100644 --- a/addons/weaponselect/CfgEventHandlers.hpp +++ b/addons/weaponselect/CfgEventHandlers.hpp @@ -13,8 +13,8 @@ class Extended_PostInit_EventHandlers { class Extended_FiredBIS_EventHandlers { class CAManBase { - class GVAR(ThrowGrenade) { - clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(throwGrenade)};); + class GVAR(throwGrenade) { + clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(throwGrenade)}); }; }; }; diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 3da7fda785..4d0df68f52 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -3,7 +3,7 @@ if (!hasInterface) exitWith {}; -// Add keybinds +// add keybinds ["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), { // Conditions: canInteract diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 37956d2121..6ae945e2fd 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -1,10 +1,10 @@ /* - * Author: esteldunedain + * Author: esteldunedain, commy2 * Display a grenade type and quantity. * * Arguments: - * 0: magazine class - * 1: number of magazines + * 0: grenade magazine class + * 1: number of grenades * * Return Value: * None @@ -18,14 +18,14 @@ if !(GVAR(DisplayText)) exitwith {}; +params ["_magazine", "_numberofGrenades"]; + private ["_color", "_name", "_text", "_picture"]; -params ["_magazine", "_numberofMagazines"]; - -_color = [[1, 0, 0], [1, 1, 1]] select (_numberofMagazines > 0); +_color = [[1, 0, 0], [1, 1, 1]] select (_numberofGrenades > 0); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); -_text = [format["%1 x%2", _name, _numberofMagazines], _color] call EFUNC(common,stringToColoredText); +_text = [format ["%1 x%2", _name, _numberofGrenades], _color] call EFUNC(common,stringToColoredText); _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); -[_text, _picture] call EFUNC(common,displayTextPicture); +["displayTextPicture", [_text, _picture]] call EFUNC(common,localEvent); From f8819d3ee4c138e0b6926766ca4fa7ea7c83dc82 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 27 Sep 2015 14:55:36 +0200 Subject: [PATCH 216/311] WeaponSelect cleanup --- addons/weaponselect/XEH_postInit.sqf | 70 ++++++++----------- .../functions/fnc_fireSmokeLauncher.sqf | 10 +-- .../functions/fnc_playChangeFiremodeSound.sqf | 38 ++++------ .../functions/fnc_putWeaponAway.sqf | 2 +- 4 files changed, 49 insertions(+), 71 deletions(-) diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 4d0df68f52..336358381a 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -4,8 +4,7 @@ if (!hasInterface) exitWith {}; // add keybinds -["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), -{ +["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -16,10 +15,9 @@ if (!hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 1 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 1 Key) -["ACE3 Weapons", QGVAR(SelectRifleNew), localize LSTRING(SelectRifle), -{ +["ACE3 Weapons", QGVAR(SelectRifleNew), localize LSTRING(SelectRifle), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -30,10 +28,9 @@ if (!hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 2 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 2 Key) -["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize LSTRING(SelectRifleMuzzle), -{ +["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize LSTRING(SelectRifleMuzzle), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -44,10 +41,9 @@ if (!hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 3 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 3 Key) -["ACE3 Weapons", QGVAR(SelectLauncherNew), localize LSTRING(SelectLauncher), -{ +["ACE3 Weapons", QGVAR(SelectLauncherNew), localize LSTRING(SelectLauncher), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -58,10 +54,9 @@ if (!hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 4 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 4 Key) -["ACE3 Weapons", QGVAR(SelectBinocularNew), localize LSTRING(SelectBinocular), -{ +["ACE3 Weapons", QGVAR(SelectBinocularNew), localize LSTRING(SelectBinocular), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -72,10 +67,9 @@ if (!hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 5 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 5 Key) -["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize LSTRING(SelectGrenadeFrag), -{ +["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize LSTRING(SelectGrenadeFrag), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -86,10 +80,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key +[7, [false, false, false]], false] call CBA_fnc_addKeybind; //6 Key -["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize LSTRING(SelectGrenadeOther), -{ +["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize LSTRING(SelectGrenadeOther), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -100,10 +93,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key +[8, [false, false, false]], false] call CBA_fnc_addKeybind; //7 Key -["ACE3 Weapons", QGVAR(HolsterWeapon), localize LSTRING(HolsterWeapon), -{ +["ACE3 Weapons", QGVAR(HolsterWeapon), localize LSTRING(HolsterWeapon), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotInside", "isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -125,10 +117,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key +[11, [false, false, false]], false] call CBA_fnc_addKeybind; //0 Key -["ACE3 Vehicles", QGVAR(EngineOn), localize LSTRING(EngineOn), -{ +["ACE3 Vehicles", QGVAR(EngineOn), localize LSTRING(EngineOn), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -139,10 +130,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key +[3, [false, false, false]], false] call CBA_fnc_addKeybind; //2 Key -["ACE3 Vehicles", QGVAR(EngineOff), localize LSTRING(EngineOff), -{ +["ACE3 Vehicles", QGVAR(EngineOff), localize LSTRING(EngineOff), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -153,10 +143,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key +[2, [false, false, false]], false] call CBA_fnc_addKeybind; //1 Key -["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize LSTRING(SelectMainGun), -{ +["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize LSTRING(SelectMainGun), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -167,10 +156,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 3 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 3 Key) -["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize LSTRING(SelectMachineGun), -{ +["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize LSTRING(SelectMachineGun), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -181,10 +169,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 4 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 4 Key) -["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize LSTRING(SelectMissiles), -{ +["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize LSTRING(SelectMissiles), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -195,10 +182,9 @@ if (!hasInterface) exitWith {}; true }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 5 Key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 5 Key) -["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize LSTRING(FireSmokeLauncher), -{ +["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize LSTRING(FireSmokeLauncher), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -209,4 +195,4 @@ if (!hasInterface) exitWith {}; true }, {false}, -[10, [false, false, false]], false] call cba_fnc_addKeybind; //9 Key +[10, [false, false, false]], false] call CBA_fnc_addKeybind; //9 Key diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf index 20ef674dae..71ef89ecf6 100644 --- a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -15,10 +15,10 @@ */ #include "script_component.hpp" -private ["_turret", "_weapons"]; - params ["_vehicle"]; +private ["_turret", "_weapons"]; + _turret = [_vehicle] call EFUNC(common,getTurretCommander); _weapons = _vehicle weaponsTurret _turret; @@ -29,11 +29,10 @@ if ( ) then { //This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead. - private "_index"; - // avoid infinite loop if !("SmokeLauncher" in _weapons) exitWith {}; + private "_index"; _index = 0; while { _vehicle currentWeaponTurret _turret != "SmokeLauncher" @@ -46,8 +45,9 @@ if ( // fire away! private "_logic"; - _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; + _logic action ["useWeapon", _vehicle, commander _vehicle, 0]; + deleteVehicle _logic; }; diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index c79f03c6f2..28ef5d21e5 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Play the change firemode sound for specified weapon at units position. + * Play weapon firemode change sound. * * Arguments: * 0: Unit @@ -16,32 +16,24 @@ */ #include "script_component.hpp" -private ["_sound"]; - params ["_unit", "_weapon"]; +private ["_sound", "_position"]; + _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); -if (count _sound == 0) exitWith {}; +if (_sound isEqualTo []) exitWith {}; -// add file extension -if call { - { - if (toLower (_sound select 0) find _x == count toArray (_sound select 0) - count toArray _x - 1) exitWith {false}; - true - } forEach [".wav", ".ogg", ".wss"]; -} then { - _sound set [0, (_sound select 0) + ".wss"]; +// get position where to play the sound (position of the weapon) +_position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); + +_sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; + +if (_filename == "") exitWith {}; + +// add file extension .wss as default +if !(toLower (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { + _filename = format ["%1.wss", _filename]; }; -// add default volume, pitch and distance -if (count _sound < 2) then {_sound pushBack 1}; -if (count _sound < 3) then {_sound pushBack 1}; -if (count _sound < 4) then {_sound pushBack 0}; - -private "_position"; - -_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); -_position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; - -playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3]; +playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; diff --git a/addons/weaponselect/functions/fnc_putWeaponAway.sqf b/addons/weaponselect/functions/fnc_putWeaponAway.sqf index faddb4d869..fd1e463a4d 100644 --- a/addons/weaponselect/functions/fnc_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -11,7 +11,7 @@ * Example: * [player] call ace_weaponselect_fnc_putWeaponAway * - * Public: NO + * Public: Yes */ #include "script_component.hpp" From b6532a05cc33dca159d0de4c633ffc37d2c121d1 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 27 Sep 2015 16:47:02 +0200 Subject: [PATCH 217/311] new function to select a grenade --- addons/weaponselect/XEH_preInit.sqf | 11 +++ .../functions/fnc_selectNextGrenade.sqf | 76 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 addons/weaponselect/functions/fnc_selectNextGrenade.sqf diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 4c5216c2f6..4319a507dd 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -13,6 +13,7 @@ PREP(putWeaponAway); PREP(selectGrenadeAll); PREP(selectGrenadeFrag); PREP(selectGrenadeOther); +PREP(selectNextGrenade); PREP(selectWeaponMode); PREP(selectWeaponMuzzle); PREP(selectWeaponVehicle); @@ -36,6 +37,10 @@ with uiNamespace do { GVAR(NonFragMagazines) = []; GVAR(AllMagazines) = []; + GVAR(GrenadesAll) = []; + GVAR(GrenadesFrag) = [];// + GVAR(GrenadesNonFrag) = [];// + { _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); _magazine = _magazines select 0; @@ -46,13 +51,16 @@ with uiNamespace do { if (_explosive == 0) then { GVAR(NonFragMuzzles) pushBack _x; GVAR(NonFragMagazines) pushBack _magazines; + GVAR(GrenadesNonFrag) append _magazines;// } else { GVAR(FragMuzzles) pushBack _x; GVAR(FragMagazines) pushBack _magazines; + GVAR(GrenadesFrag) append _magazines;// }; GVAR(AllMuzzles) pushBack _x; GVAR(AllMagazines) pushBack _magazines; + GVAR(GrenadesAll) append _magazines;// } forEach getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); }; @@ -64,5 +72,8 @@ GVAR(AllMuzzles) = uiNamespace getVariable QGVAR(AllMuzzles); GVAR(FragMagazines) = uiNamespace getVariable QGVAR(FragMagazines); GVAR(NonFragMagazines) = uiNamespace getVariable QGVAR(NonFragMagazines); GVAR(AllMagazines) = uiNamespace getVariable QGVAR(AllMagazines); +GVAR(GrenadesAll) = uiNamespace getVariable QGVAR(GrenadesAll);// +GVAR(GrenadesFrag) = uiNamespace getVariable QGVAR(GrenadesFrag);// +GVAR(GrenadesNonFrag) = uiNamespace getVariable QGVAR(GrenadesNonFrag);// ADDON = true; diff --git a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf new file mode 100644 index 0000000000..c0d9e8ccf4 --- /dev/null +++ b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf @@ -0,0 +1,76 @@ +/* + * Author: commy2 + * Select the next grenade. + * + * Arguments: + * 0: Unit + * 1: Grenade type [0: all, 1: frags, 2: non-frags] (default: 0) + * + * Return Value: + * Selecting successful? + * + * Example: + * [player] call ace_weaponselect_fnc_selectNextGrenade + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", ["_type", 0]]; + +private ["_currentGrenade", "_magazines", "_grenades", "_nextGrenadeIndex", "_nextGrenade", "_uniformGrenades", "_vestGrenades", "_backpackGrenades"]; + +// get currently selected grenade +_currentGrenade = currentThrowable _unit; + +// get correct array format if no grenade is selected +if (_currentGrenade isEqualTo []) then { + _currentGrenade = ["", ""]; +}; + +_currentGrenade = _currentGrenade select 0; + +// get available magazines for that unit +_magazines = magazines _unit; + +_grenades = []; + +{ + if (_x in _magazines) then { + _grenades pushBack _x; + }; + false +} count ([GVAR(GrenadesAll), GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select _type); + +// abort if no grenades are available +if (_grenades isEqualTo []) exitWith {false}; + +// get next grenade muzzle +_nextGrenadeIndex = (_grenades find _currentGrenade) + 1; + +// roll over if the last grenade was selected +if (_nextGrenadeIndex >= count _grenades) then { + _nextGrenadeIndex = 0; +}; + +_nextGrenade = _grenades select _nextGrenadeIndex; + +// abort if the same grenade would be selected +if (_currentGrenade == _nextGrenade) exitWith {false}; + +// current best method to select a grenade: remove all grenades, add the one you want to select first and then add the rest +_uniformGrenades = [uniformItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); +_vestGrenades = [vestItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); +_backpackGrenades = [backpackItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); + +// remove all grenades except those we are switching to --> this breaks the selector +{_unit removeItemFromUniform _x; false} count _uniformGrenades; +{_unit removeItemFromVest _x; false} count _vestGrenades; +{_unit removeItemFromBackpack _x; false} count _backpackGrenades; + +// readd grenades +{_unit addItemToUniform _x; false} count _uniformGrenades; +{_unit addItemToVest _x; false} count _vestGrenades; +{_unit addItemToBackpack _x; false} count _backpackGrenades; + +true From 1613ce3ff6304d75af925eeed5b7fe5e0a768f4d Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 27 Sep 2015 16:55:43 +0200 Subject: [PATCH 218/311] correct comment --- addons/weaponselect/functions/fnc_selectNextGrenade.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf index c0d9e8ccf4..0c0d834a3d 100644 --- a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf +++ b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf @@ -58,7 +58,7 @@ _nextGrenade = _grenades select _nextGrenadeIndex; // abort if the same grenade would be selected if (_currentGrenade == _nextGrenade) exitWith {false}; -// current best method to select a grenade: remove all grenades, add the one you want to select first and then add the rest +// current best method to select a grenade: remove all grenades except the one you want to select, then add them back _uniformGrenades = [uniformItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); _vestGrenades = [vestItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); _backpackGrenades = [backpackItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); From e9770fcb9752625991f2ec0ff17532c49471e2c6 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 27 Sep 2015 17:15:59 +0200 Subject: [PATCH 219/311] remove obsolete functions --- addons/weaponselect/XEH_postInit.sqf | 4 +- addons/weaponselect/XEH_preInit.sqf | 74 +++-------- .../fnc_countMagazinesForGrenadeMuzzle.sqf | 55 -------- .../functions/fnc_findNextGrenadeMagazine.sqf | 47 ------- .../functions/fnc_findNextGrenadeMuzzle.sqf | 47 ------- .../functions/fnc_getSelectedGrenade.sqf | 18 --- .../functions/fnc_selectGrenadeAll.sqf | 54 -------- .../functions/fnc_selectGrenadeFrag.sqf | 48 ------- .../functions/fnc_selectGrenadeOther.sqf | 48 ------- .../functions/fnc_selectNextGrenade.sqf | 2 + .../functions/fnc_setNextGrenadeMuzzle.sqf | 118 ------------------ 11 files changed, 20 insertions(+), 495 deletions(-) delete mode 100644 addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf delete mode 100644 addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf delete mode 100644 addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf delete mode 100644 addons/weaponselect/functions/fnc_getSelectedGrenade.sqf delete mode 100644 addons/weaponselect/functions/fnc_selectGrenadeAll.sqf delete mode 100644 addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf delete mode 100644 addons/weaponselect/functions/fnc_selectGrenadeOther.sqf delete mode 100644 addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 336358381a..491a86f39d 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -76,7 +76,7 @@ if (!hasInterface) exitWith {}; if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; // Statement - [ACE_player] call FUNC(selectGrenadeFrag); + [ACE_player, 1] call FUNC(selectNextGrenade); true }, {false}, @@ -89,7 +89,7 @@ if (!hasInterface) exitWith {}; if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; // Statement - [ACE_player] call FUNC(selectGrenadeOther); + [ACE_player, 2] call FUNC(selectNextGrenade); true }, {false}, diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 4319a507dd..1f324f7fb0 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -2,78 +2,36 @@ ADDON = false; -PREP(countMagazinesForGrenadeMuzzle); PREP(displayGrenadeTypeAndNumber); -PREP(findNextGrenadeMagazine); -PREP(findNextGrenadeMuzzle); PREP(fireSmokeLauncher); -PREP(getSelectedGrenade); PREP(playChangeFiremodeSound); PREP(putWeaponAway); -PREP(selectGrenadeAll); -PREP(selectGrenadeFrag); -PREP(selectGrenadeOther); PREP(selectNextGrenade); PREP(selectWeaponMode); PREP(selectWeaponMuzzle); PREP(selectWeaponVehicle); -PREP(setNextGrenadeMuzzle); PREP(throwGrenade); -// prepare grenades from config -GVAR(CurrentGrenadeMuzzleIsFrag) = true; -GVAR(CurrentGrenadeMuzzleFrag) = ""; -GVAR(CurrentGrenadeMuzzleOther) = ""; +// collect frag and other grenades separately +GVAR(GrenadesAll) = []; +GVAR(GrenadesFrag) = []; +GVAR(GrenadesNonFrag) = []; -// Collect frag and other muzzles separately -with uiNamespace do { - private ["_magazines", "_magazine", "_ammo", "_explosive"]; - if (isNil QGVAR(FragMuzzles)) then { - GVAR(FragMuzzles) = []; - GVAR(NonFragMuzzles) = []; - GVAR(AllMuzzles) = []; +private ["_magazines", "_ammo", "_explosive"]; - GVAR(FragMagazines) = []; - GVAR(NonFragMagazines) = []; - GVAR(AllMagazines) = []; +{ + _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); - GVAR(GrenadesAll) = []; - GVAR(GrenadesFrag) = [];// - GVAR(GrenadesNonFrag) = [];// + GVAR(GrenadesAll) append _magazines; - { - _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); - _magazine = _magazines select 0; + { + _ammo = getText (configfile >> "CfgMagazines" >> _x >> "ammo"); + _explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive"); - _ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo"); - _explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive"); - - if (_explosive == 0) then { - GVAR(NonFragMuzzles) pushBack _x; - GVAR(NonFragMagazines) pushBack _magazines; - GVAR(GrenadesNonFrag) append _magazines;// - } else { - GVAR(FragMuzzles) pushBack _x; - GVAR(FragMagazines) pushBack _magazines; - GVAR(GrenadesFrag) append _magazines;// - }; - - GVAR(AllMuzzles) pushBack _x; - GVAR(AllMagazines) pushBack _magazines; - GVAR(GrenadesAll) append _magazines;// - - } forEach getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); - }; -}; - -GVAR(FragMuzzles) = uiNamespace getVariable QGVAR(FragMuzzles); -GVAR(NonFragMuzzles) = uiNamespace getVariable QGVAR(NonFragMuzzles); -GVAR(AllMuzzles) = uiNamespace getVariable QGVAR(AllMuzzles); -GVAR(FragMagazines) = uiNamespace getVariable QGVAR(FragMagazines); -GVAR(NonFragMagazines) = uiNamespace getVariable QGVAR(NonFragMagazines); -GVAR(AllMagazines) = uiNamespace getVariable QGVAR(AllMagazines); -GVAR(GrenadesAll) = uiNamespace getVariable QGVAR(GrenadesAll);// -GVAR(GrenadesFrag) = uiNamespace getVariable QGVAR(GrenadesFrag);// -GVAR(GrenadesNonFrag) = uiNamespace getVariable QGVAR(GrenadesNonFrag);// + ([GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select (_explosive == 0)) pushBack _x; + false + } count _magazines; + false +} count getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); ADDON = true; diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf deleted file mode 100644 index 572a83edf1..0000000000 --- a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: esteldunedain - * Count how many grenade magazines the unit has on the uniform and vest. - * - * Arguments: - * 0: Unit - * 1: Muzzle Class - * - * Return Value: - * 0: Number of magazines - * 1: First magazine name - * - * Example: - * [player, currentMuzzle player] call ace_weaponselect_fnc_countMagazinesForGrenadeMuzzle - * - * Public: No - */ -#include "script_component.hpp" - -private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; - -params ["_unit", "_muzzle"]; - -_uniformMags = getMagazineCargo uniformContainer _unit; -_vestMags = getMagazineCargo vestContainer _unit; -_backpackMags = getMagazineCargo backpackContainer _unit; - -_numberOfMagazines = 0; -_magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines"); -_firstMagazine = _magazineClasses select 0; - -{ - private ["_indexInUniform", "_indexInVest", "_indexInBackpack"]; - - _indexInUniform = (_uniformMags select 0) find _x; - if (_indexInUniform > -1) then { - _numberOfMagazines = _numberOfMagazines + ((_uniformMags select 1) select _indexInUniform); - _firstMagazine = _x; - }; - - _indexInVest = (_vestMags select 0) find _x; - if (_indexInVest > -1) then { - _numberOfMagazines = _numberOfMagazines + ((_vestMags select 1) select _indexInVest); - _firstMagazine = _x; - }; - - _indexInBackpack = (_backpackMags select 0) find _x; - if (_indexInBackpack > -1) then { - _numberOfMagazines = _numberOfMagazines + ((_backpackMags select 1) select _indexInBackpack); - _firstMagazine = _x; - }; - -} forEach _magazineClasses; - -[_numberOfMagazines, _firstMagazine] diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf deleted file mode 100644 index 2b2370260a..0000000000 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Author: commy2 - * Find the next Grenade Magazine. - * - * Arguments: - * 0: Grenade Type ("All", "Frag", "NonFrag") - * - * Return Value: - * Magazine classname - * - * Example: - * ["All"] call ace_weaponselect_fnc_findNextGrenadeMagazine - * - * Public: No - */ -#include "script_component.hpp" - -private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMagazine"]; - -params ["_type"]; - -_allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; -_allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; - -_magazines = magazines ACE_player; - -_start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); -_index = _allMuzzles find _start; - -scopeName "SearchMain"; - -_nextMagazine = ""; -for "_index" from (_index + 1) to (count _allMuzzles - 1) do { - { - if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"}; - } count _magazines; -}; - -if (_nextMagazine != "") exitWith {_nextMagazine}; - -for "_index" from 0 to _index do { - { - if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"}; - } count _magazines; -}; - -_nextMagazine diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf deleted file mode 100644 index 5aa096f44e..0000000000 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Author: commy2 - * Find the next Grenade Muzzle. - * - * Arguments: - * 0: Grenade Type ("All", "Frag", "NonFrag") - * - * Return Value: - * Class name of next throw muzzle - * - * Example: - * ["All"] call ace_weaponselect_fnc_findNextGrenadeMuzzle - * - * Public: No - */ -#include "script_component.hpp" - -private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMuzzle"]; - -params ["_type"]; - -_allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; -_allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; - -_magazines = magazines ACE_player; - -_start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); -_index = _allMuzzles find _start; - -scopeName "SearchMain"; - -_nextMuzzle = ""; -for "_index" from (_index + 1) to (count _allMuzzles - 1) do { - { - if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"}; - } count _magazines; -}; - -if (_nextMuzzle != "") exitWith {_nextMuzzle}; - -for "_index" from 0 to _index do { - { - if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"}; - } count _magazines; -}; - -_nextMuzzle diff --git a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf deleted file mode 100644 index aa89a13c98..0000000000 --- a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Author: commy2 - * Returns the selected Grenade Muzzle. - * - * Arguments: - * None - * - * Return Value: - * Class name of selected throw muzzle - * - * Example: - * [] call ace_weaponselect_fnc_getSelectedGrenade - * - * Public: No - */ -#include "script_component.hpp" - -[GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag) diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf deleted file mode 100644 index a68670184a..0000000000 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Author: esteldunedain, commy2 - * Cycle through all grenades. - * - * Arguments: - * 0: Unit - * - * Return Value: - * None - * - * Example: - * [player] call ace_weaponselect_fnc_selectGrenadeAll - * - * Public: No - */ -#include "script_component.hpp" - -private ["_text", "_nextMuzzle"]; - -params ["_unit"]; - -_nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); - -if (_nextMuzzle != "") then { - - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); - reverse _magazines; - - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); - -} else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; - - if (GVAR(DisplayText)) then { - _text = [localize LSTRING(NoGrenadesLeft), [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; -}; - -if (_nextMuzzle in GVAR(FragMuzzles)) then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = true; -} else { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = false; -}; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf deleted file mode 100644 index c221b6cc30..0000000000 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Author: esteldunedain, commy2 - * Cycle through frags. - * - * Arguments: - * 0: Unit - * - * Return Value: - * None - * - * Example: - * [player] call ace_weaponselect_fnc_selectGrenadeFrag - * - * Public: No - */ -#include "script_component.hpp" - -private ["_text", "_nextMuzzle"]; - -params ["_unit"]; - -_nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); - -if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); - reverse _magazines; - - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); - -} else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; - if (GVAR(DisplayText)) then { - _text = [localize LSTRING(NoFragsLeft), [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; -}; - -GVAR(CurrentGrenadeMuzzleIsFrag) = true; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf deleted file mode 100644 index 2f219989eb..0000000000 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Author: esteldunedain, commy2 - * Cycle through non explosive grenades. - * - * Arguments: - * 0: Unit - * - * Return Value: - * None - * - * Example: - * [player] call ace_weaponselect_fnc_selectGrenadeOther - * - * Public: No - */ -#include "script_component.hpp" - -private ["_nextMuzzle", "_text"]; - -params ["_unit"]; - -_nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); - -if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); - reverse _magazines; - - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); - -} else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleOther) = ""; - if (GVAR(DisplayText)) then { - _text = [localize LSTRING(NoMiscGrenadeLeft), [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; -}; - -GVAR(CurrentGrenadeMuzzleIsFrag) = false; diff --git a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf index 0c0d834a3d..d4a00b5718 100644 --- a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf +++ b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf @@ -73,4 +73,6 @@ _backpackGrenades = [backpackItems _unit, {_x in GVAR(GrenadesAll) && {_x != _ne {_unit addItemToVest _x; false} count _vestGrenades; {_unit addItemToBackpack _x; false} count _backpackGrenades; +[_nextGrenade, {_x == _nextGrenade} count _magazines] call FUNC(displayGrenadeTypeAndNumber); + true diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf deleted file mode 100644 index ce7ec55393..0000000000 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Author: esteldunedain - * Select the next grenade muzzle to throw. - * - * Arguments: - * 0: Unit - * 1: Muzzlename - * - * Return Value: - * None - * - * Example: - * [player, currentMuzzle player] call ace_weaponselect_fnc_setNextGrenadeMuzzle - * - * Public: No - */ -#include "script_component.hpp" - -private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; - -params ["_unit", "_muzzle"]; - -_uniformMags = getMagazineCargo uniformContainer _unit; -_vestMags = getMagazineCargo vestContainer _unit; -_backpackMags = getMagazineCargo backpackContainer _unit; - -_uniformMagsToRemove = []; -_vestMagsToRemove = []; -_backpackMagsToRemove = []; - -_firstMagazine = ""; -_throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); - -// Collect which magazines to remove -{ - private "_muzzleMagazines"; - _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines" ); - - if (_x != _muzzle) then { - - { - private "_index"; - _index = (_uniformMags select 0) find _x; - if (_index > -1) then { - _uniformMagsToRemove = _uniformMagsToRemove + [[_x, (_uniformMags select 1) select _index]]; - }; - - _index = (_vestMags select 0) find _x; - if (_index > -1) then { - _vestMagsToRemove = _vestMagsToRemove + [[_x, (_vestMags select 1) select _index]]; - }; - - _index = (_backpackMags select 0) find _x; - if (_index > -1) then { - _backpackMagsToRemove = _backpackMagsToRemove + [[_x, (_backpackMags select 1) select _index]]; - }; - } forEach _muzzleMagazines; - - } else { - - { - private "_index"; - _index = (_uniformMags select 0) find _x; - if (_index > -1) then { - _firstMagazine = _x; - }; - - _index = (_vestMags select 0) find _x; - if (_index > -1) then { - _firstMagazine = _x; - }; - - _index = (_backpackMags select 0) find _x; - if (_index > -1) then { - _firstMagazine = _x; - }; - } forEach _muzzleMagazines; - - }; -} forEach _throwMuzzleNames; - -// Remove all magazines except those we are switching to --> this breaks the selector -{ - for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { - _unit removeItem (_x select 0); - }; -} forEach _uniformMagsToRemove; - -{ - for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { - _unit removeItem (_x select 0); - }; -} forEach _vestMagsToRemove; - -{ - for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { - _unit removeItem (_x select 0); - }; -} forEach _backpackMagsToRemove; - -// Readd magazines -{ - for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { - _unit addItemToUniform (_x select 0); - }; -} forEach _uniformMagsToRemove; - -{ - for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { - _unit addItemToVest (_x select 0); - }; -} forEach _vestMagsToRemove; - -{ - for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { - _unit addItemToBackpack (_x select 0); - }; -} forEach _backpackMagsToRemove; From 4b536425b19d496a8873faf632cda0ac3b86fa20 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 14:35:05 +0200 Subject: [PATCH 220/311] Code Cleanup Interaction --- addons/common/XEH_postInit.sqf | 2 + addons/interaction/ACE_Settings.hpp | 1 + addons/interaction/ACE_ZeusActions.hpp | 11 ++- addons/interaction/CfgEventHandlers.hpp | 3 +- addons/interaction/CfgVehicles.hpp | 94 +++++++++++-------- .../{Menu_Config.hpp => RscTitles.hpp} | 10 +- addons/interaction/XEH_postInit.sqf | 43 +++------ addons/interaction/config.cpp | 2 +- .../functions/fnc_addPassengerActions.sqf | 18 ++-- .../functions/fnc_addPassengersActions.sqf | 52 +++++----- .../functions/fnc_doBecomeLeader.sqf | 6 +- addons/interaction/functions/fnc_push.sqf | 14 +-- 12 files changed, 137 insertions(+), 119 deletions(-) rename addons/interaction/{Menu_Config.hpp => RscTitles.hpp} (98%) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e374a7a716..72c5b9fa7a 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -83,6 +83,8 @@ ["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler); ["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); ["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); +["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler); +["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler); if (isServer) then { ["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler); diff --git a/addons/interaction/ACE_Settings.hpp b/addons/interaction/ACE_Settings.hpp index 6c97109a37..075c1f056d 100644 --- a/addons/interaction/ACE_Settings.hpp +++ b/addons/interaction/ACE_Settings.hpp @@ -1,3 +1,4 @@ + class ACE_Settings { class GVAR(EnableTeamManagement) { value = 1; diff --git a/addons/interaction/ACE_ZeusActions.hpp b/addons/interaction/ACE_ZeusActions.hpp index 50f203a092..5a7ea9d631 100644 --- a/addons/interaction/ACE_ZeusActions.hpp +++ b/addons/interaction/ACE_ZeusActions.hpp @@ -1,6 +1,5 @@ + class ACE_ZeusActions { - // _target = curatorLogic - // curatorSelected = [objects,groups,waypoints,markers] class ZeusUnits { displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa"; @@ -29,12 +28,14 @@ class ACE_ZeusActions { statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);"; }; }; + class remoteControl { displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa"; statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];"; }; }; + class ZeusGroups { displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa"; @@ -67,6 +68,7 @@ class ACE_ZeusActions { statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);"; }; }; + class speed { displayName = "$STR_HC_Menu_Speed"; @@ -86,6 +88,7 @@ class ACE_ZeusActions { statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);"; }; }; + class formation { displayName = "$STR_Formation"; @@ -136,6 +139,7 @@ class ACE_ZeusActions { }; }; }; + class ZeusWaypoints { displayName = "Waypoints"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa"; @@ -168,6 +172,7 @@ class ACE_ZeusActions { statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);"; }; }; + class speed { displayName = "$STR_HC_Menu_Speed"; @@ -187,6 +192,7 @@ class ACE_ZeusActions { statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);"; }; }; + class formation { displayName = "$STR_Formation"; @@ -237,6 +243,7 @@ class ACE_ZeusActions { }; }; }; + class ZeusMarkers { displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa"; diff --git a/addons/interaction/CfgEventHandlers.hpp b/addons/interaction/CfgEventHandlers.hpp index 7b003bbe8c..0cd959a047 100644 --- a/addons/interaction/CfgEventHandlers.hpp +++ b/addons/interaction/CfgEventHandlers.hpp @@ -1,6 +1,7 @@ + class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index abfdb976ab..9372d3410c 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -1,25 +1,28 @@ + class CfgVehicles { - class ACE_Module; - class ACE_ModuleInteraction: ACE_Module { - author = ECSTRING(common,ACETeam); - category = "ACE"; - displayName = CSTRING(Module_DisplayName); - function = "ACE_Interaction_fnc_moduleInteraction"; - scope = 2; - isGlobal = 1; - icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); - class Arguments { - class EnableTeamManagement { - displayName = CSTRING(EnableTeamManagement_DisplayName); - description = CSTRING(EnableTeamManagement_Description); - typeName = "BOOL"; - defaultValue = 1; - }; + class ACE_Module; + class ACE_ModuleInteraction: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(Module_DisplayName); + function = "ACE_Interaction_fnc_moduleInteraction"; + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); + + class Arguments { + class EnableTeamManagement { + displayName = CSTRING(EnableTeamManagement_DisplayName); + description = CSTRING(EnableTeamManagement_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; - class ModuleDescription { - description = CSTRING(Module_Description); - }; - }; class Man; class CAManBase: Man { @@ -77,7 +80,6 @@ class CfgVehicles { priority = 2.1; hotkey = "Y"; }; - class ACE_UnassignTeam { displayName = CSTRING(LeaveTeam); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); @@ -98,7 +100,6 @@ class CfgVehicles { icon = PATHTOF(UI\team\team_management_ca.paa); hotkey = "J"; }; - class ACE_GetDown { displayName = CSTRING(GetDown); condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); @@ -121,6 +122,7 @@ class CfgVehicles { priority = 2.5; }; }; + class ACE_Torso { displayName = CSTRING(Torso); selection = "spine3"; @@ -170,7 +172,6 @@ class CfgVehicles { condition = ""; statement = ""; }; - class ACE_TapShoulderRight { displayName = CSTRING(TapShoulder); selection = "rightshoulder"; @@ -238,7 +239,6 @@ class CfgVehicles { icon = PATHTOF(UI\team\team_yellow_ca.paa); hotkey = "Y"; }; - class ACE_LeaveTeam { displayName = CSTRING(LeaveTeam); condition = QUOTE(assignedTeam _player != 'MAIN'); @@ -405,6 +405,7 @@ class CfgVehicles { }; }; }; + class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); @@ -414,6 +415,7 @@ class CfgVehicles { }; }; }; + class Tank: LandVehicle { class ACE_Actions { class ACE_MainActions { @@ -429,6 +431,7 @@ class CfgVehicles { }; }; }; + class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); @@ -455,6 +458,7 @@ class CfgVehicles { }; }; }; + class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); @@ -464,6 +468,7 @@ class CfgVehicles { }; }; }; + class Plane: Air { class ACE_Actions { class ACE_MainActions { @@ -479,6 +484,7 @@ class CfgVehicles { }; }; }; + class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); @@ -501,7 +507,7 @@ class CfgVehicles { class ACE_Push { displayName = CSTRING(Push); distance = 6; - condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3}); + condition = QUOTE(getMass _target <= 2600 && {alive _target} && {vectorMagnitude velocity _target < 3}); statement = QUOTE(_this call FUNC(push)); showDisabled = 0; priority = -1; @@ -514,6 +520,7 @@ class CfgVehicles { }; }; }; + class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); @@ -539,6 +546,7 @@ class CfgVehicles { }; }; }; + class ACE_SelfActions { class ACE_Passengers { displayName = CSTRING(Passengers); @@ -551,26 +559,29 @@ class CfgVehicles { class StaticMGWeapon: StaticWeapon {}; class HMG_01_base_F: StaticMGWeapon {}; + class HMG_01_high_base_F: HMG_01_base_F { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - position = "[-0.172852,0.164063,-0.476091]"; - }; - }; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[-0.172852,0.164063,-0.476091]"; + }; + }; }; + class AA_01_base_F: StaticMGWeapon { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - position = "[0,0.515869,-0.200671]"; - }; - }; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0,0.515869,-0.200671]"; + }; + }; }; + class AT_01_base_F: StaticMGWeapon { - class ACE_Actions: ACE_Actions { - class ACE_MainActions: ACE_MainActions { - position = "[0,0.515869,-0.200671]"; - }; - }; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0,0.515869,-0.200671]"; + }; + }; }; class thingX; @@ -581,6 +592,7 @@ class CfgVehicles { selection = ""; distance = 2; condition = "true"; + class ACE_OpenBox { displayName = CSTRING(OpenBox); condition = QUOTE(alive _target); @@ -590,6 +602,7 @@ class CfgVehicles { }; }; }; + class ACE_SelfActions {}; }; @@ -602,6 +615,7 @@ class CfgVehicles { condition = "true"; }; }; + class ACE_SelfActions {}; }; }; diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/RscTitles.hpp similarity index 98% rename from addons/interaction/Menu_Config.hpp rename to addons/interaction/RscTitles.hpp index 8359ee560a..7e1b07432f 100644 --- a/addons/interaction/Menu_Config.hpp +++ b/addons/interaction/RscTitles.hpp @@ -1,3 +1,4 @@ + #define HSPACE 0.5-2.0/16/2 #define VSPACE 0.5-0.3/9/2 @@ -44,13 +45,15 @@ class ACE_Interaction_Button_Base { class RscListbox; class IGUIBack; class RscText; + #define X_OFFSET 0.2 class RscACE_SelectAnItem { idd = 8854; movingEnable = 0; + class controls { - class back:IGUIBack { + class back: IGUIBack { x = X_OFFSET; y = 0; w = 0.6; @@ -66,7 +69,7 @@ class RscACE_SelectAnItem { style = 0x02; text = ""; }; - class itemList:RscListBox { + class itemList: RscListBox { onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; idc = 8866; x = X_OFFSET + 0.005; @@ -139,18 +142,21 @@ class RscInteractionIcon: RscPicture { w = 2*GUI_GRID_H; h = 2*GUI_GRID_H; }; + class RscInteractionHelperIcon: RscInteractionIcon { x = 20 * GUI_GRID_W; y = 16 * GUI_GRID_H; w = GUI_GRID_H; h = GUI_GRID_H; }; + class RscInteractionText: RscText{ x = 21 * GUI_GRID_W; y = 16 * GUI_GRID_H; w = 8 * GUI_GRID_W; h = 1.5 * GUI_GRID_H; }; + class RscTitles { class GVAR(InteractionHelper) { idd = 9930; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 8d97803b1d..7b264db3c9 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -1,37 +1,22 @@ // by commy2 and esteldunedain - #include "script_component.hpp" ACE_Modifier = 0; -//SelectLeader Event Handler for BecomeLeader action: -[QGVAR(selectLeader), { - PARAMS_2(_group,_leader); - _group selectLeader _leader; -}] call EFUNC(common,addEventHandler); - -//Pushing boats from FUNC(push) -[QGVAR(pushBoat), { - params ["_boat", "_newVelocity"]; - _boat setVelocity _newVelocity; -}] call EFUNC(common,addEventHandler); - - if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; // restore global fire teams for JIP -private ["_team"]; +private "_team"; { _team = _x getVariable [QGVAR(assignedFireTeam), ""]; if (_team != "") then {_x assignTeam _team}; -} forEach allUnits; + false +} count allUnits; - -// Add keybinds -["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), -{ +// add keybinds +["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -40,18 +25,16 @@ private ["_team"]; // Statement call EFUNC(interaction,openDoor); true -}, -{ +}, { //Probably don't want any condidtions here, so variable never gets locked down // Statement GVAR(isOpeningDoor) = false; true }, -[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space +[57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space -["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), -{ +["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific @@ -62,10 +45,9 @@ private ["_team"]; true }, {false}, -[20, [true, false, false]], false] call cba_fnc_addKeybind; +[20, [true, false, false]], false] call CBA_fnc_addKeybind; -["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey), -{ +["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey), { // Conditions: canInteract //if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed @@ -73,13 +55,12 @@ private ["_team"]; ACE_Modifier = 1; // Return false so it doesn't block other actions false -}, -{ +}, { //Probably don't want any condidtions here, so variable never gets locked down ACE_Modifier = 0; false; }, -[29, [false, false, false]], false] call cba_fnc_addKeybind; +[29, [false, false, false]], false] call CBA_fnc_addKeybind; ["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); ["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 0afb2fc0fe..9659565c3c 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -14,6 +14,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -#include "Menu_Config.hpp" +#include "RscTitles.hpp" #include "ACE_Settings.hpp" #include "ACE_ZeusActions.hpp" diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index d7e21d4a7b..20de00e315 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -1,13 +1,13 @@ /* * Author: esteldunedain - * Mount unit actions inside passenger submenu + * Mount unit actions inside passenger submenu. * * Arguments: * 0: Vehicle * 1: Player * 3: Parameters * - * Return value: + * Return Value: * Children actions * * Example: @@ -17,8 +17,8 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); -EXPLODE_1_PVT(_parameters,_unit); +params ["", "", "_parameters"]; +_parameters params ["_unit"]; private ["_varName", "_actionTrees", "_actions"]; @@ -26,11 +26,13 @@ _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit]; _actionTrees = missionNamespace getVariable [_varName, []]; _actions = []; -// Mount unit MainActions menu +// Mount unit MainActions menu { - EXPLODE_2_PVT(_x,_actionData,_children); - _actions pushBack [_actionData, _children, _unit]; -} forEach ((_actionTrees select 0) select 1); + _x params ["_actionData", "_children"]; + + _actions pushBack [_actionData, _children, _unit]; + false +} count (_actionTrees select 0 select 1); _actions diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index fe557e7ada..eb96ca729e 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -1,6 +1,6 @@ /* * Author: esteldunedain - * Create one action per passenger + * Create one action per passenger. * * Arguments: * 0: Vehicle @@ -17,39 +17,43 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); +params ["_vehicle", "_player"]; -private ["_actions"]; +private "_actions"; _actions = []; { private ["_unit", "_icon"]; + _unit = _x; - if ((_unit != _player) && {(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"}) then { - _icon = switch _unit do { - case (driver _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa) }; - case (gunner _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa) }; - case (commander _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa) }; - default { "" }; - }; + + if (_unit != _player && {getText (configFile >> "CfgVehicles" >> typeOf _unit >> "simulation") != "UAVPilot"}) then { + _icon = [ + "", + "A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa", + "A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa", + "A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa" + ] select (([driver _vehicle, gunner _vehicle, commander _vehicle] find _unit) + 1); + if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then { _icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa)); }; - _actions pushBack + + _actions pushBack [ [ - [ - str(_unit), - [_unit, true] call EFUNC(common,getName), - _icon, - {}, - {true}, - {_this call FUNC(addPassengerActions);}, - [_unit] - ] call EFUNC(interact_menu,createAction), - [], - _unit - ]; + format ["%1", _unit], + [_unit, true] call EFUNC(common,getName), + _icon, + {}, + {true}, + {_this call FUNC(addPassengerActions)}, + [_unit] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; }; -} forEach crew _vehicle; + false +} count crew _vehicle; _actions diff --git a/addons/interaction/functions/fnc_doBecomeLeader.sqf b/addons/interaction/functions/fnc_doBecomeLeader.sqf index 0fd81cbc96..48ac68059b 100644 --- a/addons/interaction/functions/fnc_doBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_doBecomeLeader.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Target - * 1: Player + * 1: Unit * * Return Value: * None @@ -16,6 +16,6 @@ */ #include "script_component.hpp" -PARAMS_2(_target,_player); +params ["_target", "_unit"]; -[QGVAR(selectLeader), (units group _player), [(group _player), _player]] call EFUNC(common,targetEvent); +["selectLeader", units group _unit, [group _unit, _unit]] call EFUNC(common,targetEvent); diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index 86ad673d9c..9a6c86a18e 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Boat - * 1: Player + * 1: Unit * * Return Value: * None @@ -14,13 +14,13 @@ * * Public: No */ - #include "script_component.hpp" -params ["_boat", "_player"]; +params ["_boat", "_unit"]; -private ["_newVelocity"]; +private "_newVelocity"; +_newVelocity = vectorDir _unit; +_newVelocity set [2, 0.25]; +_newVelocity = _newVelocity vectorMultiply 2; -_newVelocity = [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5]; - -[QGVAR(pushBoat), [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent); +["setVelocity", [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent); From 9189148b3fc4a4d7135d9763931572a6e53f4aa7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 15:37:18 +0200 Subject: [PATCH 221/311] more interaction cleanup --- addons/common/XEH_postInit.sqf | 1 + .../functions/fnc_addSelectableItem.sqf | 13 ++-- .../functions/fnc_applyButtons.sqf | 66 ------------------- .../functions/fnc_canBecomeLeader.sqf | 11 ++-- .../functions/fnc_canInteractWithCivilian.sqf | 15 ++--- .../functions/fnc_canJoinGroup.sqf | 10 +-- .../functions/fnc_doBecomeLeader.sqf | 9 ++- addons/interaction/functions/fnc_joinTeam.sqf | 26 ++++---- 8 files changed, 43 insertions(+), 108 deletions(-) delete mode 100644 addons/interaction/functions/fnc_applyButtons.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 72c5b9fa7a..b4cece2410 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -84,6 +84,7 @@ ["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); ["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); ["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler); +["assignTeam", {(_this select 0) assignTeam (_this select 1)}] call FUNC(addEventHandler); ["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler); if (isServer) then { diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf index 74a0e9caea..3a0607dc88 100644 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -1,6 +1,6 @@ /* * Author: Garth de Wet (LH) - * Adds an item to the select menu + * Adds an item to the select menu. * * Arguments: * 0: List container @@ -8,8 +8,8 @@ * 2: Picture * 3: Data * - * Return value: - * Container + * Return Value: + * Container * * Example: * [actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem @@ -18,14 +18,15 @@ */ #include "script_component.hpp" -PARAMS_4(_container,_displayName,_picture,_data); +params ["_container", "_displayName", "_picture", "_data"]; -if (_picture == "" || _picture == "PictureThing") then { +if (toLower _picture in ["", "picturething"]) then { _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); }; -private ["_index"]; +private "_index"; _index = lbAdd [_container, _displayName]; + lbSetData [_container, _index, str _data]; lbSetPicture [_container, _index, _picture]; diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf deleted file mode 100644 index 8aa57d5923..0000000000 --- a/addons/interaction/functions/fnc_applyButtons.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Author: commy2 - * Applies buttons - * - * Arguments: - * None - * - * Return value: - * None - * - * Example: - * call ace_interaction_fnc_applyButtons - * - * Public: No - */ -#include "script_component.hpp" - -private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon", "_a", "_action", "_count"]; - -_object = GVAR(Target); -_actions = GVAR(Buttons); - - -disableSerialization; -_dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog); - -/* -for "_a" from 0 to (_count - 1) do { - _action = GVAR(Buttons) select _a; - - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); - _ctrlInteractionDialog ctrlShow true; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); -}; -*/ - -_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; - -GVAR(MainButton) = "(findDisplay 1713999) closeDisplay 1;"; - -if (_object isKindOf "Man") then { - _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]}); -} else { - _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); -}; - -for "_index" from 0 to 9 do { - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); - _ctrlInteractionDialog ctrlShow true; - - _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); - - if (_index < _count) then { - _action = GVAR(Buttons) select _index; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); - - _ctrlInteractionDialogIcon ctrlSetText (_action select 5); - } else { - _ctrlInteractionDialog ctrlSetText ""; - _ctrlInteractionDialog ctrlEnable false; - - _ctrlInteractionDialogIcon ctrlSetText ""; - }; -}; diff --git a/addons/interaction/functions/fnc_canBecomeLeader.sqf b/addons/interaction/functions/fnc_canBecomeLeader.sqf index 1821e41506..3978306fec 100644 --- a/addons/interaction/functions/fnc_canBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_canBecomeLeader.sqf @@ -1,21 +1,20 @@ /* * Author: PabstMirror - * Test if can Become Leader of group + * Test if can Become Leader of group. * * Arguments: - * 0: Target - * 1: Player + * 1: Unit * * Return Value: * Able to become leader of group * * Example: - * [player, player] call ace_interaction_fnc_canBecomeLeader + * [player] call ace_interaction_fnc_canBecomeLeader * * Public: No */ #include "script_component.hpp" -PARAMS_2(_target,_player); +params ["_unit"]; -(count (units group _player) > 1) && {leader group _player != _player} +count units group _unit > 1 && {leader group _unit != _unit} diff --git a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf index c20ac61f94..233adb37c7 100644 --- a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf +++ b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf @@ -1,11 +1,12 @@ /* * Author: commy2 - * Checks if the player can interact with civilian + * Checks if the unit can interact with civilian * * Arguments: - * 0: Target + * 0: Unit + * 1: Target has to be on the civilian side (default: true) * - * Return value: + * Return Value: * Able to interact with civilian * * Example: @@ -15,10 +16,6 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_isCivilian); +params ["_unit", ["_isCivilian", true]]; -if (isNil "_isCivilian") then {_isCivilian = true}; - -alive _unit -&& [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian -//&& {count (weapons _unit) == 0} +alive _unit && [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian // return diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf index 315da658db..6a3220181d 100644 --- a/addons/interaction/functions/fnc_canJoinGroup.sqf +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -1,12 +1,12 @@ /* * Author: commy2 - * Checks if the player can join a group + * Checks if the unit can join a group * * Arguments: - * 0: Player + * 0: Unit * 1: Target * - * Return value: + * Return Value: * Able to join a group * * Example: @@ -16,9 +16,9 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} && {side group _unit == side group _target} -&& {group _unit != group _target} +&& {group _unit != group _target} // return diff --git a/addons/interaction/functions/fnc_doBecomeLeader.sqf b/addons/interaction/functions/fnc_doBecomeLeader.sqf index 48ac68059b..b2a423e0c0 100644 --- a/addons/interaction/functions/fnc_doBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_doBecomeLeader.sqf @@ -1,21 +1,20 @@ /* * Author: PabstMirror - * Become Leader of group + * Become Leader of group. * * Arguments: - * 0: Target - * 1: Unit + * 0: Unit * * Return Value: * None * * Example: - * [player, player] call ace_interaction_fnc_doBecomeLeader + * [player] call ace_interaction_fnc_doBecomeLeader * * Public: No */ #include "script_component.hpp" -params ["_target", "_unit"]; +params ["_unit"]; ["selectLeader", units group _unit, [group _unit, _unit]] call EFUNC(common,targetEvent); diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index c2a542d4af..9ee82353f7 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -1,35 +1,39 @@ /* * Author: commy2 - * Assigns a unit to the team + * Unit joins a fire team. * * Arguments: * 0: Unit * 1: Team * - * Return value: + * Return Value: * None * * Example: - * [target, "YELLOW"] call ace_interaction_fnc_joinTeam + * [player, "YELLOW"] call ace_interaction_fnc_joinTeam * * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_team); +params ["_unit", "_team"]; -private ["_message"]; +// make sure correct team is set on JIP +_unit setVariable [QGVAR(assignedFireTeam), _team, true]; // @todo reset variable for Respawn+JIP - bug -_unit setVariable [QGVAR(assignedFireTeam), _team, true]; -[_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); +// join fire team on every machine in that group +["assignTeam", units group _unit, [_unit, _team]] call EFUNC(common,targetEvent); +// display message if (_unit == ACE_player) then { - _message = if (_team == "MAIN") then { - localize LSTRING(LeftTeam); + private "_message"; + + if (_team == "MAIN") then { + _message = localize LSTRING(LeftTeam); } else { _team = localize format [LSTRING(Team%1), _team]; - format [localize LSTRING(JoinedTeam), _team]; + _message = format [localize LSTRING(JoinedTeam), _team]; }; - [_message] call EFUNC(common,displayTextStructured); + ["displayTextStructured", _message] call EFUNC(common,localEvent); }; From e4d8f13c89ad4011be7b054252f49ebf694153bc Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 28 Sep 2015 16:02:18 +0200 Subject: [PATCH 222/311] Change may to must in slideshow error log --- addons/slideshow/functions/fnc_createSlideshow.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index b480e4ac01..792905db0f 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -30,10 +30,10 @@ params [ // Verify data if (_objects isEqualTo []) exitWith { - ACE_LOGERROR("Slideshow Objects field may NOT be empty!"); + ACE_LOGERROR("Slideshow Objects field must NOT be empty!"); }; if (count _images != count _names || {_images isEqualTo []} || {_names isEqualTo []}) exitWith { - ACE_LOGERROR("Slideshow Images or Names fields may NOT be empty and must have equal number of items!"); + ACE_LOGERROR("Slideshow Images or Names fields must NOT be empty and must have equal number of items!"); }; // If no controllers use objects as controllers From 4521df0a575776a59b0b9db77ce0acc753fdc4cf Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 28 Sep 2015 16:17:12 +0200 Subject: [PATCH 223/311] Add synchronizedObjects vehicle support to assignObjectsInList with an optional parameter --- addons/common/functions/fnc_assignObjectsInList.sqf | 12 +++++++++--- .../functions/fnc_moduleAssignMedicalVehicle.sqf | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf index eddd792500..a09447a43a 100644 --- a/addons/common/functions/fnc_assignObjectsInList.sqf +++ b/addons/common/functions/fnc_assignObjectsInList.sqf @@ -8,6 +8,7 @@ * 1: Variable Name * 2: Value * 3: Global + * 4: Vehicle (default: false) * * Return Value: * None @@ -19,7 +20,7 @@ */ #include "script_component.hpp" -params ["_list", "_variable", "_setting", "_global"]; +params ["_list", "_variable", "_setting", "_global", ["_vehicle", false]]; if (typeName _list == "STRING") then { _list = [_list, true, true] call FUNC(parseList); @@ -30,8 +31,13 @@ if (typeName _list == "STRING") then { if (!isNil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setVariable [_variable, _setting, _global]; - TRACE_4("Set variable",_x,_variable,_setting,_global); + if (_vehicle) then { + (vehicle _x) setVariable [_variable, _setting, _global]; + TRACE_6("Set variable vehicle",_x,vehicle _x,typeOf (vehicle _x),_variable,_setting,_global); + } else { + _x setVariable [_variable, _setting, _global]; + TRACE_5("Set variable",_x,typeOf _x,_variable,_setting,_global); + }; }; }; }; diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 9cbb698c82..2bc6d3a332 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -22,5 +22,5 @@ if (!isNull _logic) then { _setting = _logic getVariable ["enabled", 0]; [_list, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); - [synchronizedObjects _logic, QGVAR(medicClass), _setting, true] call EFUNC(common,assignObjectsInList); + [synchronizedObjects _logic, QGVAR(medicClass), _setting, true, true] call EFUNC(common,assignObjectsInList); }; From f48636e63395a8cfa0150446ec522016b4554429 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 17:11:53 +0200 Subject: [PATCH 224/311] more interaction cleanup, remove dead code --- addons/interaction/CfgVehicles.hpp | 2 +- addons/interaction/XEH_postInit.sqf | 26 +++++++ addons/interaction/XEH_preInit.sqf | 50 +++++++------- .../functions/fnc_addSelectableItem.sqf | 33 --------- .../functions/fnc_canTapShoulder.sqf | 6 +- addons/interaction/functions/fnc_getDoor.sqf | 10 +-- .../functions/fnc_getDoorAnimations.sqf | 6 +- addons/interaction/functions/fnc_getDown.sqf | 32 ++++----- .../functions/fnc_getSelectedButton.sqf | 38 ----------- addons/interaction/functions/fnc_hideMenu.sqf | 22 ------ .../interaction/functions/fnc_isInRange.sqf | 53 --------------- addons/interaction/functions/fnc_moveDown.sqf | 67 ------------------- .../interaction/functions/fnc_onButtonUp.sqf | 44 ------------ addons/interaction/functions/fnc_onClick.sqf | 57 ---------------- .../functions/fnc_onSelectMenuDblClick.sqf | 18 ----- addons/interaction/functions/fnc_openDoor.sqf | 26 +++---- .../functions/fnc_openMenuSelectUI.sqf | 57 ---------------- .../functions/fnc_openSelectMenu.sqf | 49 -------------- .../functions/fnc_prepareSelectMenu.sqf | 33 --------- addons/interaction/functions/fnc_sendAway.sqf | 39 +++++------ .../functions/fnc_sortOptionsByPriority.sqf | 35 ---------- .../interaction/functions/fnc_tapShoulder.sqf | 26 ++----- .../functions/fnc_updateTooltipPosition.sqf | 33 --------- 23 files changed, 115 insertions(+), 647 deletions(-) delete mode 100644 addons/interaction/functions/fnc_addSelectableItem.sqf delete mode 100644 addons/interaction/functions/fnc_getSelectedButton.sqf delete mode 100644 addons/interaction/functions/fnc_hideMenu.sqf delete mode 100644 addons/interaction/functions/fnc_isInRange.sqf delete mode 100644 addons/interaction/functions/fnc_moveDown.sqf delete mode 100644 addons/interaction/functions/fnc_onButtonUp.sqf delete mode 100644 addons/interaction/functions/fnc_onClick.sqf delete mode 100644 addons/interaction/functions/fnc_onSelectMenuDblClick.sqf delete mode 100644 addons/interaction/functions/fnc_openMenuSelectUI.sqf delete mode 100644 addons/interaction/functions/fnc_openSelectMenu.sqf delete mode 100644 addons/interaction/functions/fnc_prepareSelectMenu.sqf delete mode 100644 addons/interaction/functions/fnc_sortOptionsByPriority.sqf delete mode 100644 addons/interaction/functions/fnc_updateTooltipPosition.sqf diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 9372d3410c..e844da9517 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -167,7 +167,7 @@ class CfgVehicles { }; class ACE_Weapon { displayName = CSTRING(Weapon); - position = QUOTE(call FUNC(getWeaponPos)); + position = QUOTE(call DFUNC(getWeaponPos)); distance = 1.50; condition = ""; statement = ""; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 7b264db3c9..aeee004e7d 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -3,8 +3,34 @@ ACE_Modifier = 0; +["getDown", { + params ["_target"]; + + _target setUnitPos "DOWN"; +}] call EFUNC(common,addEventHandler); + +["sendAway", { + params ["_unit", "_position"]; + + _unit setUnitPos "AUTO"; + _unit doMove _position; +}] call EFUNC(common,addEventHandler); + if (!hasInterface) exitWith {}; +["tapShoulder", { + params ["_unit", "_shoulderNum"]; + + if (_unit == ACE_player) then { + addCamShake [4, 0.5, 5]; + }; + + private "_message"; + _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0)); + + ["displayTextStructured", _message] call EFUNC(common,targetEvent); +}] call EFUNC(common,addEventHandler); + GVAR(isOpeningDoor) = false; // restore global fire teams for JIP diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index c2534b44b9..a460fdeadd 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -2,37 +2,35 @@ ADDON = false; -PREP(addPassengerActions); +// interaction menu +PREP(addPassengerActions) PREP(addPassengersActions); -PREP(addSelectableItem); -PREP(applyButtons); -PREP(canBecomeLeader); +PREP(getWeaponPos); +PREP(moduleInteraction); +PREP(removeTag); + +// scroll wheel hint +PREP(showMouseHint); +PREP(hideMouseHint); + +// interaction with units PREP(canInteractWithCivilian); +PREP(getDown); +PREP(sendAway); PREP(canJoinGroup); PREP(canJoinTeam); -PREP(canTapShoulder); -PREP(doBecomeLeader); -PREP(getDoor); -PREP(getDoorAnimations); -PREP(getDown); -PREP(getSelectedButton); -PREP(getWeaponPos); -PREP(hideMenu); -PREP(hideMouseHint); -PREP(isInRange); PREP(joinTeam); -PREP(moduleInteraction); -PREP(moveDown); -PREP(onSelectMenuDblClick); -PREP(openDoor); -PREP(openMenuSelectUI); -PREP(openSelectMenu); -PREP(prepareSelectMenu); -PREP(push); -PREP(removeTag); -PREP(sendAway); -PREP(showMouseHint); -PREP(sortOptionsByPriority); +PREP(canBecomeLeader); +PREP(doBecomeLeader); +PREP(canTapShoulder); PREP(tapShoulder); +// interaction with doors +PREP(getDoor); +PREP(getDoorAnimations); +PREP(openDoor); + +// interaction with boats +PREP(push); + ADDON = true; diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf deleted file mode 100644 index 3a0607dc88..0000000000 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: Garth de Wet (LH) - * Adds an item to the select menu. - * - * Arguments: - * 0: List container - * 1: Display name - * 2: Picture - * 3: Data - * - * Return Value: - * Container - * - * Example: - * [actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem - * - * Public: No - */ -#include "script_component.hpp" - -params ["_container", "_displayName", "_picture", "_data"]; - -if (toLower _picture in ["", "picturething"]) then { - _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); -}; - -private "_index"; -_index = lbAdd [_container, _displayName]; - -lbSetData [_container, _index, str _data]; -lbSetPicture [_container, _index, _picture]; - -_container diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index bbeee51b4a..a2b70e4959 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Checks if the player can tap a shoulder + * Checks if the player can tap a shoulder. * * Arguments: * 0: Player @@ -16,9 +16,9 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; _target isKindOf "CAManBase" && {alive _target} && {_unit distance _target < 4} && -{!(_target getVariable ["ACE_isUnconscious", false])} +{!(_target getVariable ["ACE_isUnconscious", false])} // return diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index a085c9a3b8..6b1134675d 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -1,11 +1,11 @@ /* * Author: commy2 - * Get door + * Find door. * * Arguments: * 0: Distance * - * Return value: + * Return Value: * House objects and door * 0: House * 1: Door Name @@ -17,16 +17,17 @@ */ #include "script_component.hpp" -PARAMS_1(_distance); +params ["_distance"]; private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"]; _position0 = positionCameraToWorld [0, 0, 0]; _position1 = positionCameraToWorld [0, 0, _distance]; -_intersections = lineIntersectsWith [ATLToASL _position0, ATLToASL _position1, objNull, objNull, true]; +_intersections = lineIntersectsWith [AGLToASL _position0, AGLToASL _position1, objNull, objNull, true]; // @todo LIS _count = count _intersections; + if (_count == 0) exitWith {[objNull, ""]}; _house = _intersections select (_count - 1); @@ -37,6 +38,7 @@ if (typeOf _house == "") exitWith {[objNull, ""]}; _intersections = [_house, "GEOM"] intersect [_position0, _position1]; _door = _intersections select 0 select 0; + if (isNil "_door") exitWith {[_house, ""]}; [_house, _door] diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index 0de74e61ed..fac29c74a8 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -1,12 +1,12 @@ /* * Author: commy2 - * Get door animations + * Get door animations. @todo rewrite for better custom building support * * Arguments: * 0: House * 1: Door * - * Return value: + * Return Value: * Animation and Locked variable * 0: Animation * 1: Locked variable @@ -18,7 +18,7 @@ */ #include "script_component.hpp" -PARAMS_2(_house,_door); +params ["_house", "_door"]; private ["_index", "_animations", "_lockedVariable"]; diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index 09d651eadf..b380fe9c39 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -1,6 +1,6 @@ /* - * Author: KoffeinFlummi - * Forces a civilian to the ground (with a chance of failure) + * Author: KoffeinFlummi, commy2 + * Forces a civilian to the ground with a chance of failure. * * Arguments: * 0: Unit @@ -9,30 +9,24 @@ * None * * Example: - * [target] call ace_interaction_fnc_getDown + * [civillian] call ace_interaction_fnc_getDown * * Public: No */ #include "script_component.hpp" -#define RADIUS 10 +#define SEND_RADIUS 10 -PARAMS_1(_unit); +params ["_unit"]; -private ["_chance", "_x"]; +_unit playActionNow "GestureGo"; -ACE_player playActionNow "GestureGo"; // put something else here. - -if (count (weapons ACE_player) > 0) then { - _chance = 0.8; -} else { - _chance = 0.5; -}; +private "_chance"; +_chance = [0.5, 0.8] select (count weapons _unit > 0); { - if (count (weapons _unit) == 0 and random 1 < _chance) then { - [-2, { - _this setUnitPos "DOWN"; - }, _x] call CBA_fnc_globalExecute; - }; -} forEach (_unit nearEntities ["Civilian", RADIUS]); + if (count weapons _x == 0 && {random 1 < _chance}) then { + ["getDown", [_x], [_x]] call EFUNC(common,targetEvent); + }; + false +} count (_unit nearEntities ["Civilian", SEND_RADIUS]); diff --git a/addons/interaction/functions/fnc_getSelectedButton.sqf b/addons/interaction/functions/fnc_getSelectedButton.sqf deleted file mode 100644 index 92768b67f7..0000000000 --- a/addons/interaction/functions/fnc_getSelectedButton.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: commy2 - * Get selected button - * - * Arguments: - * None - * - * Return value: - * Angle - * - * Example: - * call ace_interaction_fnc_getSelectedButton - * - * Public: No - */ -#include "script_component.hpp" - -#define MIN_DISTANCE 0.0065 - -private ["_position", "_distance", "_angle"]; - -_position = uiNamespace getVariable [QGVAR(CursorPosition), [0.5, 0.5, 0]]; - -_position = [((_position select 1) - 0.5) / safezoneH, ((_position select 2) - 0.5) / safezoneW, 0]; - -_distance = [0, 0, 0] vectorDistanceSqr _position; - -// is in center -if (_distance < MIN_DISTANCE) exitWith {-1}; - -_angle = (_position select 0) atan2 (_position select 1); - -// rotate circle -_angle = 180 - _angle + 360 / 10 / 2; -if (_angle < 0) then {_angle = _angle + 360}; - -_angle = floor (_angle / 360 * 10); -if (_angle == 10) then {0} else {_angle} diff --git a/addons/interaction/functions/fnc_hideMenu.sqf b/addons/interaction/functions/fnc_hideMenu.sqf deleted file mode 100644 index 89dc49be40..0000000000 --- a/addons/interaction/functions/fnc_hideMenu.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: Garth de Wet (LH) - * Closes the Interaction menu - * - * Arguments: - * None - * - * Return value: - * None - * - * Example: - * call ace_interaction_fnc_hideMenu - * - * Public: No - */ -#include "script_component.hpp" - -closeDialog 0; -(findDisplay 1713999) closeDisplay 1; -(uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; -GVAR(MainButton) = nil; -call FUNC(hideMouseHint); diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf deleted file mode 100644 index 49ac391871..0000000000 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: commy2 - * Check if the vehicle is in range of the player. - * - * Arguments: - * 0: Vehicle - * 1: Distance in meters - * - * Return value: - * Vehicle in range of player - * - * Example: - * [target, 5] call ace_interaction_fnc_isInRange - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_2(_vehicle,_distance); - -private ["_player", "_position0", "_position1"]; - -_player = ACE_player; - -if (_vehicle isKindOf "Man") exitWith {_player distance _vehicle < _distance}; - -private ["_position0", "_position1"];//, "_direction"]; - -_position0 = getPosASL _player; -_position1 = getPosASL _vehicle; - -/* -_direction = _position1 vectorDiff _position0; -_direction = _direction vectorMultiply (_distance / (vectorMagnitude _direction)); - -_position0 = eyePos _player; -_position1 = _position0 vectorAdd _direction; - -_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance} -*/ - -_position0 = ATLToASL positionCameraToWorld [0, 0, 0]; -_position0 set [2, (_position0 select 2) - (getTerrainHeightASL _position0 min 0)]; - -_position1 = ATLToASL positionCameraToWorld [0, 0, _distance]; -_position1 set [2, (_position1 select 2) - (getTerrainHeightASL _position1 min 0)]; - -if (_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}) then { - true -} else { - ["Not in Range"] call FUNC(addToTooltip); - false -} diff --git a/addons/interaction/functions/fnc_moveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf deleted file mode 100644 index 235f12fb1f..0000000000 --- a/addons/interaction/functions/fnc_moveDown.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Author: Garth de Wet (LH) - * Scrolls through the list down or up - * - * Arguments: - * 0: Amount - * - * Return value: - * None - * - * Example: - * [2] call ace_interaction_fnc_moveDown - * - * Public: No - */ -#include "script_component.hpp" - -private ["_count", "_player", "_vehicle", "_dlgInteractionDialog", "_top", "_i", "", "_ctrl", "_index", "_action", "_color", "_current", "_infoText", "_target"]; - -#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) -if (isNil QGVAR(MainButton)) exitWith{}; -if (isNil QGVAR(Buttons)) exitWith{}; -_count = (count GVAR(Buttons))- 1; -GVAR(SelectedButton) = CLAMP(GVAR(SelectedButton) + _this, 0, _count); - -_target = GVAR(Target); -_player = ACE_player; -_vehicle = vehicle _player; - -disableSerialization; -_dlgInteractionDialog = uiNamespace getVariable QGVAR(Flow_Display); -_top = GVAR(SelectedButton) - 2; -_i = 0; -while {_i <= 4} do { - _index =_i + _top; - _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); - if (_index >= 0 && {_index <= _count}) then { - _action = GVAR(Buttons) select _index; - _ctrl ctrlShow true; - _ctrl ctrlSetText (_action select 5); - _color = [1,1,1,1]; - if !([_target, _player] call (_action select 2)) then { - _color = [0.3,0.3,0.3,0.8]; - }; - if (_i == 0 || _i == 4) then { - _color set [3, 0.5]; - }; - if (_i == 1 || _i == 3) then { - _color set [3, 0.75]; - }; - _ctrl ctrlSetTextColor _color; - }else{ - _ctrl ctrlShow false; - }; - _i = _i + 1; -}; - -_ctrl = _dlgInteractionDialog displayCtrl 1000; -_ctrl ctrlSetText ((GVAR(Buttons) select GVAR(SelectedButton)) select 0); -_ctrl = _dlgInteractionDialog displayCtrl 1100; -_current = (GVAR(Buttons) select GVAR(SelectedButton)); -_infoText = ""; -if !([_target, _player] call (_current select 2)) then { - _infoText = "Unavailable"; -}; -_ctrl ctrlSetText _infoText; -_ctrl ctrlShow (_infoText != ""); diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf deleted file mode 100644 index da1b55b613..0000000000 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Author: commy2 - * On button up - * - * Arguments: - * None - * - * Return value: - * None - * - * Example: - * call ace_interaction_fnc_onButtonUp - * - * Public: No - */ -#include "script_component.hpp" - -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_distance"]; - -_player = ACE_player; -_vehicle = vehicle _player; -_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); - -_count = count GVAR(Buttons); -_index = call FUNC(getSelectedButton); - -_action = if (_index != -1 && {_index < _count}) then { - GVAR(Buttons) select _index -} else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] -}; - -(findDisplay 1713999) closeDisplay 1; -closeDialog 0; - - -_statement = _action select 1; -_condition = _action select 2; -_conditionShow = _action select 7; -_distance = _action select 9; - -if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; -}; diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf deleted file mode 100644 index a240823710..0000000000 --- a/addons/interaction/functions/fnc_onClick.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Author: commy2 - * On click - * - * Arguments: - * Index - * - * Return value: - * None - * - * Example: - * 5 call ace_interaction_fnc_onClick - * - * Public: No - */ -#include "script_component.hpp" -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_distance"]; - -_player = ACE_player; -_vehicle = vehicle _player; -_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); - -_count = count GVAR(Buttons); -_index = _this; - -_action = if (_index != -1 && {_index < _count}) then { - GVAR(Buttons) select _index -} else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] -}; - -_subMenu = _action select 4; - -// back -if (_index == -1) exitWith { - call GVAR(MainButton); -}; - -if (count _subMenu < 2) then { - (findDisplay 1713999) closeDisplay 1; - closeDialog 0; - - _statement = _action select 1; - _condition = _action select 2; - _conditionShow = _action select 7; - _distance = _action select 9; - - if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; - }; -} else { - if (_subMenu select 1 < 1) then { - [_subMenu select 0] call FUNC(openSubMenu); - } else { - [_subMenu select 0] call FUNC(openSubMenuSelf); - }; -}; diff --git a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf deleted file mode 100644 index 18b69ba40d..0000000000 --- a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Author: CorruptedHeart, commy2 - * On select menu double click - * - * Arguments: - * None - * - * Return value: - * None - * - * Example: - * call ace_interaction_fnc_onSelectMenuDblClick - * - * Public: No - */ -#include "script_component.hpp" - -call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 9555502a93..609fa91574 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Opens door + * Open door. * * Arguments: * 0: House @@ -16,38 +16,40 @@ */ #include "script_component.hpp" -private ["_info", "_phase", "_position", "_time", "_usedMouseWheel", "_getDoorAnimations"]; - +private "_info"; _info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor); -EXPLODE_2_PVT(_info,_house,_door); +_info params ["_house", "_door"]; if (isNull _house) exitWith {}; +private "_getDoorAnimations"; _getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations); -EXPLODE_2_PVT(_getDoorAnimations,_animations,_lockedVariable); +_getDoorAnimations params ["_animations", "_lockedVariable"]; -if (count _animations == 0) exitWith {}; +if (_animations isEqualTo []) exitWith {}; if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { _lockedVariable set [0, _house]; - _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; + _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; // note: spawn because thats what the house does too. }; GVAR(isOpeningDoor) = true; -playSound "ACE_Sound_Click"; //@todo replace with smth. more fitting -[_house, _animations] spawn { - private ["_house", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"]; - _house = _this select 0; - _animations = _this select 1; +playSound "ACE_Sound_Click"; // @todo replace with smth. more fitting + +[_house, _animations] spawn { // @todo + params ["_house", "_animations"]; + + private ["_phase", "_position", "_time", "_usedMouseWheel"]; _phase = _house animationPhase (_animations select 0); _position = getPosASL ACE_player; _time = ACE_time + 0.2; _usedMouseWheel = false; + waitUntil { if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { _usedMouseWheel = true; diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf deleted file mode 100644 index 6141e839b8..0000000000 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Author: commy2 - * Opens menu select UI - * - * Arguments: - * 0: Unit - * 1: Vehicle - * - * Return value: - * None - * - * Example: - * [unit, vehicle] call ace_interaction_fnc_openMenuSelectUI - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_2(_unit,_vehicle); - -private ["_cargo", "_actions"]; - -// Allow interaction with all cargo slots and all FFV slots -_cargo = [_vehicle, ["cargo", "ffv"], true] call EFUNC(common,getVehicleCrew); - -// You can only interact if you are in cargo or FFV yourself. exit otherwise -if !(_unit in _cargo) exitWith {}; - -GVAR(InteractionMenu_Crew) = _cargo; - -// Prepare: add header and "OK" button to select menu -_actions = [localize LSTRING(InteractionMenu), localize LSTRING(Interact)] call FUNC(prepareSelectMenu); - -// Prepare: add all cargo units as options to select menu -{ - if (_x != _unit) then { - _actions = [ - _actions, - [_x] call EFUNC(common,getName), - QUOTE(PATHTOF(UI\dot_ca.paa)), - _forEachIndex - ] call FUNC(addSelectableItem); - }; -} forEach _cargo; - -// Open select menu -[ - _actions, - { - call FUNC(hideMenu); - [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); - GVAR(InteractionMenu_Crew) = nil; - }, - { - call FUNC(hideMenu); - } -] call FUNC(openSelectMenu); diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf deleted file mode 100644 index 6e42d3af47..0000000000 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Author: Garth de Wet (LH) - * Opens the select menu UI and sets up the UI - * - * Arguments: - * 0: Items - * 0: Text - * 1: Statement to execute - * 2: Condition before execute - * 3: showDisabled - * 4: Priority - * 5: Icon - * 6: Extra variables passed to the code - * 1: Select Action - * 2: Cancel Action - * - * Return value: - * None - * - * Example: - * [["text", {statement}, {condition}, showDisabled, priority, "icon", [variables]], {selectAction}, {cancelAction}] call ace_interaction_fnc_openSelectMenu - * - * Public: No - */ -#include "script_component.hpp" - -private["_action", "_count", "_customActions", "_i"]; - -if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { - GVAR(SelectAccept) = _this select 1; - GVAR(SelectCancel) = _this select 2; - buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // Cancel - buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // Accept - lbSetCurSel [8866, 0]; -}else{ - PARAMS_1(_customActions); - - private ["_count", "_action"]; - - _count = count _customActions; - if (_count == 0) exitWith {}; - _customActions call FUNC(sortOptionsByPriority); - for "_i" from 0 to _count -1 do { - _action = _customActions select _i; - _action set [1, (_this select 1)]; - }; - GVAR(Buttons) = _customActions; - [(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction); -}; diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf deleted file mode 100644 index f42d95b75b..0000000000 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: Garth de Wet (LH) - * Prepares the select menu for use - * - * Arguments: - * 0: Header Text - * 1: Approve Button Text - * - * Return value: - * Container object - * - * Example: - * array = ["Select Explosive", "Place"] call ace_interaction_fnc_prepareSelectMenu - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_2(_header,_buttonText); - -closeDialog 0; - -if (isNil "_buttonText" or {_buttonText == ""}) then { - _buttonText = localize LSTRING(MakeSelection); -}; - -createDialog "RscACE_SelectAnItem"; -ctrlSetText [8860, _buttonText]; -ctrlSetText [8870, _header]; - -lbClear 8866; - -8866 diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index 0dd106de08..546ab9ba3f 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -1,40 +1,37 @@ /* - * Author: KoffeinFlummi - * Sends a civilian crowd away with a chance of failure + * Author: KoffeinFlummi, commy2 + * Sends a near civilian crowd away with a chance of failure. * * Arguments: * 0: Unit * - * Return value: + * Return Value: * None * * Example: - * [target] call ace_interaction_fnc_sendAway + * [civillian] call ace_interaction_fnc_sendAway * * Public: No */ #include "script_component.hpp" -#define DISTANCE 50 -#define RADIUS 10 +#define SEND_DISTANCE 50 +#define SEND_RADIUS 10 -PARAMS_1(_unit); +params ["_unit"]; -private ["_chance", "_x"]; +_unit playActionNow "GestureGo"; -ACE_player playActionNow "GestureGo"; - -if (count weapons ACE_player > 0) then { - _chance = 0.8; -} else { - _chance = 0.5; -}; +private "_chance"; +_chance = [0.5, 0.8] select (count weapons _unit > 0); { - if (count (weapons _unit) == 0 and random 1 < _chance) then { - [-2, { - (_this select 0) setUnitPos "AUTO"; - (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; - }, [_x, ACE_player]] call CBA_fnc_globalExecute; + if (count weapons _x == 0 && {random 1 < _chance}) then { + private "_position"; + _position = getPosASL _unit vectorAdd (eyeDirection _unit vectorMultiply SEND_DISTANCE); + _position set [2, 0]; + + ["sendAway", [_x], [_x, _position]] call EFUNC(common,targetEvent); }; -} forEach (_unit nearEntities ["Civilian", RADIUS]); + false +} count (_unit nearEntities ["Civilian", SEND_RADIUS]); diff --git a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf deleted file mode 100644 index 05a4f3bad4..0000000000 --- a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: commy2 - * Sort options by priority - * - * Arguments: - * Actions - * - * Return value: - * None - * - * Example: - * customActions call ace_interaction_fnc_sortOptionsByPriority - * - * Public: No - */ -#include "script_component.hpp" - -private ["_actions", "_count", "_index", "_actionN", "_actionM"]; - -_actions = _this; -_count = count _actions; -_index = 0; - -while {_index < _count - 1} do { - _actionN = + _actions select _index; - _actionM = + _actions select (_index + 1); - - if (_actionN select 3 < _actionM select 3) then { - _actions set [_index, _actionM]; - _actions set [_index + 1, _actionN]; - _index = 0; - } else { - _index = _index + 1; - }; -}; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index b8bb591c6d..ad1fbce6b1 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -3,38 +3,26 @@ * Taps a shoulder * * Arguments: - * 0: Player + * 0: Unit * 1: Target - * 2: Shoulder which was tapped + * 2: Shoulder which was tapped [0: left, 1: right] * * Return value: * None * * Example: - * [player, target] call ace_interaction_fnc_tapShoulder + * [player, target, 0] call ace_interaction_fnc_tapShoulder * * Public: No */ #include "script_component.hpp" -PARAMS_3(_tapper,_target,_shoulderNum); +params ["_unit", "_target", "_shoulderNum"]; -if (_target != ACE_player) exitWith { +if (_unit == ACE_player) then { addCamShake [4, 0.5, 5]; - ACE_player playActionNow "PutDown"; - if !(local _target) then { - [[_tapper, _target, _shoulderNum], QUOTE(DFUNC(tapShoulder)), _target] call EFUNC(common,execRemoteFnc); - }; }; -addCamShake [4, 0.5, 5]; +_unit playActionNow "PutDown"; -private ["_message"]; -//localize is converting the escaped <> symbols, so just add them here instead of in the stringtable -if (_shoulderNum == 0) then { - _message = format ["%1 >", (localize LSTRING(YouWereTappedRight))]; -} else { - _message = format ["< %1", (localize LSTRING(YouWereTappedLeft))]; -}; - -[parseText _message] call EFUNC(common,displayTextStructured); +["tapShoulder", [_target], [_target, _shoulderNum]] call EFUNC(common,targetEvent); diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf deleted file mode 100644 index 93acd6d203..0000000000 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: commy2 - * Updates tooltip's position - * - * Arguments: - * 0: Tooltip Display - * 1: X Coordinate - * 2: Y Coordinate - * - * Return value: - * None - * - * Example: - * [player, 0.5, 0.5] call ace_interaction_fnc_updateTooltipPosition - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_3(_tooltip,_coordinateX,_coordinateY); - -private["_ctrl"]; - -disableSerialization; -_ctrl = ctrlParent _tooltip displayCtrl 40; - -_ctrl ctrlSetPosition [ - _coordinateX + 0.01 * safezoneW, - _coordinateY + 0.01 * safezoneH, - 2.0 / 16 * safezoneW, - 0.3 / 9 * safezoneH -]; -_ctrl ctrlCommit 0; From 5c5a65443bf84f94cee5299615469338b92c27f7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 17:20:56 +0200 Subject: [PATCH 225/311] more interaction cleanup --- addons/interaction/CfgVehicles.hpp | 3 ++- addons/interaction/XEH_postInit.sqf | 2 ++ addons/interaction/XEH_preInit.sqf | 2 ++ .../interaction/functions/fnc_canPardon.sqf | 20 +++++++++++++++++++ addons/interaction/functions/fnc_pardon.sqf | 18 +++++++++++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 addons/interaction/functions/fnc_canPardon.sqf create mode 100644 addons/interaction/functions/fnc_pardon.sqf diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index e844da9517..5f79dd16cc 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -117,7 +117,8 @@ class CfgVehicles { class ACE_Pardon { displayName = CSTRING(Pardon); condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); - statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canPardon)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(pardon)); showDisabled = 0; priority = 2.5; }; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index aeee004e7d..7e4cf981aa 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -3,6 +3,8 @@ ACE_Modifier = 0; +["pardon", {(_this select 0) addRating -rating (_this select 0)}] call EFUNC(common,addEventHandler); + ["getDown", { params ["_target"]; diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index a460fdeadd..43d08160b4 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -24,6 +24,8 @@ PREP(canBecomeLeader); PREP(doBecomeLeader); PREP(canTapShoulder); PREP(tapShoulder); +PREP(canPardon); +PREP(pardon); // interaction with doors PREP(getDoor); diff --git a/addons/interaction/functions/fnc_canPardon.sqf b/addons/interaction/functions/fnc_canPardon.sqf new file mode 100644 index 0000000000..a377533018 --- /dev/null +++ b/addons/interaction/functions/fnc_canPardon.sqf @@ -0,0 +1,20 @@ +/* + * Author: commy2 + * Checks if the unit can pardon the target. + * + * Arguments: + * 0: Unit + * 1: Target + * + * Return Value: + * Unit can pardon target + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target"]; + +alive _target +&& {rating _target < -2000} +&& {side group _unit == side group _target} diff --git a/addons/interaction/functions/fnc_pardon.sqf b/addons/interaction/functions/fnc_pardon.sqf new file mode 100644 index 0000000000..00fe2f6d17 --- /dev/null +++ b/addons/interaction/functions/fnc_pardon.sqf @@ -0,0 +1,18 @@ +/* + * Author: commy2 + * Unit pardons target unit. + * + * Arguments: + * 0: Unit + * 1: Target + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["", "_target"]; + +["pardon", [_target], [_target]] call EFUNC(common,targetEvent); From 9bf7b68d76f25a82a75188dee5dd2e63e16b673f Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 17:28:51 +0200 Subject: [PATCH 226/311] fix errors on game start --- addons/interaction/CfgVehicles.hpp | 3 +-- addons/interaction/XEH_preInit.sqf | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 5f79dd16cc..d79f78b4be 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -116,9 +116,8 @@ class CfgVehicles { }; class ACE_Pardon { displayName = CSTRING(Pardon); - condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canPardon)); - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(pardon)); + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(pardon)); showDisabled = 0; priority = 2.5; }; diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index 43d08160b4..3f86227476 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -3,7 +3,7 @@ ADDON = false; // interaction menu -PREP(addPassengerActions) +PREP(addPassengerActions); PREP(addPassengersActions); PREP(getWeaponPos); PREP(moduleInteraction); From 5a3a32f2360f94499700bd3072b8fe14d83ecb89 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 18:06:25 +0200 Subject: [PATCH 227/311] more interaction cleanup --- addons/interaction/CfgEventHandlers.hpp | 8 ++++++++ addons/interaction/CfgVehicles.hpp | 8 ++++---- .../functions/fnc_addPassengersActions.sqf | 2 +- .../functions/fnc_canInteractWithCivilian.sqf | 7 ++++--- addons/interaction/functions/fnc_canTapShoulder.sqf | 2 +- addons/interaction/functions/fnc_getDown.sqf | 7 ++++--- .../interaction/functions/fnc_moduleInteraction.sqf | 11 ++++------- addons/interaction/functions/fnc_openDoor.sqf | 2 +- addons/interaction/functions/fnc_tapShoulder.sqf | 2 +- 9 files changed, 28 insertions(+), 21 deletions(-) diff --git a/addons/interaction/CfgEventHandlers.hpp b/addons/interaction/CfgEventHandlers.hpp index 0cd959a047..60a8fdfcf6 100644 --- a/addons/interaction/CfgEventHandlers.hpp +++ b/addons/interaction/CfgEventHandlers.hpp @@ -10,3 +10,11 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; + +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE((_this select 0) setVariable [ARR_3(QUOTE(QGVAR(assignedFireTeam)),(_this select 0) getVariable [ARR_2(QUOTE(QGVAR(assignedFireTeam)),'MAIN')],true)]); + }; + }; +}; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index d79f78b4be..56fb06a85b 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -102,15 +102,15 @@ class CfgVehicles { }; class ACE_GetDown { displayName = CSTRING(GetDown); - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(getDown)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(getDown)); showDisabled = 0; priority = 2.2; }; class ACE_SendAway { displayName = CSTRING(SendAway); - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(sendAway)); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(sendAway)); showDisabled = 0; priority = 2.0; }; diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index eb96ca729e..7296b34fa2 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -7,7 +7,7 @@ * 1: Player * 3: Parameters * - * Return value: + * Return Value: * Children actions * * Example: diff --git a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf index 233adb37c7..eb8374191b 100644 --- a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf +++ b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf @@ -4,7 +4,8 @@ * * Arguments: * 0: Unit - * 1: Target has to be on the civilian side (default: true) + * 1: Target + * 2: Target has to be on the civilian side (default: true) * * Return Value: * Able to interact with civilian @@ -16,6 +17,6 @@ */ #include "script_component.hpp" -params ["_unit", ["_isCivilian", true]]; +params ["_unit", "_target", ["_isCivilian", true]]; -alive _unit && [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian // return +alive _target && [side _target != side _unit, side group _target == civilian] select _isCivilian // return diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index a2b70e4959..514ac0301b 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -6,7 +6,7 @@ * 0: Player * 1: Target * - * Return value: + * Return Value: * Able to tap a shoulder * * Example: diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index b380fe9c39..2dc9711e2c 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -4,8 +4,9 @@ * * Arguments: * 0: Unit + * 1: Target * - * Return value: + * Return Value: * None * * Example: @@ -17,7 +18,7 @@ #define SEND_RADIUS 10 -params ["_unit"]; +params ["_unit", "_target"]; _unit playActionNow "GestureGo"; @@ -29,4 +30,4 @@ _chance = [0.5, 0.8] select (count weapons _unit > 0); ["getDown", [_x], [_x]] call EFUNC(common,targetEvent); }; false -} count (_unit nearEntities ["Civilian", SEND_RADIUS]); +} count (_target nearEntities ["Civilian", SEND_RADIUS]); diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index 4d6ef3f1c0..425ee9d6e4 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -1,13 +1,13 @@ /* * Author: bux578 - * Initializes the Interaction module + * Initializes the Interaction module. * * Arguments: * 0: Logic - * 1: ??? + * 1: Units * 2: Activation State * - * Return value: + * Return Value: * None * * Example: @@ -17,10 +17,7 @@ */ #include "script_component.hpp" -private ["_logic", "_activated"]; - -_logic = _this select 0; -_activated = _this select 2; +params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 609fa91574..98bc1d5070 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -6,7 +6,7 @@ * 0: House * 1: Door * - * Return value: + * Return Value: * None * * Example: diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index ad1fbce6b1..2061f1806f 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -7,7 +7,7 @@ * 1: Target * 2: Shoulder which was tapped [0: left, 1: right] * - * Return value: + * Return Value: * None * * Example: From 6f64fcd0fbbe35841b7364693c6cfef107e9cab0 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 18:45:10 +0200 Subject: [PATCH 228/311] search for door in geometry lod (lineintersectssurface) --- addons/interaction/functions/fnc_getDoor.sqf | 10 ++++------ addons/interaction/functions/fnc_joinTeam.sqf | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 6b1134675d..8261aa44f0 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -19,18 +19,16 @@ params ["_distance"]; -private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"]; +private ["_position0", "_position1", "_intersections", "_house", "_door"]; _position0 = positionCameraToWorld [0, 0, 0]; _position1 = positionCameraToWorld [0, 0, _distance]; -_intersections = lineIntersectsWith [AGLToASL _position0, AGLToASL _position1, objNull, objNull, true]; // @todo LIS +_intersections = lineIntersectsSurfaces [AGLToASL _position0, AGLToASL _position1, cameraOn, objNull, true, 1, "GEOM"]; -_count = count _intersections; +if (_intersections isEqualTo []) exitWith {[objNull, ""]}; -if (_count == 0) exitWith {[objNull, ""]}; - -_house = _intersections select (_count - 1); +_house = _intersections select 0 select 2; // shithouse is bugged if (typeOf _house == "") exitWith {[objNull, ""]}; diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index 9ee82353f7..9283e7b474 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -19,7 +19,7 @@ params ["_unit", "_team"]; // make sure correct team is set on JIP -_unit setVariable [QGVAR(assignedFireTeam), _team, true]; // @todo reset variable for Respawn+JIP - bug +_unit setVariable [QGVAR(assignedFireTeam), _team, true]; // join fire team on every machine in that group ["assignTeam", units group _unit, [_unit, _team]] call EFUNC(common,targetEvent); From 443cbf8be39dc84fbdc9b74cd721512086cd0c67 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 19:03:37 +0200 Subject: [PATCH 229/311] fix compile error when trying to open a locked door by shortcut --- addons/interaction/functions/fnc_openDoor.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 98bc1d5070..8fff955137 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -32,7 +32,7 @@ if (_animations isEqualTo []) exitWith {}; if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { _lockedVariable set [0, _house]; - _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; // note: spawn because thats what the house does too. + _lockedVariable call BIS_fnc_LockedDoorOpen; }; GVAR(isOpeningDoor) = true; From 6c968d8bc7267474c65db4b3161b5db2235b8f1c Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 20:07:01 +0200 Subject: [PATCH 230/311] per frame handler for incremental door opening --- addons/interaction/XEH_postInit.sqf | 6 ++- addons/interaction/XEH_preInit.sqf | 1 + .../functions/fnc_handleScrollWheel.sqf | 23 +++++++++ addons/interaction/functions/fnc_openDoor.sqf | 48 +++++++++---------- 4 files changed, 51 insertions(+), 27 deletions(-) create mode 100644 addons/interaction/functions/fnc_handleScrollWheel.sqf diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 7e4cf981aa..1eda11f281 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -20,6 +20,10 @@ ACE_Modifier = 0; if (!hasInterface) exitWith {}; +GVAR(isOpeningDoor) = false; + +[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); + ["tapShoulder", { params ["_unit", "_shoulderNum"]; @@ -33,8 +37,6 @@ if (!hasInterface) exitWith {}; ["displayTextStructured", _message] call EFUNC(common,targetEvent); }] call EFUNC(common,addEventHandler); -GVAR(isOpeningDoor) = false; - // restore global fire teams for JIP private "_team"; { diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index 3f86227476..95be20f141 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -30,6 +30,7 @@ PREP(pardon); // interaction with doors PREP(getDoor); PREP(getDoorAnimations); +PREP(handleScrollWheel); PREP(openDoor); // interaction with boats diff --git a/addons/interaction/functions/fnc_handleScrollWheel.sqf b/addons/interaction/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..793e78c1b3 --- /dev/null +++ b/addons/interaction/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,23 @@ +/* + * Author: commy2 + * Handles incremental door opening + * + * Arguments: + * 0: scroll amount + * + * Return Value: + * handled + * + * Public: No + */ +#include "script_component.hpp" + +params ["_scroll"]; + +if !(GVAR(isOpeningDoor)) exitWith {false}; + +GVAR(doorTargetPhase) = ((GVAR(doorTargetPhase) + (_scroll / (1.2 * 12))) max 0) min 1; + +GVAR(usedScrollWheel) = true; + +true diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 8fff955137..b2249d1589 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -35,39 +35,37 @@ if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_l _lockedVariable call BIS_fnc_LockedDoorOpen; }; -GVAR(isOpeningDoor) = true; - playSound "ACE_Sound_Click"; // @todo replace with smth. more fitting -[_house, _animations] spawn { // @todo - params ["_house", "_animations"]; +GVAR(doorTargetPhase) = _house animationPhase (_animations select 0); +GVAR(isOpeningDoor) = true; +GVAR(usedScrollWheel) = false; - private ["_phase", "_position", "_time", "_usedMouseWheel"]; +[{ + (_this select 0) params ["_house", "_animations", "_position", "_time", "_frame"]; - _phase = _house animationPhase (_animations select 0); - _position = getPosASL ACE_player; + if !(GVAR(isOpeningDoor)) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; - _time = ACE_time + 0.2; - _usedMouseWheel = false; + // didn't use incremental opening. Just do animation normally. + if !(GVAR(usedScrollWheel)) then { + private "_phase"; + _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); - waitUntil { - if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { - _usedMouseWheel = true; + {_house animate [_x, _phase]; false} count _animations; }; - - _phase = _phase + (inputAction "PrevAction" / 12) min 1; - _phase = _phase - (inputAction "NextAction" / 12) max 0; - - {_house animate [_x, _phase]} forEach _animations; - - !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} }; - if (!_usedMouseWheel && {ACE_time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then { - _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); - - {_house animate [_x, _phase]} forEach _animations; + // check if player moved too far away + if (getPosASL ACE_player distance _position > 1) exitWith { + GVAR(isOpeningDoor) = false; }; - GVAR(isOpeningDoor) = false; -}; + // this allows for holding the door in it's current state. + if (ACE_time > _time && {diag_frameno > _frame}) then { + GVAR(usedScrollWheel) = true; + }; + + // do incremental door opening + {_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations; +}, 0.1, [_house, _animations, getPosASL ACE_player, ACE_time + 0.2, diag_frameno + 2]] call CBA_fnc_addPerFrameHandler; From 19131f001d68fe240a712d2b7451e55509f3b5a2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 28 Sep 2015 21:16:13 +0200 Subject: [PATCH 231/311] fix error in handleplayerchanged for tacticl ladder --- addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf index bc8d1faf54..07118acbaf 100644 --- a/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf +++ b/addons/tacticalladder/functions/fnc_handlePlayerChanged.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -if (isNull (GETMVAR(ladder,objNull))) exitWith {}; +if (isNull (GETGVAR(ladder,objNull))) exitWith {}; params ["_newPlayer", "_oldPlayer"]; From 488541bba686e6addafe4884e4115b42738705a2 Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Mon, 28 Sep 2015 20:08:07 -0400 Subject: [PATCH 232/311] Fix for Arma wounds not being healed with healHitPointAfterAdvBandage. --- .../fnc_treatmentAdvanced_bandageLocal.sqf | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index abf09385b2..8e4e7e204f 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -94,12 +94,40 @@ if (_impact > 0 && {GVAR(enableAdvancedWounds)}) then { [_target, _impact, _part, _mostEffectiveSpot, _mostEffectiveInjury, _bandage] call FUNC(handleBandageOpening); }; -// If all wounds have been bandaged, we will reset all damage to 0, so the unit is not showing any blood on the model anymore. -if (GVAR(healHitPointAfterAdvBandage) && {{(_x select 2) == _part && {((_x select 4) * (_x select 3)) > 0}}count _openWounds == 0}) then { - _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; - _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; - _point = _hitPoints select (_hitSelections find _selectionName); - _target setHitPointDamage [_point, 0]; +// If all wounds to a body part have been bandaged, reset damage to that body part to zero +// so that the body part functions normally and blood is removed from the uniform. +// Arma combines left and right arms into a single body part (HitHands), same with left and right legs (HitLegs). +// Arms are actually hands. +if (GVAR(healHitPointAfterAdvBandage)) then +{ + private["_currentWounds", "_headWounds", "_bodyWounds", "_legsWounds", "_armWounds"]; + + // Get the list of the wounds the target is currently suffering from. + _currentWounds = _target getvariable [QGVAR(openWounds), []]; + + // Tally of unbandaged wounds to each body part. + _headWounds = 0; + _bodyWounds = 0; + _legsWounds = 0; + _armWounds = 0; + + // Loop through all current wounds and add up the number of unbandaged wounds on each body part. + { + _x params ["", "", "_bodyPart", "_numOpenWounds"]; + + if (_bodyPart == 0 && {_numOpenWounds > 0}) then { _headWounds = _headWounds + 1; }; // Head + if (_bodyPart == 1 && {_numOpenWounds > 0}) then { _bodyWounds = _bodyWounds + 1; }; // Body + if (_bodyPart == 2 && {_numOpenWounds > 0}) then { _armWounds = _armWounds + 1; }; // Left Arm + if (_bodyPart == 3 && {_numOpenWounds > 0}) then { _armWounds = _armWounds + 1; }; // Right Arm + if (_bodyPart == 4 && {_numOpenWounds > 0}) then { _legsWounds = _legsWounds + 1; }; // Left Leg + if (_bodyPart == 5 && {_numOpenWounds > 0}) then { _legsWounds = _legsWounds + 1; }; // Right Leg + } foreach _currentWounds; + + // Any body part that has no wounds is healed to full health + if (_headWounds == 0) then { _target setHitPointDamage ["hitHead", 0.0]; }; + if (_bodyWounds == 0) then { _target setHitPointDamage ["hitBody", 0.0]; }; + if (_armWounds == 0) then { _target setHitPointDamage ["hitHands", 0.0]; }; + if (_legsWounds == 0) then { _target setHitPointDamage ["hitLegs", 0.0]; }; }; true; From 1ec4556bb8734d2cc78e9a12e715b45730b6a04b Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 02:48:22 +0200 Subject: [PATCH 233/311] fix zeus forced interface broken, fix #2642 --- addons/optics/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index 64226fcf3d..6214178ac9 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -7,7 +7,7 @@ GVAR(camera) = objNull; 0 = 0 spawn { waituntil {!isNull ACE_player}; - waituntil {sleep 1; {_x != GVAR(camera)} count allMissionObjects "camera" == 0}; + waituntil {sleep 1; {_x != GVAR(camera)} count allMissionObjects "camera" == 0 && {isNull curatorCamera}}; GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; camDestroy GVAR(camera); From a864a3411cda7c14524510ef7d0f15f1b42e20ee Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Mon, 28 Sep 2015 21:32:04 -0400 Subject: [PATCH 234/311] Clarified a comment. --- addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 8e4e7e204f..acc58d6b10 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -123,7 +123,7 @@ if (GVAR(healHitPointAfterAdvBandage)) then if (_bodyPart == 5 && {_numOpenWounds > 0}) then { _legsWounds = _legsWounds + 1; }; // Right Leg } foreach _currentWounds; - // Any body part that has no wounds is healed to full health + // Any body part that has no unbandaged ACE wounds it is healed to full Arma health if (_headWounds == 0) then { _target setHitPointDamage ["hitHead", 0.0]; }; if (_bodyWounds == 0) then { _target setHitPointDamage ["hitBody", 0.0]; }; if (_armWounds == 0) then { _target setHitPointDamage ["hitHands", 0.0]; }; From 6e24d2868c502cc52987ebff627a5251b77954c0 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 28 Sep 2015 22:41:45 -0500 Subject: [PATCH 235/311] Fix playerChanged event --- addons/common/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index b2c1cb94d1..87dc71deb2 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -298,7 +298,7 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { // "playerChanged" event _data = call FUNC(player); - if !(_data isEqualTo GVAR(OldPlayerVehicle)) then { + if !(_data isEqualTo ACE_player) then { private "_oldPlayer"; _oldPlayer = ACE_player; From 8619f02538d8507c169311b912bdb0e633a26014 Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Tue, 29 Sep 2015 06:19:49 -0400 Subject: [PATCH 236/311] Take into account wounds that do no cause blood loss. --- .../fnc_treatmentAdvanced_bandageLocal.sqf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 8e4e7e204f..f7bda102dd 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -113,14 +113,14 @@ if (GVAR(healHitPointAfterAdvBandage)) then // Loop through all current wounds and add up the number of unbandaged wounds on each body part. { - _x params ["", "", "_bodyPart", "_numOpenWounds"]; + _x params ["", "", "_bodyPart", "_numOpenWounds", "_bloodLoss"]; - if (_bodyPart == 0 && {_numOpenWounds > 0}) then { _headWounds = _headWounds + 1; }; // Head - if (_bodyPart == 1 && {_numOpenWounds > 0}) then { _bodyWounds = _bodyWounds + 1; }; // Body - if (_bodyPart == 2 && {_numOpenWounds > 0}) then { _armWounds = _armWounds + 1; }; // Left Arm - if (_bodyPart == 3 && {_numOpenWounds > 0}) then { _armWounds = _armWounds + 1; }; // Right Arm - if (_bodyPart == 4 && {_numOpenWounds > 0}) then { _legsWounds = _legsWounds + 1; }; // Left Leg - if (_bodyPart == 5 && {_numOpenWounds > 0}) then { _legsWounds = _legsWounds + 1; }; // Right Leg + if (_bodyPart == 0 && {(_numOpenWounds * _bloodLoss) > 0}) then { _headWounds = _headWounds + 1; }; // Head + if (_bodyPart == 1 && {(_numOpenWounds * _bloodLoss) > 0}) then { _bodyWounds = _bodyWounds + 1; }; // Body + if (_bodyPart == 2 && {(_numOpenWounds * _bloodLoss) > 0}) then { _armWounds = _armWounds + 1; }; // Left Arm + if (_bodyPart == 3 && {(_numOpenWounds * _bloodLoss) > 0}) then { _armWounds = _armWounds + 1; }; // Right Arm + if (_bodyPart == 4 && {(_numOpenWounds * _bloodLoss) > 0}) then { _legsWounds = _legsWounds + 1; }; // Left Leg + if (_bodyPart == 5 && {(_numOpenWounds * _bloodLoss) > 0}) then { _legsWounds = _legsWounds + 1; }; // Right Leg } foreach _currentWounds; // Any body part that has no wounds is healed to full health From 954fad615a90361076d8e463a0c667243bcd5f03 Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Tue, 29 Sep 2015 06:36:36 -0400 Subject: [PATCH 237/311] Reformatted to follow ACE3 coding guidelines. --- .../fnc_treatmentAdvanced_bandageLocal.sqf | 61 ++++++++++++++----- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index f7bda102dd..069499d051 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -98,13 +98,12 @@ if (_impact > 0 && {GVAR(enableAdvancedWounds)}) then { // so that the body part functions normally and blood is removed from the uniform. // Arma combines left and right arms into a single body part (HitHands), same with left and right legs (HitLegs). // Arms are actually hands. -if (GVAR(healHitPointAfterAdvBandage)) then -{ +if (GVAR(healHitPointAfterAdvBandage)) then { private["_currentWounds", "_headWounds", "_bodyWounds", "_legsWounds", "_armWounds"]; // Get the list of the wounds the target is currently suffering from. - _currentWounds = _target getvariable [QGVAR(openWounds), []]; - + _currentWounds = GETVAR(_target, openWounds, []); + // Tally of unbandaged wounds to each body part. _headWounds = 0; _bodyWounds = 0; @@ -115,19 +114,53 @@ if (GVAR(healHitPointAfterAdvBandage)) then { _x params ["", "", "_bodyPart", "_numOpenWounds", "_bloodLoss"]; - if (_bodyPart == 0 && {(_numOpenWounds * _bloodLoss) > 0}) then { _headWounds = _headWounds + 1; }; // Head - if (_bodyPart == 1 && {(_numOpenWounds * _bloodLoss) > 0}) then { _bodyWounds = _bodyWounds + 1; }; // Body - if (_bodyPart == 2 && {(_numOpenWounds * _bloodLoss) > 0}) then { _armWounds = _armWounds + 1; }; // Left Arm - if (_bodyPart == 3 && {(_numOpenWounds * _bloodLoss) > 0}) then { _armWounds = _armWounds + 1; }; // Right Arm - if (_bodyPart == 4 && {(_numOpenWounds * _bloodLoss) > 0}) then { _legsWounds = _legsWounds + 1; }; // Left Leg - if (_bodyPart == 5 && {(_numOpenWounds * _bloodLoss) > 0}) then { _legsWounds = _legsWounds + 1; }; // Right Leg + // Head + if (_bodyPart == 0 && {(_numOpenWounds * _bloodLoss) > 0}) then { + _headWounds = _headWounds + 1; + }; + + // Body + if (_bodyPart == 1 && {(_numOpenWounds * _bloodLoss) > 0}) then { + _bodyWounds = _bodyWounds + 1; + }; + + // Left Arm + if (_bodyPart == 2 && {(_numOpenWounds * _bloodLoss) > 0}) then { + _armWounds = _armWounds + 1; + }; + + // Right Arm + if (_bodyPart == 3 && {(_numOpenWounds * _bloodLoss) > 0}) then { + _armWounds = _armWounds + 1; + }; + + // Left Leg + if (_bodyPart == 4 && {(_numOpenWounds * _bloodLoss) > 0}) then { + _legsWounds = _legsWounds + 1; + }; + + // Right Leg + if (_bodyPart == 5 && {(_numOpenWounds * _bloodLoss) > 0}) then { + _legsWounds = _legsWounds + 1; + }; } foreach _currentWounds; // Any body part that has no wounds is healed to full health - if (_headWounds == 0) then { _target setHitPointDamage ["hitHead", 0.0]; }; - if (_bodyWounds == 0) then { _target setHitPointDamage ["hitBody", 0.0]; }; - if (_armWounds == 0) then { _target setHitPointDamage ["hitHands", 0.0]; }; - if (_legsWounds == 0) then { _target setHitPointDamage ["hitLegs", 0.0]; }; + if (_headWounds == 0) then { + _target setHitPointDamage ["hitHead", 0.0]; + }; + + if (_bodyWounds == 0) then { + _target setHitPointDamage ["hitBody", 0.0]; + }; + + if (_armWounds == 0) then { + _target setHitPointDamage ["hitHands", 0.0]; + }; + + if (_legsWounds == 0) then { + _target setHitPointDamage ["hitLegs", 0.0]; + }; }; true; From d25d79c48518201019fa281f9ca51e17831c13d5 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 16:22:57 +0200 Subject: [PATCH 238/311] Goggles Code refactoring initial commit --- addons/goggles/ACE_Settings.hpp | 7 +++++++ addons/goggles/CfgEventHandlers.hpp | 32 ++++++++++++++++++++++++++--- addons/goggles/XEH_postInit.sqf | 27 ++++++++---------------- addons/goggles/XEH_preInit.sqf | 20 +++++------------- 4 files changed, 49 insertions(+), 37 deletions(-) diff --git a/addons/goggles/ACE_Settings.hpp b/addons/goggles/ACE_Settings.hpp index 6b3faa1823..a78c2866e0 100644 --- a/addons/goggles/ACE_Settings.hpp +++ b/addons/goggles/ACE_Settings.hpp @@ -1,4 +1,11 @@ + class ACE_Settings { + /*class GVAR(enable) { // @todo + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(enable); + };*/ class GVAR(showInThirdPerson) { value = 0; typeName = "BOOL"; diff --git a/addons/goggles/CfgEventHandlers.hpp b/addons/goggles/CfgEventHandlers.hpp index 8c7edda20f..67f17fda18 100644 --- a/addons/goggles/CfgEventHandlers.hpp +++ b/addons/goggles/CfgEventHandlers.hpp @@ -1,10 +1,36 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; + +class Extended_Fired_EventHandlers { + class CAManBase { + class ADDON { + fired = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleFired)}); + }; + }; +}; + +class Extended_Explosion_EventHandlers { + class CAManBase { + class ADDON { + explosion = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleExplosion)}); + }; + }; }; diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 088ccc477a..51ffd14b49 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -1,24 +1,8 @@ -/* - * Author: Garth 'L-H' de Wet - * Sets up the glasses mod for usage. Initialises variables and event handlers. - * Shouldn't be called by a user/modder ever. Done by the engine. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * None - * - * Public: No - */ #include "script_component.hpp" + if (!hasInterface) exitWith {}; -["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), -{ +["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), { if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { call FUNC(clearGlasses); true @@ -26,7 +10,12 @@ if (!hasInterface) exitWith {}; false }, {false}, -[20, [true, true, false]], false] call cba_fnc_addKeybind; +[20, [true, true, false]], false] call CBA_fnc_addKeybind; + + + + + if isNil(QGVAR(UsePP)) then { GVAR(UsePP) = true; diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf index 4eb7df91d1..c6fa4e12b2 100644 --- a/addons/goggles/XEH_preInit.sqf +++ b/addons/goggles/XEH_preInit.sqf @@ -1,22 +1,12 @@ -/* - * Author: Garth 'L-H' de Wet - * Initialises Goggles. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * None - * - * Public: No - */ #include "script_component.hpp" ADDON = false; +PREP(handleExplosion); +PREP(handleFired); +PREP(handleKilled); + + PREP(applyDirtEffect); PREP(applyDust); PREP(applyGlassesEffect); From 2731ac360ab2ccb42863ec4e34127f15764661fe Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 16:56:10 +0200 Subject: [PATCH 239/311] more goggles code cleanup --- addons/goggles/functions/fnc_dustHandler.sqf | 71 ++++++++++++-------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/addons/goggles/functions/fnc_dustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf index 44475d1acc..07d1bded75 100644 --- a/addons/goggles/functions/fnc_dustHandler.sqf +++ b/addons/goggles/functions/fnc_dustHandler.sqf @@ -1,5 +1,5 @@ /* - * Author: Garth 'L-H' de Wet + * Author: Garth 'L-H' de Wet, commy2 * Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements. * * Arguments: @@ -7,67 +7,82 @@ * 1: Weapon * * Return Value: - * None - * - * Example: - *ace_player addEventHandler ["Fired", {[_this select 0, _this select 1] call ace_goggles_fnc_dustHandler;}]; + * Function is handled? * * Public: No */ #include "script_component.hpp" -private ["_bullets", "_position", "_surface", "_weapon", "_cloudType", "_unit"]; -EXPLODE_2_PVT(_this,_unit,_weapon); -if (_unit != ace_player) exitWith {true}; + +params ["_unit", "_weapon"]; + +if (_unit != ACE_player) exitWith {true}; + +// no dust in rain +if (rain > 0.1) exitWith {true}; + +// effect only aplies when lying on the ground +if (stance _unit != "PRONE") exitWith {true}; + +private ["_position", "_particleConfig", "_cloudType", "_surface", "_bullets"]; + +// check if the unit really is on the ground and not in a building +_position = getPosATL _unit; + +if (_position select 2 > 0.2) exitWith {}; + +// get weapon dust effect +_particleConfig = configFile >> "CfgWeapons" >> _weapon >> "GunParticles"; + _cloudType = ""; -if (rain > 0.1) exitWith {true}; -if ((stance _unit) != "PRONE") exitWith {true}; - -if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then { - _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName"); +if (isClass (_particleConfig >> "FirstEffect")) then { // @todo read this with custom / non-standard config classnames + _cloudType = getText (_particleConfig >> "FirstEffect" >> "effectName"); } else { - if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1")) then { - _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "effect1" >> "effectName"); + if (isClass (_particleConfig >> "effect1")) then { + _cloudType = getText (_particleConfig >> "effect1" >> "effectName"); }; }; +// quit if the weapon causes no dust effect if (_cloudType == "") exitWith {true}; -_position = getPosATL _unit; +// get if the surface is dusty +if (surfaceIsWater _position) exitWith {true}; -if (surfaceIsWater _position) exitWith {}; -if ((_position select 2) > 0.2) exitWith {}; - -_surface = surfaceType _position; +_surface = surfaceType _position select [1]; // cuts of the leading # if (_surface != GVAR(surfaceCache)) then { GVAR(surfaceCache) = _surface; - _surface = ([_surface, "#"] call CBA_fnc_split) select 1; - GVAR(surfaceCacheIsDust) = getNumber (ConfigFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1; + GVAR(surfaceCacheIsDust) = getNumber (configFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1; }; +// quit if surface isn't dusty if (!GVAR(surfaceCacheIsDust)) exitWith {}; +// increment dust value with type bullet _bullets = GETDUSTT(DBULLETS); -if ((ACE_diagTime - GETDUSTT(DTIME)) > 1) then { +if (ACE_diagTime - GETDUSTT(DTIME) > 1) then { _bullets = 0; }; _bullets = _bullets + 1; + SETDUST(DBULLETS,_bullets); SETDUST(DTIME,ACE_diagTime); +// apply dust effect if the amount of fired bullets is over the threshold if (GETDUSTT(DAMOUNT) < 2) then { - private "_bulletsRequired"; - _bulletsRequired = 100; - if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then { - _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount"); + local _bulletsRequired = 100; + + if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then { + _bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount)); }; - if (_bulletsRequired <= _bullets) then { + if (_bullets > _bulletsRequired) then { SETDUST(DACTIVE,true); call FUNC(applyDust); }; }; + true From 477e9f06b60e19dab33c53e0b77ffefee0ef2c61 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 17:09:23 +0200 Subject: [PATCH 240/311] more goggles code cleanup --- addons/goggles/XEH_postInit.sqf | 4 ++-- addons/goggles/XEH_preInit.sqf | 4 ++-- .../functions/{fnc_applyDirtEffect.sqf => fnc_applyDirt.sqf} | 2 +- .../{fnc_applyGlassesEffect.sqf => fnc_applyGlasses.sqf} | 4 ++-- addons/goggles/functions/fnc_checkGoggles.sqf | 2 +- addons/goggles/functions/fnc_dustHandler.sqf | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) rename addons/goggles/functions/{fnc_applyDirtEffect.sqf => fnc_applyDirt.sqf} (93%) rename addons/goggles/functions/{fnc_applyGlassesEffect.sqf => fnc_applyGlasses.sqf} (94%) diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 51ffd14b49..0cff31e9d2 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -49,7 +49,7 @@ FUNC(CheckGlasses) = { player addEventHandler ["Explosion", { private "_effects"; if (alive ace_player) then { - call FUNC(ApplyDirtEffect); + call FUNC(ApplyDirt); if (GETBROKEN) exitWith {}; if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; @@ -90,7 +90,7 @@ player AddEventHandler ["Put", {call FUNC(checkGlasses);}]; if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; if ([ace_player] call FUNC(isGogglesVisible)) then { - [_this select 0] call FUNC(applyGlassesEffect); + [_this select 0] call FUNC(applyGlasses); } else { call FUNC(removeGlassesEffect); }; diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf index c6fa4e12b2..1a1222b4a1 100644 --- a/addons/goggles/XEH_preInit.sqf +++ b/addons/goggles/XEH_preInit.sqf @@ -7,9 +7,9 @@ PREP(handleFired); PREP(handleKilled); -PREP(applyDirtEffect); +PREP(applyDirt); PREP(applyDust); -PREP(applyGlassesEffect); +PREP(applyGlasses); PREP(checkGoggles); PREP(clearGlasses); diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirt.sqf similarity index 93% rename from addons/goggles/functions/fnc_applyDirtEffect.sqf rename to addons/goggles/functions/fnc_applyDirt.sqf index 068f7639d2..87f140b91d 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirt.sqf @@ -9,7 +9,7 @@ * Succeeded * * Example: - * _applied = call ace_goggles_fnc_ApplyDirtEffect; + * _applied = call ace_goggles_fnc_ApplyDirt; * * Public: Yes */ diff --git a/addons/goggles/functions/fnc_applyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlasses.sqf similarity index 94% rename from addons/goggles/functions/fnc_applyGlassesEffect.sqf rename to addons/goggles/functions/fnc_applyGlasses.sqf index 7abb10d448..e524a503a6 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlasses.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [goggles ace_player] call ace_goggles_fnc_ApplyGlassesEffect; + * [goggles ace_player] call ace_goggles_fnc_ApplyGlasses * * Public: No */ @@ -46,7 +46,7 @@ if (_glassImagePath != "") then { }; if GETDIRT then { - call FUNC(applyDirtEffect); + call FUNC(applyDirt); }; if GETDUSTT(DACTIVE) then { diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index 84b86c3da4..0587469f02 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -35,7 +35,7 @@ if (true) then { }; }; if !(GVAR(EffectsActive)) then { - [goggles ace_player] call FUNC(applyGlassesEffect); + [goggles ace_player] call FUNC(applyGlasses); } else { if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then { call FUNC(removeRainEffect); diff --git a/addons/goggles/functions/fnc_dustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf index 07d1bded75..2f23f69afb 100644 --- a/addons/goggles/functions/fnc_dustHandler.sqf +++ b/addons/goggles/functions/fnc_dustHandler.sqf @@ -28,7 +28,7 @@ private ["_position", "_particleConfig", "_cloudType", "_surface", "_bullets"]; // check if the unit really is on the ground and not in a building _position = getPosATL _unit; -if (_position select 2 > 0.2) exitWith {}; +if (_position select 2 > 0.2) exitWith {true}; // get weapon dust effect _particleConfig = configFile >> "CfgWeapons" >> _weapon >> "GunParticles"; @@ -57,7 +57,7 @@ if (_surface != GVAR(surfaceCache)) then { }; // quit if surface isn't dusty -if (!GVAR(surfaceCacheIsDust)) exitWith {}; +if (!GVAR(surfaceCacheIsDust)) exitWith {true}; // increment dust value with type bullet _bullets = GETDUSTT(DBULLETS); From 16b1244b0a21808a7a1615a77d18f6d96878cd14 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 29 Sep 2015 10:17:17 -0500 Subject: [PATCH 241/311] Global Event for "CaptiveStatusChange" --- addons/captives/XEH_postInit.sqf | 2 +- addons/captives/functions/fnc_setHandcuffed.sqf | 3 +++ addons/captives/functions/fnc_setSurrendered.sqf | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index fec6e84fbe..26f84e6bd9 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -26,7 +26,7 @@ if (isServer) then { ["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler); ["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler); -//Medical Integration Events??? +//Medical Integration Events ["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler); if (!hasInterface) exitWith {}; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index a8c8e02fd4..e73803c9aa 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -109,3 +109,6 @@ if (_state) then { showHUD true; }; }; + +//Global Event after changes: +["CaptiveStatusChange", [_unit, _state, "SetHandcuffed"]] call EFUNC(common,globalEvent); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index dd9ac417c5..e9f26960dd 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -101,3 +101,6 @@ if (_state) then { }, 0, [_unit, (ACE_time + 20)]] call CBA_fnc_addPerFrameHandler; }; }; + +//Global Event after changes: +["CaptiveStatusChange", [_unit, _state, "SetSurrendered"]] call EFUNC(common,globalEvent); From d051d4c2088aa5d3b3cf7ad2ca82ee5f955dbc3e Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 17:57:09 +0200 Subject: [PATCH 242/311] more goggles code cleanup --- .../goggles/functions/fnc_handleExplosion.sqf | 0 addons/goggles/functions/fnc_handleFired.sqf | 0 addons/goggles/functions/fnc_handleKilled.sqf | 0 .../goggles/functions/fnc_isDivingGoggles.sqf | 20 ++++++++------- .../functions/fnc_isGogglesVisible.sqf | 25 ++++++++----------- 5 files changed, 22 insertions(+), 23 deletions(-) create mode 100644 addons/goggles/functions/fnc_handleExplosion.sqf create mode 100644 addons/goggles/functions/fnc_handleFired.sqf create mode 100644 addons/goggles/functions/fnc_handleKilled.sqf diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/addons/goggles/functions/fnc_handleFired.sqf b/addons/goggles/functions/fnc_handleFired.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/addons/goggles/functions/fnc_handleKilled.sqf b/addons/goggles/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/addons/goggles/functions/fnc_isDivingGoggles.sqf b/addons/goggles/functions/fnc_isDivingGoggles.sqf index bcc6b0db5e..ab5bb74269 100644 --- a/addons/goggles/functions/fnc_isDivingGoggles.sqf +++ b/addons/goggles/functions/fnc_isDivingGoggles.sqf @@ -1,22 +1,24 @@ /* - * Author: Garth 'L-H' de Wet + * Author: commy2 * Determines whether passed goggles is diving goggles or a variant of them. * * Arguments: * 0: Glasses classname * * Return Value: - * Whether diving goggles are worn + * Check if these goggles are diving goggles * * Example: - * [(goggles ace_player)] call ace_goggles_fnc_isDivingGoggles; + * [goggles ace_player] call ace_goggles_fnc_isDivingGoggles; * * Public: Yes */ #include "script_component.hpp" -private ["_result", "_glasses"]; -_glasses = _this select 0; -_result = _glasses == "G_Diving"; -if (_result) exitWith {true}; -_result = [configFile >> "CfgGlasses" >> _glasses, configFile >> "CfgGlasses" >> "G_Diving"] call CBA_fnc_inheritsFrom; -_result + +params ["_glasses"]; + +local _config = configFile >> "CfgGlasses" >> _glasses; + +if (!isClass _config) exitWith {false}; + +getNumber (_config >> "mode") == 1 // return diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 80f9de4830..dfa2b97087 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -1,6 +1,6 @@ /* * Author: Garth 'L-H' de Wet - * Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER) + * Determines if goggles are visible on passed unit. * * Arguments: * 0: Unit @@ -16,20 +16,17 @@ #include "script_component.hpp" params ["_unit"]; -private ["_currentGlasses", "_result", "_position", "_visible"]; + +private ["_currentGlasses", "_position"]; _currentGlasses = goggles _unit; -_result = false; -if (_currentGlasses != "") then { - _position = getPosASLW _unit; - if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { - _result = ([_currentGlasses] call FUNC(isDivingGoggles)); - }; - if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith { - _result = false; - }; - _result = !([_currentGlasses] call FUNC(isDivingGoggles)); -}; +if (_currentGlasses == "") exitWith {false}; -_result +// requires ACE_Resistance config entry. Returns false for balaclavas and bandanas. +if (getNumber (configFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {false}; + +// check if in water and has diving goggles or on land and not diving goggles +_position = getPosASLW _unit; + +(surfaceIsWater _position && {_position select 2 < 0.25}) isEqualTo (_currentGlasses call FUNC(isDivingGoggles)) // return From c0b78ecf3a5695c60e590330ae746c1181c93e4e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 29 Sep 2015 11:36:30 -0500 Subject: [PATCH 243/311] Set Default Channel at mission start --- addons/map/ACE_Settings.hpp | 22 ++++++++++++++++++++++ addons/map/CfgVehicles.hpp | 14 ++++++++++++++ addons/map/XEH_postInitClient.sqf | 15 +++++++++++++++ addons/map/functions/fnc_moduleMap.sqf | 3 ++- addons/map/stringtable.xml | 6 ++++++ 5 files changed, 59 insertions(+), 1 deletion(-) diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp index 4e2a5d5706..c0d2718c1f 100644 --- a/addons/map/ACE_Settings.hpp +++ b/addons/map/ACE_Settings.hpp @@ -2,33 +2,55 @@ class ACE_Settings { class GVAR(BFT_Interval) { value = 1.0; typeName = "SCALAR"; + displayName = CSTRING(BFT_Interval_DisplayName); + description = CSTRING(BFT_Interval_Description); }; class GVAR(BFT_Enabled) { value = 0; typeName = "BOOL"; + displayName = CSTRING(BFT_Enabled_DisplayName); + description = CSTRING(BFT_Enabled_Description); }; class GVAR(BFT_HideAiGroups) { value = 0; typeName = "BOOL"; + displayName = CSTRING(BFT_HideAiGroups_DisplayName); + description = CSTRING(BFT_HideAiGroups_Description); }; class GVAR(mapIllumination) { value = 1; typeName = "BOOL"; + displayName = CSTRING(MapIllumination_DisplayName); + description = CSTRING(MapIllumination_Description); }; class GVAR(mapGlow) { value = 1; typeName = "BOOL"; + displayName = CSTRING(MapGlow_DisplayName); + description = CSTRING(MapGlow_Description); }; class GVAR(mapShake) { value = 1; typeName = "BOOL"; + displayName = CSTRING(MapShake_DisplayName); + description = CSTRING(MapShake_Description); }; class GVAR(mapLimitZoom) { value = 0; typeName = "BOOL"; + displayName = CSTRING(MapLimitZoom_DisplayName); + description = CSTRING(MapLimitZoom_Description); }; class GVAR(mapShowCursorCoordinates) { value = 0; typeName = "BOOL"; + displayName = CSTRING(MapShowCursorCoordinates_DisplayName); + description = CSTRING(MapShowCursorCoordinates_Description); + }; + class GVAR(DefaultChannel) { + value = -1; + typeName = "SCALAR"; + displayName = CSTRING(DefaultChannel_DisplayName); + description = CSTRING(DefaultChannel_Description); }; }; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 560453b416..7906de8bb7 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -55,6 +55,20 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 0; }; + class DefaultChannel { + displayName = CSTRING(DefaultChannel_DisplayName); + description = CSTRING(DefaultChannel_Description); + typeName = "NUMBER"; + class values { + class disable {name = ECSTRING(common,Disabled); value = -1; default = 1;}; + class global {name = "$STR_channel_global"; value = 0;}; + class side {name = "$STR_channel_side"; value = 1;}; + class command {name = "$STR_channel_command"; value = 2;}; + class group {name = "$STR_channel_group"; value = 3;}; + class vehicle {name = "$STR_channel_vehicle"; value = 4;}; + class direct {name = "$STR_channel_direct"; value = 5;}; + }; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 02800c2540..c162f8802d 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -56,6 +56,21 @@ call FUNC(determineZoom); }, 0] call CBA_fnc_addPerFrameHandler; ["SettingsInitialized", { + if (isMultiplayer && {GVAR(DefaultChannel) != -1}) then { + //Set the chat channel once the map has finished loading + [{ + if ((isNull findDisplay 37) && {isNull findDisplay 52} && {isNull findDisplay 53} && {isNull findDisplay 12}) exitWith {}; + [_this select 1] call CBA_fnc_removePerFrameHandler; + + setCurrentChannel GVAR(DefaultChannel); + if (currentChannel == GVAR(DefaultChannel)) then { + // ACE_LOGINFO_1("Channel Set - %1", currentChannel); + } else { + ACE_LOGERROR_2("Failed To Set Channel %1 (is %2)", GVAR(DefaultChannel), currentChannel); + }; + }, 0, []] call CBA_fnc_addPerFrameHandler; + }; + // Start Blue Force Tracking if Enabled if (GVAR(BFT_Enabled)) then { GVAR(BFT_markers) = []; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index b7db6996d6..605c15127e 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -13,7 +13,7 @@ if !(isServer) exitWith {}; -params ["_logic", "_units", "_activated"]; +params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; @@ -22,5 +22,6 @@ if !(_activated) exitWith {}; [_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(DefaultChannel), "DefaultChannel" ] call EFUNC(common,readSettingFromModule); ACE_LOGINFO("Map Module Initialized."); diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 8f693ef37a..76055cc45a 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -256,5 +256,11 @@ Snížit jas Reducir brillo + + Set Channel At Start + + + Change the starting marker channel at mission start + \ No newline at end of file From d454271fb97461a1ac4c089209b0864760e6be4f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 29 Sep 2015 11:40:32 -0500 Subject: [PATCH 244/311] Give the event the D --- addons/captives/functions/fnc_setHandcuffed.sqf | 2 +- addons/captives/functions/fnc_setSurrendered.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index e73803c9aa..00122862eb 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -111,4 +111,4 @@ if (_state) then { }; //Global Event after changes: -["CaptiveStatusChange", [_unit, _state, "SetHandcuffed"]] call EFUNC(common,globalEvent); +["CaptiveStatusChanged", [_unit, _state, "SetHandcuffed"]] call EFUNC(common,globalEvent); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index e9f26960dd..cdba47a406 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -103,4 +103,4 @@ if (_state) then { }; //Global Event after changes: -["CaptiveStatusChange", [_unit, _state, "SetSurrendered"]] call EFUNC(common,globalEvent); +["CaptiveStatusChanged", [_unit, _state, "SetSurrendered"]] call EFUNC(common,globalEvent); From 53bfcdb61e677dbf7b25ca6c5a2ea5c3959bd8e3 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 18:51:24 +0200 Subject: [PATCH 245/311] more goggles code cleanup --- .../goggles/functions/fnc_externalCamera.sqf | 8 ++-- .../functions/fnc_getExplosionIndex.sqf | 17 ++++--- .../goggles/functions/fnc_isInRotorWash.sqf | 44 +++++++++---------- 3 files changed, 31 insertions(+), 38 deletions(-) diff --git a/addons/goggles/functions/fnc_externalCamera.sqf b/addons/goggles/functions/fnc_externalCamera.sqf index ddc05e6b87..1af09827ab 100644 --- a/addons/goggles/functions/fnc_externalCamera.sqf +++ b/addons/goggles/functions/fnc_externalCamera.sqf @@ -6,15 +6,13 @@ * None * * Return Value: - * Whether the camera is in external view or not. If the "showInThirdPerson" option is checked, this will always return false. + * Whether the camera is in external view or not. * * Example: - * call ace_goggles_fnc_removeRainEffect; + * call ace_goggles_fnc_externalCamera; * * Public: Yes */ #include "script_component.hpp" -if (GVAR(showInThirdPerson)) exitWith { false }; - -(cameraView in ["EXTERNAL", "GROUP"] || {call EFUNC(common,isFeatureCameraActive)}) +cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return diff --git a/addons/goggles/functions/fnc_getExplosionIndex.sqf b/addons/goggles/functions/fnc_getExplosionIndex.sqf index 6e16085b2c..9d7c4004c7 100644 --- a/addons/goggles/functions/fnc_getExplosionIndex.sqf +++ b/addons/goggles/functions/fnc_getExplosionIndex.sqf @@ -1,5 +1,5 @@ /* - * Author: Garth 'L-H' de Wet + * Author: Garth 'L-H' de Wet, commy2 * Turns 0-1 damage of explosion Event into a rating system of 0-3 * * Arguments: @@ -13,13 +13,12 @@ * * Public: No */ -private ["_effectIndex"]; +#include "script_component.hpp" -_effectIndex = switch true do { - case (_this <= 0.04): {0}; - case (_this <= 0.06): {1}; - case (_this <= 0.09): {2}; - default {3}; -}; +params ["_damage"]; -_effectIndex +if (_damage <= 0.04) exitWith {0}; +if (_damage <= 0.06) exitWith {1}; +if (_damage <= 0.09) exitWith {2}; + +3 diff --git a/addons/goggles/functions/fnc_isInRotorWash.sqf b/addons/goggles/functions/fnc_isInRotorWash.sqf index ef6391fdc6..5ddc59192a 100644 --- a/addons/goggles/functions/fnc_isInRotorWash.sqf +++ b/addons/goggles/functions/fnc_isInRotorWash.sqf @@ -1,10 +1,10 @@ /* - * Author: Garth 'L-H' de Wet + * Author: Garth 'L-H' de Wet, commy2 * Checks for nearby running helicopters (within 15m) * * Arguments: * 0: Unit - * 1: Radius to check for helicopter Default: 15 (optional) + * 1: Radius to check for helicopter (default: 15) * * Return Value: * : @@ -12,35 +12,31 @@ * 1: Amount of rotor wash. * * Example: - * if (([ace_player, 10] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; }; - * if (([ace_player] call ace_goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; }; + * if ([ace_player, 10] call ace_goggles_fnc_isInRotorWash select 0) then { hint "Rotor wash"; }; + * if ([ace_player] call ace_goggles_fnc_isInRotorWash select 0) then { hint "Rotor wash"; }; * * Public: Yes */ #include "script_component.hpp" -private ["_heli", "_unit", "_result", "_radius"]; -_unit = _this select 0; -_radius = 15; -if (count _this > 1) then { - _radius = _this select 1; -}; -_result = [false, _radius + 2]; -_heli = (getPosATL _unit) nearEntities [["Helicopter"], _radius]; +params ["_unit", ["_radius", 15]]; + +local _rotorWash = [false, 0]; + { - if !(_x isKindOf "ParachuteBase") then { - if (isEngineOn _x) then { - private "_distance"; - _distance = (_radius - (_unit distance _x)); - if (_distance != 0) then { - _distance = _distance / _radius; - }; - if (_distance < (_result select 1)) then { - _result = [true, _distance]; - }; + if (isEngineOn _x) then { + local _distance = _unit distance _x; + + // convert distance to 0...1 range, where 0 is the maximum radius + _distance = 1 - _distance / _radius; + + // use highest amount of rotor wash as return value in case of multiple helicopters + if (_distance > _rotorWash select 1) then { + _rotorWash set [0, true]; + _rotorWash set [1, _distance]; }; }; false -} count _heli; +} count (position _unit nearEntities [["Helicopter"], _radius]); -_result +_rotorWash From d1aacf3fef3cc6c5719f5d28ab962cae9b108ecd Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 19:51:41 +0200 Subject: [PATCH 246/311] more goggles code cleanup --- addons/goggles/XEH_postInit.sqf | 6 +- addons/goggles/XEH_preInit.sqf | 48 ++++++------ addons/goggles/functions/fnc_applyDirt.sqf | 33 -------- .../goggles/functions/fnc_applyDirtEffect.sqf | 39 ++++++++++ addons/goggles/functions/fnc_applyDust.sqf | 60 --------------- .../goggles/functions/fnc_applyDustEffect.sqf | 77 +++++++++++++++++++ ...Glasses.sqf => fnc_applyGlassesEffect.sqf} | 39 +++++----- .../goggles/functions/fnc_applyRainEffect.sqf | 68 ++++++++++++++++ addons/goggles/functions/fnc_checkGoggles.sqf | 2 +- addons/goggles/functions/fnc_dustHandler.sqf | 2 +- addons/goggles/functions/fnc_onEachFrame.sqf | 4 +- addons/goggles/functions/fnc_rainEffect.sqf | 53 ------------- 12 files changed, 238 insertions(+), 193 deletions(-) delete mode 100644 addons/goggles/functions/fnc_applyDirt.sqf create mode 100644 addons/goggles/functions/fnc_applyDirtEffect.sqf delete mode 100644 addons/goggles/functions/fnc_applyDust.sqf create mode 100644 addons/goggles/functions/fnc_applyDustEffect.sqf rename addons/goggles/functions/{fnc_applyGlasses.sqf => fnc_applyGlassesEffect.sqf} (52%) create mode 100644 addons/goggles/functions/fnc_applyRainEffect.sqf delete mode 100644 addons/goggles/functions/fnc_rainEffect.sqf diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 0cff31e9d2..2d78e6f372 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -49,7 +49,7 @@ FUNC(CheckGlasses) = { player addEventHandler ["Explosion", { private "_effects"; if (alive ace_player) then { - call FUNC(ApplyDirt); + call FUNC(applyDirtEffect); if (GETBROKEN) exitWith {}; if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; @@ -90,7 +90,7 @@ player AddEventHandler ["Put", {call FUNC(checkGlasses);}]; if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; if ([ace_player] call FUNC(isGogglesVisible)) then { - [_this select 0] call FUNC(applyGlasses); + [_this select 0] call FUNC(applyGlassesEffect); } else { call FUNC(removeGlassesEffect); }; @@ -116,5 +116,5 @@ player AddEventHandler ["Put", {call FUNC(checkGlasses);}]; }] call EFUNC(common,addEventHandler); call FUNC(checkGlasses); [FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler; -[FUNC(rainEffect), 0.5, []] call CBA_fnc_addPerFrameHandler; +[FUNC(applyRainEffect), 0.5, []] call CBA_fnc_addPerFrameHandler; [FUNC(onEachFrame), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf index 1a1222b4a1..be54cf73e6 100644 --- a/addons/goggles/XEH_preInit.sqf +++ b/addons/goggles/XEH_preInit.sqf @@ -2,31 +2,35 @@ ADDON = false; -PREP(handleExplosion); -PREP(handleFired); -PREP(handleKilled); - - -PREP(applyDirt); -PREP(applyDust); -PREP(applyGlasses); - -PREP(checkGoggles); -PREP(clearGlasses); -PREP(dustHandler); -PREP(externalCamera); -PREP(getExplosionIndex); - -PREP(isDivingGoggles); -PREP(isGogglesVisible); -PREP(isInRotorWash); - -PREP(onEachFrame); -PREP(rainEffect); - +// effects +PREP(applyDirtEffect); +PREP(applyDustEffect); +PREP(applyGlassesEffect); +PREP(applyRainEffect); PREP(removeDirtEffect); PREP(removeDustEffect); PREP(removeGlassesEffect); PREP(removeRainEffect); +// general +PREP(externalCamera); +PREP(isDivingGoggles); +PREP(isGogglesVisible); +PREP(isInRotorWash); +PREP(getExplosionIndex); + +// eventhandlers +PREP(handleExplosion); +PREP(handleFired); +PREP(handleKilled); + + + +PREP(checkGoggles); +PREP(clearGlasses); +PREP(dustHandler); + +PREP(onEachFrame); + + ADDON = true; diff --git a/addons/goggles/functions/fnc_applyDirt.sqf b/addons/goggles/functions/fnc_applyDirt.sqf deleted file mode 100644 index 87f140b91d..0000000000 --- a/addons/goggles/functions/fnc_applyDirt.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Adds dirt effect to the glasses. - * - * Arguments: - * None - * - * Return Value: - * Succeeded - * - * Example: - * _applied = call ace_goggles_fnc_ApplyDirt; - * - * Public: Yes - */ -#include "script_component.hpp" - -if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false}; -private ["_dirtImage", "_applied", "_effects"]; -_effects = GETGLASSES(ace_player); -_effects set [DIRT, true]; -SETGLASSES(ace_player,_effects); - -if ([ace_player] call FUNC(isGogglesVisible)) then{ - _dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt"); - if (_dirtImage != "") then { - 100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false]; - - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; - }; -}; - -true diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf new file mode 100644 index 0000000000..b8aedd5e64 --- /dev/null +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -0,0 +1,39 @@ +/* + * Author: Garth 'L-H' de Wet + * Adds dirt effect to the glasses. + * + * Arguments: + * None + * + * Return Value: + * Succeeded + * + * Example: + * _applied = call ace_goggles_fnc_applyDirtEffect + * + * Public: Yes + */ +#include "script_component.hpp" + +if (GVAR(showInThirdPerson)) exitWith {false}; +if (call FUNC(externalCamera)) exitWith {false}; + +private ["_unit", "_effects"]; + +_unit = ACE_player; + +_effects = GETGLASSES(_unit); +_effects set [DIRT, true]; + +SETGLASSES(_unit,_effects); + +if ([_unit] call FUNC(isGogglesVisible)) then { + local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt"); + + if (_dirtImage != "") then { + (QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false]; // @todo init as 100 + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; + }; +}; + +true diff --git a/addons/goggles/functions/fnc_applyDust.sqf b/addons/goggles/functions/fnc_applyDust.sqf deleted file mode 100644 index a1ac88c78d..0000000000 --- a/addons/goggles/functions/fnc_applyDust.sqf +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Applies dust to screen. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_goggles_fnc_ApplyDust; - * - * Public: Yes - */ -#include "script_component.hpp" - -if (call FUNC(ExternalCamera)) exitWith {}; -if ([ace_player] call FUNC(isGogglesVisible)) exitWith { - 100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false]; - (uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1]; - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1)); - SETDUST(DBULLETS,0); -}; - -if (GETVAR(ace_player,ACE_EyesDamaged,false)) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);}; -SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,2)); - -private "_amount"; -_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); - -GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; -GVAR(PostProcessEyes) ppEffectCommit 1; -GVAR(PostProcessEyes) ppEffectEnable true; -SETDUST(DBULLETS,0); - -if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; -}; -GVAR(DustHandler) = [{ - if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then { - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - private "_amount"; - _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); - if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 0.5; - }; - if (GETDUSTT(DAMOUNT) <= 0) then { - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 2; - [{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute); - SETDUST(DACTIVE,false); - SETDUST(DBULLETS,0); - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - }; -},0,[]] call CALLSTACK(CBA_fnc_addPerFrameHandler); diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf new file mode 100644 index 0000000000..6e89a8df6b --- /dev/null +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -0,0 +1,77 @@ +/* + * Author: Garth 'L-H' de Wet + * Applies dust to screen. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_goggles_fnc_applyDustEffect + * + * Public: Yes + */ +#include "script_component.hpp" + +if (GVAR(showInThirdPerson)) exitWith {false}; +if (call FUNC(ExternalCamera)) exitWith {}; + +private ["_unit", "_amount"]; + +_unit = ACE_player; + +if ([_unit] call FUNC(isGogglesVisible)) exitWith { + (QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false]; + + ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetText format [getText (configFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1]; + + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,1)); + SETDUST(DBULLETS,0); +}; + +if (GETVAR(_unit,ACE_EyesDamaged,false)) exitWith { + SETDUST(DACTIVE,false); + SETDUST(DBULLETS,0); + SETDUST(DAMOUNT,0); +}; + +SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,2)); + +_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); + +GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]]; +GVAR(PostProcessEyes) ppEffectCommit 1; +GVAR(PostProcessEyes) ppEffectEnable true; + +SETDUST(DBULLETS,0); + +[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; +GVAR(DustHandler) = -1; + +GVAR(DustHandler) = [{ + if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then { + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); + + local _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); + + if !(_unit getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]]; + GVAR(PostProcessEyes) ppEffectCommit 0.5; + }; + + if (GETDUSTT(DAMOUNT) <= 0) then { + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + + [{GVAR(PostProcessEyes) ppEffectEnable false}, [], 2] call EFUNC(common,waitAndExecute); + + SETDUST(DACTIVE,false); + SETDUST(DBULLETS,0); + + [GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; + GVAR(DustHandler) = -1; + }; + }; +}, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/goggles/functions/fnc_applyGlasses.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf similarity index 52% rename from addons/goggles/functions/fnc_applyGlasses.sqf rename to addons/goggles/functions/fnc_applyGlassesEffect.sqf index e524a503a6..a8ccf23633 100644 --- a/addons/goggles/functions/fnc_applyGlasses.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -11,20 +11,23 @@ * None * * Example: - * [goggles ace_player] call ace_goggles_fnc_ApplyGlasses + * [goggles ace_player] call ace_goggles_fnc_applyGlassesEffect * * Public: No */ #include "script_component.hpp" -private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"]; - -_glassesClassname = _this select 0; -_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Color"); -_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_TintAmount"); +params ["_glasses"]; +// remove old effect call FUNC(removeGlassesEffect); -GVAR(EffectsActive) = true; + +private ["_config", "_postProcessColour", "_postProcessTintAmount", "_imagePath"]; + +_config = configFile >> "CfgGlasses" >> _glasses; + +_postProcessColour = getArray (_config >> "ACE_Color"); +_postProcessTintAmount = getNumber (_config >> "ACE_TintAmount"); if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { _postProcessColour set [3, _postProcessTintAmount/100]; @@ -36,20 +39,20 @@ if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { GVAR(PostProcess) ppEffectCommit 30; }; -_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay"); -if GETBROKEN then { - _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked"); -}; -if (_glassImagePath != "") then { - 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath; +_imagePath = getText (_config >> ["ACE_Overlay", "ACE_OverlayCracked"] select GETBROKEN); + +if (_imagePath != "") then { + (QGVAR(GogglesLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false]; // @todo init as 150 + (GLASSDISPLAY displayCtrl 10650) ctrlSetText _imagePath; }; -if GETDIRT then { - call FUNC(applyDirt); +if (GETDIRT) then { + call FUNC(applyDirtEffect); }; -if GETDUSTT(DACTIVE) then { +if (GETDUSTT(DACTIVE)) then { SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - call FUNC(applyDust); + call FUNC(applyDustEffect); }; + +GVAR(EffectsActive) = true; diff --git a/addons/goggles/functions/fnc_applyRainEffect.sqf b/addons/goggles/functions/fnc_applyRainEffect.sqf new file mode 100644 index 0000000000..7e1260a453 --- /dev/null +++ b/addons/goggles/functions/fnc_applyRainEffect.sqf @@ -0,0 +1,68 @@ +/* + * Author: Garth 'L-H' de Wet + * Handles rain effects being created on glasses. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_goggles_fnc_applyRainEffect; + * + * Public: No + */ +#include "script_component.hpp" + +private ["_unit", "_fnc_underCover"]; + +_unit = ACE_player; + +if (!alive _unit) exitWith {}; + +_fnc_underCover = { + params ["_unit"]; + + if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true}; + + // looking up and no roof over head + local _position = eyePos _unit; + positionCameraToWorld [0, 0, 1] select 2 < (positionCameraToWorld [0, 0, 0] select 2) - 0.4 || {(lineIntersects [_position, _position vectorAdd [0, 0, 15], _unit])} // return +}; + +if (!isNull findDisplay 312) exitWith { + if (GVAR(RainActive)) then { + call FUNC(removeRainEffect); + }; +}; + +// Ignore if unit is under water +if !(GVAR(EffectsActive) || {underwater _unit}) exitWith { + call FUNC(RemoveRainEffect); +}; + +if (GVAR(RainLastLevel) != rain) then { + call FUNC(RemoveRainEffect); + + GVAR(RainLastLevel) = rain; + + // Rain is happening + if (GVAR(RainLastLevel) > 0.05 && {!([_unit] call _fnc_underCover)}) then { + GVAR(RainActive) = true; + GVAR(RainDrops) = "#particlesource" createVehicleLocal position _unit; + GVAR(RainDrops) setParticleClass "ACERainEffect"; + GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); + GVAR(RainDrops) attachTo [vehicle _unit, [0,0,0]]; + }; +} else { + if (GVAR(RainLastLevel) > 0.05) then { + if (GVAR(RainActive) && {[_unit] call _fnc_underCover}) exitWith { + call FUNC(RemoveRainEffect); + }; + + if !(GVAR(RainActive)) then { + GVAR(RainLastLevel) = -1; + }; + }; +}; diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index 0587469f02..84b86c3da4 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -35,7 +35,7 @@ if (true) then { }; }; if !(GVAR(EffectsActive)) then { - [goggles ace_player] call FUNC(applyGlasses); + [goggles ace_player] call FUNC(applyGlassesEffect); } else { if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then { call FUNC(removeRainEffect); diff --git a/addons/goggles/functions/fnc_dustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf index 2f23f69afb..90260d07b3 100644 --- a/addons/goggles/functions/fnc_dustHandler.sqf +++ b/addons/goggles/functions/fnc_dustHandler.sqf @@ -81,7 +81,7 @@ if (GETDUSTT(DAMOUNT) < 2) then { if (_bullets > _bulletsRequired) then { SETDUST(DACTIVE,true); - call FUNC(applyDust); + call FUNC(applyDustEffect); }; }; diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf index 85692a0f57..b3494d1290 100644 --- a/addons/goggles/functions/fnc_onEachFrame.sqf +++ b/addons/goggles/functions/fnc_onEachFrame.sqf @@ -46,10 +46,10 @@ if !(_safe) then { if (GETDUSTT(DAMOUNT) < 2) then { if (!GETDUSTT(DACTIVE)) then { SETDUST(DACTIVE,true); - call FUNC(ApplyDust); + call FUNC(applyDustEffect); } else { if ((_rotorWash select 1) > 0.5) then { - call FUNC(ApplyDust); + call FUNC(applyDustEffect); }; }; }; diff --git a/addons/goggles/functions/fnc_rainEffect.sqf b/addons/goggles/functions/fnc_rainEffect.sqf deleted file mode 100644 index 6f351f4002..0000000000 --- a/addons/goggles/functions/fnc_rainEffect.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Handles rain effects being created on glasses. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_goggles_fnc_rainEffect; - * - * Public: No - */ -#include "script_component.hpp" -private ["_fnc_underCover"]; -if (isNull(ace_player) || {!(alive ace_player)}) exitWith {}; -_fnc_underCover = { - private ["_pos", "_unit"]; - _unit = (_this select 0); - if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true}; - _pos = eyePos _unit; - ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} -}; -if (!isNull(findDisplay 312)) exitWith { - if (GVAR(RainActive)) then { - call FUNC(RemoveRainEffect); - }; -}; -// Ignore if ace_player is under water -if (!GVAR(EffectsActive) || {underwater ace_player}) exitWith{call FUNC(RemoveRainEffect);}; -if (GVAR(RainLastLevel) != rain) then { - call FUNC(RemoveRainEffect); - GVAR(RainLastLevel) = rain; - // Rain is happening - if (GVAR(RainLastLevel) > 0.05 && {!([ace_player] call _fnc_underCover)}) then { - GVAR(RainActive) = true; - GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player; - GVAR(RainDrops) setParticleClass "ACERainEffect"; - GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); - GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]]; - }; -}else{ - if (GVAR(RainLastLevel) > 0.05) then { - if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith { - call FUNC(RemoveRainEffect); - }; - if (!GVAR(RainActive)) then { - GVAR(RainLastLevel) = -1; - }; - }; -}; From 251437c415444f0472ea2395e1e1a860ee680826 Mon Sep 17 00:00:00 2001 From: gienkov Date: Tue, 29 Sep 2015 20:37:30 +0200 Subject: [PATCH 247/311] pl translation --- addons/map/stringtable.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 76055cc45a..0488a13493 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -258,9 +258,11 @@ Set Channel At Start + Ust. domyślny kanał Change the starting marker channel at mission start + Ustaw domyślny kanał dla markerów przy starcie misji \ No newline at end of file From b7ce315240e9fda2be08130baf1e6b745977964d Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 21:28:57 +0200 Subject: [PATCH 248/311] more goggles code cleanup --- addons/goggles/XEH_preInit.sqf | 12 +++++++----- addons/goggles/functions/fnc_clearGlasses.sqf | 16 ++++++++++------ .../goggles/functions/fnc_removeDirtEffect.sqf | 5 +++-- .../goggles/functions/fnc_removeDustEffect.sqf | 5 +++-- .../functions/fnc_removeGlassesEffect.sqf | 8 ++++---- .../goggles/functions/fnc_removeRainEffect.sqf | 8 +++++--- 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf index be54cf73e6..bb96add89d 100644 --- a/addons/goggles/XEH_preInit.sqf +++ b/addons/goggles/XEH_preInit.sqf @@ -12,12 +12,16 @@ PREP(removeDustEffect); PREP(removeGlassesEffect); PREP(removeRainEffect); -// general +// public PREP(externalCamera); PREP(isDivingGoggles); PREP(isGogglesVisible); -PREP(isInRotorWash); + +// general +PREP(clearGlasses); +PREP(dustHandler); PREP(getExplosionIndex); +PREP(isInRotorWash); // eventhandlers PREP(handleExplosion); @@ -27,10 +31,8 @@ PREP(handleKilled); PREP(checkGoggles); -PREP(clearGlasses); -PREP(dustHandler); - PREP(onEachFrame); + ADDON = true; diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index 7fcb05a511..d0b14e4f90 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -10,27 +10,31 @@ * None * * Example: - * call ace_goggles_fnc_ClearGlasses; + * call ace_goggles_fnc_clearGlasses * * Public: Yes */ #include "script_component.hpp" -private ["_broken", "_effects"]; +private ["_unit", "_broken", "_effects"]; + +_unit = ACE_player; _broken = GETBROKEN; _effects = GLASSESDEFAULT; _effects set [BROKEN, _broken]; -SETGLASSES(ace_player,_effects); -if ((stance ace_player) != "PRONE") then { - ace_player playActionNow "gestureWipeFace"; +SETGLASSES(_unit,_effects); + +if (stance _unit != "PRONE") then { + _unit playActionNow "gestureWipeFace"; }; + [{ if (cameraView == "INTERNAL") then { addCamShake [5, 1.75, 2]; }; -}, [], 0.3, 0] call EFUNC(common,waitAndExecute); +}, [], 0.3] call EFUNC(common,waitAndExecute); call FUNC(removeDirtEffect); call FUNC(removeRainEffect); diff --git a/addons/goggles/functions/fnc_removeDirtEffect.sqf b/addons/goggles/functions/fnc_removeDirtEffect.sqf index f7efd39af3..a6d5a232cc 100644 --- a/addons/goggles/functions/fnc_removeDirtEffect.sqf +++ b/addons/goggles/functions/fnc_removeDirtEffect.sqf @@ -9,11 +9,12 @@ * None * * Example: - * call ace_goggles_fnc_removeDirtEffect; + * call ace_goggles_fnc_removeDirtEffect * * Public: Yes */ #include "script_component.hpp" -if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { + +if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then { (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText ""; }; diff --git a/addons/goggles/functions/fnc_removeDustEffect.sqf b/addons/goggles/functions/fnc_removeDustEffect.sqf index 1e179ed6b4..a04121e8ba 100644 --- a/addons/goggles/functions/fnc_removeDustEffect.sqf +++ b/addons/goggles/functions/fnc_removeDustEffect.sqf @@ -9,11 +9,12 @@ * None * * Example: - * call ace_goggles_fnc_removeDustEffect; + * call ace_goggles_fnc_removeDustEffect * * Public: Yes */ #include "script_component.hpp" -if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { + +if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then { (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText ""; }; diff --git a/addons/goggles/functions/fnc_removeGlassesEffect.sqf b/addons/goggles/functions/fnc_removeGlassesEffect.sqf index c7965fefbc..658daf1d32 100644 --- a/addons/goggles/functions/fnc_removeGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_removeGlassesEffect.sqf @@ -1,7 +1,6 @@ /* * Author: Garth 'L-H' de Wet - * Removes the glasses effect from the screen, removes dirt effect, removes rain effect, - * removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) + * Removes the glasses effect from the screen, removes dirt effect, removes rain effect, removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) * * Arguments: * None @@ -10,15 +9,16 @@ * None * * Example: - * call ace_goggles_fnc_removeGlassesEffect; + * call ace_goggles_fnc_removeGlassesEffect * * Public: Yes */ #include "script_component.hpp" + GVAR(EffectsActive) = false; GVAR(PostProcess) ppEffectEnable false; -if (!isNull(GLASSDISPLAY)) then { +if (!isNull (GLASSDISPLAY)) then { GLASSDISPLAY closeDisplay 0; }; diff --git a/addons/goggles/functions/fnc_removeRainEffect.sqf b/addons/goggles/functions/fnc_removeRainEffect.sqf index 0d322e12da..fb7f3e5e2e 100644 --- a/addons/goggles/functions/fnc_removeRainEffect.sqf +++ b/addons/goggles/functions/fnc_removeRainEffect.sqf @@ -9,13 +9,15 @@ * None * * Example: - * call ace_goggles_fnc_removeRainEffect; + * call ace_goggles_fnc_removeRainEffect * * Public: Yes */ #include "script_component.hpp" -if (!isNull (GVAR(RainDrops))) then { - deleteVehicle (GVAR(RainDrops)); + +if (!isNull GVAR(RainDrops)) then { + deleteVehicle GVAR(RainDrops); }; + GVAR(RainActive) = false; GVAR(RainLastLevel) = 0; From 62349f685c37bdfdb29e8cf5c2af678b079b91f0 Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 22:01:40 +0200 Subject: [PATCH 249/311] more goggles code cleanup --- addons/goggles/XEH_postInit.sqf | 123 ++++++++---------- .../goggles/functions/fnc_applyDirtEffect.sqf | 2 +- .../goggles/functions/fnc_applyDustEffect.sqf | 2 +- .../functions/fnc_applyGlassesEffect.sqf | 2 +- addons/goggles/functions/fnc_checkGoggles.sqf | 2 +- .../goggles/functions/fnc_handleExplosion.sqf | 19 +++ addons/goggles/functions/fnc_handleFired.sqf | 2 + addons/goggles/functions/fnc_handleKilled.sqf | 13 ++ addons/goggles/functions/fnc_onEachFrame.sqf | 2 +- 9 files changed, 94 insertions(+), 73 deletions(-) diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 2d78e6f372..5a3c2c875b 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -12,22 +12,25 @@ if (!hasInterface) exitWith {}; {false}, [20, [true, true, false]], false] call CBA_fnc_addKeybind; +// make sure to stack effect layers in correct order +QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer; +QGVAR(GogglesLayer) call BIS_fnc_RSCLayer; - - - - -if isNil(QGVAR(UsePP)) then { +if (isNil QGVAR(UsePP)) then { GVAR(UsePP) = true; }; -GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995]; +// init pp effects +GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995]; GVAR(PostProcessEyes) = ppEffectCreate ["ColorCorrections", 1992]; -GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; +GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 0; GVAR(PostProcessEyes) ppEffectEnable false; + GVAR(EffectsActive) = false; + SETGLASSES(ace_player,GLASSESDEFAULT); + GVAR(Current) = "None"; GVAR(EyesDamageScript) = -1; GVAR(FrameEvent) = [false, [false,20]]; @@ -39,82 +42,66 @@ GVAR(RainLastLevel) = 0; GVAR(surfaceCache) = ""; GVAR(surfaceCacheIsDust) = false; -FUNC(CheckGlasses) = { - if (GVAR(Current) != (goggles ace_player)) then { - GVAR(Current) = (goggles ace_player); - ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent); - }; -}; -player addEventHandler ["Explosion", { - private "_effects"; - if (alive ace_player) then { - call FUNC(applyDirtEffect); - if (GETBROKEN) exitWith {}; - if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; - if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; - _effects = GETGLASSES(ace_player); - _effects set [BROKEN, true]; - SETGLASSES(ace_player,_effects); - if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { - if (call FUNC(ExternalCamera)) exitWith {}; - if (isNull(GLASSDISPLAY)) then { - 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; - }; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); - }; - ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); - }; -}]; -player addEventHandler ["Killed",{ - GVAR(PostProcessEyes) ppEffectEnable false; - SETGLASSES(ace_player,GLASSESDEFAULT); - call FUNC(removeGlassesEffect); - GVAR(EffectsActive)=false; - ace_player setVariable ["ACE_EyesDamaged", false]; - if (GVAR(EyesDamageScript) != -1) then { - [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); - }; - if (GVAR(DustHandler) != -1) then { - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; -}]; -player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}]; -player AddEventHandler ["Take",{call FUNC(checkGlasses);}]; -player AddEventHandler ["Put", {call FUNC(checkGlasses);}]; +// init GlassesChanged eventhandler +GVAR(OldGlasses) = "#NULLSTRING"; -["GlassesChanged",{ - SETGLASSES(ace_player,GLASSESDEFAULT); +["playerInventoryChanged", { + (_this select 1) params ["", "_currentGlasses"]; + + if (GVAR(OldGlasses) != _currentGlasses) then { + ["GlassesChanged", [ACE_player, _currentGlasses]] call EFUNC(common,localEvent); + GVAR(OldGlasses) = _currentGlasses; + }; +}] call EFUNC(common,addEventHandler); + +// add glasses eventhandlers +["GlassesChanged", { + params ["_unit", "_glasses"]; + + SETGLASSES(_unit,GLASSESDEFAULT); if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; - if ([ace_player] call FUNC(isGogglesVisible)) then { - [_this select 0] call FUNC(applyGlassesEffect); + if ([_unit] call FUNC(isGogglesVisible)) then { + _glasses call FUNC(applyGlassesEffect); } else { call FUNC(removeGlassesEffect); }; }] call EFUNC(common,addEventHandler); -["GlassesCracked",{ - if (_this select 0 != ace_player) exitWith {}; - ace_player setVariable ["ACE_EyesDamaged", true]; - if (GVAR(EyesDamageScript) != -1) then { - [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); - }; - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]]; + +["GlassesCracked", { + params ["_unit"]; + + _unit setVariable ["ACE_EyesDamaged", true]; + + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.5, 0.5, 0.5, 0.5], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 0; GVAR(PostProcessEyes) ppEffectEnable true; - GVAR(EyesDamageScript) = [{ - GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; + + [{ + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 5; + GVAR(EyesDamageScript) = [{ + params ["_unit"]; + GVAR(PostProcessEyes) ppEffectEnable false; - ace_player setVariable ["ACE_EyesDamaged", false]; - GVAR(EyesDamageScript) = -1; - }, [], 5, 1] call EFUNC(common,waitAndExecute); - }, [], 25, 5] call EFUNC(common,waitAndExecute); + + _unit setVariable ["ACE_EyesDamaged", false]; + + }, _this, 5] call EFUNC(common,waitAndExecute); + + }, _unit, 25] call EFUNC(common,waitAndExecute); + }] call EFUNC(common,addEventHandler); -call FUNC(checkGlasses); + + + + + + + [FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler; [FUNC(applyRainEffect), 0.5, []] call CBA_fnc_addPerFrameHandler; [FUNC(onEachFrame), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index b8aedd5e64..655fec2f59 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -31,7 +31,7 @@ if ([_unit] call FUNC(isGogglesVisible)) then { local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt"); if (_dirtImage != "") then { - (QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false]; // @todo init as 100 + (QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false]; (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; }; }; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index 6e89a8df6b..f281af8c3e 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -25,7 +25,7 @@ _unit = ACE_player; if ([_unit] call FUNC(isGogglesVisible)) exitWith { (QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false]; - ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetText format [getText (configFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1]; + ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetText format [getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1]; SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,1)); SETDUST(DBULLETS,0); diff --git a/addons/goggles/functions/fnc_applyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf index a8ccf23633..aa0ecea6af 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -42,7 +42,7 @@ if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { _imagePath = getText (_config >> ["ACE_Overlay", "ACE_OverlayCracked"] select GETBROKEN); if (_imagePath != "") then { - (QGVAR(GogglesLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false]; // @todo init as 150 + (QGVAR(GogglesLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false]; (GLASSDISPLAY displayCtrl 10650) ctrlSetText _imagePath; }; diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index 84b86c3da4..2d10515fc6 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -23,7 +23,7 @@ if (true) then { call FUNC(removeGlassesEffect); }; }; - call FUNC(checkGlasses); + //call FUNC(checkGlasses); if !([ace_player] call FUNC(isGogglesVisible)) exitWith { if (GVAR(EffectsActive)) then { call FUNC(removeGlassesEffect); diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf index e69de29bb2..a47b2f14ba 100644 --- a/addons/goggles/functions/fnc_handleExplosion.sqf +++ b/addons/goggles/functions/fnc_handleExplosion.sqf @@ -0,0 +1,19 @@ +#include "script_component.hpp" + private "_effects"; + if (alive ace_player) then { + call FUNC(applyDirtEffect); + if (GETBROKEN) exitWith {}; + if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; + if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; + _effects = GETGLASSES(ace_player); + _effects set [BROKEN, true]; + SETGLASSES(ace_player,_effects); + if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { + if (call FUNC(ExternalCamera)) exitWith {}; + if (isNull(GLASSDISPLAY)) then { + 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; + }; + (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); + }; + ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); + }; \ No newline at end of file diff --git a/addons/goggles/functions/fnc_handleFired.sqf b/addons/goggles/functions/fnc_handleFired.sqf index e69de29bb2..521418bea4 100644 --- a/addons/goggles/functions/fnc_handleFired.sqf +++ b/addons/goggles/functions/fnc_handleFired.sqf @@ -0,0 +1,2 @@ +#include "script_component.hpp" +[_this select 0, _this select 1] call FUNC(dustHandler); \ No newline at end of file diff --git a/addons/goggles/functions/fnc_handleKilled.sqf b/addons/goggles/functions/fnc_handleKilled.sqf index e69de29bb2..55dd926387 100644 --- a/addons/goggles/functions/fnc_handleKilled.sqf +++ b/addons/goggles/functions/fnc_handleKilled.sqf @@ -0,0 +1,13 @@ +#include "script_component.hpp" + GVAR(PostProcessEyes) ppEffectEnable false; + SETGLASSES(ace_player,GLASSESDEFAULT); + call FUNC(removeGlassesEffect); + GVAR(EffectsActive)=false; + ace_player setVariable ["ACE_EyesDamaged", false]; + if (GVAR(EyesDamageScript) != -1) then { + [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); + }; + if (GVAR(DustHandler) != -1) then { + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; \ No newline at end of file diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf index b3494d1290..d9181373a1 100644 --- a/addons/goggles/functions/fnc_onEachFrame.sqf +++ b/addons/goggles/functions/fnc_onEachFrame.sqf @@ -53,7 +53,7 @@ if !(_safe) then { }; }; }; - _safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1); + _safe = (getNumber (ConfigFile >> "CfgGlasses" >> goggles ace_player >> "ACE_Protection") == 1); }; if (_safe) exitWith {}; if ((_rotorWash select 1) <= 15) then { From ba42e3e29576a2f4791679fd46f9d42231200a3c Mon Sep 17 00:00:00 2001 From: gienkov Date: Tue, 29 Sep 2015 22:12:11 +0200 Subject: [PATCH 250/311] pl string for dragging, tactical ladder --- addons/dragging/stringtable.xml | 1 + addons/tacticalladder/stringtable.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 42bd0ccd02..4535a8e62e 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -52,6 +52,7 @@ Raise/Lower Heben/Senken + Wyżej/Niżej diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index 98e041b1af..b347c4e2d9 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -40,6 +40,7 @@ Extend, +Ctrl tilt Ausfahren, +Strg kippen + Rozłóż, +Ctrl nachyl Position ladder From 8d5ce1dbe248ebca64544b1643afc56db47d91db Mon Sep 17 00:00:00 2001 From: commy2 Date: Tue, 29 Sep 2015 22:24:25 +0200 Subject: [PATCH 251/311] more goggles code cleanup --- addons/goggles/XEH_postInit.sqf | 4 +- addons/goggles/XEH_preInit.sqf | 3 +- .../goggles/functions/fnc_applyDirtEffect.sqf | 2 +- .../goggles/functions/fnc_applyDustEffect.sqf | 4 +- .../functions/fnc_applyGlassesEffect.sqf | 2 +- addons/goggles/functions/fnc_dustHandler.sqf | 88 ------------------- .../goggles/functions/fnc_handleExplosion.sqf | 68 ++++++++++---- addons/goggles/functions/fnc_handleFired.sqf | 88 ++++++++++++++++++- addons/goggles/functions/fnc_handleKilled.sqf | 43 ++++++--- 9 files changed, 175 insertions(+), 127 deletions(-) delete mode 100644 addons/goggles/functions/fnc_dustHandler.sqf diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 5a3c2c875b..cc25c259e9 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -13,8 +13,8 @@ if (!hasInterface) exitWith {}; [20, [true, true, false]], false] call CBA_fnc_addKeybind; // make sure to stack effect layers in correct order -QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer; -QGVAR(GogglesLayer) call BIS_fnc_RSCLayer; +GVAR(GogglesEffectsLayer) = QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer; +GVAR(GogglesLayer) = QGVAR(GogglesLayer) call BIS_fnc_RSCLayer; if (isNil QGVAR(UsePP)) then { GVAR(UsePP) = true; diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf index bb96add89d..deb2aed0fc 100644 --- a/addons/goggles/XEH_preInit.sqf +++ b/addons/goggles/XEH_preInit.sqf @@ -16,12 +16,11 @@ PREP(removeRainEffect); PREP(externalCamera); PREP(isDivingGoggles); PREP(isGogglesVisible); +PREP(isInRotorWash); // general PREP(clearGlasses); -PREP(dustHandler); PREP(getExplosionIndex); -PREP(isInRotorWash); // eventhandlers PREP(handleExplosion); diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index 655fec2f59..b10ebc9668 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -31,7 +31,7 @@ if ([_unit] call FUNC(isGogglesVisible)) then { local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt"); if (_dirtImage != "") then { - (QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false]; + GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false]; (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; }; }; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index f281af8c3e..558a6c674b 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -if (GVAR(showInThirdPerson)) exitWith {false}; +if (GVAR(showInThirdPerson)) exitWith {}; if (call FUNC(ExternalCamera)) exitWith {}; private ["_unit", "_amount"]; @@ -23,7 +23,7 @@ private ["_unit", "_amount"]; _unit = ACE_player; if ([_unit] call FUNC(isGogglesVisible)) exitWith { - (QGVAR(GogglesEffectsLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false]; + GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false]; ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetText format [getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1]; diff --git a/addons/goggles/functions/fnc_applyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf index aa0ecea6af..7be010ef9c 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -42,7 +42,7 @@ if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { _imagePath = getText (_config >> ["ACE_Overlay", "ACE_OverlayCracked"] select GETBROKEN); if (_imagePath != "") then { - (QGVAR(GogglesLayer) call BIS_fnc_RSCLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false]; + GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false]; (GLASSDISPLAY displayCtrl 10650) ctrlSetText _imagePath; }; diff --git a/addons/goggles/functions/fnc_dustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf deleted file mode 100644 index 90260d07b3..0000000000 --- a/addons/goggles/functions/fnc_dustHandler.sqf +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet, commy2 - * Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements. - * - * Arguments: - * 0: Unit - * 1: Weapon - * - * Return Value: - * Function is handled? - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit", "_weapon"]; - -if (_unit != ACE_player) exitWith {true}; - -// no dust in rain -if (rain > 0.1) exitWith {true}; - -// effect only aplies when lying on the ground -if (stance _unit != "PRONE") exitWith {true}; - -private ["_position", "_particleConfig", "_cloudType", "_surface", "_bullets"]; - -// check if the unit really is on the ground and not in a building -_position = getPosATL _unit; - -if (_position select 2 > 0.2) exitWith {true}; - -// get weapon dust effect -_particleConfig = configFile >> "CfgWeapons" >> _weapon >> "GunParticles"; - -_cloudType = ""; - -if (isClass (_particleConfig >> "FirstEffect")) then { // @todo read this with custom / non-standard config classnames - _cloudType = getText (_particleConfig >> "FirstEffect" >> "effectName"); -} else { - if (isClass (_particleConfig >> "effect1")) then { - _cloudType = getText (_particleConfig >> "effect1" >> "effectName"); - }; -}; - -// quit if the weapon causes no dust effect -if (_cloudType == "") exitWith {true}; - -// get if the surface is dusty -if (surfaceIsWater _position) exitWith {true}; - -_surface = surfaceType _position select [1]; // cuts of the leading # - -if (_surface != GVAR(surfaceCache)) then { - GVAR(surfaceCache) = _surface; - GVAR(surfaceCacheIsDust) = getNumber (configFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1; -}; - -// quit if surface isn't dusty -if (!GVAR(surfaceCacheIsDust)) exitWith {true}; - -// increment dust value with type bullet -_bullets = GETDUSTT(DBULLETS); - -if (ACE_diagTime - GETDUSTT(DTIME) > 1) then { - _bullets = 0; -}; - -_bullets = _bullets + 1; - -SETDUST(DBULLETS,_bullets); -SETDUST(DTIME,ACE_diagTime); - -// apply dust effect if the amount of fired bullets is over the threshold -if (GETDUSTT(DAMOUNT) < 2) then { - local _bulletsRequired = 100; - - if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then { - _bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount)); - }; - - if (_bullets > _bulletsRequired) then { - SETDUST(DACTIVE,true); - call FUNC(applyDustEffect); - }; -}; - -true diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf index a47b2f14ba..795cdd78b1 100644 --- a/addons/goggles/functions/fnc_handleExplosion.sqf +++ b/addons/goggles/functions/fnc_handleExplosion.sqf @@ -1,19 +1,51 @@ +/* + * Author: Garth 'L-H' de Wet, commy2 + * Handles explosions. + * + * Arguments: + * 0: Unit + * + * Return Value: + * Function is handled? + * + * Public: No + */ #include "script_component.hpp" - private "_effects"; - if (alive ace_player) then { - call FUNC(applyDirtEffect); - if (GETBROKEN) exitWith {}; - if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; - if !([ace_player] call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; - _effects = GETGLASSES(ace_player); - _effects set [BROKEN, true]; - SETGLASSES(ace_player,_effects); - if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { - if (call FUNC(ExternalCamera)) exitWith {}; - if (isNull(GLASSDISPLAY)) then { - 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; - }; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); - }; - ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); - }; \ No newline at end of file + +params ["_unit"]; + +if (_unit != ACE_player) exitWith {true}; + +call FUNC(applyDirtEffect); + +if (GETBROKEN) exitWith {true}; + +private ["_config", "_effects"]; + +_config = configFile >> "CfgGlasses" >> goggles _unit; + +if ((_this select 1) call FUNC(GetExplosionIndex) < getNumber (_config >> "ACE_Resistance")) exitWith {true}; + +if !([_unit] call FUNC(isGogglesVisible)) exitWith { + ["GlassesCracked", [_unit]] call EFUNC(common,localEvent); + true +}; + +_effects = GETGLASSES(_unit); +_effects set [BROKEN, true]; + +SETGLASSES(_unit,_effects); + +if (getText (_config >> "ACE_OverlayCracked") != "") then { + if (GVAR(showInThirdPerson)) exitWith {}; + if (call FUNC(ExternalCamera)) exitWith {}; + + if (isNull (GLASSDISPLAY)) then { + GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false]; + }; + + (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText (_config >> "ACE_OverlayCracked"); +}; + +["GlassesCracked", [_unit]] call EFUNC(common,localEvent); +true diff --git a/addons/goggles/functions/fnc_handleFired.sqf b/addons/goggles/functions/fnc_handleFired.sqf index 521418bea4..90260d07b3 100644 --- a/addons/goggles/functions/fnc_handleFired.sqf +++ b/addons/goggles/functions/fnc_handleFired.sqf @@ -1,2 +1,88 @@ +/* + * Author: Garth 'L-H' de Wet, commy2 + * Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements. + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * Function is handled? + * + * Public: No + */ #include "script_component.hpp" -[_this select 0, _this select 1] call FUNC(dustHandler); \ No newline at end of file + +params ["_unit", "_weapon"]; + +if (_unit != ACE_player) exitWith {true}; + +// no dust in rain +if (rain > 0.1) exitWith {true}; + +// effect only aplies when lying on the ground +if (stance _unit != "PRONE") exitWith {true}; + +private ["_position", "_particleConfig", "_cloudType", "_surface", "_bullets"]; + +// check if the unit really is on the ground and not in a building +_position = getPosATL _unit; + +if (_position select 2 > 0.2) exitWith {true}; + +// get weapon dust effect +_particleConfig = configFile >> "CfgWeapons" >> _weapon >> "GunParticles"; + +_cloudType = ""; + +if (isClass (_particleConfig >> "FirstEffect")) then { // @todo read this with custom / non-standard config classnames + _cloudType = getText (_particleConfig >> "FirstEffect" >> "effectName"); +} else { + if (isClass (_particleConfig >> "effect1")) then { + _cloudType = getText (_particleConfig >> "effect1" >> "effectName"); + }; +}; + +// quit if the weapon causes no dust effect +if (_cloudType == "") exitWith {true}; + +// get if the surface is dusty +if (surfaceIsWater _position) exitWith {true}; + +_surface = surfaceType _position select [1]; // cuts of the leading # + +if (_surface != GVAR(surfaceCache)) then { + GVAR(surfaceCache) = _surface; + GVAR(surfaceCacheIsDust) = getNumber (configFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1; +}; + +// quit if surface isn't dusty +if (!GVAR(surfaceCacheIsDust)) exitWith {true}; + +// increment dust value with type bullet +_bullets = GETDUSTT(DBULLETS); + +if (ACE_diagTime - GETDUSTT(DTIME) > 1) then { + _bullets = 0; +}; + +_bullets = _bullets + 1; + +SETDUST(DBULLETS,_bullets); +SETDUST(DTIME,ACE_diagTime); + +// apply dust effect if the amount of fired bullets is over the threshold +if (GETDUSTT(DAMOUNT) < 2) then { + local _bulletsRequired = 100; + + if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then { + _bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount)); + }; + + if (_bullets > _bulletsRequired) then { + SETDUST(DACTIVE,true); + call FUNC(applyDustEffect); + }; +}; + +true diff --git a/addons/goggles/functions/fnc_handleKilled.sqf b/addons/goggles/functions/fnc_handleKilled.sqf index 55dd926387..d156fb684c 100644 --- a/addons/goggles/functions/fnc_handleKilled.sqf +++ b/addons/goggles/functions/fnc_handleKilled.sqf @@ -1,13 +1,32 @@ +/* + * Author: Garth 'L-H' de Wet, commy2 + * Handles the player dying. + * + * Arguments: + * 0: Unit + * + * Return Value: + * Function is handled? + * + * Public: No + */ #include "script_component.hpp" - GVAR(PostProcessEyes) ppEffectEnable false; - SETGLASSES(ace_player,GLASSESDEFAULT); - call FUNC(removeGlassesEffect); - GVAR(EffectsActive)=false; - ace_player setVariable ["ACE_EyesDamaged", false]; - if (GVAR(EyesDamageScript) != -1) then { - [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); - }; - if (GVAR(DustHandler) != -1) then { - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; \ No newline at end of file + +params ["_unit"]; + +if (_unit != ACE_player) exitWith {true}; + +GVAR(PostProcessEyes) ppEffectEnable false; + +SETGLASSES(_unit,GLASSESDEFAULT); + +call FUNC(removeGlassesEffect); + +GVAR(EffectsActive) = false; + +_unit setVariable ["ACE_EyesDamaged", false]; + +[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; +GVAR(DustHandler) = -1; + +true From 28240093176767ea2dbc78447670ae2eb80ee6fc Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Tue, 29 Sep 2015 17:00:49 -0400 Subject: [PATCH 252/311] Incorrectly retrieving list of current wounds. Used the wrong method to retrieve the target's current wounds and was getting an empty array. This caused bandaging any wound even once to completely heal the target on the Arma side. --- addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 4a21ffe68b..653e5b7fce 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -102,7 +102,7 @@ if (GVAR(healHitPointAfterAdvBandage)) then { private["_currentWounds", "_headWounds", "_bodyWounds", "_legsWounds", "_armWounds"]; // Get the list of the wounds the target is currently suffering from. - _currentWounds = GETVAR(_target, openWounds, []); + _currentWounds = _target getvariable [QGVAR(openWounds), []]; // Tally of unbandaged wounds to each body part. _headWounds = 0; From 8bbd6b69f0064dbb4c9fdf7fb74248c4006b1dd0 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 30 Sep 2015 00:12:35 +0200 Subject: [PATCH 253/311] change function header of removeEventhandler and waitAndExecute to public: yes --- addons/common/functions/fnc_removeEventHandler.sqf | 2 +- addons/common/functions/fnc_waitAndExecute.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/common/functions/fnc_removeEventHandler.sqf b/addons/common/functions/fnc_removeEventHandler.sqf index c869b3d0cc..0c70046706 100644 --- a/addons/common/functions/fnc_removeEventHandler.sqf +++ b/addons/common/functions/fnc_removeEventHandler.sqf @@ -9,7 +9,7 @@ * Return Value: * None * - * Public: No + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf index c8f078854b..af59e301f7 100644 --- a/addons/common/functions/fnc_waitAndExecute.sqf +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -13,7 +13,7 @@ * Example: * [{(_this select 0) setVelocity [0,0,200];}, [player], 10] call ace_common_fnc_waitAndExecute * - * Public: No + * Public: Yes */ #include "script_component.hpp" From 9f3615ea0651df08fb1702a9a8b10ea65cc15368 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 30 Sep 2015 00:14:21 +0200 Subject: [PATCH 254/311] change function header of removeEventhandler and waitAndExecute to public: yes --- addons/common/functions/fnc_removeEventHandler.sqf | 2 +- addons/common/functions/fnc_waitAndExecute.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/common/functions/fnc_removeEventHandler.sqf b/addons/common/functions/fnc_removeEventHandler.sqf index c869b3d0cc..0c70046706 100644 --- a/addons/common/functions/fnc_removeEventHandler.sqf +++ b/addons/common/functions/fnc_removeEventHandler.sqf @@ -9,7 +9,7 @@ * Return Value: * None * - * Public: No + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf index c8f078854b..af59e301f7 100644 --- a/addons/common/functions/fnc_waitAndExecute.sqf +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -13,7 +13,7 @@ * Example: * [{(_this select 0) setVelocity [0,0,200];}, [player], 10] call ace_common_fnc_waitAndExecute * - * Public: No + * Public: Yes */ #include "script_component.hpp" From dc882a3c6675b4409efd89e6da529025a21385b7 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 30 Sep 2015 01:26:08 +0200 Subject: [PATCH 255/311] more goggles code cleanup --- addons/goggles/XEH_postInit.sqf | 36 ++++-- addons/goggles/XEH_preInit.sqf | 8 +- .../goggles/functions/fnc_applyDustEffect.sqf | 12 +- .../functions/fnc_applyRotorWashEffect.sqf | 108 ++++++++++++++++++ addons/goggles/functions/fnc_checkGoggles.sqf | 46 -------- addons/goggles/functions/fnc_onEachFrame.sqf | 78 ------------- 6 files changed, 146 insertions(+), 142 deletions(-) create mode 100644 addons/goggles/functions/fnc_applyRotorWashEffect.sqf delete mode 100644 addons/goggles/functions/fnc_checkGoggles.sqf delete mode 100644 addons/goggles/functions/fnc_onEachFrame.sqf diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index cc25c259e9..4958c8e02b 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -31,9 +31,8 @@ GVAR(EffectsActive) = false; SETGLASSES(ace_player,GLASSESDEFAULT); -GVAR(Current) = "None"; GVAR(EyesDamageScript) = -1; -GVAR(FrameEvent) = [false, [false,20]]; +GVAR(FrameEvent) = [false, [false, 20]]; GVAR(PostProcessEyes_Enabled) = false; GVAR(DustHandler) = -1; GVAR(RainDrops) = objNull; @@ -42,7 +41,6 @@ GVAR(RainLastLevel) = 0; GVAR(surfaceCache) = ""; GVAR(surfaceCacheIsDust) = false; - // init GlassesChanged eventhandler GVAR(OldGlasses) = "#NULLSTRING"; @@ -96,12 +94,36 @@ GVAR(OldGlasses) = "#NULLSTRING"; }] call EFUNC(common,addEventHandler); +// check goggles +local _fnc_checkGoggles = { + params ["_unit"]; + if (GVAR(EffectsActive)) then { + if (call FUNC(externalCamera) || {!([_unit] call FUNC(isGogglesVisible))}) then { + call FUNC(removeGlassesEffect); + }; + } else { + if (!(call FUNC(externalCamera)) && {[_unit] call FUNC(isGogglesVisible)}) then { + [goggles _unit] call FUNC(applyGlassesEffect); + }; + }; +}; +["cameraViewChanged", _fnc_checkGoggles] call EFUNC(common,addEventHandler); +["activeCameraChanged", _fnc_checkGoggles] call EFUNC(common,addEventHandler); +// goggles effects main PFH +[{ + // rain + call FUNC(applyRainEffect); + // auto remove effects under water + if (GVAR(EffectsActive) && {[goggles ACE_player] call FUNC(isDivingGoggles) && {underwater ACE_player}}) then { + call FUNC(removeRainEffect); + call FUNC(removeDirtEffect); + call FUNC(removeDustEffect); + }; - -[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler; -[FUNC(applyRainEffect), 0.5, []] call CBA_fnc_addPerFrameHandler; -[FUNC(onEachFrame), 0, []] call CBA_fnc_addPerFrameHandler; + // rotor wash effect + call FUNC(applyRotorWashEffect) +}, 0.5, _fnc_checkGoggles] call CBA_fnc_addPerFrameHandler; diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf index deb2aed0fc..ba5fa2373e 100644 --- a/addons/goggles/XEH_preInit.sqf +++ b/addons/goggles/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(applyDirtEffect); PREP(applyDustEffect); PREP(applyGlassesEffect); PREP(applyRainEffect); +PREP(applyRotorWashEffect); PREP(removeDirtEffect); PREP(removeDustEffect); PREP(removeGlassesEffect); @@ -27,11 +28,4 @@ PREP(handleExplosion); PREP(handleFired); PREP(handleKilled); - - -PREP(checkGoggles); -PREP(onEachFrame); - - - ADDON = true; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index 558a6c674b..b052f3eae7 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -62,13 +62,17 @@ GVAR(DustHandler) = [{ }; if (GETDUSTT(DAMOUNT) <= 0) then { + SETDUST(DACTIVE,false); + SETDUST(DBULLETS,0); + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [1, 1, 1, 0]]; GVAR(PostProcessEyes) ppEffectCommit 2; - [{GVAR(PostProcessEyes) ppEffectEnable false}, [], 2] call EFUNC(common,waitAndExecute); - - SETDUST(DACTIVE,false); - SETDUST(DBULLETS,0); + [{ + if (GVAR(DustHandler) == -1) then { + GVAR(PostProcessEyes) ppEffectEnable false + }; + }, [], 2] call EFUNC(common,waitAndExecute); [GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; GVAR(DustHandler) = -1; diff --git a/addons/goggles/functions/fnc_applyRotorWashEffect.sqf b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf new file mode 100644 index 0000000000..7dc088bc4e --- /dev/null +++ b/addons/goggles/functions/fnc_applyRotorWashEffect.sqf @@ -0,0 +1,108 @@ +/* + * Author: Garth 'L-H' de Wet, commy2 + * Handles the rotor wash effects. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_goggles_fnc_applyRotorWashEffect; + * + * Public: No + */ +#include "script_component.hpp" + +private ["_unit", "_fnc_underCover"]; + +_unit = ACE_player; + +if (!alive _unit) exitWith {}; + +// idk. chaching magic? ends with isInRotorWash check. +GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; + +if (GVAR(FrameEvent) select 0) exitWith { + if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith { + (GVAR(FrameEvent) select 1) set [0, false]; + }; + + GVAR(FrameEvent) set [1, ([_unit] call FUNC(isInRotorWash))]; +}; + +// check if the unit is affected by rotor wash +private ["_rotorWash", "_safe"]; + +_rotorWash = GVAR(FrameEvent) select 1; +_safe = false; + +// no rotor wash? remove effects. +if !(_rotorWash select 0) exitWith { + if (GVAR(PostProcessEyes_Enabled)) then { + GVAR(PostProcessEyes_Enabled) = false; + + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [1, 1, 1, 0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + + [{ + if (GVAR(DustHandler) == -1) then { + GVAR(PostProcessEyes) ppEffectEnable false; + } + }, [], 2] call EFUNC(common,waitAndExecute); + + [GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; + GVAR(DustHandler) = -1; + }; +}; + +// check protection of helmet +if (headgear _unit != "") then { + _safe = getNumber (configFile >> "CfgWeapons" >> headgear _unit >> "ACE_Protection") == 1; +}; + +// check protection of goggles +if !(_safe) then { + if !([_unit] call FUNC(isGogglesVisible)) exitWith {}; + + if (GETDUSTT(DAMOUNT) < 2) then { + if !(GETDUSTT(DACTIVE)) then { + SETDUST(DACTIVE,true); + + call FUNC(applyDustEffect); + } else { + if (_rotorWash select 1 > 0.5) then { + call FUNC(applyDustEffect); + }; + }; + }; + + _safe = getNumber (ConfigFile >> "CfgGlasses" >> goggles _unit >> "ACE_Protection") == 1; +}; + +// quit if protected by goggles or helmet +if (_safe) exitWith {}; + +// apply rotor wash effect +if (_rotorWash select 1 > 0) then { + local _scale = 0.7; + + if (_rotorWash select 1 > 0) then { + _scale = CLAMP(0.3 * (_rotorWash select 1),0.1,0.3); + } else { + _scale = 0.1; + }; + + _scale = 1 - _scale; + + [GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler; + GVAR(DustHandler) = -1; + + if !(_unit getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes_Enabled) = true; + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_scale, _scale, _scale, _scale], [1, 1, 1, 0]]; + GVAR(PostProcessEyes) ppEffectCommit 0.5; + GVAR(PostProcessEyes) ppEffectEnable true; + }; +}; diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf deleted file mode 100644 index 2d10515fc6..0000000000 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Performs rain checks and checks to see whether glasses effects have been applied or not. - * Checks for external camera and removes effects. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * None - * - * Public: No - */ -#include "script_component.hpp" -if (!alive ace_player) exitWith {}; -if (true) then { - // Detect if curator interface is open and disable effects - if !(isNull curatorCamera) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - //call FUNC(checkGlasses); - if !([ace_player] call FUNC(isGogglesVisible)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - if (call FUNC(externalCamera)) exitWith { - if (GVAR(EffectsActive)) then { - call FUNC(removeGlassesEffect); - }; - }; - if !(GVAR(EffectsActive)) then { - [goggles ace_player] call FUNC(applyGlassesEffect); - } else { - if ([goggles ace_player] call FUNC(isDivingGoggles) && {underwater ace_player}) then { - call FUNC(removeRainEffect); - call FUNC(removeDirtEffect); - call FUNC(removeDustEffect); - }; - }; -}; diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf deleted file mode 100644 index d9181373a1..0000000000 --- a/addons/goggles/functions/fnc_onEachFrame.sqf +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Checks whether the player is in the downwash of a helicopter and handles applying effects of that. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * ["ACE_Goggles_RotorWash", "OnEachFrame", "call ace_goggles_fnc_OnEachFrame;"] call BIS_fnc_addStackedEventHandler; - * - * Public: No - */ -#include "script_component.hpp" -if (isNull(ace_player)) exitWith {}; -GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; -if (GVAR(FrameEvent) select 0) exitWith { - if (vehicle ace_player != ace_player && {!isTurnedOut ACE_player}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; - GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; -}; -private ["_rotorWash","_safe"]; -_rotorWash = GVAR(FrameEvent) select 1; -_safe = false; -if !(_rotorWash select 0) exitWith { - if (GVAR(PostProcessEyes_Enabled)) then { - GVAR(PostProcessEyes_Enabled) = false; - if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 2; - GVAR(DustHandler) = [{ - GVAR(PostProcessEyes) ppEffectEnable false; - GVAR(DustHandler) = -1; - }, [], 2, 0.5] call EFUNC(common,waitAndExecute); - }; -}; -if ((headgear ace_player) != "") then { - _safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1); -}; -if !(_safe) then { - if !([ace_player] call FUNC(isGogglesVisible)) exitWith{}; - if (GETDUSTT(DAMOUNT) < 2) then { - if (!GETDUSTT(DACTIVE)) then { - SETDUST(DACTIVE,true); - call FUNC(applyDustEffect); - } else { - if ((_rotorWash select 1) > 0.5) then { - call FUNC(applyDustEffect); - }; - }; - }; - _safe = (getNumber (ConfigFile >> "CfgGlasses" >> goggles ace_player >> "ACE_Protection") == 1); -}; -if (_safe) exitWith {}; -if ((_rotorWash select 1) <= 15) then { - private "_scale"; - _scale = 0.7; - if ((_rotorWash select 1) != 0) then { - _scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3); - } else { - _scale = 0.1; - }; - _scale = 1 - _scale; - if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA - [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); - GVAR(DustHandler) = -1; - }; - if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { - GVAR(PostProcessEyes_Enabled) = true; - GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]]; - GVAR(PostProcessEyes) ppEffectCommit 0.5; - GVAR(PostProcessEyes) ppEffectEnable true; - }; -}; From 945ec7a38858a03287d0944f24ed22ff8927bdbb Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 30 Sep 2015 01:31:45 +0200 Subject: [PATCH 256/311] more goggles code cleanup --- addons/goggles/anim/model.cfg | 261 +++++++++++++++++----------------- 1 file changed, 133 insertions(+), 128 deletions(-) diff --git a/addons/goggles/anim/model.cfg b/addons/goggles/anim/model.cfg index 00ce647aa7..da614e05db 100644 --- a/addons/goggles/anim/model.cfg +++ b/addons/goggles/anim/model.cfg @@ -1,128 +1,133 @@ -class CfgSkeletons -{ - class Default - { - isDiscrete = 1; - skeletonInherit = ""; - skeletonBones[] = {}; - }; - class OFP2_ManSkeleton - { - isDiscrete = 0; - skeletonInherit = ""; - skeletonBones[] = - { - "Pelvis","", - "Spine","Pelvis", - "Spine1","Spine", - "Spine2","Spine1", - "Spine3","Spine2", - "Camera","Pelvis", - "weapon","Spine1", - "launcher","Spine1", - //Head skeleton in hierarchy - "neck","Spine3", - "neck1","neck", - "head","neck1", - //New facial features - "Face_Hub","head", - "Face_Jawbone","Face_Hub", - "Face_Jowl","Face_Jawbone", - "Face_chopRight","Face_Jawbone", - "Face_chopLeft","Face_Jawbone", - "Face_LipLowerMiddle","Face_Jawbone", - "Face_LipLowerLeft","Face_Jawbone", - "Face_LipLowerRight","Face_Jawbone", - "Face_Chin","Face_Jawbone", - "Face_Tongue","Face_Jawbone", - "Face_CornerRight","Face_Hub", - "Face_CheekSideRight","Face_CornerRight", - "Face_CornerLeft","Face_Hub", - "Face_CheekSideLeft","Face_CornerLeft", - "Face_CheekFrontRight","Face_Hub", - "Face_CheekFrontLeft","Face_Hub", - "Face_CheekUpperRight","Face_Hub", - "Face_CheekUpperLeft","Face_Hub", - "Face_LipUpperMiddle","Face_Hub", - "Face_LipUpperRight","Face_Hub", - "Face_LipUpperLeft","Face_Hub", - "Face_NostrilRight","Face_Hub", - "Face_NostrilLeft","Face_Hub", - "Face_Forehead","Face_Hub", - "Face_BrowFrontRight","Face_Forehead", - "Face_BrowFrontLeft","Face_Forehead", - "Face_BrowMiddle","Face_Forehead", - "Face_BrowSideRight","Face_Forehead", - "Face_BrowSideLeft","Face_Forehead", - "Face_Eyelids","Face_Hub", - "Face_EyelidUpperRight","Face_Hub", - "Face_EyelidUpperLeft","Face_Hub", - "Face_EyelidLowerRight","Face_Hub", - "Face_EyelidLowerLeft","Face_Hub", - "EyeLeft","Face_Hub", - "EyeRight","Face_Hub", - //Left upper side - "LeftShoulder","Spine3", - "LeftArm","LeftShoulder", - "LeftArmRoll","LeftArm", - "LeftForeArm","LeftArmRoll", - "LeftForeArmRoll","LeftForeArm", - "LeftHand","LeftForeArmRoll", - "LeftHandRing","LeftHand", - "LeftHandRing1","LeftHandRing", - "LeftHandRing2","LeftHandRing1", - "LeftHandRing3","LeftHandRing2", - "LeftHandPinky1","LeftHandRing", - "LeftHandPinky2","LeftHandPinky1", - "LeftHandPinky3","LeftHandPinky2", - "LeftHandMiddle1","LeftHand", - "LeftHandMiddle2","LeftHandMiddle1", - "LeftHandMiddle3","LeftHandMiddle2", - "LeftHandIndex1","LeftHand", - "LeftHandIndex2","LeftHandIndex1", - "LeftHandIndex3","LeftHandIndex2", - "LeftHandThumb1","LeftHand", - "LeftHandThumb2","LeftHandThumb1", - "LeftHandThumb3","LeftHandThumb2", - //Right upper side - "RightShoulder","Spine3", - "RightArm","RightShoulder", - "RightArmRoll","RightArm", - "RightForeArm","RightArmRoll", - "RightForeArmRoll","RightForeArm", - "RightHand","RightForeArmRoll", - "RightHandRing","RightHand", - "RightHandRing1","RightHandRing", - "RightHandRing2","RightHandRing1", - "RightHandRing3","RightHandRing2", - "RightHandPinky1","RightHandRing", - "RightHandPinky2","RightHandPinky1", - "RightHandPinky3","RightHandPinky2", - "RightHandMiddle1","RightHand", - "RightHandMiddle2","RightHandMiddle1", - "RightHandMiddle3","RightHandMiddle2", - "RightHandIndex1","RightHand", - "RightHandIndex2","RightHandIndex1", - "RightHandIndex3","RightHandIndex2", - "RightHandThumb1","RightHand", - "RightHandThumb2","RightHandThumb1", - "RightHandThumb3","RightHandThumb2", - //Left lower side - "LeftUpLeg","Pelvis", - "LeftUpLegRoll","LeftUpLeg", - "LeftLeg","LeftUpLegRoll", - "LeftLegRoll","LeftLeg", - "LeftFoot","LeftLegRoll", - "LeftToeBase","LeftFoot", - //Right lower side - "RightUpLeg","Pelvis", - "RightUpLegRoll","RightUpLeg", - "RightLeg","RightUpLegRoll", - "RightLegRoll","RightLeg", - "RightFoot","RightLegRoll", - "RightToeBase","RightFoot" - }; - // location of pivot points (local axes) for hierarchical animation - pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d"; - }; -}; \ No newline at end of file + +class CfgSkeletons { + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + + class OFP2_ManSkeleton { + isDiscrete = 0; + skeletonInherit = ""; + skeletonBones[] = { + "Pelvis","", + "Spine","Pelvis", + "Spine1","Spine", + "Spine2","Spine1", + "Spine3","Spine2", + "Camera","Pelvis", + "weapon","Spine1", + "launcher","Spine1", + + //Head skeleton in hierarchy + "neck","Spine3", + "neck1","neck", + "head","neck1", + + //New facial features + "Face_Hub","head", + "Face_Jawbone","Face_Hub", + "Face_Jowl","Face_Jawbone", + "Face_chopRight","Face_Jawbone", + "Face_chopLeft","Face_Jawbone", + "Face_LipLowerMiddle","Face_Jawbone", + "Face_LipLowerLeft","Face_Jawbone", + "Face_LipLowerRight","Face_Jawbone", + "Face_Chin","Face_Jawbone", + "Face_Tongue","Face_Jawbone", + "Face_CornerRight","Face_Hub", + "Face_CheekSideRight","Face_CornerRight", + "Face_CornerLeft","Face_Hub", + "Face_CheekSideLeft","Face_CornerLeft", + "Face_CheekFrontRight","Face_Hub", + "Face_CheekFrontLeft","Face_Hub", + "Face_CheekUpperRight","Face_Hub", + "Face_CheekUpperLeft","Face_Hub", + "Face_LipUpperMiddle","Face_Hub", + "Face_LipUpperRight","Face_Hub", + "Face_LipUpperLeft","Face_Hub", + "Face_NostrilRight","Face_Hub", + "Face_NostrilLeft","Face_Hub", + "Face_Forehead","Face_Hub", + "Face_BrowFrontRight","Face_Forehead", + "Face_BrowFrontLeft","Face_Forehead", + "Face_BrowMiddle","Face_Forehead", + "Face_BrowSideRight","Face_Forehead", + "Face_BrowSideLeft","Face_Forehead", + "Face_Eyelids","Face_Hub", + "Face_EyelidUpperRight","Face_Hub", + "Face_EyelidUpperLeft","Face_Hub", + "Face_EyelidLowerRight","Face_Hub", + "Face_EyelidLowerLeft","Face_Hub", + "EyeLeft","Face_Hub", + "EyeRight","Face_Hub", + + //Left upper side + "LeftShoulder","Spine3", + "LeftArm","LeftShoulder", + "LeftArmRoll","LeftArm", + "LeftForeArm","LeftArmRoll", + "LeftForeArmRoll","LeftForeArm", + "LeftHand","LeftForeArmRoll", + "LeftHandRing","LeftHand", + "LeftHandRing1","LeftHandRing", + "LeftHandRing2","LeftHandRing1", + "LeftHandRing3","LeftHandRing2", + "LeftHandPinky1","LeftHandRing", + "LeftHandPinky2","LeftHandPinky1", + "LeftHandPinky3","LeftHandPinky2", + "LeftHandMiddle1","LeftHand", + "LeftHandMiddle2","LeftHandMiddle1", + "LeftHandMiddle3","LeftHandMiddle2", + "LeftHandIndex1","LeftHand", + "LeftHandIndex2","LeftHandIndex1", + "LeftHandIndex3","LeftHandIndex2", + "LeftHandThumb1","LeftHand", + "LeftHandThumb2","LeftHandThumb1", + "LeftHandThumb3","LeftHandThumb2", + + //Right upper side + "RightShoulder","Spine3", + "RightArm","RightShoulder", + "RightArmRoll","RightArm", + "RightForeArm","RightArmRoll", + "RightForeArmRoll","RightForeArm", + "RightHand","RightForeArmRoll", + "RightHandRing","RightHand", + "RightHandRing1","RightHandRing", + "RightHandRing2","RightHandRing1", + "RightHandRing3","RightHandRing2", + "RightHandPinky1","RightHandRing", + "RightHandPinky2","RightHandPinky1", + "RightHandPinky3","RightHandPinky2", + "RightHandMiddle1","RightHand", + "RightHandMiddle2","RightHandMiddle1", + "RightHandMiddle3","RightHandMiddle2", + "RightHandIndex1","RightHand", + "RightHandIndex2","RightHandIndex1", + "RightHandIndex3","RightHandIndex2", + "RightHandThumb1","RightHand", + "RightHandThumb2","RightHandThumb1", + "RightHandThumb3","RightHandThumb2", + + //Left lower side + "LeftUpLeg","Pelvis", + "LeftUpLegRoll","LeftUpLeg", + "LeftLeg","LeftUpLegRoll", + "LeftLegRoll","LeftLeg", + "LeftFoot","LeftLegRoll", + "LeftToeBase","LeftFoot", + + //Right lower side + "RightUpLeg","Pelvis", + "RightUpLegRoll","RightUpLeg", + "RightLeg","RightUpLegRoll", + "RightLegRoll","RightLeg", + "RightFoot","RightLegRoll", + "RightToeBase","RightFoot" + }; + + // location of pivot points (local axes) for hierarchical animation + pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d"; + }; +}; From f69f4066e97b5bf2c846c017fcb620a8eac60255 Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Wed, 30 Sep 2015 06:17:54 -0400 Subject: [PATCH 257/311] Fix capitalization on forEach and getVariable. --- .../medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 653e5b7fce..e98df21b03 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -102,7 +102,7 @@ if (GVAR(healHitPointAfterAdvBandage)) then { private["_currentWounds", "_headWounds", "_bodyWounds", "_legsWounds", "_armWounds"]; // Get the list of the wounds the target is currently suffering from. - _currentWounds = _target getvariable [QGVAR(openWounds), []]; + _currentWounds = _target getVariable [QGVAR(openWounds), []]; // Tally of unbandaged wounds to each body part. _headWounds = 0; @@ -143,7 +143,7 @@ if (GVAR(healHitPointAfterAdvBandage)) then { if (_bodyPart == 5 && {(_numOpenWounds * _bloodLoss) > 0}) then { _legsWounds = _legsWounds + 1; }; - } foreach _currentWounds; + } forEach _currentWounds; // Any body part that has no wounds is healed to full health if (_headWounds == 0) then { From 1fdedb5785073f1f9507d331611035318e9e9fa2 Mon Sep 17 00:00:00 2001 From: commy2 Date: Wed, 30 Sep 2015 19:29:17 +0200 Subject: [PATCH 258/311] delay scroll wheel init --- addons/common/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 87dc71deb2..4bd58ade33 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -224,8 +224,8 @@ call FUNC(assignedItemFix); GVAR(ScrollWheelFrame) = diag_frameno; ["mainDisplayLoaded", { - call FUNC(handleScrollWheelInit); [{ + call FUNC(handleScrollWheelInit); call FUNC(handleModifierKeyInit); }, [], 0.1] call FUNC(waitAndExecute); // needs delay, otherwise doesn't work without pressing "RESTART" in editor once. Tested in 1.52RC }] call FUNC(addEventHandler); From 88ee846d7d6e48bb80482af3e51902e1b80d5b5e Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Thu, 1 Oct 2015 01:36:27 +0200 Subject: [PATCH 259/311] Update Stringtable, german: "captives" --- addons/captives/stringtable.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 864fa7c437..ed66fb7cf2 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -99,7 +99,7 @@ Cable ties that allow you to restrain prisoners. - Kabelbinder ermöglichen es, Gefangene zu fesseln. + Mit Kabelbindern können Personen gefesselt werden. Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia. Los precintos permiten maniatar prisioneros Les Serflex permettent de menotter les prisonniers. @@ -206,7 +206,7 @@ Skuwanie sojuszników Se puede esposar el bando propio Může spoutat spolubojovníky - Kann Teamkollegen fesseln + Kann Kameraden fesseln Pode algemar o próprio lado Peut libérer sa propre faction Saját oldal megbilincselhető @@ -217,7 +217,7 @@ Czy gracze mogą skuwać sojuszników? Pueden los jugadores esposar unidades en su propio bando Mohou hráči spoutat jednotky na své straně - Können Spieler eigene Einheiten fesseln + Spieler können eigene Einheiten fesseln. Os jogadores podem algemar unidades do seu lado Les joueurs peuvent utiliser les Serflex sur leur propre camp A játékosok megkötözhetik-e a saját oldalukon lévő egységeket @@ -239,7 +239,7 @@ Gracze mogą skapitulować po schowaniu swojej broni do kabury Los jugadores pueden rendirse después de enfundar su arma Hráč se může vzdát poté, co si skryje zbraň - Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben + Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben. Jogadores podem se render depois de guardar sua arma Les joueurs peuvent se rendre après avoir rangé leur arme A játékosok megadhatják magukat a fegyverük elrakása után @@ -247,6 +247,7 @@ Require surrendering + Benötigt Kapitulation Wymagaj kapitulacji Requer rendição Требовать пленения @@ -254,6 +255,7 @@ Require Players to surrender before they can be arrested + Spieler müssen zunächst kapitulieren bevor sie gefangen genommen werden können. Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować Requer que jogadores se rendam antes de poderem ser presos Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать @@ -261,6 +263,7 @@ Surrendering only + Nur Kapitulieren. Tylko kapitulacja Somente rendição Только сдавшийся в плен @@ -268,6 +271,7 @@ Surrendering or No weapon + Kapitulieren oder keine Waffe. Kapitulacja lub brak broni Rendição ou desarmado Сдавшийся или безоружный From 0a788a282e2d702634deebccf2eee45df0604381 Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Wed, 30 Sep 2015 20:27:40 -0400 Subject: [PATCH 260/311] Improved efficiency of wound counting. Using a switch/case conditional since it offers early termination if a matching condition is found before all conditions are checked. It also unnecessary to use a conditional to confirm whether a limb is wounded or not. Number of Wounds multiplied by Blood loss will return zero for a fully bandaged body part, not incrementing the wound counter; or it will return some other number which will increment the wound counter. --- .../fnc_treatmentAdvanced_bandageLocal.sqf | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index e98df21b03..cb6be534ed 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -114,34 +114,40 @@ if (GVAR(healHitPointAfterAdvBandage)) then { { _x params ["", "", "_bodyPart", "_numOpenWounds", "_bloodLoss"]; - // Head - if (_bodyPart == 0 && {(_numOpenWounds * _bloodLoss) > 0}) then { - _headWounds = _headWounds + 1; - }; + // Use switch/case for early termination if wounded limb is found before all six are checked. + // Multiplying wounds by blood loss will either increment the wound count by + // some number (only care if greater than zero) or it will return zero indicating + // the body part is still undamaged. + switch (_bodyPart) do { + // Head + case 0: { + _headWounds = _headWounds + (_numOpenWounds * _bloodLoss); + }; - // Body - if (_bodyPart == 1 && {(_numOpenWounds * _bloodLoss) > 0}) then { - _bodyWounds = _bodyWounds + 1; - }; + // Body + case 1: { + _bodyWounds = _bodyWounds + (_numOpenWounds * _bloodLoss); + }; - // Left Arm - if (_bodyPart == 2 && {(_numOpenWounds * _bloodLoss) > 0}) then { - _armWounds = _armWounds + 1; - }; + // Left Arm + case 2: { + _armWounds = _armWounds + (_numOpenWounds * _bloodLoss); + }; - // Right Arm - if (_bodyPart == 3 && {(_numOpenWounds * _bloodLoss) > 0}) then { - _armWounds = _armWounds + 1; - }; + // Right Arm + case 3: { + _armWounds = _armWounds + (_numOpenWounds * _bloodLoss); + }; - // Left Leg - if (_bodyPart == 4 && {(_numOpenWounds * _bloodLoss) > 0}) then { - _legsWounds = _legsWounds + 1; - }; + // Left Leg + case 4: { + _legsWounds = _legsWounds + (_numOpenWounds * _bloodLoss); + }; - // Right Leg - if (_bodyPart == 5 && {(_numOpenWounds * _bloodLoss) > 0}) then { - _legsWounds = _legsWounds + 1; + // Right Leg + case 5: { + _legsWounds = _legsWounds + (_numOpenWounds * _bloodLoss); + }; }; } forEach _currentWounds; From f9352de48906ed7aca659eb524f9faf4db7cf9d5 Mon Sep 17 00:00:00 2001 From: Derek Sauer Date: Wed, 30 Sep 2015 20:34:51 -0400 Subject: [PATCH 261/311] Clarified comment slightly. --- .../functions/fnc_treatmentAdvanced_bandageLocal.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index cb6be534ed..2ef1174e63 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -115,9 +115,9 @@ if (GVAR(healHitPointAfterAdvBandage)) then { _x params ["", "", "_bodyPart", "_numOpenWounds", "_bloodLoss"]; // Use switch/case for early termination if wounded limb is found before all six are checked. - // Multiplying wounds by blood loss will either increment the wound count by - // some number (only care if greater than zero) or it will return zero indicating - // the body part is still undamaged. + // Number of wounds multiplied by blood loss will return zero for a fully + // bandaged body part, not incrementing the wound counter; or it will return + // some other number which will increment the wound counter. switch (_bodyPart) do { // Head case 0: { From 66e89143603ed362c54766898063f94d9cc01891 Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Thu, 1 Oct 2015 04:38:21 +0200 Subject: [PATCH 262/311] Update stringtable.xml --- addons/captives/stringtable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index ed66fb7cf2..0e1714d225 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -99,7 +99,7 @@ Cable ties that allow you to restrain prisoners. - Mit Kabelbindern können Personen gefesselt werden. + Mit Kabelbindern können Gefangene gefesselt werden. Opaska zaciskowa pozwala na skrępowanie dłoni u więźnia. Los precintos permiten maniatar prisioneros Les Serflex permettent de menotter les prisonniers. From 7f1f56c121b569505accbb981a8410246e0b86df Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 1 Oct 2015 21:28:00 +0200 Subject: [PATCH 263/311] fix broken time format for rallypoints, fix #2662 --- addons/respawn/functions/fnc_moveRallypoint.sqf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index bf96905343..89e5815a69 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -41,12 +41,18 @@ _position set [2, 0]; [localize LSTRING(Deploy)] call EFUNC(common,displayTextStructured); [{ - params ["_rallypoint", "_unit", "_position"]; + params ["_rallypoint", "_unit", "_position", "_minutes"]; _rallypoint setPosATL _position; _unit reveal _rallypoint; - _rallypoint setVariable [QGVAR(markerDate), format ["%1:%2", date select 3, date select 4], true]; + // fix leading zero + _minutes = date select 4; + if (_minutes < 10) then { + _minutes = format ["0%1", _minutes]; + }; + + _rallypoint setVariable [QGVAR(markerDate), format ["%1:%2", date select 3, _minutes], true]; ["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent); From 94eaeb38cc1588c169ce3374278576222c988901 Mon Sep 17 00:00:00 2001 From: commy2 Date: Thu, 1 Oct 2015 21:34:40 +0200 Subject: [PATCH 264/311] move variable out of params --- addons/respawn/functions/fnc_moveRallypoint.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index 89e5815a69..b34b69b617 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -41,13 +41,13 @@ _position set [2, 0]; [localize LSTRING(Deploy)] call EFUNC(common,displayTextStructured); [{ - params ["_rallypoint", "_unit", "_position", "_minutes"]; + params ["_rallypoint", "_unit", "_position"]; _rallypoint setPosATL _position; _unit reveal _rallypoint; // fix leading zero - _minutes = date select 4; + local _minutes = date select 4; if (_minutes < 10) then { _minutes = format ["0%1", _minutes]; }; From 4d867cb4f78470995be722d1f82ef0210746c32f Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Sat, 3 Oct 2015 04:36:38 +0200 Subject: [PATCH 265/311] Update README_DE.md --- docs/README_DE.md | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index 9921bf3fc6..e80c5e48da 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -29,16 +29,40 @@ Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc. .Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am medizinischem System), sodass eine individuelle Erfahrung gewährleistet wird. -### Features -- Verbessertes medizinisches System -- Logistik System: U.a. Transport und Fahrzeugreparatur -- Sprengstoffsystem mit unterschiedlichen Zündern +### Hauptmerkmale +- Vollkommen neues 3D Interaktionssystem +- Leistungs- und stabilitätsoptimiert +- Hauptmerkmal auf Modularität und individuelle Anpassungsmöglichkeiten +- Neue, flexible Spieler- und Servereinstellungen +- Verbessertes Sanitätssystem mit unterschiedlichen Stufen (Basis/Erweitert) Spielbarkeit/Realismus +- Echte und stetige Wettersynchronisation +- Ballistik basierend auf vielen Faktoren u.a. Wetter und Wind - Gefangenensystem -- Reale Namen für Arma 3 Fahrzeuge und Waffen -- Realistisches, ballistisches Verhalten (Wind und Luftfeuchtigkeit) -- Simulation der Rückstrahlzone -- Ein Feuerleitsystem für gepanzerte Fahrzeuge und Hubschrauber -***und noch viel mehr...*** +- Sprengtoffmechaniken mit den unterschiedlichsten Auslösern +- Kartenverbesserungen – Setzen von Markierungen ; Kartenwerkzeuge +- Erweitertes Raketenlenksystem + +#### Weitere Mechaniken +- Tragen und Ziehen +- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder in der echten Welt +- Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer +- Realistische Ballistik/Feuerleitsystem werdeb in C/C++ Erweiterungen berechnet +- Rückstrahlzonen- und Überdrucksimulation +- Einwegwaffen +- Realistische G-Kräfte +- Fahrzeuge abschließen +- Realistische Nacht- und Thermalsicht +- Magazin umpacken +- Realistische Waffen Er- bzw. Überhitzung +- Temporäre Taubheit bei zu lauten Geräuschen +- Verbesserte Ragdollphysik +- Verbesserte Interaktionen für AARs und Munitionsschlepper +- Einstellbare Zielfernrohre +- Keine Ruheanimationen bei gesenkter Waffe +- No talking player avatar +- Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen +- Vector IV, MicroDAGR und Kestrel
+***und noch viel viel mehr...*** #### Anleitungen Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert und wo sich was befindet? From 978d00211284dbd978bbfbbabbdfdd36751acf9a Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Sat, 3 Oct 2015 04:37:28 +0200 Subject: [PATCH 266/311] Update README_DE.md --- docs/README_DE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index e80c5e48da..c716f0fa22 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -38,7 +38,7 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod - Echte und stetige Wettersynchronisation - Ballistik basierend auf vielen Faktoren u.a. Wetter und Wind - Gefangenensystem -- Sprengtoffmechaniken mit den unterschiedlichsten Auslösern +- Sprengtoffmechaniken mit den unterschiedlichsten Zündern - Kartenverbesserungen – Setzen von Markierungen ; Kartenwerkzeuge - Erweitertes Raketenlenksystem From 2afbe36b89067b6a2940ea14f6daec14b2038b73 Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Sat, 3 Oct 2015 04:39:22 +0200 Subject: [PATCH 267/311] Update README_DE.md --- docs/README_DE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index c716f0fa22..a54bf70e59 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -46,7 +46,7 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod - Tragen und Ziehen - Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder in der echten Welt - Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer -- Realistische Ballistik/Feuerleitsystem werdeb in C/C++ Erweiterungen berechnet +- Viele Funktionen werden in C/C++ Erweiterungen berechnet - Rückstrahlzonen- und Überdrucksimulation - Einwegwaffen - Realistische G-Kräfte From 411ddac3b992cd6fe2ed1f413bade6c957a066e7 Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Sat, 3 Oct 2015 04:53:00 +0200 Subject: [PATCH 268/311] Update README_DE.md --- docs/README_DE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index a54bf70e59..23be2069d3 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -27,7 +27,7 @@ Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem frei Änderungen vorzuschlagen, oder seine eigene, modifizierte Version zu erstellen, solange diese ebenfalls der Öffentlichkeit zugänglich ist und mit GNU General Public License übereinstimmt. (Weitere Informationen ist der Lizenzdatei in diesem Projekt entnehmbar) -Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc. .Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am medizinischem System), sodass eine individuelle Erfahrung gewährleistet wird. +Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc..Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am Sanitätssystem), sodass eine individuelle Erfahrung gewährleistet werden kann. ### Hauptmerkmale - Vollkommen neues 3D Interaktionssystem @@ -69,11 +69,11 @@ Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert - [Erste Schritte](http://ace3mod.com/wiki/user/getting-started.html). #### Mitwirken -Wenn du bei der Entwicklung der MOD mithelfen möchtest, so kannst du dies tun, indem du nach Fehlern Ausschau hältst, oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. repository) und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gütligen Email-Adresse ein. +Wenn du bei der Entwicklung der MOD mithelfen möchtest kannst du dies tun, indem du nach Fehlern Ausschau hältst oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. "repository") und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gütligen Email-Adresse ein. -Um einen Fehler oder ein Feature zu melden bzw. ein bereits Bestehendes zu ändern - nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: +Um einen Fehler, Anregungen oder neue Funktionalitäten uns mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: - [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) -- [Wie kann ich ein Feature Request erstellen](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) +- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen? ](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) #### Testen & MOD erstellen Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter. From e056a3b2cdf773c59b2ef64f396076d923f7c88f Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Sat, 3 Oct 2015 04:54:10 +0200 Subject: [PATCH 269/311] Update README_DE.md --- docs/README_DE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index 23be2069d3..b08dddcc1e 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -59,8 +59,8 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod - Verbesserte Interaktionen für AARs und Munitionsschlepper - Einstellbare Zielfernrohre - Keine Ruheanimationen bei gesenkter Waffe -- No talking player avatar - Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen +- Keine "sprechender Charkater" - Vector IV, MicroDAGR und Kestrel
***und noch viel viel mehr...*** From b0b755720cb3f69e9b449c118a2441dee5ac68e8 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 3 Oct 2015 12:28:54 -0500 Subject: [PATCH 270/311] #2672 - Use ACE_gameTime for triage card --- addons/medical/functions/fnc_addToTriageCard.sqf | 4 ++-- addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 76d74f85a7..b1df46f751 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -29,7 +29,7 @@ _amount = 1; private "_info"; _info = _log select _foreachIndex; _info set [1,(_info select 1) + 1]; - _info set [2, ACE_time]; + _info set [2, ACE_gameTime]; _log set [_foreachIndex, _info]; _amount = (_info select 1); @@ -38,7 +38,7 @@ _amount = 1; } foreach _log; if (!_inList) then { - _log pushback [_newItem, 1, ACE_time]; + _log pushback [_newItem, 1, ACE_gameTime]; }; _unit setvariable [QGVAR(triageCard), _log, true]; ["Medical_onItemAddedToTriageCard", [_unit, _newItem, _amount]] call EFUNC(common,localEvent); diff --git a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf index c65aba5074..dafd72d54d 100644 --- a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf +++ b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf @@ -75,7 +75,7 @@ if (_name isEqualTo "triage") exitwith { _message = localize _message; }; }; - _triageCardTexts pushback format["%1x - %2 (%3m)", _amount, _message, round((ACE_time - _time) / 60)]; + _triageCardTexts pushback format["%1x - %2 (%3m)", _amount, _message, round((ACE_gameTime - _time) / 60)]; nil; } count _log; From 38422e65861d9d8314f9e8ccc8cf3b8fd05b3fab Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 4 Oct 2015 01:26:38 +0200 Subject: [PATCH 271/311] fix missing magazines after certain scenarios --- addons/common/CfgVehicles.hpp | 6 + addons/common/XEH_preInit.sqf | 6 + .../functions/fnc_binocularMagazine.sqf | 35 ++++ addons/common/functions/fnc_dropBackpack.sqf | 2 +- addons/common/functions/fnc_getAllGear.sqf | 5 +- .../functions/fnc_removeBinocularMagazine.sqf | 30 +++ .../common/functions/fnc_selectWeaponMode.sqf | 31 ++++ addons/common/functions/fnc_setAllGear.sqf | 172 ++++++++++++++++++ .../functions/fnc_takeLoadedATWeapon.sqf | 2 +- addons/respawn/functions/fnc_handleKilled.sqf | 2 +- addons/respawn/functions/fnc_restoreGear.sqf | 147 +-------------- 11 files changed, 293 insertions(+), 145 deletions(-) create mode 100644 addons/common/functions/fnc_binocularMagazine.sqf create mode 100644 addons/common/functions/fnc_removeBinocularMagazine.sqf create mode 100644 addons/common/functions/fnc_selectWeaponMode.sqf create mode 100644 addons/common/functions/fnc_setAllGear.sqf diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 69d6f99924..7c5c9295f9 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -140,4 +140,10 @@ class CfgVehicles { isBicycle = 1; XEH_DISABLED; }; + + class Bag_Base; + class ACE_FakeBackpack: Bag_Base { + scope = 1; + maximumLoad = 1E6; + }; }; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index e422206134..d64d196a40 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -146,8 +146,10 @@ PREP(resetAllDefaults); PREP(restoreVariablesJIP); PREP(runAfterSettingsInit); PREP(sanitizeString); +PREP(selectWeaponMode); PREP(sendRequest); PREP(serverLog); +PREP(setAllGear); PREP(setCaptivityStatus); PREP(setDefinedVariable); PREP(setDisableUserInputStatus); @@ -220,6 +222,10 @@ PREP(getDoorTurrets); PREP(getTurretsFFV); PREP(getTurretsOther); +// missing inventory commands +PREP(binocularMagazine); +PREP(removeBinocularMagazine); + // ACE_Debug PREP(exportConfig); PREP(getChildren); diff --git a/addons/common/functions/fnc_binocularMagazine.sqf b/addons/common/functions/fnc_binocularMagazine.sqf new file mode 100644 index 0000000000..db88e29488 --- /dev/null +++ b/addons/common/functions/fnc_binocularMagazine.sqf @@ -0,0 +1,35 @@ +/* + * Author: commy2 + * Returns the magazine of the units rangefinder. + * + * Arguments: + * 0: Unit + * + * Return Value: + * Magazine of the units binocular + * + * Example: + * [player] call ace_common_fnc_binocularMagazine + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit"]; + +private ["_binocular", "_muzzle", "_mode", "_magazine"]; + +_binocular = binocular _unit; + +if (_binocular == "") exitWith {""}; + +_muzzle = currentMuzzle _unit; +_mode = currentWeaponMode _unit; + +_unit selectWeapon _binocular; + +_magazine = currentMagazine _unit; + +[_unit, _muzzle, _mode] call FUNC(selectWeaponMode); + +_magazine diff --git a/addons/common/functions/fnc_dropBackpack.sqf b/addons/common/functions/fnc_dropBackpack.sqf index fc2b0bba64..26c902a057 100644 --- a/addons/common/functions/fnc_dropBackpack.sqf +++ b/addons/common/functions/fnc_dropBackpack.sqf @@ -18,7 +18,7 @@ private ["_backpackObject", "_holder"]; _backpackObject = backpackContainer _unit; -_unit addBackpack "Bag_Base"; +_unit addBackpack "ACE_FakeBackpack"; removeBackpack _unit; objectParent _backpackObject // return diff --git a/addons/common/functions/fnc_getAllGear.sqf b/addons/common/functions/fnc_getAllGear.sqf index 97b28fddd6..715966b176 100644 --- a/addons/common/functions/fnc_getAllGear.sqf +++ b/addons/common/functions/fnc_getAllGear.sqf @@ -25,6 +25,7 @@ * 16: Handgun Magazines * 17: Assigned Items (map, compass, watch, etc.) * 18: Binoculars + * 19: Binocular Magazine (E.g. Laserbatteries) * * Public: Yes * @@ -44,6 +45,7 @@ if (isNull _unit) exitWith {[ "", ["","","",""], [], "", ["","","",""], [], [], + "", "" ]}; @@ -57,5 +59,6 @@ if (isNull _unit) exitWith {[ secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit, handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit, assignedItems _unit, - binocular _unit + binocular _unit, + [_unit] call FUNC(binocularMagazine) ] diff --git a/addons/common/functions/fnc_removeBinocularMagazine.sqf b/addons/common/functions/fnc_removeBinocularMagazine.sqf new file mode 100644 index 0000000000..3d2252390a --- /dev/null +++ b/addons/common/functions/fnc_removeBinocularMagazine.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * Removes the magazine of the units rangefinder. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [player] call ace_common_fnc_removeBinocularMagazine + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit"]; + +private ["_binocular", "_selectBinocular"]; + +_binocular = binocular _unit; + +_selectBinocular = currentWeapon _unit == _binocular; + +_unit addWeapon _binocular; + +if (_selectBinocular) then { + _unit selectWeapon _binocular; +}; diff --git a/addons/common/functions/fnc_selectWeaponMode.sqf b/addons/common/functions/fnc_selectWeaponMode.sqf new file mode 100644 index 0000000000..f255c63e98 --- /dev/null +++ b/addons/common/functions/fnc_selectWeaponMode.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * Unit selects given muzzle and weapon mode. + * + * Arguments: + * 0: unit + * 1: weapon or Muzzle + * 2: weapon Mode + * + * Return Value: + * Successful? + * + * Example: + * [player, primaryWeapon player, "FullAuto"] call ace_common_fnc_selectWeaponMode + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_muzzle", "_mode"]; + +local _index = 0; + +while { + _index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} +} do { + _unit action ["SwitchWeapon", _unit, _unit, _index]; + _index = _index + 1; +}; + +_index < 100 // return diff --git a/addons/common/functions/fnc_setAllGear.sqf b/addons/common/functions/fnc_setAllGear.sqf new file mode 100644 index 0000000000..e25045a685 --- /dev/null +++ b/addons/common/functions/fnc_setAllGear.sqf @@ -0,0 +1,172 @@ +/* + * Author: bux578, commy2 + * Applies gear to unit. + * + * Arguments: + * 0: Unit + * 1: All Gear based on return value of ACE_common_fnc_getAllGear + * 2: Remove all attachments from weapons? (default: false) + * 3: Remove all items from prefilled backpacks? (default: false) + * + * Return Value: + * None + * + * Example: + * [player, gear_array, true, true] call ace_common_fnc_setAllGear + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_allGear", ["_clearAttachments", false], ["_clearBackpack", false]]; + +// remove all starting gear of a player +removeAllWeapons _unit; +removeGoggles _unit; +removeHeadgear _unit; +removeVest _unit; +removeUniform _unit; +removeAllAssignedItems _unit; +removeBackpack _unit; + +_allGear params [ + "_headgear", "_goggles", + "_uniform", "_uniformitems", + "_vest", "_vestitems", + "_backpack", "_backpackitems", + "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", + "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine", + "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", + "_assigneditems", + "_binocular", + "_binocularmagazine" +]; + +// start restoring the items +if (_headgear != "") then {_unit addHeadgear _headgear}; +if (_goggles != "") then {_unit addGoggles _goggles}; + +// ensure all weapons being loaded +_unit addBackpack "ACE_FakeBackpack"; + +// primaryWeapon +if (_primaryweapon != "") then { + { + _unit addMagazine _x; + false + } count _primaryweaponmagazine; + + _unit addWeapon _primaryweapon; + + if (_clearAttachments) then { + removeAllPrimaryWeaponItems _unit; + }; + + { + if (_x != "") then { + _unit addPrimaryWeaponItem _x; + }; + false + } count _primaryweaponitems; +}; + +// secondaryWeapon +if (_secondaryweapon != "") then { + { + _unit addMagazine _x; + false + } count _secondaryweaponmagazine; + + _unit addWeapon _secondaryweapon; + + if (_clearAttachments) then { + //removeAllSecondaryWeaponItems _unit; + { + _unit removeSecondaryWeaponItem _x; + false + } count secondaryWeaponItems _unit; + }; + + { + if (_x != "") then { + _unit addSecondaryWeaponItem _x; + }; + false + } count _secondaryweaponitems; +}; + +// handgun +if (_handgunweapon != "") then { + { + _unit addMagazine _x; + false + } count _handgunweaponmagazine; + + _unit addWeapon _handgunweapon; + + if (_clearAttachments) then { + removeAllHandgunItems _unit; + }; + + { + if (_x != "") then { + _unit addHandgunItem _x; + }; + false + } count _handgunweaponitems; +}; + +// binocular +_unit addWeapon _binocular; +_unit addMagazine _binocularmagazine; + +// done with dummy backpack. now remove +removeBackpack _unit; + +// uniform +if (_uniform != "") then { + _unit forceAddUniform _uniform; +}; + +{ + _unit addItemToUniform _x; + false +} count _uniformitems; + +// vest +if (_vest != "") then { + _unit addVest _vest; +}; + +{ + _unit addItemToVest _x; + false +} count _vestitems; + +// backpack +if (_backpack != "") then { + _unit addBackpack _backpack; + + if (_clearBackpack) then { + local _backpackObject = unitBackpack _unit; + + clearMagazineCargoGlobal _backpackObject; + clearWeaponCargoGlobal _backpackObject; + clearItemCargoGlobal _backpackObject; + }; + + { + _unit addItemToBackpack _x; + false + } count _backpackitems; +}; + +// assigned items +_assignedItems deleteAt (_assignedItems find _binocular); + +{ + _unit linkItem _x; + false +} count _assignedItems; + +nil diff --git a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf index de7cdefd70..c371c8d5a5 100644 --- a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf +++ b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf @@ -35,7 +35,7 @@ if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber _unit removeMagazines _magazine; if (backpack _unit == "") then { - _unit addBackpack "Bag_Base"; + _unit addBackpack "ACE_FakeBackpack"; _unit removeWeapon _launcher; _unit addMagazine _magazine; _didAdd = _magazine in (magazines _unit); diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 200e3c98c8..cd1ad33491 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -24,7 +24,7 @@ if (ACE_player == _unit) then { if (GVAR(SavePreDeathGear)) then { GVAR(unitGear) = [_unit] call EFUNC(common,getAllGear); - GVAR(unitGear) pushBack [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]; + GVAR(unitGear) append [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]; }; }; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index e8a512e127..d01e45dd50 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -1,5 +1,5 @@ /* - * Author: bux578 + * Author: bux578, commy2 * Restores previously saved gear. * * Arguments: @@ -10,150 +10,16 @@ * None * * Example: - * [ACE_Player, stored_allGear] call ace_respawn_fnc_restoreGear + * [ACE_Player, stored_allGear, active_weapon_muzzle_and_mode] call ace_respawn_fnc_restoreGear * * Public: No */ #include "script_component.hpp" -params ["_unit", "_allGear"]; +params ["_unit", "_allGear", "_activeWeaponAndMuzzle"]; -// remove all starting gear of a player -removeAllWeapons _unit; -removeGoggles _unit; -removeHeadgear _unit; -removeVest _unit; -removeUniform _unit; -removeAllAssignedItems _unit; -clearAllItemsFromBackpack _unit; -removeBackpack _unit; - -_allGear params [ - "_headgear", "_goggles", - "_uniform", "_uniformitems", - "_vest", "_vestitems", - "_backpack", "_backpackitems", - "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", - "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine", - "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", - "_assigneditems", "_binocular", - "_activeWeaponAndMuzzle" -]; - -// start restoring the items -if (_headgear != "") then {_unit addHeadgear _headgear}; -if (_goggles != "") then {_unit addGoggles _goggles}; -if (_uniform != "") then {_unit forceAddUniform _uniform}; -if (_vest != "") then {_unit addVest _vest}; - -{ - _unit addItemToUniform _x; - false -} count _uniformitems; - -{ - _unit addItemToVest _x; - false -} count _vestitems; - -private "_flagRemoveDummyBag"; - -if (format ["%1", _backpack] != "") then { - _unit addBackpack _backpack; - - // make sure the backpack is empty. Some bags are prefilled by config - private "_backpackObject"; - _backpackObject = unitBackpack _unit; - - clearMagazineCargoGlobal _backpackObject; - clearWeaponCargoGlobal _backpackObject; - clearItemCargoGlobal _backpackObject; - - { - _unit addItemToBackpack _x; - false - } count _backpackitems; - - _flagRemoveDummyBag = false; -} else { - // dummy backpack to ensure mags being loaded - _unit addBackpack "Bag_Base"; - - _flagRemoveDummyBag = true; -}; - -// primaryWeapon -if ((_primaryweapon != "") && {_primaryweapon != "ACE_FakePrimaryWeapon"}) then { - { - _unit addMagazine _x; - false - } count _primaryweaponmagazine; - - _unit addWeapon _primaryweapon; - - { - if (_x != "") then { - _unit addPrimaryWeaponItem _x; - }; - false - } count _primaryweaponitems; -}; - -// secondaryWeapon -if (_secondaryweapon != "") then { - { - _unit addMagazine _x; - false - } count _secondaryweaponmagazine; - - _unit addWeapon _secondaryweapon; - - { - if (_x != "") then { - _unit addSecondaryWeaponItem _x; - }; - false - } count _secondaryweaponitems; -}; - -// handgun -if (_handgunweapon != "") then { - { - _unit addMagazine _x; - false - } count _handgunweaponmagazine; - - _unit addWeapon _handgunweapon; - - { - if (_x != "") then { - _unit addHandgunItem _x; - }; - false - } count _handgunweaponitems; -}; - -// remove dummy bagpack -if (_flagRemoveDummyBag) then { - removeBackpack _unit; -}; - -_assignedItems deleteAt (_assignedItems find _binocular); - -// items -{_unit linkItem _x; false} count _assignedItems; - -_unit addWeapon _binocular; - -// reload Laserdesignator -// we assume that if the unit had a Laserdesignator it probably had batteries for it -if ("Laserdesignator" in assignedItems _unit) then { - _unit selectWeapon "Laserdesignator"; - - if (currentMagazine _unit == "") then { - _unit addMagazine "Laserbatteries"; - }; -}; +// restore all gear +[_unit, _allGear, true, true] call EFUNC(common,setAllGear); // restore the last active weapon, muzzle and weaponMode _activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; @@ -171,8 +37,7 @@ if ( }; if (currentWeapon _unit != "") then { - private "_index"; - _index = 0; + local _index = 0; while { _index < 100 && {currentWeaponMode _unit != _activeWeaponMode} From f0036fabbb371b26bdeab39a6117e9cd46ae58cb Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 4 Oct 2015 02:15:38 +0200 Subject: [PATCH 272/311] use BIS fnc for time format --- addons/respawn/functions/fnc_moveRallypoint.sqf | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index b34b69b617..fa8aae40a5 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -46,13 +46,7 @@ _position set [2, 0]; _rallypoint setPosATL _position; _unit reveal _rallypoint; - // fix leading zero - local _minutes = date select 4; - if (_minutes < 10) then { - _minutes = format ["0%1", _minutes]; - }; - - _rallypoint setVariable [QGVAR(markerDate), format ["%1:%2", date select 3, _minutes], true]; + _rallypoint setVariable [QGVAR(markerDate), [dayTime, "HH:MM"] call BIS_fnc_timeToString, true]; ["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent); From 21f35dc7d09153d54af6e0016a2edc68339ca997 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 3 Oct 2015 19:42:40 -0500 Subject: [PATCH 273/311] #2664 - Disable loading into locked vehicles. --- addons/cargo/functions/fnc_canLoad.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/cargo/functions/fnc_canLoad.sqf b/addons/cargo/functions/fnc_canLoad.sqf index f5d1304a95..f18ceb5835 100644 --- a/addons/cargo/functions/fnc_canLoad.sqf +++ b/addons/cargo/functions/fnc_canLoad.sqf @@ -31,4 +31,6 @@ if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then { if (isNull _nearestVehicle) exitWith {false}; +if ((locked _nearestVehicle) >= 2) exitWith {false}; + [_object, _nearestVehicle] call FUNC(canLoadItemIn) From c75d219b65a2c311293a31dfcc236abafdc0f5b6 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 3 Oct 2015 21:34:46 -0500 Subject: [PATCH 274/311] Cleanup Undefined Functions --- addons/common/functions/fnc_dumpArray.sqf | 14 ++--- .../functions/fnc_execPersistentFnc.sqf | 3 +- addons/common/functions/fnc_execRemoteFnc.sqf | 3 +- addons/common/functions/fnc_loadPerson.sqf | 2 +- .../fnc_sendDisplayInformationTo.sqf | 53 ------------------- .../functions/fnc_sendDisplayMessageTo.sqf | 53 ------------------- 6 files changed, 11 insertions(+), 117 deletions(-) delete mode 100644 addons/common/functions/fnc_sendDisplayInformationTo.sqf delete mode 100644 addons/common/functions/fnc_sendDisplayMessageTo.sqf diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 182c542df2..010736d3a9 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -1,22 +1,24 @@ /* * Author: ? - * ? + * Dumps an array to the RPT, showing the depth of each element. * * Arguments: * 0: Array to be dumped - * 1: Depth + * 1: Depth * * Return Value: * None * + * Example: + * [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray + * * Public: No */ #include "script_component.hpp" -params ["_var", "_depth"]; +params ["_var", ["_depth", 0, [0]]]; -private "_pad"; -_pad = ""; +local _pad = ""; for "_i" from 0 to _depth do { _pad = _pad + toString [9]; @@ -38,5 +40,5 @@ if (IS_ARRAY(_var)) then { diag_log text format ["%1],", _pad]; }; } else { - diag_log text format ["%1%2", _pad, [_var] call FUNC(formatVar)]; + diag_log text format ["%1%2", _pad, _var]; }; diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf index dc88a7c3c9..0b7bccb69a 100644 --- a/addons/common/functions/fnc_execPersistentFnc.sqf +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -20,11 +20,10 @@ GVAR(remoteFnc) = _this; params ["_arguments", "_function", "_unit", "_name"]; +TRACE_4("params", _arguments, _function, _unit, _name); _function = call compile _function; -//["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); - // execute function on every currently connected machine [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf index 6b617bf92f..0dd0653a33 100644 --- a/addons/common/functions/fnc_execRemoteFnc.sqf +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -23,11 +23,10 @@ GVAR(remoteFnc) = _this; params ["_arguments", "_function", ["_unit", 2]]; +TRACE_3("params", _arguments, _function, _unit); _function = call compile _function; -//["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); - if (typeName _unit == "SCALAR") exitWith { switch (_unit) do { case 0 : { diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index 377412bd4c..da729ed0d7 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -21,7 +21,7 @@ private ["_vehicle", "_loadcar", "_loadair", "_loadtank", "_loadboat"]; _vehicle = objNull; -if (!([_caller] call FUNC(canInteract)) || {_caller == _unit}) exitwith {_vehicle}; +if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitwith {_vehicle}; _loadcar = nearestObject [_unit, "Car"]; diff --git a/addons/common/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf deleted file mode 100644 index aa3dba2365..0000000000 --- a/addons/common/functions/fnc_sendDisplayInformationTo.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: Glowbal - * Sends a display information hint to a receiver - * - * Arguments: - * 0: receiver - * 1: title - * 2: content - * 3: type (optional) - * - * Return Value: - * None - * - * Public: Yes - */ -#include "script_component.hpp" - -params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]]; - -if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QFUNC(sendDisplayInformationTo), _reciever, false] call FUNC(execRemoteFnc); - } else { - if (isLocalized _title) then { - _title = localize _title; - }; - - private "_localizationArray"; - _localizationArray = [_title]; - - { - _localizationArray pushback _x; - false - } count _parameters; - - _title = format _localizationArray; - - { - if (isLocalized _x) then { - _localizationArray = [localize _x]; - - { - _localizationArray pushBack _x; - false - } count _parameters; - - _content set [_forEachIndex, format _localizationArray]; - }; - } forEach _content; - - [_title, _content, _type] call FUNC(displayInformation); - }; -}; diff --git a/addons/common/functions/fnc_sendDisplayMessageTo.sqf b/addons/common/functions/fnc_sendDisplayMessageTo.sqf deleted file mode 100644 index 6f16ec8006..0000000000 --- a/addons/common/functions/fnc_sendDisplayMessageTo.sqf +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Author: Glowbal - * Displays a message on locality of receiver - * - * Arguments: - * 0: receiver - * 1: title - * 2: content - * 3: type (optional) - * - * Return Value: - * None - * - * Public: Yes - */ -#include "script_component.hpp" - -params [["_reciever", objNull], ["_title", ""], ["_content", ""], ["_type", 0], ["_parameters", []]]; - -if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QFUNC(sendDisplayMessageTo), _reciever, false] call FUNC(execRemoteFnc); - } else { - if (isLocalized _title) then { - _title = localize _title; - }; - - if (isLocalized _content) then { - _content = localize _content; - }; - - private "_localizationArray"; - _localizationArray = [_title]; - - { - _localizationArray pushBack _x; - false - } count _parameters; - - _title = format _localizationArray; - - _localizationArray = [_content]; - - { - _localizationArray pushBack _x; - false - } count _parameters; - - _content = format _localizationArray; - - [_title, _content, _type] call FUNC(displayMessage); - }; -}; From 59da3e1c35ee12c1439df9c9c396fb0264ff8153 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 3 Oct 2015 23:05:46 -0500 Subject: [PATCH 275/311] Optimize PFEH Funcs --- .../common/functions/fnc_getTurretIndex.sqf | 24 +++++++------------ addons/common/functions/fnc_timePFH.sqf | 20 +++++++++------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf index b2f28c5f90..050f3e1c4f 100644 --- a/addons/common/functions/fnc_getTurretIndex.sqf +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -8,29 +8,23 @@ * Return Value: * Turret Index * + * Example: + * [ace_player] call ace_common_fnc_getTurretIndex + * * Public: Yes */ #include "script_component.hpp" params ["_unit"]; -private ["_vehicle", "_turrets", "_units", "_index"]; - -_vehicle = vehicle _unit; - +local _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {[]}; -_turrets = allTurrets [_vehicle, true]; - -_units = []; +scopeName "main"; { - _units pushBack (_vehicle turretUnit _x); - false -} count _turrets; + if (_unit == (_vehicle turretUnit _x)) then {_x breakOut "main"}; + nil +} count allTurrets [_vehicle, true]; -_index = _units find _unit; - -if (_index == -1) exitWith {[]}; - -_turrets select _index; +[] diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index 4f099ea68c..152eceee3f 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -1,26 +1,26 @@ /* - * Author: ? - * ? + * Author: jaynus + * PFEH to set all Ace Time Variables * * Arguments: - * ? + * None * * Return Value: - * ? + * None * - * Public: ? + * Public: No */ #include "script_component.hpp" -private ["_lastTickTime", "_lastGameTime", "_delta"]; +BEGIN_COUNTER(timePFH); -_lastTickTime = ACE_diagTime; -_lastGameTime = ACE_gameTime; +local _lastTickTime = ACE_diagTime; +local _lastGameTime = ACE_gameTime; ACE_gameTime = time; ACE_diagTime = diag_tickTime; -_delta = ACE_diagTime - _lastTickTime; +local _delta = ACE_diagTime - _lastTickTime; if (ACE_gameTime <= _lastGameTime) then { TRACE_1("paused",_delta); @@ -36,3 +36,5 @@ if (ACE_gameTime <= _lastGameTime) then { ACE_virtualTime = ACE_virtualTime + (_delta * accTime); ACE_time = ACE_virtualTime; }; + +END_COUNTER(timePFH); From dc9ba7aa4cd0196c4cfd72d6e9bad600a6e3829e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 4 Oct 2015 03:48:37 -0500 Subject: [PATCH 276/311] Validate sqf - python 3 compat --- tools/sqf_validator.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index c80e2e5462..e4af90f50f 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -54,24 +54,21 @@ def check_sqf_syntax(filepath): brackets_list.append('(') elif (c == ')'): if (brackets_list[-1] in ['{', '[']): - print "Possible missing bracket detected at )" - print filepath + "Line number: " + str(lineNumber) + print("Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 brackets_list.append(')') elif (c == '['): brackets_list.append('[') elif (c == ']'): if (brackets_list[-1] in ['{', '(']): - print "Possible missing bracket detected at ]" - print filepath + "Line number: " + str(lineNumber) + print("Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 brackets_list.append(']') elif (c == '{'): brackets_list.append('{') elif (c == '}'): if (brackets_list[-1] in ['(', '[']): - print "Possible missing bracket detected at }" - print filepath + "Line number: " + str(lineNumber) + print("Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 brackets_list.append('}') else: @@ -84,13 +81,13 @@ def check_sqf_syntax(filepath): checkIfNextIsClosingBlock = False if brackets_list.count('[') != brackets_list.count(']'): - print "A possible missing [ or ] in file " + filepath + "[ = " + str(brackets_list.count('[')) + " ] =" + str(brackets_list.count(']')) + print("A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}".format(filepath,brackets_list.count('['),brackets_list.count(']'))) bad_count_file += 1 if brackets_list.count('(') != brackets_list.count(')'): - print "A possible missing ( or ) in file " + filepath + "( = " + str(brackets_list.count('(')) + " ) =" + str(brackets_list.count(')')) + print("A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}".format(filepath,brackets_list.count('('),brackets_list.count(')'))) bad_count_file += 1 if brackets_list.count('{') != brackets_list.count('}'): - print "A possible missing { or } in file " + filepath + "{ = " + str(brackets_list.count('{')) + " } =" + str(brackets_list.count('}')) + print("A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}".format(filepath,brackets_list.count('{'),brackets_list.count('}'))) bad_count_file += 1 return bad_count_file @@ -114,7 +111,7 @@ def main(): for filename in sqf_list: bad_count = bad_count + check_sqf_syntax(filename) - print ("Bad Count {0}".format(bad_count)) + print("Bad Count {0}".format(bad_count)) return bad_count if __name__ == "__main__": From a2b6166aa0f70b0ab11eede862f90d0b172c448e Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 4 Oct 2015 11:43:13 +0200 Subject: [PATCH 277/311] optimization waitUntilAndExecute, add comments --- addons/common/XEH_postInit.sqf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 6f9f95f38f..29c798fb31 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -31,11 +31,12 @@ //Handle the waitUntilAndExec array: _deleted = 0; { - _x params ["_condition", "_code", "_args"]; - if ((_args call _condition)) then { + // if condition is satisifed call statement + if ((_x select 2) call (_x select 0)) then { + // make sure to delete the correct handle when multiple conditions are met in one frame GVAR(waitUntilAndExecArray) deleteAt (_forEachIndex - _deleted); _deleted = _deleted + 1; - _args call _code; + (_x select 2) call (_x select 1); }; } forEach GVAR(waitUntilAndExecArray); }, 0, []] call CBA_fnc_addPerFrameHandler; From 92ed7eeac29d2ff94ba52028b7cbff7ae13da171 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 4 Oct 2015 11:58:26 +0200 Subject: [PATCH 278/311] remove check ammo action on destroyed static weapons, fix #2671 --- addons/reload/functions/fnc_canCheckAmmo.sqf | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 95ac2582a2..8fbb37c726 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -3,7 +3,7 @@ * Check if the player can check the ammo of the target. * * Argument: - * 0: Player + * 0: Unit * 1: Target * * Return value: @@ -16,22 +16,24 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_player,_target); - -private ["_magazineType", "_magazineCfg"]; +params ["", "_target"]; // Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore if (_target isKindOf "StaticWeapon") exitWith { if (currentMagazine _target != "") exitWith {true}; - private ["_magazines","_found"]; - _magazines = magazinesAmmoFull _target; - _found = false; + // no check ammo action on destroyed static weapons + if (!alive _target) exitWith {false}; + + local _found = false; + { if (_x select 2) exitWith { _found = true; }; - } forEach _magazines; + false + } count magazinesAmmoFull _target; + _found }; @@ -42,9 +44,7 @@ if !(_target isKindOf "CAManBase") exitWith {false}; if (currentWeapon _target == "") exitWith {false}; // Check if their current magazine is a belt -_magazineType = currentMagazine _target; -_magazineCfg = configFile >> "CfgMagazines" >> _magazineType; -if (getNumber (_magazineCfg >> "ACE_isBelt") == 1) exitWith {true}; +if (getNumber (configFile >> "CfgMagazines" >> currentMagazine _target >> "ACE_isBelt") == 1) exitWith {true}; // Check for rocket launchers if (currentWeapon _target == secondaryWeapon _target) exitWith {true}; From d9595b6176abd2921ff1bd9561ef42b1e4abac80 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sun, 4 Oct 2015 12:10:08 +0200 Subject: [PATCH 279/311] fix fnc_binocularMagazine on remote and dead units --- addons/common/functions/fnc_binocularMagazine.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/common/functions/fnc_binocularMagazine.sqf b/addons/common/functions/fnc_binocularMagazine.sqf index db88e29488..f097b90841 100644 --- a/addons/common/functions/fnc_binocularMagazine.sqf +++ b/addons/common/functions/fnc_binocularMagazine.sqf @@ -12,6 +12,8 @@ * [player] call ace_common_fnc_binocularMagazine * * Public: Yes + * + * Note: Doesn't work on dead units */ #include "script_component.hpp" @@ -28,6 +30,9 @@ _mode = currentWeaponMode _unit; _unit selectWeapon _binocular; +// didn't select the binocular (unit probably dead or not local). function won't work. quit with empty string +if (currentWeapon _unit != _binocular) exitWith {""}; + _magazine = currentMagazine _unit; [_unit, _muzzle, _mode] call FUNC(selectWeaponMode); From 616bc9f8a0e4e09f387038aba70b3bd1cddd9f11 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 4 Oct 2015 11:38:31 -0500 Subject: [PATCH 280/311] local-private waitAndXX PFEH --- addons/common/XEH_postInit.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 912acce7c4..032b6148be 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -9,11 +9,11 @@ //Singe PFEH to handle execNextFrame, waitAndExec and waitUntilAndExec: [{ - private ["_entry", "_deleted"]; + BEGIN_COUNTER(waitAndExec); //Handle the waitAndExec array: while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do { - _entry = GVAR(waitAndExecArray) deleteAt 0; + local _entry = GVAR(waitAndExecArray) deleteAt 0; (_entry select 2) call (_entry select 1); }; @@ -29,7 +29,7 @@ GVAR(nextFrameNo) = diag_frameno + 1; //Handle the waitUntilAndExec array: - _deleted = 0; + local _deleted = 0; { // if condition is satisifed call statement if ((_x select 2) call (_x select 0)) then { @@ -39,6 +39,8 @@ (_x select 2) call (_x select 1); }; } forEach GVAR(waitUntilAndExecArray); + + END_COUNTER(waitAndExec); }, 0, []] call CBA_fnc_addPerFrameHandler; From 7258bc5efc14e8c1851d67bbb46d2a9d88d1ba06 Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 8 Oct 2015 17:55:54 +0200 Subject: [PATCH 281/311] Fix link in deploy tool --- tools/deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/deploy.py b/tools/deploy.py index ff2d499d9f..c6e96f85f3 100755 --- a/tools/deploy.py +++ b/tools/deploy.py @@ -17,7 +17,7 @@ from pygithub3 import Github TRANSLATIONISSUE = 367 TRANSLATIONBODY = """**How to translate ACE3:** -https://github.com/acemod/ACE3/blob/master/documentation/development/how-to-translate-ace3.md +http://ace3mod.com/wiki/development/how-to-translate-ace3.html {} """ From 8cbd57309317a62ff8fe640ab1c226561ec27c38 Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Thu, 8 Oct 2015 19:20:17 +0200 Subject: [PATCH 282/311] Update README_DE.md --- docs/README_DE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index b08dddcc1e..4e09c46108 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -73,7 +73,7 @@ Wenn du bei der Entwicklung der MOD mithelfen möchtest kannst du dies tun, inde Um einen Fehler, Anregungen oder neue Funktionalitäten uns mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: - [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) -- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen? ](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) +- [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen?](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) #### Testen & MOD erstellen Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter. From 4b7f281eba530167bc1093e9750fbc25c3df11e3 Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 8 Oct 2015 20:30:54 +0200 Subject: [PATCH 283/311] Fix slacking badge links, Add Travis CI build badge --- README.md | 7 +++++-- docs/README_DE.md | 7 +++++-- docs/README_PL.md | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5a01e5d5de..c3d4c1389f 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,11 @@ ACE3 License - - ACE3 Slack + + ACE3 Slack + + + ACE3 CI Status (master branch)

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

diff --git a/docs/README_DE.md b/docs/README_DE.md index 9921bf3fc6..6f45df8b81 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -17,8 +17,11 @@ ACE3 License - - ACE3 Slack + + ACE3 Slack + + + ACE3 CI Status (master branch)

Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit

diff --git a/docs/README_PL.md b/docs/README_PL.md index aa7023a9e4..bf31f0e3b9 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -17,8 +17,11 @@ ACE3 Licencja - - ACE3 Slack + + ACE3 Slack + + + ACE3 CI Status (master branch)

Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit

From 7efcc3b8d180f95e2a99abd1b19eff056a34f05b Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 8 Oct 2015 20:33:20 +0200 Subject: [PATCH 284/311] Update version and download size --- README.md | 2 +- docs/README_DE.md | 4 ++-- docs/README_PL.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c3d4c1389f..f5a5e5a948 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ACE3 Version - ACE3 Download + ACE3 Download ACE3 Issues diff --git a/docs/README_DE.md b/docs/README_DE.md index 6f45df8b81..849a75a692 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -3,10 +3,10 @@

- ACE3 Version + ACE3 Version - ACE3 Download + ACE3 Download ACE3 Issues diff --git a/docs/README_PL.md b/docs/README_PL.md index bf31f0e3b9..b623d90c11 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -3,10 +3,10 @@

- ACE3 Wersja + ACE3 Wersja - ACE3 Pobierz + ACE3 Pobierz ACE3 Zagadnienia From 7c101bde8757a48d9df44644168799d971c18d78 Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 8 Oct 2015 21:01:06 +0200 Subject: [PATCH 285/311] Change build badge tooltip --- README.md | 2 +- docs/README_DE.md | 2 +- docs/README_PL.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f5a5e5a948..fc02b56898 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ ACE3 Slack - ACE3 CI Status (master branch) + ACE3 Build Status

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

diff --git a/docs/README_DE.md b/docs/README_DE.md index 849a75a692..97dd500019 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -21,7 +21,7 @@ ACE3 Slack - ACE3 CI Status (master branch) + ACE3 Build Status

Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit

diff --git a/docs/README_PL.md b/docs/README_PL.md index b623d90c11..13ec07b395 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -21,7 +21,7 @@ ACE3 Slack - ACE3 CI Status (master branch) + ACE3 Build Status

Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit

From fc7230359f6da4a8e624012169e191be08e1af4a Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 8 Oct 2015 21:58:02 +0200 Subject: [PATCH 286/311] Remove redundant variables (left-over from deploy wiki to gh-pages) --- tools/deploy.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/deploy.py b/tools/deploy.py index c6e96f85f3..0b3a730470 100755 --- a/tools/deploy.py +++ b/tools/deploy.py @@ -26,9 +26,6 @@ REPOUSER = "acemod" REPONAME = "ACE3" REPOPATH = "{}/{}".format(REPOUSER,REPONAME) -USERNAME = "ACE3 Travis" -USEREMAIL = "travis@ace3mod.com" - def update_translations(token): diag = sp.check_output(["python3", "tools/stringtablediag.py", "--markdown"]) From 01a39e7db5438ed7413de77046bf0c3f7441c02d Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 8 Oct 2015 23:53:21 +0200 Subject: [PATCH 287/311] Update badges --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fc02b56898..3aa6ae6af7 100644 --- a/README.md +++ b/README.md @@ -6,22 +6,22 @@ ACE3 Version - ACE3 Download + ACE3 Download - ACE3 Issues + ACE3 Issues BIF Thread - ACE3 License + ACE3 License ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

From e5a7516ec14137f12f992bec07fdcc4d7829405e Mon Sep 17 00:00:00 2001 From: jonpas Date: Thu, 8 Oct 2015 23:54:44 +0200 Subject: [PATCH 288/311] Non-English as well --- docs/README_DE.md | 8 ++++---- docs/README_PL.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index 97dd500019..5c82cc5097 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -6,22 +6,22 @@ ACE3 Version - ACE3 Download + ACE3 Download - ACE3 Issues + ACE3 Issues BIF Thread - ACE3 License + ACE3 License ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit

diff --git a/docs/README_PL.md b/docs/README_PL.md index 13ec07b395..6447e4b5b9 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -6,22 +6,22 @@ ACE3 Wersja - ACE3 Pobierz + ACE3 Pobierz - ACE3 Zagadnienia + ACE3 Zagadnienia Temat BIF - ACE3 Licencja + ACE3 Licencja ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit

From 36895d2e305de104e14f217e769b52601e330f0c Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 9 Oct 2015 00:23:36 +0200 Subject: [PATCH 289/311] Update more version numbers --- docs/README_DE.md | 2 +- docs/README_PL.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index 5c82cc5097..24be427392 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -5,7 +5,7 @@ ACE3 Version - + ACE3 Download diff --git a/docs/README_PL.md b/docs/README_PL.md index 6447e4b5b9..b12f574b6f 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -5,7 +5,7 @@ ACE3 Wersja - + ACE3 Pobierz From 15cba66b9b3ca3f04ee9d39ab929f7c3522f826c Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 9 Oct 2015 20:49:23 +0200 Subject: [PATCH 290/311] Fix spelling of separate in LICENSE --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 01832682d7..037f1df2f3 100644 --- a/LICENSE +++ b/LICENSE @@ -22,13 +22,13 @@ source code of the individual modules. When publishing a derivative of this product you may not use a name that might create the impression that your version is an official release. -Some folders of this project may contain a seperate LICENSE file. Should +Some folders of this project may contain a separate LICENSE file. Should that be the case, everything in that folder and all subfolders is subject to that license instead. ============================================================================ - Full Gnu General Public License Text + Full GNU General Public License Text ============================================================================ From 53f833b68cafb9d29629d98984f7657374873e58 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 10 Oct 2015 00:19:09 -0500 Subject: [PATCH 291/311] #2702 - Cargo: Make "Supply Box" pallets heavy --- addons/cargo/CfgVehicles.hpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index ccc23a99aa..1fae56749f 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -218,6 +218,24 @@ class CfgVehicles { GVAR(size) = 2; // 1 = small, 2 = large GVAR(canLoad) = 1; }; + //"Supply Box" - Small Pallets + class B_supplyCrate_F: ReammoBox_F { + GVAR(size) = 6; + }; + class O_supplyCrate_F: ReammoBox_F { + GVAR(size) = 6; + }; + class I_supplyCrate_F: ReammoBox_F { + GVAR(size) = 6; + }; + class IG_supplyCrate_F: ReammoBox_F { + GVAR(size) = 6; + }; + class C_supplyCrate_F: ReammoBox_F { + GVAR(size) = 6; + }; + + class Scrapyard_base_F; class Land_PaperBox_closed_F: Scrapyard_base_F { @@ -425,5 +443,5 @@ class CfgVehicles { selection = ""; }; }; - }; + }; }; From 33be10126ee7e74411b1b542b095b37414f8e6c6 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 15:01:02 +0200 Subject: [PATCH 292/311] Improve travis yml - Add slack integration - Change the deploy.py to only run on pushes to the master branch - Change email notifications to only mail once on failure --- .travis.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0aadd9cd0b..0506cc0952 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,13 +3,26 @@ branches: - master language: python python: - - "3.4" +- '3.4' before_script: - - pip install pygithub - - pip install pygithub3 +- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then + pip install pygithub; + pip install pygithub3; + fi script: - - python3 tools/deploy.py - - python3 tools/sqf_validator.py +- python3 tools/sqf_validator.py +- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then + python3 tools/deploy.py; + fi env: global: - - secure: "KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=" + - secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg= +notifications: + slack: + secure: aWYF/YX7vxEdXJ5w1jhYJQ2TtTP2NRdnXzJDMYXTv2dlXYhO9qp2qjxDGW3dezuPY7B1mPBgebfSKRx3Robkt1rAfEwPWivOiEztL30rwzOy+5Q1wpORv1JkvTC/q2wqQzxQCU/FPVjD2GkF1wtq1Rnx3ESWD8gbvzYoMNdIw1g= + on_success: change + on_failure: always + on_start: never + email: + on_success: never + on_failure: change From 8e9c2754fdb2e1bc72384bf5adf36c7330e6d86f Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 15:01:31 +0200 Subject: [PATCH 293/311] Change translation guide link in translations issue to markdown - Change from @Jonpas --- tools/deploy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/deploy.py b/tools/deploy.py index 0b3a730470..2bc894176d 100755 --- a/tools/deploy.py +++ b/tools/deploy.py @@ -16,8 +16,7 @@ from pygithub3 import Github TRANSLATIONISSUE = 367 -TRANSLATIONBODY = """**How to translate ACE3:** -http://ace3mod.com/wiki/development/how-to-translate-ace3.html +TRANSLATIONBODY = """**[ACE3 Translation Guide](http://ace3mod.com/wiki/development/how-to-translate-ace3.html)** {} """ From fe7f8e66f73268f9f33491f174a41e3aedb41cef Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 15:23:22 +0200 Subject: [PATCH 294/311] Add slack notification for ace3public dev channel --- .travis.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0506cc0952..6063d59b34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,16 @@ branches: only: - - master + - master language: python python: - '3.4' before_script: -- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then - pip install pygithub; - pip install pygithub3; - fi +- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" + == "false" ]; then pip install pygithub; pip install pygithub3; fi script: - python3 tools/sqf_validator.py -- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then - python3 tools/deploy.py; - fi +- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" + == "false" ]; then python3 tools/deploy.py; fi env: global: - secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg= @@ -23,6 +20,8 @@ notifications: on_success: change on_failure: always on_start: never + rooms: + secure: MvxmqL1NGwiGTVv6uIVTM7jeNLQH95KYtTgSWlXaSw4jdjnf4cmrb/ofHQ3FHhhNVdhRN6W8n0cJfTC3DBZ90bionVh+528qw2mDnDbKljVdIwmoFSexBcH7H1uTLF3gsEz0tbrHtLcnAyTMxdjsdIXDLZ5hwxABNmW5/03jOgs= email: on_success: never on_failure: change From 51c4b2b89518ccf58bba7610c2826d179e7dbd7d Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 15:26:06 +0200 Subject: [PATCH 295/311] Fix formatting of script --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6063d59b34..313b0a11c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,15 @@ language: python python: - '3.4' before_script: -- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" - == "false" ]; then pip install pygithub; pip install pygithub3; fi +- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then + pip install pygithub; + pip install pygithub3; + fi script: - python3 tools/sqf_validator.py -- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" - == "false" ]; then python3 tools/deploy.py; fi +- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then + python3 tools/deploy.py; + fi env: global: - secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg= From afb28d01eab012adbd81b32f4a110254894a5cf4 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 17:25:53 +0200 Subject: [PATCH 296/311] Improve sqf validator - fix not all string cases were caught - add basic semi column validation after code blocks - Improve print output - Fix a dot in file path when reporting an error --- tools/sqf_validator.py | 94 +++++++++++++++++++++++++++++++++--------- 1 file changed, 75 insertions(+), 19 deletions(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index e4af90f50f..7d1780c5e0 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -6,6 +6,16 @@ import ntpath import sys import argparse +def validKeyWordAfterCode(content, index): + keyWords = ["for", "do", "count", "each", "forEach", "else", "and", "not", "isEqualTo", "in", "call", "spawn", "execVM", "catch"]; + for word in keyWords: + try: + subWord = content.index(word, index, index+len(word)) + return True; + except: + pass + return False + def check_sqf_syntax(filepath): bad_count_file = 0 def pushClosing(t): @@ -17,61 +27,96 @@ def check_sqf_syntax(filepath): with open(filepath, 'r') as file: content = file.read() + + # Store all brackets we find in this file, so we can validate everything on the end brackets_list = [] + # To check if we are in a comment block isInCommentBlock = False checkIfInComment = False + # Used in case we are in a line comment (//) ignoreTillEndOfLine = False + # Used in case we are in a comment block (/* */). This is true if we detect a * inside a comment block. + # If the next character is a /, it means we end our comment block. checkIfNextIsClosingBlock = False - isInString = False + # We ignore everything inside a string + isInString = False + # Used to store the starting type of a string, so we can match that to the end of a string + inStringType = ''; + + lastIsCurlyBrace = False + checkForSemiColumn = False + + # Extra information so we know what line we find errors at lineNumber = 0 + indexOfCharacter = 0 + # Parse all characters in the content of this file to search for potential errors for c in content: - if c == '\n': + if (lastIsCurlyBrace): + lastIsCurlyBrace = False + checkForSemiColumn = True + + if c == '\n': # Keeping track of our line numbers lineNumber += 1 # so we can print accurate line number information when we detect a possible error - if (isInString): + if (isInString): # while we are in a string, we can ignore everything else, except the end of the string if (c == inStringType): isInString = False - elif (isInCommentBlock == False): # if we are not in a comment block, we will check if we are at the start of one or count the () {} and [] - if (checkIfInComment): # This means we have encountered a /, so we are now checking if this is an inline comment or a comment block + # if we are not in a comment block, we will check if we are at the start of one or count the () {} and [] + elif (isInCommentBlock == False): + + # This means we have encountered a /, so we are now checking if this is an inline comment or a comment block + if (checkIfInComment): checkIfInComment = False if c == '*': # if the next character after / is a *, we are at the start of a comment block isInCommentBlock = True - if (c == '/'): # Otherwise, will check if we are in an line comment + elif (c == '/'): # Otherwise, will check if we are in an line comment ignoreTillEndOfLine = True # and an line comment is a / followed by another / (//) We won't care about anything that comes after it + if (isInCommentBlock == False): if (ignoreTillEndOfLine): # we are in a line comment, just continue going through the characters until we find an end of line if (c == '\n'): ignoreTillEndOfLine = False - else: - if (c == '"'): + else: # validate brackets + if (c == '"' or c == "'"): isInString = True inStringType = c + elif (c == '#'): + ignoreTillEndOfLine = True elif (c == '/'): checkIfInComment = True elif (c == '('): brackets_list.append('(') elif (c == ')'): if (brackets_list[-1] in ['{', '[']): - print("Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath,lineNumber)) + print("ERROR: Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 brackets_list.append(')') elif (c == '['): brackets_list.append('[') elif (c == ']'): if (brackets_list[-1] in ['{', '(']): - print("Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath,lineNumber)) + print("ERROR: Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 brackets_list.append(']') elif (c == '{'): brackets_list.append('{') elif (c == '}'): + lastIsCurlyBrace = True if (brackets_list[-1] in ['(', '[']): - print("Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath,lineNumber)) + print("ERROR: Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 brackets_list.append('}') - else: + + if (checkForSemiColumn): + if (c not in [' ', '\t', '\n', '/']): # keep reading until no white space or comments + checkForSemiColumn = False + if (c not in [']', ')', '}', ';', ',', '&', '!', '|', '='] and not validKeyWordAfterCode(content, indexOfCharacter)): # , 'f', 'd', 'c', 'e', 'a', 'n', 'i']): + print("ERROR: Possible missing semi-column ':' detected at {0} Line number: {1}".format(filepath,lineNumber)) + bad_count_file += 1 + + else: # Look for the end of our comment block if (c == '*'): checkIfNextIsClosingBlock = True; elif (checkIfNextIsClosingBlock): @@ -79,39 +124,50 @@ def check_sqf_syntax(filepath): isInCommentBlock = False elif (c != '*'): checkIfNextIsClosingBlock = False + indexOfCharacter += 1 if brackets_list.count('[') != brackets_list.count(']'): - print("A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}".format(filepath,brackets_list.count('['),brackets_list.count(']'))) + print("ERROR: A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}".format(filepath,brackets_list.count('['),brackets_list.count(']'))) bad_count_file += 1 if brackets_list.count('(') != brackets_list.count(')'): - print("A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}".format(filepath,brackets_list.count('('),brackets_list.count(')'))) + print("ERROR: A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}".format(filepath,brackets_list.count('('),brackets_list.count(')'))) bad_count_file += 1 if brackets_list.count('{') != brackets_list.count('}'): - print("A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}".format(filepath,brackets_list.count('{'),brackets_list.count('}'))) + print("ERROR: A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}".format(filepath,brackets_list.count('{'),brackets_list.count('}'))) bad_count_file += 1 return bad_count_file def main(): print("#########################") - print("# Validate SQF files missing brackets #") + print("# Validate SQF #") print("#########################") sqf_list = [] bad_count = 0 parser = argparse.ArgumentParser() - parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") + parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="") args = parser.parse_args() - for root, dirnames, filenames in os.walk('../addons' + '/' + args.module): + # Allow running from root directory as well as from inside the tools directory + rootDir = "../addons" + if (os.path.exists("addons")): + rootDir = "addons" + + for root, dirnames, filenames in os.walk(rootDir + '/' + args.module): for filename in fnmatch.filter(filenames, '*.sqf'): sqf_list.append(os.path.join(root, filename)) for filename in sqf_list: bad_count = bad_count + check_sqf_syntax(filename) - print("Bad Count {0}".format(bad_count)) + print("Checked {0} files. Errors detected {1}.".format(len(sqf_list), bad_count)) + if (bad_count == 0): + print("Sqf validation passed") + else: + print("Sqf validation failed") + return bad_count if __name__ == "__main__": From d6ab43d77ea7467abc3ed709f3b39d34f0132cb9 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 17:35:55 +0200 Subject: [PATCH 297/311] Possible fix for travis build failure --- tools/sqf_validator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index 7d1780c5e0..6cfa3e4db3 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -25,7 +25,7 @@ def check_sqf_syntax(filepath): def popClosing(): closing << closingStack.pop() - with open(filepath, 'r') as file: + with open(filepath, 'r', encoding='utf-8', errors='ignore') as file: content = file.read() # Store all brackets we find in this file, so we can validate everything on the end From b524c28d53cfd3accc2120fab30947d8fc2eb844 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 18:31:39 +0200 Subject: [PATCH 298/311] Improved output text - Capitalized SQF everywhere - Break checked files and errors into multiple lines - Add a break by line between reported errors and result - Fix incorrect report message for semi-columns - Change excessive usage of # prints on start --- tools/sqf_validator.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index 6cfa3e4db3..d76434f81d 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -113,7 +113,7 @@ def check_sqf_syntax(filepath): if (c not in [' ', '\t', '\n', '/']): # keep reading until no white space or comments checkForSemiColumn = False if (c not in [']', ')', '}', ';', ',', '&', '!', '|', '='] and not validKeyWordAfterCode(content, indexOfCharacter)): # , 'f', 'd', 'c', 'e', 'a', 'n', 'i']): - print("ERROR: Possible missing semi-column ':' detected at {0} Line number: {1}".format(filepath,lineNumber)) + print("ERROR: Possible missing semi-column ';' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 else: # Look for the end of our comment block @@ -139,9 +139,7 @@ def check_sqf_syntax(filepath): def main(): - print("#########################") - print("# Validate SQF #") - print("#########################") + print("Validating SQF") sqf_list = [] bad_count = 0 @@ -162,11 +160,12 @@ def main(): for filename in sqf_list: bad_count = bad_count + check_sqf_syntax(filename) - print("Checked {0} files. Errors detected {1}.".format(len(sqf_list), bad_count)) + + print("------\nChecked {0} files\nErrors detected: {1}".format(len(sqf_list), bad_count)) if (bad_count == 0): - print("Sqf validation passed") + print("SQF validation PASSED") else: - print("Sqf validation failed") + print("SQF validation FAILED") return bad_count From d926a4a52a6ac1acf0341f0d8d92f14e44855d61 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sun, 11 Oct 2015 23:20:56 +0200 Subject: [PATCH 299/311] Add shebang line to specify python version to SQF validator and replace slash with backslash --- tools/sqf_validator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index d76434f81d..8af8e08a61 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import fnmatch import os @@ -149,11 +150,11 @@ def main(): args = parser.parse_args() # Allow running from root directory as well as from inside the tools directory - rootDir = "../addons" + rootDir = "..\\addons" if (os.path.exists("addons")): rootDir = "addons" - for root, dirnames, filenames in os.walk(rootDir + '/' + args.module): + for root, dirnames, filenames in os.walk(rootDir + '\\' + args.module): for filename in fnmatch.filter(filenames, '*.sqf'): sqf_list.append(os.path.join(root, filename)) From 7062f60f0a667cc3a3e59859d75eaca4e2bd4d35 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 12 Oct 2015 01:07:20 -0500 Subject: [PATCH 300/311] Fix UBC from #2726 --- addons/cargo/CfgVehicles.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 1fae56749f..111c4d9956 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -222,12 +222,6 @@ class CfgVehicles { class B_supplyCrate_F: ReammoBox_F { GVAR(size) = 6; }; - class O_supplyCrate_F: ReammoBox_F { - GVAR(size) = 6; - }; - class I_supplyCrate_F: ReammoBox_F { - GVAR(size) = 6; - }; class IG_supplyCrate_F: ReammoBox_F { GVAR(size) = 6; }; From 5d76395914271470ed09b22ccc31676902ffab67 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 12 Oct 2015 11:27:38 -0500 Subject: [PATCH 301/311] #2734 - Map effects / flashlights for TrippleHead --- addons/map/functions/fnc_simulateMapLight.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/map/functions/fnc_simulateMapLight.sqf b/addons/map/functions/fnc_simulateMapLight.sqf index 9554409e15..ec08f14d4c 100644 --- a/addons/map/functions/fnc_simulateMapLight.sqf +++ b/addons/map/functions/fnc_simulateMapLight.sqf @@ -22,7 +22,7 @@ _hmd = hmd ACE_player; _flashlight = GVAR(flashlightInUse); //map width (on screen) in pixels -_screenSize = 640 * safeZoneW; +_screenSize = 640 * safeZoneWAbs; //resolution params (every frame in case resolution change) getResolution params ["_resX", "_resY", "_viewPortX", "_viewPortY", "", "_uiScale"]; @@ -58,7 +58,7 @@ if (_flashlight == "") then { if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"}; _size = getNumber (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Size"); _flashTex = format[QUOTE(PATHTOF_SYS(ace,flashlights,UI\Flashlight_Beam_%1_ca.paa)), _colour]; - _beamSize = _screenSize / _size; + _beamSize = (safeZoneW/safeZoneWAbs) * _screenSize / _size; //after 5x zoom, it's simulated to be fixed (it actually gets bigger relative to zoom) if (_mapScale < 0.2) then {_beamSize = _beamSize / (_mapScale * (1 / 0.2))}; From 3e4906fa7e1768ff974e48fafc338dbbca333e4a Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 12 Oct 2015 21:29:50 +0200 Subject: [PATCH 302/311] Revert the backslash in sqf validator - Use a forward slash in path for travis to work properly --- tools/sqf_validator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index 8af8e08a61..7e7c0183d6 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -150,11 +150,11 @@ def main(): args = parser.parse_args() # Allow running from root directory as well as from inside the tools directory - rootDir = "..\\addons" + rootDir = "../addons" if (os.path.exists("addons")): rootDir = "addons" - for root, dirnames, filenames in os.walk(rootDir + '\\' + args.module): + for root, dirnames, filenames in os.walk(rootDir + '/' + args.module): for filename in fnmatch.filter(filenames, '*.sqf'): sqf_list.append(os.path.join(root, filename)) From f7fe0c08e0af57d2529731d348b31ffd5e64caa6 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 14 Oct 2015 11:15:44 -0500 Subject: [PATCH 303/311] #2391 - Use AGL for sitting setPos --- addons/sitting/functions/fnc_sit.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 5e9c36947e..b6c853f645 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -58,8 +58,8 @@ _sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber // Set direction and position _player setDir _sitDirection; -// No need for ATL/ASL as modelToWorld returns in format position -_player setPos (_seat modelToWorld _sitPosition); +//modelToWorld returns AGL +_player setPosASL (AGLtoASL (_seat modelToWorld _sitPosition)); // Set variables _player setVariable [QGVAR(isSitting), true]; From 38be666b37681affff13d2c8d4b286b8b5650447 Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Fri, 16 Oct 2015 18:34:31 +0200 Subject: [PATCH 304/311] Use "flat-square" badge style --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ecbc0dd01d..538dc09b08 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,25 @@

- ACE3 Version + ACE3 Version - ACE3 Download + ACE3 Download - ACE3 Issues + ACE3 Issues - BIF Thread + BIF Thread - ACE3 License + ACE3 License - ACE3 Slack + ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

From b3032da51cb973d416709428eb68ac7554e09b8e Mon Sep 17 00:00:00 2001 From: bux578 Date: Sat, 17 Oct 2015 11:48:12 +0200 Subject: [PATCH 305/311] reorder badges, social networks --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ecbc0dd01d..0089dca494 100644 --- a/README.md +++ b/README.md @@ -8,23 +8,24 @@ ACE3 Download - - ACE3 Issues - - - BIF Thread - ACE3 License + + ACE3 Issues + ACE3 Slack ACE3 Build Status + + BIF Thread +

-

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

+

Requires the latest version of CBA A3.
+Visit us on Twitter | Facebook | YouTube | Reddit

**ACE3** is a joint effort by the teams behind **ACE2**, **AGM** and **CSE** to improve the realism and authenticity of Arma 3. @@ -43,6 +44,7 @@ The mod is **built modularly**, so almost any included PBO can be easily removed - Captivity system - Explosives system, including different trigger types - Map screen improvements – marker placement and map tools +- Logistics - Advanced missile guidance and laser designation #### Additional features From 26c051d397b9d63213c82dd8015b5a23f6beadc2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 18 Oct 2015 11:48:21 -0500 Subject: [PATCH 306/311] Sitting - Fix missing semicolon --- addons/sitting/CfgEventHandlers.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp index da7efe1601..3481fa1fb5 100644 --- a/addons/sitting/CfgEventHandlers.hpp +++ b/addons/sitting/CfgEventHandlers.hpp @@ -22,7 +22,7 @@ class Extended_Killed_EventHandlers { class Extended_InitPost_EventHandlers { class ThingX { class ADDON { - init = QUOTE(_this call DFUNC(addSitActions)) + init = QUOTE(_this call DFUNC(addSitActions)); }; }; }; From 602832cc0c0d3f0c9bdf43bd9b213ea96d6ab062 Mon Sep 17 00:00:00 2001 From: bux578 Date: Mon, 19 Oct 2015 07:29:02 +0200 Subject: [PATCH 307/311] adjust german translations --- addons/captives/stringtable.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 0e1714d225..0ab6cb457d 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -255,7 +255,7 @@ Require Players to surrender before they can be arrested - Spieler müssen zunächst kapitulieren bevor sie gefangen genommen werden können. + Spieler müssen sich erst ergeben, bevor sie gefangen genommen werden können Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować Requer que jogadores se rendam antes de poderem ser presos Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать @@ -263,7 +263,7 @@ Surrendering only - Nur Kapitulieren. + Nur Ergeben Tylko kapitulacja Somente rendição Только сдавшийся в плен @@ -271,7 +271,7 @@ Surrendering or No weapon - Kapitulieren oder keine Waffe. + Ergeben oder keine Waffe Kapitulacja lub brak broni Rendição ou desarmado Сдавшийся или безоружный From a873481c361e9871c27a21f237d4e650a6072227 Mon Sep 17 00:00:00 2001 From: bux578 Date: Mon, 19 Oct 2015 07:37:14 +0200 Subject: [PATCH 308/311] improve german readme --- docs/README_DE.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index 07af1a092c..dc571fe9b2 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -30,24 +30,24 @@ Da die MOD vollkommen als **open-source** Projekt gestaltet ist, steht es jedem frei Änderungen vorzuschlagen, oder seine eigene, modifizierte Version zu erstellen, solange diese ebenfalls der Öffentlichkeit zugänglich ist und mit GNU General Public License übereinstimmt. (Weitere Informationen ist der Lizenzdatei in diesem Projekt entnehmbar) -Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, da das Feature nicht gewünscht ist, oder es mit einer anderen MOD in Konflikt gerät etc..Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am Sanitätssystem), sodass eine individuelle Erfahrung gewährleistet werden kann. +Die Mod ist **modular aufgebaut**. Beinahe jede PBO kann entfernt werden, sodass jede Gemeinschaft ihre eigene Version der Mod unterhalten kann. Dies kann zum Beispiel einige Funktionalitäten ausschließen, wenn gewisse Features nicht gewünscht sind, oder es mit einer anderen Mod in Konflikt gerät. Ebenfalls können viele Einstellungen vom Missionsersteller vorgenommen werden (u.a. am Sanitätssystem), sodass eine individuelle Erfahrung gewährleistet werden kann. ### Hauptmerkmale -- Vollkommen neues 3D Interaktionssystem +- Vollkommen neues 3D-Interaktionssystem - Leistungs- und stabilitätsoptimiert - Hauptmerkmal auf Modularität und individuelle Anpassungsmöglichkeiten - Neue, flexible Spieler- und Servereinstellungen -- Verbessertes Sanitätssystem mit unterschiedlichen Stufen (Basis/Erweitert) Spielbarkeit/Realismus +- Verbessertes Sanitätssystem mit unterschiedlichen Stufen (Basis/Erweitert) - Echte und stetige Wettersynchronisation - Ballistik basierend auf vielen Faktoren u.a. Wetter und Wind - Gefangenensystem -- Sprengtoffmechaniken mit den unterschiedlichsten Zündern -- Kartenverbesserungen – Setzen von Markierungen ; Kartenwerkzeuge -- Erweitertes Raketenlenksystem +- Sprengtoffmechaniken mit unterschiedlichen Zündern +- Kartenverbesserungen – Setzen von Markierungen / Kartenwerkzeuge +- Erweitertes Raketenlenksystem #### Weitere Mechaniken - Tragen und Ziehen -- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder in der echten Welt +- Waffen und Fahrzeuge tragen die Namen ihrer Vorbilder aus der echten Welt - Ein Feuerleitsystem (FLS) für Hubschrauber und Panzer - Viele Funktionen werden in C/C++ Erweiterungen berechnet - Rückstrahlzonen- und Überdrucksimulation @@ -55,11 +55,11 @@ Die Mod ist **modular gestaltet** — beinahe jede PBO kann entfernt werden, sod - Realistische G-Kräfte - Fahrzeuge abschließen - Realistische Nacht- und Thermalsicht -- Magazin umpacken +- Magazine umpacken - Realistische Waffen Er- bzw. Überhitzung -- Temporäre Taubheit bei zu lauten Geräuschen -- Verbesserte Ragdollphysik -- Verbesserte Interaktionen für AARs und Munitionsschlepper +- Temporäre Taubheit bei zu lauten Geräuschen +- Verbesserte Ragdoll-Physik +- Verbesserte Interaktionen für MG2s und Munitionsschlepper - Einstellbare Zielfernrohre - Keine Ruheanimationen bei gesenkter Waffe - Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen @@ -72,12 +72,12 @@ Du hast ACE3 installiert, hast aber keine Ahnung was und wie alles funktioniert - [Erste Schritte](http://ace3mod.com/wiki/user/getting-started.html). #### Mitwirken -Wenn du bei der Entwicklung der MOD mithelfen möchtest kannst du dies tun, indem du nach Fehlern Ausschau hältst oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" einfach dieses Archiv (bzw. "repository") und erstelle deine "Pull-Request", welche von anderen Entwicklern und Beiträgern überprüft wird. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gütligen Email-Adresse ein. +Wenn du bei der Entwicklung von ACE3 mithelfen möchtest, kannst du dies tun, indem du nach Fehlern Ausschau hältst oder neue Funktionen vorschlägst. Um etwas beizutragen, "Forke" dieses Repository und erstelle deine "Pull-Requests", welche von anderen Entwicklern und Beiträgern überprüft werden. Bitte trage dich dabei in [`AUTHORS.txt`](https://github.com/acemod/ACE3/blob/master/AUTHORS.txt) mit deinem Nutzernamen und einer gültigen Email-Adresse ein. -Um einen Fehler, Anregungen oder neue Funktionalitäten uns mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: +Um uns einen Fehler, Anregungen oder neue Funktionalitäten mitzuteilen: Nutze unseren [Issue Tracker](https://github.com/acemod/ACE3/issues). Besuche auch: - [Wie kann ich ein Problem melden](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) - [Wie kann ich ein Wunsch zu einer neuen Funktion mitteilen?](http://ace3mod.com/wiki/user/how-to-make-a-feature-request.html) -#### Testen & MOD erstellen -Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir einfach die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter. -Wie du deine eigene Entwicklungsumgebung und eine Testversion von ACE3 erstellst folge [dieser Anleitung](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md). +#### Testen & Mod erstellen +Wenn du die neusten Entwicklungen erleben und uns dabei helfen möchtest bestehende Fehler zu entdecken, lade dir die "Master Branch" herunter. Entweder nutzt du [Git](https://help.github.com/articles/fetching-a-remote/) - wenn die Schritte bekannt sind - oder du lädst es dir direkt über [diesen Link](https://github.com/acemod/ACE3/archive/master.zip) herunter. +Wie du deine eigene Entwicklungsumgebung und eine Testversion von ACE3 erstellst, folge [dieser Anleitung](https://github.com/acemod/ACE3/blob/master/documentation/development/setting-up-the-development-environment.md). From c5fd41b9a1993677b62ac0766aabcb7ffa54af0f Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Mon, 19 Oct 2015 09:44:40 +0200 Subject: [PATCH 309/311] Add flat badges to other READMEs --- docs/README_DE.md | 14 +++++++------- docs/README_PL.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index 24be427392..7fa29c7489 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -3,25 +3,25 @@

- ACE3 Version + ACE3 Version - ACE3 Download + ACE3 Download - ACE3 Issues + ACE3 Issues - BIF Thread + BIF Thread - ACE3 License + ACE3 License - ACE3 Slack + ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Benötigt die aktuellste Version von CBA A3. Besucht uns auf Facebook | YouTube | Twitter | Reddit

diff --git a/docs/README_PL.md b/docs/README_PL.md index b12f574b6f..4d7f5d1e09 100644 --- a/docs/README_PL.md +++ b/docs/README_PL.md @@ -3,25 +3,25 @@

- ACE3 Wersja + ACE3 Wersja - ACE3 Pobierz + ACE3 Pobierz - ACE3 Zagadnienia + ACE3 Zagadnienia - Temat BIF + Temat BIF - ACE3 Licencja + ACE3 Licencja - ACE3 Slack + ACE3 Slack - ACE3 Build Status + ACE3 Build Status

Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit

From 5db3f6111336418ff9759d86072659b4fae4a455 Mon Sep 17 00:00:00 2001 From: bux578 Date: Mon, 19 Oct 2015 10:59:48 +0200 Subject: [PATCH 310/311] add back the flat-square styles --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a13712be1..a407f5a299 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ ACE3 Download - ACE3 Issues + ACE3 Issues - BIF Thread + BIF Thread ACE3 License From 9c28ea500423b056237ad984f609b3e4a8468c66 Mon Sep 17 00:00:00 2001 From: licht-im-Norden87 Date: Mon, 19 Oct 2015 17:21:54 +0200 Subject: [PATCH 311/311] Readme_DE.md, small grammar fix --- docs/README_DE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_DE.md b/docs/README_DE.md index 9f85287589..a51c562de8 100644 --- a/docs/README_DE.md +++ b/docs/README_DE.md @@ -63,7 +63,7 @@ Die Mod ist **modular aufgebaut**. Beinahe jede PBO kann entfernt werden, sodass - Einstellbare Zielfernrohre - Keine Ruheanimationen bei gesenkter Waffe - Über Hindernisse springen, über Mauern klettern, Zäune durchtrennen -- Keine "sprechender Charkater" +- Kein "sprechender Charkater" - Vector IV, MicroDAGR und Kestrel
***und noch viel viel mehr...***