diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 15627dc893e..e6223b6702a 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)); + }; + }; icon = "iconObject_circle"; mapSize = 0.7; diff --git a/addons/repair/XEH_PREP.hpp b/addons/repair/XEH_PREP.hpp index e3604c95a70..692bee6112c 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 00000000000..cff0fbe6e89 --- /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 00000000000..f7c2348f295 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 00000000000..b143d3cb430 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 00000000000..062c4e5a6c2 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 00000000000..88bc0b87ab6 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 00000000000..24584de084a 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 00000000000..41a7e5b42d1 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 00000000000..68dffc516f8 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 00000000000..087359e3244 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 00000000000..1e78785d0cd Binary files /dev/null and b/addons/repair/ui/damage_8_ca.paa differ