2025-06-08 19:52:24 -04:00
|
|
|
---@diagnostic disable: duplicate-set-field
|
2025-04-28 10:21:03 -04:00
|
|
|
Notify = Notify or {}
|
|
|
|
|
local resourceName = "ox_lib"
|
|
|
|
|
local configValue = BridgeSharedConfig.Notify
|
|
|
|
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
|
|
|
|
|
|
|
|
|
Notify.GetResourceName = function()
|
|
|
|
|
return resourceName
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-23 19:27:27 -05:00
|
|
|
|
|
|
|
|
local Language = Language or Require("modules/locales/shared.lua")
|
|
|
|
|
local locale = Language.Locale
|
|
|
|
|
local placeHolderText = locale("Notifications.PlaceholderTitle")
|
|
|
|
|
|
|
|
|
|
Notify.SendNotify = function(message, _type, time)
|
|
|
|
|
time = time or 3000
|
|
|
|
|
return exports.ox_lib:notify({ description = message, type = _type, duration = time, position = 'top-right' })
|
|
|
|
|
end
|
|
|
|
|
|
2025-04-28 10:21:03 -04:00
|
|
|
---This will send a notify message of the type and time passed
|
2025-12-14 16:22:35 -05:00
|
|
|
---@param title string
|
2025-04-28 10:21:03 -04:00
|
|
|
---@param message string
|
|
|
|
|
---@param _type string
|
|
|
|
|
---@param time number
|
2025-12-14 16:22:35 -05:00
|
|
|
---@props table optional
|
2025-04-28 10:21:03 -04:00
|
|
|
---@return nil
|
2025-12-14 16:22:35 -05:00
|
|
|
Notify.SendNotification = function(title, message, _type, time, props)
|
2025-04-28 10:21:03 -04:00
|
|
|
time = time or 3000
|
2025-12-23 19:27:27 -05:00
|
|
|
if not title then title = placeHolderText end
|
2025-12-14 16:22:35 -05:00
|
|
|
return exports.ox_lib:notify({ title = title, description = message, type = _type or "success", duration = time, position = 'top-right' })
|
2025-05-10 00:01:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return Notify
|