Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added gameplay camera horizontal and vertical angle/rotation locking …
…options in the misc menu. Apparently this is useful in helicopters, according to the person that requested this feature.
  • Loading branch information
TomGrobbe committed Apr 13, 2018
1 parent 0f811cc commit fbb5f93
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
17 changes: 17 additions & 0 deletions vMenu/FunctionsController.cs
Expand Up @@ -26,6 +26,7 @@ class FunctionsController : BaseScript
private Dictionary<int, string> playerList = new Dictionary<int, string>();
private List<int> deadPlayers = new List<int>();
private UIMenu lastOpenMenu = null;
private float cameraRotationHeading = 0f;

/// <summary>
/// Constructor.
Expand Down Expand Up @@ -566,6 +567,22 @@ private async Task MiscSettings()
//SetNightvision(MainMenu.MiscSettingsMenu.NightVision);
//SetSeethrough(MainMenu.MiscSettingsMenu.ThermalVision);
#endregion
if (MainMenu.MiscSettingsMenu.LockCameraY)
{
SetGameplayCamRelativePitch(0f, 0f);
}
if (MainMenu.MiscSettingsMenu.LockCameraX)
{
if (Game.IsControlPressed(0, Control.LookLeftOnly))
{
cameraRotationHeading++;
}
else if (Game.IsControlPressed(0, Control.LookRightOnly))
{
cameraRotationHeading--;
}
SetGameplayCamRelativeHeading(cameraRotationHeading);
}
}
else
{
Expand Down
14 changes: 14 additions & 0 deletions vMenu/menus/MiscSettings.cs
Expand Up @@ -27,6 +27,8 @@ public class MiscSettings
public bool JoinQuitNotifications { get; private set; } = UserDefaults.MiscJoinQuitNotifications;
public bool NightVision { get; private set; } = false;
public bool ThermalVision { get; private set; } = false;
public bool LockCameraX { get; private set; } = false;
public bool LockCameraY { get; private set; } = false;

/// <summary>
/// Creates the menu.
Expand Down Expand Up @@ -59,6 +61,8 @@ private void CreateMenu()
UIMenuCheckboxItem thermalVision = new UIMenuCheckboxItem("Toggle Thermal Vision", ThermalVision, "Enable or disable thermal vision.");

UIMenuItem clearArea = new UIMenuItem("Clear Area", "Clears the area around your player (100 meters) of everything! Damage, dirt, peds, props, vehicles, etc. Everything gets cleaned up and reset.");
UIMenuCheckboxItem lockCamX = new UIMenuCheckboxItem("Lock Camera Horizontal Rotation", false, "Locks your camera horizontal rotation. Could be useful in helicopters I guess.");
UIMenuCheckboxItem lockCamY = new UIMenuCheckboxItem("Lock Camera Vertical Rotation", false, "Locks your camera vertical rotation. Could be useful in helicopters I guess.");

// Add menu items to the menu.
if (cf.IsAllowed(Permission.MSTeleportToWp))
Expand Down Expand Up @@ -102,6 +106,8 @@ private void CreateMenu()
// Always allowed
menu.AddItem(hideRadar);
menu.AddItem(hideHud);
menu.AddItem(lockCamX);
menu.AddItem(lockCamY);
menu.AddItem(saveSettings);

// Handle checkbox changes.
Expand Down Expand Up @@ -149,6 +155,14 @@ private void CreateMenu()
//ThermalVision = _checked;
SetSeethrough(_checked);
}
else if (item == lockCamX)
{
LockCameraX = _checked;
}
else if (item == lockCamY)
{
LockCameraY = _checked;
}
};

// Handle button presses.
Expand Down

0 comments on commit fbb5f93

Please sign in to comment.