diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 9428cdb1a0..503c11bd97 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -35,8 +35,7 @@ private _hitPointsAddedNames = []; private _hitPointsAddedStrings = []; private _hitPointsAddedAmount = []; private _processedHitpoints = []; -private _icon = QPATHTOF(ui\repair_0_ca.paa); - +private _icon = ["a3\ui_f\data\igui\cfg\actions\repair_ca.paa", "#FFFFFF"]; // Custom position can be defined via config for associated hitpoint private _hitpointPositions = getArray (configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointPositions)); diff --git a/addons/repair/functions/fnc_modifyInteraction.sqf b/addons/repair/functions/fnc_modifyInteraction.sqf index 5b49089268..5795f0c584 100644 --- a/addons/repair/functions/fnc_modifyInteraction.sqf +++ b/addons/repair/functions/fnc_modifyInteraction.sqf @@ -1,18 +1,18 @@ /* - * Author: PabstMirror - * Modifies the base interaction point for repair items to show it's current damage. + * Author: PabstMirror, mharis001 + * Modifies the base interaction point for repair items to show its current damage. * * Arguments: * 0: Target - * 1: Player - * 2: Args + * 1: Player (not used) + * 2: Args (not used) * 3: Action Data * * Return Value: * None * * Example: - * [cursorObject, ace_player, [], []] call ace_repair_fnc_modifyInteraction; + * [cursorObject, ACE_player, [], []] call ace_repair_fnc_modifyInteraction * * Public: No */ @@ -20,9 +20,8 @@ params ["_target", "", "", "_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])]; -TRACE_2("modifyInteraction",_target,_fileName); -_actionData set [2, _fileName]; +// Convert damage to number (round up to show even slight damage) +private _color = ceil linearConversion [0, 1, damage _target, 0, 8, true]; +TRACE_2("Modifying icon color",_target,_color); +(_actionData select 2) set [1, DAMAGE_COLOR_SCALE select _color]; + diff --git a/addons/repair/functions/fnc_modifySelectionInteraction.sqf b/addons/repair/functions/fnc_modifySelectionInteraction.sqf index 5698d55e24..b4e3ed031b 100644 --- a/addons/repair/functions/fnc_modifySelectionInteraction.sqf +++ b/addons/repair/functions/fnc_modifySelectionInteraction.sqf @@ -1,10 +1,10 @@ /* - * Author: 654wak654 - * Modifies interaction color of vehicle selection to show it's current damage. + * Author: 654wak654, mharis001 + * Modifies interaction icon color of vehicle selection to show its current damage. * * Arguments: * 0: Target - * 1: Player + * 1: Player (not used) * 2: Args * 3: Action Data * @@ -12,7 +12,7 @@ * None * * Example: - * [cursorObject, ace_player, [], []] call ace_repair_fnc_modifySelectionInteraction; + * [cursorObject, ACE_player, [], []] call ace_repair_fnc_modifySelectionInteraction * * Public: No */ @@ -20,12 +20,7 @@ params ["_target", "", "_args", "_actionData"]; -// 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]) -]; -TRACE_2("modifyInteraction",_target,_fileName); -_actionData set [2, _fileName]; +// Convert damage to number (round up to show even slight damage) +private _color = ceil linearConversion [0, 1, _target getHitPointDamage (_args select 0), 0, 8, true]; +TRACE_2("Modifying icon color",_target,_color); +(_actionData select 2) set [1, DAMAGE_COLOR_SCALE select _color]; diff --git a/addons/repair/script_component.hpp b/addons/repair/script_component.hpp index 678f8fe04e..7ec3be3233 100644 --- a/addons/repair/script_component.hpp +++ b/addons/repair/script_component.hpp @@ -17,3 +17,5 @@ #include "\z\ace\addons\main\script_macros.hpp" #define TRACK_HITPOINTS ["hitltrack", "hitrtrack"] + +#define DAMAGE_COLOR_SCALE ["#FFFFFF", "#FFFF7E", "#FFEC4D", "#FFD52C", "#FCB121", "#FF9916", "#FF7D16", "#FF4400", "#FF0000"] diff --git a/addons/repair/ui/damage_0_ca.paa b/addons/repair/ui/damage_0_ca.paa deleted file mode 100644 index f7c2348f29..0000000000 Binary files a/addons/repair/ui/damage_0_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_1_ca.paa b/addons/repair/ui/damage_1_ca.paa deleted file mode 100644 index b143d3cb43..0000000000 Binary files a/addons/repair/ui/damage_1_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_2_ca.paa b/addons/repair/ui/damage_2_ca.paa deleted file mode 100644 index 062c4e5a6c..0000000000 Binary files a/addons/repair/ui/damage_2_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_3_ca.paa b/addons/repair/ui/damage_3_ca.paa deleted file mode 100644 index 88bc0b87ab..0000000000 Binary files a/addons/repair/ui/damage_3_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_4_ca.paa b/addons/repair/ui/damage_4_ca.paa deleted file mode 100644 index 24584de084..0000000000 Binary files a/addons/repair/ui/damage_4_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_5_ca.paa b/addons/repair/ui/damage_5_ca.paa deleted file mode 100644 index 41a7e5b42d..0000000000 Binary files a/addons/repair/ui/damage_5_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_6_ca.paa b/addons/repair/ui/damage_6_ca.paa deleted file mode 100644 index 68dffc516f..0000000000 Binary files a/addons/repair/ui/damage_6_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_7_ca.paa b/addons/repair/ui/damage_7_ca.paa deleted file mode 100644 index 087359e324..0000000000 Binary files a/addons/repair/ui/damage_7_ca.paa and /dev/null differ diff --git a/addons/repair/ui/damage_8_ca.paa b/addons/repair/ui/damage_8_ca.paa deleted file mode 100644 index 1e78785d0c..0000000000 Binary files a/addons/repair/ui/damage_8_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_0_ca.paa b/addons/repair/ui/repair_0_ca.paa deleted file mode 100644 index edb6c3681d..0000000000 Binary files a/addons/repair/ui/repair_0_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_1_ca.paa b/addons/repair/ui/repair_1_ca.paa deleted file mode 100644 index bb6d85eca9..0000000000 Binary files a/addons/repair/ui/repair_1_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_2_ca.paa b/addons/repair/ui/repair_2_ca.paa deleted file mode 100644 index e5ed37905a..0000000000 Binary files a/addons/repair/ui/repair_2_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_3_ca.paa b/addons/repair/ui/repair_3_ca.paa deleted file mode 100644 index 24940192f4..0000000000 Binary files a/addons/repair/ui/repair_3_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_4_ca.paa b/addons/repair/ui/repair_4_ca.paa deleted file mode 100644 index bdf36fd572..0000000000 Binary files a/addons/repair/ui/repair_4_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_5_ca.paa b/addons/repair/ui/repair_5_ca.paa deleted file mode 100644 index cdabf0f8bf..0000000000 Binary files a/addons/repair/ui/repair_5_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_6_ca.paa b/addons/repair/ui/repair_6_ca.paa deleted file mode 100644 index c1716ba16d..0000000000 Binary files a/addons/repair/ui/repair_6_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_7_ca.paa b/addons/repair/ui/repair_7_ca.paa deleted file mode 100644 index 4cf28c97e4..0000000000 Binary files a/addons/repair/ui/repair_7_ca.paa and /dev/null differ diff --git a/addons/repair/ui/repair_8_ca.paa b/addons/repair/ui/repair_8_ca.paa deleted file mode 100644 index 1db3809543..0000000000 Binary files a/addons/repair/ui/repair_8_ca.paa and /dev/null differ