Esc to clear, Enter to open the best match, click an export to open it in its page
Tools

Your page in /w

Add a page of your own to the /w menu, a debug tool switch, or Object Viewer options. They show only to a developer with developer mode on.

A page of your own

Your page is a row at the end of Panels; picked, it shows your rows, and its first row (or Backspace) goes back. whip_core draws the rows and asks for them again after every pick. For levels of your own, return a view with back, and the way back calls your onBack.

The menu only reads rows. Check anything a row does on the server there: exports.whip_core:HasDevTools(source).
RegisterDevPage(id, def)CLIENT#

Adds your page to /w, or replaces yours with this id. Declare it in Whip.register: whip_core forgets every page when it restarts. The page goes when your resource stops, and /w reopens on the page it was shut on with Escape.

FieldTypeDescription
idstringLetters, digits, _ and -; another resource's page with the same id is another page
labelstringThe row in /w and the page's title
descstring|nilThe line under the list while your row is picked
rowsfunctionReturns a list of rows, or { title, back, select, rows } for a level (back names the level above, select the row picked first). Called on open, after every pick, and on RefreshDevPage
onSelectfunction(rowId)A row was picked. It must not wait: start a thread, then call RefreshDevPage
onBackfunction|nilThe way back on a level that returned back
onOpen / onClosefunction|nilThe page came on screen, or left it
Row fieldTypeDescription
idstring|numberWhat onSelect gets. Every row but a note needs one
labelstringThe row's text
kindstring|nil'run' (default), 'toggle' (lit by active), 'open' (a chevron into a level) or 'note' (never picked)
activeboolean|nilA toggle's switch
descstring|nilThe line under the list while the row is picked
closeboolean|nilShut the menu after onSelect, for an action that needs a clear screen
iconstring|nilOne of the prompts' glyphs by name ('target', 'car'...); an unknown name draws nothing
sepstringA group header instead of a row: { sep = 'Playback' }
Returns: true, or false, why (a bad id, no label, no rows or onSelect)
local open, level = false, 'top'

Whip.register(function()
    Whip.core:RegisterDevPage('cafe', {
        label = 'Café',
        rows = function()
            if level == 'menu' then
                return { title = 'Menu', back = 'Café', rows = { { id = 'coffee', label = 'Coffee' } } }
            end
            return { rows = {
                { id = 'open', label = 'Open', kind = 'toggle', active = open },
                { id = 'restock', label = 'Restock', desc = 'Fills every shelf.' },
                { id = 'menu', label = 'Menu', kind = 'open' },
            } }
        end,
        onSelect = function(rowId)
            if rowId == 'open' then open = not open
            elseif rowId == 'menu' then level = 'menu'
            else TriggerServerEvent('mycafe:devAction', rowId) end   -- the server checks HasDevTools
        end,
        onBack = function() level = 'top' end,
    })
end)
RefreshDevPage(id)CLIENT#

Your rows changed without a pick (a list arrived from the server). If your page is on screen, whip_core calls rows again, keeping the same row picked; otherwise it costs nothing.

Returns: true, or false, why (no page of yours has that id)
exports.whip_core:RefreshDevPage('cafe')
RemoveDevPage(id)CLIENT#

Takes your page out of /w while your resource keeps running; it goes by itself when your resource stops.

Returns: true, or false, why (no page of yours has that id)

Debug tools

RegisterDebugTool(id, def)CLIENT#

A switch of your own among /w's debug tools, shown while its Debug row is on, after WHIP's own, by label. Turning it on checks with the server, as any dev tool does; the same id again replaces it. Declare it in Whip.register; it goes when your resource stops.

FieldTypeDescription
labelstringIts row in /w (40 characters at most)
descstring?The line under the list while its row is picked
onTogglefunctiononToggle(on), also with false when Debug or developer mode goes off. Return false to stay off
Returns: true, or false, why
exports.whip_core:RegisterDebugTool('mine', {
    label = 'My Debug', desc = 'What my overlay shows.',
    onToggle = function(on) ShowMyOverlay(on) end,
})
RemoveDebugTool(id)CLIENT#

Takes your debug tool out of /w (it goes by itself when your resource stops). One that's on isn't switched off: that's yours to do.

Returns: true, or false, why (no debug tool of yours has that id)

Object Viewer options

Whip.objectViewerOption(id, def)CLIENT#

Adds or changes an option in the Object Viewer's options, the list G opens on what's picked out (whip_autos' Open Whiplash is one). The id is '<your namespace>.<name>'. From @whip_core/lib/satellite.lua, called at file scope; picked, your select runs in a thread of its own.

FieldTypeDescription
labelstringThe option's line (48 characters at most)
kindsstring[]vehicle, player, npc, object
whipboolean?true: only WHIP's own (a saved car, a player). false: only the game's. Left out: both
groupstring?Its heading (24 characters); default your resource's name
tintstring?blue, teal, green, amber, red, violet or slate (default)
hintstring?The line under the list while it's pointed at (160 characters)
selectfunctionselect(target), with target = { kind, entity, netId, whip, vehicleId, serverId, model, name, coords = { x, y, z, heading } }
Returns: true, or false when it isn't valid (the reason is printed). Whip.removeObjectViewerOption(id) removes one; it goes by itself when your resource stops.
Whip.objectViewerOption('mycafe.refuel', {
    label = 'Fill the tank', group = 'My cafe', tint = 'amber', kinds = { 'vehicle' }, whip = true,
    select = function(target)
        TriggerServerEvent('mycafe:server:refuel', target.vehicleId)   -- the server checks HasDevTools
    end,
})
A Dungeon Master sees it too, in Dungeon Mode. Check anything it asks of your server: HasDevTools(source), or the permission it needs.