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
|
if GetResourceState('es_extended') ~= 'started' then return end
|
||||||
|
|
||||||
ESX = exports["es_extended"]:getSharedObject()
|
ESX = exports["es_extended"]:getSharedObject()
|
||||||
|
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||||
|
|
||||||
Framework = Framework or {}
|
Framework = Framework or {}
|
||||||
|
|
||||||
@@ -18,11 +19,10 @@ Framework.GetPlayerData = function()
|
|||||||
return ESX.GetPlayerData()
|
return ESX.GetPlayerData()
|
||||||
end
|
end
|
||||||
|
|
||||||
--<-- TODO swap to internal callback system
|
|
||||||
---This will return a table of all the jobs in the framework.
|
---This will return a table of all the jobs in the framework.
|
||||||
---@return table
|
---@return table
|
||||||
Framework.GetFrameworkJobs = function()
|
Framework.GetFrameworkJobs = function()
|
||||||
local jobs = lib.callback.await('community_bridge:Callback:GetFrameworkJobs', false)
|
local jobs = Callback.Trigger('community_bridge:Callback:GetFrameworkJobs', false)
|
||||||
return jobs
|
return jobs
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
if GetResourceState('es_extended') ~= 'started' then return end
|
if GetResourceState('es_extended') ~= 'started' then return end
|
||||||
|
|
||||||
Prints = Prints or Require("lib/utility/shared/prints.lua")
|
Prints = Prints or Require("lib/utility/shared/prints.lua")
|
||||||
|
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||||
|
|
||||||
ESX = exports["es_extended"]:getSharedObject()
|
ESX = exports["es_extended"]:getSharedObject()
|
||||||
|
|
||||||
@@ -452,8 +453,7 @@ AddEventHandler("playerDropped", function()
|
|||||||
TriggerEvent("community_bridge:Server:OnPlayerUnload", src)
|
TriggerEvent("community_bridge:Server:OnPlayerUnload", src)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--<-- TODO swap to internal callback system
|
Callback.Register('community_bridge:Callback:GetFrameworkJobs', function(source)
|
||||||
lib.callback.register('community_bridge:Callback:GetFrameworkJobs', function(source)
|
|
||||||
return Framework.GetFrameworkJobs() or {}
|
return Framework.GetFrameworkJobs() or {}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
if GetResourceState('core_inventory') ~= 'started' then return end
|
if GetResourceState('core_inventory') ~= 'started' then return end
|
||||||
local core = exports.core_inventory
|
local core = exports.core_inventory
|
||||||
|
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||||
|
|
||||||
Inventory = Inventory or {}
|
Inventory = Inventory or {}
|
||||||
|
|
||||||
@@ -12,8 +13,7 @@ Inventory.GetItemInfo = function(item)
|
|||||||
if not frameworkName then return {} end
|
if not frameworkName then return {} end
|
||||||
local dataRepack = {}
|
local dataRepack = {}
|
||||||
if frameworkName == 'es_extended' then
|
if frameworkName == 'es_extended' then
|
||||||
--<-- TODO swap to internal callback system
|
local callbackData = Callback.Trigger('community_bridge:Callback:core_inventory', false)
|
||||||
local callbackData = lib.callback.await('community_bridge:Callback:core_inventory', false)
|
|
||||||
-- really really wish this inventory allowed me to pull the item list client side....
|
-- really really wish this inventory allowed me to pull the item list client side....
|
||||||
dataRepack = callbackData[item]
|
dataRepack = callbackData[item]
|
||||||
if not dataRepack then return {} end
|
if not dataRepack then return {} end
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ if GetResourceState('core_inventory') ~= 'started' then return end
|
|||||||
|
|
||||||
Inventory = Inventory or {}
|
Inventory = Inventory or {}
|
||||||
Inventory.Stashes = Inventory.Stashes or {}
|
Inventory.Stashes = Inventory.Stashes or {}
|
||||||
|
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||||
local core = exports.core_inventory
|
local core = exports.core_inventory
|
||||||
|
|
||||||
---This will add an item, and return true or false based on success
|
---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"
|
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||||
end
|
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.
|
---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()
|
local items = core:getItemsList()
|
||||||
return items or {}
|
return items or {}
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
local resourceName = "okokPhone"
|
local resourceName = "okokPhone"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Phone = Phone or {}
|
Phone = Phone or {}
|
||||||
|
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||||
|
|
||||||
---This will get the name of the Phone system being being used.
|
---This will get the name of the Phone system being being used.
|
||||||
---@return string
|
---@return string
|
||||||
@@ -15,8 +16,7 @@ end
|
|||||||
---@param message string
|
---@param message string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
Phone.SendEmail = function(email, title, message)
|
Phone.SendEmail = function(email, title, message)
|
||||||
--<-- TODO swap to internal callback system
|
local success = Callback.Trigger('community_bridge:Callback:okokPhone:sendEmail', false, email, title, message)
|
||||||
local success = lib.callback.await('community_bridge:Callback:okokPhone:sendEmail', false, email, title, message) --[[ @as boolean ]]
|
|
||||||
return success
|
return success
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
local resourceName = "okokPhone"
|
local resourceName = "okokPhone"
|
||||||
if GetResourceState(resourceName) == 'missing' then return end
|
if GetResourceState(resourceName) == 'missing' then return end
|
||||||
Phone = Phone or {}
|
Phone = Phone or {}
|
||||||
|
Callback = Callback or Require("lib/utility/shared/callbacks.lua")
|
||||||
|
|
||||||
---This will get the name of the Phone system being being used.
|
---This will get the name of the Phone system being being used.
|
||||||
---@return string
|
---@return string
|
||||||
@@ -53,8 +54,7 @@ Phone.SendEmail = function(src, email, title, message)
|
|||||||
return success
|
return success
|
||||||
end
|
end
|
||||||
|
|
||||||
--<-- TODO swap to internal callback system
|
Callback.Register('community_bridge:Callback:okokPhone:sendEmail', function(src, email, title, message)
|
||||||
lib.callback.register('community_bridge:Callback:okokPhone:sendEmail', function(src, email, title, message)
|
|
||||||
return Phone.SendEmail(src, email, title, message)
|
return Phone.SendEmail(src, email, title, message)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user