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:
Kakarot
2021-09-28 23:39:11 -06:00
parent 8a1181171c
commit be4f57410b
7 changed files with 123 additions and 86 deletions
+20 -3
View File
@@ -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)