Display the new weapon temperature right after swapping barrels

This commit is contained in:
esteldunedain 2016-03-01 19:27:39 -03:00
parent 850a499c0e
commit d886289716
3 changed files with 7 additions and 3 deletions

View File

@ -55,3 +55,8 @@ GVAR(cacheSilencerData) = call CBA_fnc_createNamespace;
["firedPlayerNonLocal", DFUNC(firedEH)] call EFUNC(common,addEventHandler);
};
}] call EFUNC(common,addEventHandler);
// Install event handlers to display temp when a barrel was swapped
["barrelSwapped", {
_this call FUNC(displayTemperature);
}] call EFUNC(common,addEventHandler);

View File

@ -48,3 +48,5 @@ _unit setVariable [format [QGVAR(%1_temp), _weapon], _coolestTemp, true];
// Heat up the coolest barrel to the former weapon temperature
[GVAR(storedSpareBarrels), _coolestMag, [_weaponTemp, ACE_Time, _barrelMass]] call CBA_fnc_hashSet;
// Send an event so the local machine can show the hint
["barrelSwapped", _unit, [_unit, _weapon]] call EFUNC(common,objectEvent);

View File

@ -24,9 +24,6 @@ TRACE_2("params",_player,_weapon);
_player playAction QGVAR(GestureMountMuzzle);
playSound "ACE_BarrelSwap";
// don't consume the barrel, but rotate through them.
[localize LSTRING(SwappedBarrel), QUOTE(PATHTOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture);
private _temp = _player getVariable [format [QGVAR(%1_temp), _weapon], 0];
private _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0;