Lumina Portal

Free to read, no accountVersion 2.1.1

API

Exports and the event a script uses to plug into the core as a module.

Exports

ExportSidePurpose
RegisterModule(data)ServerRegister a script as a module
SetModuleEnabled(enabled)ServerSet the tile status to active or disabled (boolean)
HasModuleAccess(source)ServerChecks access to the calling module (hub admin, group or licence)
OpenHub()ClientBack to the hub

Registering a module

A module registers at start and again whenever lumina_core restarts. lumina_core belongs in the module's dependencies.

server/module.lua
local function registerModule()
    exports.lumina_core:RegisterModule({
        label = 'My module',
        description = 'Short description for the tile.',
        icon = 'mail',
        image = 'web/dist/module.webp' -- optional, 16:9, listed under files in the manifest
    })

    exports.lumina_core:SetModuleEnabled(true)
end

registerModule()

AddEventHandler('onResourceStart', function(resource)
    if resource == 'lumina_core' then
        registerModule()
    end
end)

-- Triggered by the core when someone clicks the tile
AddEventHandler(('%s:server:openAdmin'):format(GetCurrentResourceName()), function(source)
    if not exports.lumina_core:HasModuleAccess(source) then
        return
    end

    -- Open the admin interface
end)

Fields of RegisterModule

FieldRequiredRule
labelyes1–48 characters
descriptionyes1–160 characters
iconyesgrid, car, home, mail, chart, vote, shield, box, user, tool, bell, file, map, sliders
imagenoRelative path to a .webp file

The core reads the version from the module's fxmanifest.lua; it must have the form X.Y.Z. Invalid values raise an error.

Check HasModuleAccess on the server for every admin action, not only when opening.