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:
JappaWakka 2023-07-27 15:50:45 +02:00
parent 41e4889e10
commit 5c3cbe89c1
3 changed files with 26 additions and 10 deletions

View File

@ -22,13 +22,14 @@ Public Class NotificationPopup
Public _waitForInput As Boolean = False
Public _interacted As Boolean = False
Public _scriptFile As String = ""
Public _forceAccept As Boolean = False
Public IsReady As Boolean = False
''' <summary>
''' Sets the values of the NotificationPopup and displays it on the screen.
''' </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
If Delay <> -1 Then
@ -81,6 +82,8 @@ Public Class NotificationPopup
_scriptFile = ScriptFile
_soundEffect = SoundEffect
_forceAccept = ForceAccept
End Sub
''' <summary>
@ -122,7 +125,7 @@ Public Class NotificationPopup
End If
Else
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
Me._positionY -= CInt(1.5 * (FrameSizeBack / 3 * _scale) / _size.Height)
If Me._positionY <= BackY Then

View File

@ -229,14 +229,17 @@ Public Class OverworldCamera
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
Dim OS As OverworldScreen = CType(CurrentScreen, OverworldScreen)
If _freeCameraMode = True And OS.ActionScript.IsReady = True Then
If YawLocked = False Then
Yaw += -RotationSpeed * 0.75F * dx
If OS.NotificationPopupList.Count = 0 OrElse OS.NotificationPopupList(0)._forceAccept = False Then
If _freeCameraMode = True And OS.ActionScript.IsReady = True Then
If YawLocked = False Then
Yaw += -RotationSpeed * 0.75F * dx
End If
End If
If OS.ActionScript.IsReady = True Then
Pitch += -RotationSpeed * dy
End If
End If
End If
Pitch += -RotationSpeed * dy
'text = " (Moving)"
End If
'Dim interval As TimeSpan
@ -334,10 +337,14 @@ Public Class OverworldCamera
If _isFixed = False Then
If PreventMovement = False AndAlso KeyBoardHandler.KeyPressed(KeyBindings.PerspectiveSwitchKey) = True Or ControllerHandler.ButtonPressed(Buttons.LeftShoulder) = True Then
Dim actionscriptReady As Boolean = True
Dim forcedNotification As Boolean = False
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
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
If actionscriptReady = True And _canToggleThirdPerson AndAlso forcedNotification = False Then
SetThirdPerson(Not _thirdPerson, True)
End If
End If
@ -656,13 +663,17 @@ Public Class OverworldCamera
End If
Dim isActionscriptReady As Boolean = False
Dim forcedNotification As Boolean = False
Dim OS As OverworldScreen = Nothing
If CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
OS = CType(CurrentScreen, OverworldScreen)
isActionscriptReady = OS.ActionScript.IsReady
If OS.NotificationPopupList.Count > 0 AndAlso OS.NotificationPopupList(0)._forceAccept = True Then
forcedNotification = True
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
FirstPersonMovement()
Else

View File

@ -26,8 +26,10 @@
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)))
Case 5
_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))
Case 7
_NotificationPopup.Setup(args(0), int(args(1)), int(args(2)), int(args(3)), args(4), args(5), CBool(args(6)))
End Select
If args.Length = 7 AndAlso CBool(args(6)) = True Then
CType(CurrentScreen, OverworldScreen).NotificationPopupList.Insert(0, _NotificationPopup)