mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 07:44:31 +02:00
You can now scroll using the gamepad triggers
This commit is contained in:
parent
b015a3632d
commit
8f7c725b95
@ -53,7 +53,7 @@
|
|||||||
Return (GamePad.GetState(CType(index, PlayerIndex)).IsConnected = True And Core.GameOptions.GamePadEnabled = True)
|
Return (GamePad.GetState(CType(index, PlayerIndex)).IsConnected = True And Core.GameOptions.GamePadEnabled = True)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function HasControlerInput(Optional ByVal index As Integer = 0) As Boolean
|
Public Shared Function HasControllerInput(Optional ByVal index As Integer = 0) As Boolean
|
||||||
If IsConnected() = False Then
|
If IsConnected() = False Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
@ -350,7 +350,7 @@
|
|||||||
Core.GameInstance.IsMouseVisible = True
|
Core.GameInstance.IsMouseVisible = True
|
||||||
End If
|
End If
|
||||||
ElseIf Core.GameInstance.IsMouseVisible = True Then
|
ElseIf Core.GameInstance.IsMouseVisible = True Then
|
||||||
If ControllerHandler.HasControlerInput() = True Or Controls.HasKeyboardInput() = True Then
|
If ControllerHandler.HasControllerInput() = True Or Controls.HasKeyboardInput() = True Then
|
||||||
Core.GameInstance.IsMouseVisible = False
|
Core.GameInstance.IsMouseVisible = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
@ -222,7 +222,7 @@
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Case ScreenStates.Stopped
|
Case ScreenStates.Stopped
|
||||||
If KeyBoardHandler.GetPressedKeys().Count > 0 Or ControllerHandler.HasControlerInput() = True Or Controls.Accept() = True Or Controls.Dismiss() = True Then
|
If KeyBoardHandler.GetPressedKeys().Count > 0 Or ControllerHandler.HasControllerInput() = True Or Controls.Accept() = True Or Controls.Dismiss() = True Then
|
||||||
SoundManager.PlaySound("select")
|
SoundManager.PlaySound("select")
|
||||||
CloseScreen()
|
CloseScreen()
|
||||||
End If
|
End If
|
||||||
|
@ -229,7 +229,7 @@
|
|||||||
Case ScreenStates.Idle
|
Case ScreenStates.Idle
|
||||||
Me.UpdateIdle()
|
Me.UpdateIdle()
|
||||||
Case ScreenStates.Stopped
|
Case ScreenStates.Stopped
|
||||||
If KeyBoardHandler.GetPressedKeys().Count > 0 Or ControllerHandler.HasControlerInput() = True Or Controls.Accept() = True Or Controls.Dismiss() = True Then
|
If KeyBoardHandler.GetPressedKeys().Count > 0 Or ControllerHandler.HasControllerInput() = True Or Controls.Accept() = True Or Controls.Dismiss() = True Then
|
||||||
SoundManager.PlaySound("select")
|
SoundManager.PlaySound("select")
|
||||||
Core.SetScreen(Me.PreScreen)
|
Core.SetScreen(Me.PreScreen)
|
||||||
End If
|
End If
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
Case ScreenStates.Idle
|
Case ScreenStates.Idle
|
||||||
Me.UpdateIdle()
|
Me.UpdateIdle()
|
||||||
Case ScreenStates.Stopped
|
Case ScreenStates.Stopped
|
||||||
If KeyBoardHandler.GetPressedKeys().Count > 0 Or ControllerHandler.HasControlerInput() = True Or Controls.Accept() = True Or Controls.Dismiss() = True Then
|
If KeyBoardHandler.GetPressedKeys().Count > 0 Or ControllerHandler.HasControllerInput() = True Or Controls.Accept() = True Or Controls.Dismiss() = True Then
|
||||||
SoundManager.PlaySound("select")
|
SoundManager.PlaySound("select")
|
||||||
Core.SetScreen(Me.PreScreen)
|
Core.SetScreen(Me.PreScreen)
|
||||||
End If
|
End If
|
||||||
|
@ -221,7 +221,7 @@ Public Class OverworldCamera
|
|||||||
|
|
||||||
Dim dy As Single = mState.Y - oldY
|
Dim dy As Single = mState.Y - oldY
|
||||||
If gState.ThumbSticks.Right.Y <> 0.0F And Core.GameOptions.GamePadEnabled = True Then
|
If gState.ThumbSticks.Right.Y <> 0.0F And Core.GameOptions.GamePadEnabled = True Then
|
||||||
dy = gState.ThumbSticks.Right.Y * 40.0F * -1.0F
|
dy = gState.ThumbSticks.Right.Y * 35.0F * -1.0F
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If _isFixed = False AndAlso (dx <> 0 OrElse dy <> 0) Then
|
If _isFixed = False AndAlso (dx <> 0 OrElse dy <> 0) Then
|
||||||
@ -274,7 +274,14 @@ Public Class OverworldCamera
|
|||||||
_scrollDirection = 1
|
_scrollDirection = 1
|
||||||
_scrollSpeed += _scrollSpeed.Clamp(0, 0.01)
|
_scrollSpeed += _scrollSpeed.Clamp(0, 0.01)
|
||||||
End If
|
End If
|
||||||
|
If ControllerHandler.ButtonDown(Buttons.LeftTrigger) = True Then
|
||||||
|
If _scrollSpeed = 0.0F Or _scrollDirection <> 1 Then
|
||||||
|
_scrollSpeed = 0.002F
|
||||||
|
End If
|
||||||
|
|
||||||
|
_scrollDirection = 1
|
||||||
|
_scrollSpeed += _scrollSpeed.Clamp(0, 0.002F)
|
||||||
|
End If
|
||||||
If Controls.Up(True, False, True, False, False, False) = True Then
|
If Controls.Up(True, False, True, False, False, False) = True Then
|
||||||
If _scrollSpeed = 0.0F Or _scrollDirection <> -1 Then
|
If _scrollSpeed = 0.0F Or _scrollDirection <> -1 Then
|
||||||
_scrollSpeed = 0.01F
|
_scrollSpeed = 0.01F
|
||||||
@ -283,6 +290,14 @@ Public Class OverworldCamera
|
|||||||
_scrollDirection = -1
|
_scrollDirection = -1
|
||||||
_scrollSpeed += _scrollSpeed.Clamp(0, 0.01)
|
_scrollSpeed += _scrollSpeed.Clamp(0, 0.01)
|
||||||
End If
|
End If
|
||||||
|
If ControllerHandler.ButtonDown(Buttons.RightTrigger) = True Then
|
||||||
|
If _scrollSpeed = 0.0F Or _scrollDirection <> -1 Then
|
||||||
|
_scrollSpeed = 0.002F
|
||||||
|
End If
|
||||||
|
|
||||||
|
_scrollDirection = -1
|
||||||
|
_scrollSpeed += _scrollSpeed.Clamp(0, 0.002F)
|
||||||
|
End If
|
||||||
|
|
||||||
_scrollSpeed = _scrollSpeed.Clamp(0, 0.08)
|
_scrollSpeed = _scrollSpeed.Clamp(0, 0.08)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user