Show damage on repair items interaction point (#4448)

* Show damage on repair items interaction point

* Fix dot size

* Change scaling
This commit is contained in:
PabstMirror 2016-09-24 15:15:02 -05:00 committed by GitHub
parent bc520c7fe7
commit 9451716a44
12 changed files with 34 additions and 0 deletions

View File

@ -313,6 +313,11 @@ class CfgVehicles {
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {};
};
class ACE_Actions {
class ACE_MainActions {
modifierFunction = QUOTE(_this call FUNC(modifyInteraction));
};
};
accuracy = 0.2;
vehicleClass = "ACE_Logistics_Items";

View File

@ -23,6 +23,7 @@ PREP(isEngineer);
PREP(isInRepairFacility);
PREP(isNearRepairVehicle);
PREP(isRepairVehicle);
PREP(modifyInteraction);
PREP(moduleAddSpareParts);
PREP(moduleAssignEngineer);
PREP(moduleAssignRepairVehicle);

View File

@ -0,0 +1,28 @@
/*
* Author: PabstMirror
* Modifies the base interaction point for repair items to show it's current damage
*
* Arguments:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
* 2: Args <Any>
* 3: Action Data <ARRAY>
*
* Return Value:
* Nothing
*
* Example:
* [cursorObject, player, [], []] call ace_repair_fnc_modifyInteraction;
*
* Public: No
*/
#include "script_component.hpp"
params ["_target", "_player", "_args", "_actionData"];
TRACE_4("params",_target,_player,_args,_actionData);
// Interaction dots 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\damage_%1_ca.paa), ceil (linearConversion [0, 1, damage _target, 0, 8, true])];
_actionData set [2, _fileName];

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.