diff --git a/addons/repair/config.cpp b/addons/repair/config.cpp index 33d2665311..fc06143d54 100644 --- a/addons/repair/config.cpp +++ b/addons/repair/config.cpp @@ -13,3 +13,13 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" + +class ACE_Settings { + class GVAR(DisplayTextOnRepair) { + typeName = "BOOL"; + isClientSetable = 1; + value = 1; + displayName = "$STR_ACE_Repair_SettingDisplayTextName"; + description = "$STR_ACE_Repair_SettingDisplayTextDesc"; + }; +}; diff --git a/addons/repair/functions/fnc_doRepair.sqf b/addons/repair/functions/fnc_doRepair.sqf index 66f0bd57fc..3a35eae261 100644 --- a/addons/repair/functions/fnc_doRepair.sqf +++ b/addons/repair/functions/fnc_doRepair.sqf @@ -31,3 +31,17 @@ _hitPointDamage = _hitPointDamage max 0; // raise event to set the new hitpoint damage ["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); + +// display text message if enabled +if (GVAR(DisplayTextOnRepair)) then { + private "_text"; + _text = format ["STR_ACE_Repair_%1", _hitPoint]; + + if (isLocalized _text) then { + _text = format [localize (["STR_ACE_Repair_RepairedHitPointFully", "STR_ACE_Repair_RepairedHitPointPartially"] select (_hitPointDamage > 0)), localize _text]; + } else { + _text = localize (["STR_ACE_Repair_RepairedFully", "STR_ACE_Repair_RepairedPartially"] select (_hitPointDamage > 0)); + }; + + [_text] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 3f4387b0de..93c6c60a85 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -2,6 +2,13 @@ + + Display text on repair + + + Display a notification whenever you repair a vehicle + + Repairing ... Reparieren ... @@ -39,6 +46,23 @@ %1 отремонтирован + + Fully repaired part + Bauteil vollständig repariert + + + Partially repaired %1 + Bauteil teilweise repariert + + + Fully repaired %1 + %1 vollständig repariert + + + Partially repaired %1 + %1 teilweise repariert + + Body Karosserie