From ad53873b0454e2fa7543cbe5409727fd25f0f83e Mon Sep 17 00:00:00 2001 From: oldnapalm <38410858+oldnapalm@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:07:14 -0300 Subject: [PATCH] Add blips key Closes #13 --- CommunityRaces.cs | 26 ++++++++++++++++++++++++++ CommunityRaces.ini | 1 + Config.cs | 32 ++++++++++++++++++++++++++++---- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/CommunityRaces.cs b/CommunityRaces.cs index d865310..8e81dd3 100644 --- a/CommunityRaces.cs +++ b/CommunityRaces.cs @@ -711,10 +711,36 @@ public void OnTick(object sender, EventArgs e) private void OnKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Config.TeleportKey) + { if (Game.IsWaypointActive) Helpers.Teleport(World.GetWaypointPosition()); else UI.Notify("Select teleport destination"); + } + else if (e.KeyCode == Config.BlipsKey) + { + if (!Config.RacesBlips) + { + Config.RacesBlips = true; + Config.GroupBlips = false; + AddRacesBlips(); + UI.Notify("Blips on"); + } + else if (Config.GroupBlips) + { + RemoveRacesBlips(); + Config.RacesBlips = false; + Config.GroupBlips = false; + UI.Notify("Blips off"); + } + else + { + RemoveRacesBlips(); + Config.GroupBlips = true; + AddRacesBlips(); + UI.Notify("Blips grouped"); + } + } } private void OnAbort(object sender, EventArgs e) diff --git a/CommunityRaces.ini b/CommunityRaces.ini index 14d2895..1a84b15 100644 --- a/CommunityRaces.ini +++ b/CommunityRaces.ini @@ -16,6 +16,7 @@ CAYOPERICOLOADER = True RACESBLIPS = True GROUPBLIPS = False TELEPORTKEY = F8 +BLIPSKEY = None [GHOST] OPACITY = 2 diff --git a/Config.cs b/Config.cs index 1437a3a..7237e95 100644 --- a/Config.cs +++ b/Config.cs @@ -10,11 +10,10 @@ public static class Config public static int Opacity; public static bool Collision; public static bool CayoPericoLoader; - public static bool RacesBlips; - public static bool GroupBlips; public static int WantedCheckInterval; public static int WantedProbability; public static Keys TeleportKey; + public static Keys BlipsKey; static Config() { @@ -25,11 +24,36 @@ static Config() Opacity = o * 51; Collision = _settings.GetValue("Ghost", "Collision", false); CayoPericoLoader = _settings.GetValue("Main", "CayoPericoLoader", true); - RacesBlips = _settings.GetValue("Main", "RacesBlips", true); - GroupBlips = _settings.GetValue("Main", "GroupBlips", false); WantedCheckInterval = _settings.GetValue("Main", "WantedCheckInterval", 10); WantedProbability = _settings.GetValue("Main", "WantedProbability", 20); TeleportKey = (Keys)Enum.Parse(typeof(Keys), _settings.GetValue("Main", "TeleportKey", "F8"), true); + BlipsKey = (Keys)Enum.Parse(typeof(Keys), _settings.GetValue("Main", "BlipsKey", "None"), true); + } + + public static bool RacesBlips + { + get + { + return _settings.GetValue("Main", "RacesBlips", true); + } + set + { + _settings.SetValue("Main", "RacesBlips", value); + _settings.Save(); + } + } + + public static bool GroupBlips + { + get + { + return _settings.GetValue("Main", "GroupBlips", false); + } + set + { + _settings.SetValue("Main", "GroupBlips", value); + _settings.Save(); + } } public static string Time