Actions cleanup

This commit is contained in:
ebaydayz
2016-03-29 14:47:28 -04:00
parent e1a0bfebc1
commit 71b975b05e
38 changed files with 330 additions and 503 deletions

View File

@@ -1,7 +1,7 @@
private ["_part","_cancel","_color","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints","_damagePercent","_configVeh"];
_vehicle = _this select 3;
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = _vehicle;
_hitpoints = _vehicle call vehicle_getHitpoints;
@@ -17,7 +17,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
_configVeh = configFile >> "cfgVehicles" >> "RepairParts" >> _x;
_part = getText(_configVeh >> "part");
if (isnil ("_part")) then { _part = "PartGeneric"; };
if (isNil "_part") then { _part = "PartGeneric"; };
// get every damaged part no matter how tiny damage is!
_damagePercent = str(round(_damage * 100))+"% Damage";
@@ -29,15 +29,15 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
_cmpt = format[localize "str_actions_medical_09",_cmpt,_damagePercent];
_string = format["<t %1>%2</t>",_color,_cmpt]; //Repair - Part
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true];
s_player_repairActions set [count s_player_repairActions,_handle];
};
} forEach _hitpoints;
if(count _hitpoints > 0 ) then {
if (count _hitpoints > 0 ) then {
//ArmA OA String
_cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""];
_cancel = dayz_myCursorTarget addAction [localize "str_action_cancel_action", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false];
s_player_repairActions set [count s_player_repairActions,_cancel];
s_player_repair_crtl = 1;
};