Laptops/tablets
Laptop configuration
This file can be located in peuren_electricianjob/shared/sh_laptops.lua.
Config.LaptopScript = 'default'
--Suported laptop/tablet names:
--[[
default
lb-tablet
fd_laptop
]]On laptop open
This file can be located in peuren_electricianjob/shared/sh_laptops.lua.
Config.LaptopOpened = function()
--Client-side code to run when laptop is opened
endOn laptop close
This file can be located in peuren_electricianjob/shared/sh_laptops.lua.
Config.LaptopClosed = function()
--Client-side code to run when laptop is closed
endAdding new laptop/tablet scripts
This file can be located in peuren_electricianjob/shared/sh_laptops.lua.
CreateThread(function()
local id = GetCurrentResourceName()
local url = GetResourceMetadata(id, "ui_page", 0)
local appLabel = "Tow job"
local appDescription = "This app allows tow truck drivers to monitor and manage tow calls"
if Config.LaptopScript == 'lb-tablet' and not IsDuplicityVersion() then
exports["lb-tablet"]:AddCustomApp({
identifier = id,
name = appLabel,
description = appDescription,
icon = "web/dist/app_logo.webp",
ui = url,
defaultApp = true,
onOpen = function()
Config.LaptopOpened()
end,
onClose = function()
Config.LaptopClosed()
end,
})
elseif Config.LaptopScript == 'fd_laptop' and IsDuplicityVersion() then
local added, errorMessage = exports.fd_laptop:addCustomApp({
id = id,
name = appLabel,
isDefaultApp = true,
icon = ("https://cfx-nui-%s/web/dist/app_logo.webp"):format(id),
ui = ("https://cfx-nui-%s/web/dist/index.html"):format(id),
keepAlive = true,
ignoreInternalLoading = true,
windowActions = {
isResizable = false,
isMaximizable = false,
isClosable = true,
isMinimizable = true,
isDraggable = false
},
windowDefaultStates = {
isMaximized = true,
isMinimized = false
},
})
print(added, errorMessage)
end
end)Last updated