diff --git a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb index 2faf180fb..433e12500 100644 --- a/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb +++ b/2.5DHero/2.5DHero/Battle/BattleSystemV2/BattleScreen.vb @@ -2,15 +2,12 @@ Public Class BattleScreen - Inherits Screen 'Used for after fainting switching Public Shared OwnFaint As Boolean = False Public Shared OppFaint As Boolean = False - - 'Used for lead picking in PvP Battles Public Shared OwnLeadIndex As Integer = 0 Public Shared OppLeadIndex As Integer = 0 @@ -873,6 +870,7 @@ nextIndex: Lighting.UpdateLighting(Screen.Effect) Camera.Update() Level.Update() + SkyDome.Update() TextBox.Update() @@ -975,6 +973,8 @@ nextIndex: #End Region Public Sub EndBattle(ByVal blackout As Boolean) + Level.StopOffsetMapUpdate() + Dim str As String = "" 'Call the EndBattle function of the abilities and Reverts battle only Pokemon formes. For Each p As Pokemon In Core.Player.Pokemons @@ -1143,14 +1143,13 @@ nextIndex: End While Else - i = Core.Random.Next(0, Trainer.Pokemons.count) + i = Core.Random.Next(0, Trainer.Pokemons.Count) While Trainer.Pokemons(i).Status = Pokemon.StatusProblems.Fainted OrElse OppPokemonIndex = i OrElse Trainer.Pokemons(i).HP <= 0 - i = Core.Random.Next(0, Trainer.Pokemons.count) + i = Core.Random.Next(0, Trainer.Pokemons.Count) End While End If End If - OppPokemonIndex = i OppPokemon = Trainer.Pokemons(i) @@ -1416,7 +1415,6 @@ nextIndex: End If End If - While cData.Length > 0 If cData(0).ToString() = "|" AndAlso tempData(tempData.Length - 1).ToString() = "}" Then newQueries.Add(tempData) @@ -1432,8 +1430,6 @@ nextIndex: tempData = "" End If - - If s.Identification = Identifications.BattleScreen Then CType(s, BattleScreen).BattleQuery.Clear() For Each q As String In newQueries @@ -1545,7 +1541,7 @@ nextIndex: ''' Use this to download the sprites for the players. ''' Private Sub DownloadOnlineSprites() - If Core.Player.IsGamejoltSave = True Then + If Core.Player.IsGameJoltSave = True Then Dim t As New Threading.Thread(AddressOf DownloadSprites) t.IsBackground = True t.Start() @@ -1578,4 +1574,4 @@ nextIndex: End Class -End Namespace +End Namespace \ No newline at end of file diff --git a/2.5DHero/2.5DHero/Core/MainGameFunctions.vb b/2.5DHero/2.5DHero/Core/MainGameFunctions.vb index c65e9f9e6..e3acf49a8 100644 --- a/2.5DHero/2.5DHero/Core/MainGameFunctions.vb +++ b/2.5DHero/2.5DHero/Core/MainGameFunctions.vb @@ -1,57 +1,57 @@ Public Class MainGameFunctions Public Shared Sub FunctionKeys() - If KeyBoardHandler.KeyPressed(KeyBindings.ScreenshotKey) = True And Core.CurrentScreen.CanTakeScreenshot = True Then + If KeyBoardHandler.KeyPressed(KeyBindings.GUIControlKey) = True Then + Core.GameOptions.ShowGUI = Not Core.GameOptions.ShowGUI + Core.GameOptions.SaveOptions() + ElseIf KeyBoardHandler.KeyPressed(KeyBindings.ScreenshotKey) AndAlso Core.CurrentScreen.CanTakeScreenshot Then CaptureScreen() - End If - If KeyBoardHandler.KeyPressed(KeyBindings.FullScreenKey) = True Then - If Core.CurrentScreen.CanGoFullscreen = True Then - ToggleFullScreen() - End If - End If - If KeyBoardHandler.KeyPressed(KeyBindings.DebugKey) = True Then + ElseIf KeyBoardHandler.KeyPressed(KeyBindings.DebugKey) Then Core.GameOptions.ShowDebug += 1 If Core.GameOptions.ShowDebug >= 2 Then Core.GameOptions.ShowDebug = 0 End If Core.GameOptions.SaveOptions() - End If - If KeyBoardHandler.KeyPressed(KeyBindings.GUIControlKey) = True Then - Core.GameOptions.ShowGUI = Not Core.GameOptions.ShowGUI + ElseIf KeyBoardHandler.KeyPressed(KeyBindings.LightKey) Then + Core.GameOptions.LightingEnabled = Not Core.GameOptions.LightingEnabled Core.GameOptions.SaveOptions() - End If - If KeyBoardHandler.KeyPressed(KeyBindings.MuteMusicKey) = True And Core.CurrentScreen.CanMuteMusic = True Then + + If Core.GameOptions.LightingEnabled Then + Core.GameMessage.ShowMessage(Localization.GetString("game_message_lighting_on", "Lighting Enabled"), 12, FontManager.MainFont, Color.White) + Else + Core.GameMessage.ShowMessage(Localization.GetString("game_message_lighting_off", "Lighting Disabled"), 12, FontManager.MainFont, Color.White) + End If + ElseIf KeyBoardHandler.KeyPressed(KeyBindings.FullScreenKey) AndAlso Core.CurrentScreen.CanGoFullscreen Then + ToggleFullScreen() + ElseIf KeyBoardHandler.KeyPressed(KeyBindings.MuteMusicKey) AndAlso Core.CurrentScreen.CanMuteMusic Then MusicManager.Mute(Not MediaPlayer.IsMuted) SoundManager.Mute(MediaPlayer.IsMuted) Core.GameOptions.SaveOptions() Core.CurrentScreen.ToggledMute() End If - If KeyBoardHandler.KeyPressed(KeyBindings.LightKey) = True Then - Core.GameOptions.LightingEnabled = Not Core.GameOptions.LightingEnabled - End If + If KeyBoardHandler.KeyDown(KeyBindings.DebugKey) = True Then - If KeyBoardHandler.KeyPressed(Keys.F) = True Then + If KeyBoardHandler.KeyPressed(Keys.F) Then TextureManager.TextureList.Clear() - End If - If KeyBoardHandler.KeyPressed(Keys.S) = True Then + Core.GameMessage.ShowMessage(Localization.GetString("game_message_debug_texture_list_clear", "Texture list have cleared"), 12, FontManager.MainFont, Color.White) + ElseIf KeyBoardHandler.KeyPressed(Keys.S) Then Core.SetWindowSize(New Vector2(1200, 680)) + ElseIf KeyBoardHandler.KeyPressed(Keys.L) Then + Logger.DisplayLog = Not Logger.DisplayLog + ElseIf KeyBoardHandler.KeyPressed(Keys.B) Then + Entity.drawViewBox = Not Entity.drawViewBox End If End If + If ControllerHandler.ButtonPressed(Buttons.Back, True) = True Then Core.GameOptions.GamePadEnabled = Not Core.GameOptions.GamePadEnabled - If Core.GameOptions.GamePadEnabled = True Then + If Core.GameOptions.GamePadEnabled Then Core.GameMessage.ShowMessage("Enabled XBOX 360 GamePad support.", 12, FontManager.MainFont, Color.White) Else Core.GameMessage.ShowMessage("Disabled XBOX 360 GamePad support.", 12, FontManager.MainFont, Color.White) End If Core.GameOptions.SaveOptions() End If - If KeyBoardHandler.KeyPressed(Keys.L) = True And KeyBoardHandler.KeyDown(KeyBindings.DebugKey) = True Then - Logger.DisplayLog = Not Logger.DisplayLog - End If - If KeyBoardHandler.KeyPressed(Keys.B) = True And KeyBoardHandler.KeyDown(KeyBindings.DebugKey) = True Then - Entity.drawViewBox = Not Entity.drawViewBox - End If End Sub Private Shared Sub CaptureScreen() @@ -88,12 +88,12 @@ End If If Core.GraphicsManager.IsFullScreen = False Then - Dim b As New System.Drawing.Bitmap(Core.windowSize.Width, Core.windowSize.Height) - Using g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(b) - g.CopyFromScreen(Core.window.ClientBounds.X, Core.window.ClientBounds.Y, 0, 0, New System.Drawing.Size(b.Width, b.Height)) + Dim b As New Drawing.Bitmap(Core.windowSize.Width, Core.windowSize.Height) + Using g As Drawing.Graphics = Drawing.Graphics.FromImage(b) + g.CopyFromScreen(Core.window.ClientBounds.X, Core.window.ClientBounds.Y, 0, 0, New Drawing.Size(b.Width, b.Height)) End Using - b.Save(GameController.GamePath & "\screenshots\" & fileName, System.Drawing.Imaging.ImageFormat.Png) + b.Save(GameController.GamePath & "\screenshots\" & fileName, Drawing.Imaging.ImageFormat.Png) Else Dim screenshot As New RenderTarget2D(Core.GraphicsDevice, Core.windowSize.Width, Core.windowSize.Height, False, SurfaceFormat.Color, DepthFormat.Depth24Stencil8) Core.GraphicsDevice.SetRenderTarget(screenshot) @@ -119,11 +119,11 @@ ' MonoGame Bug > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width != System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width ' MonoGame Bug > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height != System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height ' Temp Fix just in case someone else face this as well. - If GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width <> System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width OrElse - GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height <> System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height Then - Core.GraphicsManager.PreferredBackBufferWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - Core.GraphicsManager.PreferredBackBufferHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - Core.windowSize = New Rectangle(0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) + If GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width <> Windows.Forms.Screen.PrimaryScreen.Bounds.Width OrElse + GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height <> Windows.Forms.Screen.PrimaryScreen.Bounds.Height Then + Core.GraphicsManager.PreferredBackBufferWidth = Windows.Forms.Screen.PrimaryScreen.Bounds.Width + Core.GraphicsManager.PreferredBackBufferHeight = Windows.Forms.Screen.PrimaryScreen.Bounds.Height + Core.windowSize = New Rectangle(0, 0, Windows.Forms.Screen.PrimaryScreen.Bounds.Width, Windows.Forms.Screen.PrimaryScreen.Bounds.Height) Else Core.GraphicsManager.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width Core.GraphicsManager.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height diff --git a/2.5DHero/2.5DHero/HelperClasses/Animation.vb b/2.5DHero/2.5DHero/HelperClasses/Animation.vb index 4fef05fbd..a0315ce6a 100644 --- a/2.5DHero/2.5DHero/HelperClasses/Animation.vb +++ b/2.5DHero/2.5DHero/HelperClasses/Animation.vb @@ -164,9 +164,9 @@ Public Class Animation End Sub ''' - ''' Stopps the animation and returns to start. + ''' Stops the animation and returns to start. ''' - Public Sub Stopp() + Public Sub [Stop]() _Running = PlayMode.Stopped CurrentRow = StartRow CurrentColumn = StartColumn diff --git a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb index 7a30911ee..21f8217ad 100644 --- a/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb +++ b/2.5DHero/2.5DHero/Overworld/OverworldScreen.vb @@ -329,7 +329,7 @@ Public Class OverworldScreen d.Add(Buttons.A, "Interact") d.Add(Buttons.X, "Menu") - If Core.Player.hasPokegear = True Then + If Core.Player.HasPokegear = True Then d.Add(Buttons.Y, "Pokégear") End If @@ -394,7 +394,7 @@ Public Class OverworldScreen Thread.Sleep(20) x = x + 1 End While - If String.IsNullOrEmpty(Level.MusicLoop) + If String.IsNullOrEmpty(Level.MusicLoop) Then Return End If diff --git a/2.5DHero/2.5DHero/Screens/TransitionScreen.vb b/2.5DHero/2.5DHero/Screens/TransitionScreen.vb index c9abaf0f7..1e3b6b552 100644 --- a/2.5DHero/2.5DHero/Screens/TransitionScreen.vb +++ b/2.5DHero/2.5DHero/Screens/TransitionScreen.vb @@ -59,7 +59,7 @@ End If End Sub - Public Overrides Sub Draw() + Public Overrides Sub Draw() If reduce = False Then OldScreen.Draw() Else diff --git a/2.5DHero/2.5DHero/World/Level.vb b/2.5DHero/2.5DHero/World/Level.vb index 4bc9ff058..3a66e1736 100644 --- a/2.5DHero/2.5DHero/World/Level.vb +++ b/2.5DHero/2.5DHero/World/Level.vb @@ -685,7 +685,9 @@ Public Class Level Public Sub StopOffsetMapUpdate() Me._offsetTimer.Stop() - While Me._isUpdatingOffsetMaps : End While + While Me._isUpdatingOffsetMaps + System.Threading.Thread.Sleep(1) + End While Logger.Debug("Stopped Offset map update") End Sub