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:
MrNewb committed 2025-06-28 16:52:01 -04:00
1 parent 7dcb01de2d
commit 5dc2321d67
6 files changed
+12 -12

No files matched your search

+2 -2
View File
@@ -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
+2 -2
View File
@@ -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)