Added key to switch SandboxMode on and off

the key to press is Right Ctrl
This commit is contained in:
JappaWakka 2024-08-09 17:28:42 +02:00
parent 27bd072946
commit b802531748
2 changed files with 14 additions and 1 deletions

View File

@ -27,6 +27,7 @@ Public Class KeyBindings
Public Shared DisableControllerKey As Keys = Keys.F6
Public Shared FullScreenKey As Keys = Keys.F11
Public Shared DebugWalkKey As Keys = Keys.LeftControl
Public Shared SandBoxModeSwitchKey As Keys = Keys.RightControl
Public Shared EnterKey1 As Keys = Keys.Enter
Public Shared EnterKey2 As Keys = Keys.Space
@ -85,6 +86,8 @@ Public Class KeyBindings
DebugKey = binding
Case "debugwalk"
DebugWalkKey = binding
Case "sandboxmodeswitch"
SandBoxModeSwitchKey = binding
Case "perspectiveswitch"
PerspectiveSwitchKey = binding
Case "fullscreen"

View File

@ -172,6 +172,16 @@ Public Class OverworldCamera
#Region "Update"
Public Overrides Sub Update()
If GameController.IS_DEBUG_ACTIVE = True Or Core.Player.IsGameJoltSave = False Then
If KeyBoardHandler.KeyPressed(KeyBindings.SandBoxModeSwitchKey) = True Then
Core.Player.SandBoxMode = Not Core.Player.SandBoxMode
If Core.Player.SandBoxMode = True Then
Core.GameMessage.ShowMessage(Localization.GetString("game_message_sandbox_mode_on"), 12, FontManager.MainFont, Color.White)
Else
Core.GameMessage.ShowMessage(Localization.GetString("game_message_sandbox_mode_off"), 12, FontManager.MainFont, Color.White)
End If
End If
End If
If GameController.IS_DEBUG_ACTIVE = True Or Core.Player.SandBoxMode = True Then
If KeyBoardHandler.KeyPressed(KeyBindings.DebugWalkKey) = True Then
@ -321,7 +331,7 @@ Public Class OverworldCamera
ThirdPersonOffset.Y += _scrollSpeed * _scrollDirection
ThirdPersonOffset.Z += _scrollSpeed * _scrollDirection
If GameController.IS_DEBUG_ACTIVE = False And Core.Player.SandBoxMode = False Then
If Core.Player.SandBoxMode = False Then
ThirdPersonOffset.Y = ThirdPersonOffset.Y.Clamp(0, 1.32F)
ThirdPersonOffset.Z = ThirdPersonOffset.Z.Clamp(-0.1, 2.7F)
End If