Skip to content

Commit

Permalink
MouseToggle Fixes
Browse files Browse the repository at this point in the history
- ShootState is now set to false whenever MouseToggle is changed
- Shoot is only toggled when the mouse cursor is invisible
  • Loading branch information
ari-steas committed Mar 13, 2024
1 parent 337fb2d commit 1ebe874
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ public bool MouseShootState
{
Settings.MouseShootState = value;
Settings.Sync(SorterWep.GetPosition());
ShootState = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void HandleMouseShoot()
{
IMyEntity controlledEntity = MyAPIGateway.Session.Player?.Controller?.ControlledEntity?.Entity?.GetTopMostParent(); // Get the currently controlled grid.
IMyCubeGrid grid = controlledEntity as IMyCubeGrid;
if (grid == null || !GridWeapons.ContainsKey(grid))
if (MyAPIGateway.Gui.IsCursorVisible || grid == null || !GridWeapons.ContainsKey(grid))
return;

bool isMousePressed = MyAPIGateway.Input.IsMousePressed(VRage.Input.MyMouseButtonsEnum.Left);
Expand Down

0 comments on commit 1ebe874

Please sign in to comment.