-
Notifications
You must be signed in to change notification settings - Fork 22
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
166 changes: 166 additions & 0 deletions
166
server-data/resources/[esx_addons]/pNotify/cl_notify.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
13
server-data/resources/[esx_addons]/pNotify/html/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
<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> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Inclusion of functionality from an untrusted source Medium