From 2e6a9c496744d9cca620d870948db462b48ae6bd Mon Sep 17 00:00:00 2001 From: jaynus Date: Fri, 3 Apr 2015 21:07:04 -0700 Subject: [PATCH] Placeholder sounds for jav/titan locking. accurate fire tweaks --- addons/wep_javelin/CfgSounds.hpp | 10 ++++++---- .../data/{sound => sounds}/javelin_locked.ogg | Bin .../{sound => sounds}/javelin_locking.ogg | Bin .../functions/fnc_onGetLockedTarget.sqf | 18 +++++++++++++++++- 4 files changed, 23 insertions(+), 5 deletions(-) rename addons/wep_javelin/data/{sound => sounds}/javelin_locked.ogg (100%) rename addons/wep_javelin/data/{sound => sounds}/javelin_locking.ogg (100%) diff --git a/addons/wep_javelin/CfgSounds.hpp b/addons/wep_javelin/CfgSounds.hpp index 6c87219f78..0af40b9485 100644 --- a/addons/wep_javelin/CfgSounds.hpp +++ b/addons/wep_javelin/CfgSounds.hpp @@ -1,11 +1,13 @@ class CfgSounds { class ACE_Javelin_Locking { - sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), 1, 1, 200}; - titles[] = {}; + name = "ACE_Javelin_Locking"; + sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0}; + titles[] = {}; }; class ACE_Javelin_Locked { - sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), 1, 1, 200}; - titles[] = {}; + name = "ACE_Javelin_Locked"; + sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0}; + titles[] = {}; }; }; diff --git a/addons/wep_javelin/data/sound/javelin_locked.ogg b/addons/wep_javelin/data/sounds/javelin_locked.ogg similarity index 100% rename from addons/wep_javelin/data/sound/javelin_locked.ogg rename to addons/wep_javelin/data/sounds/javelin_locked.ogg diff --git a/addons/wep_javelin/data/sound/javelin_locking.ogg b/addons/wep_javelin/data/sounds/javelin_locking.ogg similarity index 100% rename from addons/wep_javelin/data/sound/javelin_locking.ogg rename to addons/wep_javelin/data/sounds/javelin_locking.ogg diff --git a/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf b/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf index 3cc5d685c2..e96520e7f7 100644 --- a/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf +++ b/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf @@ -5,4 +5,20 @@ GVAR(currentTarget) = cursorTarget; GVAR(currentTargetPos) = screenToWorld [0.5,0.5]; -TRACE_2("Tracking optics target draw", GVAR(currentTarget), GVAR(currentTargetPos)); \ No newline at end of file +TRACE_2("Tracking optics target draw", GVAR(currentTarget), GVAR(currentTargetPos)); + +if(isNil QGVAR(nextSoundPlay)) then { + GVAR(nextSoundPlay) = diag_tickTime + 0.25; +}; + +hint format["T: %1", GVAR(currentTarget)]; + +if(diag_tickTime > GVAR(nextSoundPlay) ) then { + GVAR(nextSoundPlay) = diag_tickTime + 0.25; + + if(!isNull GVAR(currentTarget)) then { + playSound "ACE_Javelin_Locked"; + } else { + playSound "ACE_Javelin_Locking"; + }; +};