Skip to content

Commit

Permalink
fix(client): don't close menu when returning to "home"
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Jul 26, 2023
1 parent 1b7feb6 commit b834548
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
---@field groups? string | string[] | table<string, number>
---@field items? string | string[] | table<string, number>
---@field anyItem? boolean
---@field canInteract fun(entity?: number, distance: number, coords: vector3, name?: string, bone?: number): boolean?
---@field canInteract? fun(entity?: number, distance: number, coords: vector3, name?: string, bone?: number): boolean?
---@field onSelect? fun(data: TargetOptions | number)
---@field export? string
---@field event? string
Expand Down
4 changes: 3 additions & 1 deletion client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ local function startTargeting()
end

do
---@type CKeybind
---@type KeybindProps
local keybind = {
name = 'ox_target',
defaultKey = GetConvar('ox_target:defaultHotkey', 'LMENU'),
Expand Down Expand Up @@ -417,6 +417,8 @@ RegisterNUICallback('select', function(data, cb)
elseif option.command then
ExecuteCommand(option.command)
end

if option.menuName == 'home' then return end
end

if not option?.openMenu and IsNuiFocused() then
Expand Down

0 comments on commit b834548

Please sign in to comment.