Skip to content

Commit

Permalink
Merge pull request #1472 from zImSkillz/main
Browse files Browse the repository at this point in the history
fix(es_extended/client/functions.lua): bug fix with the menu close & closeall function
  • Loading branch information
Kenshiin13 authored Nov 17, 2024
2 parents 99f34fc + 5bddb7d commit 7cf3673
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions [core]/es_extended/client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,12 @@ function ESX.UI.Menu.Close(menuType, namespace, name, cancel)
if not cancel then
ESX.UI.Menu.Opened[i].close()
else
ESX.UI.Menu.Opened[i].cancel()
local menu = ESX.UI.Menu.Opened[i]
ESX.UI.Menu.RegisteredTypes[menu.type].close(menu.namespace, menu.name)

if type(menu.cancel) ~= "nil" then
menu.cancel(menu.data, menu)
end
end
ESX.UI.Menu.Opened[i] = nil
end
Expand All @@ -405,7 +410,12 @@ function ESX.UI.Menu.CloseAll(cancel)
if not cancel then
ESX.UI.Menu.Opened[i].close()
else
ESX.UI.Menu.Opened[i].cancel()
local menu = ESX.UI.Menu.Opened[i]
ESX.UI.Menu.RegisteredTypes[menu.type].close(menu.namespace, menu.name)

if type(menu.cancel) ~= "nil" then
menu.cancel(menu.data, menu)
end
end
ESX.UI.Menu.Opened[i] = nil
end
Expand Down

0 comments on commit 7cf3673

Please sign in to comment.