diff --git a/src/Config/ConfigManager.cs b/src/Config/ConfigManager.cs index 1214cbf..dfccdeb 100644 --- a/src/Config/ConfigManager.cs +++ b/src/Config/ConfigManager.cs @@ -35,6 +35,7 @@ namespace UnityExplorer.Config public static ConfigElement HUD_Toggle; public static ConfigElement Freecam_Toggle; public static ConfigElement Block_Freecam_Movement; + public static ConfigElement Toggle_Block_Games_Input; public static ConfigElement Speed_Up_Movement; public static ConfigElement Speed_Down_Movement; public static ConfigElement Forwards_1; @@ -192,10 +193,14 @@ namespace UnityExplorer.Config "Toggles freecamera mode.", KeyCode.Insert); - Block_Freecam_Movement = new("Block Freecam movement", + Block_Freecam_Movement = new("Toggle block Freecam movement", "Blocks the freecam from moving when pressing the freecam-related hotkeys.", KeyCode.Home); + Toggle_Block_Games_Input = new("Toggle block games input", + "Blocks the games input when the the freecam is on.", + KeyCode.KeypadPeriod); + Speed_Up_Movement = new("Speed up movement", "Maintain this key pressed while moving the camera around to increase the freecam movement speed.", KeyCode.LeftShift); @@ -246,15 +251,15 @@ namespace UnityExplorer.Config Tilt_Left = new("Tilt left", "Tilt the camera to the left.", - KeyCode.Q); + KeyCode.Keypad1); Tilt_Right = new("Tilt right", "Tilt the camera to the left.", - KeyCode.E); + KeyCode.Keypad3); Tilt_Reset = new("Tilt reset", "Resets the tilt the camera.", - KeyCode.KeypadPeriod); + KeyCode.Keypad2); Increase_FOV = new("Increase FOV", "Increase the field of view of the current freecam.", diff --git a/src/ExplorerBehaviour.cs b/src/ExplorerBehaviour.cs index 2a4c10f..6b5492c 100644 --- a/src/ExplorerBehaviour.cs +++ b/src/ExplorerBehaviour.cs @@ -138,6 +138,11 @@ namespace UnityExplorer { FreeCamPanel.blockFreecamMovementToggle.isOn = !FreeCamPanel.blockFreecamMovementToggle.isOn; } + + if (IInputManager.GetKeyDown(ConfigManager.Toggle_Block_Games_Input.Value)) + { + FreeCamPanel.blockGamesInputOnFreecamToggle.isOn = !FreeCamPanel.blockGamesInputOnFreecamToggle.isOn; + } } void stopFrameSkip(){ diff --git a/src/Loader/Standalone/Editor/ExplorerEditorBehaviour.cs b/src/Loader/Standalone/Editor/ExplorerEditorBehaviour.cs index f88cb1c..1888191 100644 --- a/src/Loader/Standalone/Editor/ExplorerEditorBehaviour.cs +++ b/src/Loader/Standalone/Editor/ExplorerEditorBehaviour.cs @@ -33,6 +33,7 @@ namespace UnityExplorer.Loader.Standalone public KeyCode HUD_Toggle; public KeyCode Freecam_Toggle; public KeyCode Block_Freecam_Movement; + public KeyCode Toggle_Block_Games_Input; public KeyCode Speed_Up_Movement; public KeyCode Speed_Down_Movement; public KeyCode Forwards_1; @@ -85,6 +86,7 @@ namespace UnityExplorer.Loader.Standalone ConfigManager.HUD_Toggle.Value = this.HUD_Toggle; ConfigManager.Freecam_Toggle.Value = this.Freecam_Toggle; ConfigManager.Block_Freecam_Movement.Value = this.Block_Freecam_Movement; + ConfigManager.Toggle_Block_Games_Input.Value = this.Toggle_Block_Games_Input; ConfigManager.Speed_Up_Movement.Value = this.Speed_Up_Movement; ConfigManager.Speed_Down_Movement.Value = this.Speed_Down_Movement; ConfigManager.Forwards_1.Value = this.Forwards_1; diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 9b553f4..0b4754e 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -50,6 +50,7 @@ namespace UnityExplorer.UI.Panels static ButtonRef startStopButton; public static Toggle useGameCameraToggle; public static Toggle blockFreecamMovementToggle; + public static Toggle blockGamesInputOnFreecamToggle; static InputFieldRef positionInput; static InputFieldRef moveSpeedInput; static Text followObjectLabel; @@ -322,11 +323,18 @@ namespace UnityExplorer.UI.Panels AddSpacer(5); - GameObject blockFreecamMovement = UIFactory.CreateToggle(ContentRoot, "blockFreecamMovement", out blockFreecamMovementToggle, out Text blockFreecamMovementText); + GameObject togglesRow = UIFactory.CreateHorizontalGroup(ContentRoot, "TogglesRow", false, false, true, true, 3, default, new(1, 1, 1, 0)); + + GameObject blockFreecamMovement = UIFactory.CreateToggle(togglesRow, "blockFreecamMovement", out blockFreecamMovementToggle, out Text blockFreecamMovementText); UIFactory.SetLayoutElement(blockFreecamMovement, minHeight: 25, flexibleWidth: 9999); blockFreecamMovementToggle.isOn = false; blockFreecamMovementText.text = "Block Freecam movement"; + GameObject blockGamesInputOnFreecam = UIFactory.CreateToggle(togglesRow, "blockGamesInputOnFreecam", out blockGamesInputOnFreecamToggle, out Text blockGamesInputOnFreecamText); + UIFactory.SetLayoutElement(blockGamesInputOnFreecam, minHeight: 25, flexibleWidth: 9999); + blockGamesInputOnFreecamToggle.isOn = true; + blockGamesInputOnFreecamText.text = "Block games input on Freecam"; + AddSpacer(5); @@ -343,7 +351,8 @@ namespace UnityExplorer.UI.Panels $"- {ConfigManager.Reset_FOV.Value}: Reset FOV\n\n" + "Extra:\n" + $"- {ConfigManager.Freecam_Toggle.Value}: Freecam toggle\n" + - $"- {ConfigManager.Block_Freecam_Movement.Value}: Block freecam movement\n" + + $"- {ConfigManager.Block_Freecam_Movement.Value}: Toggle block Freecam\n" + + $"- {ConfigManager.Toggle_Block_Games_Input.Value}: Toggle games input on Freecam\n" + $"- {ConfigManager.HUD_Toggle.Value}: HUD toggle\n" + $"- {ConfigManager.Pause.Value}: Pause\n" + $"- {ConfigManager.Frameskip.Value}: Frameskip\n"; @@ -526,7 +535,7 @@ namespace UnityExplorer.UI.Panels } public static bool ShouldOverrideInput(){ - return inFreeCamMode; + return inFreeCamMode && blockGamesInputOnFreecamToggle.isOn; } }