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 "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,13 +42,16 @@ if (_weapon in _jammedWeapons) then {
};
_unit playActionNow _clearJamAction;
};
if (_weapon == primaryWeapon _unit) then {
playSound QGVAR(fixing_rifle);
} else {
if (_weapon == secondaryWeapon _unit) then {
playSound QGVAR(fixing_pistol);
if (_weapon == primaryWeapon _unit) then {
playSound QGVAR(fixing_rifle);
} else {
if (_weapon == secondaryWeapon _unit) then {
playSound QGVAR(fixing_pistol);
};
};
};
[localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
if (GVAR(DisplayTextOnJam)) then {
[localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured);
};
};

View File

@ -61,7 +61,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then {
_statement = {
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);
GVAR(knowAboutJam) = true;
};

View File

@ -2,6 +2,12 @@
<!-- Edited with tabler - 2014-12-17 -->
<Project name="ACE">
<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">
<English>Spare barrel</English>
<German>Ersatzlauf</German>