From 045892d907939b945b7af6b8081e84d1d1c10662 Mon Sep 17 00:00:00 2001 From: davwheat Date: Wed, 24 Oct 2018 23:59:23 +0100 Subject: [PATCH] Allows easier editing of settings --- .../VoiceGPS/VoiceGPS_FiveM.Client.net.dll | Bin 11264 -> 11264 bytes src/VoiceGPS-FiveM.Client/ClientScript.cs | 19 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/_Resource/VoiceGPS/VoiceGPS_FiveM.Client.net.dll b/_Resource/VoiceGPS/VoiceGPS_FiveM.Client.net.dll index 170669fb0e791c930295893474b9eb2cede99de2..50e4720e4f2276c49d912c997fed1d55d68ea634 100644 GIT binary patch delta 4103 zcmaJ^4RBP|6+ZXwd-uI;b~pRp{v{B?k^o&yAPGSr0}2QXMx+qKkNlNJ{<<0ng0&6H zvYQInXsLu(t4xbS72DEI+riih)ppA0&{RhuGs+Y?fJ}dowo>WfOsUh@@80*aiInL} z-goag_uO;8d(OG{CHedF_wV~Uue#CwLf@W+CoYp2~>YIQAMTvWgm?9J0|qwNYoX zS>Mk{CqYsMDn%i}Vz6~v;@mxm2Tl4$a0h;4n!6KZCl^lFE@b24)JcvPrlK3w^i zl^3!?jR%G#Ldv>vg|eKxqZW!F@C`AcL6bM~42S2quMsQsVpM65{RR`c#yb)Mqt zh8-w|!NSP7t6)h0Ou(b1PV7ymIiJS71DCFlbCVKfv+&VuAH$MfE z372H4RXT*E{pkhd#ze!shK$MbRjxK z@BAP*h9#Z1gVlGGqIRox6752}17E|cmPfXxH*ee~w@xKQ*O8X0B`tIvcXSx4s(DMA z=AhNUq13rOR2#$XKta5iO!6Z!3$NyMgvRHd*QG3v$8L=bLH|^k_PrxYs2-aW)a|>f z3;L2Ku}R@sg)b`nwZiw6P1biw2x?SVqxAE9N%;K4H%Ir=F!Lh!Q&o+ zaQZ`^T=;b?Dd<`K9`w6})NG($O#3Ry3H?SGmKDnKfYFQoi#V);exfX=32C`YNT*Rv z`gxB_%`z-0=&~;DKZZt71U?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Yk8P>qp}8}s zp?w9i-x(LIjiN?S03R$S@m0|%TBjpelUbn&SzM1M^^C65ZzPUWexw)BXV_1t12;naZoMph>(XHDTo%G;b;)%|{;@hq#Z@>=4)K0N(~{>y$GY z3_p*}bXuat44vlcg2X!7h6Pj zViJk;LPw?4MW3+~OraSSVyuhW*jc91!V1brGc864w`i*z z?4*6#@0musJ!zsILREgtT`0+zbWuu|nQH1t>GM^>=w}Iy}&{AGEk>?Bwi&!`zi^#c^M`Ky5&GOO)!R088p>Y#2#m3@T*+(yJ?O#m5$Nt z{4wBdqXoD~TZSz7hOvqoSiSZ%U62+|QGz)%lXV$Cpi@+i{wW&jX?{#itWDdGnOlut zQUvqgq*j)h&;E#Lgw1!c%{#`2)XDZ~*QDuNw39u_Kc~Gc&Q*3Nr0QAVZcO5E|MP4V?!rZ27*QQXgHfnQQ3d4zt7s^&UgAWF4@&*RG!pt| zshKZvF*QQ7oR$OE(zk&r+Qg^OCb|H8mJDSvITSFIO=t||MRte`=WKYyh~fuDtyHtv zmHI#J;w7oFru#ze zvBPDppZsaoPd5K9bL8Olsm{ejY33_hf-(CkEkSnnIW56iaiIYW+S%IK&$wesnszmA@uxU(dz6fE6E(QvcE=TSa3+OLEO&1 z5#-nzE zx_E0K)?(sVR)?>Sa~Aqm3580S?!$6%}CMh znOqNWopaq(bSr|-0w_&Y#|EbEc>~%GHNk>regbZm4ziZ^9xflxCe$O;sKxR*ck{fc z&@vl}p*+}#PX*DV&C{Asp6UK+$FM6?x_9n*WAUO-cJwBOn#{g7)mbKSr!2;A dO?4ivJdQujOL~LD{;Tl9`d(|~KUq(m@jrWjXDR>y diff --git a/src/VoiceGPS-FiveM.Client/ClientScript.cs b/src/VoiceGPS-FiveM.Client/ClientScript.cs index 631b491..1089f01 100644 --- a/src/VoiceGPS-FiveM.Client/ClientScript.cs +++ b/src/VoiceGPS-FiveM.Client/ClientScript.cs @@ -10,19 +10,28 @@ namespace VoiceGPS_FiveM.Client public class ClientScript : BaseScript { private static Ped _playerPed; + private bool _justPlayed1000M, _justPlayed200M, _justPlayedFollowRoad, _justPlayedImmediate, _playedStartDriveAudio, _justPlayedRecalc, _voiceGpsEnabled, _welcomeShowed; + private bool _justPlayedArrived = true; + private int _lastDirection; + + // User editable variables // Default volume (between 0.1 and 1.0) private double _audioVolume = 0.7; - private bool _justPlayed1000M, _justPlayed200M, _justPlayedFollowRoad, _justPlayedImmediate, _playedStartDriveAudio, _justPlayedRecalc, _voiceGpsEnabled, _welcomeShowed; - private bool _justPlayedArrived = true; + private const Control ToggleVGPSKeybind = Control.DropAmmo; // F10 + private const bool IsKeybindEnabled = true; + + private const bool IsCommandEnabled = true; - private int _lastDirection; public ClientScript() { Chat("VGPS Loaded"); - EventHandlers.Add("vgps:toggleVGPS", new Action(ToggleVgps)); + EventHandlers.Add("vgps:toggleVGPS", + IsCommandEnabled + ? new Action(ToggleVgps) + : new Action(() => ShowNotification("~r~The command has been disabled. Please use the set keybind instead."))); // UNCOMMENT BELOW LINE TO REMOVE THE WELCOME MESSAGE //_welcomeShowed = true; @@ -41,7 +50,7 @@ private async Task OnTick() _welcomeShowed = true; } - if (Game.IsControlJustReleased(1, Control.DropAmmo)) + if (IsKeybindEnabled && Game.IsControlJustReleased(1, ToggleVGPSKeybind)) { ToggleVgps(); }