From 6f0a35b5c742cd669b573fb7a62298c094f319ea Mon Sep 17 00:00:00 2001 From: Aragas Date: Mon, 5 Dec 2016 22:28:36 +0300 Subject: [PATCH 1/2] Added -nosplash command --- 2.5DHero/2.5DHero/Core/CommandLineArgHandler.vb | 16 +++++++++++++++- 2.5DHero/2.5DHero/Core/Core.vb | 8 +++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/2.5DHero/2.5DHero/Core/CommandLineArgHandler.vb b/2.5DHero/2.5DHero/Core/CommandLineArgHandler.vb index de0b76478..4d9e194a1 100644 --- a/2.5DHero/2.5DHero/Core/CommandLineArgHandler.vb +++ b/2.5DHero/2.5DHero/Core/CommandLineArgHandler.vb @@ -1,12 +1,20 @@ Module CommandLineArgHandler Private _forceGraphics As Boolean = False + Private _nosplash As Boolean = False Public Sub Initialize(ByVal args() As String) If args.Length > 0 Then - If args(0) = "-forcegraphics" Then + If args.Any(Function(arg As String) + Return arg = "-forcegraphics" + End Function) Then _forceGraphics = True End If + If args.Any(Function(arg As String) + Return arg = "-nosplash" + End Function) Then + _nosplash = True + End If End If For Each arg As String In args @@ -28,4 +36,10 @@ End Get End Property + Public ReadOnly Property NoSplash() As Boolean + Get + Return _nosplash + End Get + End Property + End Module \ No newline at end of file diff --git a/2.5DHero/2.5DHero/Core/Core.vb b/2.5DHero/2.5DHero/Core/Core.vb index fabddb1ab..1f129736b 100644 --- a/2.5DHero/2.5DHero/Core/Core.vb +++ b/2.5DHero/2.5DHero/Core/Core.vb @@ -73,7 +73,13 @@ GraphicsDevice.SamplerStates(0) = sampler KeyboardInput = New KeyboardInput() - SetScreen(New SplashScreen(GameInstance)) + + If CommandLineArgHandler.NoSplash = True Then + Core.LoadContent() + SetScreen(New MainMenuScreen()) + Else + SetScreen(New SplashScreen(GameInstance)) + End If End Sub Public Sub LoadContent() From bd9d651899a7f1be688173806ee43ab4a5c92a7f Mon Sep 17 00:00:00 2001 From: Aragas Date: Mon, 5 Dec 2016 22:30:02 +0300 Subject: [PATCH 2/2] Dictionary key not found fix? --- 2.5DHero/2.5DHero/Overworld/OverworldScreen.vb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb index 7a987b064..f2abb57b6 100644 --- a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb +++ b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb @@ -1,4 +1,6 @@ -''' +Imports System.Threading + +''' ''' The screen to display the default Overworld gameplay. ''' Public Class OverworldScreen @@ -380,6 +382,15 @@ Public Class OverworldScreen 'Set to correct music: If TrainerEncountered = False Then + Dim x = 0 + While (x < 100 And String.IsNullOrEmpty(Level.MusicLoop)) + Thread.Sleep(20) + x = x + 1 + End While + If String.IsNullOrEmpty(Level.MusicLoop) + Return + End If + Dim theme As String = Level.MusicLoop If Screen.Level.Surfing = True Then theme = "surf"