2024-04-01 19:19:59 +11:00
|
|
|
local settings = {
|
|
|
|
|
locale = GetResourceKvpString('locale'),
|
2024-04-03 14:58:35 +11:00
|
|
|
notification_audio = GetResourceKvpInt('notification_audio') == 1
|
2024-04-01 19:19:59 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RegisterCommand('ox_lib', function()
|
|
|
|
|
local input = lib.inputDialog('Settings', {
|
|
|
|
|
{
|
|
|
|
|
type = 'select',
|
|
|
|
|
label = locale('ui.settings.locale'),
|
|
|
|
|
searchable = true,
|
|
|
|
|
description = locale('ui.settings.locale_description', settings.locale),
|
|
|
|
|
options = GlobalState['ox_lib:locales'],
|
|
|
|
|
icon = 'book',
|
2024-04-03 14:58:35 +11:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type = 'checkbox',
|
|
|
|
|
label = locale('ui.settings.notification_audio'),
|
|
|
|
|
checked = settings.notification_audio,
|
2024-04-01 19:19:59 +11:00
|
|
|
}
|
|
|
|
|
}) --[[@as any]]
|
|
|
|
|
|
|
|
|
|
if not input then return end
|
|
|
|
|
|
|
|
|
|
if input[1] then lib.setLocale(input[1]) end
|
2024-04-03 14:58:35 +11:00
|
|
|
|
|
|
|
|
if input[2] ~= nil then
|
|
|
|
|
settings.notification_audio = input[2]
|
|
|
|
|
SetResourceKvpInt('notification_audio', input[2] and 1 or 0)
|
|
|
|
|
end
|
2024-04-01 19:19:59 +11:00
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
return settings
|