2017-08-10 11:32:55 +00:00
|
|
|
/*
|
|
|
|
* Author: 654wak654
|
|
|
|
* Modifies interaction color of vehicle selection to show it's current damage.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Target <OBJECT>
|
|
|
|
* 1: Player <OBJECT>
|
|
|
|
* 2: Args <Any>
|
|
|
|
* 3: Action Data <ARRAY>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [cursorObject, ace_player, [], []] call ace_repair_fnc_modifySelectionInteraction;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2018-04-19 17:31:00 +00:00
|
|
|
params ["_target", "", "_args", "_actionData"];
|
2017-08-10 11:32:55 +00:00
|
|
|
|
|
|
|
// Interaction wrenches numbered 0..8, white to red.
|
|
|
|
// Convert damage to number (rounding up), so that even slight damage can bee seen
|
|
|
|
|
|
|
|
private _fileName = format [
|
|
|
|
QPATHTOF(ui\repair_%1_ca.paa),
|
|
|
|
ceil (linearConversion [0, 1, _target getHitPointDamage (_args select 0), 0, 8, true])
|
|
|
|
];
|
2018-04-19 17:31:00 +00:00
|
|
|
TRACE_2("modifyInteraction",_target,_fileName);
|
2017-08-10 11:32:55 +00:00
|
|
|
_actionData set [2, _fileName];
|