Store

Configuration

All configuration options for legacy-notify

All options are set in config.lua.

General#

OptionTypeDefaultDescription
Config.Versionstring'1.0.0'Resource version (used by the automatic version checker)
Config.Localestring'en'Language file from the locales/ folder
Config.Positionstring'center-right'Default notification position on screen
Config.DefaultDurationnumber5000Default notification duration in milliseconds
Config.MaxVisiblenumber5Maximum number of visible notifications per position
Config.AnimationDurationnumber300Entry/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:

PositionDescription
'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#

OptionTypeDefaultDescription
Config.EnableTestCommandsbooleantrueEnable /testnotify and /testnotifyall commands
Config.TestCommandACEstring/boolean'group.admin'ACE permission required for test commands. false allows everyone
CommandDescription
/testnotify [type]Send a test notification of the specified type (e.g. /testnotify error)
/testnotifyallSend one test notification for every defined type in sequence