mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Use faster switch in repair and salvage
7496ef5d5c (commitcomment-20292237)
This commit is contained in:
@@ -23,10 +23,10 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
|
|||||||
_damagePercent = str(round(_damage * 100))+"% Damage";
|
_damagePercent = str(round(_damage * 100))+"% Damage";
|
||||||
if (_damage > 0) then {
|
if (_damage > 0) then {
|
||||||
_color = switch true do {
|
_color = switch true do {
|
||||||
case (_damage >= 0 && _damage <= 0.25): {"color='#00ff00'"}; //green
|
case (_damage <= 0.25): {"color='#00ff00'"}; //green
|
||||||
case (_damage > 0.25 && _damage <= 0.50): {"color='#ffff00'"}; //yellow
|
case (_damage <= 0.50): {"color='#ffff00'"}; //yellow
|
||||||
case (_damage > 0.50 && _damage <= 0.75): {"color='#ff8800'"}; //orange
|
case (_damage <= 0.75): {"color='#ff8800'"}; //orange
|
||||||
case (_damage > 0.75 && _damage <= 1): {"color='#ff0000'"}; //red
|
default {"color='#ff0000'"}; //red
|
||||||
};
|
};
|
||||||
|
|
||||||
_cmpt = format[localize "str_actions_medical_09",_cmpt,_damagePercent];
|
_cmpt = format[localize "str_actions_medical_09",_cmpt,_damagePercent];
|
||||||
|
|||||||
@@ -58,10 +58,10 @@ if (_is6WheelType) then {
|
|||||||
_damagePercent = str(round(_damage * 100))+"% Damage";
|
_damagePercent = str(round(_damage * 100))+"% Damage";
|
||||||
if (_damage < 1 && _damage > 0) then { //Tempfix for issue where certain hitpoints on some vehicles do not get damaged and allow infinite removal
|
if (_damage < 1 && _damage > 0) then { //Tempfix for issue where certain hitpoints on some vehicles do not get damaged and allow infinite removal
|
||||||
_color = switch true do {
|
_color = switch true do {
|
||||||
case (_damage >= 0 && _damage <= 0.25): {"color='#00ff00'"}; //green
|
case (_damage <= 0.25): {"color='#00ff00'"}; //green
|
||||||
case (_damage > 0.25 && _damage <= 0.50): {"color='#ffff00'"}; //yellow
|
case (_damage <= 0.50): {"color='#ffff00'"}; //yellow
|
||||||
case (_damage > 0.50 && _damage <= 0.75): {"color='#ff8800'"}; //orange
|
case (_damage <= 0.75): {"color='#ff8800'"}; //orange
|
||||||
case (_damage > 0.75 && _damage <= 1): {"color='#ff0000'"}; //red
|
default {"color='#ff0000'"}; //red
|
||||||
};
|
};
|
||||||
_string = format[localize "str_actions_repair_01",_cmpt,_damagePercent];
|
_string = format[localize "str_actions_repair_01",_cmpt,_damagePercent];
|
||||||
_string = format["<t %1>%2</t>",_color,_string]; //Remove - Part
|
_string = format["<t %1>%2</t>",_color,_string]; //Remove - Part
|
||||||
|
|||||||
Reference in New Issue
Block a user