Improved PressStartScreen functionality part 1, updated SaveScreen save fail description.

This commit is contained in:
CaptainSegis 2017-09-01 21:05:38 -05:00
parent 89944271da
commit f35af71a36
4 changed files with 73 additions and 13 deletions

View File

@ -261,6 +261,19 @@ Public Class NewMainMenuScreen
End If
Next
End If
If Controls.Dismiss(True, False, False) Then
'Click on profiles:
For x = 0 To _profiles.Count - 1
Dim xOffset As Single = _screenOffset.X + x * 180 + ((x + 1) * 100 * (1 - _fadeIn))
If New Rectangle(CInt(xOffset), CInt(_screenOffset.Y), 160, 160).Contains(MouseHandler.MousePosition) Then
If _selectedProfile = x Then
DismissProfile()
End If
Exit For
End If
Next
End If
If Controls.Right(True) And _selectedProfile < _profiles.Count - 1 Then
_selectedProfile += 1
@ -276,7 +289,9 @@ Public Class NewMainMenuScreen
If Controls.Accept(False, True, True) Then
ClickedProfile()
End If
If Controls.Dismiss(False, True, True) Then
DismissProfile()
End If
'Try to load the GameJolt profile once the player has logged in.
_profiles(0).LoadGameJolt()
End If
@ -324,6 +339,10 @@ Public Class NewMainMenuScreen
End If
End Sub
Private Sub DismissProfile()
_profiles(_selectedProfile).UnSelectProfile()
End Sub
Private Sub UpdateScreenOffset()
If _screenOffset.X > _screenOffsetTarget.X Then
_screenOffset.X = MathHelper.Lerp(_screenOffsetTarget.X, _screenOffset.X, 0.93F)
@ -428,7 +447,17 @@ Public Class NewMainMenuScreen
"GameMode: " & tmpProfile.GameMode, New Vector2(displayRect.X + 30, displayRect.Y + 20), Color.White, 0F, Vector2.Zero, 0.5F, SpriteEffects.None, 0F)
SpriteBatch.Draw(_menuTexture, New Rectangle(displayRect.X + 30, displayRect.Y + 70, 32, 32), New Rectangle(0, 32, 32, 32), Color.White)
GetFontRenderer().DrawString(FontManager.GameJoltFont, "The required GameMode does not exist!", New Vector2(displayRect.X + 70, displayRect.Y + 78), Color.White, 0F, Vector2.Zero, 0.5F, SpriteEffects.None, 0F)
Dim errorText As String = ""
If tmpProfile.IsGameJolt() Then
errorText = "Download failed. Press Accept to try again." & vbNewLine & vbNewLine &
"If the problem persists, please try again later" & vbNewLine &
"or contact us in our Discord server:" & vbNewLine & vbNewLine &
"http://www.discord.me/p3d"
Else
errorText = "The required GameMode does not exist!"
End If
GetFontRenderer().DrawString(FontManager.GameJoltFont, errorText, New Vector2(displayRect.X + 70, displayRect.Y + 78), Color.White, 0F, Vector2.Zero, 0.5F, SpriteEffects.None, 0F)
End If
End If
@ -484,7 +513,7 @@ Public Class NewMainMenuScreen
Private _path As String = ""
Private _isNewGameButton As Boolean = False
Private _name As String
Private _name As String = ""
Private _gameMode As String
Private _pokedexSeen As Integer
Private _pokedexCaught As Integer
@ -590,7 +619,7 @@ Public Class NewMainMenuScreen
_loaded = False
_sprite = Content.Load(Of Texture2D)("Textures\UI\GameJolt\gameJoltIcon")
_sprite = TextureManager.GetTexture("Textures\UI\GameJolt\gameJoltIcon")
LoadGameJolt()
Else
@ -622,7 +651,7 @@ Public Class NewMainMenuScreen
End If
Else
_gameModeExists = False
_sprite = Content.Load(Of Texture2D)("SharedResources\Textures\unknownSprite")
_sprite = TextureManager.GetTexture("GUI\unknownSprite")
End If
End Sub
@ -767,13 +796,22 @@ Public Class NewMainMenuScreen
_isLoading = False
_failedGameJoltLoading = True
_sprite = Content.Load(Of Texture2D)("SharedResources\Textures\unknownSprite")
_sprite = TextureManager.GetTexture("GUI\unknownSprite")
End If
End If
End If
End If
End Sub
Public Sub UnSelectProfile()
If IsGameJolt AndAlso _loaded Then
_loaded = False
_isLoading = False
_pokemonTextures.Clear()
_sprite = TextureManager.GetTexture("Textures\UI\GameJolt\gameJoltIcon")
_fontSize = 0.75F
GameJolt.API.LoggedIn = False
End If
End Sub
Public Sub SelectProfile()
If _isNewGameButton Then
If GameModeManager.GameModeCount = 1 Then
@ -803,8 +841,15 @@ Public Class NewMainMenuScreen
SetScreen(New JoinServerScreen(CurrentScreen))
End If
Else
Dim messageBox As New UI.MessageBox(CurrentScreen)
messageBox.Show("The required GameMode does not exist." & vbNewLine & "Reaquire the GameMode to play on this profile.")
If Me.IsGameJolt Then
_loaded = False
_sprite = TextureManager.GetTexture("Textures\UI\GameJolt\gameJoltIcon")
LoadGameJolt()
Else
Dim messageBox As New UI.MessageBox(CurrentScreen)
messageBox.Show("The required GameMode does not exist." & vbNewLine & "Reaquire the GameMode to play on this profile.")
End If
End If
End If
End If

View File

@ -40,10 +40,13 @@
"You may safely quit the game now or try to save again later." & vbNewLine & vbNewLine &
"Backup save can be found at the Backup Save folder :)", New Vector2(188, 240), Color.Black)
Else
.DrawString(FontManager.MiniFont, "Press Dismiss to close this screen and try to save" & vbNewLine &
"again in order to prevent data corruption." & vbNewLine & vbNewLine &
"To have your save back up, you will require to enable Backup Save" & vbNewLine &
"Via GameOptions.dat > Extras|Backup Save", New Vector2(188, 240), Color.Black)
.DrawString(FontManager.MiniFont,
"Press Dismiss to close this screen and try to save again in order to prevent" & vbNewLine &
"data corruption." & vbNewLine & vbNewLine &
"If the problem persists, the reason could be GameJolt servers being under" & vbNewLine &
"maintenance right now." & vbNewLine & vbNewLine &
"Please try again later, or contact us in our official Discord server: " & vbNewLine & vbNewLine &
"http://www.discord.me/p3d", New Vector2(188, 240), Color.Black)
End If
Else
If ready = True Then

View File

@ -46435,3 +46435,15 @@
/processorParam:Quality=Best
/build:Songs/gameintro.ogg
#begin GUI/unknownSprite.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:GUI/unknownSprite.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB