2016-09-07 18:50:38 +02:00
|
|
|
|
Public Class GameOptions
|
|
|
|
|
|
|
|
|
|
Public RenderDistance As Integer = 3
|
|
|
|
|
Public ShowDebug As Integer = 0
|
|
|
|
|
Public ShowGUI As Boolean = True
|
|
|
|
|
Public GraphicStyle As Integer = 1
|
2021-08-30 19:46:39 +02:00
|
|
|
|
Public LoadOffsetMaps As Integer = 1
|
2016-09-07 18:50:38 +02:00
|
|
|
|
Public ContentPackNames() As String = {}
|
|
|
|
|
Public ViewBobbing As Boolean = True
|
|
|
|
|
Public LightingEnabled As Boolean = True
|
|
|
|
|
Public GamePadEnabled As Boolean = True
|
|
|
|
|
Public StartedOfflineGame As Boolean = False
|
|
|
|
|
Public WindowSize As New Vector2(1200, 680)
|
|
|
|
|
Public ForceMusic As Boolean = False
|
|
|
|
|
Public MaxOffsetLevel As Integer = 0
|
2017-02-15 16:48:35 +01:00
|
|
|
|
Public UpdateDisabled As Boolean = False
|
2017-02-11 15:22:05 +01:00
|
|
|
|
Public Extras As New List(Of String)
|
2021-09-25 00:27:12 +02:00
|
|
|
|
Public ChangedPack As Boolean = False
|
2016-09-07 18:50:38 +02:00
|
|
|
|
|
|
|
|
|
Public Sub LoadOptions()
|
|
|
|
|
KeyBindings.CreateKeySave(False)
|
2017-02-11 15:22:05 +01:00
|
|
|
|
If Directory.Exists(GameController.GamePath & "\Save\") = False Then
|
|
|
|
|
Directory.CreateDirectory(GameController.GamePath & "\Save\")
|
2016-09-07 18:50:38 +02:00
|
|
|
|
End If
|
|
|
|
|
|
2017-02-11 15:22:05 +01:00
|
|
|
|
If File.Exists(GameController.GamePath & "\Save\options.dat") = False Then
|
2016-09-07 18:50:38 +02:00
|
|
|
|
CreateOptions()
|
|
|
|
|
End If
|
|
|
|
|
|
2017-02-11 15:22:05 +01:00
|
|
|
|
Dim Data() As String = File.ReadAllText(GameController.GamePath & "\Save\options.dat").SplitAtNewline()
|
2016-09-07 18:50:38 +02:00
|
|
|
|
|
|
|
|
|
Dim LanguageFound As Boolean = False
|
|
|
|
|
|
|
|
|
|
For Each line As String In Data
|
|
|
|
|
If line <> "" Then
|
|
|
|
|
Dim name As String = line.GetSplit(0, "|")
|
|
|
|
|
Dim value As String = line.GetSplit(1, "|")
|
|
|
|
|
|
|
|
|
|
Select Case name.ToLower()
|
|
|
|
|
Case "volume"
|
|
|
|
|
MusicManager.MasterVolume = CSng(CDbl(value) / 100)
|
|
|
|
|
SoundManager.Volume = CSng(CDbl(value) / 100)
|
|
|
|
|
Case "music"
|
|
|
|
|
MusicManager.MasterVolume = CSng(CDbl(value) / 100)
|
|
|
|
|
Case "sound"
|
|
|
|
|
SoundManager.Volume = CSng(CDbl(value) / 100)
|
|
|
|
|
Case "muted"
|
2018-02-22 03:40:20 +01:00
|
|
|
|
SoundManager.Muted = CBool(value)
|
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
|
|
|
|
MusicManager.Muted = CBool(value)
|
2016-09-07 18:50:38 +02:00
|
|
|
|
Case "renderdistance"
|
|
|
|
|
Me.RenderDistance = CInt(value)
|
|
|
|
|
Case "showdebug"
|
|
|
|
|
Me.ShowDebug = CInt(value)
|
|
|
|
|
Case "showboundingboxes"
|
|
|
|
|
Entity.drawViewBox = CBool(value)
|
|
|
|
|
Case "showdebugconsole"
|
|
|
|
|
Logger.DisplayLog = CBool(value)
|
|
|
|
|
Case "showgui"
|
|
|
|
|
Me.ShowGUI = CBool(value)
|
|
|
|
|
Case "graphicstyle"
|
|
|
|
|
Me.GraphicStyle = CInt(value)
|
|
|
|
|
Case "loadoffsetmaps"
|
|
|
|
|
Me.LoadOffsetMaps = CInt(value)
|
|
|
|
|
Case "language"
|
|
|
|
|
LanguageFound = True
|
|
|
|
|
Localization.Load(value)
|
|
|
|
|
Case "contentpack", "contentpacks"
|
|
|
|
|
ContentPackManager.CreateContentPackFolder()
|
|
|
|
|
If value <> "" Then
|
|
|
|
|
Me.ContentPackNames = value.Split(CChar(","))
|
|
|
|
|
If Me.ContentPackNames.Count > 0 Then
|
|
|
|
|
For Each c As String In Me.ContentPackNames
|
2017-02-11 15:22:05 +01:00
|
|
|
|
If Directory.Exists(GameController.GamePath & "\ContentPacks\" & c) = False Then
|
2016-09-07 18:50:38 +02:00
|
|
|
|
Dim cList As List(Of String) = Me.ContentPackNames.ToList()
|
|
|
|
|
cList.Remove(c)
|
|
|
|
|
Me.ContentPackNames = cList.ToArray()
|
|
|
|
|
Else
|
|
|
|
|
ContentPackManager.Load(GameController.GamePath & "\ContentPacks\" & c & "\exceptions.dat")
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Case "viewbobbing"
|
|
|
|
|
Me.ViewBobbing = CBool(value)
|
2021-08-20 17:53:40 +02:00
|
|
|
|
Case "lightingenabled", "lightningenabled"
|
2016-09-07 18:50:38 +02:00
|
|
|
|
Me.LightingEnabled = CBool(value)
|
|
|
|
|
Case "gamepadenabled"
|
|
|
|
|
Me.GamePadEnabled = CBool(value)
|
|
|
|
|
Case "startedofflinegame"
|
|
|
|
|
Me.StartedOfflineGame = CBool(value)
|
|
|
|
|
Case "prefermultisampling"
|
|
|
|
|
Core.GraphicsManager.PreferMultiSampling = CBool(value)
|
|
|
|
|
Case "windowsize"
|
|
|
|
|
If value.Contains(",") = True Then
|
|
|
|
|
Dim arg() As String = value.Split(CChar(","))
|
2018-01-07 18:01:32 +01:00
|
|
|
|
If StringHelper.IsNumeric(arg(0)) = True Then
|
2016-09-07 18:50:38 +02:00
|
|
|
|
Me.WindowSize.X = CSng(arg(0).Replace(".", GameController.DecSeparator)).Clamp(1, 4096)
|
|
|
|
|
End If
|
2018-01-07 18:01:32 +01:00
|
|
|
|
If StringHelper.IsNumeric(arg(1)) = True Then
|
2016-09-07 18:50:38 +02:00
|
|
|
|
Me.WindowSize.Y = CSng(arg(1).Replace(".", GameController.DecSeparator)).Clamp(1, 4096)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Case "forcemusic"
|
|
|
|
|
Me.ForceMusic = CBool(value)
|
|
|
|
|
Case "maxoffsetlevel"
|
|
|
|
|
Me.MaxOffsetLevel = CInt(value)
|
2017-02-11 15:22:05 +01:00
|
|
|
|
Case "extras"
|
2017-02-05 15:40:10 +01:00
|
|
|
|
If Not String.IsNullOrEmpty(value) Then
|
2017-02-11 15:22:05 +01:00
|
|
|
|
Me.Extras = value.Split(";"c).ToList()
|
2017-02-05 15:40:10 +01:00
|
|
|
|
End If
|
2017-02-15 16:48:35 +01:00
|
|
|
|
Case "updatedisabled"
|
|
|
|
|
UpdateDisabled = CBool(value)
|
2016-09-07 18:50:38 +02:00
|
|
|
|
End Select
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
|
|
|
|
|
If LanguageFound = False Then
|
|
|
|
|
Localization.Load("en")
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Sub SaveOptions()
|
|
|
|
|
If MapPreviewScreen.MapViewMode = False Then
|
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
|
|
|
|
Dim mutedString As String = MusicManager.Muted.ToNumberString()
|
2016-09-07 18:50:38 +02:00
|
|
|
|
Dim showDebugString As String = Me.ShowDebug.ToString()
|
|
|
|
|
Dim ContentPackString As String = ""
|
|
|
|
|
If Me.ContentPackNames.Count > 0 Then
|
|
|
|
|
For Each c As String In Me.ContentPackNames
|
|
|
|
|
If ContentPackString <> "" Then
|
|
|
|
|
ContentPackString &= ","
|
|
|
|
|
End If
|
|
|
|
|
ContentPackString &= c
|
|
|
|
|
Next
|
|
|
|
|
End If
|
|
|
|
|
|
2018-01-07 18:01:32 +01:00
|
|
|
|
Dim Data As String = "Music|" & CInt(MusicManager.MasterVolume * 100) & Environment.NewLine &
|
|
|
|
|
"Sound|" & CInt(SoundManager.Volume * 100) & Environment.NewLine &
|
|
|
|
|
"Muted|" & mutedString & Environment.NewLine &
|
|
|
|
|
"RenderDistance|" & Me.RenderDistance.ToString() & Environment.NewLine &
|
|
|
|
|
"ShowDebug|" & showDebugString & Environment.NewLine &
|
|
|
|
|
"ShowBoundingBoxes|" & Entity.drawViewBox.ToNumberString() & Environment.NewLine &
|
|
|
|
|
"ShowDebugConsole|" & Logger.DisplayLog.ToNumberString() & Environment.NewLine &
|
|
|
|
|
"ShowGUI|" & Me.ShowGUI.ToNumberString() & Environment.NewLine &
|
|
|
|
|
"GraphicStyle|" & Me.GraphicStyle.ToString() & Environment.NewLine &
|
|
|
|
|
"LoadOffsetMaps|" & Me.LoadOffsetMaps.ToString() & Environment.NewLine &
|
|
|
|
|
"Language|" & Localization.LanguageSuffix & Environment.NewLine &
|
|
|
|
|
"ViewBobbing|" & Me.ViewBobbing.ToNumberString() & Environment.NewLine &
|
|
|
|
|
"GamePadEnabled|" & Me.GamePadEnabled.ToNumberString() & Environment.NewLine &
|
2021-08-20 17:53:40 +02:00
|
|
|
|
"LightingEnabled|" & Me.LightingEnabled.ToNumberString() & Environment.NewLine &
|
2018-01-07 18:01:32 +01:00
|
|
|
|
"StartedOfflineGame|" & Me.StartedOfflineGame.ToNumberString() & Environment.NewLine &
|
|
|
|
|
"PreferMultiSampling|" & Core.GraphicsManager.PreferMultiSampling.ToNumberString() & Environment.NewLine &
|
|
|
|
|
"ContentPacks|" & ContentPackString & Environment.NewLine &
|
|
|
|
|
"WindowSize|" & Core.windowSize.Width.ToString() & "," & Core.windowSize.Height.ToString().Replace(GameController.DecSeparator, ".") & Environment.NewLine &
|
|
|
|
|
"ForceMusic|" & Me.ForceMusic.ToNumberString() & Environment.NewLine &
|
|
|
|
|
"MaxOffsetLevel|" & Me.MaxOffsetLevel.ToString() & Environment.NewLine &
|
|
|
|
|
"UpdateDisabled|" & Me.UpdateDisabled.ToNumberString() & Environment.NewLine &
|
2017-02-11 15:22:05 +01:00
|
|
|
|
"Extras|" & String.Join(";", Me.Extras)
|
2016-09-07 18:50:38 +02:00
|
|
|
|
|
2017-02-15 16:48:35 +01:00
|
|
|
|
File.WriteAllText(GameController.GamePath & "\Save\options.dat", Data)
|
2016-09-07 18:50:38 +02:00
|
|
|
|
KeyBindings.SaveKeys()
|
|
|
|
|
|
|
|
|
|
Logger.Debug("---Options saved---")
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Private Sub CreateOptions()
|
2018-01-07 18:01:32 +01:00
|
|
|
|
Dim s As String = "Music|50" & Environment.NewLine &
|
|
|
|
|
"Sound|50" & Environment.NewLine &
|
|
|
|
|
"Muted|0" & Environment.NewLine &
|
|
|
|
|
"RenderDistance|2" & Environment.NewLine &
|
|
|
|
|
"ShowDebug|0" & Environment.NewLine &
|
|
|
|
|
"ShowBoundingBoxes|0" & Environment.NewLine &
|
|
|
|
|
"ShowDebugConsole|0" & Environment.NewLine &
|
|
|
|
|
"ShowGUI|1" & Environment.NewLine &
|
|
|
|
|
"GraphicStyle|1" & Environment.NewLine &
|
2021-08-30 19:46:39 +02:00
|
|
|
|
"LoadOffsetMaps|1" & Environment.NewLine &
|
2018-01-07 18:01:32 +01:00
|
|
|
|
"Language|en" & Environment.NewLine &
|
|
|
|
|
"ViewBobbing|1" & Environment.NewLine &
|
|
|
|
|
"GamePadEnabled|1" & Environment.NewLine &
|
2021-08-20 17:53:40 +02:00
|
|
|
|
"LightingEnabled|1" & Environment.NewLine &
|
2018-01-07 18:01:32 +01:00
|
|
|
|
"StartedOfflineGame|0" & Environment.NewLine &
|
|
|
|
|
"PreferMultiSampling|1" & Environment.NewLine &
|
|
|
|
|
"ContentPacks|" & Environment.NewLine &
|
|
|
|
|
"WindowSize|1200,680" & Environment.NewLine &
|
|
|
|
|
"ForceMusic|0" & Environment.NewLine &
|
|
|
|
|
"MaxOffsetLevel|0" & Environment.NewLine &
|
|
|
|
|
"UpdateDisabled|0" & Environment.NewLine &
|
2017-06-23 23:42:36 +02:00
|
|
|
|
"Extras|"
|
2016-09-07 18:50:38 +02:00
|
|
|
|
|
2017-02-11 15:22:05 +01:00
|
|
|
|
File.WriteAllText(GameController.GamePath & "\Save\options.dat", s)
|
2016-09-07 18:50:38 +02:00
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
End Class
|