From edb76ffae4f584f38d833d4ed8087adbcdfbd703 Mon Sep 17 00:00:00 2001 From: BaerMitUmlaut Date: Wed, 7 Oct 2015 20:11:07 +0200 Subject: [PATCH] Initial commit --- addons/nightvision/ACE_Settings.hpp | 8 +++++ addons/nightvision/CfgVehicles.hpp | 24 ++++++++++++++ addons/nightvision/UI/Icon_Module_ca.paa | Bin 0 -> 5625 bytes addons/nightvision/XEH_postInitClient.sqf | 12 +++++-- addons/nightvision/XEH_preInit.sqf | 2 ++ addons/nightvision/config.cpp | 1 + .../nightvision/functions/fnc_handleNVGs.sqf | 31 ++++++++++++++++++ .../nightvision/functions/fnc_initModule.sqf | 21 ++++++++++++ addons/nightvision/stringtable.xml | 18 +++++++++- .../Icon_Module_Nightvision_ca.png | Bin 0 -> 552 bytes 10 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 addons/nightvision/ACE_Settings.hpp create mode 100644 addons/nightvision/UI/Icon_Module_ca.paa create mode 100644 addons/nightvision/functions/fnc_handleNVGs.sqf create mode 100644 addons/nightvision/functions/fnc_initModule.sqf create mode 100644 extras/assets/icons/Icon_Module_png/Icon_Module_Nightvision_ca.png diff --git a/addons/nightvision/ACE_Settings.hpp b/addons/nightvision/ACE_Settings.hpp new file mode 100644 index 0000000000..d6d52bab10 --- /dev/null +++ b/addons/nightvision/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(disableNVGsWithSights) { + displayName = CSTRING(DisableNVGsWithSights_DisplayName); + description = CSTRING(DisableNVGsWithSights_description); + typeName = "BOOL"; + value = 1; + }; +}; diff --git a/addons/nightvision/CfgVehicles.hpp b/addons/nightvision/CfgVehicles.hpp index 84e7105f0b..8b489ad64f 100644 --- a/addons/nightvision/CfgVehicles.hpp +++ b/addons/nightvision/CfgVehicles.hpp @@ -14,4 +14,28 @@ class CfgVehicles { MACRO_ADDITEM(ACE_NVG_Wide,6); }; }; + + class ACE_Module; + class GVAR(ModuleSettings): ACE_Module { + scope = 2; + displayName = CSTRING(Module_DisplayName); + icon = QUOTE(PATHTOF(UI\Icon_Module_ca.paa)); + category = "ACE"; + function = QUOTE(FUNC(initModule)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "BaerMitUmlaut"; + class Arguments { + class disableNVGsWithSights { + displayName = CSTRING(DisableNVGsWithSights_DisplayName); + description = CSTRING(DisableNVGsWithSights_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; + }; }; diff --git a/addons/nightvision/UI/Icon_Module_ca.paa b/addons/nightvision/UI/Icon_Module_ca.paa new file mode 100644 index 0000000000000000000000000000000000000000..556adaf30ca22a622587b0deedcc0a48d0b9f127 GIT binary patch literal 5625 zcmeHLO-x)>6h3eICP1VNX=cRoBU3x8wu`#3lC;PpMqm;NB+hL}42i&^8U@0Ju5e!M zf|wW?$7o#G5aYteg#~JcCDWKRkeGH$9fBBZkwpd3gf?Y(e&^o%D7@h}w8UC3Gmrbd zd+zzW=iYPf_?`Ot+Ssf0XKPI&T3J~+Cvi({BVz}RaeeLUb&L&s8NX3i*JPn@!#)i{Qh2n$a98NbrZTA8pV4z4pVm zk%kYXJc`9)7*0f@Nri=i&f;8q*r1L0ua{>fUED0?d+aCj zh4EoI7MfT7b~snR1|QGi_c8uY(N!!I=3zO`G3T8x2iH8j0$u~!{51B$G;F8#J^g9$&Z&`&c~85 ze}u~pu-88b{stBA2!CGkbq)ME{-u8r{yF|#M+~6cyNmUZ4A#=~{#W{7yFi|de<>f^ zKS%!V<-y;(^4EWjo*ll{-%l5o;r19GFY$hkCS|_BehgKmQ=OSq#jkpQnnqUQNsVzL z{JUGpko;e)2T}lXF#5w@~{}CFa_=_j0AEreX47jAvUHTRSf^h zIu|N#eRb(4e$V+`jXpWgs-ElJv#IXWtiR#+=hOpUd%c*B*DM@}-;@4f>wN*l!{KF# zg|Mhv#*eB;5I?b75+6Fie1MH|&-i|Ot^oPKtxrNwi01AGSO;k*aLb(2z1-V1D={48 zwSPN&bEbZUV};u)U&&wLxuv1T%y5N_N8~FmS@yLR^rSk=QXLOi8xacmX^s-EwsJqT zj4R0T0nNPjmL8YGdHiI>eF5$bUek0|^^D`(8S0ewp&}EnOk=pNU1LL({|V#u_(u8q zQ9Gl=bDkaT>FvsL_(FT$-|vlb-?8|?veQ}a4RAn9tnGpyRPXEgvFzlPK6(B<3H#r; ze5yTzEy~*a5#LkO(YIX88!|#Do^a&zcntXD89pD*NqPh4WmOu6zu2YM&lIIi1AUXD ziXYcEk9xiS=eM;7yz%(7;V{xQnPiV4EaMA5X!9+Jsl80&P|mf@2EFrFrAtqYbr}tZ z3$pXxpD~JNcsv*khU9o)ffT*G_7a~Y3JYP6#TVAgr$uKA`C!Y}UdeBhYY(m|wk*4F zO$o9+)Sq?b6?7+V(OR7aV{xaEMpCgGOJa+iAMd-=is=fj$R zFv#=Q%i9>c=>cg}(r=4D(*83nrcWKz$BKyUaK82j_GV{(OO%5yntSu8ZlLz~g zxAip_XzHGjkUd9)(){m%Kbt=z)+O3m3nvd{j)yM4yR z_$d&6w9<~#*0k8>y3rn6iVrUJ)UcT*TG)<{97%n8LYW<6`pQhxA(#N&QF~eG3kF41 zbpnQ>GTrk+G^&mf6A9Bwe`vbnJi|)k%+U0}qR>-Kmi*Rw#d&t%j;l}j+SS&>jx)sa zxYP?*BNgjq6&!cZkQt^0kQ4E?t(yBWa52Rt2#9eiy?h?T8uO1E-d{`dDWAi8_C(8( zvp3$wZc-D6tYcqXJoC;f{)HwI&lS9u + * + * Return Value: + * None + * + * Example: + * [player] call ace_nightvision_fnc_disableNVGs + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_unit"]; + +if (GVAR(disableNVGsWithSights) && {(vehicle _unit == _unit) || {isTurnedOut _unit}}) then { + if ((cameraView == "GUNNER") && {currentVisionMode _unit > 0}) then { + _unit action ["NVGogglesOff", _unit]; + GVAR(reenableNVGs) = true; + } else { + if (GVAR(reenableNVGs) && {cameraView != "GUNNER"}) then { + _unit action ["NVGoggles", _unit]; + GVAR(reenableNVGs) = false; + }; + }; +}; diff --git a/addons/nightvision/functions/fnc_initModule.sqf b/addons/nightvision/functions/fnc_initModule.sqf new file mode 100644 index 0000000000..6831a29edf --- /dev/null +++ b/addons/nightvision/functions/fnc_initModule.sqf @@ -0,0 +1,21 @@ +/* + * Author: BaerMitUmlaut + * Initializes the settings for the disable NVGs in sight module. + * + * Arguments: + * 0: Module + * + * Return Value: + * None + * + * Example: + * [_module] call ace_nightvision_fnc_initModule + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_module"]; + +[_module, QGVAR(disableNVGsWithSights), "disableNVGsWithSights"] call EFUNC(common,readSettingFromModule); diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 050945d5d8..b6e35147f9 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -133,5 +133,21 @@ Diminuir Luminosidade do EVN Riduci la luminosità dell'NVG + + Nightvision + Nachtsicht + + + Settings for night vision. + Einstellungen für Nachtsichtgeräte. + + + Disable NVGs in scope + Deakt. NVGs mit Visier + + + Blocks the usage of night vision goggles whilst aiming down the sight. + Blockiert das Benutzen von Nachtsichtbrillen beim Benutzen des Visiers. + - \ No newline at end of file + diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_Nightvision_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Nightvision_ca.png new file mode 100644 index 0000000000000000000000000000000000000000..975a4126f39aa4ad307c9aded3c0ce906da572f7 GIT binary patch literal 552 zcmV+@0@wYCP)!9q(58zG>vx3W#+BUt!O7QTRum5tb1Xdy(gRgfSe z1Vi%MY!O0YOwKO5n=>B-a-Hn_ncEp+l0=4>nGHYA%6?vUmxvq}Aa((gMRI1ePRuR9 ze+`8cqIoXXQ@{oA8jyKPCRyjUr+}wGwc4OZKv8o*^eHf_czF#@(YHaL1YH2fah!;; zm`;A)1zZ3Zz;PU>(DVAfq?`19LsCytUy{Y({GleZQALML(xs%Ap<7$h&Y1V^>2FR7 z8-)W!r~|LS^3c-*;2O9BR)AxmIc4U!FtgLDhW2)v$04*UI|-WEGjI@SW^ECQ+<8C* z^eb5dMg&NJuaSB%3%fuE_y)Q_&&&ofMZqMRW4`Ao?K)4AHcJr!>4nwOuCSi5w)em) zur=njcQdP(Ju+I#kI&LXz!VYQa)=Cou9?+*AyQ@mB(-w-^#OiDKAdFiXc0xQ>ut~n zp>m|aS%C8cGkdJ^IiL|3=AFuR0ZH4yZJ?Qtq6A0+ov#BABSOxz5V`Y}*rKy=OVK$+ qh<7dSIF3_B{7+J`M}P|uy8yr9XgTsPFU7_H0000