Skip to content

Commit 7bcabab

Browse files
committed
docs(vzn-notify)
1 parent 0ce17e8 commit 7bcabab

27 files changed

Lines changed: 221 additions & 1 deletion

pages/_meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"index": "Introduction"
2+
"index": "Introduction",
3+
"vzn-notify": "vzn-notify"
34
}

pages/vzn-notify.mdx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { Steps } from "nextra-theme-docs";
2+
3+
# VZN-NOTIFY
4+
5+
Simple notifications with beutiful UI
6+
7+
Link to PREVIEW
8+
9+
Link to buy
10+
11+
## Installation
12+
13+
<Steps>
14+
### Download the newest version from [Keymaster](https://keymaster.fivem.net/asset-grants)
15+
16+
### Config
17+
18+
Configure it how do you want
19+
20+
```lua
21+
Config = {}
22+
23+
---@type boolean
24+
Config.ignoreDuplicates = true -- if the same notification will be duplicated it won't show
25+
26+
---@type keyof Positions
27+
Config.defaultPosition = Positions['top-right'] -- positions.lua
28+
29+
---@type 1 | 2 | 3 | 4
30+
Config.defaultDesignType = 3 -- design type of notification (next page)
31+
32+
---@type string
33+
Config.defaultTitle = "Notification" -- default title of notification if it's nil
34+
35+
---@type number in miliseconds
36+
Config.defaultDuration = 5000 -- default duration of notification if it's nil
37+
38+
---@type boolean
39+
Config.debug = false -- all notification data will be printed in console
40+
```
41+
42+
</Steps>
43+
44+
## Compatibility
45+
46+
- [esx](https://github.com/esx-framework/esx_core)
47+
- [ox_lib](https://github.com/overextended/ox_lib)
48+
- [qb-core](https://github.com/qbcore-framework/qb-core)
49+
- Or you can integrate this script from everything if you can
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Steps } from "nextra-theme-docs";
2+
3+
# ESX INTEGRATION
4+
5+
To integrate vzn-notify with esx framework do steps below!
6+
7+
<Steps>
8+
### Disable or remove `esx_notify` from your server
9+
After this step the script should automatically works, but if not do next steps!
10+
11+
### Go to es_extended/client/functions.lua
12+
13+
### Find function called `ESX.ShowNotification`
14+
15+
### Replace this function with this code below
16+
17+
```lua
18+
function ESX.ShowNotification(message, notifyType, length)
19+
exports['vzn-scripts']:esxNotification(notifyType, length, message)
20+
end
21+
```
22+
23+
</Steps>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Steps } from "nextra-theme-docs";
2+
3+
# OX_LIB INTEGRATION
4+
5+
To integrate vzn-notify with ox_lib do steps below!
6+
7+
<Steps>
8+
### Go to ox_lib/resource/interface/client/notify.lua
9+
10+
### Find function called `lib.notify`
11+
12+
### Replace this function with this code below
13+
14+
```lua
15+
function lib.notify(data)
16+
local sound = settings.notification_audio and data.sound
17+
data.sound = nil
18+
19+
exports['vzn-notify']:oxLibNotification(data)
20+
21+
if not sound then return end
22+
23+
if sound.bank then lib.requestAudioBank(sound.bank) end
24+
25+
local soundId = GetSoundId()
26+
PlaySoundFrontend(soundId, sound.name, sound.set, true)
27+
ReleaseSoundId(soundId)
28+
29+
if sound.bank then ReleaseNamedScriptAudioBank(sound.bank) end
30+
end
31+
```
32+
33+
</Steps>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Steps } from "nextra-theme-docs";
2+
3+
# QB-CORE INTEGRATION
4+
5+
To integrate vzn-notify with qb-core do steps below!
6+
7+
<Steps>
8+
### Go to qb-core/client/functions.lua
9+
10+
### Find function called `QBCore.Functions.Notify`
11+
12+
### Replace this function with this code below
13+
14+
```lua
15+
function QBCore.Functions.Notify(text, texttype, length, icon)
16+
exports['vzn-notify']:qbCoreNotification(text, texttype, length)
17+
end
18+
```
19+
20+
</Steps>

pages/vzn-notify/api.mdx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# API
2+
3+
### VISIBILITY
4+
5+
To show / hide notifications (for example, some cinematic mode etc) you can use export
6+
7+
```lua
8+
exports['vzn-notify']:setVisible(visible)
9+
```
10+
11+
- visible: `boolean`
12+
- setting will change the visibility of notifications nui
13+
14+
### ADD NOTIFICATION
15+
16+
To add new notification you have to use export
17+
18+
```lua
19+
---@class NotifyData
20+
---@field notifType? "error" | "success" | "primary" | "warning" | "money"
21+
---@field designType? 1 | 2 | 3 | 4
22+
---@field duration? number in miliseconds
23+
---@field title? string
24+
---@field message string
25+
26+
---@type NotifyData
27+
local data = {
28+
notifType = "warning",
29+
title = "Caution",
30+
duration = 3000,
31+
message = "Remember to join our discord and subscribe VZN Scripts on youtube",
32+
}
33+
exports['vzn-notify']:addNotification(data)
34+
```
35+
36+
- data: `NotifyData`
37+
- notifType: `error` | `success` | `primary` | `warning` | `money`
38+
- the color of the notification
39+
- if not setted -> primary
40+
- designType?: `1` | `2` | `3` | `4`
41+
- the design of the notification [Preview](./designs.mdx)
42+
- if not setted -> default from Config
43+
- duration?: number
44+
- time during which the notification will be visible (in miliseconds)
45+
- if not setted -> default from Config
46+
- title?: string
47+
- the title of the notification
48+
- if not setted -> default from Config
49+
- message: string
50+
- message of the notification
51+
- if not setted -> notification will not appear

pages/vzn-notify/designs.mdx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# DESIGNS
2+
3+
In this script you can choose from 4 design types. In script they are represented by numbers from 1 to 4
4+
5+
### 1
6+
7+
With left border and icon
8+
9+
<img src="/static/vzn-notify/design1/error1.png" alt="error1" />
10+
<img src="/static/vzn-notify/design1/warning1.png" alt="warning1" />
11+
<img src="/static/vzn-notify/design1/success1.png" alt="success1" />
12+
<img src="/static/vzn-notify/design1/primary1.png" alt="primary1" />
13+
<img src="/static/vzn-notify/design1/money1.png" alt="money1" />
14+
15+
### 2
16+
17+
With icon and bottom progressbar showing remaining time
18+
19+
<img src="/static/vzn-notify/design2/error2.png" alt="error2" />
20+
<img src="/static/vzn-notify/design2/warning2.png" alt="warning2" />
21+
<img src="/static/vzn-notify/design2/success2.png" alt="success2" />
22+
<img src="/static/vzn-notify/design2/primary2.png" alt="primary2" />
23+
<img src="/static/vzn-notify/design2/money2.png" alt="money2" />
24+
25+
### 3
26+
27+
With left border, icon and circle progressbar showing remaining time
28+
29+
<img src="/static/vzn-notify/design3/error3.png" alt="error3" />
30+
<img src="/static/vzn-notify/design3/warning3.png" alt="warning3" />
31+
<img src="/static/vzn-notify/design3/success3.png" alt="success3" />
32+
<img src="/static/vzn-notify/design3/primary3.png" alt="primary3" />
33+
<img src="/static/vzn-notify/design3/money3.png" alt="money3" />
34+
35+
### 4
36+
37+
With left border and circle progressbar showing remaining time
38+
39+
<img src="/static/vzn-notify/design4/error4.png" alt="error4" />
40+
<img src="/static/vzn-notify/design4/warning4.png" alt="warning4" />
41+
<img src="/static/vzn-notify/design4/success4.png" alt="success4" />
42+
<img src="/static/vzn-notify/design4/primary4.png" alt="primary4" />
43+
<img src="/static/vzn-notify/design4/money4.png" alt="money4" />
16.1 KB
Loading
17.3 KB
Loading
17.4 KB
Loading

0 commit comments

Comments
 (0)