mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-31 01:35:20 +02:00
Last argument notificationpopup forces accept
Also you can't move or turn the camera when a notificationpopup is forced And you can't pitch the camera up and down anymore while in a script
This commit is contained in:
parent
41e4889e10
commit
5c3cbe89c1
@ -22,13 +22,14 @@ Public Class NotificationPopup
|
|||||||
Public _waitForInput As Boolean = False
|
Public _waitForInput As Boolean = False
|
||||||
Public _interacted As Boolean = False
|
Public _interacted As Boolean = False
|
||||||
Public _scriptFile As String = ""
|
Public _scriptFile As String = ""
|
||||||
|
Public _forceAccept As Boolean = False
|
||||||
|
|
||||||
Public IsReady As Boolean = False
|
Public IsReady As Boolean = False
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Sets the values of the NotificationPopup and displays it on the screen.
|
''' Sets the values of the NotificationPopup and displays it on the screen.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Sub Setup(Text As String, Optional Delay As Integer = 500, Optional BackgroundIndex As Integer = 0, Optional IconIndex As Integer = 0, Optional SoundEffect As String = "", Optional ScriptFile As String = "")
|
Public Sub Setup(Text As String, Optional Delay As Integer = 500, Optional BackgroundIndex As Integer = 0, Optional IconIndex As Integer = 0, Optional SoundEffect As String = "", Optional ScriptFile As String = "", Optional ForceAccept As Boolean = False)
|
||||||
_text = Text
|
_text = Text
|
||||||
|
|
||||||
If Delay <> -1 Then
|
If Delay <> -1 Then
|
||||||
@ -81,6 +82,8 @@ Public Class NotificationPopup
|
|||||||
_scriptFile = ScriptFile
|
_scriptFile = ScriptFile
|
||||||
|
|
||||||
_soundEffect = SoundEffect
|
_soundEffect = SoundEffect
|
||||||
|
|
||||||
|
_forceAccept = ForceAccept
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
@ -122,7 +125,7 @@ Public Class NotificationPopup
|
|||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim BackY As Integer = CInt(0 - _size.Height * (FrameSizeBack / 3) * _scale - (FrameSizeBack / 3 * _scale) - 5)
|
Dim BackY As Integer = CInt(0 - _size.Height * (FrameSizeBack / 3) * _scale - (FrameSizeBack / 3 * _scale) - 5)
|
||||||
If Me._interacted = True Then
|
If Me._interacted = True OrElse _forceAccept = True Then
|
||||||
If Me._positionY > BackY Then
|
If Me._positionY > BackY Then
|
||||||
Me._positionY -= CInt(1.5 * (FrameSizeBack / 3 * _scale) / _size.Height)
|
Me._positionY -= CInt(1.5 * (FrameSizeBack / 3 * _scale) / _size.Height)
|
||||||
If Me._positionY <= BackY Then
|
If Me._positionY <= BackY Then
|
||||||
|
@ -229,14 +229,17 @@ Public Class OverworldCamera
|
|||||||
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
||||||
Dim OS As OverworldScreen = CType(CurrentScreen, OverworldScreen)
|
Dim OS As OverworldScreen = CType(CurrentScreen, OverworldScreen)
|
||||||
|
|
||||||
|
If OS.NotificationPopupList.Count = 0 OrElse OS.NotificationPopupList(0)._forceAccept = False Then
|
||||||
If _freeCameraMode = True And OS.ActionScript.IsReady = True Then
|
If _freeCameraMode = True And OS.ActionScript.IsReady = True Then
|
||||||
If YawLocked = False Then
|
If YawLocked = False Then
|
||||||
Yaw += -RotationSpeed * 0.75F * dx
|
Yaw += -RotationSpeed * 0.75F * dx
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
If OS.ActionScript.IsReady = True Then
|
||||||
|
|
||||||
Pitch += -RotationSpeed * dy
|
Pitch += -RotationSpeed * dy
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
'text = " (Moving)"
|
'text = " (Moving)"
|
||||||
End If
|
End If
|
||||||
'Dim interval As TimeSpan
|
'Dim interval As TimeSpan
|
||||||
@ -334,10 +337,14 @@ Public Class OverworldCamera
|
|||||||
If _isFixed = False Then
|
If _isFixed = False Then
|
||||||
If PreventMovement = False AndAlso KeyBoardHandler.KeyPressed(KeyBindings.PerspectiveSwitchKey) = True Or ControllerHandler.ButtonPressed(Buttons.LeftShoulder) = True Then
|
If PreventMovement = False AndAlso KeyBoardHandler.KeyPressed(KeyBindings.PerspectiveSwitchKey) = True Or ControllerHandler.ButtonPressed(Buttons.LeftShoulder) = True Then
|
||||||
Dim actionscriptReady As Boolean = True
|
Dim actionscriptReady As Boolean = True
|
||||||
|
Dim forcedNotification As Boolean = False
|
||||||
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
||||||
actionscriptReady = CType(CurrentScreen, OverworldScreen).ActionScript.IsReady
|
actionscriptReady = CType(CurrentScreen, OverworldScreen).ActionScript.IsReady
|
||||||
|
If CType(CurrentScreen, OverworldScreen).NotificationPopupList.Count > 0 AndAlso CType(CurrentScreen, OverworldScreen).NotificationPopupList(0)._forceAccept = True Then
|
||||||
|
forcedNotification = True
|
||||||
End If
|
End If
|
||||||
If actionscriptReady = True And _canToggleThirdPerson Then
|
End If
|
||||||
|
If actionscriptReady = True And _canToggleThirdPerson AndAlso forcedNotification = False Then
|
||||||
SetThirdPerson(Not _thirdPerson, True)
|
SetThirdPerson(Not _thirdPerson, True)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@ -656,13 +663,17 @@ Public Class OverworldCamera
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim isActionscriptReady As Boolean = False
|
Dim isActionscriptReady As Boolean = False
|
||||||
|
Dim forcedNotification As Boolean = False
|
||||||
Dim OS As OverworldScreen = Nothing
|
Dim OS As OverworldScreen = Nothing
|
||||||
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
|
||||||
OS = CType(CurrentScreen, OverworldScreen)
|
OS = CType(CurrentScreen, OverworldScreen)
|
||||||
isActionscriptReady = OS.ActionScript.IsReady
|
isActionscriptReady = OS.ActionScript.IsReady
|
||||||
|
If OS.NotificationPopupList.Count > 0 AndAlso OS.NotificationPopupList(0)._forceAccept = True Then
|
||||||
|
forcedNotification = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If isActionscriptReady = True AndAlso ScriptBlock.TriggeredScriptBlock = False AndAlso Screen.Level.CanMove() = True AndAlso PreventMovement = False Then
|
If isActionscriptReady = True AndAlso ScriptBlock.TriggeredScriptBlock = False AndAlso Screen.Level.CanMove() = True AndAlso PreventMovement = False AndAlso forcedNotification = False Then
|
||||||
If _thirdPerson = False And _cameraFocusType = CameraFocusTypes.Player Then
|
If _thirdPerson = False And _cameraFocusType = CameraFocusTypes.Player Then
|
||||||
FirstPersonMovement()
|
FirstPersonMovement()
|
||||||
Else
|
Else
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)))
|
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)))
|
||||||
Case 5
|
Case 5
|
||||||
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)), args(4))
|
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)), args(4))
|
||||||
Case 6, 7
|
Case 6
|
||||||
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)), args(4), args(5))
|
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)), args(4), args(5))
|
||||||
|
Case 7
|
||||||
|
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)), args(4), args(5), CBool(args(6)))
|
||||||
End Select
|
End Select
|
||||||
If args.Length = 7 AndAlso CBool(args(6)) = True Then
|
If args.Length = 7 AndAlso CBool(args(6)) = True Then
|
||||||
CType(CurrentScreen, OverworldScreen).NotificationPopupList.Insert(0, _NotificationPopup)
|
CType(CurrentScreen, OverworldScreen).NotificationPopupList.Insert(0, _NotificationPopup)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user