Remove all uses of ox_lib callbacks in favor of internal option
This seems fine, Crowley created the callback system in bridge so will need review
This commit is contained in:
1 parent
7dcb01de2d
commit
5dc2321d67
6 files changed
+12
-12
No files matched your search
@@ -2,6 +2,7 @@
|
||||
if GetResourceState('es_extended') ~= 'started' then return end
|
||||
|
||||
ESX = exports["es_extended"]:getSharedObject()
|
||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||
|
||||
Framework = Framework or {}
|
||||
|
||||
@@ -18,11 +19,10 @@ Framework.GetPlayerData = function()
|
||||
return ESX.GetPlayerData()
|
||||
end
|
||||
|
||||
--<-- TODO swap to internal callback system
|
||||
---This will return a table of all the jobs in the framework.
|
||||
---@return table
|
||||
Framework.GetFrameworkJobs = function()
|
||||
local jobs = lib.callback.await('community_bridge:Callback:GetFrameworkJobs', false)
|
||||
local jobs = Callback.Trigger('community_bridge:Callback:GetFrameworkJobs', false)
|
||||
return jobs
|
||||
end
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
if GetResourceState('es_extended') ~= 'started' then return end
|
||||
|
||||
Prints = Prints or Require("lib/utility/shared/prints.lua")
|
||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||
|
||||
ESX = exports["es_extended"]:getSharedObject()
|
||||
|
||||
@@ -452,8 +453,7 @@ AddEventHandler("playerDropped", function()
|
||||
TriggerEvent("community_bridge:Server:OnPlayerUnload", src)
|
||||
end)
|
||||
|
||||
--<-- TODO swap to internal callback system
|
||||
lib.callback.register('community_bridge:Callback:GetFrameworkJobs', function(source)
|
||||
Callback.Register('community_bridge:Callback:GetFrameworkJobs', function(source)
|
||||
return Framework.GetFrameworkJobs() or {}
|
||||
end)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('core_inventory') ~= 'started' then return end
|
||||
local core = exports.core_inventory
|
||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||
|
||||
Inventory = Inventory or {}
|
||||
|
||||
@@ -12,8 +13,7 @@ Inventory.GetItemInfo = function(item)
|
||||
if not frameworkName then return {} end
|
||||
local dataRepack = {}
|
||||
if frameworkName == 'es_extended' then
|
||||
--<-- TODO swap to internal callback system
|
||||
local callbackData = lib.callback.await('community_bridge:Callback:core_inventory', false)
|
||||
local callbackData = Callback.Trigger('community_bridge:Callback:core_inventory', false)
|
||||
-- really really wish this inventory allowed me to pull the item list client side....
|
||||
dataRepack = callbackData[item]
|
||||
if not dataRepack then return {} end
|
||||
|
||||
@@ -3,6 +3,7 @@ if GetResourceState('core_inventory') ~= 'started' then return end
|
||||
|
||||
Inventory = Inventory or {}
|
||||
Inventory.Stashes = Inventory.Stashes or {}
|
||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||
local core = exports.core_inventory
|
||||
|
||||
---This will add an item, and return true or false based on success
|
||||
@@ -244,9 +245,8 @@ Inventory.GetImagePath = function(item)
|
||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||
end
|
||||
|
||||
---<-- TODO swap to internal callback system
|
||||
---This is used for the esx users, documentation doesnt show a client side available option for the inventory so we use jank callbacks to get this.
|
||||
lib.callback.register('community_bridge:Callback:core_inventory', function(source)
|
||||
Callback.Register('community_bridge:Callback:core_inventory', function(source)
|
||||
local items = core:getItemsList()
|
||||
return items or {}
|
||||
end)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
local resourceName = "okokPhone"
|
||||
if GetResourceState(resourceName) == 'missing' then return end
|
||||
Phone = Phone or {}
|
||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||
|
||||
---This will get the name of the Phone system being being used.
|
||||
---@return string
|
||||
@@ -15,8 +16,7 @@ end
|
||||
---@param message string
|
||||
---@return boolean
|
||||
Phone.SendEmail = function(email, title, message)
|
||||
--<-- TODO swap to internal callback system
|
||||
local success = lib.callback.await('community_bridge:Callback:okokPhone:sendEmail', false, email, title, message) --[[ @as boolean ]]
|
||||
local success = Callback.Trigger('community_bridge:Callback:okokPhone:sendEmail', false, email, title, message)
|
||||
return success
|
||||
end
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
local resourceName = "okokPhone"
|
||||
if GetResourceState(resourceName) == 'missing' then return end
|
||||
Phone = Phone or {}
|
||||
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||
|
||||
---This will get the name of the Phone system being being used.
|
||||
---@return string
|
||||
@@ -53,8 +54,7 @@ Phone.SendEmail = function(src, email, title, message)
|
||||
return success
|
||||
end
|
||||
|
||||
--<-- TODO swap to internal callback system
|
||||
lib.callback.register('community_bridge:Callback:okokPhone:sendEmail', function(src, email, title, message)
|
||||
Callback.Register('community_bridge:Callback:okokPhone:sendEmail', function(src, email, title, message)
|
||||
return Phone.SendEmail(src, email, title, message)
|
||||
end)
|
||||
|
||||
|
||||
Reference in new issue
Block a user