Change repair to use icon color not multiple files (#6318)

This commit is contained in:
mharis001 2018-05-31 19:11:16 -04:00 committed by PabstMirror
parent 77b4ce7585
commit e90ea95ce7
22 changed files with 21 additions and 26 deletions

View File

@ -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));

View File

@ -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 <OBJECT>
* 1: Player <OBJECT>
* 2: Args <Any>
* 1: Player (not used) <OBJECT>
* 2: Args (not used) <Any>
* 3: Action Data <ARRAY>
*
* 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
// 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];
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];

View File

@ -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 <OBJECT>
* 1: Player <OBJECT>
* 1: Player (not used) <OBJECT>
* 2: Args <Any>
* 3: Action Data <ARRAY>
*
@ -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];

View File

@ -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"]

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.

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.