From a53a2651175a420548986a1db64ca9861bc33dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 13 Jan 2015 00:30:39 -0300 Subject: [PATCH] overheating: Replace calls to core for calls to common --- addons/overheating/config.cpp | 2 +- addons/overheating/functions/fnc_checkTemperature.sqf | 8 ++++---- addons/overheating/functions/fnc_clearJam.sqf | 4 ++-- addons/overheating/functions/fnc_jamWeapon.sqf | 10 +++++----- addons/overheating/functions/fnc_overheat.sqf | 10 +++++----- addons/overheating/functions/fnc_swapBarrel.sqf | 4 ++-- .../overheating/functions/fnc_swapBarrelCallback.sqf | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index b2db6117b8..3fa17d9be0 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -19,7 +19,7 @@ class CfgPatches { class ACE_Core_Default_Keys { class clearJam { displayName = "$STR_ACE_Overheating_UnjamWeapon"; - condition = QUOTE( [_player] call EFUNC(core,canUseWeapon) && {currentWeapon _player in (_player getVariable [QUOTE(QGVAR(jammedWeapons)), []])} ); + condition = QUOTE( [_player] call EFUNC(common,canUseWeapon) && {currentWeapon _player in (_player getVariable [QUOTE(QGVAR(jammedWeapons)), []])} ); statement = QUOTE( [_player, currentMuzzle _player, false] call FUNC(clearJam); ); key = 19; shift = 1; diff --git a/addons/overheating/functions/fnc_checkTemperature.sqf b/addons/overheating/functions/fnc_checkTemperature.sqf index 97d0d70d73..4db5105843 100644 --- a/addons/overheating/functions/fnc_checkTemperature.sqf +++ b/addons/overheating/functions/fnc_checkTemperature.sqf @@ -17,7 +17,7 @@ _this spawn { // Calculate cooling _temperature = [_temperature, _barrelMass, time - _time] call FUNC(cooldown); - ["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(core,log); + ["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log); // Store new temperature _time = time; @@ -46,7 +46,7 @@ _this spawn { for "_a" from 1 to _count do { _string = _string + "|"; }; - _text = [_string, _color] call EFUNC(core,stringToColoredText); + _text = [_string, _color] call EFUNC(common,stringToColoredText); _string = ""; for "_a" from (_count + 1) to 12 do { @@ -55,10 +55,10 @@ _this spawn { _text = composeText [ _text, - [_string, [0.5, 0.5, 0.5]] call EFUNC(core,stringToColoredTex)t + [_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredTex)t ]; _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); - [_text, _picture] call EFUNC(core,displayTextPicture); + [_text, _picture] call EFUNC(common,displayTextPicture); }; diff --git a/addons/overheating/functions/fnc_clearJam.sqf b/addons/overheating/functions/fnc_clearJam.sqf index 198e3ea135..f7ec9568fb 100644 --- a/addons/overheating/functions/fnc_clearJam.sqf +++ b/addons/overheating/functions/fnc_clearJam.sqf @@ -18,7 +18,7 @@ if (_weapon in _jammedWeapons) then { private "_id"; _id = _unit getVariable [QGVAR(JammingActionID), -1]; - [_unit, "DefaultAction", _id] call EFUNC(core,removeActionEventHandler); + [_unit, "DefaultAction", _id] call EFUNC(common,removeActionEventHandler); _unit setVariable [QGVAR(JammingActionID), -1]; }; @@ -34,5 +34,5 @@ if (_weapon in _jammedWeapons) then { _unit playActionNow _clearJamAction; }; - [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(core,displayTextStructured); + [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured); }; diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 1351742690..df5d46046e 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -29,7 +29,7 @@ _unit setVariable [QGVAR(jammedWeapons), _jammedWeapons]; waitUntil {_frame < diag_frameno}; _unit setAmmo [_weapon, _ammo]; - //[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(core,displayTextStructured); + //[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured); }; }; @@ -40,7 +40,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { private ["_condition", "_statement", "_condition2", "_statement2", "_id"]; _condition = { - [_this select 1] call EFUNC(core,canUseWeapon) + [_this select 1] call EFUNC(common,canUseWeapon) && {currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(jammedWeapons), []])} && {!(currentMuzzle (_this select 1) in ((_this select 1) getVariable [QEGVAR(safemode,safedWeapons), []]))} }; @@ -49,7 +49,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { playSound3D ["a3\sounds_f\weapons\Other\dry9.wss", _this select 0]; if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0}) then { - [localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(core,displayTextStructured); + [localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured); GVAR(knowAboutJam) = true; }; }; @@ -62,8 +62,8 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { [_this select 1, currentWeapon (_this select 1), false] call FUNC(clearJam); }; - //_id = [_unit, format ["%1", localize "STR_ACE_Overheating_UnjamWeapon"], "DefaultAction", _condition, _statement, _condition2, _statement2, 10] call EFUNC(core,addActionMenuEventHandler); - _id = [_unit, "DefaultAction", _condition, _statement] call EFUNC(core,addActionEventHandler); + //_id = [_unit, format ["%1", localize "STR_ACE_Overheating_UnjamWeapon"], "DefaultAction", _condition, _statement, _condition2, _statement2, 10] call EFUNC(common,addActionMenuEventHandler); + _id = [_unit, "DefaultAction", _condition, _statement] call EFUNC(common,addActionEventHandler); _unit setVariable [QGVAR(JammingActionID), _id]; }; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index 084af39f2f..e46c9a6c6f 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -102,7 +102,7 @@ _dispersion = getArray (configFile >> "CfgWeapons" >> _weapon >> "ACE_Overheatin _count = count _dispersion; if (_count > 0) then { - _dispersion = ([_dispersion, (_count - 1) * _scaledTemperature] call EFUNC(core,interpolateFromArray)) max 0; + _dispersion = ([_dispersion, (_count - 1) * _scaledTemperature] call EFUNC(common,interpolateFromArray)) max 0; } else { _dispersion = 0; }; @@ -111,12 +111,12 @@ _slowdownFactor = getArray (configFile >> "CfgWeapons" >> _weapon >> "ACE_Overhe _count = count _slowdownFactor; if (_count > 0) then { - _slowdownFactor = ([_slowdownFactor, (_count - 1) * _scaledTemperature] call EFUNC(core,interpolateFromArray)) max 0; + _slowdownFactor = ([_slowdownFactor, (_count - 1) * _scaledTemperature] call EFUNC(common,interpolateFromArray)) max 0; } else { _slowdownFactor = 1; }; -[_projectile, _dispersion - 2 * random _dispersion, _dispersion - 2 * random _dispersion, (_slowdownFactor - 1) * vectorMagnitude _velocity] call EFUNC(core,changeProjectileDirection); +[_projectile, _dispersion - 2 * random _dispersion, _dispersion - 2 * random _dispersion, (_slowdownFactor - 1) * vectorMagnitude _velocity] call EFUNC(common,changeProjectileDirection); // jamming @@ -130,7 +130,7 @@ if (_count == 0) then { _count = 1; }; -_jamChance = [_jamChance, (_count - 1) * _scaledTemperature] call EFUNC(core,interpolateFromArray); +_jamChance = [_jamChance, (_count - 1) * _scaledTemperature] call EFUNC(common,interpolateFromArray); // increase jam chance on dusty grounds if prone if (stance _unit == "PRONE") then { @@ -148,7 +148,7 @@ 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(core,log); +["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/overheating/functions/fnc_swapBarrel.sqf b/addons/overheating/functions/fnc_swapBarrel.sqf index 76abc6b68e..46e22cef64 100644 --- a/addons/overheating/functions/fnc_swapBarrel.sqf +++ b/addons/overheating/functions/fnc_swapBarrel.sqf @@ -7,10 +7,10 @@ _player = _this select 0; _weapon = _this select 1; if (stance _player != "PRONE") then { - [_player, "amovpknlmstpsraswrfldnon", 1] call EFUNC(core,doAnimation); + [_player, "amovpknlmstpsraswrfldnon", 1] call EFUNC(common,doAnimation); }; _player playActionNow "GestureDismountMuzzle"; _player playAction "GestureMountMuzzle"; playSound "ACE_BarrelSwap"; -[10, [_player, _weapon], QFUNC(swapBarrelCallback), localize "STR_ACE_Overheating_SwappingBarrel"] call EFUNC(core,progressBar); +[10, [_player, _weapon], QFUNC(swapBarrelCallback), localize "STR_ACE_Overheating_SwappingBarrel"] call EFUNC(common,progressBar); diff --git a/addons/overheating/functions/fnc_swapBarrelCallback.sqf b/addons/overheating/functions/fnc_swapBarrelCallback.sqf index b02de4bf32..373e451dcf 100644 --- a/addons/overheating/functions/fnc_swapBarrelCallback.sqf +++ b/addons/overheating/functions/fnc_swapBarrelCallback.sqf @@ -9,6 +9,6 @@ _weapon = _this select 1; // don't consume the barrel, but rotate through them. //player removeItem "ACE_SpareBarrel"; -[localize "STR_ACE_Overheating_SwappedBarrel", QUOTE(PATHOF(UI\spare_barrel_ca.paa))] call EFUNC(core,displayTextPicture); +[localize "STR_ACE_Overheating_SwappedBarrel", QUOTE(PATHOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture); _player setVariable [format [QGVAR(%1), _weapon], [0, 0], false];