diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index e073c3d2ff..847258f6da 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -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"; diff --git a/addons/repair/XEH_PREP.hpp b/addons/repair/XEH_PREP.hpp index e3604c95a7..692bee6112 100644 --- a/addons/repair/XEH_PREP.hpp +++ b/addons/repair/XEH_PREP.hpp @@ -23,6 +23,7 @@ PREP(isEngineer); PREP(isInRepairFacility); PREP(isNearRepairVehicle); PREP(isRepairVehicle); +PREP(modifyInteraction); PREP(moduleAddSpareParts); PREP(moduleAssignEngineer); PREP(moduleAssignRepairVehicle); diff --git a/addons/repair/functions/fnc_modifyInteraction.sqf b/addons/repair/functions/fnc_modifyInteraction.sqf new file mode 100644 index 0000000000..cff0fbe6e8 --- /dev/null +++ b/addons/repair/functions/fnc_modifyInteraction.sqf @@ -0,0 +1,28 @@ +/* + * Author: PabstMirror + * Modifies the base interaction point for repair items to show it's current damage + * + * Arguments: + * 0: Target + * 1: Player + * 2: Args + * 3: Action Data + * + * 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]; diff --git a/addons/repair/ui/damage_0_ca.paa b/addons/repair/ui/damage_0_ca.paa new file mode 100644 index 0000000000..f7c2348f29 Binary files /dev/null and b/addons/repair/ui/damage_0_ca.paa differ diff --git a/addons/repair/ui/damage_1_ca.paa b/addons/repair/ui/damage_1_ca.paa new file mode 100644 index 0000000000..b143d3cb43 Binary files /dev/null and b/addons/repair/ui/damage_1_ca.paa differ diff --git a/addons/repair/ui/damage_2_ca.paa b/addons/repair/ui/damage_2_ca.paa new file mode 100644 index 0000000000..062c4e5a6c Binary files /dev/null and b/addons/repair/ui/damage_2_ca.paa differ diff --git a/addons/repair/ui/damage_3_ca.paa b/addons/repair/ui/damage_3_ca.paa new file mode 100644 index 0000000000..88bc0b87ab Binary files /dev/null and b/addons/repair/ui/damage_3_ca.paa differ diff --git a/addons/repair/ui/damage_4_ca.paa b/addons/repair/ui/damage_4_ca.paa new file mode 100644 index 0000000000..24584de084 Binary files /dev/null and b/addons/repair/ui/damage_4_ca.paa differ diff --git a/addons/repair/ui/damage_5_ca.paa b/addons/repair/ui/damage_5_ca.paa new file mode 100644 index 0000000000..41a7e5b42d Binary files /dev/null and b/addons/repair/ui/damage_5_ca.paa differ diff --git a/addons/repair/ui/damage_6_ca.paa b/addons/repair/ui/damage_6_ca.paa new file mode 100644 index 0000000000..68dffc516f Binary files /dev/null and b/addons/repair/ui/damage_6_ca.paa differ diff --git a/addons/repair/ui/damage_7_ca.paa b/addons/repair/ui/damage_7_ca.paa new file mode 100644 index 0000000000..087359e324 Binary files /dev/null and b/addons/repair/ui/damage_7_ca.paa differ diff --git a/addons/repair/ui/damage_8_ca.paa b/addons/repair/ui/damage_8_ca.paa new file mode 100644 index 0000000000..1e78785d0c Binary files /dev/null and b/addons/repair/ui/damage_8_ca.paa differ