mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 07:44:31 +02:00
Added per GameMode instance of global start script. New GameMode rule added "StartScript"
This commit is contained in:
parent
e435227959
commit
6b12b8f9d0
@ -81,6 +81,7 @@ Public Class OverworldScreen
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public Property GlobalGameModeScriptStarted As Boolean = False
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
@ -143,6 +144,12 @@ Public Class OverworldScreen
|
|||||||
''' Updates the OverworldScreen.
|
''' Updates the OverworldScreen.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Overrides Sub Update()
|
Public Overrides Sub Update()
|
||||||
|
If GameModeManager.ActiveGameMode.StartScript <> "" AndAlso ActionScript.IsReady AndAlso Not GlobalGameModeScriptStarted Then
|
||||||
|
ActionScript.reDelay = 0.0F
|
||||||
|
ActionScript.StartScript(GameModeManager.ActiveGameMode.StartScript, 0)
|
||||||
|
GlobalGameModeScriptStarted = True
|
||||||
|
End If
|
||||||
|
|
||||||
'If the MapScript has a value loaded from the MapScript map tag and there is no script running, start that script:
|
'If the MapScript has a value loaded from the MapScript map tag and there is no script running, start that script:
|
||||||
If LevelLoader.MapScript <> "" And ActionScript.IsReady = True Then
|
If LevelLoader.MapScript <> "" And ActionScript.IsReady = True Then
|
||||||
ActionScript.reDelay = 0.0F
|
ActionScript.reDelay = 0.0F
|
||||||
|
@ -459,6 +459,8 @@ Public Class GameMode
|
|||||||
End If
|
End If
|
||||||
Case "startrotation"
|
Case "startrotation"
|
||||||
Me._startRotation = CSng(Value.Replace(".", GameController.DecSeparator))
|
Me._startRotation = CSng(Value.Replace(".", GameController.DecSeparator))
|
||||||
|
Case "startscript"
|
||||||
|
StartScript = Value
|
||||||
Case "startlocationname"
|
Case "startlocationname"
|
||||||
Me._startLocationName = Value
|
Me._startLocationName = Value
|
||||||
Case "startdialogue"
|
Case "startdialogue"
|
||||||
@ -590,6 +592,7 @@ Public Class GameMode
|
|||||||
"StartMap|" & Me._startMap & vbNewLine &
|
"StartMap|" & Me._startMap & vbNewLine &
|
||||||
"StartPosition|" & Me._startPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & Me._startPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & Me._startPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine &
|
"StartPosition|" & Me._startPosition.X.ToString().Replace(GameController.DecSeparator, ".") & "," & Me._startPosition.Y.ToString().Replace(GameController.DecSeparator, ".") & "," & Me._startPosition.Z.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine &
|
||||||
"StartRotation|" & Me._startRotation.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine &
|
"StartRotation|" & Me._startRotation.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine &
|
||||||
|
"StartScript|" & StartScript & vbNewLine &
|
||||||
"StartLocationName|" & Me._startLocationName & vbNewLine &
|
"StartLocationName|" & Me._startLocationName & vbNewLine &
|
||||||
"StartDialogue|" & Me._startDialogue & vbNewLine &
|
"StartDialogue|" & Me._startDialogue & vbNewLine &
|
||||||
"StartColor|" & Me._startColor.R & "," & Me._startColor.G & "," & Me._startColor.B & vbNewLine &
|
"StartColor|" & Me._startColor.R & "," & Me._startColor.G & "," & Me._startColor.B & vbNewLine &
|
||||||
@ -980,6 +983,11 @@ Public Class GameMode
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' The default gamemode boot up script.
|
||||||
|
''' </summary>
|
||||||
|
Public Property StartScript As String = ""
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Class GameRule
|
Class GameRule
|
||||||
|
Loading…
x
Reference in New Issue
Block a user