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 = "pNotify"
|
|
|
|
|
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
|
|
|
Notify.SendNotify = function(message, _type, time)
|
|
|
|
|
time = time or 3000
|
|
|
|
|
return exports['pNotify']:SendNotification({ text = message, type = _type, timeout = time, layout = 'centerRight' })
|
|
|
|
|
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
|
2026-08-18 00:02:04 -07:00
|
|
|
if not title then title = lib.locale("Notifications.PlaceholderTitle") end
|
2025-12-14 16:22:35 -05:00
|
|
|
return exports['pNotify']:SendNotification({ title = title, text = message, type = _type or "success", timeout = time, layout = 'centerRight' })
|
2025-05-10 00:01:56 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return Notify
|