Studios
Storeshouse-3.jpg

Configuration

SoonStoresQbox
PAGE 03 OF 07  ·  INSTALLATION → CONFIGURATION → EXAMPLESdocs.glitchstudios.dev
Browse docs

Everything is in config/main.lua, config/clerks.lua and locales/en.json. These files stay open under escrow, along with shared/main.lua and install/.

Which shops use the screen#

Config.Shops lists the ox_inventory shop types this screen draws. Stock, prices, groups, licences and grades stay in ox_inventory (data/shops.lua, or the resource that calls RegisterShop). Shop types that are not listed keep the normal ox_inventory shop window.

Field What it does
match Shop type name. With pattern = true it is a Lua pattern, for shops registered per player like ^%d*PoliceArmoury$.
icon Tabler icon (ti-*) for the title tab.
label Title shown instead of the ox_inventory shop name.
take Job stock. The pay keys become one Take key, used only when the basket costs $0.
maxPerLine Most of one line per purchase. Falls back to Config.MaxPerLine.
order Category ids to show first, in this order. The rest follow Config.Categories.

The defaults cover the shop types in a stock data/shops.lua: General (shown as 24/7), Liquor, YouTool, Chemist, Ammunation, WeedShop, the three vending machine types, ^%d*PoliceArmoury$ (pattern, take, 250 per line) and AmbulanceArmory (take, shown as EMS Armoury).

Categories#

Config.Categories sets the chips along the top, in order. A shop only shows the categories it has items in, and shows no chips when everything falls in one. Config.ItemCategory maps item names to a category id. Items starting with weapon_ go to weapons and ammo to ammo on their own, and anything unlisted lands in Other. The shipped list uses the item names of the server it was built on, and names your server does not have are ignored.

Tax row#

Prices are treated as already including tax, so the row only shows how much of the total is tax. The defaults are for Australia: 10% and the label "GST included" (ui.tax_included in locales/en.json). stateKey names an optional GlobalState table with a live rate and stateField the field in it. When nothing sets that key, rate is used, so the default key is safe to leave. Set enabled = false to hide the row.

Shop clerks and price surge#

Config.Clerks adds an ox_target option to the clerk models. It opens the nearest targets entry in ox_inventory's data/shops.lua within Range that the player has the groups for. Shops added at run time with RegisterShop have no clerk; open those with the OpenShop export.

While any job in FoodJobs has someone on duty, the Items in the ShopTypes shops cost Mult times as much. The surge is checked each time one of those shops opens. FallbackClerks spawns a local clerk at the listed Ammu-Nation counters when the player is within FallbackRange and GTA has not spawned one there. An empty list turns that off. Enabled = false turns off the clerk targets, the fallback clerks and the surge.

Language#

Player text, including the screen's own text (the ui block), is in locales/en.json. Add another language as locales/<code>.json and set the ox:locale convar.

Configuration reference#

config/main.lua defaults#

Setting Default / editing guidance
Config.ImagePath nil (uses the inventory:imagepath convar, or nui://ox_inventory/web/images)
Config.Currency { symbol = '$', numberLocale = 'en-AU' }
Config.Tax { enabled = true, rate = 10, stateKey = 'glitch-gov:levers', stateField = 'gst' }
Config.IconStylesheet jsDelivr Tabler Icons 3.19.0, or the copy in glitch-uiElements when it is running
Config.NetGuard true (sends nothing unless glitch-poolcleaning is started)
Config.Shops Table; see the field list above.
Config.Categories Table of { id, label, icon }; 14 categories.
Config.ItemCategory Table of item name to category id.
Config.CloseDistance 6.0
Config.BuySlack 4.0
Config.MaxPerLine 50
Config.MaxNonStackPerLine 10

config/clerks.lua defaults#

Setting Default / editing guidance
Config.Clerks.Enabled true
Config.Clerks.Models `mp_m_shopkeep_01`, `s_m_y_ammucity_01`, `s_m_m_ammucountry`
Config.Clerks.Range 6.0
Config.Clerks.TargetDistance 3.0
Config.Clerks.Icon 'fas fa-shopping-basket'
Config.Clerks.FoodJobs { 'burgershot' }
Config.Clerks.Mult 4
Config.Clerks.ShopTypes { 'General' }
Config.Clerks.Items { 'water', 'sprunk', 'coffee', 'sandwich' }
Config.Clerks.FallbackClerks Nine Ammu-Nation counters, each { model, coords = vec4(...) }
Config.Clerks.FallbackRange 40.0