Configuration
All configuration options for legacy-notify
All options are set in config.lua.
General#
| Option | Type | Default | Description |
|---|---|---|---|
Config.Version | string | '1.0.0' | Resource version (used by the automatic version checker) |
Config.Locale | string | 'en' | Language file from the locales/ folder |
Config.Position | string | 'center-right' | Default notification position on screen |
Config.DefaultDuration | number | 5000 | Default notification duration in milliseconds |
Config.MaxVisible | number | 5 | Maximum number of visible notifications per position |
Config.AnimationDuration | number | 300 | Entry/exit animation duration in milliseconds |
Info
The UI accent color is now configured globally in legacy-lib. See the Legacy Lib Configuration page.
Position Options#
The Config.Position value controls where notifications appear by default. Valid options:
| Position | Description |
|---|---|
'top-right' | Top-right corner |
'top-left' | Top-left corner |
'top-center' | Top center |
'bottom-right' | Bottom-right corner |
'bottom-left' | Bottom-left corner |
'bottom-center' | Bottom center |
'center-right' | Center-right side |
'center-left' | Center-left side |
Individual notifications can override this default by passing a position parameter.
Notification Types#
The Config.Types table defines the available notification types. Each type has a label, color, and FontAwesome 6 icon class.
Config.Types = {
primary = {
label = 'Primary',
color = '#4ADE80',
icon = 'fa-solid fa-circle-info',
},
success = {
label = 'Success',
color = '#22C55E',
icon = 'fa-solid fa-circle-check',
},
error = {
label = 'Error',
color = '#EF4444',
icon = 'fa-solid fa-circle-xmark',
},
warning = {
label = 'Warning',
color = '#F59E0B',
icon = 'fa-solid fa-triangle-exclamation',
},
info = {
label = 'Info',
color = '#3B82F6',
icon = 'fa-solid fa-circle-info',
},
}
Adding Custom Types#
Add new entries to Config.Types with a unique key:
Config.Types = {
-- ... existing types ...
police = {
label = 'Police',
color = '#3B82F6',
icon = 'fa-solid fa-shield-halved',
},
mechanic = {
label = 'Mechanic',
color = '#F97316',
icon = 'fa-solid fa-wrench',
},
}
Then use the key as the type parameter when sending notifications:
exports['legacy-notify']:SendNotify({
type = 'police',
title = 'Dispatch',
message = '10-80 in progress on Route 68',
})
Test Commands#
| Option | Type | Default | Description |
|---|---|---|---|
Config.EnableTestCommands | boolean | true | Enable /testnotify and /testnotifyall commands |
Config.TestCommandACE | string/boolean | 'group.admin' | ACE permission required for test commands. false allows everyone |
| Command | Description |
|---|---|
/testnotify [type] | Send a test notification of the specified type (e.g. /testnotify error) |
/testnotifyall | Send one test notification for every defined type in sequence |