Files
community_bridge/modules/notify/pNotify/client.lua
T
MrNewb 6e418f406c Notify and HelpText split into seperate modules
Notify and HelpText split into separate modules, settings moved into shared.
2025-04-28 10:21:03 -04:00

20 lines
770 B
Lua

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
---@diagnostic disable-next-line: duplicate-set-field
Notify.GetResourceName = function()
return resourceName
end
---This will send a notify message of the type and time passed
---@param message string
---@param _type string
---@param time number
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
Notify.SendNotify = function(message, _type, time)
time = time or 3000
return exports['pNotify']:SendNotification({ text = message, type = _type, timeout = time, layout = 'centerRight' })
end