2017-08-11 07:02:26 +02:00
|
|
|
|
Public Class NewMenuScreen
|
|
|
|
|
|
|
|
|
|
Inherits Screen
|
|
|
|
|
|
|
|
|
|
Private _menuOptions As New List(Of String)
|
|
|
|
|
Private _menuIndex As Integer = 0
|
|
|
|
|
|
|
|
|
|
Private _texture As Texture2D
|
|
|
|
|
|
|
|
|
|
'Intro animation:
|
|
|
|
|
Private _gradientFade As Integer = 0
|
|
|
|
|
Private _buttonFadeIndex As Integer = 0
|
|
|
|
|
Private _currentButtonFade As Integer = 0
|
|
|
|
|
Private _buttonIntroFinished As Boolean = False
|
|
|
|
|
|
|
|
|
|
'cursor animation:
|
|
|
|
|
Private _cursorPosition As Vector2 = New Vector2(0, 0)
|
|
|
|
|
Private _cursorDestPosition As Vector2 = New Vector2(0, 0)
|
|
|
|
|
|
|
|
|
|
Private _preScreenTexture As RenderTarget2D
|
|
|
|
|
Private _preScreenTarget As RenderTarget2D
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Public Sub New(ByVal currentScreen As Screen)
|
|
|
|
|
Identification = Identifications.MenuScreen
|
|
|
|
|
PreScreen = currentScreen
|
|
|
|
|
IsDrawingGradients = True
|
|
|
|
|
|
|
|
|
|
MouseVisible = True
|
2022-06-04 16:12:03 +02:00
|
|
|
|
If windowSize.Width > 0 AndAlso windowSize.Height > 0 Then
|
|
|
|
|
_preScreenTarget = New RenderTarget2D(GraphicsDevice, windowSize.Width, windowSize.Height, False, SurfaceFormat.Color, DepthFormat.Depth24Stencil8)
|
|
|
|
|
_blur = New Resources.Blur.BlurHandler(windowSize.Width, windowSize.Height)
|
|
|
|
|
End If
|
2017-08-11 07:02:26 +02:00
|
|
|
|
_texture = TextureManager.GetTexture("GUI\Menus\General")
|
|
|
|
|
|
|
|
|
|
ConstructMenu()
|
|
|
|
|
|
|
|
|
|
_menuIndex = Player.Temp.MenuIndex
|
|
|
|
|
SetCursorPosition(_menuIndex)
|
|
|
|
|
_cursorPosition = _cursorDestPosition
|
|
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub ConstructMenu()
|
2022-08-29 13:01:56 +02:00
|
|
|
|
If Screen.Level.SaveOnly = False Then
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-08-29 13:01:56 +02:00
|
|
|
|
If Core.Player.HasPokedex = True Then
|
|
|
|
|
_menuOptions.Add("Pokédex")
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End If
|
|
|
|
|
|
2022-08-29 13:01:56 +02:00
|
|
|
|
If Screen.Level.IsBugCatchingContest = True Then
|
|
|
|
|
_menuOptions.AddRange({Screen.Level.BugCatchingContestData.GetSplit(2) & " x" & Core.Player.Inventory.GetItemAmount(177),
|
|
|
|
|
"Bag",
|
|
|
|
|
"|||" & Core.Player.Name, 'Trainer card
|
|
|
|
|
"End Contest"})
|
|
|
|
|
Else
|
|
|
|
|
If Core.Player.Pokemons.Count > 0 Then
|
|
|
|
|
_menuOptions.Add("Pokémon")
|
|
|
|
|
End If
|
|
|
|
|
_menuOptions.AddRange({"Bag",
|
|
|
|
|
"|||" & Core.Player.Name,
|
|
|
|
|
"Save"})
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
_menuOptions.Add("Options")
|
|
|
|
|
Else
|
|
|
|
|
_menuOptions.Add("Save")
|
|
|
|
|
End If
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End Sub
|
|
|
|
|
|
2018-02-22 23:43:27 +01:00
|
|
|
|
Private _blur As Resources.Blur.BlurHandler
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
|
|
|
|
Private Sub DrawPrescreen()
|
2022-06-04 16:12:03 +02:00
|
|
|
|
If windowSize.Width > 0 And windowSize.Height > 0 Then
|
|
|
|
|
If _preScreenTarget Is Nothing Then
|
|
|
|
|
_preScreenTarget = New RenderTarget2D(GraphicsDevice, windowSize.Width, windowSize.Height, False, SurfaceFormat.Color, DepthFormat.Depth24Stencil8)
|
|
|
|
|
End If
|
|
|
|
|
If _blur Is Nothing Then
|
|
|
|
|
_blur = New Resources.Blur.BlurHandler(windowSize.Width, windowSize.Height)
|
|
|
|
|
End If
|
|
|
|
|
If _preScreenTexture Is Nothing OrElse _preScreenTexture.IsContentLost Then
|
|
|
|
|
SpriteBatch.EndBatch()
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-06-04 16:12:03 +02:00
|
|
|
|
Dim target As RenderTarget2D = _preScreenTarget
|
|
|
|
|
GraphicsDevice.SetRenderTarget(target)
|
|
|
|
|
GraphicsDevice.Clear(BackgroundColor)
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-06-04 16:12:03 +02:00
|
|
|
|
SpriteBatch.BeginBatch()
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-06-04 16:12:03 +02:00
|
|
|
|
PreScreen.Draw()
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-06-04 16:12:03 +02:00
|
|
|
|
SpriteBatch.EndBatch()
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-06-04 16:12:03 +02:00
|
|
|
|
GraphicsDevice.SetRenderTarget(Nothing)
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-06-04 16:12:03 +02:00
|
|
|
|
SpriteBatch.BeginBatch()
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
2022-06-04 16:12:03 +02:00
|
|
|
|
_preScreenTexture = target
|
|
|
|
|
End If
|
|
|
|
|
If _preScreenTexture IsNot Nothing Then
|
|
|
|
|
If _preScreenTexture.Width > 0 And _preScreenTexture.Height > 0 Then
|
|
|
|
|
SpriteBatch.Draw(_blur.Perform(_preScreenTexture), windowSize, Color.White)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Overrides Sub Draw()
|
|
|
|
|
DrawPrescreen()
|
|
|
|
|
|
|
|
|
|
DrawGradients(_gradientFade)
|
|
|
|
|
|
|
|
|
|
If Me.IsCurrentScreen() = True Then
|
|
|
|
|
'Draw buttons:
|
|
|
|
|
If _gradientFade = 255 Then
|
|
|
|
|
If Core.Player.IsGameJoltSave = True Then
|
|
|
|
|
GameJolt.Emblem.Draw(GameJolt.API.username, Core.GameJoltSave.GameJoltID, Core.GameJoltSave.Points, Core.GameJoltSave.Gender, Core.GameJoltSave.Emblem, New Vector2(CSng(Core.windowSize.Width / 2 - 256), 30), 4, Core.GameJoltSave.DownloadedSprite)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
For i = 0 To _menuOptions.Count - 1
|
|
|
|
|
Dim text As String = _menuOptions(i).Replace("|||", "")
|
|
|
|
|
|
|
|
|
|
If _buttonIntroFinished = True Or _buttonFadeIndex > i Then
|
|
|
|
|
Dim pos = GetButtonPosition(i)
|
|
|
|
|
|
|
|
|
|
Core.SpriteBatch.Draw(_texture, New Rectangle(CInt(pos.X), CInt(pos.Y), 64, 64), New Rectangle(16, 16, 16, 16), Color.White)
|
|
|
|
|
Core.SpriteBatch.Draw(_texture, New Rectangle(CInt(pos.X) + 64, CInt(pos.Y), 64 * 4, 64), New Rectangle(32, 16, 16, 16), Color.White)
|
|
|
|
|
Core.SpriteBatch.Draw(_texture, New Rectangle(CInt(pos.X) + 64 * 5, CInt(pos.Y), 64, 64), New Rectangle(16, 16, 16, 16), Color.White, 0.0F, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.0F)
|
|
|
|
|
|
2021-09-28 17:30:43 +02:00
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, text, New Vector2(CInt(pos.X) + 20, CInt(pos.Y) + 20), Color.Black, 0.0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0.0F)
|
2017-08-11 07:02:26 +02:00
|
|
|
|
Else
|
|
|
|
|
Dim pos = GetButtonPosition(i)
|
|
|
|
|
|
|
|
|
|
Core.SpriteBatch.Draw(_texture, New Rectangle(CInt(pos.X), CInt(pos.Y), 64, 64), New Rectangle(16, 16, 16, 16), New Color(255, 255, 255, _currentButtonFade))
|
|
|
|
|
Core.SpriteBatch.Draw(_texture, New Rectangle(CInt(pos.X) + 64, CInt(pos.Y), 64 * 4, 64), New Rectangle(32, 16, 16, 16), New Color(255, 255, 255, _currentButtonFade))
|
|
|
|
|
Core.SpriteBatch.Draw(_texture, New Rectangle(CInt(pos.X) + 64 * 5, CInt(pos.Y), 64, 64), New Rectangle(16, 16, 16, 16), New Color(255, 255, 255, _currentButtonFade), 0.0F, Vector2.Zero, SpriteEffects.FlipHorizontally, 0.0F)
|
|
|
|
|
|
2021-09-28 17:30:43 +02:00
|
|
|
|
Core.SpriteBatch.DrawString(FontManager.MainFont, text, New Vector2(CInt(pos.X) + 20, CInt(pos.Y) + 20), New Color(0, 0, 0, _currentButtonFade), 0.0F, Vector2.Zero, 1.0F, SpriteEffects.None, 0.0F)
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
|
|
|
|
Exit For
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
DrawCursor()
|
|
|
|
|
Else
|
|
|
|
|
_buttonFadeIndex = 0
|
|
|
|
|
_currentButtonFade = 0
|
|
|
|
|
_buttonIntroFinished = False
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub DrawCursor()
|
|
|
|
|
If _buttonIntroFinished = True Or _buttonFadeIndex > _menuIndex Then
|
|
|
|
|
Dim t As Texture2D = TextureManager.GetTexture("GUI\Menus\General", New Rectangle(0, 0, 16, 16), "")
|
|
|
|
|
Core.SpriteBatch.Draw(t, New Rectangle(CInt(_cursorPosition.X), CInt(_cursorPosition.Y), 64, 64), Color.White)
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub SetCursorPosition(ByVal _buttonIndex As Integer)
|
|
|
|
|
Dim pos = GetButtonPosition(_buttonIndex)
|
2022-01-16 17:26:58 +01:00
|
|
|
|
Dim cPosition As Vector2 = New Vector2(CInt(pos.X + 180), CInt(pos.Y - 42))
|
2017-08-11 07:02:26 +02:00
|
|
|
|
_cursorDestPosition = cPosition
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Function GetButtonPosition(ByVal index As Integer) As Vector2
|
|
|
|
|
'button size: 384x64
|
|
|
|
|
'space between buttons horizontally: 150
|
|
|
|
|
'space between buttons vertically: 80
|
|
|
|
|
|
|
|
|
|
Dim X As Single = 0F
|
|
|
|
|
Dim Y As Single = 0F
|
|
|
|
|
|
|
|
|
|
If (index Mod 2) = 0 Then
|
2022-05-14 16:26:42 +02:00
|
|
|
|
X = Core.windowSize.Width / 2.0F - 384 - 75
|
2017-08-11 07:02:26 +02:00
|
|
|
|
Else
|
2022-05-14 16:26:42 +02:00
|
|
|
|
X = Core.windowSize.Width / 2.0F + 75
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Select Case Math.Floor(index / 2)
|
|
|
|
|
Case 0
|
2022-05-14 16:26:42 +02:00
|
|
|
|
Y = (Core.windowSize.Height / 2.0F) - 64 - 80 - 32
|
2017-08-11 07:02:26 +02:00
|
|
|
|
Case 1
|
2022-05-14 16:26:42 +02:00
|
|
|
|
Y = (Core.windowSize.Height / 2.0F) - 32
|
2017-08-11 07:02:26 +02:00
|
|
|
|
Case 2
|
2022-05-14 16:26:42 +02:00
|
|
|
|
Y = (Core.windowSize.Height / 2.0F) + 32 + 80
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End Select
|
|
|
|
|
|
|
|
|
|
Return New Vector2(X, Y)
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Overrides Sub Update()
|
|
|
|
|
If _gradientFade < 255 Then
|
|
|
|
|
_gradientFade += 25
|
|
|
|
|
If _gradientFade >= 255 Then
|
|
|
|
|
_gradientFade = 255
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
If _buttonIntroFinished = False Then
|
|
|
|
|
_currentButtonFade += 45
|
|
|
|
|
If _currentButtonFade >= 255 Then
|
|
|
|
|
_currentButtonFade = 0
|
|
|
|
|
_buttonFadeIndex += 1
|
|
|
|
|
If _buttonFadeIndex > _menuOptions.Count - 1 Then
|
|
|
|
|
_buttonIntroFinished = True
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If _buttonIntroFinished = True Then
|
|
|
|
|
Player.Temp.MenuIndex = _menuIndex
|
|
|
|
|
|
|
|
|
|
Dim preMenuIndex As Integer = _menuIndex
|
|
|
|
|
|
|
|
|
|
If _cursorDestPosition.X <> _cursorPosition.X Or _cursorDestPosition.Y <> _cursorPosition.Y Then
|
2022-01-16 17:26:58 +01:00
|
|
|
|
_cursorPosition.X = CInt(MathHelper.Lerp(_cursorDestPosition.X, _cursorPosition.X, 0.75F))
|
|
|
|
|
_cursorPosition.Y = CInt(MathHelper.Lerp(_cursorDestPosition.Y, _cursorPosition.Y, 0.75F))
|
2017-08-11 07:02:26 +02:00
|
|
|
|
|
|
|
|
|
If Math.Abs(_cursorDestPosition.X - _cursorPosition.X) < 0.1F Then
|
2022-01-16 17:26:58 +01:00
|
|
|
|
_cursorPosition.X = CInt(_cursorDestPosition.X)
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End If
|
|
|
|
|
If Math.Abs(_cursorDestPosition.Y - _cursorPosition.Y) < 0.1F Then
|
2022-01-16 17:26:58 +01:00
|
|
|
|
_cursorPosition.Y = CInt(_cursorDestPosition.Y)
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
If Math.Abs(_cursorDestPosition.Y - _cursorPosition.Y) < 5.0F Then
|
|
|
|
|
If Controls.Accept(True, False, False) = True Then
|
|
|
|
|
For i = 0 To _menuOptions.Count - 1
|
|
|
|
|
Dim pos = GetButtonPosition(i)
|
|
|
|
|
If New Rectangle(CInt(pos.X), CInt(pos.Y), 64 * 6, 64).Contains(MouseHandler.MousePosition) Then
|
|
|
|
|
If _menuIndex = i Then
|
2022-01-16 17:26:58 +01:00
|
|
|
|
_cursorPosition.X = CInt(_cursorDestPosition.X)
|
Fix audio engine & contentpacks (#35)
* Replaced existing Gen 2 SFX with better sounding ones (no ugly reverb)
Replaced MediaPlayer with NAudio(and NAudio.Vorbis) for playing music in order to fix random stopping issues.
The game now directly loads .ogg files instead of the .wma/.xnb combination from before.
ContentPacks are now able to replace Music and SFX again (I haven't added a menu yet for choosing ContentPacks).
To make older GameModes work with current versions, you can add the GameMode property EnterType and set it to "1", this will make the game use the older 2D NewGameScreen.
* Delete GameController.vb
* Add gamecontroller.vb back
* Fix sfx missing
* Battleintro doodle now doesn't loop anymore (for no trainer)
Changed the shutter sound (aka Large Door sound) to something more large door-y
Made the enter sound slightly louder
The enter sound now plays when going through any warp to or from an indoor map (including falling through holes)
The flying sound effect is played earlier in the animation after selecting a location
Changed played sound effect when using the Escape Rope to "teleport" instead of "destroy"
The bump noise now also plays when bumping into something in first person
Fixed small gap between the end of the intro song and the start of the main song
Replaced some songs with better songs
* Fixed some more intro issues
* Forgot to change a thing
* Fixed an error where the main music would play, ignoring the muted musicmanager.
* fix indenting in musicmanager
* The music player will now only start playback on a new song if the music player is not muted, fixed the end time calculation of the intro of a song after muting, Music can't be unmuted now as long as a sound effect plays that stops the music.
* Fixed league restplace position, fixed sound effects sharing the volume slider of the music, sound effects are now also muted when pressing M, changed music on/off popup to audio on/off, removed bump delay in first person, added more control on whether played songs should be looping or not.
* Fixed some more scripts that turn on thirdperson mode but don't check if it was on before or set it back to what it was before afterwards, also fixed a small error in creditsscreen.vb.
* Fixed indenting error in musicmanager.vb, fixed an error of mine where the loopsong parameter would be seen as the playintro parameter.
* Added more music commands, added quite some menu select noises, will add more later
* More select sound effects!
* Fix music not resuming after soundeffect
* Trainer using item now plays the single_heal soundeffect
* Pokémon cries now sound louder
* Possibly fixing crash when playing Pokémon cry at volume higher than 0.71
* Added better quality Pokémon cries, made random overworld cries slightly less loud, added cries for 719 and 720.
* Sound effects now sound louder
* Revert "Added better quality Pokémon cries, made random overworld cries slightly less loud, added cries for 719 and 720."
This reverts commit 8c9296ed1a82144d17f303a52c3f2e9e65a5bfea.
* Fixed the cause of why the title screen music plays even when the game is muted
* Tabs to spaces
* Revert
Co-authored-by: darkfire006 <blazer257@live.com>
Co-authored-by: JappaWakkaP3D <66885565+JappaWakkaP3D@users.noreply.github.com>
Co-authored-by: JappaWakkaP3D <jasper.speelman@outlook.com>
Co-authored-by: Vitaly Mikhailov <personal@aragas.org>
2020-07-09 19:59:42 +02:00
|
|
|
|
SoundManager.PlaySound("select")
|
2017-08-11 07:02:26 +02:00
|
|
|
|
PressButton()
|
|
|
|
|
Else
|
|
|
|
|
_menuIndex = i
|
2022-01-16 17:26:58 +01:00
|
|
|
|
SetCursorPosition(_menuIndex)
|
2017-08-11 07:02:26 +02:00
|
|
|
|
preMenuIndex = _menuIndex 'Prevent the update of the mouse position below.
|
|
|
|
|
Exit For
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
End If
|
|
|
|
|
If Controls.Accept(False, True, True) = True Then
|
2022-01-16 17:26:58 +01:00
|
|
|
|
_cursorPosition.X = CInt(_cursorDestPosition.X)
|
Fix audio engine & contentpacks (#35)
* Replaced existing Gen 2 SFX with better sounding ones (no ugly reverb)
Replaced MediaPlayer with NAudio(and NAudio.Vorbis) for playing music in order to fix random stopping issues.
The game now directly loads .ogg files instead of the .wma/.xnb combination from before.
ContentPacks are now able to replace Music and SFX again (I haven't added a menu yet for choosing ContentPacks).
To make older GameModes work with current versions, you can add the GameMode property EnterType and set it to "1", this will make the game use the older 2D NewGameScreen.
* Delete GameController.vb
* Add gamecontroller.vb back
* Fix sfx missing
* Battleintro doodle now doesn't loop anymore (for no trainer)
Changed the shutter sound (aka Large Door sound) to something more large door-y
Made the enter sound slightly louder
The enter sound now plays when going through any warp to or from an indoor map (including falling through holes)
The flying sound effect is played earlier in the animation after selecting a location
Changed played sound effect when using the Escape Rope to "teleport" instead of "destroy"
The bump noise now also plays when bumping into something in first person
Fixed small gap between the end of the intro song and the start of the main song
Replaced some songs with better songs
* Fixed some more intro issues
* Forgot to change a thing
* Fixed an error where the main music would play, ignoring the muted musicmanager.
* fix indenting in musicmanager
* The music player will now only start playback on a new song if the music player is not muted, fixed the end time calculation of the intro of a song after muting, Music can't be unmuted now as long as a sound effect plays that stops the music.
* Fixed league restplace position, fixed sound effects sharing the volume slider of the music, sound effects are now also muted when pressing M, changed music on/off popup to audio on/off, removed bump delay in first person, added more control on whether played songs should be looping or not.
* Fixed some more scripts that turn on thirdperson mode but don't check if it was on before or set it back to what it was before afterwards, also fixed a small error in creditsscreen.vb.
* Fixed indenting error in musicmanager.vb, fixed an error of mine where the loopsong parameter would be seen as the playintro parameter.
* Added more music commands, added quite some menu select noises, will add more later
* More select sound effects!
* Fix music not resuming after soundeffect
* Trainer using item now plays the single_heal soundeffect
* Pokémon cries now sound louder
* Possibly fixing crash when playing Pokémon cry at volume higher than 0.71
* Added better quality Pokémon cries, made random overworld cries slightly less loud, added cries for 719 and 720.
* Sound effects now sound louder
* Revert "Added better quality Pokémon cries, made random overworld cries slightly less loud, added cries for 719 and 720."
This reverts commit 8c9296ed1a82144d17f303a52c3f2e9e65a5bfea.
* Fixed the cause of why the title screen music plays even when the game is muted
* Tabs to spaces
* Revert
Co-authored-by: darkfire006 <blazer257@live.com>
Co-authored-by: JappaWakkaP3D <66885565+JappaWakkaP3D@users.noreply.github.com>
Co-authored-by: JappaWakkaP3D <jasper.speelman@outlook.com>
Co-authored-by: Vitaly Mikhailov <personal@aragas.org>
2020-07-09 19:59:42 +02:00
|
|
|
|
SoundManager.PlaySound("select")
|
2017-08-11 07:02:26 +02:00
|
|
|
|
PressButton()
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If Controls.Up(True, True, False, True, True, True) = True Then
|
|
|
|
|
If _menuIndex > 1 Then
|
|
|
|
|
_menuIndex -= 2
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
If Controls.Down(True, True, False, True, True, True) = True Then
|
|
|
|
|
If _menuIndex < _menuOptions.Count - 2 Then
|
|
|
|
|
_menuIndex += 2
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
If Controls.Right(True, True, True, True, True, True) = True Then
|
|
|
|
|
If _menuIndex < _menuOptions.Count - 1 Then
|
|
|
|
|
_menuIndex += 1
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
If Controls.Left(True, True, True, True, True, True) = True Then
|
|
|
|
|
If _menuIndex > 0 Then
|
|
|
|
|
_menuIndex -= 1
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
If _menuIndex <> preMenuIndex Then
|
|
|
|
|
SetCursorPosition(_menuIndex)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
2021-09-21 17:45:29 +02:00
|
|
|
|
If CurrentScreen.Identification = Identifications.MenuScreen Then
|
|
|
|
|
If Controls.Dismiss() = True Then
|
|
|
|
|
Core.SetScreen(PreScreen)
|
|
|
|
|
End If
|
2017-08-11 07:02:26 +02:00
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub PressButton()
|
|
|
|
|
Select Case _menuOptions(_menuIndex)
|
|
|
|
|
Case "Pokédex"
|
|
|
|
|
Core.SetScreen(New TransitionScreen(Core.CurrentScreen, New PokedexSelectScreen(Me), Color.White, False))
|
|
|
|
|
Case "Pokémon"
|
|
|
|
|
SetScreen(New PartyScreen(Me))
|
|
|
|
|
Case "Bag"
|
|
|
|
|
Core.SetScreen(New NewInventoryScreen(Me))
|
|
|
|
|
Case "|||" & Core.Player.Name
|
|
|
|
|
Core.SetScreen(New NewTrainerScreen(Me))
|
|
|
|
|
Case "Save"
|
2022-10-06 21:24:18 +02:00
|
|
|
|
If CBool(GameModeManager.GetGameRuleValue("SavingDisabled", "0")) = True AndAlso Core.Player.SandBoxMode = False Then
|
2022-09-29 21:25:38 +02:00
|
|
|
|
Dim s As Screen = Core.CurrentScreen
|
|
|
|
|
While Not s.PreScreen Is Nothing And s.Identification <> Identifications.OverworldScreen
|
|
|
|
|
s = s.PreScreen
|
|
|
|
|
End While
|
|
|
|
|
Core.SetScreen(s)
|
2022-09-29 20:36:09 +02:00
|
|
|
|
Screen.TextBox.Show("Saving is not possible right now.")
|
|
|
|
|
Else
|
|
|
|
|
Core.SetScreen(New SaveScreen(Me))
|
|
|
|
|
End If
|
2017-08-11 07:02:26 +02:00
|
|
|
|
Case "Options"
|
2017-10-15 21:12:47 +02:00
|
|
|
|
Core.SetScreen(New NewOptionScreen(Me))
|
2017-08-11 07:02:26 +02:00
|
|
|
|
Case "Exit"
|
|
|
|
|
Core.SetScreen(PreScreen)
|
|
|
|
|
Case Screen.Level.BugCatchingContestData.GetSplit(2) & " x" & Core.Player.Inventory.GetItemAmount(177)
|
|
|
|
|
Me.ShowBalls()
|
|
|
|
|
Case "End Contest"
|
|
|
|
|
Me.EndContest()
|
|
|
|
|
End Select
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub ShowBalls()
|
|
|
|
|
''' Requires new scripting system
|
|
|
|
|
'Dim s As Screen = Me.PreScreen
|
|
|
|
|
'Construct.Controller.GetInstance().RunFromFile(Screen.Level.BugCatchingContestData.GetSplit(1))
|
|
|
|
|
'Core.SetScreen(s)
|
|
|
|
|
|
|
|
|
|
Dim s As Screen = Me.PreScreen
|
|
|
|
|
CType(s, OverworldScreen).ActionScript.StartScript(Screen.Level.BugCatchingContestData.GetSplit(1), 0)
|
|
|
|
|
Core.SetScreen(s)
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub EndContest()
|
|
|
|
|
''' Requires new scripting system
|
|
|
|
|
'Dim s As Screen = Me.PreScreen
|
|
|
|
|
'Construct.Controller.GetInstance().RunFromFile(Screen.Level.BugCatchingContestData.GetSplit(0))
|
|
|
|
|
'Core.SetScreen(s)
|
|
|
|
|
|
|
|
|
|
Dim s As Screen = Me.PreScreen
|
|
|
|
|
CType(s, OverworldScreen).ActionScript.StartScript(Screen.Level.BugCatchingContestData.GetSplit(0), 0)
|
|
|
|
|
Core.SetScreen(s)
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Overrides Sub SizeChanged()
|
|
|
|
|
SetCursorPosition(_menuIndex)
|
|
|
|
|
_cursorPosition = _cursorDestPosition
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
End Class
|