Skip to content

Commit ca46607

Browse files
Automatically update the default freecam every time a new freecam type is selected.
1 parent 7fb67b4 commit ca46607

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Config/ConfigManager.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public static class ConfigManager
3333
public static ConfigElement<bool> Auto_Scale_UI;
3434
public static ConfigElement<bool> Reset_Camera_Transform;
3535

36-
public static ConfigElement<FreeCamPanel.FreeCameraType> Default_Freecam;
3736
public static ConfigElement<KeyCode> Pause;
3837
public static ConfigElement<KeyCode> Frameskip;
3938
public static ConfigElement<KeyCode> Screenshot;
@@ -61,6 +60,8 @@ public static class ConfigManager
6160
public static ConfigElement<KeyCode> Reset_FOV;
6261
public static ConfigElement<KeyCode> Toggle_Animations;
6362

63+
public static ConfigElement<FreeCamPanel.FreeCameraType> Default_Freecam;
64+
6465
// internal configs
6566
internal static InternalConfigHandler InternalHandler { get; private set; }
6667
internal static readonly Dictionary<UIManager.Panels, ConfigElement<string>> PanelSaveData = new();
@@ -191,10 +192,6 @@ private static void CreateConfigElements()
191192
"Reset the camera position and rotation between freecam sessions, so the freecam always starts from the gameplay position and rotation.",
192193
false);
193194

194-
Default_Freecam = new("Default Freecam mode",
195-
"Default type of freecam selected on startup.",
196-
FreeCamPanel.FreeCameraType.New);
197-
198195
Pause = new("Pause",
199196
"Toggle the pause of the game.",
200197
KeyCode.PageUp);
@@ -300,6 +297,10 @@ private static void CreateConfigElements()
300297
Toggle_Animations = new("Toggle NPC animations",
301298
"Toggle NPC animations as selected in the Animator panel.",
302299
KeyCode.Keypad0);
300+
301+
Default_Freecam = new("Default Freecam mode",
302+
"Default type of freecam selected on startup (gets automatically updated with the last type of camera used).",
303+
FreeCamPanel.FreeCameraType.New);
303304
}
304305
}
305306
}

src/UI/Panels/FreeCamPanel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ protected override void ConstructPanelContent()
408408
UIFactory.SetLayoutElement(CameraMode.gameObject, minWidth: 100, minHeight: 25);
409409

410410
GameObject cameraTypeDropdownObj = UIFactory.CreateDropdown(CameraModeRow, "CameraType_Dropdown", out cameraTypeDropdown, null, 14, (idx) => {
411+
ConfigManager.Default_Freecam.Value = (FreeCameraType)idx;
411412
if (inFreeCamMode) {
412413
EndFreecam();
413414
BeginFreecam();

0 commit comments

Comments
 (0)