Skip to content

Commit

Permalink
Add blips key
Browse files Browse the repository at this point in the history
Closes #13
  • Loading branch information
oldnapalm committed Nov 7, 2023
1 parent bf78417 commit ad53873
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
26 changes: 26 additions & 0 deletions CommunityRaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions CommunityRaces.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CAYOPERICOLOADER = True
RACESBLIPS = True
GROUPBLIPS = False
TELEPORTKEY = F8
BLIPSKEY = None

[GHOST]
OPACITY = 2
Expand Down
32 changes: 28 additions & 4 deletions Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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
Expand Down

0 comments on commit ad53873

Please sign in to comment.