Various Fixes & Improvements

Fixed PlayerSkins displaying incorrectly in the new intro.

Fixed position of Pause Menu text.

Songs don't fade in by default now except with the @musicplayer.playfade(songname) command

You can now also close the Options row in the Main Menu with the "Up" or "Move Forward" keys

Improved the timing of the Battle intro screens

Renamed Badge_Aquired to Receive_Badge for consistency
This commit is contained in:
JappaWakka 2021-10-03 21:18:25 +02:00
parent bd8f91e338
commit 799792e49c
11 changed files with 67 additions and 61 deletions

Binary file not shown.

View File

@ -15328,6 +15328,9 @@
<Content Include="Content\Sounds\PC\TurnOn.wav"> <Content Include="Content\Sounds\PC\TurnOn.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Sounds\Receive_Badge.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Sounds\Receive_Egg.wav"> <Content Include="Content\Sounds\Receive_Egg.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -23968,9 +23971,6 @@
<Content Include="Content\SkyDomeResource\UnderwaterGround.png"> <Content Include="Content\SkyDomeResource\UnderwaterGround.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Content\Sounds\badge_acquired.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Sounds\Battle\exp_max.wav"> <Content Include="Content\Sounds\Battle\exp_max.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

View File

@ -106,7 +106,6 @@ Public Class MusicManager
' if the song that gets played after fading completed is an intro to another song ' if the song that gets played after fading completed is an intro to another song
Public Shared _fadeIntoIntro As Boolean = False Public Shared _fadeIntoIntro As Boolean = False
Private Shared _isFadingOut As Boolean = False Private Shared _isFadingOut As Boolean = False
Private Shared _isFadingIn As Boolean = False
' NAudio properties ' NAudio properties
Public Shared outputDevice As WaveOutEvent Public Shared outputDevice As WaveOutEvent
Public Shared audioFile As VorbisWaveReader Public Shared audioFile As VorbisWaveReader
@ -176,7 +175,6 @@ Public Class MusicManager
_nextSong = "" _nextSong = ""
_fadeSpeed = DEFAULT_FADE_SPEED _fadeSpeed = DEFAULT_FADE_SPEED
_isFadingOut = False _isFadingOut = False
_isFadingIn = False
_isLooping = True _isLooping = True
End Sub End Sub
@ -201,7 +199,7 @@ Public Class MusicManager
Public Shared Sub Update() Public Shared Sub Update()
If _isPausedForSound Then If _isPausedForSound Then
If Date.Now >= _pausedUntil Then If Date.Now >= _pausedUntil Then
If MusicManager.Paused = True Then If Paused = True Then
_isPausedForSound = False _isPausedForSound = False
Paused = False Paused = False
End If End If
@ -216,7 +214,6 @@ Public Class MusicManager
Volume = 0F Volume = 0F
_isFadingOut = False _isFadingOut = False
_isFadingIn = True
Dim song = GetSong(_nextSong) Dim song = GetSong(_nextSong)
@ -232,13 +229,16 @@ Public Class MusicManager
Else Else
_isLooping = True _isLooping = True
End If End If
If Muted = True Then
Volume = 0.0F
Else
Volume = 1.0F
End If
Else Else
' no song found, do not fade into anything ' no song found, do not fade into anything
_fadeIntoIntro = False _fadeIntoIntro = False
ClearCurrentlyPlaying() ClearCurrentlyPlaying()
_isFadingIn = False
If Muted = True Then If Muted = True Then
Volume = 0.0F Volume = 0.0F
Else Else
@ -252,32 +252,19 @@ Public Class MusicManager
End If End If
ElseIf _isFadingIn Then ' intro
If Muted = True Then ' If _isIntroStarted Then
Volume = 0.0F ' If Paused = False Then
_isFadingIn = False 'If Date.Now >= _introEndTime Then
Else 'Dim song = GetSong(_introContinueSong)
Volume += _fadeSpeed '_isLooping = True
If Volume >= 1.0F Then '_isIntroStarted = False
Volume = 1.0F 'Play(song)
_isFadingIn = False 'End If
End If 'End If
End If 'End If
End If End If
' intro
' If _isIntroStarted Then
' If Paused = False Then
'If Date.Now >= _introEndTime Then
'Dim song = GetSong(_introContinueSong)
'_isLooping = True
'_isIntroStarted = False
'Play(song)
'End If
'End If
'End If
End If End If
If Core.GameInstance.IsActive AndAlso _lastVolume <> (Volume * MasterVolume) Then If Core.GameInstance.IsActive AndAlso _lastVolume <> (Volume * MasterVolume) Then
UpdateVolume() UpdateVolume()
End If End If

View File

@ -15,7 +15,7 @@
Dim Trainer As Trainer Dim Trainer As Trainer
Dim minDelay As Single = 16.0F Dim minDelay As Single = 4.0F
Dim startTime As Date Dim startTime As Date
Dim duration As TimeSpan Dim duration As TimeSpan
@ -453,22 +453,22 @@
Private Sub UpdateBlockIn() Private Sub UpdateBlockIn()
If Animations.Count = 0 Then If Animations.Count = 0 Then
Animations.Add(New Rectangle(CInt(Core.windowSize.Width / 2) - 10, CInt(Core.windowSize.Height / 2) - 10, 20, 20)) Animations.Add(New Rectangle(CInt(Core.windowSize.Width / 2 - (Core.windowSize.Width / 100 / 2)), CInt(Core.windowSize.Height / 2 - (Core.windowSize.Height / 100 / 2)), CInt(Core.windowSize.Width / 100), CInt(Core.windowSize.Height / 100)))
Else Else
If Animations(0).Width >= Core.windowSize.Width Then Dim Speed As Integer = CInt(Me.duration.TotalMilliseconds / Core.windowSize.Height * 6)
If Animations(0).Height >= Core.windowSize.Height + 128 Then
ready = True ready = True
Else
Dim a As Rectangle = Animations(0)
a.X -= 7
a.Y -= 7
a.Width += 14
a.Height += 14
Animations.RemoveAt(0)
Animations.Add(a)
End If End If
Dim a As Rectangle = Animations(0)
a.X -= CInt(Speed)
a.Y -= CInt(Speed / 16 * 9)
a.Width += Speed * 2
a.Height += CInt(Speed * 2 / 16 * 9)
Animations.RemoveAt(0)
Animations.Add(a)
End If End If
End Sub End Sub
@ -476,10 +476,10 @@
If Animations.Count = 0 Then If Animations.Count = 0 Then
Animations.Add(New Rectangle(0, 0, Core.windowSize.Width, Core.windowSize.Height)) Animations.Add(New Rectangle(0, 0, Core.windowSize.Width, Core.windowSize.Height))
Else Else
If value >= Core.windowSize.Height / 2 Then If value >= Core.windowSize.Height / 2 - 4 Then
ready = True ready = True
Else Else
value += CInt(Math.Ceiling(Core.windowSize.Height / 300)) value += CInt(Math.Ceiling(Me.duration.TotalMilliseconds / Core.windowSize.Height * 3))
End If End If
End If End If
End Sub End Sub
@ -515,7 +515,7 @@
End Sub End Sub
Private Function SongOver() As Boolean Private Function SongOver() As Boolean
Return startTime + duration < Date.Now.AddSeconds(0.1) Return startTime + duration < Date.Now
End Function End Function
'Protected Overrides Sub Finalize() 'Protected Overrides Sub Finalize()

View File

@ -234,7 +234,7 @@
SelectedSkin = "" SelectedSkin = ""
For Each skin As String In GameModeManager.ActiveGameMode.SkinFiles For Each skin As String In GameModeManager.ActiveGameMode.SkinFiles
_sprites.Add(TextureManager.GetTexture("Textures\OverworldSprites\PlayerSkins\" & skin)) _sprites.Add(TextureManager.GetTexture("Textures\NPC\" & skin))
Next Next
_skins = GameModeManager.ActiveGameMode.SkinFiles _skins = GameModeManager.ActiveGameMode.SkinFiles

View File

@ -51,9 +51,10 @@
Me.PreScreen.Draw() Me.PreScreen.Draw()
Canvas.DrawRectangle(New Rectangle(0, 0, Core.ScreenSize.Width, Core.ScreenSize.Height), New Color(0, 0, 0, 150)) Canvas.DrawRectangle(New Rectangle(0, 0, Core.ScreenSize.Width, Core.ScreenSize.Height), New Color(0, 0, 0, 150))
Dim pX As Integer = CInt(Core.ScreenSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(Localization.GetString("pause_menu_title")).X / 2) Dim titletext As String = Localization.GetString("pause_menu_title")
Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, Localization.GetString("pause_menu_title"), New Vector2(pX - 7, CInt(Core.ScreenSize.Height / 7.5) + 3), Color.Black) Dim pX As Integer = CInt(Core.ScreenSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(titletext).X / 2)
Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, Localization.GetString("pause_menu_title"), New Vector2(pX - 10, CInt(Core.ScreenSize.Height / 7.5)), Color.White) Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, titletext, New Vector2(pX - 7, CInt(160 - FontManager.InGameFont.MeasureString(titletext).Y / 2 + 3)), Color.Black)
Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, titletext, New Vector2(pX - 10, CInt(160 - FontManager.InGameFont.MeasureString(titletext).Y / 2)), Color.White)
If Me.menuIndex = 0 Then If Me.menuIndex = 0 Then
DrawMenu() DrawMenu()
@ -62,10 +63,10 @@
End If End If
If Me.canCreateAutosave = False Then If Me.canCreateAutosave = False Then
Dim text As String = Localization.GetString("pause_menu_autosave_fail") Dim autosaveFailText As String = Localization.GetString("pause_menu_autosave_fail")
Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, text, New Vector2(9, Core.ScreenSize.Height - FontManager.InGameFont.MeasureString(text).Y), Color.Black) Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, autosaveFailText, New Vector2(9, Core.ScreenSize.Height - FontManager.InGameFont.MeasureString(autosaveFailText).Y), Color.Black)
Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, text, New Vector2(5, Core.ScreenSize.Height - FontManager.InGameFont.MeasureString(text).Y - 4), Color.White) Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, autosaveFailText, New Vector2(5, Core.ScreenSize.Height - FontManager.InGameFont.MeasureString(autosaveFailText).Y - 4), Color.White)
End If End If
Dim d As New Dictionary(Of Buttons, String) Dim d As New Dictionary(Of Buttons, String)
@ -182,8 +183,8 @@
Private Sub DrawQuit() Private Sub DrawQuit()
Dim pX As Integer = CInt(Core.ScreenSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(Localization.GetString("pause_menu_confirmation")).X / 2) Dim pX As Integer = CInt(Core.ScreenSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString(Localization.GetString("pause_menu_confirmation")).X / 2)
Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, Localization.GetString("pause_menu_confirmation"), New Vector2(pX - 7, CInt(Core.ScreenSize.Height / 6.8) + 3 + 110), Color.Black) Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, Localization.GetString("pause_menu_confirmation"), New Vector2(pX - 7, CInt(Core.ScreenSize.Height / 7.5) + 3 + 110), Color.Black)
Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, Localization.GetString("pause_menu_confirmation"), New Vector2(pX - 10, CInt(Core.ScreenSize.Height / 6.8) + 110), Color.White) Core.SpriteBatch.DrawInterfaceString(FontManager.InGameFont, Localization.GetString("pause_menu_confirmation"), New Vector2(pX - 10, CInt(Core.ScreenSize.Height / 7.5) + 110), Color.White)
For i = 0 To 1 For i = 0 To 1
Dim Text As String = "" Dim Text As String = ""

View File

@ -548,6 +548,19 @@ Public Class NewMainMenuScreen
_sliderTarget = GetSliderTarget(_selectedProfile) _sliderTarget = GetSliderTarget(_selectedProfile)
End Select End Select
End If End If
If KeyBoardHandler.KeyPressed(KeyBindings.ForwardMoveKey) Or KeyBoardHandler.KeyPressed(KeyBindings.UpKey) Then
Select Case _menuIndex
Case 1, 2
_menuIndex = 0
_selectedProfile = _selectedProfileTemp
_sliderTarget = GetSliderTarget(_selectedProfile)
Case 3
_menuIndex = 1
_selectedProfile = _selectedProfileTemp
_sliderTarget = GetSliderTarget(_selectedProfile)
End Select
End If
If _fadeInMain = 1.0F Then If _fadeInMain = 1.0F Then
If _closingDisplay Then If _closingDisplay Then
If _expandDisplay > 0.0F Then If _expandDisplay > 0.0F Then

View File

@ -12,6 +12,12 @@
Select Case command.ToLower() Select Case command.ToLower()
Case "play" Case "play"
MusicManager.Play(argument, True, 0.0F)
If Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then
Screen.Level.MusicLoop = argument
End If
Case "playfade"
MusicManager.Play(argument, True) MusicManager.Play(argument, True)
If Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then If Core.CurrentScreen.Identification = Screen.Identifications.OverworldScreen Then

View File

@ -188,7 +188,7 @@
If StringHelper.IsNumeric(argument) Then If StringHelper.IsNumeric(argument) Then
If Core.Player.Badges.Contains(int(argument)) = False Then If Core.Player.Badges.Contains(int(argument)) = False Then
Core.Player.Badges.Add(int(argument)) Core.Player.Badges.Add(int(argument))
SoundManager.PlaySound("badge_acquired", True) SoundManager.PlaySound("Receive_Badge", True)
Screen.TextBox.TextColor = TextBox.PlayerColor Screen.TextBox.TextColor = TextBox.PlayerColor
Screen.TextBox.Show(Core.Player.Name & " received the~" & Badge.GetBadgeName(int(argument)) & " Badge.", {}, False, False) Screen.TextBox.Show(Core.Player.Name & " received the~" & Badge.GetBadgeName(int(argument)) & " Badge.", {}, False, False)

View File

@ -231,7 +231,6 @@
CanContinue = False CanContinue = False
Case "skinselection" Case "skinselection"
Dim skins = argument.Split(","c)
If Screens.MainMenu.NewNewGameScreen.CharacterSelectionScreen.SelectedSkin <> "" Then If Screens.MainMenu.NewNewGameScreen.CharacterSelectionScreen.SelectedSkin <> "" Then
IsReady = True IsReady = True
Else Else