Docs/Yecoyz Tablet

Configuration

Every option in the Yecoyz Tablet config file, and the open hooks.

All options are in config.lua. Texts are in locales/.

Opening

lua
Config.locale = 'en'
Config.item = 'tablet'     -- false: open with the command only
Config.command = 'tablet'  -- false: no command
Config.keybind = ''        -- default key for the command ('' = none)

Device

lua
Config.osName = 'SlateOS'
Config.deviceName = 'Slate'

-- The screen page (16:10). scale renders it sharper (1 - 3; higher costs more GPU memory).
Config.resolution = { width = 1280, height = 800, scale = 2.0 }

-- The camera while the tablet is in use.
Config.view = { fov = 50.0, fill = 0.8, ease = 450 }

Config.clock = 'game'      -- 'game' time or the player's 'real' clock

Built-in apps

lua
Config.apps = {
    store = true,          -- install and remove apps
    notes = true,
    calculator = true,
    settings = true,
}

Config.defaults = {
    wallpaper = 'dunes',   -- dunes, ember, slate, moss, dusk, plain
    brightness = 100,
    lockScreen = true,
    clock24 = true,
}

Config.notes = { max = 100, maxLength = 8000 }

Config.apps also has camera = true and gallery = true.

Camera

lua
Config.camera = {
    width = 1280,      -- width of a photo in pixels (16:10), 640 - 1920
    format = 'webp',   -- 'webp' (smaller files) or 'jpg'
    quality = 0.85,    -- 0.5 - 1.0
    cooldown = 1500,   -- ms between two photos
    zoom = 4.0,        -- how far the scroll wheel zooms in (1 - 8)
    sensitivity = 6.0, -- how fast the mouse turns the camera
    -- How other players see the tablet held up
    animation = { dict = 'amb@world_human_tourist_mobile@female@base', name = 'base', flag = 49, hold = 0.4 },
    hold = vector3(0.035, 0.42, 0.53),
}

The tablet keeps the size it has on screen while in use (Config.view), which also sets how wide a photo is without zoom.

lua
Config.gallery = {
    max = 150,      -- pictures a character can keep
    albums = 30,    -- albums a character can make
    links = true,   -- players may add a picture by its address
    linkHosts = { 'i.imgur.com', 'r2.fivemanage.com', ... }, -- false = any https site
}

Config.media = {
    provider = 'database', -- 'database', 'fivemanage', 'zyke' or 'custom'
    databaseUrl = false,   -- 'database': the address pictures are loaded from, behind a domain or proxy
    folder = 'tablet',     -- 'fivemanage' and 'zyke'
    deleteFiles = false,   -- also delete the file when a picture is removed
}

See Where photos are stored for each provider's setup.

Printing and printed photos

lua
Config.printers = {
    models = { 'prop_printer_01', 'prop_printer_02', 'v_res_printer', 'prop_copier_01' },
    locations = {},   -- { coords = vector3(...), label = 'Front desk printer' }
    range = 6.0,      -- metres from the player to the printer
    time = 3500,      -- ms a print takes
    price = 0,
    account = 'cash',
}

Config.photo = {
    item = 'photo',
    size = vector2(0.20, 0.14), -- the sheet in metres
    viewDistance = 25.0,        -- metres from which other players' photos are drawn
    maxShown = 4,               -- photos drawn at the same time
    -- prop, animation and brightness (day, dusk, night, interior) are in config.lua too
}

App pages from other sites

lua
Config.allowedAppHosts = {}

Apps load pages from their own resource. Add an https host here only if you trust it: an app page can show anything.

Open hooks

open/client.lua and open/server.lua stay readable in the escrowed release.

Hook What it does
OpenClient.CanOpen() Return false and a message to stop the tablet from coming out
OpenClient.HolsterWeapon() Puts the weapon away before the tablet comes out. Tell your inventory here
OpenClient.BlockWeapons(block) Blocks drawing a weapon while the tablet is out
OpenClient.Notify(message, kind) How messages are shown
OpenClient.OnOpened(), OpenClient.OnClosed() Called when the tablet is taken out and put away
OpenServer.CanOpen(source) An extra server check before the tablet opens
OpenServer.LoadProfile(identifier), OpenServer.SaveProfile(identifier, data) Where settings and notes are stored (resource KVP by default)
OpenServer.UploadMedia(source, file), OpenServer.DeleteMedia(reference) Your own photo storage, with Config.media.provider = 'custom'
OpenServer.CanPrint(source, picture, printer) Return false and a message to refuse a print
Stuck on this step?

Open a ticket in the Discord with what you tried and what you see, and I'll help you get it running.

Ask on Discord
Up nextYour own appsPut a page from your own resource on Yecoyz Tablet with the app SDK.