Clientside display text option for weapon jamming

This commit is contained in:
Glowbal 2015-03-08 16:57:06 +01:00
parent d919c2436d
commit 2250255d65
4 changed files with 28 additions and 8 deletions

View File

@ -19,3 +19,14 @@ class CfgPatches {
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
class ACE_Settings {
class GVAR(DisplayTextOnJam) {
typeName = "BOOL";
isClientSetable = 1;
value = 1;
displayName = "$STR_ACE_overheating_SettingDisplayTextName";
description = "$STR_ACE_overheating_SettingDisplayTextDesc";
};
};

View File

@ -42,7 +42,6 @@ if (_weapon in _jammedWeapons) then {
}; };
_unit playActionNow _clearJamAction; _unit playActionNow _clearJamAction;
};
if (_weapon == primaryWeapon _unit) then { if (_weapon == primaryWeapon _unit) then {
playSound QGVAR(fixing_rifle); playSound QGVAR(fixing_rifle);
} else { } else {
@ -50,5 +49,9 @@ if (_weapon in _jammedWeapons) then {
playSound QGVAR(fixing_pistol); playSound QGVAR(fixing_pistol);
}; };
}; };
};
if (GVAR(DisplayTextOnJam)) then {
[localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured); [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
};
}; };

View File

@ -61,7 +61,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then {
_statement = { _statement = {
playSound3D ["a3\sounds_f\weapons\Other\dry9.wss", _this select 0]; playSound3D ["a3\sounds_f\weapons\Other\dry9.wss", _this select 0];
if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0}) then { if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0} && {GVAR(DisplayTextOnJam)}) then {
[localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured); [localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured);
GVAR(knowAboutJam) = true; GVAR(knowAboutJam) = true;
}; };

View File

@ -2,6 +2,12 @@
<!-- Edited with tabler - 2014-12-17 --> <!-- Edited with tabler - 2014-12-17 -->
<Project name="ACE"> <Project name="ACE">
<Package name="Overheating"> <Package name="Overheating">
<Key ID="STR_ACE_overheating_SettingDisplayTextName">
<English>Display text on jam</English>
</Key>
<Key ID="STR_ACE_overheating_SettingDisplayTextDesc">
<English>Display a notification whenever your weapon gets jammed</English>
</Key>
<Key ID="STR_ACE_Overheating_SpareBarrelName"> <Key ID="STR_ACE_Overheating_SpareBarrelName">
<English>Spare barrel</English> <English>Spare barrel</English>
<German>Ersatzlauf</German> <German>Ersatzlauf</German>