filter hitpoints without selections, misc

This commit is contained in:
commy2 2015-03-11 21:52:34 +01:00
parent 1c90e2bb33
commit b16267539c
7 changed files with 15 additions and 9 deletions

View File

@ -4,8 +4,9 @@
class ACE_MainActions { \
class GVAR(Repair) { \
displayName = "$STR_ACE_Repair_Repair"; \
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(actionCanRepair)); \
statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionRepair);); \
condition = ""; \
statement = "'show a hint with the hitpart damage'"; \
runOnHover = 1; \
showDisabled = 0; \
priority = 2; \
icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; \

View File

@ -2,8 +2,6 @@
ADDON = false;
PREP(actionCanRepair);
PREP(actionRepair);
PREP(addRepairActions);
PREP(doRepair);
PREP(getWheelHitPointsWithSelections);

View File

@ -1 +0,0 @@
true

View File

@ -1 +0,0 @@
systemChat str _this

View File

@ -26,7 +26,7 @@ if (_type in _initializedClasses) exitWith {};
// get all hitpoints
private "_hitPoints";
_hitPoints = [_vehicle] call EFUNC(common,getHitPoints);
_hitPoints = [_vehicle] call EFUNC(common,getHitPointsWithSelections) select 0;
// get hitpoints of wheels with their selections
private ["_wheelHitPointsWithSelections", "_wheelHitPoints", "_wheelHitPointSelections"];
@ -88,6 +88,9 @@ _wheelHitPointSelections = _wheelHitPointsWithSelections select 1;
[_type, 0, [_nameReplace], _nameReplace, _icon, _selection, _statement_replace, _condition_replace, 2] call EFUNC(interact_menu,addClassAction);
} else {
// exit if the hitpoint is in the blacklist, e.g. glasses
if (_x in IGNORED_HITPOINTS) exitWith {};
// add misc repair action
private ["_name", "_icon", "_selection"];

View File

@ -27,7 +27,7 @@ private ["_damage", "_time"];
_damage = _vehicle getHitPointDamage _hitPoint;
_time = 5 * _damage;
_time = 5 + 10 * _damage;
// get string of the hitpoint
private "_text";
@ -41,3 +41,6 @@ if (isLocalized _text) then {
// open the loading bar
[_time, [_vehicle, _hitPoint], DFUNC(doRepair), DFUNC(doRepair), _text, {true}, []] call EFUNC(common,progressBar);
// do animation
[_unit] call EFUNC(common,goKneeling);

View File

@ -9,4 +9,7 @@
#define DEBUG_SETTINGS DEBUG_SETTINGS_REPAIR
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#include "\z\ace\addons\main\script_macros.hpp"
#define IGNORED_HITPOINTS ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitGlass9","HitGlass10","HitGlass11","HitGlass12","HitGlass13","HitGlass14","HitGlass15","HitRGlass","HitLGlass"]