Enable Backup Save by default. Changed DLC to Extras

This commit is contained in:
jianmingyong 2017-02-11 22:22:05 +08:00
parent 0db122e2a4
commit b804db510d
3 changed files with 15 additions and 15 deletions

View File

@ -13,19 +13,19 @@
Public WindowSize As New Vector2(1200, 680) Public WindowSize As New Vector2(1200, 680)
Public ForceMusic As Boolean = False Public ForceMusic As Boolean = False
Public MaxOffsetLevel As Integer = 0 Public MaxOffsetLevel As Integer = 0
Public DLC As New List(Of String) Public Extras As New List(Of String)
Public Sub LoadOptions() Public Sub LoadOptions()
KeyBindings.CreateKeySave(False) KeyBindings.CreateKeySave(False)
If System.IO.Directory.Exists(GameController.GamePath & "\Save\") = False Then If Directory.Exists(GameController.GamePath & "\Save\") = False Then
System.IO.Directory.CreateDirectory(GameController.GamePath & "\Save\") Directory.CreateDirectory(GameController.GamePath & "\Save\")
End If End If
If System.IO.File.Exists(GameController.GamePath & "\Save\options.dat") = False Then If File.Exists(GameController.GamePath & "\Save\options.dat") = False Then
CreateOptions() CreateOptions()
End If End If
Dim Data() As String = System.IO.File.ReadAllText(GameController.GamePath & "\Save\options.dat").SplitAtNewline() Dim Data() As String = File.ReadAllText(GameController.GamePath & "\Save\options.dat").SplitAtNewline()
Dim LanguageFound As Boolean = False Dim LanguageFound As Boolean = False
@ -68,7 +68,7 @@
Me.ContentPackNames = value.Split(CChar(",")) Me.ContentPackNames = value.Split(CChar(","))
If Me.ContentPackNames.Count > 0 Then If Me.ContentPackNames.Count > 0 Then
For Each c As String In Me.ContentPackNames For Each c As String In Me.ContentPackNames
If System.IO.Directory.Exists(GameController.GamePath & "\ContentPacks\" & c) = False Then If Directory.Exists(GameController.GamePath & "\ContentPacks\" & c) = False Then
Dim cList As List(Of String) = Me.ContentPackNames.ToList() Dim cList As List(Of String) = Me.ContentPackNames.ToList()
cList.Remove(c) cList.Remove(c)
Me.ContentPackNames = cList.ToArray() Me.ContentPackNames = cList.ToArray()
@ -102,9 +102,9 @@
Me.ForceMusic = CBool(value) Me.ForceMusic = CBool(value)
Case "maxoffsetlevel" Case "maxoffsetlevel"
Me.MaxOffsetLevel = CInt(value) Me.MaxOffsetLevel = CInt(value)
Case "dlc" Case "extras"
If Not String.IsNullOrEmpty(value) Then If Not String.IsNullOrEmpty(value) Then
Me.DLC = value.Split(";"c).ToList() Me.Extras = value.Split(";"c).ToList()
End If End If
End Select End Select
End If End If
@ -149,7 +149,7 @@
"WindowSize|" & Core.windowSize.Width.ToString() & "," & Core.windowSize.Height.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine & "WindowSize|" & Core.windowSize.Width.ToString() & "," & Core.windowSize.Height.ToString().Replace(GameController.DecSeparator, ".") & vbNewLine &
"ForceMusic|" & Me.ForceMusic.ToNumberString() & vbNewLine & "ForceMusic|" & Me.ForceMusic.ToNumberString() & vbNewLine &
"MaxOffsetLevel|" & Me.MaxOffsetLevel.ToString() & vbNewLine & "MaxOffsetLevel|" & Me.MaxOffsetLevel.ToString() & vbNewLine &
"DLC|" & String.Join(";", Me.DLC) "Extras|" & String.Join(";", Me.Extras)
System.IO.File.WriteAllText(GameController.GamePath & "\Save\options.dat", Data) System.IO.File.WriteAllText(GameController.GamePath & "\Save\options.dat", Data)
KeyBindings.SaveKeys() KeyBindings.SaveKeys()
@ -179,9 +179,9 @@
"WindowSize|1200,680" & vbNewLine & "WindowSize|1200,680" & vbNewLine &
"ForceMusic|0" & vbNewLine & "ForceMusic|0" & vbNewLine &
"MaxOffsetLevel|0" & vbNewLine & "MaxOffsetLevel|0" & vbNewLine &
"DLC|" "Extras|Backup Save"
System.IO.File.WriteAllText(GameController.GamePath & "\Save\options.dat", s) File.WriteAllText(GameController.GamePath & "\Save\options.dat", s)
End Sub End Sub
End Class End Class

View File

@ -571,7 +571,7 @@
''' 1. Encrypted OverWrite Save. ''' 1. Encrypted OverWrite Save.
''' 2. OverWrite Save. ''' 2. OverWrite Save.
''' 3. Backup Save. ''' 3. Backup Save.
If filePrefix = "GAMEJOLTSAVE" AndAlso Core.GameOptions.DLC.Contains("Backup Save") Then If filePrefix = "GAMEJOLTSAVE" AndAlso Core.GameOptions.Extras.Contains("Backup Save") Then
If Not Directory.Exists(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID) Then If Not Directory.Exists(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID) Then
Directory.CreateDirectory(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID) Directory.CreateDirectory(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID)
End If End If
@ -1582,7 +1582,7 @@
filePrefix = newFilePrefix filePrefix = newFilePrefix
If IsGameJoltSave = True Then If IsGameJoltSave = True Then
If Core.GameOptions.DLC.Contains("Backup Save") Then If Core.GameOptions.Extras.Contains("Backup Save") Then
If Not Directory.Exists(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID & "\Encrypted") Then If Not Directory.Exists(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID & "\Encrypted") Then
Directory.CreateDirectory(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID & "\Encrypted") Directory.CreateDirectory(GameController.GamePath & "\Backup Save\" & GameJoltSave.GameJoltID & "\Encrypted")
End If End If

View File

@ -33,7 +33,7 @@
If saveSessionFailed = True Then If saveSessionFailed = True Then
.DrawString(FontManager.InGameFont, "Saving failed!", New Vector2(188, 186), Color.Red) .DrawString(FontManager.InGameFont, "Saving failed!", New Vector2(188, 186), Color.Red)
If Core.GameOptions.DLC.Contains("Backup Save") Then If Core.GameOptions.Extras.Contains("Backup Save") Then
.DrawString(FontManager.MiniFont, "Press Dismiss to close this screen and try to save" & vbNewLine & .DrawString(FontManager.MiniFont, "Press Dismiss to close this screen and try to save" & vbNewLine &
"again in order to prevent data corruption." & vbNewLine & vbNewLine & "again in order to prevent data corruption." & vbNewLine & vbNewLine &
"We have backup your save in the event of gamejolt API being down." & vbNewLine & "We have backup your save in the event of gamejolt API being down." & vbNewLine &
@ -43,7 +43,7 @@
.DrawString(FontManager.MiniFont, "Press Dismiss to close this screen and try to save" & vbNewLine & .DrawString(FontManager.MiniFont, "Press Dismiss to close this screen and try to save" & vbNewLine &
"again in order to prevent data corruption." & vbNewLine & vbNewLine & "again in order to prevent data corruption." & vbNewLine & vbNewLine &
"To have your save back up, you will require to enable Backup Save" & vbNewLine & "To have your save back up, you will require to enable Backup Save" & vbNewLine &
"Via GameOptions.dat > DLC|Backup Save", New Vector2(188, 240), Color.Black) "Via GameOptions.dat > Extras|Backup Save", New Vector2(188, 240), Color.Black)
End If End If
Else Else
If ready = True Then If ready = True Then