master #4
@ -60,6 +60,11 @@ namespace Terkoiz.Freecam
|
||||
ToggleCamera();
|
||||
}
|
||||
|
||||
if (FreecamPlugin.ToggleFreecamControls.Value.IsDown())
|
||||
{
|
||||
ToggleCameraControls();
|
||||
}
|
||||
|
||||
if (FreecamPlugin.TeleportToCamera.Value.IsDown())
|
||||
{
|
||||
MovePlayerToCamera();
|
||||
@ -196,6 +201,25 @@ namespace Terkoiz.Freecam
|
||||
localPlayer.PointOfView = EPointOfView.FirstPerson;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A helper method to toggle the Freecam Camera Controls
|
||||
/// </summary>
|
||||
private void ToggleCameraControls()
|
||||
{
|
||||
if (_freeCamScript.IsActive)
|
||||
{
|
||||
_freeCamScript.IsActive = false;
|
||||
_gamePlayerOwner.enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_freeCamScript.IsActive = true;
|
||||
_gamePlayerOwner.enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="Player"/> instance if it's available
|
||||
/// </summary>
|
||||
|
@ -20,6 +20,7 @@ namespace Terkoiz.Freecam
|
||||
// Keyboard shortcut config entries
|
||||
private const string KeybindSectionName = "Keybinds";
|
||||
internal static ConfigEntry<KeyboardShortcut> ToggleFreecamMode;
|
||||
internal static ConfigEntry<KeyboardShortcut> ToggleFreecamControls;
|
||||
internal static ConfigEntry<KeyboardShortcut> TeleportToCamera;
|
||||
internal static ConfigEntry<KeyboardShortcut> ToggleUi;
|
||||
|
||||
@ -67,6 +68,12 @@ namespace Terkoiz.Freecam
|
||||
new KeyboardShortcut(KeyCode.KeypadPlus),
|
||||
"The keyboard shortcut that toggles Freecam");
|
||||
|
||||
ToggleFreecamControls = Config.Bind(
|
||||
KeybindSectionName,
|
||||
"Toggle Freecam Controls",
|
||||
new KeyboardShortcut(KeyCode.KeypadPeriod),
|
||||
"The keyboard shortcut that toggles Freecam Controls");
|
||||
|
||||
TeleportToCamera = Config.Bind(
|
||||
KeybindSectionName,
|
||||
"Teleport To Camera",
|
||||
|
Reference in New Issue
Block a user