Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed invisible belt icon issue #915

Merged
merged 1 commit into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions server-data/resources/[esx_addons]/pNotify/cl_notify.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
--[[
Complete List of Options:
type
layout
theme
text
timeout
progressBar
closeWith
animation = {
open
close
}
sounds = {
volume
conditions
sources
}
docTitle = {
conditions
}
modal
id
force
queue
killer
container
buttons

More details below or visit the creators website http://ned.im/noty/options.html

Layouts:
top
topLeft
topCenter
topRight
center
centerLeft
centerRight
bottom
bottomLeft
bottomCenter
bottomRight

Types:
alert
success
error
warning
info

Themes: -- You can create more themes inside html/themes.css, use the gta theme as a template.
gta
mint
relax
metroui

Animations:
open:
noty_effects_open
gta_effects_open
gta_effects_open_left
gta_effects_fade_in
close:
noty_effects_close
gta_effects_close
gta_effects_close_left
gta_effects_fade_out

closeWith: -- array, You will probably never use this.
click
button

sounds:
volume: 0.0 - 1.0
conditions: -- array
docVisible
docHidden
sources: -- array of sound files

modal:
true
false

force:
true
false

queue: -- default is global, you can make it what ever you want though.
global

killer: -- will close all visible notifications and show only this one
true
false

visit the creators website http://ned.im/noty/options.html for more information
--]]

function SetQueueMax(queue, max)
local tmp = {
queue = tostring(queue),
max = tonumber(max)
}

SendNUIMessage({maxNotifications = tmp})
end

function SendNotification(options)
options.animation = options.animation or {}
options.sounds = options.sounds or {}
options.docTitle = options.docTitle or {}

local options = {
type = options.type or "success",
layout = options.layout or "topRight",
theme = options.theme or "gta",
text = options.text or "Empty Notification",
timeout = options.timeout or 5000,
progressBar = options.progressBar ~= false and true or false,
closeWith = options.closeWith or {},
animation = {
open = options.animation.open or "gta_effects_open",
close = options.animation.close or "gta_effects_close"
},
sounds = {
volume = options.sounds.volume or 1,
conditions = options.sounds.conditions or {},
sources = options.sounds.sources or {}
},
docTitle = {
conditions = options.docTitle.conditions or {}
},
modal = options.modal or false,
id = options.id or false,
force = options.force or false,
queue = options.queue or "global",
killer = options.killer or false,
container = options.container or false,
buttons = options.button or false
}

SendNUIMessage({options = options})
end

RegisterNetEvent("pNotify:SendNotification")
AddEventHandler("pNotify:SendNotification", function(options)
SendNotification(options)
end)

RegisterNetEvent("pNotify:SetQueueMax")
AddEventHandler("pNotify:SetQueueMax", function(queue, max)
SetQueueMax(queue, max)
end)

--[[RegisterNetEvent("chatMessage")
AddEventHandler("chatMessage", function(author, color, text)
TriggerEvent("pNotify:SendNotification", {text = "<span style='font-weight: 900'>" .. text .. "</span>",
layout = "centerLeft",
timeout = 2000,
progressBar = false,
type = "error",
animation = {
open = "gta_effects_fade_in",
close = "gta_effects_fade_out"
}})
end)]]
19 changes: 19 additions & 0 deletions server-data/resources/[esx_addons]/pNotify/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
fx_version("adamant")
game("gta5")
lua54("yes")
version("1.0.2")

ui_page("html/index.html")

client_script("cl_notify.lua")

files({
"html/index.html",
"html/pNotify.js",
"html/noty.js",
"html/noty.css",
"html/themes.css",
})

export("SetQueueMax")
export("SendNotification")
13 changes: 13 additions & 0 deletions server-data/resources/[esx_addons]/pNotify/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html>
<head>
<meta charset="utf-8" />
<title>pNotify</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>

Check warning

Code scanning / CodeQL

Inclusion of functionality from an untrusted source Medium

Script loaded using unencrypted connection.
Script loaded from content delivery network with no integrity check.
<script src="pNotify.js" type="text/javascript"></script>
<link href="noty.css" rel="stylesheet"></script>
<link href="themes.css" rel="stylesheet"></script>
<script src="noty.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
Loading
Loading