Skip to content

Commit

Permalink
feat(client): add convar ox_target:leftClick
Browse files Browse the repository at this point in the history
Default value is 1, making left mouse button the default control
to gain nui focus. Maybe make it a user setting in the future?
  • Loading branch information
thelindat committed Nov 8, 2022
1 parent fec5d6f commit d028bd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ local currentTarget = {}

-- Toggle ox_target, instead of holding the hotkey
local toggleHotkey = GetConvarInt('ox_target:toggleHotkey', 0) == 1
local mouseButton = GetConvarInt('ox_target:leftClick', 1) == 1 and 24 or 25

local function enableTargeting()
if isDisabled or isActive or IsNuiFocused() or IsPauseMenuActive() then return end
Expand Down Expand Up @@ -244,7 +245,7 @@ local function enableTargeting()
if options and IsDisabledControlJustPressed(0, 25) then
setNuiFocus(false, false)
end
elseif options and IsDisabledControlJustPressed(0, 25) then
elseif options and IsDisabledControlJustPressed(0, mouseButton) then
setNuiFocus(true, true)
end

Expand Down

0 comments on commit d028bd0

Please sign in to comment.