Skip to content

Commit

Permalink
Add (wip) expanded radar keybinds.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGrobbe committed Mar 14, 2019
1 parent 606e898 commit 46f2c87
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
31 changes: 31 additions & 0 deletions vMenu/FunctionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ private void ShowSpeedMph()
}
}
#endregion
int radarSwitchTimer = 0;
/// <summary>
/// Run all tasks that need to be handeled for the Misc Settings Menu.
/// </summary>
Expand Down Expand Up @@ -916,6 +917,36 @@ private async Task MiscSettings()
}
}
}
/*
TODO: UNCOMMENT WHEN PR IS MERGED INTO FIVEM PRODUCTION
*/
//if (GetProfileSetting(221) == 1) // 221 = settings > display > expanded radar
//{
// SetBigmapActive(true, false);
//}
//else
//{
// if (IsBigmapActive() && GetGameTimer() - radarSwitchTimer > 8000)
// {
// SetBigmapActive(false, false);
// }
// if (Game.IsControlJustReleased(0, Control.MultiplayerInfo) && MainMenu.MiscSettingsMenu.KbRadarKeys && !MenuController.IsAnyMenuOpen() && !IsPauseMenuActive())
// {
// bool radarExpanded = IsBigmapActive();

// if (radarExpanded)
// {
// SetBigmapActive(false, false);
// }
// else
// {
// SetBigmapActive(true, false);
// radarSwitchTimer = GetGameTimer();
// }
// }
//}
}
else
{
Expand Down
10 changes: 9 additions & 1 deletion vMenu/UserDefaults.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -302,6 +302,11 @@ public static bool KbRecordKeys
get { return GetSettingsBool("kbRecordKeys"); }
set { SetSavedSettingsBool("kbRecordKeys", value); }
}
public static bool KbRadarKeys
{
get { return GetSettingsBool("kbRadarKeys"); }
set { SetSavedSettingsBool("kbRadarKeys", value); }
}
#endregion
#endregion

Expand Down Expand Up @@ -550,6 +555,9 @@ public static void SaveSettings()

KbRecordKeys = MainMenu.MiscSettingsMenu.KbRecordKeys;
prefs.Add("kbRecordKeys", KbRecordKeys);

KbRadarKeys = MainMenu.MiscSettingsMenu.KbRadarKeys;
prefs.Add("kbRadarKeys", KbRadarKeys);
}

if (MainMenu.VehicleOptionsMenu != null)
Expand Down
8 changes: 8 additions & 0 deletions vMenu/menus/MiscSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class MiscSettings
: 168; // 168 (F7 by default)
public bool KbDriftMode { get; private set; } = UserDefaults.KbDriftMode;
public bool KbRecordKeys { get; private set; } = UserDefaults.KbRecordKeys;
public bool KbRadarKeys { get; private set; } = UserDefaults.KbRadarKeys;

private List<Vector3> tpLocations = new List<Vector3>();
private List<float> tpLocationsHeading = new List<float>();
Expand Down Expand Up @@ -93,6 +94,7 @@ private void CreateMenu()
MenuCheckboxItem kbTpToWaypoint = new MenuCheckboxItem("Teleport To Waypoint", "Teleport to your waypoint when pressing the keybind. By default, this keybind is set to ~r~F7~s~, server owners are able to change this however so ask them if you don't know what it is.", KbTpToWaypoint);
MenuCheckboxItem kbDriftMode = new MenuCheckboxItem("Drift Mode", "Makes your vehicle have almost no traction while holding left shift on keyboard, or X on controller.", KbDriftMode);
MenuCheckboxItem kbRecordKeys = new MenuCheckboxItem("Recording Controls", "Enables or disables the recording (gameplay recording for the Rockstar editor) hotkeys on both keyboard and controller.", KbRecordKeys);
MenuCheckboxItem kbRadarKeys = new MenuCheckboxItem("Minimap Controls", "Press the Multiplayer Info (z on keyboard, down arrow on controller) key to switch between expanded radar and normal radar.", KbRadarKeys);
MenuItem backBtn = new MenuItem("Back");

// Create the menu items.
Expand Down Expand Up @@ -122,6 +124,7 @@ private void CreateMenu()
MenuItem clearArea = new MenuItem("Clear Area", "Clears the area around your player (100 meters). Damage, dirt, peds, props, vehicles, etc. Everything gets cleaned up, fixed and reset to the default world state.");
MenuCheckboxItem lockCamX = new MenuCheckboxItem("Lock Camera Horizontal Rotation", "Locks your camera horizontal rotation. Could be useful in helicopters I guess.", false);
MenuCheckboxItem lockCamY = new MenuCheckboxItem("Lock Camera Vertical Rotation", "Locks your camera vertical rotation. Could be useful in helicopters I guess.", false);


Menu connectionSubmenu = new Menu(Game.Player.Name, "Connection Options");
MenuItem connectionSubmenuBtn = new MenuItem("Connection Options", "Server connection/game quit options.");
Expand Down Expand Up @@ -168,6 +171,10 @@ private void CreateMenu()
{
KbRecordKeys = _checked;
}
else if (item == kbRadarKeys)
{
KbRadarKeys = _checked;
}
};
keybindMenu.OnItemSelect += (sender, item, index) =>
{
Expand Down Expand Up @@ -233,6 +240,7 @@ private void CreateMenu()
}
// always allowed keybind menu options
keybindMenu.AddMenuItem(kbRecordKeys);
keybindMenu.AddMenuItem(kbRadarKeys);
keybindMenu.AddMenuItem(backBtn);

// Always allowed
Expand Down

0 comments on commit 46f2c87

Please sign in to comment.