2015-01-16 02:36:31 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: Commy2 and esteldunedain
|
2015-01-17 06:13:05 +00:00
|
|
|
* Displays the weapon temperature
|
2015-01-16 02:36:31 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2015-02-08 22:54:12 +00:00
|
|
|
* 0: Player <OBJECT>
|
|
|
|
* 1: Weapon <STRING>
|
2015-01-16 02:36:31 +00:00
|
|
|
*
|
|
|
|
* Return Values:
|
|
|
|
* None
|
|
|
|
*
|
2015-02-08 22:54:12 +00:00
|
|
|
* Public: No
|
2015-01-16 02:36:31 +00:00
|
|
|
*/
|
2015-01-16 01:00:01 +00:00
|
|
|
#include "\z\ace\addons\overheating\script_component.hpp"
|
|
|
|
|
2015-01-17 06:13:05 +00:00
|
|
|
EXPLODE_2_PVT(_this,_player,_weapon);
|
2015-01-16 01:00:01 +00:00
|
|
|
|
2015-04-01 17:29:22 +00:00
|
|
|
private ["_temperature", "_scaledTemperature", "_color", "_count", "_string", "_text", "_picture"];
|
2015-01-16 01:00:01 +00:00
|
|
|
|
2015-04-01 17:29:22 +00:00
|
|
|
// Calculate cool down of weapon since last shot
|
|
|
|
_temperature = [_player, _weapon, 0] call FUNC(updateTemperature)
|
2015-01-16 01:00:01 +00:00
|
|
|
_scaledTemperature = (_temperature / 1000) min 1;
|
|
|
|
|
|
|
|
_color = [
|
|
|
|
2 * _scaledTemperature min 1,
|
|
|
|
2 * (1 - _scaledTemperature) min 1,
|
|
|
|
00
|
|
|
|
];
|
|
|
|
|
2015-04-01 17:29:22 +00:00
|
|
|
_count = 2 + round (10 * _scaledTemperature);
|
2015-01-16 01:00:01 +00:00
|
|
|
_string = "";
|
|
|
|
for "_a" from 1 to _count do {
|
|
|
|
_string = _string + "|";
|
|
|
|
};
|
|
|
|
_text = [_string, _color] call EFUNC(common,stringToColoredText);
|
|
|
|
|
|
|
|
_string = "";
|
|
|
|
for "_a" from (_count + 1) to 12 do {
|
|
|
|
_string = _string + "|";
|
|
|
|
};
|
|
|
|
|
|
|
|
_text = composeText [
|
|
|
|
_text,
|
2015-04-01 17:29:22 +00:00
|
|
|
[_string, [0.5, 0.5, 0.5]] call EFUNC(common,stringToColoredTex)t
|
2015-01-16 01:00:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
|
|
|
|
|
|
|
[_text, _picture] call EFUNC(common,displayTextPicture);
|