Skip to content

Commit

Permalink
Allows easier editing of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Oct 24, 2018
1 parent d906f42 commit 045892d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Binary file modified _Resource/VoiceGPS/VoiceGPS_FiveM.Client.net.dll
Binary file not shown.
19 changes: 14 additions & 5 deletions src/VoiceGPS-FiveM.Client/ClientScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,7 +50,7 @@ private async Task OnTick()
_welcomeShowed = true;
}

if (Game.IsControlJustReleased(1, Control.DropAmmo))
if (IsKeybindEnabled && Game.IsControlJustReleased(1, ToggleVGPSKeybind))
{
ToggleVgps();
}
Expand Down

0 comments on commit 045892d

Please sign in to comment.