JixelPatterns
  • JixelPatterns Documentation
  • Troubleshooting
    • Common Issues
    • Setting Up Locations
    • FAQ
  • Dependency
    • Jim_Bridge
      • Animal Ped Support
      • Script Helpers
      • Loader Functions
      • Callbacks
      • Cameras
      • Context Menus
      • Crafting
      • DrawText
      • Dui Functions
      • Input Creator
      • Inventories
      • Job Functions
      • Make Functions
      • Meta Handlers
      • Notifications
      • Phones
      • Player Functions
      • Poly Zones
      • Progress Bars
      • Scale Entity
      • Shops
      • Skillcheck
      • Society Banking
      • Stash Control
      • Targets
      • Vehicles
      • Wrapper Functions
      • Scaleforms
  • Paid Assets
    • Jim-Mechanic
      • Common Issues
      • Installation
      • Locations
        • Creating a Location
      • Nitrous
      • Harness + Seatbelt
      • Emergency Repair Bench
      • Odometer
      • Speedometer
      • Performance Mods
      • Preview System
      • Repair System
      • Car Lifts
      • Plate Change
      • Push Vehicle
      • Stancer Kit
      • Vehicle Seat Picker
    • Jim-Bakery
      • Installation
    • Jim-BeanMachine
      • Installation
    • Jim-BurgerShot
      • Installation
    • Jim-CatCafe
      • Installation
    • Jim-Henhouse
      • Installation
    • Jim-PizzaThis
      • Installation
    • Jim-Popsdiner
      • Installation
  • Free Assets
    • Jim-Mining
      • Installation
      • How To Use
        • Mining
        • Stone Washing
        • Gold Panning
    • Jim-Recycle
      • Installation
      • How To Use
        • Recycling
        • Dumpster Diving
        • Scrapping
    • Jim-Payments
      • Installation
      • How To Use
    • Jim-Shops
      • Installation
      • How To Use
    • Jim-Boarding
      • Installation
      • How To Use
    • Jim-Trains
      • Installation
      • How To Use
    • Jim-Consumbles
      • Installation
      • How To Use
    • Jim-DJBooth
      • Installation
      • How To Use
    • Jim-JobGarage
      • Installation
      • How To Use
    • Jim-Chairs
      • Installation
    • Jim-Notepad
      • Installation
      • How To Use
Powered by GitBook
On this page
  • contextmenus.lua
  • openMenu(Menu, data)
  • isOx()
  • isWarMenuOpen()
  1. Dependency
  2. Jim_Bridge

Context Menus

contextmenus.lua

These functions provide a unified way to interact with different context menu systems, such as OX and WarMenu, depending on what's available on the server.

openMenu(Menu, data)

Opens a context menu using the preferred menu system.

Automatically selects between supported systems like OX or WarMenu based on availability.

The Menu parameter should be a list of menu entries, and the data parameter can be used to set headers, subtexts, and actions like onBack, onExit, and canClose.

Example:

openMenu({
    { header = "Option 1", txt = "Description 1", onSelect = function() print("Option 1 selected") end },
    { header = "Option 2", txt = "Description 2", onSelect = function() print("Option 2 selected") end },
}, {
    header = "Main Menu",
    headertxt = "Select an option",
    onBack = function() print("Return selected") end,
    onExit = function() print("Menu closed") end,
    canClose = true,
})

isOx()

Checks whether the OX context menu system is available on the server.

Allows to do specific things if ox_lib menu is in use

Example:

if isOx() then
    print("OX Context Menu is available")
end

isWarMenuOpen()

Returns whether WarMenu is currently open.

Useful to prevent opening a new menu if one is already active.

Example:

if not isWarMenuOpen() then
    openMenu("main_menu", menuData)
end

Returns whether the WarMenu is currently open.

PreviousCamerasNextCrafting

Last updated 4 days ago