ACE3/addons/overheating/functions/fnc_displayTemperature.sqf
Dedmen Miller e2ac18a05d [WIP] Fix script errors reporting wrong line numbers (#6407)
* advanced_ballistics

* advanced_fatigue

* advanced_throwing

* ai

* aircraft

* arsenal

* atragmx

* attach

* backpacks

* ballistics

* captives

* cargo

* chemlights

* common

* concertina_wire

* cookoff

* dagr

* disarming

* disposable

* dogtags

* dragging

* explosives

* fastroping

* fcs

* finger

* frag

* gestures

* gforces

* goggles

* grenades

* gunbag

* hearing

* hitreactions

* huntir

* interact_menu

* interaction

* inventory

* kestrel4500

* laser

* laserpointer

* logistics_uavbattery

* logistics_wirecutter

* magazinerepack

* map

* map_gestures

* maptools

* markers

* medical

* medical_ai

* medical_blood

* medical_menu

* microdagr

* minedetector

* missileguidance

* missionmodules

* mk6mortar

* modules

* movement

* nametags

* nightvision

* nlaw

* optics

* optionsmenu

* overheating

* overpressure

* parachute

* pylons

* quickmount

* rangecard

* rearm

* recoil

* refuel

* reload

* reloadlaunchers

* repair

* respawn

* safemode

* sandbag

* scopes

* slideshow

* spectator

* spottingscope

* switchunits

* tacticalladder

* tagging

* trenches

* tripod

* ui

* vector

* vehiclelock

* vehicles

* viewdistance

* weaponselect

* weather

* winddeflection

* yardage450

* zeus

* arsenal defines.hpp

* optionals

* DEBUG_MODE_FULL 1

* DEBUG_MODE_FULL 2

* Manual fixes

* Add SQF Validator check for #include after block comment

* explosives fnc_openTimerUI

* fix uniqueItems
2018-09-17 14:19:29 -05:00

53 lines
1.3 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: Commy2 and esteldunedain
* Displays the weapon temperature
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Weapon <STRING>
*
* Return Values:
* None
*
* Example:
* [player, currentWeapon player] call ace_overheating_fnc_displayTemperature
*
* Public: No
*/
params ["_unit", "_weapon"];
TRACE_2("params",_unit,_weapon);
// Get unit's weapon's temperature:
private _tempVarName = format [QGVAR(%1_temp), _weapon];
private _temperature = _unit getVariable [_tempVarName, 0];
private _scaledTemperature = (_temperature / 1000) min 1;
private _color = [
2 * (_scaledTemperature * 2 min 1) min 1,
2 * (1 - (_scaledTemperature * 2 min 1)) min 1,
00
];
private _count = round (12 * _scaledTemperature);
private _string = "";
for "_a" from 1 to _count do {
_string = _string + "|";
};
private _text = [_string, _color] call EFUNC(common,stringToColoredText);
_string = "";
for "_a" from (_count + 1) to 12 do {
_string = _string + "|";
};
TRACE_3("",_temperature,_color,_string);
_text = composeText [_text, [_string, "#808080"] call EFUNC(common,stringToColoredText)];
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
[_text, _picture] call EFUNC(common,displayTextPicture);