Added DiscordRPC to game options

This commit is contained in:
Daniel S. Billing 2021-02-20 16:20:51 +01:00
parent c9d5b8dc74
commit cd0cf2dad3
2 changed files with 14 additions and 1 deletions

View File

@ -14,6 +14,7 @@
Public ForceMusic As Boolean = False
Public MaxOffsetLevel As Integer = 0
Public UpdateDisabled As Boolean = False
Public DiscordRPCEnabled As Boolean = True
Public Extras As New List(Of String)
Public Sub LoadOptions()
@ -109,6 +110,8 @@
End If
Case "updatedisabled"
UpdateDisabled = CBool(value)
Case "discordrpcenabled"
Me.DiscordRPCEnabled = CBool(value)
End Select
End If
Next
@ -153,6 +156,7 @@
"ForceMusic|" & Me.ForceMusic.ToNumberString() & Environment.NewLine &
"MaxOffsetLevel|" & Me.MaxOffsetLevel.ToString() & Environment.NewLine &
"UpdateDisabled|" & Me.UpdateDisabled.ToNumberString() & Environment.NewLine &
"DiscordRPCEnabled|" & Me.DiscordRPCEnabled.ToNumberString() & Environment.NewLine &
"Extras|" & String.Join(";", Me.Extras)
File.WriteAllText(GameController.GamePath & "\Save\options.dat", Data)
@ -183,6 +187,7 @@
"WindowSize|1200,680" & Environment.NewLine &
"ForceMusic|0" & Environment.NewLine &
"MaxOffsetLevel|0" & Environment.NewLine &
"DiscordRPCEnabled|1" & Environment.NewLine &
"UpdateDisabled|0" & Environment.NewLine &
"Extras|"

View File

@ -20,6 +20,7 @@
Dim ShowModels As Integer = 1
Dim Muted As Integer = 0
Dim GamePadEnabled As Boolean = True
Dim DiscordRPCEnabled As Boolean = True
Dim PreferMultiSampling As Boolean = True
Dim savedOptions As Boolean = True
@ -94,6 +95,7 @@
Me.ViewBobbing = Core.GameOptions.ViewBobbing
Me.GamePadEnabled = Core.GameOptions.GamePadEnabled
Me.PreferMultiSampling = Core.GraphicsManager.PreferMultiSampling
Me.DiscordRPCEnabled = Core.GameOptions.DiscordRPCEnabled
End Sub
@ -418,7 +420,8 @@
Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf SwitchToMain))
Case 6 ' "Advanced" from the Options menu.
Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 100, Delta_Y + 100), 2, 64, "Reset Options", AddressOf Reset))
Me.ControlList.Add(New ToggleButton(New Vector2(Delta_X + 100, Delta_Y + 100), 3, 64, "Discord RPC", Me.DiscordRPCEnabled, AddressOf ToggleDiscordRPC, {"Disabled", "Enabled"}.ToList()))
Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 100, Delta_Y + 200), 2, 64, "Reset Options", AddressOf Reset))
Me.ControlList.Add(New CommandButton(New Vector2(Delta_X + 530 + 24, Delta_Y + 327), 1, 48, "Back", AddressOf SwitchToMain))
End Select
@ -474,6 +477,7 @@
Core.Player.BattleStyle = Me.BattleStyle
Core.Player.ShowModelsInBattle = CBool(Me.ShowModels)
Core.GameOptions.GamePadEnabled = Me.GamePadEnabled
Core.GameOptions.DiscordRPCEnabled = Me.DiscordRPCEnabled
Core.GraphicsManager.PreferMultiSampling = Me.PreferMultiSampling
If LoadOffsetMaps = 0 Then
Core.GameOptions.LoadOffsetMaps = Me.LoadOffsetMaps
@ -618,6 +622,10 @@
Me.MouseSpeed = c.Value
End Sub
Private Sub ToggleDiscordRPC(ByVal c As ToggleButton)
Me.DiscordRPCEnabled = Not Me.DiscordRPCEnabled
End Sub
Private Sub ResetKeyBindings(ByVal c As CommandButton)
KeyBindings.CreateKeySave(True)
KeyBindings.LoadKeys()