P3D-Legacy/P3D/Core/CommandLineArgHandler.vb

45 lines
1.2 KiB
VB.net
Raw Normal View History

2016-09-07 18:50:38 +02:00
Module CommandLineArgHandler
Private _forceGraphics As Boolean = False
2016-12-05 20:28:36 +01:00
Private _nosplash As Boolean = False
2016-09-07 18:50:38 +02:00
Public Sub Initialize(ByVal args() As String)
If args.Length > 0 Then
2016-12-05 20:28:36 +01:00
If args.Any(Function(arg As String)
Return arg = "-forcegraphics"
End Function) Then
2016-09-07 18:50:38 +02:00
_forceGraphics = True
End If
2016-12-05 20:28:36 +01:00
If args.Any(Function(arg As String)
Return arg = "-nosplash"
End Function) Then
_nosplash = True
End If
2016-09-07 18:50:38 +02:00
End If
For Each arg As String In args
If arg.Contains(":") = True Then
Dim identifier As String = arg.Remove(arg.IndexOf(":"))
Dim value As String = arg.Remove(0, arg.IndexOf(":") + 1)
Select Case identifier
Case "MAP"
MapPreviewScreen.DetectMapPath(value)
End Select
End If
Next
End Sub
Public ReadOnly Property ForceGraphics() As Boolean
Get
Return _forceGraphics
End Get
End Property
2016-12-05 20:28:36 +01:00
Public ReadOnly Property NoSplash() As Boolean
Get
Return _nosplash
End Get
End Property
2016-09-07 18:50:38 +02:00
End Module