From a0770c770767d1bcd01024afbeb86ff88f0b8c4a Mon Sep 17 00:00:00 2001 From: BaerMitUmlaut Date: Fri, 29 Apr 2016 14:26:30 +0200 Subject: [PATCH] Moved and expanded in-vehicle interactions to cockpit_interactions --- addons/cockpit_interaction/$PBOPREFIX$ | 1 + addons/cockpit_interaction/CfgActions.hpp | 9 ++ .../cockpit_interaction/CfgEventHandlers.hpp | 41 ++++++ addons/cockpit_interaction/CfgVehicles.hpp | 117 ++++++++++++++++++ addons/cockpit_interaction/UI/BatteryOff.paa | Bin 0 -> 5625 bytes addons/cockpit_interaction/UI/BatteryOn.paa | Bin 0 -> 5625 bytes .../UI/CollisionLightsOff.paa | Bin 0 -> 5625 bytes .../UI/CollisionLightsOn.paa | Bin 0 -> 5625 bytes .../cockpit_interaction/UI/FuelPumpsOff.paa | Bin 0 -> 5625 bytes addons/cockpit_interaction/UI/FuelPumpsOn.paa | Bin 0 -> 5625 bytes .../cockpit_interaction/UI/GeneratorOff.paa | Bin 0 -> 5625 bytes addons/cockpit_interaction/UI/GeneratorOn.paa | Bin 0 -> 5625 bytes .../cockpit_interaction/UI/MainLightsOff.paa | Bin 0 -> 5625 bytes .../cockpit_interaction/UI/MainLightsOn.paa | Bin 0 -> 5625 bytes addons/cockpit_interaction/UI/StarterOff.paa | Bin 0 -> 5625 bytes addons/cockpit_interaction/UI/StarterOn.paa | Bin 0 -> 5625 bytes addons/cockpit_interaction/XEH_PREP.hpp | 11 ++ addons/cockpit_interaction/XEH_postInit.sqf | 25 ++++ addons/cockpit_interaction/XEH_preInit.sqf | 7 ++ addons/cockpit_interaction/XEH_preStart.sqf | 3 + addons/cockpit_interaction/config.cpp | 17 +++ .../functions/fnc_handleActionsPFH.sqf | 31 +++++ .../functions/fnc_onEngine.sqf | 34 +++++ .../functions/fnc_onLocal.sqf | 29 +++++ .../functions/fnc_switchBattery.sqf | 21 ++++ .../functions/fnc_switchCollisionLight.sqf | 24 ++++ .../functions/fnc_switchFuelPumps.sqf | 29 +++++ .../functions/fnc_switchGenerator.sqf | 21 ++++ .../functions/fnc_switchMainLight.sqf | 24 ++++ .../functions/fnc_switchStarter.sqf | 24 ++++ .../functions/fnc_switchStarterInternal.sqf | 32 +++++ .../functions/fnc_updateElectricalPower.sqf | 38 ++++++ .../functions/script_component.hpp | 1 + .../cockpit_interaction/script_component.hpp | 13 ++ 34 files changed, 552 insertions(+) create mode 100644 addons/cockpit_interaction/$PBOPREFIX$ create mode 100644 addons/cockpit_interaction/CfgActions.hpp create mode 100644 addons/cockpit_interaction/CfgEventHandlers.hpp create mode 100644 addons/cockpit_interaction/CfgVehicles.hpp create mode 100644 addons/cockpit_interaction/UI/BatteryOff.paa create mode 100644 addons/cockpit_interaction/UI/BatteryOn.paa create mode 100644 addons/cockpit_interaction/UI/CollisionLightsOff.paa create mode 100644 addons/cockpit_interaction/UI/CollisionLightsOn.paa create mode 100644 addons/cockpit_interaction/UI/FuelPumpsOff.paa create mode 100644 addons/cockpit_interaction/UI/FuelPumpsOn.paa create mode 100644 addons/cockpit_interaction/UI/GeneratorOff.paa create mode 100644 addons/cockpit_interaction/UI/GeneratorOn.paa create mode 100644 addons/cockpit_interaction/UI/MainLightsOff.paa create mode 100644 addons/cockpit_interaction/UI/MainLightsOn.paa create mode 100644 addons/cockpit_interaction/UI/StarterOff.paa create mode 100644 addons/cockpit_interaction/UI/StarterOn.paa create mode 100644 addons/cockpit_interaction/XEH_PREP.hpp create mode 100644 addons/cockpit_interaction/XEH_postInit.sqf create mode 100644 addons/cockpit_interaction/XEH_preInit.sqf create mode 100644 addons/cockpit_interaction/XEH_preStart.sqf create mode 100644 addons/cockpit_interaction/config.cpp create mode 100644 addons/cockpit_interaction/functions/fnc_handleActionsPFH.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_onEngine.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_onLocal.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_switchBattery.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_switchCollisionLight.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_switchFuelPumps.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_switchGenerator.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_switchMainLight.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_switchStarter.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_switchStarterInternal.sqf create mode 100644 addons/cockpit_interaction/functions/fnc_updateElectricalPower.sqf create mode 100644 addons/cockpit_interaction/functions/script_component.hpp create mode 100644 addons/cockpit_interaction/script_component.hpp diff --git a/addons/cockpit_interaction/$PBOPREFIX$ b/addons/cockpit_interaction/$PBOPREFIX$ new file mode 100644 index 0000000000..56f155f1dd --- /dev/null +++ b/addons/cockpit_interaction/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\cockpit_interaction \ No newline at end of file diff --git a/addons/cockpit_interaction/CfgActions.hpp b/addons/cockpit_interaction/CfgActions.hpp new file mode 100644 index 0000000000..8c12c27d3f --- /dev/null +++ b/addons/cockpit_interaction/CfgActions.hpp @@ -0,0 +1,9 @@ +class CfgActions { + class None; + class EngineOn: None { + show = 0; + }; + class EngineOff: None { + show = 0; + }; +}; diff --git a/addons/cockpit_interaction/CfgEventHandlers.hpp b/addons/cockpit_interaction/CfgEventHandlers.hpp new file mode 100644 index 0000000000..1836d3bdc9 --- /dev/null +++ b/addons/cockpit_interaction/CfgEventHandlers.hpp @@ -0,0 +1,41 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Init_EventHandlers { + class Air { + class ADDON { + init = QUOTE([ARR_2(_this select 0,local (_this select 0))] call FUNC(onLocal)); + }; + }; +}; + +class Extended_Engine_EventHandlers { + class Air { + class ADDON { + engine = QUOTE(_this call FUNC(onEngine)); + }; + }; +}; + +class Extended_Local_EventHandlers { + class Air { + class ADDON { + local = QUOTE(_this call FUNC(onLocal)); + }; + }; +}; diff --git a/addons/cockpit_interaction/CfgVehicles.hpp b/addons/cockpit_interaction/CfgVehicles.hpp new file mode 100644 index 0000000000..87ea4c3ade --- /dev/null +++ b/addons/cockpit_interaction/CfgVehicles.hpp @@ -0,0 +1,117 @@ +class CfgVehicles { + class Helicopter_Base_H; + class Heli_Light_01_base_F: Helicopter_Base_H { + GVAR(enabled) = 1; + + class ACE_SelfSpatialActions { + class GVAR(StarterOn) { + icon = QUOTE(PATHTOF(UI\StarterOff.paa)); + displayName = ""; + selection = ""; + position = "[0.057,1.725,-0.24]"; + distance = 1.5; + condition = QUOTE(!(_target getVariable [ARR_2(QUOTE(QGVAR(starterOn)),false)])); + statement = QUOTE([_target] call FUNC(switchStarter)); + }; + class GVAR(StarterOff) { + icon = QUOTE(PATHTOF(UI\StarterOn.paa)); + displayName = ""; + selection = ""; + position = "[0.057,1.725,-0.24]"; + distance = 1.5; + condition = QUOTE((_target getVariable [ARR_2(QUOTE(QGVAR(starterOn)),false)])); + statement = QUOTE([_target] call FUNC(switchStarter)); + }; + class GVAR(BatteryOn) { + icon = QUOTE(PATHTOF(UI\BatteryOff.paa)); + displayName = ""; + selection = ""; + position = "[-0.08,1.74,-0.01]"; + distance = 1.5; + condition = QUOTE(!(_target getVariable [ARR_2(QUOTE(QGVAR(batteryOn)),false)])); + statement = QUOTE([_target] call FUNC(switchBattery)); + }; + class GVAR(BatteryOff) { + icon = QUOTE(PATHTOF(UI\BatteryOn.paa)); + displayName = ""; + selection = ""; + position = "[-0.08,1.74,-0.01]"; + distance = 1.5; + condition = QUOTE((_target getVariable [ARR_2(QUOTE(QGVAR(batteryOn)),false)])); + statement = QUOTE([_target] call FUNC(switchBattery)); + }; + class GVAR(GeneratorOn) { + icon = QUOTE(PATHTOF(UI\GeneratorOff.paa)); + displayName = ""; + selection = ""; + position = "[-0.08,1.735,-0.05]"; + distance = 1.5; + condition = QUOTE(!(_target getVariable [ARR_2(QUOTE(QGVAR(generatorOn)),false)])); + statement = QUOTE([_target] call FUNC(switchGenerator)); + }; + class GVAR(GeneratorOff) { + icon = QUOTE(PATHTOF(UI\GeneratorOn.paa)); + displayName = ""; + selection = ""; + position = "[-0.08,1.735,-0.05]"; + distance = 1.5; + condition = QUOTE((_target getVariable [ARR_2(QUOTE(QGVAR(generatorOn)),false)])); + statement = QUOTE([_target] call FUNC(switchGenerator)); + }; + class GVAR(FuelPumpsOn) { + icon = QUOTE(PATHTOF(UI\FuelPumpsOff.paa)); + displayName = ""; + selection = ""; + position = "[-0.055,1.74,-0.015]"; + distance = 1.5; + condition = QUOTE(!(_target getVariable [ARR_2(QUOTE(QGVAR(fuelPumpsOn)),false)])); + statement = QUOTE([_target] call FUNC(switchFuelPumps)); + }; + class GVAR(FuelPumpsOff) { + icon = QUOTE(PATHTOF(UI\FuelPumpsOn.paa)); + displayName = ""; + selection = ""; + position = "[-0.055,1.74,-0.015]"; + distance = 1.5; + condition = QUOTE((_target getVariable [ARR_2(QUOTE(QGVAR(fuelPumpsOn)),false)])); + statement = QUOTE([_target] call FUNC(switchFuelPumps)); + }; + class GVAR(CollisionLightsOn) { + icon = QUOTE(PATHTOF(UI\CollisionLightsOff.paa)); + displayName = ""; + selection = ""; + position = "[-0.008,1.74,-0.015]"; + distance = 1.5; + condition = QUOTE(!(_target getVariable [ARR_2(QUOTE(QGVAR(collisionLightsOn)),false)])); + statement = QUOTE([_target] call FUNC(switchCollisionLight)); + }; + class GVAR(CollisionLightsOff) { + icon = QUOTE(PATHTOF(UI\CollisionLightsOn.paa)); + displayName = ""; + selection = ""; + position = "[-0.008,1.74,-0.015]"; + distance = 1.5; + condition = QUOTE((_target getVariable [ARR_2(QUOTE(QGVAR(collisionLightsOn)),false)])); + statement = QUOTE([_target] call FUNC(switchCollisionLight)); + }; + class GVAR(MainLightsOn) { + icon = QUOTE(PATHTOF(UI\MainLightsOff.paa)); + displayName = ""; + selection = ""; + position = "[0.054,1.735,-0.05]"; + distance = 1.5; + condition = QUOTE(!(_target getVariable [ARR_2(QUOTE(QGVAR(mainLightsOn)),false)])); + statement = QUOTE([_target] call FUNC(switchMainLight)); + }; + class GVAR(MainLightsOff) { + icon = QUOTE(PATHTOF(UI\MainLightsOn.paa)); + displayName = ""; + selection = ""; + position = "[0.054,1.735,-0.05]"; + distance = 1.5; + condition = QUOTE((_target getVariable [ARR_2(QUOTE(QGVAR(mainLightsOn)),false)])); + statement = QUOTE([_target] call FUNC(switchMainLight)); + }; + }; + }; +}; diff --git a/addons/cockpit_interaction/UI/BatteryOff.paa b/addons/cockpit_interaction/UI/BatteryOff.paa new file mode 100644 index 0000000000000000000000000000000000000000..15cc098f126b3995c6c814b0eddaac582ddbdeac GIT binary patch literal 5625 zcmeHLYitx%6h2dSA{AsO%8F*&u)x~>5R8clMycr(V#^weqjs7aB|Hj>p{4%BkkV#B zYtl%UhQ{)!ZS)7kpnxHxK|_m`Qlc#-CepIlQl3F*w-6rNu*>y3cXoj;Bu#&mKkd!T zbiUqm&-ky&8qiCi7L*?iTG z_uDaVny&o*yHz4m52mFdF7mHmK9Cx$h;}i*yaL0ZJ>(o{N|JS1RaKMrfYfJWkeieD z0uNTQ8#BP z5~Xb}i!|@ejrrSnNdEK3=9XM)2}PM+RTU+zd+)Wbid0Fj8AhJaXl9dRHS8%3=}=ac z^8DU||HyoKh@Ti``$esy>B_UqWd3vf%SF8xda?ejQNdO5-34on+s4R%-c8Y_vglIA zh#wOT8Iyi%uM&59q`x@dC)MnKBe<_P*aLcm%hZm9Ly?Om(m#ZF3R?WT_bq=q^TWI` zgc-nS+do|XCzG$1_j9lt`HcO%Av$zI<0kAv@De^;xTC zT?GVoA^&|5aqXltrL#xcryKM~`IG^DN-W=1#dj++(z&a&i|2J6^(|p2Emq+UYn7Yp zC)`z&dowe7RBS1e^a->KN85g?9dt@LY!5a({sa(j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%~<{U!6|A$ek$?H4tQrYp}Zk@?T@FB5fc=*9Z8MtN7ncjv8@&Im>Z^sEmz zmxdQJM*NuR0UG~Hd!@MDE&av$KE8VQ>;7Fu{%-IiT&8v~7zkY`mi{5cQ_#X+-EVnQ zSsvDn2ZR9(xBY|VeTGmfo!quP+>staRl}c;aOkkxe2>r9otJfd0p4h-{MGVweq)G z1y1gta94Hq&Ghggv9VP0$MG^8Zu_Zbz%KV;dryo z{vY*y_4i)ia`{-rj9@G#KoHGB$0Qe(Q8(`e*t5Sc^8 zr%@J5604e7eN%l?oz-F`ckVc_Sz@229U)J`2YK(x>B+?Vf%CFe+x~g93@{D$P~sL> z;ue`UxLrL%%O@p$cqzp9LqW2)?KpKTv+#Gux}I^cg;sl0SD%sckfjE`i~0aS*q{A5 zL_ChhVI(KLOxP*q%B22AqK1Y83Vkb@ikuGZ)?UW6Kwq=)pNZ5bw^87=7b`M~4p-ff Zm}|?1AE;YDllpE4#vrH#DR(oD{sp*e*3kd} literal 0 HcmV?d00001 diff --git a/addons/cockpit_interaction/UI/CollisionLightsOff.paa b/addons/cockpit_interaction/UI/CollisionLightsOff.paa new file mode 100644 index 0000000000000000000000000000000000000000..12f4960df98e250fa73cb205fd3e7938233ee7de GIT binary patch literal 5625 zcmeHLe@v8R9DiQDHz854d51VWg#q@%Rcq6WW_s`C2Hn!U!}hw!4DoP`R02k@!1 zGWNEOvCVeIPUADQr7(ptD+HNjB#?fM;9=$uGS{;y(~LXkA_;~OHlscAJ>mh=12(!0 zo=ujjYm9Nu?YUvCu&b}y)q#s4qYBTucoFoWp9PL|I!e6AZtF<~m|hp)}QX1u;U#xMDaGwY(Kj9sD{d$FJL zE$C|e;JGYG$F$95cXn$h*(! znW8B1%rjb7t38_f3F#+6pDC9=iw0e%4-ob)Qy6qLpP$NdBL>+H$3nRtjl%)iNgHuLZK?NTcABM8BrvVU4< zuX@?3&hEG0K5;uGpMGROe!Ri^7`t!(_z3ND1kB#8ojKsrgW|p_%Ch?}w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WUW!^5$`x)scL7%agzK8}KC-)Fm7bwaDp>A)e$rm;Bm83D%jgdf2 zMS!q!3w`GVkNI%q4DCy)vOH*84fsWVB&>qr?Y4j3BD*)V%o{TFmF2XNm65%U$lmW^ z56r*G{$zh7W6#p2uE^mogdFx@nIcuTV1rG>yU>kzCauZSmwC_F4f{oWmC7qaD#JtQ zypVsJ<6pc8#zTd;{VWZ_Z;Z*S1I6viL+CG3x|XI5n6Mf_p@P4=_N|IBZPQW-gb z5Zo#I$9HslFWJ3QWAgm97xDdHh33f5AGfwrhSfpSubm+_BbK|abFc>!9y3? ze9X=PCDgsDpqA$Ef{!c%S%ZDpN^kA1dLBr*1H0Z%jz1{h5@oU8yC^?kx zRx9U@PW=N%k5AMam@Ykb5cO^Lby1%1IG}Xe!8tu*RPHyepDaXp7CZjh%wSf zEp+o_`)mK$5^Ws;_k&(kzgnDe{ch;T8GES~{9R%2r20z?`?l^avo8#S#r!VB0}Wwk z_1n?={rcO!PW?XSPx4N`!<5Iuev#3M=RsT`v19x;9!L#3K@Pfs z{r`hMGFc{u)1j|NIN6!7sKAr6i}a;0*vTKP1Kw&M}7W zL-2R6m}czD(&TpRS2moD(@$vz)&`3)0%N}=O#EYG59fc6J#fCbO7pg8MLV@(L2t!M zd2LO_iK>b~JLF?ZP~Sc4E!_u})CT<$=Tpu-x2mOQ)e({>VJ@_3m|3(XI|<7;Z)T+zi5!#LUW;?X!X(r|l-}cH`;Hk78s}M9gNl0DN2qvy~7*qhM0E!ehjC%B?rfv1V(luiYENP TpQCGCn}@Z22!+4~|2EcN22$w& literal 0 HcmV?d00001 diff --git a/addons/cockpit_interaction/UI/FuelPumpsOff.paa b/addons/cockpit_interaction/UI/FuelPumpsOff.paa new file mode 100644 index 0000000000000000000000000000000000000000..956d9346fe48aa8464598e2ab06e46953040727b GIT binary patch literal 5625 zcmeHLO=uHA6n=?aY{b@z7Qx?8V=o>R>_Kp&wlPpKV77`_)cS*n(UVaSZA=9V{xnv^ zfQY$RJoK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YtUQ-hd zMR9%sjpvI~<9KBs@P#X<3@k|-MVn`|<+_fxd>5P@Ym=Z)+w?_V^>|J7HIk<`KXd=_ zYxMM;-(7z`HlI?$i}z#x0AVah zd2R^bEV1>`YpX9(_}*Du#8*KZZ|8^8&%M1`$fL1frupZO0dRwH8pQOe z;+6e=*U1&v#n*{0sp?P6@nuTqk$vQ5ghd`>j+HfzD@_KLS=g^K%hIYC{8Y+sa;#{;5F$anH z=$v#)IEAIqvFMy~zU4q5eHrIfOQbG$Edn#8{5IxJMP( YSf~XR75>ckIg(PF4`D%2BMhL&f14{eo&W#< literal 0 HcmV?d00001 diff --git a/addons/cockpit_interaction/UI/MainLightsOff.paa b/addons/cockpit_interaction/UI/MainLightsOff.paa new file mode 100644 index 0000000000000000000000000000000000000000..89db264afc39831b860a8e94d9839a6fef808081 GIT binary patch literal 5625 zcmeHLUuauZ82@gT*cG}Z$S#UqHEIh3?ZY5+ZWVjtNK2S@7tASvDXvRv#ik7?^re)> z^`SzUjn%n`AbIqmIQDXV5Vm2*QfQe~C#^=4%F5OvYRszbH1+s>=VYeMsxwqdp*h@p zxxbw6-0$!Go$tmbnws3c!%Z!2D*#MP{P>E*e)qG41rEYZ?q?baYj_fVuCehb!}~Cv zgARZ<_W+#M0lvkvxWRw{I8c#VMhfY!gtu8d$X)M9waPo^vIw>jR@p9HOA%N<0@2y! zfd)K;NQsj;)|blvT1GFEcf|Tf5`c5ASO0FdFOH`gQut!kAd7b{c4maVJdxvBf9=(U zthg1L%VBMAyIGYOUKu0IeFlTkS^J-Ui{xcZ(|E-w61De4WlmlXen!lF^C2OUOK3$H zAKEtitKcM#l;l*kK*A%`3mqxta!ZeGd*9|MG!1bJjnkrjzam3;$r2K zWIb;+{}-2sE-VjVk|h6GAch(7W)Ks<;e7#qF^0)~edQbJ&uPP`{9a6p@z5e+99nPM z+?B8|sr3dx?@wm?wMm5JKk}pV3-L?b{``z&GhisOc5HV3A$rSB7D)S%(9z5Y^1JGn z*1-^!;!@tg`6n>HB%dPx5Wk&09!Qvqk7|qdfs+ey_e)aMj-$FSHjyP9!_uqSQWj=^eduPSM@){>atKooiCIB z4c~=U??$^DohKh@IPoN(Cez5#Z=9N;IB;$lmV&mvd=}@ACtp+Z0P{3Ib9kS^44?%c zlszlA3EC!Gt|-pGE#Ewk_}nhp26685p|l)Myej>uJf|PqcH_tgX6q-|InjD*6Do&> z`@SCRllIa4-q`hyHl+gaD}mor*d~MjWDOp)p5&FbyuXEbGQC!RC`N5tr)<+m{{t<9 zz4xD4k@_7D!+1O*9)0R^;7NKu?(*73^}m!p_1(vjHW?o@mftsJzIAmjD6!5M&%jiG zdEb-qWuS4_Lh{U)_?e^H1|#QxRBe;kW*#%w{|s`XwG?kj`(8_K8{n|%SjG+Wfix`b z*<|d%zXAc(h_5Faw{?_#xqt6kvVM7ls(EIfWH8^Nmcm( literal 0 HcmV?d00001 diff --git a/addons/cockpit_interaction/UI/MainLightsOn.paa b/addons/cockpit_interaction/UI/MainLightsOn.paa new file mode 100644 index 0000000000000000000000000000000000000000..34f9fa280e12ed3174e84166171f72c0ec0c621c GIT binary patch literal 5625 zcmeHLZ)jUp6hALZ>xT+uHdf~%g5;x=;@FqB55hK9Sqg@&(@Cq*q_VQL3L3MzcA9!U=iWru%!;8<3(e_$ zX?}UhJxfY|C0xIjUtusCi4fG>mI50*U}eV7wNExFj-xqk_T4v zKxAfVpb-b>DSjMjHNO1sWwe;wBj(?ew3>9a`ZvSBFp+9Z;lirHD&D!!nc>#*M6S+y z>#ogb`JLcw4l6tTMpa^Xd7QBB(HM-)SpV>vM4eU?MXwmcoxy#qGRLn5uFzI->tW85 zi>N~g#C^$+SRa}kUY;K467n=n)AM@%*Z;-Zzx$HW(O?9xlQybqu^hV0e~t01um>1p zg>vuD)F1oM=%^%qi>j*Z7SB%gS6oP;{m33FRhd4_m7~8{K{k+V)u-dHcc9pDx2enCx$f7`_Ih zP2?knPxpR;>09mlE1x+9Q^fP!BJmgcYops=cFySjvA(-O-1?w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^D&IRyYzoZ{(n!Ziw5&Q`SQAJQ~5`jUx)jH8pJ$&!nTL(|2O&X+h~^VZ!-QQ ze;DScYMEJ9eVNFAJU&D6bMB!gBaD=jJmvF4SqIC`RF$=o|HJ0nUHU&#{=eDXXmIEJ zN|G!;QG@yKoZn&Xi3)h!H!ViLx5#}M?Z@TnrmL0VqkMyiFFC*aGV;0Ms=y4J&P~mo zRh;+zB>czugzox$tFBbUqd?bL)b{XypZ`zJq4Qot)NiVnHCHOj&g>dI|Jo3HM)<*f zB(@mOm+(iz1OD@^MJpnh4t&;*^>qHk`S2qiVLS3akz@p4Bwr$+eLjaLfTR}08?OtV z7*k;Bi}XxL6m2<`jir|eFLCCv^*xEWspo!sy(BH5_3NYyk^P=@+D1p8{@?|(_?Efa zO&DJr)Wz-f%dN`V=L!3%>-b{shl+>~mT?W+%-Dav7MQT0+=Ca%>o`vK=9GMg7hxZc zq+Mp)Zg5c*Jm+<9-&GBlwL z=Vg_#^p5qlvszYJWH0*7ydQ@{txj8^X*!DydIKF^yY0iLJX>bgr$pKg+>Z4^(v-A} z_XHp4K6|dqEdJVDA@m`=>@wt)d)~7D_R#%)%r|P|v0cU@NKeU8$ATAtR4hAm25p{3 z4=cnnzTXB>^WWZ9?-ZXv8lOp2<(jzKfrPdfz1ljmh@KSx;hNpjke`WHS}|Eim?qA1gTg!~_B@(0A*qYH=9oKVu# zSt8bJ7-#%nv>Id1MHng5?hsFeiJ$>IQpg)hA1yEB;x#fRHQhkG@^giA%Eur~dAVSd k-!l+V#N5HWpwGH7h+W_!K6lTC>db)&R1`3+!08SD0&oxL<^TWy literal 0 HcmV?d00001 diff --git a/addons/cockpit_interaction/UI/StarterOn.paa b/addons/cockpit_interaction/UI/StarterOn.paa new file mode 100644 index 0000000000000000000000000000000000000000..347dd81af7dd6d60c66a33c57cd82ab63404d3c8 GIT binary patch literal 5625 zcmeHLe@swLf8d(IVETAD*$pO)pY5JEaGey?$y?Z`yTfDorSHl`vL;6}VTHFc8$&u+LY zBtqVbB&1FzqzCS~kwO$gBv52dD_r%&J)ZzA;CU7gbT@sktuO%}DCOxek1%?@KnoG@ zM_^64UTo+E{n!U7mBkg;TEFzL@hHUDgyV*H{K*P6tFKSW5$)yPPWBG8YeJj~A@MKj z1xb2{(F<6XWtAL;q4XespQTHV0B+MfzWG8?C*bfM-9GHB`hkt77@&o-ReK+P$tm@D_S2gaxAcTrBk`Kl zHl3B7gVl_U|IGb|@vxDGOyg)VUyp26r2*o}|6Ttd^?>tsjrVWtm$iRXl$<#*RsYH~ zduI8=dNQ~G>Wlj$K!N`%$3n7IEl*IP&m#A%78vW_`{yANs$a zU&Qgg8}l>r#vU8AB$Utjx0iC05Gymu=cDuYhhhH)_c1=Wdh-s0-$+o<{K@=X!1E;@ zF(if%3r~McgWL8QfRGw&Tl^RbZ3=SnmST->bNEgO=i72@8(9|+Z=Px+YCGVL(Yww0g0KPSmkQ_n@*eeV8-4oJ`_AbFllnF* zVmLO)oBA4Zjf(nb5Ib?#@%h^KC0?e`#ueCR2LJO|ppy+{Hn@;q1!^BlE&3KN#15ck z2Xxn@-8F#Q5;0yBQkom1jm9wkT0?$m4cKSTKac#BieePYF335W%*TnWsUmY764R#H;qC7!xIN~m`l~?SpB*b8WyslLbGr$C{5A=r&*zKps?!PihTC}an1*l3TaI~LZeQD#Fv@Vgbwl5S zFqmJ12%RfF4PksTHll?utKbk8b?LdQYeV;QOr*%IZF+Rv!d5lf`&yelU+U7q2SIW2`U%t2 + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_handleActionsPFH + * + * Public: No + */ + +#include "script_component.hpp" +params ["_arguments", "_pfhHandle"]; +_arguments params ["_vehicle"]; + +if (_vehicle getVariable [QGVAR(hasElectricalPower), false]) then { + if !((isCollisionLightOn _vehicle) isEqualTo (_vehicle getVariable [QGVAR(collisionLightsOn), false])) then { + [_vehicle] call FUNC(switchCollisionLight); + }; + if !((isLightOn _vehicle) isEqualTo (_vehicle getVariable [QGVAR(mainLightsOn), false])) then { + [_vehicle] call FUNC(switchMainLight); + }; +} else { + _vehicle setCollisionLight false; + _vehicle setPilotLight false; +}; diff --git a/addons/cockpit_interaction/functions/fnc_onEngine.sqf b/addons/cockpit_interaction/functions/fnc_onEngine.sqf new file mode 100644 index 0000000000..87fe5b6bbc --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_onEngine.sqf @@ -0,0 +1,34 @@ +/* + * Author: BaerMitUmlaut + * Disables the engine or switches the switches for AI pilots. + * + * Arguments: + * 0: Aircraft + * 1: Engine state + * + * Return Value: + * None + * + * Example: + * [_helo, true] call ace_cockpit_interaction_fnc_onEngine + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle", "_engineOn"]; + +if !(local _vehicle) exitWith {}; + +if (isPlayer driver _vehicle) then { + if !(_vehicle getVariable [QGVAR(engineOn), false]) then { + _vehicle engineOn false; + }; +} else { + // Flip the switches for AI pilots + _vehicle setVariable [QGVAR(engineOn), _engineOn, true]; + _vehicle setVariable [QGVAR(batteryOn), _engineOn, true]; + _vehicle setVariable [QGVAR(fuelPumpsOn), _engineOn, true]; + _vehicle setVariable [QGVAR(generatorOn), _engineOn, true]; + _vehicle setVariable [QGVAR(hasElectricalPower), _engineOn, true]; +}; diff --git a/addons/cockpit_interaction/functions/fnc_onLocal.sqf b/addons/cockpit_interaction/functions/fnc_onLocal.sqf new file mode 100644 index 0000000000..a8074f2b02 --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_onLocal.sqf @@ -0,0 +1,29 @@ +/* + * Author: BaerMitUmlaut + * Adds/removes the handleActionsPFH where the vehicle is/was local. + * + * Arguments: + * 0: Aircraft + * 1: Local + * + * Return Value: + * None + * + * Example: + * [_helo, true] call ace_cockpit_interaction_fnc_onLocal + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle", "_local"]; + +if !(getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(enabled)) == 1) exitWith {}; + +if (_local) then { + private _pfh = [FUNC(handleActionsPFH), 0, _vehicle] call CBA_fnc_addPerFrameHandler; + _vehicle setVariable [QGVAR(handleActionsPFH), _pfh]; +} else { + private _pfh = _vehicle getVariable [QGVAR(handleActionsPFH), -1]; + [_pfh] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/cockpit_interaction/functions/fnc_switchBattery.sqf b/addons/cockpit_interaction/functions/fnc_switchBattery.sqf new file mode 100644 index 0000000000..6eb79ef011 --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_switchBattery.sqf @@ -0,0 +1,21 @@ +/* + * Author: BaerMitUmlaut + * Switches the battery of any aircraft on or off. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_switchBattery + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +_vehicle setVariable [QGVAR(batteryOn), !(_vehicle getVariable [QGVAR(batteryOn), false]), true]; +[_vehicle] call FUNC(updateElectricalPower); diff --git a/addons/cockpit_interaction/functions/fnc_switchCollisionLight.sqf b/addons/cockpit_interaction/functions/fnc_switchCollisionLight.sqf new file mode 100644 index 0000000000..06c847d1fe --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_switchCollisionLight.sqf @@ -0,0 +1,24 @@ +/* + * Author: BaerMitUmlaut + * Switches the anti collision lights of any aircraft on or off. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_switchCollisionLight + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +private _collisionLightsOn = _vehicle getVariable [QGVAR(collisionLightsOn), false]; +private _hasElectricalPower = _vehicle getVariable [QGVAR(hasElectricalPower), false]; + +_vehicle setVariable [QGVAR(collisionLightsOn), !_collisionLightsOn, true]; +[QGVAR(setCollisionLight), _vehicle, [_vehicle, _hasElectricalPower && !_collisionLightsOn]] call EFUNC(common,objectEvent); diff --git a/addons/cockpit_interaction/functions/fnc_switchFuelPumps.sqf b/addons/cockpit_interaction/functions/fnc_switchFuelPumps.sqf new file mode 100644 index 0000000000..82bc9f2ee0 --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_switchFuelPumps.sqf @@ -0,0 +1,29 @@ +/* + * Author: BaerMitUmlaut + * Switches the fuel pumps of any aircraft on or off. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_switchFuelPumps + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +if (_vehicle getVariable [QGVAR(fuelPumpsOn), false]) then { + if (isEngineOn _vehicle) then { + [QGVAR(setEngineOn), _vehicle, [_vehicle, false]] call EFUNC(common,objectEvent); + [_vehicle] call FUNC(updateElectricalPower); + // TODO: add engine damage? + }; + _vehicle setVariable [QGVAR(fuelPumpsOn), false, true]; +} else { + _vehicle setVariable [QGVAR(fuelPumpsOn), true, true]; +}; diff --git a/addons/cockpit_interaction/functions/fnc_switchGenerator.sqf b/addons/cockpit_interaction/functions/fnc_switchGenerator.sqf new file mode 100644 index 0000000000..e2b8ed9f50 --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_switchGenerator.sqf @@ -0,0 +1,21 @@ +/* + * Author: BaerMitUmlaut + * Switches the generator of any aircraft on or off. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_switchGenerator + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +_vehicle setVariable [QGVAR(generatorOn), !(_vehicle getVariable [QGVAR(generatorOn), false]), true]; +[_vehicle] call FUNC(updateElectricalPower); diff --git a/addons/cockpit_interaction/functions/fnc_switchMainLight.sqf b/addons/cockpit_interaction/functions/fnc_switchMainLight.sqf new file mode 100644 index 0000000000..f744598a15 --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_switchMainLight.sqf @@ -0,0 +1,24 @@ +/* + * Author: BaerMitUmlaut + * Switches the main lights of any aircraft on or off. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_switchMainLights + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +private _mainLightsOn = _vehicle getVariable [QGVAR(mainLightsOn), false]; +private _hasElectricalPower = _vehicle getVariable [QGVAR(hasElectricalPower), false]; + +_vehicle setVariable [QGVAR(mainLightsOn), !_mainLightsOn, true]; +[QGVAR(setPilotLight), _vehicle, [_vehicle, _hasElectricalPower && !_mainLightsOn]] call EFUNC(common,objectEvent); diff --git a/addons/cockpit_interaction/functions/fnc_switchStarter.sqf b/addons/cockpit_interaction/functions/fnc_switchStarter.sqf new file mode 100644 index 0000000000..2b94b63b9d --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_switchStarter.sqf @@ -0,0 +1,24 @@ +/* + * Author: BaerMitUmlaut + * Switches the turbine starter switch of any aircraft on or off. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_switchStarter + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +private _starterOn = _vehicle getVariable [QGVAR(starterOn), false]; +if (!_starterOn && {_vehicle getVariable [QGVAR(hasElectricalPower), false]}) then { + [_vehicle] call FUNC(switchStarterInternal); +}; +_vehicle setVariable [QGVAR(starterOn), !_starterOn, true]; diff --git a/addons/cockpit_interaction/functions/fnc_switchStarterInternal.sqf b/addons/cockpit_interaction/functions/fnc_switchStarterInternal.sqf new file mode 100644 index 0000000000..c45d580363 --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_switchStarterInternal.sqf @@ -0,0 +1,32 @@ +/* + * Author: BaerMitUmlaut + * Switches the turbine starter of any aircraft on or off. Internal function, disconnected from the switch. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_switchStarterInternal + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +[{ + params ["_args", "_pfhID"]; + _args params ["_vehicle", "_startTime"]; + + if !(_vehicle getVariable [QGVAR(hasElectricalPower), false] && {_vehicle getVariable [QGVAR(starterOn), false]}) exitWith { + [_pfhID] call CBA_fnc_removePerFrameHandler; + }; + + if ((ACE_time - _startTime) > (5 + random 3)) exitWith { + [QGVAR(setEngineOn), _vehicle, [_vehicle, true]] call EFUNC(common,objectEvent); + [_pfhID] call CBA_fnc_removePerFrameHandler; + }; +}, 0, [_vehicle, ACE_time]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/cockpit_interaction/functions/fnc_updateElectricalPower.sqf b/addons/cockpit_interaction/functions/fnc_updateElectricalPower.sqf new file mode 100644 index 0000000000..a004ce98c5 --- /dev/null +++ b/addons/cockpit_interaction/functions/fnc_updateElectricalPower.sqf @@ -0,0 +1,38 @@ +/* + * Author: BaerMitUmlaut + * Turns the electrical power of any aircraft on or off, depending on the state of + * the battery, engine and generator. + * + * Arguments: + * 0: Aircraft + * + * Return Value: + * None + * + * Example: + * [_helo] call ace_cockpit_interaction_fnc_updateElectricalPower + * + * Public: No + */ + +#include "script_component.hpp" +params ["_vehicle"]; + +if (_vehicle getVariable [QGVAR(batteryOn), false] || {(isEngineOn _vehicle) && {_vehicle getVariable [QGVAR(generatorOn), false]}}) then { + _vehicle setVariable [QGVAR(hasElectricalPower), true, true]; + if (_vehicle getVariable [QGVAR(collisionLightsOn), false]) then { + [QGVAR(setCollisionLight), _vehicle, [_vehicle, true]] call EFUNC(common,objectEvent); + }; + if (_vehicle getVariable [QGVAR(mainLightsOn), false]) then { + [QGVAR(setPilotLight), _vehicle, [_vehicle, true]] call EFUNC(common,objectEvent); + }; + if (_vehicle getVariable [QGVAR(starterOn), false]) then { + [_vehicle] call FUNC(switchStarterInternal); + }; +} else { + _vehicle setVariable [QGVAR(hasElectricalPower), false, true]; + [QGVAR(simulatePowerLoss), _vehicle, [_vehicle]] call EFUNC(common,objectEvent); + if (_vehicle getVariable [QGVAR(starterOn), false]) then { + [_vehicle] call FUNC(switchStarterInternal); + }; +}; diff --git a/addons/cockpit_interaction/functions/script_component.hpp b/addons/cockpit_interaction/functions/script_component.hpp new file mode 100644 index 0000000000..0ecb06784d --- /dev/null +++ b/addons/cockpit_interaction/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\cockpit_interaction\script_component.hpp" \ No newline at end of file diff --git a/addons/cockpit_interaction/script_component.hpp b/addons/cockpit_interaction/script_component.hpp new file mode 100644 index 0000000000..25349ee294 --- /dev/null +++ b/addons/cockpit_interaction/script_component.hpp @@ -0,0 +1,13 @@ +#define COMPONENT cockpit_interaction +#include "\z\ace\addons\main\script_mod.hpp" +#define DISABLE_COMPILE_CACHE + +#ifdef DEBUG_ENABLED_COCKPIT_INTERACTION + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_COCKPIT_INTERACTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_COCKPIT_INTERACTION +#endif + +#include "\z\ace\addons\main\script_macros.hpp"