mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 01:38:52 +00:00
♻️(client/functions): context functions
This commit is contained in:
@@ -140,40 +140,23 @@ ESX.HashString = function(str)
|
||||
return input_map
|
||||
end
|
||||
|
||||
if GetResourceState("esx_context") ~= "missing" then
|
||||
function ESX.OpenContext(...)
|
||||
exports["esx_context"]:Open(...)
|
||||
end
|
||||
local contextAvailable = GetResourceState("esx_contex") ~= "missing"
|
||||
|
||||
function ESX.PreviewContext(...)
|
||||
exports["esx_context"]:Preview(...)
|
||||
end
|
||||
|
||||
function ESX.CloseContext(...)
|
||||
exports["esx_context"]:Close(...)
|
||||
end
|
||||
|
||||
function ESX.RefreshContext(...)
|
||||
exports["esx_context"]:Refresh(...)
|
||||
end
|
||||
else
|
||||
function ESX.OpenContext()
|
||||
print("[^1ERROR^7] Tried to ^5open^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
|
||||
function ESX.PreviewContext()
|
||||
print("[^1ERROR^7] Tried to ^5preview^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
|
||||
function ESX.CloseContext()
|
||||
print("[^1ERROR^7] Tried to ^5close^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
|
||||
function ESX.RefreshContext()
|
||||
print("[^1ERROR^7] Tried to ^5Refresh^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
function ESX.OpenContext(...)
|
||||
return contextAvailable and exports["esx_context"]:Open(...) or not contextAvailable and print("[^1ERROR^7] Tried to ^5open^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
|
||||
function ESX.PreviewContext(...)
|
||||
return contextAvailable and exports["esx_context"]:Preview(...) or not contextAvailable and print("[^1ERROR^7] Tried to ^5preview^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
|
||||
function ESX.CloseContext(...)
|
||||
return contextAvailable and exports["esx_context"]:Close(...) or not contextAvailable and print("[^1ERROR^7] Tried to ^5close^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
|
||||
function ESX.RefreshContext(...)
|
||||
return contextAvailable and exports["esx_context"]:Refresh(...) or not contextAvailable and print("[^1ERROR^7] Tried to ^5Refresh^7 context menu, but ^5esx_context^7 is missing!")
|
||||
end
|
||||
|
||||
ESX.RegisterInput = function(command_name, label, input_group, key, on_press, on_release)
|
||||
RegisterCommand(on_release ~= nil and "+" .. command_name or command_name, on_press)
|
||||
|
||||
Reference in New Issue
Block a user