refactor: ESX Notify - Better Blue, Better Readme,

This commit is contained in:
Mycroft
2022-07-16 16:50:58 +01:00
parent fc00c4e1ca
commit 42815ba79d
4 changed files with 24 additions and 10 deletions
+10 -6
View File
@@ -7,8 +7,8 @@ local function Notify(notificatonType, length, message)
if Debug then
print("1 ".. tostring(notificatonType))
print("1 "..tostring(length))
print("1 "..message)
print("2 "..tostring(length))
print("3 "..message)
end
if type(notificatonType) ~= "string" then
@@ -20,9 +20,9 @@ local function Notify(notificatonType, length, message)
end
if Debug then
print("2 ".. tostring(notificatonType))
print("2 "..tostring(length))
print("2 "..message)
print("4 ".. tostring(notificatonType))
print("5 "..tostring(length))
print("6 "..message)
end
SendNuiMessage(json.encode({
@@ -37,10 +37,14 @@ exports('Notify', Notify)
RegisterNetEvent("ESX:Notify", Notify)
if Debug then
RegisterCommand("notify", function()
RegisterCommand("oldnotify", function()
ESX.ShowNotification('No Waypoint Set.', true, false, 140)
end)
RegisterCommand("notify", function()
ESX.ShowNotification("You Recived ~br~ 1x ball~s~!", "success", 3000)
end)
RegisterCommand("notify1", function()
ESX.ShowNotification("Well ~g~Done~s~!", "success", 3000)
end)
+1 -1
View File
@@ -3,7 +3,7 @@ lua54 'yes'
game 'gta5'
author 'ESX-Framework'
description 'ESX Notification system for esx_legacy'
description 'Official NUI Notification system for ESX'
shared_script '@es_extended/imports.lua'
+1 -1
View File
@@ -16,7 +16,7 @@ const types = {
// the color codes example `i ~r~love~s~ donuts`
const codes = {
"~r~": "red",
"~b~": "blue",
"~b~": "#378cbf",
"~g~": "green",
"~y~": "yellow",
"~p~": "purple",
+12 -2
View File
@@ -1,4 +1,8 @@
<h1 align="center">ESX Notify</h1>
<h1 align='center'>[ESX] Notify</a></h1><p align='center'><b><a href='https://discord.esx-framework.org/'>Discord</a> - <a href='https://esx-framework.org/'>Website</a> - <a href='https://docs.esx-framework.org/legacy/installation'>Documentation</a></b></h5>
A beautiful and simple NUI notification system for ESX
# Example Code
<h3>Change style and time</h3>
@@ -39,4 +43,10 @@ TriggerEvent("ESX:Notify", "info", 3000, "message here")
ESX.ShowNotification("I i ~r~love~s~ donuts", "success", 3000)
```
<img src="https://imgur.com/gsNwFO3.png" alt="image">
# Previews
![Preview_1](https://cdn.discordapp.com/attachments/944789399852417096/997890963445927977/unknown.png)
![Preview_2_zoom](https://cdn.discordapp.com/attachments/944789399852417096/997892214053163148/unknown.png)
![Preview_2](https://cdn.discordapp.com/attachments/944789399852417096/997891726326898909/unknown.png)