Configuration

This guide covers all configuration options available in InfinityUI.

⚠️ IMPORTANT THING TO KNOW:

Renaming the resource can cause some parts of the code to break, do not do it !

📄 Configuration File Structure

Your config.lua should look like this:

InfinityUIConfig = {}

-- Audio Settings
-- Enable/Disable all menu sounds
InfinityUIConfig.EnableSounds = false

-- Navigation & Search
-- Text shown in the quick jump dialog
InfinityUIConfig.JumpDialog = {
    Title = "Go to Button",
    Label = "Button number (1 - %d)", -- %d will be replaced by max buttons
    Placeholder = ""
}

-- Text shown in the search dialog
InfinityUIConfig.SearchDialog = {
    Title = "Filter",
    Label = "Search",
    Description = "Enter text to search (leave empty to reset)",
    Placeholder = ""
}

-- Key mapping to jump to button number
-- Default: "RSHIFT" (Right Shift)
InfinityUIConfig.JumpToKey = "RSHIFT"

-- Configure the command 
-- and the text shown in the player mapping settings
InfinityUIConfig.MappingSettings = {
    Command = "infinityui_jump_to",
    Description = "Menu: Jump to a button (Number)"
}

-- Controls
InfinityUIConfig.ControllerSupport = true

-- Performance
InfinityUIConfig.Debug = false

-- Framework Integration
InfinityUIConfig.CoreResource = "core"

-- Custom Functions
function InfinityUIConfig.GetPlayerMenuSide() ... end
function InfinityUIConfig.PlaySound(audioName, audioRef) ... end

🔊 Audio Settings

EnableSounds

Type: boolean Default: false Description: Enable or disable all menu sounds.

circle-info

Players can toggle sounds in-game if you implement a settings menu!


SearchKey

Type: string Default: "RSHIFT" Description: Keyboard key to open the search dialog.

Common Key Codes:

  • RSHIFT - Right Shift

  • LSHIFT - Left Shift

  • RCONTROL / LCONTROL - Control keys

  • F1 through F12 - Function keys

  • TAB - Tab key


JumpToKey

Type: string Default: "RSHIFT" Description: Key to trigger the jump-to-item dialog.

circle-info

Usually set to the same key as SearchKey for consistency.


💬 Dialog Text Configuration

JumpDialog

Type: table Description: Text displayed in the jump-to-item dialog.

Multi-language Example:


SearchDialog

Type: table Description: Text displayed in the search dialog.

Multi-language Example:


MappingSettings

Type: table Description: Command name and description for key mapping.

circle-exclamation

🎮 Control Settings

ControllerSupport

Type: boolean Default: true Description: Enable gamepad/controller support.


⚡ Performance Settings

Debug

Type: boolean Default: false Description: Enable debug mode (shows console messages).

circle-exclamation

🔧 Framework Integration

CoreResource

Type: string Default: "core" Description: Name of your core/framework resource.

This is used by GetPlayerMenuSide() to access exports.


🎯 Custom Functions

GetPlayerMenuSide()

Description: Returns the player's preferred menu side.

Signature:

Return: "left" or "right"

Examples:

ESX Implementation

QBCore Implementation

Database Implementation

Simple Toggle


PlaySound()

Description: Plays a menu sound.

Signature:

Default Implementation:

Custom Implementation (with Volume):


📋 Full Configuration Template

Here's a complete, production-ready configuration template:


🎯 Best Practices

1

Use the config values (don't hardcode)

2

Provide fallback values

3

Test in debug mode during development


🔄 Updating Configuration

1

Restart the resource:

2

Or restart the entire server if using global config.

3

Test in-game to verify changes.


❓ FAQ

chevron-rightQ: Can I change config values at runtime?hashtag

A: Yes! But only for your resource. Changes won't affect other resources using InfinityUI.

chevron-rightQ: Can players customize their own settings?hashtag

A: Yes! Implement a settings menu that modifies InfinityUIConfig values and saves to database/KVP.

chevron-rightQ: Do I need to restart the server after config changes?hashtag

A: Only restart the resource infinityUI and all the resources using it.


circle-check

Last updated