mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 01:08:57 +00:00
feat(html): New Notify System
-Replaces old notification system but is also backwards compatible so no changes necessary - Now allows for the use of sending a table with text and caption - Can add as many types of notifications as wanted/needed - Configure position and icons in app,js (google icons or fontawesome)
This commit is contained in:
+20
-3
@@ -59,9 +59,26 @@ function QBCore.Functions.DrawText3D(x, y, z, text) -- Use local function instea
|
||||
end
|
||||
|
||||
function QBCore.Functions.Notify(text, textype, length)
|
||||
local ttype = textype or 'primary'
|
||||
local length = length or 5000
|
||||
SendNUIMessage({action = 'show', type = ttype, length = length, text = text})
|
||||
if type(text) == "table" then
|
||||
local ttext = text.text or 'Placeholder'
|
||||
local caption = text.caption or 'Placeholder'
|
||||
local ttype = textype or 'primary'
|
||||
local length = length or 5000
|
||||
SendNUIMessage({
|
||||
type = ttype,
|
||||
length = length,
|
||||
text = ttext,
|
||||
caption = caption
|
||||
})
|
||||
else
|
||||
local ttype = textype or 'primary'
|
||||
local length = length or 5000
|
||||
SendNUIMessage({
|
||||
type = ttype,
|
||||
length = length,
|
||||
text = text
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
function QBCore.Debug(resource, obj, depth)
|
||||
|
||||
Reference in New Issue
Block a user