Automatically update the default freecam every time a new freecam type is selected.

This commit is contained in:
originalnicodr committed 2025-01-20 11:51:50 -03:00
1 parent 7fb67b4e28
commit ca46607c49
2 files changed
+7 -5

No files matched your search

+6 -5
View File
@@ -33,7 +33,6 @@ namespace UnityExplorer.Config
public static ConfigElement<bool> Auto_Scale_UI;
public static ConfigElement<bool> Reset_Camera_Transform;
public static ConfigElement<FreeCamPanel.FreeCameraType> Default_Freecam;
public static ConfigElement<KeyCode> Pause;
public static ConfigElement<KeyCode> Frameskip;
public static ConfigElement<KeyCode> Screenshot;
@@ -61,6 +60,8 @@ namespace UnityExplorer.Config
public static ConfigElement<KeyCode> Reset_FOV;
public static ConfigElement<KeyCode> Toggle_Animations;
public static ConfigElement<FreeCamPanel.FreeCameraType> Default_Freecam;
// internal configs
internal static InternalConfigHandler InternalHandler { get; private set; }
internal static readonly Dictionary<UIManager.Panels, ConfigElement<string>> PanelSaveData = new();
@@ -191,10 +192,6 @@ namespace UnityExplorer.Config
"Reset the camera position and rotation between freecam sessions, so the freecam always starts from the gameplay position and rotation.",
false);
Default_Freecam = new("Default Freecam mode",
"Default type of freecam selected on startup.",
FreeCamPanel.FreeCameraType.New);
Pause = new("Pause",
"Toggle the pause of the game.",
KeyCode.PageUp);
@@ -300,6 +297,10 @@ namespace UnityExplorer.Config
Toggle_Animations = new("Toggle NPC animations",
"Toggle NPC animations as selected in the Animator panel.",
KeyCode.Keypad0);
Default_Freecam = new("Default Freecam mode",
"Default type of freecam selected on startup (gets automatically updated with the last type of camera used).",
FreeCamPanel.FreeCameraType.New);
}
}
}
+1
View File
@@ -408,6 +408,7 @@ namespace UnityExplorer.UI.Panels
UIFactory.SetLayoutElement(CameraMode.gameObject, minWidth: 100, minHeight: 25);
GameObject cameraTypeDropdownObj = UIFactory.CreateDropdown(CameraModeRow, "CameraType_Dropdown", out cameraTypeDropdown, null, 14, (idx) => {
ConfigManager.Default_Freecam.Value = (FreeCameraType)idx;
if (inFreeCamMode) {
EndFreecam();
BeginFreecam();