show message when fully or partially repairing a hitpoint

This commit is contained in:
commy2 2015-03-10 22:52:44 +01:00
parent f7e8dc5499
commit bd978f2a34
3 changed files with 48 additions and 0 deletions

View File

@ -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";
};
};

View File

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

View File

@ -2,6 +2,13 @@
<!-- Edited with tabler - 2014-12-21 -->
<Project name="ACE">
<Package name="repair">
<Key ID="STR_ACE_Repair_SettingDisplayTextName">
<English>Display text on repair</English>
</Key>
<Key ID="STR_ACE_Repair_SettingDisplayTextDesc">
<English>Display a notification whenever you repair a vehicle</English>
</Key>
<Key ID="STR_ACE_Repair_Repairing">
<English>Repairing ...</English>
<German>Reparieren ...</German>
@ -39,6 +46,23 @@
<Russian>%1 отремонтирован</Russian>
</Key>
<Key ID="STR_ACE_Repair_RepairedFully">
<English>Fully repaired part</English>
<German>Bauteil vollständig repariert</German>
</Key>
<Key ID="STR_ACE_Repair_RepairedPartially">
<English>Partially repaired %1</English>
<German>Bauteil teilweise repariert</German>
</Key>
<Key ID="STR_ACE_Repair_RepairedHitPointFully">
<English>Fully repaired %1</English>
<German>%1 vollständig repariert</German>
</Key>
<Key ID="STR_ACE_Repair_RepairedHitPointPartially">
<English>Partially repaired %1</English>
<German>%1 teilweise repariert</German>
</Key>
<Key ID="STR_ACE_Repair_HitBody">
<English>Body</English>
<German>Karosserie</German>