Version Check
Print a startup status box, compare versions and show the operator a changelog and an update link.
Call tlib.versioncheck on the server. Nothing needs declaring.
local current = GetResourceMetadata(GetCurrentResourceName(), 'version', 0)
tlib.versioncheck({
name = 'MyResource',
current = current,
fetch = tlib.versioncheck.github('owner/repository'),
info = {
{ key = 'Status', event = 'myresource:startupStatus', required = true },
},
})Providers
fetch is any function returning { version, changelog, url }, nil on failure, or
{ status = 'Update check not run' } for a check that is deliberately unavailable. An
unavailable check must not return the installed version and claim it is current.
| Provider | Use it for |
|---|---|
tlib.versioncheck.github(repo) | A release published on GitHub. github(nil) makes no request and reports the repository as not configured. |
tlib.versioncheck.studios(product, current) | A TIMMYG Studios catalogue product, through the product changelog API. Eight-second timeout. |
| your own function | Anything else — a private endpoint, a cached result you hold. |
Branding
Generated ASCII art, custom banner art and versioncheck.lean() are available only when
the calling resource's manifest carries an author entry equal to TIMMYG Studios
(case-insensitive, surrounding whitespace ignored). Repeated author metadata and authors
lists are both recognised:
author 'Another contributor'
author 'TIMMYG Studios'The caller's folder name, opts.name and opts.author grant nothing. Other consumers get a
plain-name status box with version, diagnostics and update links.
The rule lives in shared/sh_branding.lua. List it in both shared_scripts and files
in fxmanifest.lua; with only one, one of its callers silently loses the rule.
Display titles
A product's human-visible title is the manifest's own name directive and nothing else:
name 'Tommy\'s ELS' -- shown to people
-- the resource is still tELS everywhere elseThe resource, the folder, the slug, the event prefixes and every ACE object stay tELS.
StudioBranding.displayName(resource) reads the title, falling back to the resource name
when the manifest declares nothing, declares it empty, or the metadata natives cannot
answer.
A display title is never a slug, ACE object, event name, command, statebag or KVP key, filename, cache key, wire field or lookup index. The update check's request URL is keyed on the product slug, which is the technical name.
The banner prints the title as a text line under the wordmark rather than as art, because the figlet font has no glyph for a space or an apostrophe:
_/ _/_/_/_/ _/ _/_/_/
_/_/_/_/ _/ _/ _/
_/ _/_/_/ _/ _/_/
_/ _/ _/ _/
_/_/ _/_/_/_/ _/_/_/_/ _/_/_/
Tommy's ELS
By TIMMYG Studios
Leave name as the technical name and the title line is omitted.
tLib
Still stuck? Support can answer it directly.
Was this page helpful?
TIMMYG Studios