Skip to content

Commit

Permalink
Documentation improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Deltanic committed May 4, 2021
1 parent 22505ea commit 9b3797d
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 116 deletions.
58 changes: 29 additions & 29 deletions docs/CONFIGURING.md
Expand Up @@ -8,22 +8,22 @@ The freecam accepts a few configuration values. These can be changed
programmatically like so:

```lua
local Freecam = exports.freecam
local Freecam = exports['fivem-freecam']
Freecam:SetCameraSetting('EASING_DURATION', 2500)
```

Full list of camera settings and their default values:

```lua
--Camera
FOV = 45.0,
FOV = 45.0

-- On enable/disable
ENABLE_EASING = true,
EASING_DURATION = 1000,
ENABLE_EASING = true
EASING_DURATION = 1000

-- Keep position/rotation
KEEP_POSITION = false,
KEEP_POSITION = false
KEEP_ROTATION = false
```

Expand All @@ -40,7 +40,7 @@ It's possible to change the controls of the freecam. Controls are defined for
keyboards and gamepads and can be changed individually:

```lua
local Freecam = exports.freecam
local Freecam = exports['fivem-freecam']
Freecam:SetKeyboardControl('MOVE_X', INPUT_MOVE_LR)
Freecam:SetGamepadControl('MOVE_Y', INPUT_MOVE_UD)
```
Expand All @@ -56,33 +56,33 @@ Adjustable **keyboard** mapping and their default controls:

```lua
-- Rotation
LOOK_X = INPUT_LOOK_LR,
LOOK_Y = INPUT_LOOK_UD,
LOOK_X = INPUT_LOOK_LR
LOOK_Y = INPUT_LOOK_UD

-- Position
MOVE_X = INPUT_MOVE_LR,
MOVE_Y = INPUT_MOVE_UD,
MOVE_Z = { INPUT_PARACHUTE_BRAKE_LEFT, INPUT_PARACHUTE_BRAKE_RIGHT },
MOVE_X = INPUT_MOVE_LR
MOVE_Y = INPUT_MOVE_UD
MOVE_Z = { INPUT_PARACHUTE_BRAKE_LEFT, INPUT_PARACHUTE_BRAKE_RIGHT }

-- Multiplier
MOVE_FAST = INPUT_SPRINT,
MOVE_FAST = INPUT_SPRINT
MOVE_SLOW = INPUT_CHARACTER_WHEEL
```

Adjustable **gamepad** mapping and their default controls:

```lua
-- Rotation
LOOK_X = INPUT_LOOK_LR,
LOOK_Y = INPUT_LOOK_UD,
LOOK_X = INPUT_LOOK_LR
LOOK_Y = INPUT_LOOK_UD

-- Position
MOVE_X = INPUT_MOVE_LR,
MOVE_Y = INPUT_MOVE_UD,
MOVE_Z = { INPUT_PARACHUTE_BRAKE_RIGHT, INPUT_PARACHUTE_BRAKE_LEFT },
MOVE_X = INPUT_MOVE_LR
MOVE_Y = INPUT_MOVE_UD
MOVE_Z = { INPUT_PARACHUTE_BRAKE_RIGHT, INPUT_PARACHUTE_BRAKE_LEFT }

-- Multiplier
MOVE_FAST = INPUT_VEH_ACCELERATE,
MOVE_FAST = INPUT_VEH_ACCELERATE
MOVE_SLOW = INPUT_VEH_BRAKE
```

Expand All @@ -93,7 +93,7 @@ Control settings such as move speed multipliers and camera move sensitivity can
also be changed through settings:

```lua
local Freecam = exports.freecam
local Freecam = exports['fivem-freecam']
Freecam:SetKeyboardSetting('LOOK_SENSITIVITY_X', 5)
Freecam:SetGamepadSetting('LOOK_SENSITIVITY_X', 2)
```
Expand All @@ -105,26 +105,26 @@ Adjustable **keyboard** settings and their default values:

```lua
-- Rotation
LOOK_SENSITIVITY_X = 5,
LOOK_SENSITIVITY_Y = 5,
LOOK_SENSITIVITY_X = 5
LOOK_SENSITIVITY_Y = 5

-- Position
BASE_MOVE_MULTIPLIER = 1,
FAST_MOVE_MULTIPLIER = 10,
SLOW_MOVE_MULTIPLIER = 10,
BASE_MOVE_MULTIPLIER = 1
FAST_MOVE_MULTIPLIER = 10
SLOW_MOVE_MULTIPLIER = 10
```

Adjustable **gamepad** settings and their default values:

```lua
-- Rotation
LOOK_SENSITIVITY_X = 2,
LOOK_SENSITIVITY_Y = 2,
LOOK_SENSITIVITY_X = 2
LOOK_SENSITIVITY_Y = 2

-- Position
BASE_MOVE_MULTIPLIER = 1,
FAST_MOVE_MULTIPLIER = 10,
SLOW_MOVE_MULTIPLIER = 10,
BASE_MOVE_MULTIPLIER = 1
FAST_MOVE_MULTIPLIER = 10
SLOW_MOVE_MULTIPLIER = 10
```

[fivem-docs]: https://docs.fivem.net/game-references/controls/
5 changes: 2 additions & 3 deletions docs/EVENTS.md
Expand Up @@ -8,7 +8,6 @@ Called upon entering the freecam after `Freecam:SetActive(true)`. Useful to
detect state changes of the freecam.

```lua
local Freecam = exports.freecam
AddEventHandler('freecam:onEnter', function ()
-- Plays an effect upon entering the freecam.
StartScreenEffect('SuccessNeutral', 500, false)
Expand All @@ -23,7 +22,6 @@ Called upon exiting the freecam after `Freecam:SetActive(false)`. Useful to
detect state changes of the freecam.

```lua
local Freecam = exports.freecam
AddEventHandler('freecam:onExit', function ()
-- Plays an effect upon exiting the freecam.
StartScreenEffect('SuccessNeutral', 500, false)
Expand All @@ -41,9 +39,10 @@ in sync. Not called when the freecam is inactive.
No values are passed to this event.

```lua
local Freecam = exports.freecam
local Freecam = exports['fivem-freecam']
AddEventHandler('freecam:onTick', function ()
-- Gets the current target position of the freecam.
-- You could attach the player to this, or an object.
local target = Freecam:GetTarget(50)
print(target)
end)
Expand Down

0 comments on commit 9b3797d

Please sign in to comment.