From 0e28c3f1e4d6b29e63b68ec94900084212b0f0a2 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Wed, 5 Feb 2025 21:02:08 -0500 Subject: [PATCH 1/3] Delete supplement_events.lua --- modules/utility/server/supplement_events.lua | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 modules/utility/server/supplement_events.lua diff --git a/modules/utility/server/supplement_events.lua b/modules/utility/server/supplement_events.lua deleted file mode 100644 index 11181c0..0000000 --- a/modules/utility/server/supplement_events.lua +++ /dev/null @@ -1,6 +0,0 @@ -RegisterNetEvent("community_bridge:server:alert", function(data) - local playersByJob = Framework.GetPlayersByJob(data.job) - for _, src in pairs(playersByJob) do - TriggerClientEvent("community_bridge:client:alert", src, data) - end -end) \ No newline at end of file From 2fa129dddd2391917a1a01f365e562ad33e97afc Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Wed, 5 Feb 2025 22:51:43 -0500 Subject: [PATCH 2/3] re-add requestanimdict, add notify/showhelp to the frameworks that offer it qbx uses ox's so no point --- lib/client/utility.lua | 26 +++++++++--------------- modules/framework/es_extended/client.lua | 4 ++++ modules/framework/qb-core/client.lua | 12 +++++++++++ 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/lib/client/utility.lua b/lib/client/utility.lua index b9e0121..9373e10 100644 --- a/lib/client/utility.lua +++ b/lib/client/utility.lua @@ -92,6 +92,16 @@ Utility.LoadModel = function(model) return HasModelLoaded(model) end +Utility.RequestAnimDict = function(dict) + RequestAnimDict(dict) + local count = 0 + while not HasAnimDictLoaded(dict) and count < 30000 do + Wait(0) + count = count + 1 + end + return HasAnimDictLoaded(dict) +end + Utility.RemovePed = function(entity) local success = false DeleteEntity(entity) @@ -137,15 +147,6 @@ Utility.SetEntitySkinData = function(entity, skinData) return true end -Utility.NativeAlert = function(data) - local message = data.message or 'No message provided' - local coords = data.coords or GetEntityCoords(cache.ped) - local job = data.job - local scale = data.scale or 0.8 - local sprite = data.sprite or 1 - TriggerServerEvent('community_bridge:server:alert', {message = message, coords = coords, job = job, scale = scale, sprite = sprite}) -end - Utility.ReloadSkin = function() local skinData = Utility.GetEntitySkinData(cache.ped) Utility.SetEntitySkinData(cache.ped, skinData) @@ -279,13 +280,6 @@ AddEventHandler('onResourceStop', function(resource) end end) -RegisterNetEvent('community_bridge:client:alert', function(data) - local blip = Utility.CreateBlip(data.coords, data.sprite, 3, data.scale, data.message, true) - SetTimeout(40000, function() - Utility.RemoveBlip(blip) - end) -end) - exports('Utility', Utility) return Utility \ No newline at end of file diff --git a/modules/framework/es_extended/client.lua b/modules/framework/es_extended/client.lua index 05f7d8e..eb92eaf 100644 --- a/modules/framework/es_extended/client.lua +++ b/modules/framework/es_extended/client.lua @@ -16,6 +16,10 @@ Framework.GetPlayerMetaData = function(metadata) return ESX.GetPlayerData().metadata[metadata] end +Framework.Notify = function(message, type, time) + return ESX.ShowNotification(message, type, time) +end + Framework.GetPlayerIdentifier = function() return ESX.GetPlayerData().identifier end diff --git a/modules/framework/qb-core/client.lua b/modules/framework/qb-core/client.lua index b7dd1f8..3b8291b 100644 --- a/modules/framework/qb-core/client.lua +++ b/modules/framework/qb-core/client.lua @@ -17,6 +17,18 @@ Framework.GetPlayerMetaData = function(metadata) return QBCore.Functions.GetPlayerData().metadata[metadata] end +Framework.Notify = function(message, type, time) + TriggerEvent('QBCore:Notify', message, 'primary', time) +end + +Framework.ShowHelpText = function(message, _position) + return exports['qb-core']:DrawText(message, _position) +end + +Framework.HideHelpText = function() + return exports['qb-core']:HideText() +end + Framework.GetItemInfo = function(item) local itemData = QBCore.Shared.Items[item] if not itemData then return {} end From 6bcfc370d07410737f67b1592b5e5e9b36bd384b Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Wed, 5 Feb 2025 22:51:59 -0500 Subject: [PATCH 3/3] whitespace --- modules/input/_oxlib.lua | 4 ---- modules/input/_qb-input.lua | 4 +--- modules/input/client.lua | 7 ------- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/modules/input/_oxlib.lua b/modules/input/_oxlib.lua index 8b52b20..c376a23 100644 --- a/modules/input/_oxlib.lua +++ b/modules/input/_oxlib.lua @@ -1,7 +1,5 @@ if GetResourceState('ox_lib') ~= 'started' or (BridgeClientConfig.InputSystem ~= "ox" and BridgeClientConfig.InputSystem ~= "auto") then return end - - function QBTypeToOxType(_type) if _type == "text" then return "input" @@ -18,7 +16,6 @@ function QBTypeToOxType(_type) end end - function QBToOxInput(data) local returnData = {} for i, v in pairs(data) do @@ -44,7 +41,6 @@ function QBToOxInput(data) return returnData end - function OpenInput(title, data, isQBFormat, submitText) local inputs = data.inputs if isQBFormat then diff --git a/modules/input/_qb-input.lua b/modules/input/_qb-input.lua index 933fe0e..43809d0 100644 --- a/modules/input/_qb-input.lua +++ b/modules/input/_qb-input.lua @@ -1,8 +1,6 @@ if GetResourceState('qb-input') ~= 'started' or (BridgeClientConfig.InputSystem ~= "qb" and BridgeClientConfig.InputSystem ~= "auto") then return end - --- ox to Qb function OxTypeToQBType(_type) if _type == "input" then return "text" @@ -65,5 +63,5 @@ function OpenInput(title, data, isQBFormat, submitText) header = title, submitText = submitText or "Submit", inputs = input - }) + }) end \ No newline at end of file diff --git a/modules/input/client.lua b/modules/input/client.lua index e3067ac..a5b86d1 100644 --- a/modules/input/client.lua +++ b/modules/input/client.lua @@ -78,14 +78,7 @@ if GetResourceState('ox_lib') ~= 'started' and GetResourceState('qb-menu') ~= 's -- "input", "number", "checkbox", "select", "multi-select", "slider", "color", "date", "date-range", "time", "textarea", Input = {} - - - - - - -- qb to ox - --Open menu function Input.Open(title, data, isQBFormat, submitText)